terminada la modificacion de las lineas de albaran

This commit is contained in:
2025-05-26 21:09:24 +02:00
parent 43e0ced1bd
commit 6dc91bfa4c
7 changed files with 32 additions and 10 deletions

View File

@ -411,6 +411,14 @@ class Albaran extends \App\Controllers\BaseResourceController
return '<input type="text" class="form-control form-control-sm input-albaran-linea" value="' . $q->titulo . return '<input type="text" class="form-control form-control-sm input-albaran-linea" value="' . $q->titulo .
'" data-id="' . $q->id . '" data-field="titulo" />'; '" data-id="' . $q->id . '" data-field="titulo" />';
}) })
->edit('cajas', function ($q) {
return '<input class="form-control input-albaran-linea
form-control-sm text-center" value="' . $q->cajas . '" data-id="' . $q->id . '" data-field="cajas" />';
})
->edit('unidades_cajas', function ($q) {
return '<input class="form-control input-albaran-linea
form-control-sm text-center" value="' . $q->unidades_cajas . '" data-id="' . $q->id . '" data-field="unidades_cajas" />';
})
->edit('total', function ($q) { ->edit('total', function ($q) {
return '<input class="form-control autonumeric-2 input-albaran-linea return '<input class="form-control autonumeric-2 input-albaran-linea
form-control-sm text-center" value="' . $q->total . '" data-id="' . $q->id . '" data-field="total" />'; form-control-sm text-center" value="' . $q->total . '" data-id="' . $q->id . '" data-field="total" />';

View File

@ -21,6 +21,7 @@ class AlbaranEntity extends \CodeIgniter\Entity\Entity
'updated_at' => null, 'updated_at' => null,
'deleted_at' => null, 'deleted_at' => null,
'cajas' => null, 'cajas' => null,
'unidades_cajas' => null,
]; ];
protected $dates = ['created_at', 'updated_at', 'deleted_at']; protected $dates = ['created_at', 'updated_at', 'deleted_at'];
@ -40,6 +41,7 @@ class AlbaranEntity extends \CodeIgniter\Entity\Entity
'user_created_id' => 'integer', 'user_created_id' => 'integer',
'user_updated_id' => 'integer', 'user_updated_id' => 'integer',
'fecha_albaran' => '?datetime', 'fecha_albaran' => '?datetime',
'cajas' => '?integer',
]; ];
// Agrega tus métodos personalizados aquí // Agrega tus métodos personalizados aquí

View File

@ -21,6 +21,8 @@ class AlbaranLineaEntity extends \CodeIgniter\Entity\Entity
'created_at' => null, 'created_at' => null,
'updated_at' => null, 'updated_at' => null,
'deleted_at' => null, 'deleted_at' => null,
'cajas' => null,
'unidades_cajas' => null,
]; ];
protected $casts = [ protected $casts = [
@ -36,5 +38,8 @@ class AlbaranLineaEntity extends \CodeIgniter\Entity\Entity
'iva_reducido' => '?boolean', 'iva_reducido' => '?boolean',
'user_created_id' => 'integer', 'user_created_id' => 'integer',
'user_updated_id' => 'integer', 'user_updated_id' => 'integer',
'cajas' => '?integer',
'unidades_cajas' => '?integer',
]; ];
} }

View File

@ -13,6 +13,7 @@ return [
'att' => 'Att', 'att' => 'Att',
'direccion' => 'Dirección', 'direccion' => 'Dirección',
'cajas' => 'Cajas', 'cajas' => 'Cajas',
'unidadesCaja' => 'Unidades/Caja',
'acciones' => 'Acciones', 'acciones' => 'Acciones',
'unidades' => 'Unidades', 'unidades' => 'Unidades',

View File

@ -30,6 +30,8 @@ class AlbaranLineaModel extends \App\Models\BaseModel
'created_at', 'created_at',
'updated_at', 'updated_at',
'deleted_at', 'deleted_at',
'cajas',
'unidades_cajas',
]; ];
protected $useSoftDeletes = true; protected $useSoftDeletes = true;
@ -70,7 +72,7 @@ class AlbaranLineaModel extends \App\Models\BaseModel
->table($this->table . " t1") ->table($this->table . " t1")
->select( ->select(
"t1.id, t1.titulo as titulo, t1.isbn as isbn, t1.ref_cliente as ref_cliente, "t1.id, t1.titulo as titulo, t1.isbn as isbn, t1.ref_cliente as ref_cliente,
t1.cantidad as unidades, t1.precio_unidad as precio_unidad, t1.iva_reducido as iva_reducido, t1.cantidad as unidades, t1.cajas, t1.unidades_cajas, t1.precio_unidad as precio_unidad, t1.iva_reducido as iva_reducido,
t1.total as total, pedidos.id AS pedido" t1.total as total, pedidos.id AS pedido"
) )
->join("pedidos_linea", "t1.pedido_linea_id = pedidos_linea.id", "left") ->join("pedidos_linea", "t1.pedido_linea_id = pedidos_linea.id", "left")

