Browse Source

[FIX] handle null customer value on pos summary display

Gogs 7 years ago
parent
commit
8fea638c25
1 changed files with 6 additions and 2 deletions
  1. 6 2
      src/components/SummaryDisplay.vue

+ 6 - 2
src/components/SummaryDisplay.vue

@@ -1,7 +1,7 @@
 <template lang="pug">
     .summary
         h2 {{ getTotal() }}
-        h3 {{ customer.name }}
+        //- h3 {{ customer.name }}
 </template>
 
 <script>
@@ -10,11 +10,15 @@
     export default {
         computed: mapGetters({
             total: 'getTotal',
-            customer: 'getSelectedCustomer'
+            customer: 'getSelectedCustomer',
+            hasSelectedCustomer: 'hasSelectedCustomer'
         }),
         methods: {
             getTotal() {
                 return accounting.formatMoney(this.total, '₲', 0, '.', ',')
+            },
+            getCustomer() {
+                return this.hasSelectedCustomer ? this.customer : {}
             }
         }