diff --git a/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue b/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue index ba3a39b1..e63a6f9e 100644 --- a/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue +++ b/resources/assets/vue/components/bookings/forms/PurchaseOrderFormComponent.vue @@ -29,6 +29,7 @@
+
@@ -61,38 +62,14 @@
+
-
-
-
{{index + 1}}
-
-
-
{{product.stockCode}}
-
-
-
{{product.description}}
-
-
-
{{product.quantity}}
-
-
-
{{product.unit_price}}
-
-
-
{{data.fixed_currency.short_code}}
-
-
-
{{(Math.round((product.total + Number.EPSILON) * 100) / 100).toFixed(2) }}
-
-
- -
-
+
@@ -130,7 +107,7 @@
- +
@@ -165,16 +142,16 @@ import formHandler from '../../../general/mixins/formHandler'; export default { data(){ - return { - submitted: false, - product: { - stockCode: '', - description: '', - quantity: 1, - unit_price: 0, - }, - products: [] - } + return { + submitted: false, + product: { + stockCode: '', + description: '', + quantity: 1, + unit_price: 0, + }, + products: [], + } }, created() { this.products = this.data.purchase_order ? this.data.purchase_order.details : []; @@ -231,7 +208,16 @@ quantity: 1, unit_price: 0, }; - + }, + updateProduct(product, index){ + console.log(product); + this.products[index] = { + stockCode: product.stockCode, + description: product.description, + quantity: product.quantity, + unit_price: product.unit_price, + total: product.quantity * parseFloat((product.unit_price).toString().replace(',', '')) + }; }, removeProduct(index){ this.products.splice(index, 1); diff --git a/resources/assets/vue/components/bookings/forms/PurchaseOrderItemFormComponent.vue b/resources/assets/vue/components/bookings/forms/PurchaseOrderItemFormComponent.vue new file mode 100644 index 00000000..c25ad961 --- /dev/null +++ b/resources/assets/vue/components/bookings/forms/PurchaseOrderItemFormComponent.vue @@ -0,0 +1,92 @@ + + \ No newline at end of file