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() { openCreateDialog() {
this.dms = { const params = {filter: {
reference: null, where: {code: 'invoiceIn'}
warehouseId: null, }};
companyId: null, this.$http.get('DmsTypes/findOne', {params}).then(res => {
dmsTypeId: null, this.dms = {
description: null, reference: this.invoiceIn.supplierRef,
hasFile: true, warehouseId: this.vnConfig.warehouseFk,
hasFileAttached: true, companyId: this.vnConfig.companyFk,
files: null dmsTypeId: res.data.id,
}; description: this.invoiceIn.supplier.name,
this.$.dmsCreateDialog.show(); hasFile: true,
hasFileAttached: true,
files: null
};
this.$.dmsCreateDialog.show();
});
} }
downloadFile(dmsId) { downloadFile(dmsId) {

View File

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

View File

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