fixes #6169 invoiceIn con valores predeterminados
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Javi Gallego 2023-08-30 13:35:51 +02:00
parent 351096bd11
commit fea0db14e2
3 changed files with 18 additions and 12 deletions

View File

@ -67,17 +67,22 @@ class Controller extends Section {
}
openCreateDialog() {
this.dms = {
reference: null,
warehouseId: null,
companyId: null,
dmsTypeId: null,
description: null,
hasFile: true,
hasFileAttached: true,
files: null
};
this.$.dmsCreateDialog.show();
const params = {filter: {
where: {code: 'invoiceIn'}
}};
this.$http.get('DmsTypes/findOne', {params}).then(res => {
this.dms = {
reference: this.invoiceIn.supplierRef,
warehouseId: this.vnConfig.warehouseFk,
companyId: this.vnConfig.companyFk,
dmsTypeId: res.data.id,
description: this.invoiceIn.supplier.name,
hasFile: true,
hasFileAttached: true,
files: null
};
this.$.dmsCreateDialog.show();
});
}
downloadFile(dmsId) {

View File

@ -6,6 +6,7 @@ class Controller extends Section {
this.invoiceIn = {};
if (this.$params && this.$params.supplierFk)
this.invoiceIn.supplierFk = this.$params.supplierFk;
this.invoiceIn.issued = Date.vnNew();
}
get companyFk() {

View File

@ -26,7 +26,7 @@ describe('InvoiceIn', () => {
controller.$onInit();
expect(controller.invoiceIn).toEqual({});
expect(controller.invoiceIn).toBeDefined();
});
it(`should define invoiceIn and it's supplierFk when received via params`, () => {