Log agregar Venta

This commit is contained in:
Juan Pablo Vial
2022-06-09 16:19:05 -04:00
parent eac6b7d197
commit 9ffc7527c3

View File

@ -120,19 +120,21 @@ class Ventas
} }
public static function agregar() public static function agregar()
{ {
error_log(var_export(post(), true));
$f = Carbon::createFromDate(post('year'), post('month'), post('day'), config('app.timezone')); $f = Carbon::createFromDate(post('year'), post('month'), post('day'), config('app.timezone'));
$t = Carbon::today(config('app.timezone')); $t = Carbon::today(config('app.timezone'));
$uf = uf($f); $uf = uf($f);
error_log(var_export($uf, true));
$calle = trim(post('calle')); $calle = trim(post('calle'));
$numero = post('numero'); $numero = post('numero');
$extra = trim(post('extra')); $extra = trim(post('extra'));
$comuna = post('comuna'); $comuna = post('comuna');
$direccion = model(Direccion::class) $direccion = model(Direccion::class)
->where('calle', $calle) ->where('calle', $calle)
->where('numero', $numero) ->where('numero', $numero)
->where('extra', $extra) ->where('extra', $extra)
->where('comuna', $comuna) ->where('comuna', $comuna)
->findOne(); ->findOne();
if (!$direccion) { if (!$direccion) {
$direccion = model(Direccion::class)->create(); $direccion = model(Direccion::class)->create();