mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Implementada la logica para la creacion de albaranes en PDF
This commit is contained in:
@ -110,4 +110,33 @@ class AlbaranModel extends \App\Models\BaseModel
|
||||
|
||||
return $return_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get resource data for creating PDFs.
|
||||
*
|
||||
* @param string $search
|
||||
*
|
||||
* @return \CodeIgniter\Database\BaseBuilder
|
||||
*/
|
||||
public function getResourceForPdf($albaran_id = -1)
|
||||
{
|
||||
$builder = $this->db
|
||||
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id AS id, t1.pedido_id AS pedido_id, t1.presupuesto_id AS presupuesto_id,
|
||||
t1.presupuesto_direccion_id AS presupuesto_direccion_id, t1.cliente_id AS cliente_id,
|
||||
t1.serie_id AS serie_id, t1.numero_albaran AS numero_albaran, t1.mostrar_precios AS mostrar_precios,
|
||||
t1.total AS total, t1.direccion_albaran AS direccion_albaran, t1.att_albaran AS att_albaran,
|
||||
t1.user_created_id AS user_created_id, t1.user_updated_id AS user_updated_id,
|
||||
t1.created_at AS created_at, t1.updated_at AS updated_at,
|
||||
t2.nombre AS cliente"
|
||||
);
|
||||
$builder->join("clientes t2", "t1.cliente_id = t2.id", "left");
|
||||
|
||||
$builder->where("t1.deleted_at IS NULL");
|
||||
$builder->where("t1.id", $albaran_id);
|
||||
|
||||
return $builder;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user