diff --git a/forms/ecomerce/confirm/ui.xml b/forms/ecomerce/confirm/ui.xml
index d1f051e8..78b4a248 100644
--- a/forms/ecomerce/confirm/ui.xml
+++ b/forms/ecomerce/confirm/ui.xml
@@ -7,7 +7,7 @@
SELECT o.id, o.date_send, o.note, o.company_id,
ag.description agency, v.code method,
ad.consignee, ad.zip_code, ad.city, ad.name address,
- t.*, c.credit, clientGetDebt(NULL) debt
+ t.*, c.credit, myClientGetDebt(NULL) debt
FROM basket o
JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id
LEFT JOIN address_view ad ON ad.id = o.address_id
diff --git a/forms/ecomerce/orders/ui.xml b/forms/ecomerce/orders/ui.xml
index 4be6bf23..af990e0f 100644
--- a/forms/ecomerce/orders/ui.xml
+++ b/forms/ecomerce/orders/ui.xml
@@ -29,7 +29,7 @@
conditional-func="balanceConditionalFunc">
- SELECT clientGetDebt(NULL) debt
+ SELECT -myClientGetDebt(NULL) debt
diff --git a/forms/ecomerce/ticket/style.css b/forms/ecomerce/ticket/style.css
index 142ef4da..306c69aa 100644
--- a/forms/ecomerce/ticket/style.css
+++ b/forms/ecomerce/ticket/style.css
@@ -24,9 +24,24 @@
{
text-align: right;
}
+.ticket .packages
+{
+ margin-top: 1em;
+ padding-top: 1em;
+ border-top: 1px solid #DDD;
+ display: block;
+}
/* Lines */
+.ticket .line > .photo
+{
+ margin-right: 1em;
+ float: left;
+ border-radius: 50%;
+ height: 3.2em;
+ width: 3.2em;
+}
.ticket .line
{
padding: .5em 0;
diff --git a/forms/ecomerce/ticket/ticket.js b/forms/ecomerce/ticket/ticket.js
index 335205d9..dfb6936f 100644
--- a/forms/ecomerce/ticket/ticket.js
+++ b/forms/ecomerce/ticket/ticket.js
@@ -34,5 +34,11 @@ Hedera.Ticket = new Class
var row = form.$;
return row.quantity * row.price * ((100 - row.discount) / 100);
}
+
+ ,onPackagesChanged: function (model)
+ {
+ this.$('packages').node.style.display =
+ model.numRows > 0 ? 'block' : 'none';
+ }
});
diff --git a/forms/ecomerce/ticket/ui.xml b/forms/ecomerce/ticket/ui.xml
index fb9da468..f2cadfec 100644
--- a/forms/ecomerce/ticket/ui.xml
+++ b/forms/ecomerce/ticket/ui.xml
@@ -57,7 +57,7 @@
+
+
+
+ CALL myTicketGetPackages (#ticket)
+
+
+
+
+
+
+
+
+
+
+
+
+ @
+
+
+
+
+
diff --git a/js/hedera/app.js b/js/hedera/app.js
index b43b6d04..6dc597df 100644
--- a/js/hedera/app.js
+++ b/js/hedera/app.js
@@ -73,6 +73,9 @@ module.exports = new Class
,_onLogin: function ()
{
this._freeLogin ();
+
+ if (this._gui)
+ return;
var gui = this._gui = new Gui ({
conn: this._conn,
diff --git a/js/hedera/gui.js b/js/hedera/gui.js
index d7f02780..60cb45ff 100644
--- a/js/hedera/gui.js
+++ b/js/hedera/gui.js
@@ -94,6 +94,8 @@ module.exports = new Class
localStorage.setItem ('hederaCookies', true);
Htk.Toast.showWarning (_('By using this site you accept cookies'));
}
+
+ this.supplantInit ();
}
,hide: function ()
@@ -482,18 +484,27 @@ module.exports = new Class
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++ Supplant
+
+ ,supplantInit: function ()
+ {
+ var user = sessionStorage.getItem ('supplantUser');
+
+ if (user != null)
+ this.supplantUser (user);
+ }
,supplantUser: function (user, callback)
{
this._conn.supplantUser (user,
- this._onUserSupplant.bind (this, callback));
+ this._onUserSupplant.bind (this, callback, user));
}
- ,_onUserSupplant: function (callback, supplantOk)
+ ,_onUserSupplant: function (callback, user, supplantOk)
{
if (!supplantOk)
return;
+ sessionStorage.setItem ('supplantUser', user);
this.loadMenu ();
var sql = 'SELECT nickname FROM account.userView';
@@ -514,6 +525,8 @@ module.exports = new Class
{
Vn.Node.hide (this.$.supplant);
this._conn.supplantEnd ();
+ sessionStorage.removeItem ('supplantUser',
+ sessionStorage.getItem ('supplantUser'));
this.loadMenu ();
this._onFormChange ();
}
diff --git a/package.json b/package.json
index c777aa59..3159b2ce 100644
--- a/package.json
+++ b/package.json
@@ -21,7 +21,6 @@
"style-loader": "^0.19.0",
"url-loader": "^0.5.7",
"webpack": "^3.10.0",
- "webpack-chunk-hash": "^0.5.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
diff --git a/reports/delivery-note/delivery-note.js b/reports/delivery-note/delivery-note.js
index 3a708bdc..1319c655 100644
--- a/reports/delivery-note/delivery-note.js
+++ b/reports/delivery-note/delivery-note.js
@@ -14,4 +14,10 @@ Hedera.DeliveryNote = new Class
var discount = form.get ('discount');
return form.get ('quantity') * price * ((100 - discount) / 100);
}
+
+ ,onPackagesChanged: function (model)
+ {
+ this.$('packages').node.style.display =
+ model.numRows > 0 ? 'block' : 'none';
+ }
});
diff --git a/reports/delivery-note/style.css b/reports/delivery-note/style.css
index 10707b22..c0eaad65 100644
--- a/reports/delivery-note/style.css
+++ b/reports/delivery-note/style.css
@@ -23,3 +23,10 @@
border-top: 1px solid #333;
padding-top: .3em;
}
+.packages
+{
+ width: 50%;
+ padding-top: 1em;
+ margin-left: 0;
+ display: none;
+}
diff --git a/reports/delivery-note/ui.xml b/reports/delivery-note/ui.xml
index 3b548b8e..eee4d92e 100644
--- a/reports/delivery-note/ui.xml
+++ b/reports/delivery-note/ui.xml
@@ -52,5 +52,17 @@
+
+
+ CALL myTicketGetPackages (#ticket)
+
+
+
+
+
diff --git a/webpack.config.js b/webpack.config.js
index 9139ef47..a4f28b87 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,7 +1,6 @@
var path = require('path');
var webpack = require('webpack');
var AssetsWebpackPlugin = require('assets-webpack-plugin');
-var WebpackChunkHash = require('webpack-chunk-hash');
var merge = require('webpack-merge');
var wpConfig = require('./webpack.config.json');
@@ -61,8 +60,7 @@ var prodConfig = {
new AssetsWebpackPlugin({
path: outputPath
}),
- new webpack.HashedModuleIdsPlugin(),
- new WebpackChunkHash()
+ new webpack.HashedModuleIdsPlugin()
],
devtool: 'source-map'
};