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