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 .
'" 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) {
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" />';

View File

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

View File

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

View File

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

View File

@ -30,6 +30,8 @@ class AlbaranLineaModel extends \App\Models\BaseModel
'created_at',
'updated_at',
'deleted_at',
'cajas',
'unidades_cajas',
];
protected $useSoftDeletes = true;
@ -70,7 +72,7 @@ class AlbaranLineaModel extends \App\Models\BaseModel
->table($this->table . " t1")
->select(
"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"
)
->join("pedidos_linea", "t1.pedido_linea_id = pedidos_linea.id", "left")

View File

@ -240,7 +240,7 @@
</button>
</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">
<label for="impresoraEtiquetas" class="form-label">
<?= 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', '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.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.subtotal),
$('<th>'),
@ -230,6 +232,8 @@ class AlbaranComponent {
{ data: "titulo" },
{ data: "isbn" },
{ data: "ref_cliente" },
{ data: "cajas"},
{ data: "unidades_cajas"},
{ data: "precio_unidad" },
{ data: "total" },
{ data: "iva_reducido", visible: false },
@ -244,13 +248,13 @@ class AlbaranComponent {
drawCallback: (settings) => {
if ($('#mostrar_precios_' + this.id).is(':checked')) {
this.table
.column(7).visible(true)
.column(8).visible(true);
.column(9).visible(true)
.column(10).visible(true);
}
else {
this.table
.column(7).visible(false)
.column(8).visible(false);
.column(9).visible(false)
.column(10).visible(false);
}
requestAnimationFrame(() => {
@ -316,12 +320,12 @@ class AlbaranComponent {
const checked = $(e.currentTarget).is(':checked');
if (checked) {
this.table
.column(7).visible(true)
.column(8).visible(true);
.column(9).visible(true)
.column(10).visible(true);
} else {
this.table
.column(7).visible(false)
.column(8).visible(false);
.column(9).visible(false)
.column(10).visible(false);
}
$.post('/albaranes/updateAlbaran', {