geer-builder 1.2.889 → 1.2.890

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.
package/GCheckout.vue CHANGED
@@ -59,6 +59,11 @@
59
59
  <div class="g-cash-lable" v-if="show_gcash_fee">GCash Fee: PHP {{$_formatNumber(gcash_fee, { decimal: 2})}}</div>
60
60
  <div class="text-bold">Order Total ({{merch.total_quantity}} Item): {{payment_method.payment_method_id =='gc_points' ? 'GC' : main_currency}} {{show_gcash_fee ? $_formatNumber(merch.order_total + gcash_fee, { decimal: 2}) : $_formatNumber(merch.order_total, { decimal: 2}) }}</div>
61
61
  </div>
62
+ <div></div>
63
+ <div></div>
64
+ <div class="field col-12 q-px-lg q-mb-md" v-if="public_settings.enable_auto_activate_on_purchase">
65
+ <q-checkbox v-model="auto_activate" label="Auto-activate if membership code generated" />
66
+ </div>
62
67
  </div>
63
68
  </div>
64
69
  </div>
@@ -506,7 +511,8 @@ export default {
506
511
  ],
507
512
  payment_channel_tab: 'otc',
508
513
  checkout_fix: false,
509
- is_elms_popup: false
514
+ is_elms_popup: false,
515
+ auto_activate: false
510
516
  }),
511
517
  async mounted()
512
518
  {
@@ -2347,6 +2353,7 @@ export default {
2347
2353
  }
2348
2354
 
2349
2355
  this.checkout_info.payment_method = this.payment_method;
2356
+ this.checkout_info.auto_activate = this.auto_activate;
2350
2357
  try
2351
2358
  {
2352
2359
  this.$q.loading.show();
package/GProcessSale.vue CHANGED
@@ -187,8 +187,8 @@
187
187
  </div>
188
188
 
189
189
  <div class="buttons text-right">
190
- <div class="field col-12 q-px-lg q-mb-md" style="">
191
- <q-checkbox v-model="auto_activate" label="Activate slot immediately upon successful payment" />
190
+ <div class="field col-12 q-px-lg q-mb-md" style="" v-if="public_settings.enable_auto_activate_on_purchase">
191
+ <q-checkbox v-model="auto_activate" label="Auto-activate if code generated" />
192
192
  </div>
193
193
 
194
194
  <q-btn v-if="up_coin_button" color="primary" @click="upcoinPay()" unelevated style="margin-right:5px">
@@ -199,6 +199,10 @@
199
199
  <q-icon name="fas fa-coins" size="14px" class="q-mr-sm"></q-icon>
200
200
  PV Pay
201
201
  </q-btn>
202
+ <q-btn v-if="public_settings.enable_auto_activate_on_purchase" color="primary" @click="gcTwoPay()" unelevated style="margin-right:5px">
203
+ <q-icon name="fas fa-coins" size="14px" class="q-mr-sm"></q-icon>
204
+ GC Two Pay
205
+ </q-btn>
202
206
  <q-btn color="primary" v-if="!hide_manage_discount" @click=openDiscount unelevated style="margin-right:5px">
203
207
  <q-icon name="fa fa-percent" size="14px" class="q-mr-sm"></q-icon>
204
208
  Add Discount
@@ -289,6 +293,7 @@ export default
289
293
  up_coin_button:false,
290
294
  point_value_pay:false,
291
295
  point_value_button:false,
296
+ gc_two_pay:false,
292
297
  hide_manage_discount:true,
293
298
  show_batch:false,
294
299
  is_batch_number_dialog_open:false,
@@ -465,6 +470,44 @@ export default
465
470
  this.openChooseSlot();
466
471
  }
467
472
  },
