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

incr: posShiftOpen modal

This commit is contained in:
akshayitzme 2023-08-22 18:27:40 +05:30 committed by akshayitzme
parent b9b2f3d49e
commit 06da764309

View File

@ -74,7 +74,7 @@ export default defineComponent({
doc: computed(() => this.posShiftDoc),
};
},
emits: ['toggleShiftOpenModal'],
emits: ['toggleModal'],
data() {
return {
posShiftDoc: undefined as POSShift | undefined,
@ -92,6 +92,7 @@ export default defineComponent({
this.posShiftDoc = fyo.singles[ModelNameEnum.POSShift];
await this.seedDefaults();
this.isValuesSeeded = true;
},
methods: {
async seedDefaultCashDenomiations() {
@ -142,10 +143,8 @@ export default defineComponent({
return;
}
this.isValuesSeeded = false;
await this.seedDefaultCashDenomiations();
await this.seedPaymentMethods();
this.isValuesSeeded = true;
},
getField(fieldname: string) {
return this.fyo.getField(ModelNameEnum.POSShift, fieldname);
@ -166,9 +165,13 @@ export default defineComponent({
this.setOpeningCashAmount();
},
async handleSubmit() {
await this.posShiftDoc?.set('isShiftOpen', true);
await this.posShiftDoc?.setMultiple({
isShiftOpen: true,
openingDate: new Date(),
});
await this.posShiftDoc?.sync();
this.$emit('toggleShiftOpenModal');
this.$emit('toggleModal', 'ShiftOpen');
},
},
});