vuetify_set_unit_price_automatically_#37 #38

Merged
mono merged 3 commits from vuetify_set_unit_price_automatically_#37 into main 2024-09-28 19:37:50 -05:00
Showing only changes of commit 71e3808c78 - Show all commits

View File

@ -45,6 +45,7 @@
<v-select
v-model="line.product"
:items="products"
@update:modelValue="onProductChange(index)"
item-title="name"
item-value="id"
label="Producto"
@ -138,6 +139,11 @@
},
},
methods: {
onProductChange(index) {
const selectedProductId = this.purchase.saleline_set[index].product;
const selectedProduct = this.products.find(p => p.id == selectedProductId);
this.purchase.saleline_set[index].unit_price = selectedProduct.price;
},
fetchClients() {
fetch('/don_confiao/api/customers/')
.then(response => response.json())