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.

View File

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

View File

@ -24,22 +24,18 @@ module.exports = new Class({
}
,async _realPay(amount, company) {
if (!isNumeric(amount) || amount <= 0)
throw new UserError(_('AmountError'));
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'));
if (!isNumeric(amount) || amount <= 0) {
Htk.Toast.showError(_('AmountError'));
return;
}
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 form = document.createElement('form');

View File

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

View File

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

View File

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

View File

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

View File

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