Adaptación al nuevo calculo del bionic

This commit is contained in:
Juan Ferrer Toribio 2015-08-25 11:16:13 +02:00
parent 01e9a1e9c1
commit 8af6e0ca2b
6 changed files with 24 additions and 42 deletions

2
debian/links vendored
View File

@ -1 +1 @@
etc/hedera-web/apache.conf etc/apache/conf-available/hedera-web.conf
etc/hedera-web/apache.conf etc/apache2/conf-available/hedera-web.conf

View File

@ -17,14 +17,12 @@
</div>
<div>
<htk-grid show-header="false">
<db-model result-index="1" id="items" updatable="true">
CALL bionic_from_basket (@calc);
SELECT m.id, m.amount, t.available, a.Article, a.Categoria,
a.Medida, a.Tallos, a.Color, o.Abreviatura, m.price price, a.Foto
FROM basket_item m
INNER JOIN vn2008.Articles a ON a.Id_Article = m.item_id
LEFT JOIN vn2008.Origen o ON a.id_origen = o.id
LEFT JOIN cache.bionic t ON m.warehouse_id = t.warehouse_id AND m.item_id = t.item_id AND t.calc_id = @calc;
<db-model id="items" updatable="true">
SELECT i.id, i.amount, i.price, a.Article, a.Categoria,
a.Medida, a.Tallos, a.Color, o.Abreviatura, a.Foto
FROM basket_item i
INNER JOIN vn2008.Articles a ON a.Id_Article = i.item_id
LEFT JOIN vn2008.Origen o ON a.id_origen = o.id;
</db-model>
<htk-column-image column="Foto" directory="catalog" subdir="50x50" show-full="true"/>
<htk-column-text title="_Item" column="Article"/>

View File

@ -187,10 +187,7 @@ Vn.Catalog = new Class
,onAddItemClick: function (column, value, row, button)
{
var itemId = this.$('items-model').get (row, 'item_id')
var batch = this.$('lots-batch');
batch.addValue ('item', itemId);
batch.changed ();
this.$('lots-batch').addValue ('item', itemId);
this.itemId = itemId;
this.onEraseClick ();

View File

@ -207,9 +207,8 @@ div.amount
text-align: center;
background-color: #009688;
color: white;
height: 2em;
line-height: 2em;
padding: 0.4em;
line-height: 2.5em;
padding: 0.2em;
}
button.erase
{

View File

@ -23,20 +23,13 @@
GROUP BY warehouse_id
</db-query>
<db-model result-index="1" id="items-model">
CALL bionic_from_type (@calc, #type);
SELECT t.item_id, SUM(t.available) - IFNULL(m.amount, 0) available, MIN(t.price) price,
CALL bionic_from_type (#type);
SELECT t.item_id, t.available, t.price,
a.Foto, a.Article, a.Categoria, a.Medida, a.Tallos, a.Color, o.Abreviatura
FROM cache.bionic t
FROM vn2008.t_bionic_item t
JOIN vn2008.Articles a ON a.Id_Article = t.item_id
LEFT JOIN vn2008.Origen o ON a.id_origen = o.id
LEFT JOIN (
SELECT item_id, SUM(amount) amount
FROM basket_item
GROUP BY item_id
) m
ON m.item_id = t.item_id
WHERE t.calc_id = @calc AND t.available > 0
GROUP BY item_id
WHERE t.available > 0
ORDER BY a.Article, a.Medida
LIMIT 400;
<sql-batch property="batch" id="batch">
@ -44,27 +37,21 @@
</sql-batch>
</db-model>
<db-model id="item-lots" result-index="1" on-status-changed-after="onStatusChange">
CALL bionic_from_type (@calc, #type);
SELECT l.warehouse_id, l.items, l.grouping, l.price, l.rate,
t.amount, b.available - IFNULL(t.amount, 0) available
FROM cache.bionic b
CALL bionic_from_item (#item);
SELECT p.warehouse_id, p.items, p.grouping, p.price, p.rate,
t.amount, l.available - IFNULL(t.amount, 0) available
FROM vn2008.t_bionic_lot l
JOIN vn2008.t_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 = b.warehouse_id
JOIN cache.bionic_lot l
ON l.warehouse_id = b.warehouse_id
AND l.item_id = b.item_id
AND l.calc_id = @calc
WHERE b.calc_id = @calc
AND b.item_id = #item
ON t.warehouse_id = l.warehouse_id
ORDER BY warehouse_id, grouping;
<sql-batch property="batch" id="lots-batch" blocked="true">
<item name="type" param="type"/>
</sql-batch>
<sql-batch property="batch" id="lots-batch"/>
</db-model>
</vn-group>
<div id="form" class="catalog">
@ -174,6 +161,7 @@
src="image/dark/ok.svg"
alt="_Confirm"/>
</button>
<div class="clear"/>
</div>
</div>
<!--

View File

@ -37,7 +37,7 @@ Htk.ColumnImage = new Class
,value: false
},
/**
* Subdirectory where full image are allocated.
* Subdirectory where full images are allocated.
**/
fullDir:
{