FIX: edit payments
This commit is contained in:
@ -573,7 +573,7 @@
|
||||
form.action = '{{ $urls->base }}/ventas/add'
|
||||
|
||||
// Add CSRF token
|
||||
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content')
|
||||
const csrfToken = Math.random().toString(36).substring(2)
|
||||
const csrfInput = document.createElement('input')
|
||||
csrfInput.type = 'hidden'
|
||||
csrfInput.name = '_token'
|
||||
|
||||
@ -285,9 +285,9 @@
|
||||
'buyer_marital_status': this.reservation.buyer.datos?.estadoCivil,
|
||||
'buyer_profession': this.reservation.buyer.datos?.ocupacion,
|
||||
'broker_rut': this.reservation.broker?.rut?.toString(),
|
||||
'payment_pie': this.reservation.payment?.pie,
|
||||
'payment_cuotas': this.reservation.payment?.cuotas?.toString(),
|
||||
'payment_credit': this.reservation.payment?.credit,
|
||||
'payment_pie': this.reservation.payment?.pie?.valor?.toString(),
|
||||
'payment_cuotas': this.reservation.payment?.pie?.cuotas?.toString(),
|
||||
'payment_credit': this.reservation.payment?.credito?.valor?.toString(),
|
||||
'promotions[]': this.reservation.promotions?.map(p => p.id.toString()),
|
||||
'units[]': this.reservation.units?.map(u => u.unit.id.toString()),
|
||||
'units_value[]': this.reservation.units?.map(u => u.value.toString()),
|
||||
|
||||
@ -120,12 +120,12 @@
|
||||
birthdate.getDate().toString().padStart(2, '0')].join('-'))
|
||||
body.set(`${this.prefix}_broker_rut`, Rut.clean(this.components.$broker.dropdown('get value')))
|
||||
|
||||
if (this.components.payments.components.pie.$checkbox.checkbox('is unchecked')) {
|
||||
if (!this.components.payments.components.pie.$checkbox.is(':checked')) {
|
||||
body.delete(`${this.prefix}_payment_pie`)
|
||||
body.delete(`${this.prefix}_payment_cuotas`)
|
||||
}
|
||||
body.delete(`${this.prefix}_payment_has_pie`)
|
||||
if (this.components.payments.components.credit.$checkbox.checkbox('is unchecked')) {
|
||||
if (!this.components.payments.components.credit.$checkbox.is(':checked')) {
|
||||
body.delete(`${this.prefix}_payment_credit`)
|
||||
}
|
||||
body.delete(`${this.prefix}_payment_has_credit`)
|
||||
|
||||
Reference in New Issue
Block a user