refs #5253 #22

Merged
juan merged 20 commits from test into master 2023-02-23 09:30:53 +00:00
8 changed files with 44 additions and 81 deletions
Showing only changes of commit 17e54cfc60 - Show all commits

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (22.48.4) stable; urgency=low hedera-web (22.48.5) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -150,13 +150,9 @@ export default new Class({
this.$.assistant.moveNext(); this.$.assistant.moveNext();
}, },
goNextStep() {
this.$.assistant.moveNext();
},
onAddressClick(addressId) { onAddressClick(addressId) {
this.$.lot.set('address', addressId); this.$.lot.set('address', addressId);
this.goNextStep(); this.$.assistant.moveNext();
}, },
onAddressChange() { onAddressChange() {

View File

@ -24,22 +24,18 @@ module.exports = new Class({
} }
,async _realPay(amount, company) { ,async _realPay(amount, company) {
if (!isNumeric(amount) || amount <= 0) if (!isNumeric(amount) || amount <= 0) {
throw new UserError(_('AmountError')); Htk.Toast.showError(_('AmountError'));
return;
let json;
try {
json = await this.conn.send('tpv/transaction', {
amount: parseInt(amount)
,urlOk: this._makeUrl('ok')
,urlKo: this._makeUrl('ko')
,company: company
});
} catch(err) {
throw new UserError(_('PayError'));
} }
const json = await this.conn.send('tpv/transaction', {
amount: parseInt(amount)
,urlOk: this._makeUrl('ok')
,urlKo: this._makeUrl('ko')
,company
});
const postValues = json.postValues; const postValues = json.postValues;
const form = document.createElement('form'); const form = document.createElement('form');

View File

@ -10,15 +10,7 @@ module.exports = new Class({
value: { value: {
type: String type: String
,set(x) { ,set(x) {
if (Vn.Value.compare(x, this._value)) this._setValue(x);
return;
if (x instanceof Date)
x = x.clone();
this.valueChanged(x);
this.putValue(x);
this._notifyChanges();
} }
,get() { ,get() {
return this._value; return this._value;
@ -109,11 +101,11 @@ module.exports = new Class({
,_lockField: false ,_lockField: false
,_setValue(newValue) { ,_setValue(newValue) {
if (!this._putValue(newValue)) if (!this._putValue(newValue)) return;
return; newValue = this._value;
if (!this._lockField) if (!this._lockField)
this.putValue(newValue); this.putValue(this._value);
if (this.conditionalFunc) if (this.conditionalFunc)
this.conditionalFunc(this, newValue); this.conditionalFunc(this, newValue);

View File

@ -54,7 +54,7 @@ module.exports = new Class({
,render() { ,render() {
var radio = Vn.Browser.createRadio('', this.doc); var radio = Vn.Browser.createRadio('', this.doc);
radio.checked = false; radio.checked = false;
radio.addEventListener('change', this._onChange.bind(this)); radio.addEventListener('change', () => this._onChange());
this._node = radio; this._node = radio;
} }

View File

@ -4,8 +4,6 @@ var htkRadioGroupUid = 0;
module.exports = new Class({ module.exports = new Class({
Extends: Htk.Field Extends: Htk.Field
,Tag: 'htk-radio-group' ,Tag: 'htk-radio-group'
,radioLock: false
,initialize(props) { ,initialize(props) {
this.clear(); this.clear();

View File

@ -140,52 +140,33 @@ function sprintf(formatString) {
}); });
} }
module.exports = { function format(value, format) {
regexpNumber: /%\.([0-9]+)d/g if (value === null || value === undefined)
,regexpString: /%s/g return '';
,equals if (format)
,diff switch (typeof value) {
,partialDiff case 'number':
,kvClone return format.replace(/%\.([0-9]+)d/g,
,simpleClone (_, digits) => new Number(value).toFixed(parseInt(digits)));
,simpleEquals case 'string':
,sprintf return format.replace(/%s/g,
() => value);
,compare(a, b) { case 'object':
if (a === b) if (value instanceof Date)
return true; return VnDate.strftime(value, format);
if (a instanceof Date && b instanceof Date)
return a.getTime() === b.getTime();
return false;
} }
,format(value, format) {
if (value === null || value === undefined)
return '';
if (format) return value;
switch (typeof value) { }
case 'number':
return format.replace(this.regexpNumber,
this.replaceNumber.bind(null, value));
case 'string':
return format.replace(this.regexpString,
this.replaceString.bind(null, value));
case 'object':
if (value instanceof Date)
return VnDate.strftime(value, format);
}
return value;
}
,replaceNumber(value, token, digits) { module.exports = {
return new Number(value).toFixed(parseInt(digits)); equals,
} diff,
partialDiff,
,replaceString(value) { kvClone,
return value; simpleClone,
} simpleEquals,
sprintf,
format,
}; };

View File

@ -1,6 +1,6 @@
{ {
"name": "hedera-web", "name": "hedera-web",
"version": "22.48.4", "version": "22.48.5",
"description": "Verdnatura web page", "description": "Verdnatura web page",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {