fix(Purchase): remove fixed payment Methods.
This commit is contained in:
parent
9d602c8ddc
commit
5c24266e7b
@ -151,11 +151,7 @@
|
|||||||
client_search: '',
|
client_search: '',
|
||||||
product_search: '',
|
product_search: '',
|
||||||
payment_cash: 0,
|
payment_cash: 0,
|
||||||
payment_methods: [
|
payment_methods: null,
|
||||||
{'text': 'Efectivo', 'value': 'CASH'},
|
|
||||||
{'text': 'Confiar', 'value': 'CONFIAR'},
|
|
||||||
{'text': 'Bancolombia', 'value': 'BANCOLOMBIA'},
|
|
||||||
],
|
|
||||||
purchase: {
|
purchase: {
|
||||||
date: this.getCurrentDate(),
|
date: this.getCurrentDate(),
|
||||||
customer: null,
|
customer: null,
|
||||||
@ -177,6 +173,7 @@
|
|||||||
created() {
|
created() {
|
||||||
this.fetchClients();
|
this.fetchClients();
|
||||||
this.fetchProducts();
|
this.fetchProducts();
|
||||||
|
this.fetchPaymentMethods();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
group () {
|
group () {
|
||||||
@ -265,13 +262,22 @@
|
|||||||
fetch('/don_confiao/api/products/')
|
fetch('/don_confiao/api/products/')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
console.log(data);
|
|
||||||
this.products = data;
|
this.products = data;
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error(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() {
|
addLine() {
|
||||||
this.purchase.saleline_set.push({ product: '', unit_price: 0, quantity:0, measuring_unit: ''});
|
this.purchase.saleline_set.push({ product: '', unit_price: 0, quantity:0, measuring_unit: ''});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user