2744-invoiceIn-module_rdy_n_summary #602
|
@ -1,5 +1,8 @@
|
|||
{
|
||||
"InvoiceIn": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"InvoiceInDueDay": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -44,6 +44,11 @@
|
|||
}
|
||||
},
|
||||
"relations": {
|
||||
"invoiceInDueDay": {
|
||||
"type": "hasMany",
|
||||
"model": "InvoiceInDueDay",
|
||||
"foreignKey": "invoiceInFk"
|
||||
},
|
||||
"company": {
|
||||
"type": "belongsTo",
|
||||
"model": "Company",
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
Entries list: Listado de entradas
|
||||
Invoice list: Listado de facturas
|
||||
InvoiceIn deleted: Factura eliminada
|
Loading…
Reference in New Issue