geer-builder 1.2.930 → 1.2.932

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
@@ -393,6 +393,22 @@
393
393
  <q-dialog v-model="is_ecom_disable" max-width="1000px">
394
394
  <ecommerce-maintenance></ecommerce-maintenance>
395
395
  </q-dialog>
396
+ <q-dialog persistent v-model="is_renewal_dialog_open">
397
+ <q-card style="width: 420px; text-align: center;" class="q-pa-lg">
398
+ <div style="font-size: 50px;">&#128260;</div>
399
+ <div class="text-h5 q-mt-md" style="font-weight: 600;">Renewal Product Detected</div>
400
+ <div class="q-mt-sm text-body1">
401
+ <b>{{ renewal_names }}</b> is a renewal product.
402
+ </div>
403
+ <div class="q-mt-sm text-body2 text-grey-7">
404
+ This product will <b>{{ renewal_action }}</b> your privilege card once the order is processed.
405
+ </div>
406
+ <div class="q-mt-lg" style="display: flex; gap: 10px;">
407
+ <q-btn outline color="grey" label="Cancel" class="full-width" @click="is_renewal_dialog_open = false" />
408
+ <q-btn color="primary" label="Continue" class="full-width" @click="confirmRenewalCheckout()" />
409
+ </div>
410
+ </q-card>
411
+ </q-dialog>
396
412
  </div>
397
413
  <div v-else >
398
414
  <div class="loader">
