fix(Purchase): remove fixed payment Methods.

This commit is contained in:
Mono Mono 2024-11-11 16:15:24 -05:00
parent 9d602c8ddc
commit 5c24266e7b

View File

@ -151,11 +151,7 @@
client_search: '',
product_search: '',
payment_cash: 0,
payment_methods: [
{'text': 'Efectivo', 'value': 'CASH'},
{'text': 'Confiar', 'value': 'CONFIAR'},
{'text': 'Bancolombia', 'value': 'BANCOLOMBIA'},
],
payment_methods: null,
purchase: {
date: this.getCurrentDate(),
customer: null,
@ -177,6 +173,7 @@
created() {
this.fetchClients();
this.fetchProducts();
this.fetchPaymentMethods();
},
watch: {
group () {
@ -265,13 +262,22 @@
fetch('/don_confiao/api/products/')
.then(response => response.json())
.then(data => {
console.log(data);
this.products = data;
})
.catch(error => {
console.error(error);
});
},
fetchPaymentMethods() {
fetch('/don_confiao/payment_methods/all/select_format')
.then(response => response.json())
.then(data => {
this.payment_methods = data;
})
.catch(error => {
console.error(error);
});
},
addLine() {
this.purchase.saleline_set.push({ product: '', unit_price: 0, quantity:0, measuring_unit: ''});
},