#744 fix edit sale bug
This commit is contained in:
parent
410c38c420
commit
0b112b3d59
|
@ -25,14 +25,18 @@ class Controller {
|
|||
|
||||
set sales(value) {
|
||||
this._sales = value;
|
||||
this.loadSubTotal();
|
||||
this.loadVAT();
|
||||
this.refreshTotal();
|
||||
}
|
||||
|
||||
get sales() {
|
||||
return this._sales;
|
||||
}
|
||||
|
||||
refreshTotal() {
|
||||
this.loadSubTotal();
|
||||
this.loadVAT();
|
||||
}
|
||||
|
||||
loadSubTotal() {
|
||||
this.subTotal = 0.0;
|
||||
if (!this.sales) return;
|
||||
|
@ -151,9 +155,9 @@ class Controller {
|
|||
}
|
||||
|
||||
removeInstances(instances) {
|
||||
for (let i = instances.length - 1; i >= 0; i--) {
|
||||
this.sales.splice(instances[i].instance, 1);
|
||||
}
|
||||
for (let i of instances)
|
||||
this.sales.splice(i.instance, 1);
|
||||
this.refreshTotal();
|
||||
}
|
||||
|
||||
showRemoveLinesDialog() {
|
||||
|
@ -327,16 +331,16 @@ class Controller {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Unmark sale as reserved
|
||||
*/
|
||||
/**
|
||||
* Unmark sale as reserved
|
||||
*/
|
||||
unmarkAsReserved() {
|
||||
this.setReserved(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark sale as reserved
|
||||
*/
|
||||
/**
|
||||
* Mark sale as reserved
|
||||
*/
|
||||
markAsReserved() {
|
||||
this.setReserved(true);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue