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>
<div> <div>
<htk-grid show-header="false"> <htk-grid show-header="false">
<db-model result-index="1" id="items" updatable="true"> <db-model id="items" updatable="true">
CALL bionic_from_basket (@calc); SELECT i.id, i.amount, i.price, a.Article, a.Categoria,
SELECT m.id, m.amount, t.available, a.Article, a.Categoria, a.Medida, a.Tallos, a.Color, o.Abreviatura, a.Foto
a.Medida, a.Tallos, a.Color, o.Abreviatura, m.price price, a.Foto FROM basket_item i
FROM basket_item m INNER JOIN vn2008.Articles a ON a.Id_Article = i.item_id
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 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> </db-model>
<htk-column-image column="Foto" directory="catalog" subdir="50x50" show-full="true"/> <htk-column-image column="Foto" directory="catalog" subdir="50x50" show-full="true"/>
<htk-column-text title="_Item" column="Article"/> <htk-column-text title="_Item" column="Article"/>

View File

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

View File

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

View File

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

View File

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