fix store ot

This commit is contained in:
amazuecos
2025-03-26 23:29:19 +01:00
parent 09e8af15cc
commit e44421fb4d
7 changed files with 466 additions and 44 deletions

View File

@ -110,7 +110,6 @@ class ProductionService extends BaseService
{
$auth_user = auth()->user();
$ot = new OrdenTrabajoEntity();
$ot_exists = $this->pedido->orden_trabajo();
if ($ot_exists) {
return $ot_exists;
@ -122,11 +121,8 @@ class ProductionService extends BaseService
"total_tirada" => $this->pedido->total_tirada,
"total_precio" => $this->pedido->total_precio
];
$ot->fill($data);
$this->otModel->save($ot);
$ot_id = $this->otModel->getInsertID();
$ot->id = $ot_id;
$this->init($ot_id);
$id = $this->otModel->insert($data);
$this->init($id);
$this->storeOrdenTrabajoUsers();
$this->storeOrdenTrabajoDates();
$this->storeAllTareas();