Sección estanterias acabada

This commit is contained in:
Juan Ferrer Toribio 2015-10-24 01:41:11 +02:00
parent 6886f436a9
commit b0e614894e
11 changed files with 101 additions and 77 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.234-deb8) stable; urgency=low
hedera-web (1.235-deb8) stable; urgency=low
* Initial Release.

View File

@ -5,14 +5,20 @@ Vn.Shelves = new Class
,activate: function ()
{
this.$('report-title').value = 'Anthuriums';
this.$('warehouse').value = 44;
this.$('date').value = new Date ();
this.$('shelf').value = 4;
this.$('reign').value = 1;
this.$('family').value = 2;
this.$('filter').value = 'Ant %';
this.$('filter').value = 'Ant ';
this.$('max-amount').value = 50;
this.$('show-packing').value = true;
this.$('stack').value = true;
}
,onFamilyChange: function ()
{
this.$('report-title').value = this.$('family').get ('Tipo');
}
,onPreviewClick: function ()
@ -28,6 +34,8 @@ Vn.Shelves = new Class
report.setParams (
this.$('report-title').value,
this.$('max-amount').value,
this.$('show-packing').value,
this.$('stack').value,
batch
);
report.open ();
@ -41,11 +49,13 @@ Vn.ShelvesReport = new Class
,nItem: -1
,nColors: 4
,setParams: function (title, maxAmount, batch)
,setParams: function (title, maxAmount, showPacking, stack, batch)
{
this.title = title;
this.maxAmount = maxAmount;
this.batch = batch;
this.showPacking = showPacking;
this.stack = stack;
}
,open: function ()
@ -88,7 +98,8 @@ Vn.ShelvesReport = new Class
if (res.get ('etiquetas') <= this.maxAmount)
{
items.push ({
name: res.get ('Article') +' x'+ res.get ('Medida')
name: res.get ('Article')
,packing: res.get ('packing')
,boxHeight: res.get ('z') * 10 * scale
,boxWidth: res.get ('x') * 10 * scale
,amount: res.get ('etiquetas')
@ -97,7 +108,8 @@ Vn.ShelvesReport = new Class
else
{
remainings.push ({
name: res.get ('Article') +' x'+ res.get ('Medida')
name: res.get ('Article')
,packing: res.get ('packing')
,amount: res.get ('etiquetas')
});
}
@ -108,6 +120,7 @@ Vn.ShelvesReport = new Class
alloc.items = items;
alloc.shelfFunc = this.drawShelf.bind (this);
alloc.boxFunc = this.drawBox.bind (this);
alloc.stack = this.stack;
alloc.nTrays = Math.ceil (
(shelf.height - shelf.firstTrayElevation) /
(shelf.trayHeight + shelf.trayDensity)
@ -130,7 +143,8 @@ Vn.ShelvesReport = new Class
this.doc.body.appendChild (sheet);
var title = this.doc.createElement ('h1');
title.appendChild (this.doc.createTextNode (_('Palets')));
title.appendChild (this.doc.createTextNode (this.title +' - '));
title.appendChild (this.doc.createTextNode (_('Pallets')));
sheet.appendChild (title);
var ul = this.doc.createElement ('ul');
@ -145,7 +159,10 @@ Vn.ShelvesReport = new Class
span.className = 'item';
span.appendChild (this.doc.createTextNode (remainings[i].name));
li.appendChild (span);
if (this.showPacking)
span.appendChild (this.doc.createTextNode (' '+ remainings[i].packing));
var span = this.doc.createElement ('span');
span.className = 'amount';
span.appendChild (this.doc.createTextNode (remainings[i].amount));
@ -247,11 +264,18 @@ Vn.ShelvesReport = new Class
if (amount == 0 || allocator.firstShelfBox)
{
if (this.showPacking)
{
var packing = this.doc.createElement ('span');
packing.className = 'packing';
packing.appendChild (this.doc.createTextNode (item.packing));
box.appendChild (packing);
}
var boxLabel = this.doc.createElement ('span');
boxLabel.className = 'box-label';
boxLabel.appendChild (this.doc.createTextNode (item.name));
box.appendChild (boxLabel);
var text = this.doc.createTextNode (item.name);
boxLabel.appendChild (text);
}
}
});
@ -301,7 +325,8 @@ Vn.Allocator = new Class
trayHeight = this.topTrayHeight;
if (this.trayY + item.boxHeight > trayHeight
|| item.boxWidth > this.lastBoxWidth)
|| item.boxWidth > this.lastBoxWidth
|| (!this.stack && amount == 0))
this.addColumn (item.boxWidth);
if (this.boxFunc)

View File

