Merge branch 'dev' of http://git.verdnatura.es/salix into dev
This commit is contained in:
commit
9fd95bdc7e
|
@ -11,6 +11,7 @@
|
|||
<vn-autocomplete vn-one
|
||||
label="Class"
|
||||
field="tax.taxClassFk"
|
||||
initial-data="tax.taxClass"
|
||||
data="$ctrl.classes"
|
||||
value-field="id"
|
||||
show-field="description">
|
||||
|
|
|
@ -10,6 +10,9 @@ export default class Controller {
|
|||
include: [{
|
||||
relation: 'country',
|
||||
scope: {fields: ['country']}
|
||||
}, {
|
||||
relation: 'taxClass',
|
||||
scope: {fields: ['id', 'description']}
|
||||
}]
|
||||
};
|
||||
|
||||
|
|
|
@ -27,11 +27,15 @@ module.exports = Self => {
|
|||
|
||||
Self.updateTaxes = async (id, taxes) => {
|
||||
let promises = [];
|
||||
for (let tax of taxes)
|
||||
for (let tax of taxes) {
|
||||
if (!tax.taxClassFk)
|
||||
throw new Error('Tax class cannot be blank');
|
||||
|
||||
promises.push(Self.app.models.ItemTaxCountry.updateAll(
|
||||
{id: tax.id},
|
||||
{taxClassFk: tax.taxClassFk}
|
||||
));
|
||||
}
|
||||
await Promise.all(promises);
|
||||
return true;
|
||||
};
|
||||
|
|
|
@ -9,14 +9,16 @@
|
|||
"properties": {
|
||||
"id": {
|
||||
"type": "Number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
"description": "Identifier",
|
||||
"id": true
|
||||
},
|
||||
"description": {
|
||||
"type": "String"
|
||||
"type": "String",
|
||||
"required": true
|
||||
},
|
||||
"code": {
|
||||
"type": "String"
|
||||
"type": "String",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
|
|
Loading…
Reference in New Issue