View File

@ -240,7 +240,7 @@
</button> </button>
</div> </div>
<div class="col-sm-3 px-3 d-flex flex-column justify-content-end"> <div class="col-sm-2 px-3 d-flex flex-column justify-content-end">
<div class="d-flex flex-column justify-content-end h-100"> <div class="d-flex flex-column justify-content-end h-100">
<label for="impresoraEtiquetas" class="form-label"> <label for="impresoraEtiquetas" class="form-label">
<?= lang("Logistica.impresoraEtiquetas") ?> <?= lang("Logistica.impresoraEtiquetas") ?>

View File

@ -153,6 +153,8 @@ class AlbaranComponent {
$('<th>', { class: 'lp-header', scope: 'col' }).css({ 'font-size': 'smaller' }).text(window.language.Albaran.titulo), $('<th>', { class: 'lp-header', scope: 'col' }).css({ 'font-size': 'smaller' }).text(window.language.Albaran.titulo),
$('<th>', { class: 'lp-header', scope: 'col' }).css({ 'font-size': 'smaller', 'max-width':'15%' }).text(window.language.Albaran.ISBN), $('<th>', { class: 'lp-header', scope: 'col' }).css({ 'font-size': 'smaller', 'max-width':'15%' }).text(window.language.Albaran.ISBN),
$('<th>', { class: 'lp-header', scope: 'col' }).css({ 'font-size': 'smaller', 'max-width':'15%' }).text(window.language.Albaran.refCliente), $('<th>', { class: 'lp-header', scope: 'col' }).css({ 'font-size': 'smaller', 'max-width':'15%' }).text(window.language.Albaran.refCliente),
$('<th>', { class: 'lp-header', scope: 'col' }).css({ 'font-size': 'smaller', 'max-width':'15%' }).text(window.language.Albaran.cajas),
$('<th>', { class: 'lp-header', scope: 'col' }).css({ 'font-size': 'smaller', 'max-width':'15%' }).text(window.language.Albaran.unidadesCaja),
$('<th>', { class: 'lp-header', scope: 'col' }).css({ 'font-size': 'smaller', 'max-width':'8%' }).text(window.language.Albaran.precioU), $('<th>', { class: 'lp-header', scope: 'col' }).css({ 'font-size': 'smaller', 'max-width':'8%' }).text(window.language.Albaran.precioU),
$('<th>', { class: 'lp-header', scope: 'col' }).css({ 'font-size': 'smaller', 'max-width':'8%' }).text(window.language.Albaran.subtotal), $('<th>', { class: 'lp-header', scope: 'col' }).css({ 'font-size': 'smaller', 'max-width':'8%' }).text(window.language.Albaran.subtotal),
$('<th>'), $('<th>'),
@ -230,6 +232,8 @@ class AlbaranComponent {
{ data: "titulo" }, { data: "titulo" },
{ data: "isbn" }, { data: "isbn" },
{ data: "ref_cliente" }, { data: "ref_cliente" },
{ data: "cajas"},
{ data: "unidades_cajas"},
{ data: "precio_unidad" }, { data: "precio_unidad" },
{ data: "total" }, { data: "total" },
{ data: "iva_reducido", visible: false }, { data: "iva_reducido", visible: false },
@ -244,13 +248,13 @@ class AlbaranComponent {
drawCallback: (settings) => { drawCallback: (settings) => {
if ($('#mostrar_precios_' + this.id).is(':checked')) { if ($('#mostrar_precios_' + this.id).is(':checked')) {
this.table this.table
.column(7).visible(true) .column(9).visible(true)
.column(8).visible(true); .column(10).visible(true);
} }
else { else {
this.table this.table
.column(7).visible(false) .column(9).visible(false)
.column(8).visible(false); .column(10).visible(false);
} }
requestAnimationFrame(() => { requestAnimationFrame(() => {
@ -316,12 +320,12 @@ class AlbaranComponent {
const checked = $(e.currentTarget).is(':checked'); const checked = $(e.currentTarget).is(':checked');
if (checked) { if (checked) {
this.table this.table
.column(7).visible(true) .column(9).visible(true)
.column(8).visible(true); .column(10).visible(true);
} else { } else {
this.table this.table
.column(7).visible(false) .column(9).visible(false)
.column(8).visible(false); .column(10).visible(false);
} }
$.post('/albaranes/updateAlbaran', { $.post('/albaranes/updateAlbaran', {