diff --git a/templates/expenses/new.html b/templates/expenses/new.html index 2dc30d1..baef202 100644 --- a/templates/expenses/new.html +++ b/templates/expenses/new.html @@ -337,21 +337,19 @@

Kvittodelar

}, addPart: function () { this.expense_parts.push({ - committeeId: this.expense_parts[this.expense_parts.length - 1].committeeId, - costCentreId: this.expense_parts[this.expense_parts.length - 1].costCentreId, - budgetLineId: 0, - amount: 0 - }) + costCentre: this.expense_parts[this.expense_parts.length - 1].costCentre, + secondaryCostCentre: this.expense_parts[this.expense_parts.length - 1].secondaryCostCentre, + budgetLine: '', + amount: 0, + }); }, removePart: function (i) { - if (this.expense_parts <= 2) { - return - } - this.expense_parts.splice(i, 1) + if (this.expense_parts.length > 1) + this.expense_parts.splice(i, 1) }, - validateBudgetLines: function () { - return Array.prototype.filter.call((this.expense_parts), (budget => budget.budgetLine != '')).length == this.expense_parts.length - } + validateBudgetLines: function () { + return Array.prototype.filter.call(this.expense_parts, budget => budget.budgetLine != '').length == this.expense_parts.length + } } }) diff --git a/templates/invoices/new.html b/templates/invoices/new.html index e126ea5..0eb9414 100644 --- a/templates/invoices/new.html +++ b/templates/invoices/new.html @@ -173,7 +173,7 @@

Fakturadelar

- +