mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
erase ot dates
This commit is contained in:
@ -982,6 +982,18 @@ class ProductionService extends BaseService
|
||||
$this->updateProgress();
|
||||
return $result;
|
||||
}
|
||||
public function emptyOrdenTrabajoDate(int $orden_trabajo_id, string $dateName)
|
||||
{
|
||||
$status = $this->otDate->where('orden_trabajo_id', $orden_trabajo_id)
|
||||
->set($dateName, null)
|
||||
->update();
|
||||
if (isset($this->ordenTrabajoConfig->DATE_USER_MAPPING[$dateName])) {
|
||||
$this->otUser->where('orden_trabajo_id', $orden_trabajo_id)
|
||||
->set($this->ordenTrabajoConfig->DATE_USER_MAPPING[$dateName], auth()->user()->id)
|
||||
->update();
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
public function updateOrdenTrabajoPedidoDate($data): array
|
||||
{
|
||||
$status = false;
|
||||
@ -1004,6 +1016,25 @@ class ProductionService extends BaseService
|
||||
"status" => $status
|
||||
];
|
||||
}
|
||||
public function emptyOrdenTrabajoPedidoDate(string $dateName)
|
||||
{
|
||||
$status = false;
|
||||
$user = auth()->user();
|
||||
$row = [];
|
||||
$pedidoDatesUser = $this->ordenTrabajoConfig->DATE_USER_MAPPING_PEDIDO;
|
||||
if (isset($pedidoDatesUser[$dateName])) {
|
||||
$attrUserPedido = $pedidoDatesUser[$dateName];
|
||||
$row[$attrUserPedido] = $user->id;
|
||||
$row[$dateName] = null;
|
||||
$status = $this->pedidoModel->update($this->pedido->id, $row);
|
||||
$this->updateProgress();
|
||||
} else {
|
||||
throw new Exception(lang('Produccion.errors.attr_not_exist', [$dateName]));
|
||||
}
|
||||
|
||||
|
||||
return $status;
|
||||
}
|
||||
public function updateOrdenTrabajo($data): bool
|
||||
{
|
||||
if (isset($data["is_pedido_espera"])) {
|
||||
|
||||
Reference in New Issue
Block a user