mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
edicion de facturas terminada a falta de tirada flexible
This commit is contained in:
@ -538,6 +538,18 @@ class Facturas extends \App\Controllers\BaseResourceController
|
|||||||
$dataName = $postData['name'] ?? '';
|
$dataName = $postData['name'] ?? '';
|
||||||
$dataValue = $postData['value'] ?? '';
|
$dataValue = $postData['value'] ?? '';
|
||||||
|
|
||||||
|
if($dataName == 'factura_rectificativa_id'){
|
||||||
|
// se actualiza la factura donde el campo 'numero' sea igual al valor de $dataValue. El campo a actualizar es 'factura_rectificada_id'
|
||||||
|
$factura_rectificada = $this->model->where('numero', $dataValue)->first();
|
||||||
|
if($factura_rectificada){
|
||||||
|
$data2 = [
|
||||||
|
'factura_rectificada_id' => $factura->numero,
|
||||||
|
'user_updated_id' => auth()->user()->id,
|
||||||
|
];
|
||||||
|
$this->model->update($factura_rectificada->id, $data2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
$dataName => $dataValue,
|
$dataName => $dataValue,
|
||||||
'user_updated_id' => auth()->user()->id,
|
'user_updated_id' => auth()->user()->id,
|
||||||
|
|||||||
@ -25,12 +25,7 @@ class Test extends BaseController
|
|||||||
$data = $model->obtenerLineasPedidoSinFacturar(999);
|
$data = $model->obtenerLineasPedidoSinFacturar(999);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$model = model("\App\Models\Facturas\FacturaPagoModel");
|
xdebug_info();
|
||||||
$data = $model->getResource(9)->get()->getResultObject();
|
|
||||||
|
|
||||||
echo('<pre>');
|
|
||||||
var_dump($data);
|
|
||||||
echo('</pre>');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -8,8 +8,8 @@ class FacturaEntity extends \CodeIgniter\Entity\Entity
|
|||||||
protected $attributes = [
|
protected $attributes = [
|
||||||
'id' => null,
|
'id' => null,
|
||||||
'pedido_id' => null,
|
'pedido_id' => null,
|
||||||
'factura_retificada_id' => null,
|
'factura_rectificada_id' => null,
|
||||||
'factura_retificativa_id' => null,
|
'factura_rectificativa_id' => null,
|
||||||
'cliente_id' => null,
|
'cliente_id' => null,
|
||||||
'serie_id' => null,
|
'serie_id' => null,
|
||||||
'numero' => null,
|
'numero' => null,
|
||||||
@ -39,8 +39,6 @@ class FacturaEntity extends \CodeIgniter\Entity\Entity
|
|||||||
protected $casts = [
|
protected $casts = [
|
||||||
'id' => 'int',
|
'id' => 'int',
|
||||||
'pedido_id' => 'int',
|
'pedido_id' => 'int',
|
||||||
'factura_retificada_id' => 'int',
|
|
||||||
'factura_retificativa_id' => 'int',
|
|
||||||
'cliente_id' => 'int',
|
'cliente_id' => 'int',
|
||||||
'serie_id' => 'int',
|
'serie_id' => 'int',
|
||||||
'base' => 'float',
|
'base' => 'float',
|
||||||
|
|||||||
@ -71,7 +71,7 @@ return [
|
|||||||
"fechaCobro" => "Fecha Cobro",
|
"fechaCobro" => "Fecha Cobro",
|
||||||
"cantidad" => "Cantidad",
|
"cantidad" => "Cantidad",
|
||||||
"addPago" => "Añadir Pago",
|
"addPago" => "Añadir Pago",
|
||||||
"facturaPagada" => "Factura rectificativa ya pagada",
|
"facturaPagada" => "Factura rectificativa ya abonada",
|
||||||
|
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'requiredFields' => 'Los campos marcados con * son obligatorios',
|
'requiredFields' => 'Los campos marcados con * son obligatorios',
|
||||||
|
|||||||
@ -26,8 +26,8 @@ class FacturaModel extends \App\Models\BaseModel {
|
|||||||
// Lista de columnas basada en los campos de la tabla, para asignación masiva
|
// Lista de columnas basada en los campos de la tabla, para asignación masiva
|
||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
'pedido_id',
|
'pedido_id',
|
||||||
'factura_retificada_id',
|
'factura_rectificada_id',
|
||||||
'factura_retificativa_id',
|
'factura_rectificativa_id',
|
||||||
'cliente_id',
|
'cliente_id',
|
||||||
'serie_id',
|
'serie_id',
|
||||||
'numero',
|
'numero',
|
||||||
|
|||||||
@ -90,26 +90,24 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<?php if($facturaEntity->serie_id == 7 || $facturaEntity->serie_id == 9): ?>
|
|
||||||
<div class="col-md-12 col-lg-2 px-4">
|
<div <?= ($facturaEntity->serie_id == 7 || $facturaEntity->serie_id == 9 || $facturaEntity->factura_rectificada_id != null) ? "":"style='display:none;'" ?> class="col-md-12 col-lg-2 px-4 factura-R">
|
||||||
<div class="mb-1">
|
<div class="mb-1">
|
||||||
<label for="id" class="form-label">
|
<label for="facturaR" class="form-label factura-R">
|
||||||
<?= ($facturaEntity->factura_retificada_id != null) ? lang('Facturas.facturaRectificada') : lang('Facturas.facturaRectificativa') ?>:
|
<?= ($facturaEntity->factura_rectificada_id != null) ? lang('Facturas.facturaRectificada') : lang('Facturas.facturaRectificativa') ?>:
|
||||||
</label>
|
</label>
|
||||||
<input <?= ($facturaEntity->estado!='borrador')? "disabled":"" ?> id="facturaR" name="facturaR" tabindex="" maxLength="11" class="form-control"
|
<input <?= ($facturaEntity->estado!='borrador')? "disabled":"" ?> id="facturaR" name="<?= ($facturaEntity->factura_rectificada_id != null) ? 'factura_rectificada_id' : 'factura_rectificativa_id' ?>" tabindex="" maxLength="25" class="form-control update-cabecera factura-R"
|
||||||
value=
|
|
||||||
<?php if($facturaEntity->factura_retificada_id != null && $facturaEntity->factura_retificada_id != null): ?>
|
<?php if($facturaEntity->factura_rectificada_id == null && $facturaEntity->factura_rectificativa_id == null): ?>
|
||||||
""
|
value=""
|
||||||
<?
|
<?php else: ?>
|
||||||
<?= old('factura_retificada_id', $facturaEntity->factura_retificada_id) ?>
|
value="<?= ($facturaEntity->factura_rectificada_id != null) ? old('factura_rectificada_id', $facturaEntity->factura_rectificada_id): old('factura_rectificativa_id', $facturaEntity->factura_rectificativa_id)?>"
|
||||||
?>
|
<?php endif; ?>
|
||||||
"
|
>
|
||||||
value="<?= ($facturaEntity->factura_retificada_id != null) ? old('factura_retificada_id', $facturaEntity->factura_retificada_id): old('numero', $facturaEntity->factura_retificativa_id)?>"
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
</div>
|
||||||
<div class="col-md-12 col-lg-<?= ($facturaEntity->factura_retificada_id != null || $facturaEntity->factura_retificativa_id != null)?"4":"6" ?> px-4">
|
|
||||||
|
<div id="div_cliente" class="col-md-12 col-lg-<?= ($facturaEntity->factura_rectificada_id != null || $facturaEntity->factura_rectificativa_id != null)?"4":"6" ?> px-4">
|
||||||
<div class="mb-1">
|
<div class="mb-1">
|
||||||
<label for="cliente_nombre" class="form-label">
|
<label for="cliente_nombre" class="form-label">
|
||||||
<?= lang('Facturas.razonSocial') ?>
|
<?= lang('Facturas.razonSocial') ?>
|
||||||
@ -359,6 +357,19 @@ $('#duplicar').on('click', function() {
|
|||||||
|
|
||||||
|
|
||||||
$(".update-cabecera").on("change", function(){
|
$(".update-cabecera").on("change", function(){
|
||||||
|
|
||||||
|
if($(this).attr('id') == 'serie_id'){
|
||||||
|
var id = $(this).val();
|
||||||
|
if(id == 7 || id == 9){
|
||||||
|
// se muestra el campo de factura rectificada que tiene como clase factura-R
|
||||||
|
$('.factura-R').show();
|
||||||
|
$('#div_cliente').removeClass('col-lg-6').addClass('col-lg-4');
|
||||||
|
} else {
|
||||||
|
// se oculta el campo de factura rectificada
|
||||||
|
$('.factura-R').hide();
|
||||||
|
$('#div_cliente').removeClass('col-lg-4').addClass('col-lg-6');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?= route_to('updateCabecera', $facturaEntity->id) ?>',
|
url: '<?= route_to('updateCabecera', $facturaEntity->id) ?>',
|
||||||
|
|||||||
@ -49,8 +49,8 @@
|
|||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="9" style="text-align:right">Pendiente de pago:</td>
|
<td <?= ($facturaEntity->serie_id == 7 || $facturaEntity->serie_id == 9)? "style='display:none;'":"" ?> colspan="9" style="text-align:right">Pendiente de pago:</td>
|
||||||
<td id="pendiente-pago"></td>
|
<td <?= ($facturaEntity->serie_id == 7 || $facturaEntity->serie_id == 9)? "style='display:none;'":"" ?> id="pendiente-pago"></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -360,6 +360,9 @@ function updateFooterLineas(table){
|
|||||||
var total_pagos = parseFloat($('#totalCobrado-sum').html()).toFixed(2);
|
var total_pagos = parseFloat($('#totalCobrado-sum').html()).toFixed(2);
|
||||||
var pendientePago = totalTotal - total_pagos;
|
var pendientePago = totalTotal - total_pagos;
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
if(isNaN(pendientePago)){
|
||||||
|
pendientePago = 0;
|
||||||
|
}
|
||||||
$('#pendiente-pago').html(pendientePago.toFixed(2));
|
$('#pendiente-pago').html(pendientePago.toFixed(2));
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|||||||
@ -288,6 +288,10 @@ function updateFooterLineas(table){
|
|||||||
var total_pagos = parseFloat($('#totalCobrado-sum').html()).toFixed(2);
|
var total_pagos = parseFloat($('#totalCobrado-sum').html()).toFixed(2);
|
||||||
var pendientePago = totalTotal - total_pagos;
|
var pendientePago = totalTotal - total_pagos;
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
// Se comprueba si pendientePago es un numero o NAN
|
||||||
|
if(isNaN(pendientePago)){
|
||||||
|
pendientePago = 0;
|
||||||
|
}
|
||||||
$('#pendiente-pago').html(pendientePago.toFixed(2));
|
$('#pendiente-pago').html(pendientePago.toFixed(2));
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|||||||
@ -0,0 +1,22 @@
|
|||||||
|
<div class="accordion accordion-bordered mt-3" id="rectificadaFactura">
|
||||||
|
<div class="card accordion-item active">
|
||||||
|
<h2 class="accordion-header" id="headingrectificadaFactura">
|
||||||
|
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionRectificadaFacturaTip" aria-expanded="false" aria-controls="accordionRectificadaFacturaTip">
|
||||||
|
<h3><?= lang("Facturas.facturaRectificada") ?></h3>
|
||||||
|
</button>
|
||||||
|
</h2>
|
||||||
|
<div id="accordionRectificadaFacturaTip" class="accordion-collapse collapse show" data-bs-parent="#rectificadaFactura">
|
||||||
|
<div class="accordion-body">
|
||||||
|
|
||||||
|
<p><?= lang("Facturas.facturaPagada") ?></p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<?=$this->section('additionalInlineJs') ?>
|
||||||
|
|
||||||
|
|
||||||
|
<?=$this->endSection() ?>
|
||||||
@ -22,9 +22,12 @@
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?= view("themes/vuexy/form/facturas/_facturaLineasItems") ?>
|
<?= view("themes/vuexy/form/facturas/_facturaLineasItems") ?>
|
||||||
<?php if($facturaEntity->estado !='borrador' && (strpos($facturaEntity->numero, "REC ") === 0) ) : ?>
|
<?php if($facturaEntity->estado !='borrador' && (strpos($facturaEntity->numero, "REC ") !== 0) ) : ?>
|
||||||
<?= view("themes/vuexy/form/facturas/_pagosFacturasItems") ?>
|
<?= view("themes/vuexy/form/facturas/_pagosFacturasItems") ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<?php if($facturaEntity->estado !='borrador' && (strpos($facturaEntity->numero, "REC ") === 0) ) : ?>
|
||||||
|
<?= view("themes/vuexy/form/facturas/_rectificadaFacturasItems") ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="pt-4">
|
<div class="pt-4">
|
||||||
<?php if($facturaEntity->estado =='borrador') : ?>
|
<?php if($facturaEntity->estado =='borrador') : ?>
|
||||||
|
|||||||
30
ci4/packages.txt
Normal file
30
ci4/packages.txt
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
ii php-cli 2:8.1+92ubuntu1 all command-line interpreter for the PHP scripting language (default)
|
||||||
|
ii php-common 2:92ubuntu1 all Common files for PHP packages
|
||||||
|
ii php-composer-ca-bundle 1.3.1-1 all utility library to find a path to the system CA bundle
|
||||||
|
ii php-composer-metadata-minifier 1.0.0-2 all Small utility library that handles metadata minification and expansion
|
||||||
|
ii php-composer-pcre 1.0.1-1 all PCRE wrapping library that offers type-safe preg_* replacements
|
||||||
|
ii php-composer-semver 3.2.9-1 all utilities, version constraint parsing and validation
|
||||||
|
ii php-composer-spdx-licenses 1.5.6-1 all SPDX licenses list and validation library
|
||||||
|
ii php-composer-xdebug-handler 2.0.4-1build1 all Restarts a process without Xdebug
|
||||||
|
ii php-curl 2:8.1+92ubuntu1 all CURL module for PHP [default]
|
||||||
|
ii php-intl 2:8.1+92ubuntu1 all Internationalisation module for PHP [default]
|
||||||
|
ii php-json-schema 5.2.11-1 all implementation of JSON schema
|
||||||
|
ii php-mbstring 2:8.1+92ubuntu1 all MBSTRING module for PHP [default]
|
||||||
|
ii php-psr-container 2.0.2-1 all Common Container Interface (PHP FIG PSR-11)
|
||||||
|
ii php-psr-log 3.0.0-1 all common interface for logging libraries
|
||||||
|
ii php-react-promise 2.7.0-2 all lightweight implementation of CommonJS Promises/A for PHP
|
||||||
|
ii php-symfony-console 5.4.4+dfsg-1ubuntu8 all run tasks from the command line
|
||||||
|
ii php-symfony-deprecation-contracts 2.4.0-1ubuntu2 all A generic function and convention to trigger deprecation notices
|
||||||
|
ii php-symfony-filesystem 5.4.4+dfsg-1ubuntu8 all basic filesystem utilities
|
||||||
|
ii php-symfony-finder 5.4.4+dfsg-1ubuntu8 all find files and directories
|
||||||
|
ii php-symfony-polyfill-php80 1.24.0-1ubuntu2 all Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
|
||||||
|
ii php-symfony-process 5.4.4+dfsg-1ubuntu8 all execute commands in sub-processes
|
||||||
|
ii php-symfony-service-contracts 2.4.0-1ubuntu2 all Generic abstractions related to writing services
|
||||||
|
ii php-symfony-string 5.4.4+dfsg-1ubuntu8 all object-oriented API to work with strings
|
||||||
|
ii php8.1-cli 8.1.2-1ubuntu2.18 amd64 command-line interpreter for the PHP scripting language
|
||||||
|
ii php8.1-common 8.1.2-1ubuntu2.18 amd64 documentation, examples and common module for PHP
|
||||||
|
ii php8.1-curl 8.1.2-1ubuntu2.18 amd64 CURL module for PHP
|
||||||
|
ii php8.1-intl 8.1.2-1ubuntu2.18 amd64 Internationalisation module for PHP
|
||||||
|
ii php8.1-mbstring 8.1.2-1ubuntu2.18 amd64 MBSTRING module for PHP
|
||||||
|
ii php8.1-opcache 8.1.2-1ubuntu2.18 amd64 Zend OpCache module for PHP
|
||||||
|
ii php8.1-readline 8.1.2-1ubuntu2.18 amd64 readline module for PHP
|
||||||
Reference in New Issue
Block a user