geer-builder 1.2.505 → 1.2.515

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -68,8 +68,8 @@ export default
68
68
  {
69
69
  month_picker: false,
70
70
  link: '',
71
- report_options: ['Completed Transaction', 'Pending Transaction','For Pick Up Transaction', 'Voided Transaction'],
72
- report_type: 'Completed Transaction',
71
+ report_options: ['All Transactions','Completed Transactions', 'Pending Transactions','For Pick Up Transactions', 'Voided Transactions'],
72
+ report_type: 'All Transactions',
73
73
  filter: {
74
74
  from: '',
75
75
  to: '',
@@ -78,6 +78,9 @@ export default
78
78
  month_pick: '',
79
79
  public_settings: {},
80
80
  db_sale: new DB_SALE(),
81
+ payment_method:[],
82
+ filtered_cashier_method:[],
83
+ header:["Sale No.", "Customer Slot","Customer Name", "Customer Email", "Stockist", "Sub Total", "Discount", "Grand Total","Transction Date", "Claim Code", "Remarks","Status"],
81
84
  }),
82
85
  async mounted()
83
86
  {
@@ -85,9 +88,19 @@ export default
85
88
  this.filter.from = moment().format('YYYY/MM/DD');
86
89
  this.filter.to = moment().format('YYYY/MM/DD');
87
90
  this.public_settings = await this.$_getData('public_settings');
91
+ await this.getPaymentMethod();
88
92
  },
89
93
  methods:
