geer-builder 1.2.647 → 1.2.649
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/GProcessSaleGc.vue +58 -4
- package/package.json +1 -1
package/GProcessSaleGc.vue
CHANGED
|
@@ -103,6 +103,8 @@
|
|
|
103
103
|
</q-select>
|
|
104
104
|
<template v-if="slot_reference != null ">
|
|
105
105
|
<label class="label row q-mt-sm">{{slot_reference == 'no_slot' ? "No Slot Selected" : slot_reference}}</label>
|
|
106
|
+
<label class="label row q-mt-sm">Current GC:{{slot_reference_gc}}</label>
|
|
107
|
+
<label v-if="is_monthly_gc_limit_enabled" class="label row q-mt-sm">Monthly Used GC:{{slot_reference_monthly_gc}}</label>
|
|
106
108
|
</template>
|
|
107
109
|
<template v-if="show_address">
|
|
108
110
|
<label class="label row q-mt-sm">Address:{{auto_fill_address}}</label>
|
|
@@ -225,12 +227,13 @@ import DB_SLOT from "./models/DB_SLOT";
|
|
|
225
227
|
import DB_COUNTER from "./models/DB_COUNTER";
|
|
226
228
|
import ProcessSaleConfirmDialog from "./components/ProcessSaleConfirmDialog";
|
|
227
229
|
import AddPaymentDialog from "./dialogs/AddPaymentDialog";
|
|
228
|
-
import ManagerOverrideDialog
|
|
230
|
+
import ManagerOverrideDialog from "./dialogs/ManagerOverrideDialog";
|
|
229
231
|
import DiscountDialog from "./components/DiscountDialog";
|
|
230
232
|
import GlobalMixins from './mixins/global_mixins.js';
|
|
231
233
|
import SaleChooseSlotDialog from "./components/SaleChooseSlotDialog";
|
|
232
234
|
import DB_PRODUCT from './models/DB_PRODUCT';
|
|
233
|
-
import ProductClass
|
|
235
|
+
import ProductClass from './classes/ProductClass';
|
|
236
|
+
import moment from 'moment';
|
|
234
237
|
|
|
235
238
|
|
|
236
239
|
export default
|
|
@@ -239,6 +242,9 @@ export default
|
|
|
239
242
|
data: () =>
|
|
240
243
|
({
|
|
241
244
|
is_already_received_payment:false,
|
|
245
|
+
is_monthly_gc_limit_enabled:false,
|
|
246
|
+
slot_reference_gc:0,
|
|
247
|
+
slot_reference_monthly_gc:0,
|
|
242
248
|
is_already_choose_slot: false,
|
|
243
249
|
is_override_dialog_open : false,
|
|
244
250
|
is_sale_choose_slot_dialog_open: false,
|
|
@@ -355,8 +361,32 @@ export default
|
|
|
355
361
|
cancel: true,
|
|
356
362
|
persistent: true
|
|
357
363
|
}).onOk(async data => {
|
|
364
|
+
|
|
365
|
+
let gc_limit = this.public_settings.hasOwnProperty("monthly_gc_paylimit") ? this.public_settings.monthly_gc_paylimit : 0;
|
|
366
|
+
let is_gc_limit = 0;
|
|
367
|
+
if(gc_limit != 0)
|
|
368
|
+
{
|
|
369
|
+
let current_gc = selected_slot_info.gc_monthly_amount + this.grandTotal;
|
|
370
|
+
|
|
371
|
+
let default_utc_timezone = this.public_settings.hasOwnProperty('default_utc_timezone') ? this.public_settings.default_utc_timezone : 8;
|
|
372
|
+
let startOfMonth = moment().utc(default_utc_timezone).format("YYYY-MM-01");
|
|
373
|
+
|
|
374
|
+
if(selected_slot_info.gc_monthly_date != startOfMonth)
|
|
375
|
+
{
|
|
376
|
+
current_gc = this.grandTotal;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
if(current_gc > gc_limit)
|
|
380
|
+
{
|
|
381
|
+
is_gc_limit = 1;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
358
384
|
|
|
359
|
-
if(
|
|
385
|
+
if(is_gc_limit == 1)
|
|
386
|
+
{
|
|
387
|
+
this.$q.dialog({ title: "Warning", message: 'Your monthly gc limit has been exceeded.' });
|
|
388
|
+
}
|
|
389
|
+
else if((this.grandTotal > slot_code.points.gc) || !slot_code.points.gc )
|
|
360
390
|
{
|
|
361
391
|
this.$q.dialog({ title: "Warning", message: 'Your GC is not enough to continue this transaction' });
|
|
362
392
|
}
|
|
@@ -376,6 +406,12 @@ export default
|
|
|
376
406
|
{
|
|
377
407
|
this.gc_discount = true;
|
|
378
408
|
}
|
|
409
|
+
|
|
410
|
+
let gc_limit = this.public_settings.hasOwnProperty("monthly_gc_paylimit") ? this.public_settings.monthly_gc_paylimit : 0;
|
|
411
|
+
if(gc_limit != 0)
|
|
412
|
+
{
|
|
413
|
+
this.is_monthly_gc_limit_enabled = true;
|
|
414
|
+
}
|
|
379
415
|
},
|
|
380
416
|
unsetSlot()
|
|
381
417
|
{
|
|
@@ -586,7 +622,25 @@ export default
|
|
|
586
622
|
async getSelectedSlot(chosen_slot)
|
|
587
623
|
{
|
|
588
624
|
this.is_already_choose_slot = true;
|
|
589
|
-
this.slot_reference
|
|
625
|
+
this.slot_reference = chosen_slot.slot_code;
|
|
626
|
+
|
|
627
|
+
if(this.is_monthly_gc_limit_enabled == true)
|
|
628
|
+
{
|
|
629
|
+
let slot_details = await this.$_getSlotBySlotCode(this.slot_reference)
|
|
630
|
+
this.slot_reference_gc = slot_details.points.gc ? slot_details.points.gc : 0;
|
|
631
|
+
this.slot_reference_monthly_gc = slot_details.gc_monthly_amount ? slot_details.gc_monthly_amount : 0;
|
|
632
|
+
|
|
633
|
+
let default_utc_timezone = this.public_settings.hasOwnProperty('default_utc_timezone') ? this.public_settings.default_utc_timezone : 8;
|
|
634
|
+
let startOfMonth = moment().utc(default_utc_timezone).format("YYYY-MM-01");
|
|
635
|
+
|
|
636
|
+
if(slot_details.gc_monthly_date != startOfMonth)
|
|
637
|
+
{
|
|
638
|
+
this.slot_reference_monthly_gc = 0;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
|
|
590
644
|
if(this.slot_reference != 'no_slot')
|
|
591
645
|
{
|
|
592
646
|
this.chosen_slot_info = await this.db_slot.get(chosen_slot.slot_code)
|