2
0
mirror of https://github.com/frappe/books.git synced 2025-01-23 15:18:24 +00:00

fix: resolve warnings and refactor POS

This commit is contained in:
AbleKSaju 2024-11-04 16:42:58 +05:30
parent 87c3884299
commit fe75b3addf
3 changed files with 21 additions and 6 deletions

View File

@ -85,6 +85,7 @@ export default defineComponent({
isExapanded: false, isExapanded: false,
}; };
}, },
emits: ['toggleModal'],
computed: { computed: {
ratio() { ratio() {
return [0.1, 0.8, 0.4, 0.8, 0.8, 0.3]; return [0.1, 0.8, 0.4, 0.8, 0.8, 0.3];
@ -138,7 +139,7 @@ export default defineComponent({
}, },
methods: { methods: {
handleToggleModal(modal: string) { handleToggleModal(modal: string) {
this.$emit('toggle-modal', modal); this.$emit('toggleModal', modal);
}, },
async runSinvFormulas() { async runSinvFormulas() {
await this.sinvDoc.runFormulas(); await this.sinvDoc.runFormulas();

View File

@ -107,7 +107,15 @@
/> />
<div class="flex fixed bottom-0 p-1 mb-7 gap-x-3"> <div class="flex fixed bottom-0 p-1 mb-7 gap-x-3">
<POSQuickActions /> <POSQuickActions
:sinv-doc="sinvDoc"
:loyalty-points="loyaltyPoints"
:loyalty-program="loyaltyProgram"
:applied-coupons-count="appliedCouponsCount"
@toggle-view="toggleView"
@toggle-modal="toggleModal"
@emit-route-to-sinv-list="emitRouteToSinvList"
/>
</div> </div>
</div> </div>
</div> </div>
@ -395,6 +403,9 @@ export default defineComponent({
setTransferRefNo(ref: string) { setTransferRefNo(ref: string) {
this.transferRefNo = ref; this.transferRefNo = ref;
}, },
emitRouteToSinvList() {
this.$emit('routeToSinvList');
},
toggleView() { toggleView() {
this.tableView = !this.tableView; this.tableView = !this.tableView;
}, },

View File

@ -257,10 +257,10 @@
<div class="flex fixed bottom-0 p-1 ml-3 mb-7 gap-x-3"> <div class="flex fixed bottom-0 p-1 ml-3 mb-7 gap-x-3">
<POSQuickActions <POSQuickActions
:sinv-doc="sinvDoc"
:loyalty-points="loyaltyPoints" :loyalty-points="loyaltyPoints"
:loyalty-program="loyaltyProgram" :loyalty-program="loyaltyProgram"
:applied-coupons-count="appliedCouponsCount" :applied-coupons-count="appliedCouponsCount"
:sinv-doc="sinvDoc"
@toggle-view="toggleView" @toggle-view="toggleView"
@toggle-modal="toggleModal" @toggle-modal="toggleModal"
@emit-route-to-sinv-list="emitRouteToSinvList" @emit-route-to-sinv-list="emitRouteToSinvList"
@ -337,7 +337,6 @@ export default defineComponent({
disablePayButton: Boolean, disablePayButton: Boolean,
openPaymentModal: Boolean, openPaymentModal: Boolean,
openKeyboardModal: Boolean, openKeyboardModal: Boolean,
coupons: AppliedCouponCodes,
openCouponCodeModal: Boolean, openCouponCodeModal: Boolean,
openShiftCloseModal: Boolean, openShiftCloseModal: Boolean,
openSavedInvoiceModal: Boolean, openSavedInvoiceModal: Boolean,
@ -355,10 +354,14 @@ export default defineComponent({
type: Number, type: Number,
default: 0, default: 0,
}, },
sinvDoc: { coupons: {
type: SalesInvoice || undefined, type: Object as PropType<AppliedCouponCodes>,
default: () => ({}), default: () => ({}),
}, },
sinvDoc: {
type: Object as PropType<SalesInvoice | undefined>,
default: undefined,
},
itemQuantityMap: { itemQuantityMap: {
type: Object as PropType<ItemQtyMap>, type: Object as PropType<ItemQtyMap>,
default: () => ({}), default: () => ({}),