90
94
  {
95
+ async getPaymentMethod()
96
+ {
97
+ this.payment_method = await this.$_getData('cashier_payment_methods');
98
+
99
+ this.payment_method.forEach(element => {
100
+ this.header.splice(5, 0, element.method_name);
101
+ });
102
+ console.log(this.header);
103
+ },
91
104
  async generateReport()
92
105
  {
93
106
  let fields = {
@@ -98,14 +111,138 @@ export default
98
111
  this.$q.loading.show({
99
112
  message: 'Generating Reports'
100
113
  });
114
+ if(fields.report_type == "All Transactions")
115
+ {
116
+ let date_now = moment(new Date()).tz('Africa/Accra').format('MMMM Do YYYY, h:mm:ss a');
117
+ let sale = await this.db_sale.getAllSale(this.user_info.branch_slot,this.filter.from, this.filter.to);
118
+ let sale_data = [];
119
+ let total_sale = 0;
120
+
121
+ sale.forEach(element => {
122
+
123
+
124
+ let sale_details ={};
125
+ sale_details.sale_id = element.sale_id;
126
+ sale_details.customer_slot = element.slot_reference;
127
+ sale_details.customer_name = element.customer.name;
128
+ sale_details.customer_email = element.customer.email;
129
+ sale_details.stockist = element.stockist;
130
+ sale_details.mtn_mobile_money = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
131
+ sale_details.payout_for_product_purchase = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
132
+ sale_details.bank_deposit = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
133
+ sale_details.cash = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
134
+ element.payment.forEach(pay =>
135
+ {
136
+ if(pay.payment_type.method_key == 'mtn_mobile_money')
137
+ {
138
+ sale_details.mtn_mobile_money = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
139
+ }
140
+ if(pay.payment_type.method_key == 'payout_for_product_purchase')
141
+ {
142
+ sale_details.payout_for_product_purchase = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
143
+ }
144
+ if(pay.payment_type.method_key == 'bank_deposit')
145
+ {
146
+ sale_details.bank_deposit = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
147
+ }
148
+ if(pay.payment_type.method_key == 'cash')
149
+ {
150
+ sale_details.cash = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
151
+ }
152
+ });
153
+ sale_details.sub_total = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.sub_total : '' +element.sub_total;
154
+ sale_details.discount = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.discount : '' +element.discount;
155
+ sale_details.grand_total = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.grand_total : '' +element.grand_total;
156
+ sale_details.date = formatDateCashier(element.created_date, 'MMMM Do YYYY, h:mm:ss a');
157
+ sale_details.claim_code = element.claim_code;
158
+ sale_details.memo = element.memo;
159
+ sale_details.status = element.status;
160
+ total_sale = total_sale + element.grand_total;
161
+ sale_data.push(sale_details);
162
+ });
163
+
164
+ let createXLSLFormatObj = [];
165
+ /* XLS Head Columns */
166
+ let xlsHeader = this.header;
167
+
168
+ createXLSLFormatObj.push(xlsHeader);
169
+
170
+ $.each(sale_data, function(index, value) {
171
+ let innerRowData = [];
172
+ $("tbody").append('<tr><td>' + value.sale_id +
173
+ '</td><td>' + value.customer_slot +
174
+ '</td><td>' + value.customer_name +
175
+ '</td><td>' + value.customer_email +
176
+ '</td><td>' + value.stockist +
177
+ '</td><td>' + value.sub_total +
178
+ '</td><td>' + value.discount +
179
+ '</td><td>' + value.grand_total +
180
+ '</td><td>' + value.created_date +
181
+ '</td><td>' + value.claim_code +
182
+ '</td><td>' + value.memo +
183
+ '</td><td>' + value.status +
184
+ '</td></tr>');
185
+ $.each(value, function(ind, val) {
186
+ innerRowData.push(val);
187
+ });
188
+ createXLSLFormatObj.push(innerRowData);
189
+ });
190
+
191
+ let space = [''];
192
+ createXLSLFormatObj.push(space);
193
+
194
+ let currency = this.public_settings.cashier_currency ? this.public_settings.cashier_currency : '';
195
+ let total = ['Total Sale: ' +currency+ ' '+ total_sale]
196
+ createXLSLFormatObj.push(total);
197
+ // footer
198
+ let footer = ['DATE GENERATED: ' + date_now];
199
+ createXLSLFormatObj.push(footer);
101
200
 
102
- if(fields.report_type == "Completed Transaction")
201
+ /* File Name */
202
+ let filename = fields.report_type +".xlsx";
203
+
204
+ /* Sheet Name */
205
+ // let ws_name = "Completed Transaction "+ this.filter.from +' - '+ this.filter.to;
206
+ let ws_name = "All Transaction ";
207
+
208
+
209
+ // if (typeof console !== 'undefined') console.log(new Date());
210
+ let wb = XLSX.utils.book_new(),
211
+ ws = XLSX.utils.aoa_to_sheet(createXLSLFormatObj);
212
+
213
+ //set colum witdh
214
+ let wscols = [
215
+ {wch:10},
216
+ {wch:15},
217
+ {wch:25},
218
+ {wch:25},
219
+ {wch:15},
220
+ {wch:10},
221
+ {wch:10},
222
+ {wch:10},
223
+ {wch:10},
224
+ {wch:10},
225
+ {wch:10},
226
+ {wch:10},
227
+ {wch:25},
228
+ {wch:10},
229
+ {wch:30},
230
+ {wch:10},
231
+ ];
232
+ ws['!cols'] = wscols;
233
+
234
+ /* Add worksheet to workbook */
235
+ XLSX.utils.book_append_sheet(wb, ws, ws_name);
236
+
237
+ /* Write workbook and Download */
238
+ XLSX.writeFile(wb, filename);
239
+ }
240
+ else if(fields.report_type == "Completed Transactions")
103
241
  {
104
242
  let date_now = moment(new Date()).tz('Africa/Accra').format('MMMM Do YYYY, h:mm:ss a');
105
243
  let sale = await this.db_sale.getCompletedSale(this.user_info.branch_slot,this.filter.from, this.filter.to);
106
244
  let sale_data = [];
107
245
  let total_sale = 0;
108
- let header = ["Sale No.", "Customer Slot","Customer Name", "Customer Email", "Stockist", "Sub Total", "Discount", "Grand Total","Transction Date", "Claim Code", "Remarks","Status"];
109
246
 
110
247
  sale.forEach(element => {
111
248
  let sale_details ={};
@@ -114,6 +251,29 @@ export default
114
251
  sale_details.customer_name = element.customer.name;
115
252
  sale_details.customer_email = element.customer.email;
116
253
  sale_details.stockist = element.stockist;
254
+ sale_details.mtn_mobile_money = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
255
+ sale_details.payout_for_product_purchase = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
256
+ sale_details.bank_deposit = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
257
+ sale_details.cash = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
258
+ element.payment.forEach(pay =>
259
+ {
260
+ if(pay.payment_type.method_key == 'mtn_mobile_money')
261
+ {
262
+ sale_details.mtn_mobile_money = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
263
+ }
264
+ if(pay.payment_type.method_key == 'payout_for_product_purchase')
265
+ {
266
+ sale_details.payout_for_product_purchase = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
267
+ }
268
+ if(pay.payment_type.method_key == 'bank_deposit')
269
+ {
270
+ sale_details.bank_deposit = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
271
+ }
272
+ if(pay.payment_type.method_key == 'cash')
273
+ {
274
+ sale_details.cash = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
275
+ }
276
+ });
117
277
  sale_details.sub_total = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.sub_total : '' +element.sub_total;
118
278
  sale_details.discount = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.discount : '' +element.discount;
119
279
  sale_details.grand_total = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.grand_total : '' +element.grand_total;
@@ -127,7 +287,7 @@ export default
127
287
 
128
288
  let createXLSLFormatObj = [];
129
289
  /* XLS Head Columns */
130
- let xlsHeader = header;
290
+ let xlsHeader = this.header;
131
291
 
132
292
  createXLSLFormatObj.push(xlsHeader);
133
293
 
@@ -184,6 +344,10 @@ export default
184
344
  {wch:10},
185
345
  {wch:10},
186
346
  {wch:10},
347
+ {wch:10},
348
+ {wch:10},
349
+ {wch:10},
350
+ {wch:10},
187
351
  {wch:25},
188
352
  {wch:10},
189
353
  {wch:30},
@@ -197,7 +361,7 @@ export default
197
361
  /* Write workbook and Download */
198
362
  XLSX.writeFile(wb, filename);
199
363
  }
200
- else if(fields.report_type == "Pending Transaction")
364
+ else if(fields.report_type == "Pending Transactions")
201
365
  {
202
366
  console.log('Print Pending');
203
367
 
@@ -205,7 +369,6 @@ export default
205
369
  let sale = await this.db_sale.getPendingSale(this.user_info.branch_slot,this.filter.from, this.filter.to);
206
370
  let sale_data = [];
207
371
  let total_sale = 0;
208
- let header = ["Sale No.", "Customer Slot", "Customer Name","Customer Name", "Customer Email", "Stockist", "Sub Total", "Discount", "Grand Total","Transction Date", "Claim Code", "Remarks","Status"];
209
372
 
210
373
  sale.forEach(element => {
211
374
  let sale_details ={};
@@ -214,6 +377,29 @@ export default
214
377
  sale_details.customer_name = element.customer.name;
215
378
  sale_details.customer_email = element.customer.email;
216
379
  sale_details.stockist = element.stockist;
380
+ sale_details.mtn_mobile_money = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
381
+ sale_details.payout_for_product_purchase = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
382
+ sale_details.bank_deposit = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
383
+ sale_details.cash = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
384
+ element.payment.forEach(pay =>
385
+ {
386
+ if(pay.payment_type.method_key == 'mtn_mobile_money')
387
+ {
388
+ sale_details.mtn_mobile_money = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
389
+ }
390
+ if(pay.payment_type.method_key == 'payout_for_product_purchase')
391
+ {
392
+ sale_details.payout_for_product_purchase = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
393
+ }
394
+ if(pay.payment_type.method_key == 'bank_deposit')
395
+ {
396
+ sale_details.bank_deposit = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
397
+ }
398
+ if(pay.payment_type.method_key == 'cash')
399
+ {
400
+ sale_details.cash = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
401
+ }
402
+ });
217
403
  sale_details.sub_total = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.sub_total : '' +element.sub_total;
218
404
  sale_details.discount = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.discount : '' +element.discount;
219
405
  sale_details.grand_total = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.grand_total : '' +element.grand_total;
@@ -227,7 +413,7 @@ export default
227
413
 
228
414
  let createXLSLFormatObj = [];
229
415
  /* XLS Head Columns */
230
- let xlsHeader = header;
416
+ let xlsHeader = this.header;
231
417
 
232
418
  createXLSLFormatObj.push(xlsHeader);
233
419
 
@@ -284,6 +470,10 @@ export default
284
470
  {wch:10},
285
471
  {wch:10},
286
472
  {wch:10},
473
+ {wch:10},
474
+ {wch:10},
475
+ {wch:10},
476
+ {wch:10},
287
477
  {wch:25},
288
478
  {wch:10},
289
479
  {wch:30},
@@ -297,7 +487,7 @@ export default
297
487
  /* Write workbook and Download */
298
488
  XLSX.writeFile(wb, filename);
299
489
  }
300
- else if(fields.report_type == "For Pick Up Transaction")
490
+ else if(fields.report_type == "For Pick Up Transactions")
301
491
  {
302
492
  console.log('Print for pick up');
303
493
 
@@ -305,7 +495,6 @@ export default
305
495
  let sale = await this.db_sale.getForPickUpSale(this.user_info.branch_slot,this.filter.from, this.filter.to);
306
496
  let sale_data = [];
307
497
  let total_sale = 0;
308
- let header = ["Sale No.", "Customer Slot", "Customer Name", "Customer Email", "Stockist", "Sub Total", "Discount", "Grand Total","Transction Date", "Claim Code", "Remarks","Status"];
309
498
 
310
499
  sale.forEach(element => {
311
500
  let sale_details ={};
@@ -314,6 +503,29 @@ export default
314
503
  sale_details.customer_name = element.customer.name;
315
504
  sale_details.customer_email = element.customer.email;
316
505
  sale_details.stockist = element.stockist;
506
+ sale_details.mtn_mobile_money = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
507
+ sale_details.payout_for_product_purchase = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
508
+ sale_details.bank_deposit = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
509
+ sale_details.cash = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
510
+ element.payment.forEach(pay =>
511
+ {
512
+ if(pay.payment_type.method_key == 'mtn_mobile_money')
513
+ {
514
+ sale_details.mtn_mobile_money = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
515
+ }
516
+ if(pay.payment_type.method_key == 'payout_for_product_purchase')
517
+ {
518
+ sale_details.payout_for_product_purchase = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
519
+ }
520
+ if(pay.payment_type.method_key == 'bank_deposit')
521
+ {
522
+ sale_details.bank_deposit = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
523
+ }
524
+ if(pay.payment_type.method_key == 'cash')
525
+ {
526
+ sale_details.cash = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
527
+ }
528
+ });
317
529
  sale_details.sub_total = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.sub_total : '' +element.sub_total;
318
530
  sale_details.discount = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.discount : '' +element.discount;
319
531
  sale_details.grand_total = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.grand_total : '' +element.grand_total;
@@ -327,7 +539,7 @@ export default
327
539
 
328
540
  let createXLSLFormatObj = [];
329
541
  /* XLS Head Columns */
330
- let xlsHeader = header;
542
+ let xlsHeader = this.header;
331
543
 
332
544
  createXLSLFormatObj.push(xlsHeader);
333
545
 
@@ -384,6 +596,10 @@ export default
384
596
  {wch:10},
385
597
  {wch:10},
386
598
  {wch:10},
599
+ {wch:10},
600
+ {wch:10},
601
+ {wch:10},
602
+ {wch:10},
387
603
  {wch:25},
388
604
  {wch:10},
389
605
  {wch:30},
@@ -398,7 +614,7 @@ export default
398
614
  XLSX.writeFile(wb, filename);
399
615
 
400
616
  }
401
- else if(fields.report_type == "Voided Transaction")
617
+ else if(fields.report_type == "Voided Transactions")
402
618
  {
403
619
  console.log('Print voided');
404
620
 
@@ -406,8 +622,6 @@ export default
406
622
  let sale = await this.db_sale.getVoidedSale(this.user_info.branch_slot,this.filter.from, this.filter.to);
407
623
  let sale_data = [];
408
624
  let total_sale = 0;
409
- let header = ["Sale No.", "Customer Slot", "Customer Name", "Customer Email", "Stockist", "Sub Total", "Discount", "Grand Total","Transction Date", "Claim Code", "Remarks","Status"];
410
-
411
625
  sale.forEach(element => {
412
626
  let sale_details ={};
413
627
  sale_details.sale_id = element.sale_id;
@@ -415,6 +629,29 @@ export default
415
629
  sale_details.customer_name = element.customer.name;
416
630
  sale_details.customer_email = element.customer.email;
417
631
  sale_details.stockist = element.stockist;
632
+ sale_details.mtn_mobile_money = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
633
+ sale_details.payout_for_product_purchase = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
634
+ sale_details.bank_deposit = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
635
+ sale_details.cash = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+0 : '' +0;
636
+ element.payment.forEach(pay =>
637
+ {
638
+ if(pay.payment_type.method_key == 'mtn_mobile_money')
639
+ {
640
+ sale_details.mtn_mobile_money = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
641
+ }
642
+ if(pay.payment_type.method_key == 'payout_for_product_purchase')
643
+ {
644
+ sale_details.payout_for_product_purchase = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
645
+ }
646
+ if(pay.payment_type.method_key == 'bank_deposit')
647
+ {
648
+ sale_details.bank_deposit = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
649
+ }
650
+ if(pay.payment_type.method_key == 'cash')
651
+ {
652
+ sale_details.cash = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+pay.payment_amount : '' +pay.payment_amount;
653
+ }
654
+ });
418
655
  sale_details.sub_total = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.sub_total : '' +element.sub_total;
419
656
  sale_details.discount = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.discount : '' +element.discount;
420
657
  sale_details.grand_total = this.public_settings.cashier_currency ? this.public_settings.cashier_currency+element.grand_total : '' +element.grand_total;
@@ -428,7 +665,7 @@ export default
428
665
 
429
666
  let createXLSLFormatObj = [];
430
667
  /* XLS Head Columns */
431
- let xlsHeader = header;
668
+ let xlsHeader = this.header;
432
669
 
433
670
  createXLSLFormatObj.push(xlsHeader);
434
671
 
@@ -485,6 +722,10 @@ export default
485
722
  {wch:10},
486
723
  {wch:10},
487
724
  {wch:10},
725
+ {wch:10},
726
+ {wch:10},
727
+ {wch:10},
728
+ {wch:10},
488
729
  {wch:25},
489
730
  {wch:10},
490
731
  {wch:30},
package/GCheckout.vue CHANGED
@@ -91,6 +91,11 @@
91
91
  <q-radio dense v-model="online_payment_choice" :val="onlines" :label="onlines.online_payment_label" />
92
92
  </div>
93
93
  </div>
94
+ <div class="manual-pay-method" v-if="payment_method.payment_method_id == 'dragon_pay'" >
95
+ <div v-for="(onlines, ind) in available_payment_channel" class="dragon-pay-list" :key="ind">
96
+ <q-radio dense v-model="dragon_pay_choice" :val="onlines" :label="onlines.shortName" />
97
+ </div>
98
+ </div>
94
99
  </div>
95
100
  <div class="grid-right">
96
101
  <div class="shipping-address">
@@ -171,7 +176,7 @@
171
176
  <add-new-address-form @done="updateAddress"></add-new-address-form>
172
177
  </q-dialog>
173
178
  <q-dialog persistent v-model="is_dialog_confirm_open">
174
- <process-checkout-confirm-dialog @closePopup="confirmedCheckout" :checkout_details="checkout_info" :sale_id="sale_id.data"></process-checkout-confirm-dialog>
179
+ <process-checkout-confirm-dialog @closePopup="confirmedCheckout" :checkout_details="checkout_info" :sale_id="sale_id.data" :proc_id="dragon_pay_choice"></process-checkout-confirm-dialog>
175
180
  </q-dialog>
176
181
  </div>
177
182
  </div>
@@ -311,7 +316,7 @@
311
316
  <add-new-address-form @done="updateAddress"></add-new-address-form>
312
317
  </q-dialog>
313
318
  <q-dialog persistent v-model="is_dialog_confirm_open" :maximized="true">
314
- <process-checkout-confirm-dialog @closePopup="confirmedCheckout" :checkout_details="checkout_info" :sale_id="sale_id.data"></process-checkout-confirm-dialog>
319
+ <process-checkout-confirm-dialog @closePopup="confirmedCheckout" :checkout_details="checkout_info" :sale_id="sale_id.data" :chosen_proc="true" ></process-checkout-confirm-dialog>
315
320
  </q-dialog>
316
321
  </div>
317
322
  </div>
@@ -355,7 +360,6 @@ import ProductClass from './classes/ProductClass';
355
360
  import EcommerceMaintenance from './dialogs/EcommerceMaintenance';
356
361
 
357
362
 
358
-
359
363
  export default {
360
364
 
361
365
  components: { EcommerceMaintenance,SelectShippingOptions, AddNewAddressForm ,ProcessCheckoutConfirmDialog, GLoader, axios ,ChooseCourierDialog, SelectVoucherDialog},
@@ -412,8 +416,14 @@ export default {
412
416
  online_payment_limit:999999,
413
417
  hide_voucher:false,
414
418
  disable_ecom:false,
419
+ total_amount:0,
420
+ available_payment_channel:[],
421
+ dragon_pay_choice:"",
422
+ check:{},
423
+ dragon_pay_amount:[],
415
424
  }),
416
- async mounted(){
425
+ async mounted()
426
+ {
417
427
  if (this.user_info)
418
428
  {
419
429
  if(this.user_info.slot_owned >0)
@@ -459,9 +469,18 @@ export default {
459
469
  {
460
470
  this.$q.loading.show();
461
471
  let pending_checkout = JSON.parse(sessionStorage.pending_checkout);
462
- let check = await this.$_fbCall('memberCheckPendingCheckout', { sale_id: pending_checkout.sale_id, amount:pending_checkout.amount });
463
- if(check.data)
472
+ if(pending_checkout.hasOwnProperty('mode') && pending_checkout.mode == "dragonpay")
473
+ {
474
+ this.check = await this.$_fbCall('memberCheckPendingCheckoutDragonpay', { sale_id: pending_checkout.sale_id, amount:pending_checkout.amount, mode:pending_checkout.mode });
475
+ }
476
+ else
464
477
  {
478
+ console.log('check online pay');
479
+ this.check = await this.$_fbCall('memberCheckPendingCheckout', { sale_id: pending_checkout.sale_id, amount:pending_checkout.amount });
480
+ }
481
+ if(this.check.data)
482
+ {
483
+ console.log(this.check.data, 'check data');
465
484
  sessionStorage.removeItem('checkout_list');
466
485
  sessionStorage.removeItem('referral_slot_code');
467
486
  sessionStorage.removeItem('pending_checkout');
@@ -470,7 +489,6 @@ export default {
470
489
  swal("Transaction Succesful!!", `Sale No. ${this.sale_id} has been successfully processed.`, "success");
471
490
 
472
491
  // this.$q.dialog({ title: "Transaction Succesful!", message: `Sale No. ${pending_checkout.sale_id} has been successfully processed.` });
473
-
474
492
  }
475
493
  else
476
494
  {
@@ -494,6 +512,7 @@ export default {
494
512
  sessionStorage.setItem('referral_slot_code', this.user_info.sponsor);
495
513
  }
496
514
  }
515
+ this.getPaymentChannel();
497
516
 
498
517
  },
499
518
  computed:
@@ -527,7 +546,24 @@ export default {
527
546
  {
528
547
  // this.getordersbymerchant();
529
548
  },
530
- methods:{
549
+ methods:
550
+ {
551
+ async getPaymentChannel()
552
+ {
553
+ if(this.public_settings.hasOwnProperty('dragonpay_details') && this.public_settings.dragonpay_details.active)
554
+ {
555
+ console.log('dragonpay:', this.public_settings.dragonpay_details.active );
556
+ try
557
+ {
558
+ let ret = await this.$_fbCall('memberGetPaymentChannel', {amount:this.dragon_pay_amount});
559
+ this.available_payment_channel = ret.data;
560
+ }
561
+ catch (error)
562
+ {
563
+ console.log(error);
564
+ }
565
+ }
566
+ },
531
567
  async removeVoucher(data)
532
568
  {
533
569
  this.all_voucher_list = [];
@@ -872,6 +908,7 @@ export default {
872
908
  merch.total_weight += Number(prod.delivery_settings.weight) * prod.quantity;
873
909
  }
874
910
  }
911
+ this.dragon_pay_amount = this.groupedProducts;
875
912
  this.checkout_info.orders = this.groupedProducts;
876
913
  this.checkout_info.sub_total = merchandise_subtotal;
877
914
  this.checkout_info.discount_total = discount_total;
@@ -1583,6 +1620,18 @@ export default {
1583
1620
  this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
1584
1621
  this.is_dialog_confirm_open = true;
1585
1622
  }
1623
+ else if (this.checkout_info.payment_method.payment_method_id == "dragon_pay")
1624
+ {
1625
+ if(!this.dragon_pay_choice)
1626
+ {
1627
+ this.$q.dialog({ html: true, title: `Something's not quite right`, message: "Invalid Dragon payment Method" });
1628
+ }
1629
+ else
1630
+ {
1631
+ this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
1632
+ this.is_dialog_confirm_open = true;
1633
+ }
1634
+ }
1586
1635
  else if (this.checkout_info.payment_method.payment_method_id == "cod_manual")
1587
1636
  {
1588
1637
  this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
package/GMyPurchases.vue CHANGED
@@ -117,7 +117,7 @@ export default {
117
117
  {
118
118
  this.processing_count++;
119
119
  }
120
- else if (order_list.status == "to_pay" || order_list.status == "payment_to_be_checked")
120
+ else if (order_list.status == "to_pay" || order_list.status == "payment_to_be_checked" || order_list.status == "pre_processing")
121
121
  {
122
122
  this.to_pay_count++;
123
123
  }
@@ -120,7 +120,7 @@ export default {
120
120
  {
121
121
  this.approval_count++;
122
122
  }
123
- else if (order_list.status == "to_pay" || order_list.status == "payment_to_be_checked")
123
+ else if (order_list.status == "to_pay" || order_list.status == "payment_to_be_checked" || order_list.status == "pre_processing")
124
124
  {
125
125
  this.to_pay_count++;
126
126
  }
package/GProcessSale.vue CHANGED
@@ -363,8 +363,12 @@ export default
363
363
  },
364
364
  resetData()
365
365
  {
366
+
366
367
  this.record_balance = 0;
367
- this.payment_list = []
368
+ this.payment_list = [];
369
+ // this.auto_fill_contact = '';
370
+ // this.auto_fill_address = '';
371
+ this.show_address = false;
368
372
  },
369
373
  openChooseSlot()
370
374
  {
@@ -1,7 +1,6 @@
1
1
  <template>
2
2
  <q-card class="process-checkout-dialog refill form" style="width: 900px; max-width: 1000px;">
3
3
  <q-form @submit="submit()">
4
-
5
4
  <div v-if="sale" style="min-height: 300px;" class="product-list">
6
5
  <printable title="Order Summary"
7
6
  :orders="sale.orders"
@@ -32,6 +31,19 @@
32
31
  <input type="hidden" name="ResponseURL" :value="ipay88_response_url">
33
32
  <input type="hidden" name="BackendURL" :value="ipay88_backend_url">
34
33
  </form>
34
+ <form v-if="sale.payment_method.payment_method_id == 'dragon_pay'" method="get" id="dragon_pay_form" name="ePayment" :action="public_settings.dragonpay_details.test_payment_request_url">
35
+ <input type="hidden" name="merchantid" :value="merchant_id">
36
+ <input type="hidden" name="txnid" :value="txnid">
37
+ <input type="hidden" name="amount" :value="amount">
38
+ <input type="hidden" name="ccy" :value="ccy">
39
+ <input type="hidden" name="description" :value="description">
40
+ <input type="hidden" name="email" :value="email">
41
+ <input type="hidden" name="digest" :value="digest_string.toString('hex')">
42
+ <input v-if="!public_settings.dragonpay_details.test" type="hidden" name="procid" :value="proc_id.procId">
43
+ <!-- <input type="hidden" name="mode" :value="mode"> -->
44
+ <!-- <input type="hidden" name="ResponseURL" :value="ipay88_response_url"> -->
45
+ <input type="hidden" name="param1" :value="dragonpay_backend">
46
+ </form>
35
47
  </div>
36
48
  <div v-else style="min-height: 300px;" class="product-list text-center q-pt-lg">
37
49
  <q-spinner-ball style="margin-top: 50px" class="q-mt-lg" color="primary" size="60px"/>
@@ -55,6 +67,7 @@ import Printable from './Printable';
55
67
  import GlobalMixins from '../../mixins/global_mixins.js';
56
68
  import {encryptSha} from '../../utilities/sha1';
57
69
  import swal from 'sweetalert';
70
+ import crypto from 'crypto';
58
71
  import config from 'app/settings';
59
72
 
60
73
 
@@ -68,16 +81,28 @@ export default {
68
81
  public_settings: {},
69
82
  merchant_code : "",
70
83
  signature : "",
84
+ digest:"",
71
85
  ipay88_backend_url:'',
72
- ipay88_response_url:''
86
+ ipay88_response_url:'',
87
+ redirect:"",
88
+ merchant_id : "",
89
+ password : "",
90
+ txnid : "",
91
+ amount : "",
92
+ ccy : "PHP",
93
+ description : "",
94
+ email : "admin@test.com",
95
+ digest_cry:"",
96
+ digest_string:"",
97
+ dragonpay_backend:"",
98
+ mode:"7"
73
99
  }),
74
- props: ['sale_id', 'hide_bottom', ],
100
+ props: ['sale_id', 'hide_bottom', 'proc_id'],
75
101
  async mounted()
76
102
  {
77
103
  this.ipay88_backend_url = `https://asia-northeast1-${config.projectId}.cloudfunctions.net/memberBackendIpayResponse`;
104
+ this.dragonpay_backend = `https://asia-northeast1-${config.projectId}.cloudfunctions.net/memberDragonpayResponse`;
78
105
  this.ipay88_response_url = location.href;
79
- console.log(this.ipay88_response_url,"response");
80
- console.log(this.ipay88_backend_url,"backend");
81
106
  this.public_settings = await this.$_getData('public_settings');
82
107
  await this.$bind('sale', this.db_checkout_request.doc(this.sale_id));
83
108
  if(this.public_settings && this.public_settings.hasOwnProperty('ipay88_details'))
@@ -86,7 +111,23 @@ export default {
86
111
  let amount_for_ip88 = this.public_settings.ipay88_details.test ? '1500' : this.$_formatNumber(this.sale.grand_total, { decimal: 2}).replace(/[ ,.]/g, "");
87
112
  this.signature = encryptSha(this.public_settings.ipay88_details.merchant_key+this.public_settings.ipay88_details.merchant_code+this.sale_id+amount_for_ip88+this.public_settings.ipay88_details.currency);
88
113
  }
89
-
114
+
115
+ if(this.public_settings && this.public_settings.hasOwnProperty('dragonpay_details') && this.public_settings.dragonpay_details.active)
116
+ {
117
+ this.merchant_id = this.public_settings.dragonpay_details.test ? this.public_settings.dragonpay_details.test_merchant_id : this.public_settings.dragonpay_details.merchant_id;
118
+ this.password = this.public_settings.dragonpay_details.test ? this.public_settings.dragonpay_details.test_merchant_key : this.public_settings.dragonpay_details.merchant_key;
119
+ let floattotal = parseFloat(this.sale.grand_total).toFixed(2);
120
+ this.txnid = this.sale.sale_id.toString();
121
+ this.amount = floattotal.toString();
122
+ this.ccy = "PHP";
123
+ this.description = "test";
124
+ this.email = this.public_settings.dragonpay_details.test ? "admin@gmail.com" : this.sale.customer_email;
125
+ let digest_string = `${this.merchant_id}:${this.txnid}:${this.amount}:${this.ccy}:${this.description}:${this.email}:${this.password}`;
126
+ this.digest = encryptSha(digest_string);
127
+ this.digest_cry = crypto.createHash("sha1").update(digest_string).digest();
128
+ this.digest_string = this.digest_cry.toString('hex');
129
+ console.log(this.digest_string);
130
+ }
90
131
 
91
132
  },
92
133
  methods:
@@ -102,18 +143,27 @@ export default {
102
143
  this.$q.loading.hide();
103
144
 
104
145
  this.$emit('closePopup', this.sale.payment_method.payment_method_id);
105
- if(this.sale.payment_method.payment_method_id != "online_payment")
146
+ if(this.sale.payment_method.payment_method_id != "online_payment" && this.sale.payment_method.payment_method_id != "dragon_pay" )
106
147
  {
107
148
  swal("Transaction Succesful!!", `Sale No. ${this.sale_id} has been successfully processed.`, "success");
108
149
  // this.$q.dialog({ title: "Transaction Succesful!", message: `Sale No. ${this.sale_id} has been successfully processed.` });
109
150
  sessionStorage.removeItem('checkout_list');
110
151
  sessionStorage.removeItem('referral_slot_code');
111
152
  }
112
- else
153
+ else if(this.sale.payment_method.payment_method_id == "online_payment")
113
154
  {
114
155
  sessionStorage.setItem('pending_checkout', JSON.stringify({status:'pending',amount: "15.00", sale_id:this.sale_id}));
115
156
  document.getElementById('ip88form').submit();
116
157
  }
158
+ else if(this.sale.payment_method.payment_method_id == "dragon_pay")
159
+ {
160
+ sessionStorage.setItem('pending_checkout', JSON.stringify({status:'pending',amount: "15.00", sale_id:this.sale_id, mode:"dragonpay"}));
161
+ document.getElementById('dragon_pay_form').submit();
162
+ }
163
+ else
164
+ {
165
+ console.log('dito sa else pumasok');
166
+ }
117
167
  }
118
168
  catch (error)
119
169
  {
@@ -16,7 +16,7 @@
16
16
  <div class="header__container">
17
17
  <div class="header-slot-code">
18
18
  <div><q-icon name="fas fa-ticket-alt" class="q-mr-sm q-ml-xs"></q-icon>Slot Code: {{list.slot_code}}</div>
19
- <div class="status">Status: <div class="value" :style="list.status == 'to_pay' ? 'color:#a29e9e;' : 'color:darkviolet;'">{{list.status == "to_pay" ? "Waiting for Payment" : "Waiting for platform to Received the payment"}}</div></div>
19
+ <div class="status">Status: <div class="value" :style="list.status == 'to_pay' ? 'color:#a29e9e;' : 'color:darkviolet;'">{{list.status == "to_pay" || list.status == "pre_processing" ? "Waiting for Payment" : "Waiting for platform to Received the payment"}}</div></div>
20
20
  </div>
21
21
  </div>
22
22
  <div style="display:flex;background:white;border-top: 1px solid rgb(194, 189, 189);">
@@ -129,7 +129,7 @@
129
129
  <div class="order-info">
130
130
  <!-- <div>Order Total ({{product_list[i].quantity}} Item): {{main_currency}} {{order_total}}</div> -->
131
131
  <div>Status:</div>
132
- <div class="order-items"> {{list.status == "to_pay" ? "Waiting for Payment" : "Waiting for platform to Received the payment"}}</div>
132
+ <div class="order-items"> {{list.status == "to_pay" || list.status == "pre_processing" ? "Waiting for Payment" : "Waiting for platform to Received the payment"}}</div>
133
133
  <div>Shipping Fee:</div>
134
134
  <div class="order-items">{{main_currency}} {{$_formatNumber(list.orders.shipping_fee, { decimal: 2})}}</div>
135
135
  <div v-if="public_settings.hasOwnProperty('custom_ecommerce_fee')">{{public_settings.custom_ecommerce_fee.label}}:</div>
@@ -194,7 +194,7 @@ export default {
194
194
  this.main_currency = this.public_settings.main_currency;
195
195
  let myOrder = [];
196
196
  this.order_list.forEach(order_list => {
197
- if (order_list.status == "to_pay" || order_list.status == "payment_to_be_checked")
197
+ if (order_list.status == "to_pay" || order_list.status == "payment_to_be_checked" ||order_list.status == "pre_processing" )
198
198
  {
199
199
  myOrder.push(order_list);
200
200
  }
@@ -21,7 +21,7 @@
21
21
  </div>
22
22
  <div style="display:flex;background:white;border-top: 1px solid rgb(194, 189, 189);">
23
23
  <div style="font-weight:600;padding:5px;padding-left:10px;width:46%;"><q-icon name="fa fa-store" class="q-mr-sm"></q-icon>{{list.orders.merchant_name}}</div>
24
- <div style="font-weight:600;padding:5px;width:35%;">Tracking Number: {{list.shipping_details.tracking_number}}</div>
24
+ <div style="font-weight:600;padding:5px;width:35%;">Tracking Number: {{list.shipping_details ? list.shipping_details.tracking_number : ''}}</div>
25
25
  <div style="font-weight:600;padding:5px;width:19%;text-align:right;padding-right:18px;">Order ID: {{list.order_id}}</div>
26
26
  </div>
27
27
 
@@ -84,13 +84,13 @@
84
84
  <div style="padding-left:10px;margin-right:10px;border-left: 1px solid rgb(194, 189, 189);" v-if="public_settings.hasOwnProperty('custom_ecommerce_fee')">{{public_settings.custom_ecommerce_fee.label}}: {{main_currency}} {{$_formatNumber(list.orders[public_settings.custom_ecommerce_fee.id], { decimal: 2})}}</div>
85
85
  <div style="padding-left:10px;border-left: 1px solid rgb(194, 189, 189);">Order Total ({{list.orders.total_quantity}} Item): {{main_currency}} {{$_formatNumber(list.orders.order_total, { decimal: 2})}}</div> -->
86
86
  </div>
87
- <div class="order-total" style="border:none;padding-top:0px;">
88
- <!-- <div style="margin-left:auto">Tracking Number: {{list.shipping_details.tracking_number}}</div> -->
89
- <div>Courier: {{list.shipping_details.courier}}</div>
87
+ <div class="order-total" style="border:none;padding-top:0px; display:flex; justify-content:">
88
+ <div>Courier: {{list.shipping_details ? list.shipping_details.courier : 'Waiting for courier'}}</div>
89
+ <div style="margin-left:auto">Tracking Number: {{list.shipping_details ? list.shipping_details.tracking_number : ''}}</div>
90
90
  </div>
91
91
  <div v-if="list.status =='delivered' || list.status =='shipping'" style="background:white;text-align:right;padding:0px 20px 10px 0px;">
92
92
  <q-btn dense color="primary" no-caps @click="openTrackingDialog(i)" label="Trace Order" style="margin: 0 10px"></q-btn>
93
- <q-btn dense color="primary" v-if="list.status =='delivered' && list.payment_method.payment_method_id =='online_payment' || list.status =='delivered' && list.payment_method.payment_method_id =='cod'" no-caps @click="orderReceived(i)" label="Order Received"></q-btn>
93
+ <q-btn dense color="primary" v-if="list.status =='delivered' && list.payment_method.payment_method_id =='online_payment' || list.status =='delivered' && list.payment_method.payment_method_id =='cod' || list.status =='delivered' && list.payment_method.payment_method_id =='dragon_pay'" no-caps @click="orderReceived(i)" label="Order Received"></q-btn>
94
94
  </div>
95
95
  </div>
96
96
  </div>
@@ -120,7 +120,7 @@
120
120
  <div style="background:white;border-top: 1px solid rgb(194, 189, 189);">
121
121
  <div style="display: grid; grid-template-columns: 1fr 2fr;">
122
122
  <div style="font-weight:600;padding:5px;"><q-icon name="fa fa-store" class="q-mr-sm"></q-icon>{{list.orders.merchant_name}}</div>
123
- <div style="font-weight:600;padding:5px;text-align:right">Tracking Number: {{list.shipping_details.tracking_number}}</div>
123
+ <div style="font-weight:600;padding:5px;text-align:right">Tracking Number: {{list.shipping_details ? list.shipping_details.tracking_number : ''}}</div>
124
124
  </div>
125
125
  <div style="font-weight:600;padding:5px;text-align:right;padding-right:18px;">Order ID: {{list.order_id}}</div>
126
126
  </div>
@@ -154,9 +154,9 @@
154
154
  <div>Order Total ({{list.orders.total_quantity}} Item): </div>
155
155
  <div class="order-items"> {{main_currency}} {{$_formatNumber(list.orders.order_total, { decimal: 2})}}</div>
156
156
  <div>Courier:</div>
157
- <div class="order-items">{{list.shipping_details.courier}}</div>
157
+ <div class="order-items">{{list.shipping_details ? list.shipping_details.courier : 'Waiting for courier'}}</div>
158
158
  <div>Tracking Number:</div>
159
- <div class="order-items">{{list.shipping_details.tracking_number}}</div>
159
+ <div class="order-items">{{list.shipping_details ? list.shipping_details.tracking_number : ''}}</div>
160
160
  </div>
161
161
  <div v-if="list.status =='delivered' || list.status =='shipping'" style="background:white;text-align:right;padding:10px">
162
162
  <q-btn dense color="primary" no-caps @click="openTrackingDialog(i)" label="Trace Order" style="margin: 0 10px"></q-btn>
@@ -259,7 +259,8 @@ export default {
259
259
  });
260
260
  }
261
261
  },
262
- openTrackingDialog(index){
262
+ openTrackingDialog(index)
263
+ {
263
264
  this.pass_data = this.my_order_list[index];
264
265
  this.is_trace_dialog_open = true;
265
266
  },
@@ -10,11 +10,11 @@
10
10
  </q-bar>
11
11
  <div class="top-banner">Visit this website to track your order:</div>
12
12
  <div class="url">
13
- <a :href="link"> {{order_info.shipping_details.courier_link}}</a>
13
+ <a :href="link"> {{link}}</a>
14
14
  </div>
15
15
  <div class="tracking">
16
16
  <input type="text" name="myInput" :value="tracking_number" id="myInput" class="input">
17
- <div class="tracking__number">{{order_info.shipping_details.tracking_number}}</div>
17
+ <div class="tracking__number">{{tracking_number}}</div>
18
18
 
19
19
  </div>
20
20
  <div class="copy-button">
@@ -34,9 +34,10 @@ export default
34
34
  tracking_number:'',
35
35
  link:'',
36
36
  }),
37
- async mounted() {
38
- this.tracking_number = this.order_info.shipping_details.tracking_number;
39
- this.link = this.order_info.shipping_details.courier_link;
37
+ async mounted()
38
+ {
39
+ this.tracking_number = this.order_info.shipping_details ? this.order_info.shipping_details.tracking_number : 'Waiting for courier';
40
+ this.link = this.order_info.shipping_details.courier_link ? this.order_info.shipping_details.courier_link : 'https://merchant-portal.payo.asia/widget/tracking?merchant=0011v00002qrGlhAAE';
40
41
  },
41
42
  methods: {
42
43
  copyTracking(){
@@ -80,7 +81,7 @@ export default
80
81
  color:$primary;
81
82
  font-size: 30px;
82
83
  border: 5px dotted grey;
83
- width: 40%;
84
+ width: 80%;
84
85
  margin: auto;
85
86
  margin-top: -10px;
86
87
  }
@@ -166,7 +166,7 @@ export default {
166
166
 
167
167
  let myOrder = [];
168
168
  this.order_list.forEach(order_list => {
169
- if (order_list.status == "to_pay" || order_list.status == "payment_to_be_checked")
169
+ if (order_list.status == "to_pay" || order_list.status == "payment_to_be_checked" || order_list.status == "pre_processing")
170
170
  {
171
171
  myOrder.push(order_list);
172
172
  }
@@ -7,7 +7,7 @@
7
7
  <div class="col-12 q-mt-sm details-holder">
8
8
  <div class="row text-left customer-grid">
9
9
  <div class="col-4 label">Customer</div>
10
- <div class="col-4 value">
10
+ <div class="col-8 value">
11
11
  <div>{{ customer.name }}</div>
12
12
  <div><i>{{ customer.email }}</i></div>
13
13
  </div>
@@ -32,6 +32,18 @@
32
32
  <div class="col-4 value" v-else>
33
33
  <div class="text-red text-bold">No Slot Selected</div>
34
34
  </div>
35
+ </div>
36
+ <div class="row text-left status-grid" v-if="show_customer_details">
37
+ <div class="col-4 label">Contact No.:</div>
38
+ <div class="col-8 value">
39
+ <div>{{ customer.contact_number }}</div>
40
+ </div>
41
+ </div>
42
+ <div class="row text-left status-grid" v-if="show_customer_details">
43
+ <div class="col-4 label">Address:</div>
44
+ <div class="col-8 value">
45
+ <div>{{ customer.address }}</div>
46
+ </div>
35
47
  </div>
36
48
  <div class="row text-left" v-if="transaction_refill">
37
49
  <div class="col-4 label">Sale Type:</div>
@@ -178,6 +190,7 @@ export default {
178
190
  payment_type:'',
179
191
  gc_discount:false,
180
192
  show_batch:false,
193
+ show_customer_details:false,
181
194
  }),
182
195
  async mounted()
183
196
  {
@@ -191,6 +204,10 @@ export default {
191
204
  {
192
205
  this.gc_discount = true;
193
206
  }
207
+ if(this.settings.hasOwnProperty('cashier_auto_fill_address') && this.settings.cashier_auto_fill_address == true)
208
+ {
209
+ this.show_customer_details = true;
210
+ }
194
211
  },
195
212
  methods:{
196
213
  async updateMemo()
@@ -12,6 +12,8 @@
12
12
  <div class="row text-left order-no">
13
13
  <div class="col-7 label"><div>STATUS : REFILL/CLAIMED</div>
14
14
  <div>EMAIL : {{customer.email}}</div>
15
+ <div v-if="show_customer_details">CONTACT : {{customer.contact_number}}</div>
16
+ <div v-if="show_customer_details">ADDRESS : {{customer.address}}</div>
15
17
  </div>
16
18
  <div class="col-5 label" style="margin-top:15px;">Order No. Receipt No. : {{ number }}</div>
17
19
  </div>
@@ -118,7 +120,8 @@ export default {
118
120
  discount:0,
119
121
  show_currency:false,
120
122
  main_currency:'',
121
- show_batch:false
123
+ show_batch:false,
124
+ show_customer_details:false,
122
125
  }),
123
126
  async mounted()
124
127
  {
@@ -130,7 +133,10 @@ export default {
130
133
  {
131
134
  this.show_batch = true;
132
135
  }
133
-
136
+ if(this.settings.hasOwnProperty("cashier_auto_fill_address") && this.settings.cashier_auto_fill_address == true)
137
+ {
138
+ this.show_customer_details = true;
139
+ }
134
140
  this.address_1 = this.settings.company_address ? this.settings.addrcompany_addressess : "";
135
141
  this.contact = this.settings.company_contact ? this.settings.company_contact : "";
136
142
 
package/models/DB_SALE.js CHANGED
@@ -27,7 +27,27 @@ export default class DB_SALE extends MODEL
27
27
 
28
28
  return data;
29
29
  }
30
+ async getAllSale(branch_slot,from_date, to_date)
31
+ {
32
+ let date_start = new Date(from_date + ' 00:00:00');
33
+ let date_end = new Date(to_date + ' 23:59:59');
34
+ let slot_code = branch_slot;
35
+
36
+ let res = await this.collection().where('stockist','==', slot_code).where('created_date','>=', date_start).where('created_date','<=', date_end).orderBy('created_date', 'asc').get();
37
+
38
+ let data = [];
39
+
40
+ if(!res.empty)
41
+ {
42
+ res.docs.forEach((d, i) =>
43
+ {
44
+ data[i] = d.data();
45
+ data[i].id = d.id;
46
+ })
47
+ }
30
48
 
49
+ return data;
50
+ }
31
51
  async getCompletedSale(branch_slot,from_date, to_date)
32
52
  {
33
53
  let date_start = new Date(from_date + ' 00:00:00');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geer-builder",
3
- "version": "1.2.505",
3
+ "version": "1.2.515",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -14,6 +14,7 @@
14
14
  "jquery": "^3.5.1",
15
15
  "moment-timezone": "^0.5.33",
16
16
  "philippine-location-json-for-geer": "^1.1.11",
17
+ "soap": "^0.43.0",
17
18
  "sweetalert": "^2.1.2",
18
19
  "validator": "^13.5.2",
19
20
  "vue-socialmedia-share": "^1.0.1",