Ahora el disponible tiene en cuenta la tabla order_row
This commit is contained in:
parent
75e7d58479
commit
ee7c7c262f
|
@ -1,4 +1,4 @@
|
|||
hedera-web (1.229-deb8) stable; urgency=low
|
||||
hedera-web (1.230-deb8) stable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
|
|
|
@ -244,18 +244,22 @@ Vn.Catalog = new Class
|
|||
var model = this.$('item-lots');
|
||||
var grouping = model.get (row, 'grouping');
|
||||
var warehouse = model.get (row, 'warehouse_id');
|
||||
var available = model.get (row, 'available');
|
||||
|
||||
var lotAmount = this.items[warehouse];
|
||||
|
||||
if (lotAmount === undefined)
|
||||
lotAmount = 0;
|
||||
|
||||
lotAmount += grouping;
|
||||
|
||||
if (lotAmount <= model.get (row, 'available'))
|
||||
if (lotAmount < available)
|
||||
{
|
||||
this.items[warehouse] = lotAmount;
|
||||
this.$('amount').value += grouping;
|
||||
var newAmount = lotAmount + grouping;
|
||||
|
||||
if (newAmount > available)
|
||||
newAmount = available;
|
||||
|
||||
this.items[warehouse] = newAmount;
|
||||
this.$('amount').value += newAmount - lotAmount;
|
||||
}
|
||||
else
|
||||
Htk.Toast.showError (_('NoMoreAmountAvailable'));
|
||||
|
|
|
@ -44,18 +44,10 @@
|
|||
</db-model>
|
||||
<db-model id="item-lots" result-index="1" on-status-changed-after="onStatusChange">
|
||||
CALL bionic_from_item (#item);
|
||||
SELECT p.warehouse_id, p.grouping, p.price, p.rate,
|
||||
t.amount, l.available - IFNULL(t.amount, 0) available
|
||||
SELECT p.warehouse_id, p.grouping, p.price, p.rate, l.available
|
||||
FROM tmp.bionic_lot l
|
||||
JOIN tmp.bionic_price p
|
||||
ON p.warehouse_id = l.warehouse_id
|
||||
LEFT JOIN (
|
||||
SELECT warehouse_id, SUM(amount) amount
|
||||
FROM basket_item
|
||||
WHERE item_id = #item
|
||||
GROUP BY warehouse_id
|
||||
) t
|
||||
ON t.warehouse_id = l.warehouse_id
|
||||
ORDER BY warehouse_id, grouping;
|
||||
<sql-batch property="batch" id="lots-batch"/>
|
||||
</db-model>
|
||||
|
|
Loading…
Reference in New Issue