Tags disaplayed in tickets and orders

This commit is contained in:
Juan 2018-03-27 17:26:17 +02:00
parent 3b14d419d6
commit 0313b8729f
6 changed files with 99 additions and 68 deletions

View File

@ -20,23 +20,23 @@ Hedera.Basket = new Class
,activate: function ()
{
this.$('items').setInfo ('i', 'basket_item', 'hedera');
this.$('items').setInfo ('bi', 'myBasketItem', 'hedera');
}
,onConfigureClick: function ()
{
Htk.Toast.showWarning (_('RememberReconfiguringImpact'));
this.hash.set ({'form': 'ecomerce/checkout'});
this.hash.set ({form: 'ecomerce/checkout'});
}
,onCatalogClick: function ()
{
this.hash.set ({'form': 'ecomerce/catalog'});
this.hash.set ({form: 'ecomerce/catalog'});
}
,onCheckoutClick: function ()
{
this.hash.set ({'form': 'ecomerce/confirm'});
this.hash.set ({form: 'ecomerce/confirm'});
}
,repeaterFunc: function (res, form)

View File

@ -42,7 +42,7 @@
.basket .line > .delete
{
margin: -0.5em;
margin-top: .3em;
margin-top: 1em;
margin-right: .5em;
float: left;
}
@ -51,14 +51,28 @@
margin-right: 1em;
float: left;
border-radius: 50%;
height: 3.2em;
width: 3.2em;
height: 4.25em;
width: 4.25em;
}
.basket .line > p
.basket .line > .info
{
margin: .1em 0;
margin-left: 7.5em;
}
.basket .line > .info > h2
{
font-size: 1em;
font-weight: normal;
padding: 0;
padding-bottom: .1em;
}
.basket .line > .info > p
{
margin: 0;
}
.basket .line > .info > .tags
{
color: #777;
}
.basket .line .subtotal
{
float: right;

View File

@ -29,42 +29,48 @@
<div class="lines">
<htk-repeater form-id="iter" renderer="repeaterFunc">
<db-model id="items" property="model" updatable="true">
<custom>
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
JOIN vn2008.Articles a ON a.Id_Article = i.item_id
LEFT JOIN vn2008.Origen o ON a.id_origen = o.id
</custom>
SELECT bi.id, bi.amount, bi.price, i.name item, i.image
t.tag1, t.val1, t.tag2, t.val2, t.tag3, t.val3
FROM myBasketItem bi
JOIN vn.item i ON i.id = bi.itemFk
LEFT JOIN vn.itemTagArranged t ON t.itemFk = i.id
</db-model>
<custom>
<div class="line">
<htk-button
form="iter"
column="ticket_id"
column="id"
class="delete"
tip="_Remove"
icon="delete"
on-click="onDeleteClick"/>
<htk-image
form="iter"
column="Foto"
column="image"
class="photo"
directory="catalog"
subdir="200x200"
full-dir="900x900"/>
<p class="concept">
<htk-text form="iter" column="Article"/>
<htk-text form="iter" column="Medida"/>
<htk-text form="iter" column="Categoria"/>
</p>
<p class="amount">
<htk-text form="iter" column="amount"/> x
<htk-text form="iter" column="price" format="%.2d€"/>
<span class="subtotal">
<htk-text id="subtotal" format="%.2d€"/>
</span>
</p>
<div class="info">
<h2>
<htk-text form="iter" column="item"/>
</h2>
<p class="tags">
<htk-text form="iter" column="tag1"/>
<htk-text form="iter" column="val1"/>,
<htk-text form="iter" column="tag2"/>
<htk-text form="iter" column="val2"/>,
<htk-text form="iter" column="tag3"/>
<htk-text form="iter" column="val3"/>
</p>
<p class="amount">
<htk-text form="iter" column="amount"/> x
<htk-text form="iter" column="price" format="%.2d€"/>
<span class="subtotal">
<htk-text id="subtotal" format="%.2d€"/>
</span>
</p>
</div>
<div class="clear"/>
</div>
</custom>

View File

@ -50,27 +50,42 @@
/* Lines */
.ticket .line
{
padding: .5em 0;
}
.ticket .line > .photo
{
margin-right: 1em;
float: left;
border-radius: 50%;
height: 3.2em;
width: 3.2em;
height: 4.25em;
width: 4.25em;
}
.ticket .line
.ticket .line > .info
{
padding: .5em 0;
margin-left: 5.25em;
}
.ticket .line p
.ticket .line > .info > h2
{
margin: .1em 0;
font-size: 1em;
font-weight: normal;
padding: 0;
padding-bottom: .1em;
}
.ticket .amount
.ticket .line > .info > p
{
margin: 0;
}
.ticket .line > .info > .tags
{
color: #777;
}
.ticket .line > .info > .amount
{
float: left;
}
.ticket .subtotal
.ticket .line > .info > .subtotal
{
float: right;
}

View File

@ -9,9 +9,7 @@
</sql-batch>
<db-form id="ticket" on-ready="onTicketReady">
<db-model id="ticket-data" property="model" batch="batch">
<custom>
CALL myTicketGet (#ticket)
</custom>
CALL myTicketGet (#ticket)
</db-model>
</db-form>
</vn-group>
@ -67,9 +65,7 @@
property="model"
id="movements"
batch="batch">
<custom>
CALL myTicketGetRows (#ticket)
</custom>
CALL myTicketGetRows (#ticket)
</db-model>
<custom>
<div class="line">
@ -80,18 +76,26 @@
directory="catalog"
subdir="200x200"
full-dir="900x900"/>
<p class="concept">
<htk-text form="iter" column="concept"/>
<htk-text form="iter" column="size"/>
<htk-text form="iter" column="category"/>
</p>
<p class="amount">
<htk-text form="iter" column="quantity"/> x
<htk-text form="iter" column="price" format="%.2d€"/>
</p>
<p class="subtotal">
<htk-text id="subtotal" format="%.2d€"/>
</p>
<div class="info">
<h2>
<htk-text form="iter" column="concept"/>
</h2>
<p class="tags">
<htk-text form="iter" column="tag1"/>
<htk-text form="iter" column="val1"/>,
<htk-text form="iter" column="tag2"/>
<htk-text form="iter" column="val2"/>,
<htk-text form="iter" column="tag3"/>
<htk-text form="iter" column="val3"/>
</p>
<p class="amount">
<htk-text form="iter" column="quantity"/> x
<htk-text form="iter" column="price" format="%.2d€"/>
</p>
<p class="subtotal">
<htk-text id="subtotal" format="%.2d€"/>
</p>
</div>
<div class="clear"/>
</div>
</custom>
@ -101,9 +105,7 @@
property="model"
on-status-changed="onPackagesChanged"
batch="batch">
<custom>
CALL myTicketGetPackages (#ticket)
</custom>
CALL myTicketGetPackages (#ticket)
</db-model>
<custom>
<div class="line">

View File

@ -2,9 +2,7 @@
<vn-group>
<db-form id="ticket" on-ready="onTicketReady">
<db-model property="model" id="ticket-data" conn="conn" batch="batch">
<custom>
CALL myTicketGet (#ticket)
</custom>
CALL myTicketGet (#ticket)
</db-model>
</db-form>
</vn-group>
@ -37,9 +35,7 @@
</div>
<htk-grid>
<db-model property="model" id="movements" conn="conn" batch="batch">
<custom>
CALL myTicketGetRows (#ticket)
</custom>
CALL myTicketGetRows (#ticket)
</db-model>
<htk-column-spin title="_Ref" column="itemFk"/>
<htk-column-spin title="_Amount" column="quantity"/>
@ -64,9 +60,7 @@
conn="conn"
batch="batch"
on-status-changed="onPackagesChanged">
<custom>
CALL myTicketGetPackages (#ticket)
</custom>
CALL myTicketGetPackages (#ticket)
</db-model>
<htk-column-spin title="_Ref" column="id"/>
<htk-column-spin title="_Amount" column="quantity"/>