Explorar o código

[FIX] information in summary display

Gogs %!s(int64=7) %!d(string=hai) anos
pai
achega
c780caec47
Modificáronse 1 ficheiros con 11 adicións e 5 borrados
  1. 11 5
      src/components/SummaryDisplay.vue

+ 11 - 5
src/components/SummaryDisplay.vue

@@ -2,7 +2,7 @@
     .summary
         .ticket-summary
             .ticket-summary-header
-                h3 {{ company.name }}
+                h3 {{ getCompanyName() }}
 
                 table
                     tbody
@@ -24,8 +24,11 @@
                 table
                     tbody
                         tr
-                            td Cliente
-                            td {{ getCustomer().name }}
+                            td Total:
+                            td {{ getTotal() }}
+                        tr
+                            td Cliente:
+                            td {{ getCustomerName() }}
 </template>
 
 <script>
@@ -40,11 +43,14 @@
             hasSelectedCustomer: 'hasSelectedCustomer'
         }),
         methods: {
+            getCompanyName() {
+                return !!this.company ? this.company.name : ''
+            },
             getTotal() {
                 return accounting.formatMoney(this.total, '₲', 0, '.', ',')
             },
-            getCustomer() {
-                return this.hasSelectedCustomer ? this.customer : {}
+            getCustomerName() {
+                return this.hasSelectedCustomer ? this.customer.name : ''
             }
         }