mirror of
https://github.com/frappe/books.git
synced 2024-12-22 10:58:59 +00:00
feat: add applied coupons count
This commit is contained in:
parent
6e2fdfc5be
commit
81cc3407f2
@ -203,6 +203,7 @@ export default defineComponent({
|
||||
);
|
||||
|
||||
await updatePricingRule(this.sinvDoc);
|
||||
this.$emit('setCouponsCount', this.sinvDoc.coupons?.length);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -38,6 +38,7 @@
|
||||
|
||||
<CouponCodeModal
|
||||
:open-modal="openCouponCodeModal"
|
||||
@set-coupons-count="setCouponsCount"
|
||||
@toggle-modal="toggleModal"
|
||||
/>
|
||||
|
||||
@ -48,6 +49,7 @@
|
||||
@set-cash-amount="setCashAmount"
|
||||
@set-transfer-amount="setTransferAmount"
|
||||
@set-transfer-ref-no="setTransferRefNo"
|
||||
@set-coupons-count="setCouponsCount"
|
||||
@set-transfer-clearance-date="setTransferClearanceDate"
|
||||
/>
|
||||
|
||||
@ -691,6 +693,7 @@ export default defineComponent({
|
||||
async activated() {
|
||||
toggleSidebar(false);
|
||||
validateIsPosSettingsSet(fyo);
|
||||
this.setCouponCodeDoc();
|
||||
this.setSinvDoc();
|
||||
this.setDefaultCustomer();
|
||||
await this.setItemQtyMap();
|
||||
@ -790,6 +793,14 @@ export default defineComponent({
|
||||
isPOS: true,
|
||||
}) as SalesInvoice;
|
||||
},
|
||||
setCouponCodeDoc() {
|
||||
this.coupons = this.fyo.doc.getNewDoc(
|
||||
ModelNameEnum.AppliedCouponCodes
|
||||
) as AppliedCouponCodes;
|
||||
},
|
||||
setAppliedCoupons() {
|
||||
this.appliedCoupons = this.sinvDoc.coupons as AppliedCouponCodes[];
|
||||
},
|
||||
setTotalQuantity() {
|
||||
this.totalQuantity = getTotalQuantity(
|
||||
this.sinvDoc.items as SalesInvoiceItem[]
|
||||
@ -798,6 +809,9 @@ export default defineComponent({
|
||||
setTotalTaxedAmount() {
|
||||
this.totalTaxedAmount = getTotalTaxedAmount(this.sinvDoc as SalesInvoice);
|
||||
},
|
||||
setCouponsCount(value: number) {
|
||||
this.appliedCouponsCount = value;
|
||||
},
|
||||
async setLoyaltyPoints(value: number) {
|
||||
this.appliedLoyaltyPoints = value;
|
||||
|
||||
|
@ -169,7 +169,7 @@
|
||||
class="w-full bg-blue-500"
|
||||
style="padding: 1.35rem"
|
||||
:disabled="disableSubmitButton"
|
||||
@click="$emit('createTransaction')"
|
||||
@click="submitTransaction()"
|
||||
>
|
||||
<slot>
|
||||
<p class="uppercase text-lg text-white font-semibold">
|
||||
@ -224,6 +224,7 @@ export default defineComponent({
|
||||
'setTransferClearanceDate',
|
||||
'setTransferRefNo',
|
||||
'toggleModal',
|
||||
'setCouponsCount',
|
||||
],
|
||||
setup() {
|
||||
return {
|
||||
@ -320,6 +321,10 @@ export default defineComponent({
|
||||
this.$emit('setTransferAmount', fyo.pesa(0));
|
||||
this.$emit('setCashAmount', this.sinvDoc?.grandTotal);
|
||||
},
|
||||
submitTransaction() {
|
||||
this.$emit('createTransaction');
|
||||
this.$emit('setCouponsCount', 0);
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user