Una fecha para facturas por venta
This commit is contained in:
@ -120,7 +120,7 @@
|
|||||||
output.push(this.draw().proporcion())
|
output.push(this.draw().proporcion())
|
||||||
output.push(this.draw().rut())
|
output.push(this.draw().rut())
|
||||||
output.push(this.draw().nombre())
|
output.push(this.draw().nombre())
|
||||||
output.push(this.draw().fecha())
|
//output.push(this.draw().fecha())
|
||||||
output.push('</div>')
|
output.push('</div>')
|
||||||
output.push('<div class="fields" data-index="'+this.props.index+'">')
|
output.push('<div class="fields" data-index="'+this.props.index+'">')
|
||||||
output.push('<div class="three wide field"></div>')
|
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: () => {
|
totalUnidades: () => {
|
||||||
const unidades = this.props.unidades.reduce((sum, unidad) => sum + unidad.props.valor, 0)
|
const unidades = this.props.unidades.reduce((sum, unidad) => sum + unidad.props.valor, 0)
|
||||||
const diff = parseFloat((this.props.valor - unidades).toFixed(4))
|
const diff = parseFloat((this.props.valor - unidades).toFixed(4))
|
||||||
@ -425,6 +431,7 @@
|
|||||||
return {
|
return {
|
||||||
venta: () => {
|
venta: () => {
|
||||||
this.watch().fecha()
|
this.watch().fecha()
|
||||||
|
this.watch().fechaFacturas()
|
||||||
this.watch().unidades()
|
this.watch().unidades()
|
||||||
this.watch().terreno()
|
this.watch().terreno()
|
||||||
this.watch().cantidad()
|
this.watch().cantidad()
|
||||||
@ -441,6 +448,15 @@
|
|||||||
}
|
}
|
||||||
$('#fecha_uf').calendar(cdo)
|
$('#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: () => {
|
unidades: () => {
|
||||||
this.props.unidades.forEach(unidad => {
|
this.props.unidades.forEach(unidad => {
|
||||||
unidad.watch().unidad()
|
unidad.watch().unidad()
|
||||||
@ -501,6 +517,7 @@
|
|||||||
const output = []
|
const output = []
|
||||||
output.push('<form id="venta_form" class="ui form">')
|
output.push('<form id="venta_form" class="ui form">')
|
||||||
output.push(this.draw().fecha())
|
output.push(this.draw().fecha())
|
||||||
|
output.push(this.draw().fechaFactura())
|
||||||
output.push(this.draw().precios())
|
output.push(this.draw().precios())
|
||||||
output.push(this.draw().prorrateos())
|
output.push(this.draw().prorrateos())
|
||||||
output.push('<div class="ui very basic segment" id="total_unidades"></div>')
|
output.push('<div class="ui very basic segment" id="total_unidades"></div>')
|
||||||
@ -530,6 +547,19 @@
|
|||||||
'</div>',
|
'</div>',
|
||||||
].join("\n")
|
].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: () => {
|
precios: () => {
|
||||||
const output = []
|
const output = []
|
||||||
output.push('<div class="fields">')
|
output.push('<div class="fields">')
|
||||||
@ -927,6 +957,7 @@
|
|||||||
fecha: new Date('{{$venta->currentEstado()->fecha->add(new DateInterval('P1D'))->format('Y-m-d')}}'),
|
fecha: new Date('{{$venta->currentEstado()->fecha->add(new DateInterval('P1D'))->format('Y-m-d')}}'),
|
||||||
valor: {{$uf}}
|
valor: {{$uf}}
|
||||||
},
|
},
|
||||||
|
fechaFactura: new Date('{{$venta->currentEstado()->fecha->add(new DateInterval('P1D'))->format('Y-m-d')}}'),
|
||||||
estado: {
|
estado: {
|
||||||
fecha: new Date('{{$venta->currentEstado()->fecha->add(new DateInterval('P1D'))->format('Y-m-d')}}')
|
fecha: new Date('{{$venta->currentEstado()->fecha->add(new DateInterval('P1D'))->format('Y-m-d')}}')
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user