mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
incr: posShiftOpen modal
This commit is contained in:
parent
b9b2f3d49e
commit
06da764309
@ -74,7 +74,7 @@ export default defineComponent({
|
|||||||
doc: computed(() => this.posShiftDoc),
|
doc: computed(() => this.posShiftDoc),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
emits: ['toggleShiftOpenModal'],
|
emits: ['toggleModal'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
posShiftDoc: undefined as POSShift | undefined,
|
posShiftDoc: undefined as POSShift | undefined,
|
||||||
@ -92,6 +92,7 @@ export default defineComponent({
|
|||||||
this.posShiftDoc = fyo.singles[ModelNameEnum.POSShift];
|
this.posShiftDoc = fyo.singles[ModelNameEnum.POSShift];
|
||||||
|
|
||||||
await this.seedDefaults();
|
await this.seedDefaults();
|
||||||
|
this.isValuesSeeded = true;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async seedDefaultCashDenomiations() {
|
async seedDefaultCashDenomiations() {
|
||||||
@ -142,10 +143,8 @@ export default defineComponent({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.isValuesSeeded = false;
|
|
||||||
await this.seedDefaultCashDenomiations();
|
await this.seedDefaultCashDenomiations();
|
||||||
await this.seedPaymentMethods();
|
await this.seedPaymentMethods();
|
||||||
this.isValuesSeeded = true;
|
|
||||||
},
|
},
|
||||||
getField(fieldname: string) {
|
getField(fieldname: string) {
|
||||||
return this.fyo.getField(ModelNameEnum.POSShift, fieldname);
|
return this.fyo.getField(ModelNameEnum.POSShift, fieldname);
|
||||||
@ -166,9 +165,13 @@ export default defineComponent({
|
|||||||
this.setOpeningCashAmount();
|
this.setOpeningCashAmount();
|
||||||
},
|
},
|
||||||
async handleSubmit() {
|
async handleSubmit() {
|
||||||
await this.posShiftDoc?.set('isShiftOpen', true);
|
await this.posShiftDoc?.setMultiple({
|
||||||
|
isShiftOpen: true,
|
||||||
|
openingDate: new Date(),
|
||||||
|
});
|
||||||
|
|
||||||
await this.posShiftDoc?.sync();
|
await this.posShiftDoc?.sync();
|
||||||
this.$emit('toggleShiftOpenModal');
|
this.$emit('toggleModal', 'ShiftOpen');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user