mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
credito
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Controllers\Pedidos\Pedido;
|
||||
use CodeIgniter\Config\BaseService;
|
||||
|
||||
use App\Models\Configuracion\MaquinasTarifasImpresionModel;
|
||||
@ -1877,7 +1878,7 @@ class PresupuestoService extends BaseService
|
||||
$data_pedido = [
|
||||
'total_precio' => $datos_presupuesto->total_aceptado,
|
||||
'total_tirada' => $datos_presupuesto->tirada,
|
||||
'estado' => $model_cliente->creditoDisponible($datos_presupuesto->cliente_id) ? "produccion" : "validacion",
|
||||
'estado' => $model_cliente->creditoDisponible($datos_presupuesto->cliente_id, $datos_presupuesto->total_aceptado) ? "produccion" : "validacion",
|
||||
'user_created_id' => auth()->user()->id,
|
||||
'user_updated_id' => auth()->user()->id,
|
||||
];
|
||||
@ -1896,6 +1897,9 @@ class PresupuestoService extends BaseService
|
||||
}
|
||||
|
||||
if ($id_linea != 0 && $pedido_id != 0) {
|
||||
if($data_pedido['estado'] == "produccion"){
|
||||
$response = (new Pedido())->to_produccion($pedido_id);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@ -121,10 +121,10 @@ class ProductionService extends BaseService
|
||||
"total_tirada" => $this->pedido->total_tirada,
|
||||
"total_precio" => $this->pedido->total_precio
|
||||
];
|
||||
$ot_id = $this->otModel->insert($data);
|
||||
$this->init($ot_id);
|
||||
// $this->storeOrdenTrabajoUsers();
|
||||
// $this->storeOrdenTrabajoDates();
|
||||
$id = $this->otModel->insert($data);
|
||||
$this->init($id);
|
||||
$this->storeOrdenTrabajoUsers();
|
||||
$this->storeOrdenTrabajoDates();
|
||||
$this->storeAllTareas();
|
||||
return $this->ot;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user