@@ -494,6 +510,9 @@ export default {
494
510
  online_payment_only:false,
495
511
  package_free_shipping:false,
496
512
  merchant_free_shipping:false,
513
+ is_renewal_dialog_open: false,
514
+ renewal_action: '',
515
+ renewal_names: '',
497
516
  payment_channel_group: [
498
517
  {
499
518
  id: 'otc',
@@ -2437,73 +2456,40 @@ export default {
2437
2456
  {
2438
2457
  this.checkout_info.reseller_slot_code = sessionStorage.reseller_slot_code;
2439
2458
  }
2440
- if(this.checkout_info.payment_method.payment_method_id == "wallet")
2441
- {
2442
- this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2443
- this.is_dialog_confirm_open = true;
2444
- }
2445
- else if(this.checkout_info.payment_method.payment_method_id == "gc_points")
2446
- {
2447
- this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2448
- this.is_dialog_confirm_open = true;
2449
- }
2450
- else if (this.checkout_info.payment_method.payment_method_id == "manual_pay")
2451
- {
2452
- if(!this.manual_pay_choice)
2453
- {
2454
- this.$q.dialog({ html: true, title: `Something's not quite right`, message: "Invalid Payment Method" });
2455
- }
2456
- else
2457
- {
2458
- this.checkout_info.payment_method.manual_pay_choice = this.manual_pay_choice;
2459
- this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2460
- this.is_dialog_confirm_open = true;
2461
- }
2462
-
2463
- }
2464
- else if (this.checkout_info.payment_method.payment_method_id == "online_payment")
2465
- {
2466
- if(!this.online_payment_choice)
2467
- {
2468
- this.$q.dialog({ html: true, title: `Something's not quite right`, message: "Invalid Payment Method" });
2469
- }
2470
- else
2471
- {
2472
- this.checkout_info.payment_method.online_payment_choice = this.online_payment_choice;
2473
- this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2474
- this.is_dialog_confirm_open = true;
2475
- }
2476
- }
2477
- else if (this.checkout_info.payment_method.payment_method_id == "cod")
2478
- {
2479
- // this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2480
- // console.log(this.sale_id.data);
2481
- // alert("Invoice Number : "+this.sale_id.data.invoice_no)
2482
- this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2483
- this.is_dialog_confirm_open = true;
2484
- }
2485
- else if (this.checkout_info.payment_method.payment_method_id == "dragon_pay")
2459
+
2460
+ // Check for renewal products only if slot_expiration is enabled (0 extra reads)
2461
+ let slot_expiration_enabled = this.public_settings.slot_expiration && this.public_settings.slot_expiration.enable;
2462
+ if (slot_expiration_enabled)
2486
2463
  {
2487
- if(this.public_settings.hasOwnProperty('dragonpay_details') && !this.public_settings.dragonpay_details.show_active_payment)
2464
+ let renewal_names = [];
2465
+ for (let p of this.product_list)
2488
2466
  {
2489
- this.dragon_pay_choice = this.public_settings.dragonpay_details ? this.public_settings.dragonpay_details.mode : 1;
2490
- }
2491
- // console.log(this.dragon_pay_choice, 'dragon_pay_choice');
2492
- if(!this.dragon_pay_choice)
2493
- {
2494
- this.$q.dialog({ html: true, title: `Something's not quite right`, message: "Invalid Dragon payment Method" });
2467
+ if (p.product && p.product.membership_kit
2468
+ && (p.product.membership_kit.use_for_renew === true || p.product.membership_kit.use_for_renew === 'Yes'))
2469
+ {
2470
+ renewal_names.push(p.product.product_name);
2471
+ }
2495
2472
  }
2496
- else
2473
+
2474
+ if (renewal_names.length > 0 && (this.user_info.slot_owned > 0 || this.user_info.active_slot))
2497
2475
  {
2498
- this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2499
- this.is_dialog_confirm_open = true;
2476
+ let is_expired = false;
2477
+ if (this.current_slot_info)
2478
+ {
2479
+ let exp_result = this.$_checkSlotExpirationLocal(this.current_slot_info, this.public_settings);
2480
+ is_expired = exp_result.expiration_enabled && exp_result.is_expired;
2481
+ }
2482
+
2483
+ let action = is_expired ? 'reactivate' : 'extend';
2484
+ this.renewal_action = action;
2485
+ this.renewal_names = renewal_names.join(', ');
2486
+ this.$q.loading.hide();
2487
+ this.is_renewal_dialog_open = true;
2488
+ return;
2500
2489
  }
2501
2490
  }
2502
- else if (this.checkout_info.payment_method.payment_method_id == "cod_manual")
2503
- {
2504
- this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2505
- this.is_dialog_confirm_open = true;
2506
- }
2491
+
2492
+ await this.executeProceedCheckout();
2507
2493
  }
2508
2494
  // console.log(this.checkout_details);
2509
2495
  this.$q.loading.hide();
@@ -2535,6 +2521,78 @@ export default {
2535
2521
  this.$q.dialog({ html: true, title: `Something's not quite right`, message: error.message });
2536
2522
  }
2537
2523
  },
2524
+ async confirmRenewalCheckout()
2525
+ {
2526
+ this.is_renewal_dialog_open = false;
2527
+ this.$q.loading.show();
2528
+ await this.executeProceedCheckout();
2529
+ this.$q.loading.hide();
2530
+ },
2531
+ async executeProceedCheckout()
2532
+ {
2533
+ if(this.checkout_info.payment_method.payment_method_id == "wallet")
2534
+ {
2535
+ this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2536
+ this.is_dialog_confirm_open = true;
2537
+ }
2538
+ else if(this.checkout_info.payment_method.payment_method_id == "gc_points")
2539
+ {
2540
+ this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2541
+ this.is_dialog_confirm_open = true;
2542
+ }
2543
+ else if (this.checkout_info.payment_method.payment_method_id == "manual_pay")
2544
+ {
2545
+ if(!this.manual_pay_choice)
2546
+ {
2547
+ this.$q.dialog({ html: true, title: `Something's not quite right`, message: "Invalid Payment Method" });
2548
+ }
2549
+ else
2550
+ {
2551
+ this.checkout_info.payment_method.manual_pay_choice = this.manual_pay_choice;
2552
+ this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2553
+ this.is_dialog_confirm_open = true;
2554
+ }
2555
+ }
2556
+ else if (this.checkout_info.payment_method.payment_method_id == "online_payment")
2557
+ {
2558
+ if(!this.online_payment_choice)
2559
+ {
2560
+ this.$q.dialog({ html: true, title: `Something's not quite right`, message: "Invalid Payment Method" });
2561
+ }
2562
+ else
2563
+ {
2564
+ this.checkout_info.payment_method.online_payment_choice = this.online_payment_choice;
2565
+ this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2566
+ this.is_dialog_confirm_open = true;
2567
+ }
2568
+ }
2569
+ else if (this.checkout_info.payment_method.payment_method_id == "cod")
2570
+ {
2571
+ this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2572
+ this.is_dialog_confirm_open = true;
2573
+ }
2574
+ else if (this.checkout_info.payment_method.payment_method_id == "dragon_pay")
2575
+ {
2576
+ if(this.public_settings.hasOwnProperty('dragonpay_details') && !this.public_settings.dragonpay_details.show_active_payment)
2577
+ {
2578
+ this.dragon_pay_choice = this.public_settings.dragonpay_details ? this.public_settings.dragonpay_details.mode : 1;
2579
+ }
2580
+ if(!this.dragon_pay_choice)
2581
+ {
2582
+ this.$q.dialog({ html: true, title: `Something's not quite right`, message: "Invalid Dragon payment Method" });
2583
+ }
2584
+ else
2585
+ {
2586
+ this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2587
+ this.is_dialog_confirm_open = true;
2588
+ }
2589
+ }
2590
+ else if (this.checkout_info.payment_method.payment_method_id == "cod_manual")
2591
+ {
2592
+ this.sale_id = await this.$_fbCall('memberProceedCheckout', this.checkout_info)
2593
+ this.is_dialog_confirm_open = true;
2594
+ }
2595
+ },
2538
2596
  showActivePayment()
2539
2597
  {
2540
2598
  if(this.product_list.length>0)
package/GProcessSale.vue CHANGED
@@ -776,9 +776,10 @@ export default
776
776
  this.sale_id = sale.data;
777
777
  this.$q.loading.hide();
778
778
 
779
- // Check for renewal products
779
+ // Check for renewal products (only if slot_expiration is enabled)
780
780
  let renewal_names = [];
781
- if (saved_product_list.length > 0 && saved_email)
781
+ let slot_expiration_enabled = this.public_settings.slot_expiration && this.public_settings.slot_expiration.enable;
782
+ if (slot_expiration_enabled && saved_product_list.length > 0 && saved_email)
782
783
  {
783
784
  let customer_docs = await new DB_USER().collection().where('email', '==', saved_email).get();
784
785
  if (customer_docs.docs.length > 0)
@@ -801,7 +802,7 @@ export default
801
802
  {
802
803
  this.$q.dialog({
803
804
  title: 'Renewal Product Detected',
804
- message: `${renewal_names.join(', ')} is a renewal product. No membership code will be generated — this product will renew the customer's privilege card upon claiming.`,
805
+ message: `${renewal_names.join(', ')} is a renewal product. No membership code will be generated — this product will renew the customer's privilege card once the order is processed.`,
805
806
  persistent: true
806
807
  }).onDismiss(() => {
807
808
  this.is_dialog_confirm_open = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geer-builder",
3
- "version": "1.2.930",
3
+ "version": "1.2.932",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {