mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
add check preimpresion when imported from Bubok or Catalogo
This commit is contained in:
@ -361,7 +361,7 @@ class ImportadorBubok extends BaseResourceController
|
|||||||
|
|
||||||
// confirmar y crear pedido y ot
|
// confirmar y crear pedido y ot
|
||||||
$presupuestoModel->confirmarPresupuesto($response['sk_id']);
|
$presupuestoModel->confirmarPresupuesto($response['sk_id']);
|
||||||
PresupuestoService::crearPedido($response['sk_id']);
|
PresupuestoService::crearPedido($response['sk_id'],isImported:true);
|
||||||
|
|
||||||
|
|
||||||
if (!isset($response['sk_id'])) {
|
if (!isset($response['sk_id'])) {
|
||||||
|
|||||||
@ -359,7 +359,7 @@ class ImportadorCatalogo extends BaseResourceController
|
|||||||
|
|
||||||
// confirmar y crear pedido y ot
|
// confirmar y crear pedido y ot
|
||||||
model('App\Models\Presupuestos\PresupuestoModel')->confirmarPresupuesto($response['data']['sk_id']);
|
model('App\Models\Presupuestos\PresupuestoModel')->confirmarPresupuesto($response['data']['sk_id']);
|
||||||
PresupuestoService::crearPedido($response['data']['sk_id']);
|
PresupuestoService::crearPedido($response['data']['sk_id'],isImported:true);
|
||||||
|
|
||||||
return $this->respond($response);
|
return $this->respond($response);
|
||||||
|
|
||||||
|
|||||||
@ -1867,7 +1867,7 @@ class PresupuestoService extends BaseService
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static function crearPedido($presupuesto_id)
|
public static function crearPedido($presupuesto_id,?bool $isImported = false)
|
||||||
{
|
{
|
||||||
$model_pedido = model('App\Models\Pedidos\PedidoModel');
|
$model_pedido = model('App\Models\Pedidos\PedidoModel');
|
||||||
$model_pedido_linea = model('App\Models\Pedidos\PedidoLineaModel');
|
$model_pedido_linea = model('App\Models\Pedidos\PedidoLineaModel');
|
||||||
@ -1911,7 +1911,7 @@ class PresupuestoService extends BaseService
|
|||||||
$serviceProduction->setPedido($pedido);
|
$serviceProduction->setPedido($pedido);
|
||||||
if (!$pedido->orden_trabajo()) {
|
if (!$pedido->orden_trabajo()) {
|
||||||
|
|
||||||
$r = $serviceProduction->createOrdenTrabajo();
|
$r = $serviceProduction->createOrdenTrabajo($isImported);
|
||||||
$modelPedido->set(['estado' => 'produccion'])->where('id', $pedido_id)->update();
|
$modelPedido->set(['estado' => 'produccion'])->where('id', $pedido_id)->update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user