Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/dev This commit looks good
Details
gitea/salix/dev This commit looks good
Details
This commit is contained in:
commit
1cc8b5512e
|
@ -3,7 +3,7 @@ View item: Ver artículo
|
||||||
Category: Reino
|
Category: Reino
|
||||||
Description: Descripción
|
Description: Descripción
|
||||||
Size: Medida
|
Size: Medida
|
||||||
Type: Familia
|
Item family: Familia
|
||||||
Name: Nombre
|
Name: Nombre
|
||||||
Full name: Nombre completo
|
Full name: Nombre completo
|
||||||
Relevancy: Relevancia
|
Relevancy: Relevancia
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<vn-label-value label="Full name"
|
<vn-label-value label="Full name"
|
||||||
value="{{$ctrl.summary.item.longName}}">
|
value="{{$ctrl.summary.item.longName}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value label="Type"
|
<vn-label-value label="Item family"
|
||||||
value="{{$ctrl.summary.item.itemType.name}}">
|
value="{{$ctrl.summary.item.itemType.name}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value label="Size"
|
<vn-label-value label="Size"
|
||||||
|
|
|
@ -162,6 +162,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
if (sale.quantity > originalSale.quantity)
|
if (sale.quantity > originalSale.quantity)
|
||||||
throw new UserError('Invalid quantity');
|
throw new UserError('Invalid quantity');
|
||||||
|
|
||||||
// Update original sale
|
// Update original sale
|
||||||
const rest = originalSale.quantity - sale.quantity;
|
const rest = originalSale.quantity - sale.quantity;
|
||||||
const updatedSale = await models.Sale.updateAll({
|
const updatedSale = await models.Sale.updateAll({
|
||||||
|
@ -173,7 +174,7 @@ module.exports = Self => {
|
||||||
newSale.ticketFk = ticketId;
|
newSale.ticketFk = ticketId;
|
||||||
newSale.quantity = sale.quantity;
|
newSale.quantity = sale.quantity;
|
||||||
|
|
||||||
await models.Sale.create(newSale, options);
|
const createdSale = await models.Sale.create(newSale, options);
|
||||||
|
|
||||||
// Clone sale components
|
// Clone sale components
|
||||||
const saleComponents = await models.SaleComponent.find({
|
const saleComponents = await models.SaleComponent.find({
|
||||||
|
@ -187,6 +188,6 @@ module.exports = Self => {
|
||||||
|
|
||||||
await models.SaleComponent.create(newComponents, options);
|
await models.SaleComponent.create(newComponents, options);
|
||||||
|
|
||||||
return [updatedSale, createdSale];
|
return updatedSale;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue