2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 03:19:01 +00:00

incr: added pos open & close modal

This commit is contained in:
akshayitzme 2023-08-22 18:30:58 +05:30 committed by akshayitzme
parent 79ef11bb23
commit e7486db8ad

View File

@ -3,7 +3,7 @@
<PageHeader :title="t`NeuPOS`">
<slot>
<div class="flex justify-end">
<Button class="bg-red-500">
<Button class="bg-red-500" @click="toggleModal('ShiftClose')">
<span class="text-white font-medium">{{
t`Close POS Shift `
}}</span>
@ -12,37 +12,53 @@
</slot>
</PageHeader>
<OpenPOSShift
<OpenPOSShiftModal
:open-modal="!isPosShiftOpen"
@toggle-shift-open-modal="toggleShiftOpenModal"
@toggle-modal="toggleModal"
/>
<ClosePOSShiftModal
:open-modal="openShiftCloseModal"
@toggle-modal="toggleModal"
/>
<PaymentModal />
</div>
</template>
<script lang="ts">
import Button from 'src/components/Button.vue';
import OpenPOSShift from './OpenPOSShift.vue';
import ClosePOSShiftModal from './ClosePOSShiftModal.vue';
import OpenPOSShiftModal from './OpenPOSShiftModal.vue';
import PageHeader from 'src/components/PageHeader.vue';
import { defineComponent } from 'vue';
import { fyo } from 'src/initFyo';
import PaymentModal from './PaymentModal.vue';
export default defineComponent({
name: 'NeuPOS',
components: { Button, OpenPOSShift, PageHeader },
components: {
Button,
ClosePOSShiftModal,
OpenPOSShiftModal,
PageHeader,
PaymentModal,
},
data() {
return {
openShiftOpenModal: false,
openShiftCloseModal: false,
};
},
computed: {
isPosShiftOpen: () => !!fyo.singles.POSShift?.isShiftOpen,
},
methods: {
toggleShiftOpenModal(value?: boolean): boolean {
toggleModal(modal: 'ShiftOpen' | 'ShiftClose', value?: boolean) {
if (value) {
return (this.openShiftOpenModal = value);
return (this[`open${modal}Modal`] = value);
}
return (this.openShiftOpenModal = !this.openShiftOpenModal);
return (this[`open${modal}Modal`] = !this[`open${modal}Modal`]);
},
},
});