From 6b38faf84e7c496a4995cae237bf753c23f2429c Mon Sep 17 00:00:00 2001
From: James Cole
Date: Tue, 6 Feb 2018 07:51:28 +0100
Subject: [PATCH] Expand views for bills.
---
resources/assets/js/app.js | 31 +++-
.../assets/js/components/bills/Index.vue | 135 ++++++++++++++++++
resources/views/bills/index.twig | 7 +
resources/views/javascript/variables.twig | 6 +
4 files changed, 178 insertions(+), 1 deletion(-)
create mode 100644 resources/assets/js/components/bills/Index.vue
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 @@
+
+
+
+
+
+
+ | |
+ name |
+ Matches on |
+ Amount |
+ Current period |
+ Next expected match |
+ Active |
+ Auto match |
+ Repeat freq |
+
+
+
+
+ |
+
+ |
+
+ {{ bill.attributes.name }}
+
+ |
+
+ {{ word }}
+ |
+
+
+ |
+
+
+ |
+
+ Not expected this period.
+ |
+
+ {{ bill.attributes.next_expected_match|formatDate }}
+ |
+
+ not or not yet.
+ |
+
+ {{ bill.attributes.next_expected_match|formatDate }}
+ |
+
+ {{ date|formatDate }}
+ |
+
+ {{ bill.attributes.next_expected_match|formatDate }}
+ |
+
+ ~
+ |
+
+ ~
+ |
+
+
+
+ |
+
+
+
+ |
+
+ {{ bill.attributes.repeat_freq }}
+ Skips over {{ bill.attributes.skip }}
+ |
+
+
+
+
+
+
+
+
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 @@
+
+
+
{% include 'list/bills' %}