Guardar factura

This commit is contained in:
Juan Pablo Vial
2025-02-03 22:17:57 -03:00
parent 71615050f3
commit 59a28a353b
11 changed files with 296 additions and 122 deletions

View File

@ -21,12 +21,13 @@ class Facturas extends Controller
'success' => false
];
try {
foreach (['cliente', 'unidades', 'detalle', 'total', 'uf'] as $key) {
/*foreach (['cliente', 'unidades', 'detalle', 'total', 'uf'] as $key) {
if (!isset($data[$key]) or empty($data[$key])) {
continue;
}
$data[$key] = json_decode($data[$key], true);
}
}*/
$data['cliente'] = json_decode($data['cliente'], true);
$output['factura'] = $facturaService->add($data);
$output['success'] = true;
} catch (Implement\Exception\EmptyResult) {