Una fecha para facturas por venta
This commit is contained in:
@ -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('</div>')
|
||||
output.push('<div class="fields" data-index="'+this.props.index+'">')
|
||||
output.push('<div class="three wide field"></div>')
|
||||
@ -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('<form id="venta_form" class="ui form">')
|
||||
output.push(this.draw().fecha())
|
||||
output.push(this.draw().fechaFactura())
|
||||
output.push(this.draw().precios())
|
||||
output.push(this.draw().prorrateos())
|
||||
output.push('<div class="ui very basic segment" id="total_unidades"></div>')
|
||||
@ -530,6 +547,19 @@
|
||||
'</div>',
|
||||
].join("\n")
|
||||
},
|
||||
fechaFactura: () => {
|
||||
return [
|
||||
'<div class="three wide field">',
|
||||
'<label for="fecha_uf">Fecha Facturas</label>',
|
||||
'<div class="ui calendar" id="fecha_facturas">',
|
||||
'<div class="ui right icon input">',
|
||||
'<input type="text" name="fecha_facturas" />',
|
||||
'<i class="calendar icon"></i>',
|
||||
'</div>',
|
||||
'</div>',
|
||||
'</div>',
|
||||
].join("\n")
|
||||
},
|
||||
precios: () => {
|
||||
const output = []
|
||||
output.push('<div class="fields">')
|
||||
@ -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')}}')
|
||||
},
|
||||
|
Reference in New Issue
Block a user