2744-invoiceIn-module_rdy_n_summary #602

Merged
joan merged 10 commits from 2744-invoiceIn-module_rdy_n_summary into dev 2021-04-15 10:06:35 +00:00
5 changed files with 56 additions and 8 deletions
Showing only changes of commit 90a7c803fd - Show all commits

View File

@ -1,5 +1,8 @@
{
"InvoiceIn": {
"dataSource": "vn"
},
"InvoiceInDueDay": {
"dataSource": "vn"
}
}

View File

@ -0,0 +1,33 @@
{
"name": "InvoiceInDueDay",
"base": "VnModel",
"options": {
"mysql": {
"table": "invoiceInDueDay"
}
},
"properties": {
"id": {
"id": true,
"type": "number",
"description": "Identifier"
},
"invoiceInFk": {
"type": "number"
},
"dueDated": {
"type": "date"
},
"bankFk": {
"type": "number"
},
"amount": {
"type": "number"
},
"created": {
"type": "date"
}
}
}

View File

@ -44,6 +44,11 @@
}
},
"relations": {
"invoiceInDueDay": {
"type": "hasMany",
"model": "InvoiceInDueDay",
"foreignKey": "invoiceInFk"
},
"company": {
"type": "belongsTo",
"model": "Company",

View File

@ -4,13 +4,23 @@ import ModuleCard from 'salix/components/module-card';
class Controller extends ModuleCard {
reload() {
const filter = {
include: {
include: [
{
relation: 'supplier'
},
{
relation: 'invoiceInDueDay'
}
};
]};
this.$http.get(`InvoiceIns/${this.$params.id}`, {filter})
.then(res => this.invoiceIn = res.data);
.then(res => {
this.invoiceIn = res.data;
this.invoiceIn.amount = res.data.invoiceInDueDay.reduce(
(accumulator, currentValue) => {
return accumulator + (currentValue['amount'] || 0);
}, 0);
});
}
}

View File

@ -1,3 +0,0 @@
Entries list: Listado de entradas
Invoice list: Listado de facturas
InvoiceIn deleted: Factura eliminada