forked from verdnatura/hedera-web
Backup
This commit is contained in:
parent
bbecb5fce9
commit
5779a5bfa6
|
@ -5,30 +5,33 @@ Vn.Shelves = new Class
|
||||||
|
|
||||||
,activate: function ()
|
,activate: function ()
|
||||||
{
|
{
|
||||||
this.$('warehouse').value = 44;
|
|
||||||
this.$('date').value = new Date ();
|
this.$('date').value = new Date ();
|
||||||
this.$('shelf').value = 4;
|
|
||||||
this.$('reign').value = 1;
|
|
||||||
this.$('family').value = 2;
|
|
||||||
this.$('filter').value = 'Ant ';
|
|
||||||
this.$('max-amount').value = 50;
|
|
||||||
this.$('show-packing').value = true;
|
|
||||||
this.$('stack').value = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
,onFamilyChange: function ()
|
,onConfigChange: function ()
|
||||||
{
|
{
|
||||||
this.$('report-title').value = this.$('family').get ('Tipo');
|
var c = this.$('config');
|
||||||
|
this.$('warehouse').value = c.get ('warehouse_id');
|
||||||
|
this.$('shelf').value = c.get ('shelf_id');
|
||||||
|
this.$('reign').value = c.get ('reino_id');
|
||||||
|
this.$('family').value = c.get ('family_id');
|
||||||
|
this.$('filter').value = c.get ('name_prefix');
|
||||||
|
this.$('max-amount').value = c.get ('max_amount');
|
||||||
|
this.$('show-packing').value = c.get ('show_packing');
|
||||||
|
this.$('stack').value = c.get ('stack');
|
||||||
|
this.$('report-title').value = c.get ('name');
|
||||||
}
|
}
|
||||||
|
|
||||||
,onPreviewClick: function ()
|
,onPreviewClick: function ()
|
||||||
{
|
{
|
||||||
var batch = new Sql.Batch ();
|
var batch = new Sql.Batch ();
|
||||||
batch.addParam ('shelf', this.$('shelf'));
|
batch.addParams ({
|
||||||
batch.addParam ('wh', this.$('warehouse'));
|
'shelf': this.$('shelf'),
|
||||||
batch.addParam ('date', this.$('date'));
|
'wh': this.$('warehouse'),
|
||||||
batch.addParam ('family', this.$('family'));
|
'date': this.$('date'),
|
||||||
batch.addValue ('filter', this.$('filter').value);
|
'family': this.$('family'),
|
||||||
|
'filter': this.$('filter')
|
||||||
|
});
|
||||||
|
|
||||||
var report = new Vn.ShelvesReport ({conn: this.conn});
|
var report = new Vn.ShelvesReport ({conn: this.conn});
|
||||||
report.setParams (
|
report.setParams (
|
||||||
|
@ -47,7 +50,7 @@ Vn.ShelvesReport = new Class
|
||||||
Extends: Vn.Report
|
Extends: Vn.Report
|
||||||
|
|
||||||
,nItem: -1
|
,nItem: -1
|
||||||
,nColors: 4
|
,nColors: 5
|
||||||
|
|
||||||
,setParams: function (title, maxAmount, showPacking, stack, batch)
|
,setParams: function (title, maxAmount, showPacking, stack, batch)
|
||||||
{
|
{
|
||||||
|
@ -61,9 +64,9 @@ Vn.ShelvesReport = new Class
|
||||||
,open: function ()
|
,open: function ()
|
||||||
{
|
{
|
||||||
var query =
|
var query =
|
||||||
'SELECT id, name, width, height, max_height, tray_height, '+
|
'SELECT id, name, width, height, depth, max_height, tray_height, '+
|
||||||
'first_tray_elevation, tray_density, vspacing, hspacing '+
|
'first_tray_elevation, tray_density, vspacing, hspacing '+
|
||||||
'FROM vn2008.shelf WHERE id = #shelf; '+
|
'FROM shelf WHERE id = #shelf; '+
|
||||||
'CALL item_organizer (#wh, #date, #family, #filter)';
|
'CALL item_organizer (#wh, #date, #family, #filter)';
|
||||||
|
|
||||||
this.conn.execQuery (query, this.onQueryExec.bind (this), this.batch);
|
this.conn.execQuery (query, this.onQueryExec.bind (this), this.batch);
|
||||||
|
@ -76,12 +79,19 @@ Vn.ShelvesReport = new Class
|
||||||
var res = resultSet.fetchResult ();
|
var res = resultSet.fetchResult ();
|
||||||
res.next ();
|
res.next ();
|
||||||
|
|
||||||
var scale = 0.065;
|
var maxWidth = 170;
|
||||||
|
var maxHeight = 200;
|
||||||
|
|
||||||
|
var scale = maxWidth / res.get ('width');
|
||||||
|
|
||||||
|
if (res.get ('max_height') * scale > maxHeight)
|
||||||
|
scale = maxHeight / res.get ('max_height');
|
||||||
|
|
||||||
var shelf = this.shelf =
|
var shelf = this.shelf =
|
||||||
{
|
{
|
||||||
width: res.get ('width') * scale
|
width: res.get ('width') * scale
|
||||||
,height: res.get ('height') * scale
|
,height: res.get ('height') * scale
|
||||||
|
,depth: res.get ('depth') * scale
|
||||||
,maxHeight: res.get ('max_height') * scale
|
,maxHeight: res.get ('max_height') * scale
|
||||||
,trayHeight: res.get ('tray_height') * scale
|
,trayHeight: res.get ('tray_height') * scale
|
||||||
,firstTrayElevation: res.get ('first_tray_elevation') * scale
|
,firstTrayElevation: res.get ('first_tray_elevation') * scale
|
||||||
|
@ -94,21 +104,32 @@ Vn.ShelvesReport = new Class
|
||||||
var remainings = [];
|
var remainings = [];
|
||||||
var res = resultSet.fetchResult ();
|
var res = resultSet.fetchResult ();
|
||||||
|
|
||||||
|
if (res.data.length == 0)
|
||||||
|
{
|
||||||
|
Htk.Toast.showError (_('No items found, check that all fields are correct'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var boxScale = scale * 10;
|
||||||
|
|
||||||
while (res.next ())
|
while (res.next ())
|
||||||
if (res.get ('etiquetas') <= this.maxAmount)
|
if (!this.maxAmount || res.get ('etiquetas') <= this.maxAmount)
|
||||||
{
|
{
|
||||||
items.push ({
|
items.push ({
|
||||||
name: res.get ('Article')
|
id: res.get ('Id_Article')
|
||||||
|
,name: res.get ('Article')
|
||||||
,packing: res.get ('packing')
|
,packing: res.get ('packing')
|
||||||
,boxHeight: res.get ('z') * 10 * scale
|
|
||||||
,boxWidth: res.get ('x') * 10 * scale
|
|
||||||
,amount: res.get ('etiquetas')
|
,amount: res.get ('etiquetas')
|
||||||
|
,boxHeight: res.get ('z') * boxScale
|
||||||
|
,boxWidth: res.get ('x') * boxScale
|
||||||
|
,boxDepth: res.get ('y') * boxScale
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
remainings.push ({
|
remainings.push ({
|
||||||
name: res.get ('Article')
|
id: res.get ('Id_Article')
|
||||||
|
,name: res.get ('Article')
|
||||||
,packing: res.get ('packing')
|
,packing: res.get ('packing')
|
||||||
,amount: res.get ('etiquetas')
|
,amount: res.get ('etiquetas')
|
||||||
});
|
});
|
||||||
|
@ -125,14 +146,16 @@ Vn.ShelvesReport = new Class
|
||||||
(shelf.height - shelf.firstTrayElevation) /
|
(shelf.height - shelf.firstTrayElevation) /
|
||||||
(shelf.trayHeight + shelf.trayDensity)
|
(shelf.trayHeight + shelf.trayDensity)
|
||||||
);
|
);
|
||||||
alloc.trayWidth = shelf.width - shelf.hspacing * 2;
|
alloc.width = shelf.width - shelf.hspacing * 2;
|
||||||
|
alloc.depth = shelf.depth;
|
||||||
alloc.trayHeight = shelf.trayHeight - shelf.vspacing;
|
alloc.trayHeight = shelf.trayHeight - shelf.vspacing;
|
||||||
alloc.topTrayHeight = shelf.maxHeight - shelf.vspacing
|
alloc.topTrayHeight = shelf.maxHeight - shelf.vspacing
|
||||||
- shelf.firstTrayElevation - (alloc.nTrays - 1) * shelf.trayHeight;
|
- shelf.firstTrayElevation - (alloc.nTrays - 1) * shelf.trayHeight;
|
||||||
|
|
||||||
// Opens the report
|
// Opens the report
|
||||||
|
|
||||||
this.createWindow ('shelves');
|
if (!this.createWindow ('shelves'))
|
||||||
|
return;
|
||||||
|
|
||||||
// Remaining amount
|
// Remaining amount
|
||||||
|
|
||||||
|
@ -143,10 +166,15 @@ Vn.ShelvesReport = new Class
|
||||||
this.doc.body.appendChild (sheet);
|
this.doc.body.appendChild (sheet);
|
||||||
|
|
||||||
var title = this.doc.createElement ('h1');
|
var title = this.doc.createElement ('h1');
|
||||||
title.appendChild (this.doc.createTextNode (this.title +' - '));
|
title.className = 'title';
|
||||||
title.appendChild (this.doc.createTextNode (_('Pallets')));
|
title.appendChild (this.doc.createTextNode (this.title));
|
||||||
sheet.appendChild (title);
|
sheet.appendChild (title);
|
||||||
|
|
||||||
|
var subtitle = this.doc.createElement ('h2');
|
||||||
|
subtitle.className = 'subtitle';
|
||||||
|
subtitle.appendChild (this.doc.createTextNode (_('Pallets')));
|
||||||
|
sheet.appendChild (subtitle);
|
||||||
|
|
||||||
var ul = this.doc.createElement ('ul');
|
var ul = this.doc.createElement ('ul');
|
||||||
sheet.appendChild (ul);
|
sheet.appendChild (ul);
|
||||||
|
|
||||||
|
@ -155,6 +183,11 @@ Vn.ShelvesReport = new Class
|
||||||
var li = this.doc.createElement ('li');
|
var li = this.doc.createElement ('li');
|
||||||
ul.appendChild (li);
|
ul.appendChild (li);
|
||||||
|
|
||||||
|
var span = this.doc.createElement ('span');
|
||||||
|
span.className = 'item-id';
|
||||||
|
span.appendChild (this.doc.createTextNode (remainings[i].id.toLocaleString ()));
|
||||||
|
li.appendChild (span);
|
||||||
|
|
||||||
var span = this.doc.createElement ('span');
|
var span = this.doc.createElement ('span');
|
||||||
span.className = 'item';
|
span.className = 'item';
|
||||||
span.appendChild (this.doc.createTextNode (remainings[i].name));
|
span.appendChild (this.doc.createTextNode (remainings[i].name));
|
||||||
|
@ -173,9 +206,10 @@ Vn.ShelvesReport = new Class
|
||||||
// Draws the shelves
|
// Draws the shelves
|
||||||
|
|
||||||
alloc.run ();
|
alloc.run ();
|
||||||
|
this.drawShelfEnding ();
|
||||||
}
|
}
|
||||||
|
|
||||||
,drawShelf: function (allocator)
|
,drawShelf: function (allocator, item)
|
||||||
{
|
{
|
||||||
var shelf = this.shelf;
|
var shelf = this.shelf;
|
||||||
|
|
||||||
|
@ -185,27 +219,32 @@ Vn.ShelvesReport = new Class
|
||||||
|
|
||||||
// Draws the title
|
// Draws the title
|
||||||
|
|
||||||
var title = this.doc.createElement ('h1');
|
|
||||||
title.className = 'title';
|
|
||||||
title.appendChild (this.doc.createTextNode (this.title));
|
|
||||||
sheet.appendChild (title);
|
|
||||||
|
|
||||||
var pageNumber = this.doc.createElement ('h1');
|
var pageNumber = this.doc.createElement ('h1');
|
||||||
pageNumber.className = 'page-number';
|
pageNumber.className = 'page-number';
|
||||||
pageNumber.appendChild (this.doc.createTextNode (allocator.currentShelf + 1));
|
pageNumber.appendChild (this.doc.createTextNode (allocator.currentShelf + 1));
|
||||||
sheet.appendChild (pageNumber);
|
sheet.appendChild (pageNumber);
|
||||||
|
|
||||||
|
var title = this.doc.createElement ('h1');
|
||||||
|
title.className = 'title';
|
||||||
|
title.appendChild (this.doc.createTextNode (this.title));
|
||||||
|
sheet.appendChild (title);
|
||||||
|
|
||||||
|
var subtitle = this.doc.createElement ('h2');
|
||||||
|
subtitle.className = 'subtitle';
|
||||||
|
subtitle.appendChild (this.doc.createTextNode (item.id.toLocaleString ()));
|
||||||
|
sheet.appendChild (subtitle);
|
||||||
|
|
||||||
|
this.drawShelfEnding ();
|
||||||
|
this.lastSubtitle = subtitle;
|
||||||
|
|
||||||
// Draws the shelf
|
// Draws the shelf
|
||||||
|
|
||||||
var shelfDiv = this.shelfDiv = this.doc.createElement ('div');
|
var shelfDiv = this.shelfDiv = this.doc.createElement ('div');
|
||||||
shelfDiv.className = 'shelf';
|
shelfDiv.className = 'shelf';
|
||||||
shelfDiv.style.width = this.shelf.width +'mm';
|
shelfDiv.style.width = this.mm (shelf.width);
|
||||||
shelfDiv.style.height = this.shelf.maxHeight +'mm';
|
shelfDiv.style.height = this.mm (shelf.maxHeight);
|
||||||
sheet.appendChild (shelfDiv);
|
sheet.appendChild (shelfDiv);
|
||||||
|
|
||||||
this.drawEdge ().style.left = 0;
|
|
||||||
this.drawEdge ().style.right = 0;
|
|
||||||
|
|
||||||
// Draws trays
|
// Draws trays
|
||||||
|
|
||||||
var lastTrayY = shelf.firstTrayElevation;
|
var lastTrayY = shelf.firstTrayElevation;
|
||||||
|
@ -215,24 +254,25 @@ Vn.ShelvesReport = new Class
|
||||||
{
|
{
|
||||||
var tray = this.doc.createElement ('div');
|
var tray = this.doc.createElement ('div');
|
||||||
tray.className = 'tray';
|
tray.className = 'tray';
|
||||||
tray.style.width = this.shelf.width +'mm';
|
tray.style.width = this.mm (shelf.width);
|
||||||
tray.style.height = '1mm';
|
tray.style.height = this.mm (shelf.trayDensity);
|
||||||
tray.style.bottom = lastTrayY +'mm';
|
tray.style.bottom = this.mm (lastTrayY);
|
||||||
shelfDiv.appendChild (tray);
|
shelfDiv.appendChild (tray);
|
||||||
|
|
||||||
lastTrayY += shelf.trayHeight + shelf.trayDensity;
|
lastTrayY += shelf.trayHeight + shelf.trayDensity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
,drawEdge: function (shelfDiv)
|
,drawShelfEnding: function ()
|
||||||
{
|
{
|
||||||
var edge = this.doc.createElement ('div');
|
if (this.lastSubtitle)
|
||||||
edge.className = 'edge';
|
this.lastSubtitle.appendChild (
|
||||||
edge.style.width = '1mm';
|
this.doc.createTextNode (' - '+ this.lastItem.id.toLocaleString ()));
|
||||||
edge.style.height = this.shelf.height +'mm';
|
}
|
||||||
edge.style.bottom = 0;
|
|
||||||
this.shelfDiv.appendChild (edge);
|
,mm: function (size)
|
||||||
return edge;
|
{
|
||||||
|
return size.toFixed (2) +'mm';
|
||||||
}
|
}
|
||||||
|
|
||||||
,drawBox: function (allocator, item, amount)
|
,drawBox: function (allocator, item, amount)
|
||||||
|
@ -251,10 +291,10 @@ Vn.ShelvesReport = new Class
|
||||||
box.className = 'box';
|
box.className = 'box';
|
||||||
this.shelfDiv.appendChild (box);
|
this.shelfDiv.appendChild (box);
|
||||||
|
|
||||||
box.style.left = x +'mm';
|
box.style.left = this.mm (x);
|
||||||
box.style.bottom = y +'mm';
|
box.style.bottom = this.mm (y);
|
||||||
box.style.width = item.boxWidth +'mm';
|
box.style.width = this.mm (item.boxWidth);
|
||||||
box.style.height = item.boxHeight +'mm';
|
box.style.height = this.mm (item.boxHeight);
|
||||||
|
|
||||||
if (amount == 0)
|
if (amount == 0)
|
||||||
this.nItem++;
|
this.nItem++;
|
||||||
|
@ -264,38 +304,38 @@ Vn.ShelvesReport = new Class
|
||||||
|
|
||||||
if (amount == 0 || allocator.firstShelfBox)
|
if (amount == 0 || allocator.firstShelfBox)
|
||||||
{
|
{
|
||||||
if (this.showPacking)
|
var fontSize = item.boxWidth / 5.2;
|
||||||
{
|
|
||||||
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');
|
if (fontSize > item.boxHeight - 1)
|
||||||
|
fontSize = item.boxHeight - 1;
|
||||||
|
|
||||||
|
var boxLabel = this.doc.createElement ('div');
|
||||||
boxLabel.className = 'box-label';
|
boxLabel.className = 'box-label';
|
||||||
boxLabel.appendChild (this.doc.createTextNode (item.name));
|
boxLabel.style.fontSize = this.mm (fontSize);
|
||||||
|
boxLabel.appendChild (this.doc.createTextNode (item.id.toLocaleString ()));
|
||||||
box.appendChild (boxLabel);
|
box.appendChild (boxLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.lastItem = item;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Vn.Allocator = new Class
|
Vn.Allocator = new Class
|
||||||
({
|
({
|
||||||
addShelf: function ()
|
addShelf: function (item)
|
||||||
{
|
{
|
||||||
this.currentShelf++;
|
this.currentShelf++;
|
||||||
this.firstShelfBox = true;
|
this.firstShelfBox = true;
|
||||||
|
|
||||||
if (this.shelfFunc)
|
if (this.shelfFunc)
|
||||||
this.shelfFunc (this);
|
this.shelfFunc (this, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
,addTray: function ()
|
,addTray: function (item)
|
||||||
{
|
{
|
||||||
if (this.currentTray <= 0)
|
if (this.currentTray <= 0)
|
||||||
{
|
{
|
||||||
this.addShelf ();
|
this.addShelf (item);
|
||||||
this.currentTray = this.nTrays - 1;
|
this.currentTray = this.nTrays - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -304,17 +344,17 @@ Vn.Allocator = new Class
|
||||||
this.trayX = 0;
|
this.trayX = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
,addColumn: function (width)
|
,addColumn: function (item)
|
||||||
{
|
{
|
||||||
if (this.trayX + this.columnWidth + width > this.trayWidth
|
if (this.trayX + this.columnWidth + item.boxWidth > this.width
|
||||||
|| this.currentTray == -1)
|
|| this.currentTray == -1)
|
||||||
this.addTray ();
|
this.addTray (item);
|
||||||
else
|
else
|
||||||
this.trayX += this.columnWidth;
|
this.trayX += this.columnWidth;
|
||||||
|
|
||||||
this.trayY = 0;
|
this.trayY = 0;
|
||||||
this.columnWidth = width;
|
this.columnWidth = item.boxWidth;
|
||||||
this.lastBoxWidth = width;
|
this.lastBoxWidth = item.boxWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
,addBox: function (item, amount)
|
,addBox: function (item, amount)
|
||||||
|
@ -327,7 +367,7 @@ Vn.Allocator = new Class
|
||||||
if (this.trayY + item.boxHeight > trayHeight
|
if (this.trayY + item.boxHeight > trayHeight
|
||||||
|| item.boxWidth > this.lastBoxWidth
|
|| item.boxWidth > this.lastBoxWidth
|
||||||
|| (!this.stack && amount == 0))
|
|| (!this.stack && amount == 0))
|
||||||
this.addColumn (item.boxWidth);
|
this.addColumn (item);
|
||||||
|
|
||||||
if (this.boxFunc)
|
if (this.boxFunc)
|
||||||
this.boxFunc (this, item, amount);
|
this.boxFunc (this, item, amount);
|
||||||
|
@ -352,8 +392,12 @@ Vn.Allocator = new Class
|
||||||
for (var i = 0; i < this.items.length; i++)
|
for (var i = 0; i < this.items.length; i++)
|
||||||
{
|
{
|
||||||
var item = this.items[i];
|
var item = this.items[i];
|
||||||
|
var boxIncrement = Math.floor (this.depth / item.boxDepth);
|
||||||
|
|
||||||
for (var amount = 0; amount < item.amount; amount++)
|
if (boxIncrement < 1)
|
||||||
|
boxIncrement = 1;
|
||||||
|
|
||||||
|
for (var amount = 0; amount < item.amount; amount += boxIncrement)
|
||||||
{
|
{
|
||||||
this.addBox (item, amount);
|
this.addBox (item, amount);
|
||||||
this.firstShelfBox = false;
|
this.firstShelfBox = false;
|
||||||
|
|
|
@ -1,10 +1,31 @@
|
||||||
<vn>
|
<vn>
|
||||||
|
<vn-group>
|
||||||
|
<db-model property="model" id="configs-model">
|
||||||
|
SELECT c.id, c.name, c.name_prefix, c.warehouse_id, c.family_id,
|
||||||
|
c.shelf_id, c.max_amount, c.show_packing, c.stack, t.reino_id
|
||||||
|
FROM shelf_config c
|
||||||
|
JOIN vn2008.Tipos t ON t.tipo_id = c.family_id
|
||||||
|
</db-model>
|
||||||
|
</vn-group>
|
||||||
<div id="title">
|
<div id="title">
|
||||||
<h1><t>Shelves</t></h1>
|
<h1><t>Shelves</t></h1>
|
||||||
</div>
|
</div>
|
||||||
<div id="form" class="shelves">
|
<div id="form" class="shelves">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="body">
|
<div class="body">
|
||||||
|
<div class="form-group">
|
||||||
|
<label><t>Configuration</t></label>
|
||||||
|
<htk-combo
|
||||||
|
id="config"
|
||||||
|
placeholder="_Select config"
|
||||||
|
model="configs-model"
|
||||||
|
on-changed="onConfigChange"
|
||||||
|
on-ready="onConfigChange"/>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label><t>Date</t></label>
|
||||||
|
<htk-date-chooser id="date"/>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><t>Reign</t></label>
|
<label><t>Reign</t></label>
|
||||||
<htk-combo id="reign">
|
<htk-combo id="reign">
|
||||||
|
@ -16,7 +37,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><t>Family</t></label>
|
<label><t>Family</t></label>
|
||||||
<htk-combo id="family" on-changed="onFamilyChange" on-ready="onFamilyChange">
|
<htk-combo id="family">
|
||||||
<db-model property="model">
|
<db-model property="model">
|
||||||
SELECT tipo_id, Tipo FROM vn2008.Tipos
|
SELECT tipo_id, Tipo FROM vn2008.Tipos
|
||||||
WHERE reino_id = #reign ORDER BY Tipo
|
WHERE reino_id = #reign ORDER BY Tipo
|
||||||
|
@ -35,21 +56,17 @@
|
||||||
</db-model>
|
</db-model>
|
||||||
</htk-combo>
|
</htk-combo>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
|
||||||
<label><t>Date</t></label>
|
|
||||||
<htk-date-chooser id="date"/>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><t>Shelf</t></label>
|
<label><t>Shelf</t></label>
|
||||||
<htk-combo id="shelf">
|
<htk-combo id="shelf">
|
||||||
<db-model property="model" id="shelves">
|
<db-model property="model" id="shelves">
|
||||||
SELECT id, name FROM vn2008.shelf
|
SELECT id, name FROM shelf
|
||||||
</db-model>
|
</db-model>
|
||||||
</htk-combo>
|
</htk-combo>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><t>Name prefix</t></label>
|
<label><t>Name prefix</t></label>
|
||||||
<input type="text" id="filter"/>
|
<htk-entry id="filter"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label><t>Limit amount per item</t></label>
|
<label><t>Limit amount per item</t></label>
|
||||||
|
|
|
@ -37,11 +37,13 @@
|
||||||
<sql-search-tags param="search"/>
|
<sql-search-tags param="search"/>
|
||||||
</sql-filter-item>
|
</sql-filter-item>
|
||||||
<!--
|
<!--
|
||||||
<pointer object="op-realm"/>
|
<list property="operands">
|
||||||
<pointer object="op-type"/>
|
<pointer object="op-realm"/>
|
||||||
<pointer object="op-color"/>
|
<pointer object="op-type"/>
|
||||||
<pointer object="op-origin"/>
|
<pointer object="op-color"/>
|
||||||
<pointer object="op-category"/>
|
<pointer object="op-origin"/>
|
||||||
|
<pointer object="op-category"/>
|
||||||
|
</list>
|
||||||
-->
|
-->
|
||||||
</sql-filter>
|
</sql-filter>
|
||||||
<db-query id="basket-lines">
|
<db-query id="basket-lines">
|
||||||
|
|
|
@ -5,9 +5,6 @@ Vn.Orders = new Class
|
||||||
|
|
||||||
,activate: function ()
|
,activate: function ()
|
||||||
{
|
{
|
||||||
this.payPopup = new Htk.Popup ();
|
|
||||||
this.payPopup.setChildNode (this.$('balance-popup'));
|
|
||||||
|
|
||||||
Vn.Tpv.check (this.conn);
|
Vn.Tpv.check (this.conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,14 +37,8 @@ Vn.Orders = new Class
|
||||||
|
|
||||||
,onPayButtonClick: function ()
|
,onPayButtonClick: function ()
|
||||||
{
|
{
|
||||||
this.payPopup.show (this.$('pay-button').getNode ());
|
var company = 442;
|
||||||
}
|
var amount = this.$('debt').value;
|
||||||
|
|
||||||
,onCompanyPayClick: function (column, value, row)
|
|
||||||
{
|
|
||||||
var model = this.$('balance');
|
|
||||||
var company = model.get (row, 'id');
|
|
||||||
var amount = model.get (row, 'amount');
|
|
||||||
|
|
||||||
amount = amount <= 0 ? null : amount;
|
amount = amount <= 0 ? null : amount;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,11 @@
|
||||||
<vn>
|
<vn>
|
||||||
|
<vn-group>
|
||||||
|
<db-model id="debt-model" result-index="1">
|
||||||
|
CALL customer_get_debt_by_company ();
|
||||||
|
SELECT * FROM t_customer_debt;
|
||||||
|
DROP TEMPORARY TABLE t_customer_debt;
|
||||||
|
</db-model>
|
||||||
|
</vn-group>
|
||||||
<div id="title">
|
<div id="title">
|
||||||
<h1><t>LastOrders</t></h1>
|
<h1><t>LastOrders</t></h1>
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,7 +13,7 @@
|
||||||
<div id="balance">
|
<div id="balance">
|
||||||
<span class="label"><t>PendingBalance:</t></span>
|
<span class="label"><t>PendingBalance:</t></span>
|
||||||
<htk-label format="%.2d€" conditional-func="balanceConditionalFunc">
|
<htk-label format="%.2d€" conditional-func="balanceConditionalFunc">
|
||||||
<db-calc-sum model="balance" column-name="amount"/>
|
<db-calc-sum model="debt-model" column-name="amount" id="debt"/>
|
||||||
</htk-label>
|
</htk-label>
|
||||||
<img src="image/dark/info.svg" title="_PaymentInfo" class="balance-info" alt="Info"/>
|
<img src="image/dark/info.svg" title="_PaymentInfo" class="balance-info" alt="Info"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -39,16 +46,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="balance-popup" class="balance-popup">
|
|
||||||
<htk-grid class="balance-grid" show-header="false">
|
|
||||||
<db-model id="balance" result-index="1">
|
|
||||||
CALL customer_get_debt_by_company ();
|
|
||||||
SELECT * FROM t_customer_debt;
|
|
||||||
DROP TEMPORARY TABLE t_customer_debt;
|
|
||||||
</db-model>
|
|
||||||
<htk-column-text title="_Company" column="abbreviation"/>
|
|
||||||
<htk-column-spin title="_Pending" column="amount" unit="€" digits="2"/>
|
|
||||||
<htk-column-button title="_Pay" image="image/pay.svg" tip="Pay" on-clicked="onCompanyPayClick"/>
|
|
||||||
</htk-grid>
|
|
||||||
</div>
|
|
||||||
</vn>
|
</vn>
|
||||||
|
|
Binary file not shown.
|
@ -33,21 +33,22 @@
|
||||||
background-color: white;
|
background-color: white;
|
||||||
margin: 10mm auto;
|
margin: 10mm auto;
|
||||||
box-shadow: 0 1mm 1mm #CCC;
|
box-shadow: 0 1mm 1mm #CCC;
|
||||||
padding: 15mm;
|
padding: 20mm;
|
||||||
}
|
}
|
||||||
.print-button
|
.print-button
|
||||||
{
|
{
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 6mm;
|
top: 1.5em;
|
||||||
right: 6mm;
|
right: 1.5em;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
background-color: #009688;
|
background-color: #009688;
|
||||||
color: white;
|
color: white;
|
||||||
padding: 2mm;
|
padding: .4em;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
border: none;
|
border: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
box-shadow: 0 1mm 1mm #AAA;
|
box-shadow: 0 .1em .1em #AAA;
|
||||||
|
font-size: 1.4em;
|
||||||
}
|
}
|
||||||
.print-button:hover
|
.print-button:hover
|
||||||
{
|
{
|
||||||
|
@ -56,7 +57,7 @@
|
||||||
}
|
}
|
||||||
*
|
*
|
||||||
{
|
{
|
||||||
font-family: 'Droid Sans', 'Sans';
|
font-family: 'Open Sans';
|
||||||
}
|
}
|
||||||
body
|
body
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,13 +29,13 @@ Vn.Report = new Class
|
||||||
,createWindow: function (reportPath)
|
,createWindow: function (reportPath)
|
||||||
{
|
{
|
||||||
var reportWindow = window.open (''/*'js/hedera/report.html'*/, '_blank'/*reportPath*/,
|
var reportWindow = window.open (''/*'js/hedera/report.html'*/, '_blank'/*reportPath*/,
|
||||||
'resizable=yes,height=900,width=900,scrollbars=yes,menubar=true');
|
'resizable=yes,height=900,width=900,scrollbars=yes,menubar=false');
|
||||||
|
|
||||||
if (!reportWindow)
|
if (!reportWindow)
|
||||||
{
|
{
|
||||||
Htk.Toast.showError (
|
Htk.Toast.showError (
|
||||||
_('Can\'t open the report, please unlock popup block and try again'));
|
_('Please unlock popups and try again'));
|
||||||
return;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.window = reportWindow;
|
this.window = reportWindow;
|
||||||
|
|
|
@ -79,12 +79,24 @@ Sql.Batch = new Class
|
||||||
new Sql.Value ({value: value}));
|
new Sql.Value ({value: value}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
,addValues: function (values)
|
||||||
|
{
|
||||||
|
for (var id in values)
|
||||||
|
this.addValue (id, values[id]);
|
||||||
|
}
|
||||||
|
|
||||||
,addParam: function (id, param)
|
,addParam: function (id, param)
|
||||||
{
|
{
|
||||||
this._addObject (id,
|
this._addObject (id,
|
||||||
new Sql.Value ({param: param}));
|
new Sql.Value ({param: param}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
,addParams: function (params)
|
||||||
|
{
|
||||||
|
for (var id in params)
|
||||||
|
this.addParam (id, params[id]);
|
||||||
|
}
|
||||||
|
|
||||||
,remove: function (id)
|
,remove: function (id)
|
||||||
{
|
{
|
||||||
if (this.objects[id])
|
if (this.objects[id])
|
||||||
|
|
|
@ -243,6 +243,73 @@ Vn.Builder = new Class
|
||||||
|
|
||||||
//+++++++++++++++++++++++++++++++++++++++++++ Alpha
|
//+++++++++++++++++++++++++++++++++++++++++++ Alpha
|
||||||
|
|
||||||
|
,compile: function (node, dstDocument)
|
||||||
|
{
|
||||||
|
this.contexts = [];
|
||||||
|
this.contextMap = {};
|
||||||
|
this.propLinks = [];
|
||||||
|
this.childLinks = [];
|
||||||
|
this.document = dstDocument ? dstDocument : document;
|
||||||
|
|
||||||
|
this.compileRec (node, null);
|
||||||
|
|
||||||
|
for (var i = 0; i < this.propLinks.length; i++)
|
||||||
|
{
|
||||||
|
var pl = this.propLinks[i];
|
||||||
|
var contextId = this.contextMap[pl.value];
|
||||||
|
|
||||||
|
if (contextId)
|
||||||
|
{
|
||||||
|
pl.context.objectProps[pl.prop] = contextId;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var object = this.parentBuilder.get (pl.value);
|
||||||
|
|
||||||
|
if (object)
|
||||||
|
{
|
||||||
|
pl.context.props[pl.prop] = object;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.warn ('Vn.Builder: Referenced unexistent object with id \'%s\'',
|
||||||
|
pl.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
delete this.propLinks;
|
||||||
|
|
||||||
|
for (var i = 0; i < this.childLinks.length; i++)
|
||||||
|
{
|
||||||
|
var cl = this.childLinks[i];
|
||||||
|
var contextId = this.contextMap[pl.value];
|
||||||
|
|
||||||
|
if (contextId)
|
||||||
|
pl.context.childs.push (contextId);
|
||||||
|
else
|
||||||
|
console.warn ('Vn.Builder: Referenced unexistent object with id \'%s\'',
|
||||||
|
pl.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
delete this.childLinks;
|
||||||
|
}
|
||||||
|
|
||||||
|
,compileRec: function (node)
|
||||||
|
{
|
||||||
|
var tagName = null;
|
||||||
|
|
||||||
|
if (node.tagName)
|
||||||
|
tagName = node.tagName.toLowerCase ();
|
||||||
|
|
||||||
|
var nextId = this.contexts.length;
|
||||||
|
var context =
|
||||||
|
createTextTemplate (nextId, node, tagName)
|
||||||
|
|| createObjectTemplate (nextId, node, tagName)
|
||||||
|
|| createHtmlTemplate (nextId, node, tagName);
|
||||||
|
|
||||||
|
this.contexts.push (context);
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
,load: function (thisData)
|
,load: function (thisData)
|
||||||
{
|
{
|
||||||
var contexts = this.contexts;
|
var contexts = this.contexts;
|
||||||
|
@ -251,97 +318,24 @@ Vn.Builder = new Class
|
||||||
for (var i = 0; i < contexts.length; i++)
|
for (var i = 0; i < contexts.length; i++)
|
||||||
{
|
{
|
||||||
var context = contexts[i];
|
var context = contexts[i];
|
||||||
objects[i] = context.func (context.template);
|
|
||||||
|
if (context.func)
|
||||||
|
objects[i] = context.func (context);
|
||||||
}
|
}
|
||||||
|
|
||||||
var links = this.links;
|
for (var i = 0; i < contexts.length; i++)
|
||||||
|
|
||||||
for (var i = 0; i < links.length; i++)
|
|
||||||
{
|
{
|
||||||
var link = links[i];
|
var context = contexts[i];
|
||||||
objects[link.contextId][link.propName] = objects[link.valueContext];
|
|
||||||
|
if (context.linkFunc)
|
||||||
|
context.linkFunc (context, objects[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
,compile: function (node, dstDocument)
|
|
||||||
{
|
|
||||||
this.contexts = [];
|
|
||||||
this.contextMap = {};
|
|
||||||
this.pointers = [];
|
|
||||||
this.links = [];
|
|
||||||
this.document = dstDocument ? dstDocument : document;
|
|
||||||
|
|
||||||
this.compileRec (node, null);
|
|
||||||
|
|
||||||
for (var i = 0; i < this.pointers.length; i++)
|
|
||||||
{
|
|
||||||
var pointerId = this.pointers[i].template;
|
|
||||||
var refContext = this.contextMap[pointerId];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
,compileRec: function (node, parentContext)
|
|
||||||
{
|
|
||||||
var tagName = null;
|
|
||||||
|
|
||||||
if (node.tagName)
|
|
||||||
tagName = node.tagName.toLowerCase ();
|
|
||||||
|
|
||||||
var context = {
|
|
||||||
node: node
|
|
||||||
,parent: parentContext
|
|
||||||
,template: template
|
|
||||||
,id: this.contexts.length
|
|
||||||
,func: null
|
|
||||||
};
|
|
||||||
this.contexts.push (context);
|
|
||||||
|
|
||||||
var template =
|
|
||||||
createTextTemplate (context, node, tagName)
|
|
||||||
|| createPointerTemplate (context, node, tagName)
|
|
||||||
|| createObjectTemplate (context, node, tagName)
|
|
||||||
|| createHtmlTemplate (context, node, tagName);
|
|
||||||
|
|
||||||
var id = node.getAttribute ('id');
|
|
||||||
|
|
||||||
if (id)
|
|
||||||
this.contextMap[id] = context;
|
|
||||||
|
|
||||||
if (parentContext)
|
|
||||||
{
|
|
||||||
var parentProperty = node.getAttribute ('property');
|
|
||||||
|
|
||||||
if (!parentProperty && parentContext.template.klass)
|
|
||||||
parentProperty = parentContext.template.klass.Child;
|
|
||||||
|
|
||||||
if (parentProperty)
|
|
||||||
{
|
|
||||||
this.links.push ({
|
|
||||||
contextId: context.id,
|
|
||||||
propName: propName,
|
|
||||||
valueContext: valueContext.id
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
this.registerLink (parentContext, parentProperty, context);
|
|
||||||
|
|
||||||
if (klass.Parent)
|
|
||||||
this.registerLink (context, klass.Parent, parentContext);
|
|
||||||
}
|
|
||||||
|
|
||||||
var childs = node.childNodes;
|
|
||||||
|
|
||||||
if (childs)
|
|
||||||
for (var i = 0; i < childs.length; i++)
|
|
||||||
this.compileRec (childs[i], context);
|
|
||||||
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a text node template.
|
* Creates a text node template.
|
||||||
**/
|
**/
|
||||||
,createTextTemplate: function (context, node, tagName)
|
,createTextTemplate: function (contextId, node, tagName)
|
||||||
{
|
{
|
||||||
if (tagName === 't')
|
if (tagName === 't')
|
||||||
var text = _(node.firstChild.textContent);
|
var text = _(node.firstChild.textContent);
|
||||||
|
@ -350,42 +344,28 @@ Vn.Builder = new Class
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return
|
return {
|
||||||
|
id: contextId,
|
||||||
context.func = createTextInstance;
|
text: text,
|
||||||
return text;
|
func: this.createTextInstance
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
,createTextInstance: function (template)
|
,createTextInstance: function (context)
|
||||||
{
|
{
|
||||||
return this.document.createTextNode (template);
|
return this.document.createTextNode (context.text);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a object pointer template.
|
|
||||||
**/
|
|
||||||
,createPointerTemplate: function (context, node, tagName)
|
|
||||||
{
|
|
||||||
if (tagName !== 'pointer')
|
|
||||||
return null;
|
|
||||||
|
|
||||||
this.pointers.push (context);
|
|
||||||
return node.getAttribute ('object');
|
|
||||||
}
|
|
||||||
|
|
||||||
,createPointerInstance: function (template)
|
|
||||||
{
|
|
||||||
return this.objectMap[template];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a object template.
|
* Creates a object template.
|
||||||
**/
|
**/
|
||||||
,createObjectTemplate: function (context, node, tagName)
|
,createObjectTemplate: function (contextId, node, tagName)
|
||||||
{
|
{
|
||||||
var id = null;
|
var id = null;
|
||||||
var handler;
|
var handler;
|
||||||
var props = {};
|
var props = {};
|
||||||
|
var objectProps = {};
|
||||||
|
var childs = [];
|
||||||
var events = null;
|
var events = null;
|
||||||
var klass = Vn.customTags[tagName];
|
var klass = Vn.customTags[tagName];
|
||||||
|
|
||||||
|
@ -401,7 +381,7 @@ Vn.Builder = new Class
|
||||||
|
|
||||||
if (attribute === 'id')
|
if (attribute === 'id')
|
||||||
{
|
{
|
||||||
id = value;
|
this.contextMap[value] = contextId;
|
||||||
}
|
}
|
||||||
else if ((handler = this.getEventHandler (attribute, value)))
|
else if ((handler = this.getEventHandler (attribute, value)))
|
||||||
{
|
{
|
||||||
|
@ -417,12 +397,49 @@ Vn.Builder = new Class
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
context.func = createObjectInstance;
|
var context = {
|
||||||
return {
|
id: contextId,
|
||||||
|
func: this.createObjectInstance,
|
||||||
|
linkFunc: this.createObjectLink,
|
||||||
klass: klass,
|
klass: klass,
|
||||||
|
props: props,
|
||||||
events: events,
|
events: events,
|
||||||
id: id
|
objectProps: objectProps,
|
||||||
|
childs: childs
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var childs = node.childNodes;
|
||||||
|
|
||||||
|
if (childs)
|
||||||
|
for (var i = 0; i < childs.length; i++)
|
||||||
|
{
|
||||||
|
var child = childs[i];
|
||||||
|
var childTagName = child.tagName.toLowerCase ();
|
||||||
|
|
||||||
|
if (childTagName === 'pointer')
|
||||||
|
{
|
||||||
|
this.childLinks.push ({
|
||||||
|
context: context,
|
||||||
|
objectId: child.getAttribute ('object')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else if (childTagName === 'custom')
|
||||||
|
{
|
||||||
|
context.custom = child.firstElementChild;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var childContext = this.compileRec (child);
|
||||||
|
var prop = child.getAttribute ('property');
|
||||||
|
|
||||||
|
if (prop)
|
||||||
|
objectProps[prop] = childContext.id;
|
||||||
|
else
|
||||||
|
childs.push (childContext.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
,createPropTemplate: function (context, klass, props, node, attribute, value)
|
,createPropTemplate: function (context, klass, props, node, attribute, value)
|
||||||
|
@ -469,37 +486,56 @@ Vn.Builder = new Class
|
||||||
}
|
}
|
||||||
else if (propInfo.type instanceof Function)
|
else if (propInfo.type instanceof Function)
|
||||||
{
|
{
|
||||||
this.registerLink (context, attribute, value);
|
this.propLinks.push ({
|
||||||
|
context: context,
|
||||||
|
prop: attribute,
|
||||||
|
value: value
|
||||||
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
console.warn ('Vn.Builder: Attribute \'%s\' invalid for tag \'%s\'',
|
console.warn ('Vn.Builder: Attribute \'%s\' invalid for tag \'%s\'',
|
||||||
attribute, node.tagName);
|
attribute, node.tagName);
|
||||||
}
|
}
|
||||||
|
|
||||||
,createObjectInstance: function (template)
|
,createObjectInstance: function (context)
|
||||||
{
|
{
|
||||||
var object = new template.klass (template.props);
|
var object = new context.klass (context.props);
|
||||||
|
|
||||||
var events = template.events;
|
var events = context.events;
|
||||||
|
|
||||||
for (var event in events)
|
for (var event in events)
|
||||||
object.on (event,
|
object.on (event,
|
||||||
events[event].bind (this.signalData));
|
events[event].bind (this.signalData));
|
||||||
|
|
||||||
if (template.id)
|
|
||||||
this.objectMap[id] = object;
|
|
||||||
|
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
,createObjectLink: function (context, object)
|
||||||
|
{
|
||||||
|
var objectProps = context.objectProps;
|
||||||
|
|
||||||
|
if (objectProps)
|
||||||
|
for (var prop in objectProps)
|
||||||
|
object[prop] = this.objects[objectProps[prop].id];
|
||||||
|
|
||||||
|
var childs = context.childs;
|
||||||
|
|
||||||
|
if (childs)
|
||||||
|
for (var i = 0; i < childs.length; i++)
|
||||||
|
object.appendChild (childs[i]);
|
||||||
|
|
||||||
|
if (context.custom)
|
||||||
|
object.loadXml (context.custom);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a HTML node template.
|
* Creates a HTML node template.
|
||||||
**/
|
**/
|
||||||
,createHtmlTemplate: function (context, node, tagName)
|
,createHtmlTemplate: function (contextId, node, tagName)
|
||||||
{
|
{
|
||||||
var id = null;
|
|
||||||
var handler;
|
var handler;
|
||||||
var events = null;
|
var events = null;
|
||||||
|
var childs = [];
|
||||||
var htmlNode = this.document.createElement (tagName);
|
var htmlNode = this.document.createElement (tagName);
|
||||||
|
|
||||||
var a = node.attributes;
|
var a = node.attributes;
|
||||||
|
@ -511,7 +547,7 @@ Vn.Builder = new Class
|
||||||
|
|
||||||
if (attribute === 'id')
|
if (attribute === 'id')
|
||||||
{
|
{
|
||||||
id = value;
|
this.contextMap[value] = contextId;
|
||||||
}
|
}
|
||||||
else if ((handler = this.getEventHandler (attribute, value)))
|
else if ((handler = this.getEventHandler (attribute, value)))
|
||||||
{
|
{
|
||||||
|
@ -525,28 +561,45 @@ Vn.Builder = new Class
|
||||||
this.translateValue (nodeValue));
|
this.translateValue (nodeValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
context.func = createHtmlInstance;
|
var childNodes = node.childNodes;
|
||||||
|
|
||||||
|
if (childNodes)
|
||||||
|
for (var i = 0; i < childNodes.length; i++)
|
||||||
|
{
|
||||||
|
var childContext = this.compileRec (childNodes[i]);
|
||||||
|
childs.push (childContext.id);
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
id: contextId,
|
||||||
|
func: this.createHtmlInstance,
|
||||||
|
linkFunc: this.createHtmlLink,
|
||||||
node: htmlNode,
|
node: htmlNode,
|
||||||
events: events,
|
events: events,
|
||||||
id: id
|
childs: childs
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
,createHtmlInstance: function (template)
|
,createHtmlInstance: function (context)
|
||||||
{
|
{
|
||||||
var node = new template.node.cloneNode (false);
|
var object = new context.node.cloneNode (false);
|
||||||
|
|
||||||
var events = template.events;
|
var events = context.events;
|
||||||
|
|
||||||
for (var event in events)
|
for (var event in events)
|
||||||
node.addEventListener (event,
|
object.addEventListener (event,
|
||||||
events[event].bind (this.signalData));
|
events[event].bind (this.signalData));
|
||||||
|
|
||||||
if (template.id)
|
return object;
|
||||||
this.objectMap[id] = node;
|
}
|
||||||
|
|
||||||
return node;
|
,createHtmlLink: function (context, object)
|
||||||
|
{
|
||||||
|
var childs = context.childs;
|
||||||
|
|
||||||
|
if (childs)
|
||||||
|
for (var i = 0; i < childs.length; i++)
|
||||||
|
object.appendChild (this.objects[childs[i]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//+++++++++++++++++++++++++++++++++++++++++++ Utilities
|
//+++++++++++++++++++++++++++++++++++++++++++ Utilities
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
{
|
{
|
||||||
"Reign": "Reino"
|
"Configuration": "Configuración"
|
||||||
|
,"Select config": "Selecciona configuración"
|
||||||
|
,"Reign": "Reino"
|
||||||
,"Family": "Familia"
|
,"Family": "Familia"
|
||||||
,"Store": "Almacén"
|
,"Store": "Almacén"
|
||||||
,"Date": "Fecha"
|
,"Date": "Fecha"
|
||||||
|
@ -11,4 +13,9 @@
|
||||||
,"Stack different items": "Apilar artículos distintos"
|
,"Stack different items": "Apilar artículos distintos"
|
||||||
|
|
||||||
,"Preview": "Mostrar"
|
,"Preview": "Mostrar"
|
||||||
|
|
||||||
|
,"Pallets": "Palets"
|
||||||
|
|
||||||
|
,"No items found, check that all fields are correct":
|
||||||
|
"No se han encontrado artículos, comprueba que todos los campos son correctos"
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,10 @@ Vn.Locale.add
|
||||||
,"TestTheNewWebsite": "¡Prueba la nueva web!"
|
,"TestTheNewWebsite": "¡Prueba la nueva web!"
|
||||||
,"ReturnToOldWebsite": "Web antigua"
|
,"ReturnToOldWebsite": "Web antigua"
|
||||||
,"ChangeLog": "Cambios recientes"
|
,"ChangeLog": "Cambios recientes"
|
||||||
|
|
||||||
,"Print": "Imprimir"
|
,"Print": "Imprimir"
|
||||||
|
,"Please unlock popups and try again":
|
||||||
|
"Por favor, desploquea los popups y vuélvelo a intentar"
|
||||||
|
|
||||||
,"ErrorLoadingForm": "Error al cargar formulario"
|
,"ErrorLoadingForm": "Error al cargar formulario"
|
||||||
,"CookiesNotification": "Al utilizar este sitio web aceptas el uso de cookies para la personalización de contenidos y análisis."
|
,"CookiesNotification": "Al utilizar este sitio web aceptas el uso de cookies para la personalización de contenidos y análisis."
|
||||||
|
|
|
@ -4,15 +4,22 @@
|
||||||
h1
|
h1
|
||||||
{
|
{
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-size: 15mm;
|
font-size: 500%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
h1.title
|
h2.subtitle
|
||||||
{
|
{
|
||||||
float: left;
|
margin: 0;
|
||||||
|
font-size: 400%;
|
||||||
|
font-weight: normal;
|
||||||
|
color: #333;
|
||||||
}
|
}
|
||||||
h1.page-number
|
h1.page-number
|
||||||
{
|
{
|
||||||
|
padding-left: 4mm;
|
||||||
float: right;
|
float: right;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
@ -20,50 +27,53 @@ h1.page-number
|
||||||
{
|
{
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding-top: 40mm;
|
padding-top: 10mm;
|
||||||
}
|
}
|
||||||
.edge,
|
.edge,
|
||||||
.tray
|
.tray
|
||||||
{
|
{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border: 1px solid black;
|
border-top: 2px solid black;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
.edge
|
||||||
|
{
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
.box
|
.box
|
||||||
{
|
{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
padding: .8mm;
|
border-bottom: 0;
|
||||||
box-sizing: padding-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.box .box-label
|
.box .box-label
|
||||||
{
|
{
|
||||||
text-align: left;
|
text-align: right;
|
||||||
font-size: 55%;
|
font-size: 55%;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
box-sizing: border-box;
|
||||||
.box .packing
|
padding: 0 4%;
|
||||||
{
|
|
||||||
margin: 3%;
|
|
||||||
display: block;
|
|
||||||
float: right;
|
|
||||||
font-size: 80%;
|
|
||||||
}
|
}
|
||||||
.color0
|
.color0
|
||||||
{
|
{
|
||||||
background-color: #ECC !important;
|
background-color: #FDD !important;
|
||||||
}
|
}
|
||||||
.color1
|
.color1
|
||||||
{
|
{
|
||||||
background-color: #CEC !important;
|
background-color: #DFD !important;
|
||||||
}
|
}
|
||||||
.color2
|
.color2
|
||||||
{
|
{
|
||||||
background-color: #CCE !important;
|
background-color: #DDF !important;
|
||||||
}
|
}
|
||||||
.color3
|
.color3
|
||||||
{
|
{
|
||||||
background-color: #ECE !important;
|
background-color: #DFF !important;
|
||||||
|
}
|
||||||
|
.color4
|
||||||
|
{
|
||||||
|
background-color: #FFD !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remaining amounts*/
|
/* Remaining amounts*/
|
||||||
|
@ -74,13 +84,20 @@ ul
|
||||||
}
|
}
|
||||||
li *
|
li *
|
||||||
{
|
{
|
||||||
font-size: 6mm;
|
font-size: 200%;
|
||||||
line-height: 12mm;
|
line-height: 200%;
|
||||||
|
}
|
||||||
|
.item-id
|
||||||
|
{
|
||||||
|
display: inline-block;
|
||||||
|
text-align: right;
|
||||||
|
margin: 0 5mm;
|
||||||
|
width: 30mm;
|
||||||
}
|
}
|
||||||
.item
|
.item
|
||||||
{
|
{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100mm;
|
width: 80mm;
|
||||||
}
|
}
|
||||||
.amount
|
.amount
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue