terminados albaranes

This commit is contained in:
2025-04-22 10:26:33 +02:00
parent 2050f0ae1e
commit 6450231b53
6 changed files with 56 additions and 4 deletions

View File

@ -175,6 +175,13 @@ class Albaran extends \App\Controllers\BaseResourceController
return $this->respond($data);
}
if($fieldName == 'fecha_albaran'){
if($fieldValue == null || $fieldValue == '')
$fieldValue = null;
else
$fieldValue = date('Y-m-d H:i:s', strtotime($fieldValue));
}
$albaranEntity->fill([
$fieldName => $fieldValue,
'user_updated_id' => auth()->user()->id,

View File

@ -14,6 +14,7 @@ class AlbaranEntity extends \CodeIgniter\Entity\Entity
'mostrar_precios' => null,
'direccion_albaran' => null,
'att_albaran' => null,
'fecha_albaran' => null,
'user_created_id' => null,
'user_updated_id' => null,
'created_at' => null,
@ -38,6 +39,7 @@ class AlbaranEntity extends \CodeIgniter\Entity\Entity
'att_albaran' => '?string',
'user_created_id' => 'integer',
'user_updated_id' => 'integer',
'fecha_albaran' => '?datetime',
];
// Agrega tus métodos personalizados aquí

View File

@ -22,6 +22,7 @@ class AlbaranModel extends \App\Models\BaseModel
'numero_albaran',
'mostrar_precios',
'direccion_albaran',
'fecha_albaran',
'att_albaran',
'user_created_id',
'user_updated_id',

View File

@ -283,6 +283,7 @@
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.1/css/rowReorder.dataTables.min.css">
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/flatpickr/flatpickr.css") ?>">
<?= $this->endSection() ?>
@ -290,7 +291,5 @@
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
<script src="https://cdn.datatables.net/rowgroup/1.3.1/js/dataTables.rowGroup.min.js"></script>
<script src="https://cdn.datatables.net/rowreorder/1.4.1/js/dataTables.rowReorder.min.js"></script>
<script type="module" src="<?= site_url("assets/js/safekat/pages/logistica/envioEdit.js") ?>"></script>
<?= $this->endSection() ?>

View File

@ -52,7 +52,7 @@
FECHA:
</th>
<th class="text-start fecha">
<?= $albaran->fecha_albaran ? date('d-m-Y', strtotime($albaran->fecha_albaran)) : date('d-m-Y') ?>
<?= $albaran->fecha_albaran ? $albaran->fecha_albaran : date('d-m-Y') ?>
</th>
</tr>
</thead>