mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'fix/pedido-espera-update-ot' into 'main'
fix update pedido espera update See merge request jjimenez/safekat!706
This commit is contained in:
@ -147,6 +147,8 @@ class Ordentrabajo extends BaseController
|
||||
];
|
||||
$this->viewData["modelId"] = $orden_trabajo_id;
|
||||
$this->produccionService->init($orden_trabajo_id);
|
||||
$this->produccionService->reInsertOrdenTrabajoDates();
|
||||
$this->produccionService->reInsertOrdenTrabajoUsers();
|
||||
$this->viewData["presupuesto"] = $this->produccionService->getPresupuesto();
|
||||
$this->viewData["cliente"] = $this->produccionService->getCliente();
|
||||
$this->viewData["ot"] = $this->produccionService->getOrdenTrabajo();
|
||||
|
||||
@ -23,7 +23,7 @@ class OrdenTrabajoDateEntity extends Entity
|
||||
"entrada_manipulado_at" => null,
|
||||
"cosido_at" => null,
|
||||
"solapa_at" => null,
|
||||
"cosido_at" => null,
|
||||
"grapado_at" => null,
|
||||
"retractilado_at"=> null,
|
||||
"retractilado5_at"=> null,
|
||||
"prototipo_at"=> null,
|
||||
|
||||
@ -30,7 +30,7 @@ class OrdenTrabajoDate extends Model
|
||||
"entrada_manipulado_at",
|
||||
"cosido_at",
|
||||
"solapa_at",
|
||||
"cosido_at",
|
||||
"grapado_at",
|
||||
"retractilado_at",
|
||||
"retractilado5_at",
|
||||
"prototipo_at",
|
||||
|
||||
@ -90,7 +90,6 @@ class ProductionService extends BaseService
|
||||
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["sin_imprimir"];
|
||||
return $this;
|
||||
} catch (\Throwable $th) {
|
||||
dd($orden_trabajo_id);
|
||||
throw $th;
|
||||
}
|
||||
}
|
||||
@ -141,10 +140,10 @@ class ProductionService extends BaseService
|
||||
];
|
||||
$id = $this->otModel->insert($data);
|
||||
$this->init($id);
|
||||
$this->updatePedidoEspera();
|
||||
$this->storeOrdenTrabajoUsers();
|
||||
$this->storeOrdenTrabajoDates();
|
||||
$this->storeAllTareas();
|
||||
$this->updatePedidoEspera();
|
||||
return $this->ot;
|
||||
}
|
||||
|
||||
@ -177,6 +176,24 @@ class ProductionService extends BaseService
|
||||
"orden_trabajo_id" => $this->ot->id,
|
||||
]);
|
||||
}
|
||||
public function reInsertOrdenTrabajoUsers(): int|bool|string
|
||||
{
|
||||
$status = false;
|
||||
if($this->otUser->where('orden_trabajo_id',$this->ot->id)->countAllResults() == 0)
|
||||
{
|
||||
$status = $this->storeOrdenTrabajoUsers();
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
public function reInsertOrdenTrabajoDates(): int|bool|string
|
||||
{
|
||||
$status = false;
|
||||
if($this->otDate->where('orden_trabajo_id',$this->ot->id)->countAllResults() == 0)
|
||||
{
|
||||
$status = $this->storeOrdenTrabajoDates();
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
protected function storeAllTareas()
|
||||
{
|
||||
$this->storeOrdenTrabajoTareas();
|
||||
@ -757,8 +774,8 @@ class ProductionService extends BaseService
|
||||
{
|
||||
$result = [];
|
||||
$otDate = $this->otDate->where('orden_trabajo_id', $this->ot->id)
|
||||
->set([$data['name'] => $data[$data['name']]])
|
||||
->update($data);
|
||||
->set($data['name'],$data[$data['name']])
|
||||
->update();
|
||||
$this->otDate->updateUserDateMap($this->ot->id, $data);
|
||||
$ot_users = $this->ot->users();
|
||||
if (isset($this->ordenTrabajoConfig->DATE_USER_MAPPING[$data["name"]])) {
|
||||
@ -1063,7 +1080,7 @@ class ProductionService extends BaseService
|
||||
$status = false;
|
||||
$presupuestoFiles = $this->presupuesto->files();
|
||||
if (count($presupuestoFiles) == 0) {
|
||||
$status = $this->otModel->update($this->ot->id, ['pedido_espera' => true]);
|
||||
$status = $this->otModel->update($this->ot->id, ['is_pedido_espera' => true]);
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
|
||||
@ -81,6 +81,15 @@ class OrdenTrabajo {
|
||||
this.prepGrapado = new DatePicker(this.otForm.find("#ot-prep-grapado"), option)
|
||||
this.prepSolapa = new DatePicker(this.otForm.find("#ot-prep-solapa"), option)
|
||||
|
||||
this.prepPrototipo = new DatePicker(this.otForm.find("#ot-prep-prototipo"), option)
|
||||
this.prepMarcapaginas = new DatePicker(this.otForm.find("#ot-prep-marcapaginas"), option)
|
||||
this.prepRetractilado = new DatePicker(this.otForm.find("#ot-prep-retractilado"), option)
|
||||
this.prepRetractilado5 = new DatePicker(this.otForm.find("#ot-prep-retractilado5"), option)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
this.espiral = new DatePicker(this.otForm.find("#ot-espiral"), option)
|
||||
this.embalaje = new DatePicker(this.otForm.find("#ot-embalaje"), option)
|
||||
this.envio = new DatePicker(this.otForm.find("#ot-envio"), option)
|
||||
@ -225,7 +234,7 @@ class OrdenTrabajo {
|
||||
if (element.presupuesto_preimpresion_id) this.createSelectMaquinaAll(selectItem)
|
||||
if (element.presupuesto_extra_id) this.createSelectMaquinaAll(selectItem)
|
||||
if (this.summaryData.impresion_interior_bn) {
|
||||
let isTareaImpresionInteriorBN = this.summaryData.impresion_interior_bn?.presupuesto_linea_id == element.presupuesto_linea_id
|
||||
let isTareaImpresionInteriorBN = this.summaryData.impresion_interior_bn?.presupuesto_linea_id == element.presupuesto_linea_id && element.is_corte == false
|
||||
if (isTareaImpresionInteriorBN) {
|
||||
let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
|
||||
this.createSelectImposicion(selectItemImposicion)
|
||||
@ -235,7 +244,7 @@ class OrdenTrabajo {
|
||||
}
|
||||
}
|
||||
if (this.summaryData.impresion_interior_color) {
|
||||
let isTareaImpresionInteriorColor = this.summaryData.impresion_interior_color?.presupuesto_linea_id == element.presupuesto_linea_id
|
||||
let isTareaImpresionInteriorColor = this.summaryData.impresion_interior_color?.presupuesto_linea_id == element.presupuesto_linea_id && element.is_corte == false
|
||||
if (isTareaImpresionInteriorColor) {
|
||||
let selectItemImposicion = this.item.find("#select-imposicion-tarea-" + element.id);
|
||||
this.createSelectImposicion(selectItemImposicion)
|
||||
@ -397,6 +406,11 @@ class OrdenTrabajo {
|
||||
this.prepSolapa.setDate(this.summaryData.dates.solapa_at)
|
||||
this.prepGrapado.setDate(this.summaryData.dates.grapado_at)
|
||||
|
||||
this.prepPrototipo.setDate(this.summaryData.dates.prototipo_at)
|
||||
this.prepMarcapaginas.setDate(this.summaryData.dates.marcapaginas_at)
|
||||
this.prepRetractilado.setDate(this.summaryData.dates.retractilado_at)
|
||||
this.prepRetractilado5.setDate(this.summaryData.dates.retractilado5_at)
|
||||
|
||||
this.espiral.setDate(this.summaryData.dates.fecha_impresion_at)
|
||||
this.embalaje.setDate(this.summaryData.dates.embalaje_at)
|
||||
this.envio.setDate(this.summaryData.dates.envio_at)
|
||||
|
||||
Reference in New Issue
Block a user