@ -23,7 +23,7 @@
display: block;
margin-bottom: 0.5em;
}
.shelves input,
.shelves input[type=text],
.shelves select
{
margin: 0;

View File

@ -6,8 +6,25 @@
<div class="box">
<div class="body">
<div class="form-group">
<label><t>Title</t></label>
<htk-entry id="report-title"/>
<label><t>Reign</t></label>
<htk-combo id="reign">
<db-model property="model" id="reigns">
SELECT id, reino FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino
</db-model>
</htk-combo>
</div>
<div class="form-group">
<label><t>Family</t></label>
<htk-combo id="family" on-changed="onFamilyChange" on-ready="onFamilyChange">
<db-model property="model">
SELECT tipo_id, Tipo FROM vn2008.Tipos
WHERE reino_id = #reign ORDER BY Tipo
<sql-batch property="batch">
<item name="reign" param="reign"/>
</sql-batch>
</db-model>
</htk-combo>
</div>
<div class="form-group">
<label><t>Store</t></label>
@ -31,34 +48,25 @@
</htk-combo>
</div>
<div class="form-group">
<label><t>Reign</t></label>
<htk-combo id="reign">
<db-model property="model" id="reigns">
SELECT id, reino FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino
</db-model>
</htk-combo>
</div>
<div class="form-group">
<label><t>Family</t></label>
<htk-combo id="family">
<db-model property="model">
SELECT tipo_id, Tipo FROM vn2008.Tipos
WHERE reino_id = #reign ORDER BY Tipo
<sql-batch property="batch">
<item name="reign" param="reign"/>
</sql-batch>
</db-model>
</htk-combo>
</div>
<div class="form-group">
<label><t>Name filter</t></label>
<label><t>Name prefix</t></label>
<input type="text" id="filter"/>
</div>
<div class="form-group">
<label><t>Max amount</t></label>
<label><t>Limit amount per item</t></label>
<htk-entry id="max-amount"/>
</div>
<div class="form-group">
<label><t>Title</t></label>
<htk-entry id="report-title"/>
</div>
<div class="form-group">
<label><t>Show packing</t></label>
<htk-check id="show-packing"/>
</div>
<div class="form-group">
<label><t>Stack different items</t></label>
<htk-check id="stack"/>
</div>
</div>
<div class="footer">
<button class="thin" on-click="onPreviewClick">

View File

@ -99,8 +99,8 @@ Htk.Select = new Class
else
value = null;
this.valueChanged (value);
this.setRow (row);
this.valueChanged (value);
}
,addOption: function (value, text)
@ -129,6 +129,7 @@ Htk.Select = new Class
this.addOption (data[i][this.showColumnIndex], data[i][1]);
this.selectOption ();
this.signalEmit ('ready');
break;
}
case Db.Model.Status.ERROR:

View File

@ -1,11 +1 @@
{
"Title": "Título"
,"Store": "Almacén"
,"Date": "Fecha"
,"Shelf": "Estantería"
,"Reign": "Reino"
,"Family": "Familia"
,"Name filter": "Filtro por nombre"
,"Max amount": "Cantidad máxima"
,"Preview": "Mostrar"
}
{}

View File

@ -76,7 +76,7 @@ Vn.Locale.add
,"Visits": "Visites"
,"News": "Noticies"
,"Photos": "Fotos"
,"Shelves": "Estanterías"
,"Shelves": "Estanteríes"
,"Contact": "Vull ser client"
,"Training": "Formació"
,"Agencies": "Agències"

View File

@ -1,11 +1,16 @@
{
"Title": "Título"
"Reign": "Reino"
,"Family": "Familia"
,"Store": "Almacén"
,"Date": "Fecha"
,"Shelf": "Estantería"
,"Reign": "Reino"
,"Family": "Familia"
,"Name filter": "Filtro por nombre"
,"Max amount": "Cantidad máxima"
,"Name prefix": "Prefijo del nombre"
,"Limit amount per item": "Límite de cantidad por artículo"
,"Title": "Título"
,"Show packing": "Mostrar unidades por caja"
,"Stack different items": "Apilar artículos distintos"
,"Preview": "Mostrar"
,"Pallets": "Palets"
}

View File

@ -1,11 +1 @@
{
"Title": "Título"
,"Store": "Almacén"
,"Date": "Fecha"
,"Shelf": "Estantería"
,"Reign": "Reino"
,"Family": "Familia"
,"Name filter": "Filtro por nombre"
,"Max amount": "Cantidad máxima"
,"Preview": "Mostrar"
}
{}

View File

@ -56,7 +56,7 @@ Vn.Locale.add
,"CookiesNotification": "En utilisant ce site, vous acceptez l'utilisation de cookies pour personnaliser le contenu et l'analyse."
,"ReturnToOldWebsite": "Ancien site web"
,"TestTheNewWebsite": "Testez le nouveau site!"
,"Print": "Imprimir"
,"Print": "Print"
,"Menu": "Menu"
@ -76,7 +76,7 @@ Vn.Locale.add
,"Visits": "Visites"
,"News": "Nouvelles"
,"Photos": "Photos"
,"Shelves": "Estanterías"
,"Shelves": "Shelves"
,"Contact": "Je veux être client"
,"Training": "Formation"
,"Agencies": "Agences"

View File

@ -33,16 +33,21 @@ h1.page-number
{
position: absolute;
border: 1px solid black;
text-align: center;
padding: .8mm;
box-sizing: padding-box;
}
.box > span
.box .box-label
{
font-size: 60%;
text-align: center;
margin: 5%;
display: inline-block;
line-height: 100%;
vertical-align: middle;
text-align: left;
font-size: 55%;
word-wrap: break-word;
}
.box .packing
{
margin: 3%;
display: block;
float: right;
font-size: 80%;
}
.color0
{