Fill payment when editing
This commit is contained in:
@ -37,13 +37,13 @@
|
|||||||
this.prefix = prefix
|
this.prefix = prefix
|
||||||
this.ids = {
|
this.ids = {
|
||||||
pie: {
|
pie: {
|
||||||
checkbox: `${this.prefix}_has_pie`,
|
checkbox: `${this.prefix}_payment_has_pie`,
|
||||||
value: `${this.prefix}_pie`,
|
value: `${this.prefix}_payment_pie`,
|
||||||
installments: `${this.prefix}_cuotas`
|
installments: `${this.prefix}_payment_cuotas`
|
||||||
},
|
},
|
||||||
credit: {
|
credit: {
|
||||||
checkbox: `${this.prefix}_has_credit`,
|
checkbox: `${this.prefix}_payment_has_credit`,
|
||||||
value: `${this.prefix}_credit`
|
value: `${this.prefix}_payment_credit`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.setup()
|
this.setup()
|
||||||
@ -77,18 +77,24 @@
|
|||||||
this.hide.credit()
|
this.hide.credit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fill(formaPago) {
|
fill(payment) {
|
||||||
if ('pie' in formaPago && formaPago.pie !== null) {
|
if ('pie' in payment && payment.pie !== null) {
|
||||||
this.components.pie.$checkbox.prop('checked', true)
|
this.components.pie.$checkbox.prop('checked', true)
|
||||||
//this.show.pie()
|
this.show.pie()
|
||||||
this.components.pie.value.value = formaPago.pie.valor
|
this.components.pie.value.querySelector('input').value = payment.pie.valor
|
||||||
this.components.pie.installments.value = formaPago.pie.cuotas
|
this.components.pie.installments.querySelector('input').value = payment.pie.cuotas
|
||||||
}
|
}
|
||||||
if ('credito' in formaPago && formaPago.credito !== null) {
|
if ('credito' in payment && payment.credito !== null) {
|
||||||
this.components.credit.$checkbox.prop('checked', true)
|
this.components.credit.$checkbox.prop('checked', true)
|
||||||
//this.show.credit()
|
this.show.credit()
|
||||||
this.components.credit.value.value = formaPago.credito.value
|
this.components.credit.value.querySelector('input').value = payment.credito.valor
|
||||||
}
|
}
|
||||||
|
/*if ('subsidio' in payment && payment.subsidio !== null) {
|
||||||
|
this.components.subsidio.$checkbox.prop('checked', true)
|
||||||
|
this.components.subsidio.subsidy.value.value = payment.subsidio.subsidio.valor
|
||||||
|
this.components.subsidio.savings.value.value = payment.subsidio.ahorro.valor
|
||||||
|
this.show.subsidio()
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
setup() {
|
setup() {
|
||||||
this.components.pie.$checkbox = $(`#${this.ids.pie.checkbox}`)
|
this.components.pie.$checkbox = $(`#${this.ids.pie.checkbox}`)
|
||||||
|
|||||||
Reference in New Issue
Block a user