diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js index e8ba0e9e4b..24a9117ce9 100644 --- a/resources/assets/js/app.js +++ b/resources/assets/js/app.js @@ -6,9 +6,36 @@ */ require('./bootstrap'); - window.Vue = require('vue'); + +import moment from 'moment'; +import accounting from 'accounting'; + +Vue.filter('formatDate', function(value) { + + if (value) { + moment.locale(window.language); + return moment(String(value)).format(window.month_and_day_js); + } +}); + +Vue.filter('formatAmount', function(value) { + if (value) { + value = parseFloat(value); + var parsed = accounting.formatMoney(value, window.currencySymbol, window.frac_digits,window.mon_thousands_sep,window.mon_decimal_point,accountingConfig); + if(value < 0) { + return '' + parsed + ''; + } + if(value > 0) { + return '' + parsed + ''; + } + return '' + parsed + ''; + } +}); + + + /** * Next, we will create a fresh Vue application instance and attach it to * the page. Then, you may begin adding components to this application @@ -17,6 +44,8 @@ window.Vue = require('vue'); Vue.component('example-component', require('./components/ExampleComponent.vue')); +Vue.component('bills-index', require('./components/bills/Index.vue')); + Vue.component( 'passport-clients', require('./components/passport/Clients.vue') diff --git a/resources/assets/js/components/bills/Index.vue b/resources/assets/js/components/bills/Index.vue new file mode 100644 index 0000000000..e5c54976d6 --- /dev/null +++ b/resources/assets/js/components/bills/Index.vue @@ -0,0 +1,135 @@ + + + + diff --git a/resources/views/bills/index.twig b/resources/views/bills/index.twig index 1fa5e633a7..40b5e5c5ea 100644 --- a/resources/views/bills/index.twig +++ b/resources/views/bills/index.twig @@ -26,6 +26,9 @@
{{ 'create_new_bill'|_ }}
+ + +


{% include 'list/bills' %}