fixes #5074 ticket balance pone null #1308

Merged
alexandre merged 4 commits from 5074-ticket-balance-null into dev 2023-02-06 09:02:44 +00:00
2 changed files with 9 additions and 6 deletions

View File

@ -59,11 +59,14 @@ class Controller extends Dialog {
if (value) {
const accountingType = value.accountingType;
if (accountingType.receiptDescription != null) {
this.receipt.description = accountingType.receiptDescription;
if (this.originalDescription) this.receipt.description += `, ${this.originalDescription}`;
} else if (this.originalDescription)
this.receipt.description = this.originalDescription;
this.receipt.description = [];
if (accountingType.receiptDescription != null && accountingType.receiptDescription != '')
this.receipt.description.push(accountingType.receiptDescription);
if (this.originalDescription)
this.receipt.description.push(this.originalDescription);
this.receipt.description.join(', ');
this.maxAmount = accountingType && accountingType.maxAmount;
this.receipt.payed = Date.vnNew();

View File

@ -38,7 +38,7 @@ describe('Client', () => {
}
};
expect(controller.receipt.description).toEqual('Cash, Albaran: 1, 2');
expect(controller.receipt.description.join(',')).toEqual('Cash,Albaran: 1, 2');
});
});