diff --git a/app/resources/views/ventas/facturacion/show.blade.php b/app/resources/views/ventas/facturacion/show.blade.php
index a2e1b39..71f57d0 100644
--- a/app/resources/views/ventas/facturacion/show.blade.php
+++ b/app/resources/views/ventas/facturacion/show.blade.php
@@ -120,7 +120,7 @@
output.push(this.draw().proporcion())
output.push(this.draw().rut())
output.push(this.draw().nombre())
- output.push(this.draw().fecha())
+ //output.push(this.draw().fecha())
output.push('')
output.push('
')
output.push('
')
@@ -354,6 +354,12 @@
})
})
},
+ fechaFacturas: date => {
+ this.props.fechaFacturas = date
+ this.props.propietarios.forEach((propietario, index) => {
+ this.props.propietarios[index].props.fecha = date
+ })
+ },
totalUnidades: () => {
const unidades = this.props.unidades.reduce((sum, unidad) => sum + unidad.props.valor, 0)
const diff = parseFloat((this.props.valor - unidades).toFixed(4))
@@ -425,6 +431,7 @@
return {
venta: () => {
this.watch().fecha()
+ this.watch().fechaFacturas()
this.watch().unidades()
this.watch().terreno()
this.watch().cantidad()
@@ -441,6 +448,15 @@
}
$('#fecha_uf').calendar(cdo)
},
+ fechaFacturas: () => {
+ const cdo = structuredClone(calendar_date_options)
+ cdo['initialDate'] = this.props.estado.fecha
+ cdo['onChange'] = (date, text, mode) => {
+ this.update().fechaFacturas(date)
+ facturas.draw().facturas()
+ }
+ $('#fecha_facturas').calendar(cdo)
+ },
unidades: () => {
this.props.unidades.forEach(unidad => {
unidad.watch().unidad()
@@ -501,6 +517,7 @@
const output = []
output.push('
',
].join("\n")
},
+ fechaFactura: () => {
+ return [
+ '',
+ '
',
+ '
',
+ '
',
+ '',
+ '',
+ '
',
+ '
',
+ '
',
+ ].join("\n")
+ },
precios: () => {
const output = []
output.push('')
@@ -927,6 +957,7 @@
fecha: new Date('{{$venta->currentEstado()->fecha->add(new DateInterval('P1D'))->format('Y-m-d')}}'),
valor: {{$uf}}
},
+ fechaFactura: new Date('{{$venta->currentEstado()->fecha->add(new DateInterval('P1D'))->format('Y-m-d')}}'),
estado: {
fecha: new Date('{{$venta->currentEstado()->fecha->add(new DateInterval('P1D'))->format('Y-m-d')}}')
},