Check uf, replace ',' in valor
This commit is contained in:
@ -194,7 +194,9 @@ class Ventas
|
||||
$pie->valor = post('pie');
|
||||
$pie->fecha = $f->format('Y-m-d');
|
||||
$pie->cuotas = post('cuotas');
|
||||
$pie->uf = $uf->uf->value;
|
||||
if ($uf->total > 0) {
|
||||
$pie->uf = $uf->uf->value;
|
||||
}
|
||||
$pie->save();
|
||||
|
||||
$venta->pie = $pie->id;
|
||||
@ -205,7 +207,9 @@ class Ventas
|
||||
|
||||
$pago = model(Pago::class)->create();
|
||||
$pago->fecha = $f->format('Y-m-d');
|
||||
$pago->uf = $uf->uf->value;
|
||||
if ($uf->total > 0) {
|
||||
$pago->uf = $uf->uf->value;
|
||||
}
|
||||
$pago->valor = $bono->valor * $uf->uf->value;
|
||||
$pago->tipo = 8;
|
||||
$pago->new();
|
||||
@ -218,7 +222,9 @@ class Ventas
|
||||
if (post('credito')) {
|
||||
$pago = model(Pago::class)->create();
|
||||
$pago->fecha = $f->format('Y-m-d');
|
||||
$pago->uf = $uf->uf->value;
|
||||
if ($uf->total > 0) {
|
||||
$pago->uf = $uf->uf->value;
|
||||
}
|
||||
$pago->valor = post('credito') * $uf->uf->value;
|
||||
$pago->tipo = 2;
|
||||
$pago->new();
|
||||
@ -231,12 +237,14 @@ class Ventas
|
||||
}
|
||||
|
||||
$venta->fecha = $f->format('Y-m-d');
|
||||
$venta->valor_uf = post('valor');
|
||||
$venta->valor_uf = str_replace(',', '', post('valor'));
|
||||
$venta->fecha_ingreso = $t->format('Y-m-d');
|
||||
if (post('operador') != 0) {
|
||||
$venta->agente = post('operador');
|
||||
}
|
||||
$venta->uf = $uf->uf->value;
|
||||
if ($uf->total > 0) {
|
||||
$venta->uf = $uf->uf->value;
|
||||
}
|
||||
$venta->new();
|
||||
|
||||
if (post('promociones') != 0) {
|
||||
|
Reference in New Issue
Block a user