diff --git a/resources/assets/js/views/common/documents.js b/resources/assets/js/views/common/documents.js index 6e29eb03e..65d6cde05 100644 --- a/resources/assets/js/views/common/documents.js +++ b/resources/assets/js/views/common/documents.js @@ -470,11 +470,13 @@ const app = new Vue({ let selected_tax; - this.dynamic_taxes.forEach(function(tax) { - if (tax.id == this.tax_id) { - selected_tax = tax; - } - }, this); + if (this.dynamic_taxes.length) { + this.dynamic_taxes.forEach(function(tax) { + if (tax.id == this.tax_id) { + selected_tax = tax; + } + }, this); + } this.items[item_index].tax_ids.push({ id: selected_tax.id,