473
+ async gcTwoPay()
474
+ {
475
+ if(this.slot_reference != null)
476
+ {
477
+ this.gc_two_pay = true;
478
+ await this.updateTable();
479
+
480
+ if(!this.chosen_slot_info.points.hasOwnProperty('gc_two'))
481
+ {
482
+ this.$q.dialog({ title: "Something's not quite right", html:true , message: `${this.chosen_slot_info.slot_code} doesnt have enough GC Two` });
483
+ }
484
+ if(this.chosen_slot_info.points.gc_two < this.grandTotal)
485
+ {
486
+ this.$q.dialog({ title: "Something's not quite right", html:true , message: `${this.chosen_slot_info.slot_code} GC Two is not enough to continue this transaction` });
487
+ }
488
+ else
489
+ {
490
+ this.hide_receive_payment_button = true;
491
+ let payment =
492
+ {
493
+ method_key:'gc_two',
494
+ payment_method_id:'gc_two'
495
+ };
496
+ payment = await this.getPaymentMethod(payment.payment_method_id);
497
+ let field =
498
+ {
499
+ payment_method_id : payment.payment_method_id,
500
+ payment_amount : this.grandTotal,
501
+ payment_type:payment
502
+ };
503
+ this.payment_list.push(field);
504
+ }
505
+ }
506
+ else
507
+ {
508
+ this.openChooseSlot();
509
+ }
510
+ },
468
511
  async upcoinPay()
469
512
  {
470
513
  if(this.slot_reference != null)
@@ -169,8 +169,8 @@
169
169
  </div>
170
170
  </div>
171
171
 
172
- <div class="field col-12 q-px-lg q-mb-md" v-if="is_already_choose_slot">
173
- <q-checkbox v-model="auto_activate" label="Activate slot immediately upon successful payment" />
172
+ <div class="field col-12 q-px-lg q-mb-md" v-if="is_already_choose_slot && public_settings.enable_auto_activate_on_purchase">
173
+ <q-checkbox v-model="auto_activate" label="Auto-activate if code generated" />
174
174
  </div>
175
175
 
176
176
  <div class="buttons text-right">
@@ -178,6 +178,10 @@
178
178
  <q-icon name="fa fa-percent" size="14px" class="q-mr-sm"></q-icon>
179
179
  Add Discount
180
180
  </q-btn> -->
181
+ <q-btn color="primary" v-if="is_already_choose_slot == true && public_settings.enable_auto_activate_on_purchase" @click=gcTwoPayment unelevated style="margin-right:5px">
182
+ <q-icon name="fas fa-coins" size="14px" class="q-mr-sm"></q-icon>
183
+ GC Two Pay
184
+ </q-btn>
181
185
  <q-btn color="primary" v-if="is_already_choose_slot == true" @click=gcPayment unelevated style="margin-right:5px">
182
186
  <q-icon name="fa fa-credit-card" size="14px" class="q-mr-sm"></q-icon>
183
187
  Receive Payment
@@ -404,6 +408,46 @@ export default
404
408
  })
405
409
  }
406
410
  },
411
+ async gcTwoPayment()
412
+ {
413
+ if(this.slot_reference)
414
+ {
415
+ let slot_code = await this.$_getSlotBySlotCode(this.slot_reference)
416
+ let selected_slot_info = slot_code != undefined ? slot_code : {}
417
+ this.$q.dialog({
418
+ outlined: true,
419
+ title: "Confirmation",
420
+ message: `This transaction will deduct <strong>${this.grandTotal} GC Two </strong> to your slot <strong>${this.slot_reference}</strong> would you like to continue?`,
421
+ html:true,
422
+ cancel: true,
423
+ persistent: true
424
+ }).onOk(async data => {
425
+
426
+ if(!selected_slot_info.points.hasOwnProperty('gc_two'))
427
+ {
428
+ this.$q.dialog({ title: "Warning", message: 'Your GC Two is not enough to continue this transaction' });
429
+ }
430
+ else if( selected_slot_info.points.gc_two < this.grandTotal )
431
+ {
432
+ this.$q.dialog({ title: "Warning", message: 'Your GC Two is not enough to continue this transaction' });
433
+ }
434
+ else
435
+ {
436
+ let gc_two_field = {
437
+ payment_method_id: "gc_two",
438
+ payment_amount: this.grandTotal,
439
+ payment_type: {
440
+ payment_method_id: "gc_two",
441
+ method_name: "GC Two",
442
+ method_key: "gc_two"
443
+ }
444
+ };
445
+ this.payment_list.push(gc_two_field);
446
+ this.is_already_received_payment = true;
447
+ }
448
+ })
449
+ }
450
+ },
407
451
  async getSettings()
408
452
  {
409
453
  this.public_settings = await this.$_getData('public_settings');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geer-builder",
3
- "version": "1.2.889",
3
+ "version": "1.2.890",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {