From b2fdd84090fa9216ca04f3eefa82447e5f38520b Mon Sep 17 00:00:00 2001 From: dainierr <147769053+dainierr@users.noreply.github.com> Date: Thu, 27 Mar 2025 18:30:47 +0100 Subject: [PATCH 1/6] add new tables fields clientes proveedores --- Extension/Table/clientes.xml | 31 +++++++++++++++++++++++++++++++ Extension/Table/proveedores.xml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 Extension/Table/clientes.xml create mode 100644 Extension/Table/proveedores.xml diff --git a/Extension/Table/clientes.xml b/Extension/Table/clientes.xml new file mode 100644 index 0000000..6ff3358 --- /dev/null +++ b/Extension/Table/clientes.xml @@ -0,0 +1,31 @@ + + + + + excluir347 + boolean + false + +
\ No newline at end of file diff --git a/Extension/Table/proveedores.xml b/Extension/Table/proveedores.xml new file mode 100644 index 0000000..6ff3358 --- /dev/null +++ b/Extension/Table/proveedores.xml @@ -0,0 +1,31 @@ + + + + + excluir347 + boolean + false + +
\ No newline at end of file From 1a3ff4f9bd32c4b8a5054adb48c3e0687ea2d7d1 Mon Sep 17 00:00:00 2001 From: dainierr <147769053+dainierr@users.noreply.github.com> Date: Fri, 28 Mar 2025 13:43:16 +0100 Subject: [PATCH 2/6] add new views fields clientes proveedores --- Extension/XMLView/EditCliente.xml | 33 +++++++++++++++++++++++++++ Extension/XMLView/EditProveedor.xml | 35 +++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 Extension/XMLView/EditCliente.xml create mode 100644 Extension/XMLView/EditProveedor.xml diff --git a/Extension/XMLView/EditCliente.xml b/Extension/XMLView/EditCliente.xml new file mode 100644 index 0000000..dcbfb72 --- /dev/null +++ b/Extension/XMLView/EditCliente.xml @@ -0,0 +1,33 @@ + + + + + + + + 0 + 1 + + + + + \ No newline at end of file diff --git a/Extension/XMLView/EditProveedor.xml b/Extension/XMLView/EditProveedor.xml new file mode 100644 index 0000000..5f6d187 --- /dev/null +++ b/Extension/XMLView/EditProveedor.xml @@ -0,0 +1,35 @@ + + + + + + + + 0 + 1 + + + + + + \ No newline at end of file From 98e901bd49c8d2f833f1d2fbe70a5a883cb5ec8e Mon Sep 17 00:00:00 2001 From: dainierr <147769053+dainierr@users.noreply.github.com> Date: Fri, 28 Mar 2025 13:48:35 +0100 Subject: [PATCH 3/6] delete space EditProvedor --- Extension/XMLView/EditProveedor.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/Extension/XMLView/EditProveedor.xml b/Extension/XMLView/EditProveedor.xml index 5f6d187..a6ec062 100644 --- a/Extension/XMLView/EditProveedor.xml +++ b/Extension/XMLView/EditProveedor.xml @@ -31,5 +31,4 @@ - \ No newline at end of file From 565e41fa2740c80bc0333ced8f6344f01903e718 Mon Sep 17 00:00:00 2001 From: dainierr <147769053+dainierr@users.noreply.github.com> Date: Fri, 28 Mar 2025 15:02:03 +0100 Subject: [PATCH 4/6] remove icon EditCliente and EditProveedor --- Extension/XMLView/EditCliente.xml | 4 ++-- Extension/XMLView/EditProveedor.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Extension/XMLView/EditCliente.xml b/Extension/XMLView/EditCliente.xml index dcbfb72..eb563cf 100644 --- a/Extension/XMLView/EditCliente.xml +++ b/Extension/XMLView/EditCliente.xml @@ -22,8 +22,8 @@ - - + + 0 1 diff --git a/Extension/XMLView/EditProveedor.xml b/Extension/XMLView/EditProveedor.xml index a6ec062..a272fe4 100644 --- a/Extension/XMLView/EditProveedor.xml +++ b/Extension/XMLView/EditProveedor.xml @@ -23,8 +23,8 @@ - - + + 0 1 From ac2a67e2c3f4e20acb3035f0f94375a2786f004d Mon Sep 17 00:00:00 2001 From: dainierr <147769053+dainierr@users.noreply.github.com> Date: Mon, 31 Mar 2025 15:39:00 +0200 Subject: [PATCH 5/6] fix documentation --- Extension/Table/clientes.xml | 5 +++-- Extension/Table/proveedores.xml | 5 +++-- Extension/XMLView/EditCliente.xml | 2 +- Extension/XMLView/EditProveedor.xml | 7 +++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Extension/Table/clientes.xml b/Extension/Table/clientes.xml index 6ff3358..cfba0bf 100644 --- a/Extension/Table/clientes.xml +++ b/Extension/Table/clientes.xml @@ -16,10 +16,11 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . - Document : facturascli.xml + Document : clientes.xml Author : Jose Antonio Cuello + Description: - Add fields to basic structure of facturascli table. + Add fields to basic structure of clientes table. - excluir347: indicates if the document should be excluded from 347. --> diff --git a/Extension/Table/proveedores.xml b/Extension/Table/proveedores.xml index 6ff3358..d874e25 100644 --- a/Extension/Table/proveedores.xml +++ b/Extension/Table/proveedores.xml @@ -16,10 +16,11 @@ You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . - Document : facturascli.xml + Document : proveedores.xml Author : Jose Antonio Cuello + Author : Dainier Rojas Jimenez Description: - Add fields to basic structure of facturascli table. + Add fields to basic structure of proveedores table. - excluir347: indicates if the document should be excluded from 347. -->
diff --git a/Extension/XMLView/EditCliente.xml b/Extension/XMLView/EditCliente.xml index eb563cf..d487a88 100644 --- a/Extension/XMLView/EditCliente.xml +++ b/Extension/XMLView/EditCliente.xml @@ -17,7 +17,7 @@ * along with this program. If not, see . * * @author Artex Trading sa - * @author Carlos García Gómez + * @author Dainier Rojas Jiménez --> diff --git a/Extension/XMLView/EditProveedor.xml b/Extension/XMLView/EditProveedor.xml index a272fe4..bc00cef 100644 --- a/Extension/XMLView/EditProveedor.xml +++ b/Extension/XMLView/EditProveedor.xml @@ -15,10 +15,9 @@ * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . - * - * @author Nazca Networks - * @author Fco. Antonio Moreno Pérez - * @author Carlos García Gómez + * + * @author Artex Trading sa + * @author Dainier Rojas Jiménez --> From f0af4682a87cc33cff72f0854ea506a9bd2eba10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Antonio=20Cuello=20Principal?= Date: Thu, 5 Jun 2025 13:34:28 +0200 Subject: [PATCH 6/6] Add excluir347 field --- Extension/Model/Cliente.php | 39 ++++++++++++++++++++++ Extension/Model/FacturaCliente.php | 48 ++++++++++++++++++++++++++++ Extension/Model/FacturaProveedor.php | 48 ++++++++++++++++++++++++++++ Extension/Model/Proveedor.php | 39 ++++++++++++++++++++++ Extension/Table/clientes.xml | 2 +- Extension/Table/facturascli.xml | 2 +- Extension/Table/facturasprov.xml | 2 +- Extension/Table/proveedores.xml | 3 +- Extension/XMLView/EditCliente.xml | 5 ++- Extension/XMLView/EditProveedor.xml | 7 ++-- Init.php | 6 +++- Mod/SalesHeaderHTMLMod.php | 2 +- 12 files changed, 189 insertions(+), 14 deletions(-) create mode 100644 Extension/Model/Cliente.php create mode 100644 Extension/Model/FacturaCliente.php create mode 100644 Extension/Model/FacturaProveedor.php create mode 100644 Extension/Model/Proveedor.php diff --git a/Extension/Model/Cliente.php b/Extension/Model/Cliente.php new file mode 100644 index 0000000..22b7486 --- /dev/null +++ b/Extension/Model/Cliente.php @@ -0,0 +1,39 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ +namespace FacturaScripts\Plugins\Modelo347\Extension\Model; + +use Closure; + +/** + * Auxiliar class for special actions into the customer. + * - Set excluir347 initial value. + * + * @author Jose Antonio Cuello Principal + * + * @property bool excluir347 + */ +class Cliente +{ + public function clear(): Closure + { + return function () { + $this->excluir347 = false; + }; + } +} diff --git a/Extension/Model/FacturaCliente.php b/Extension/Model/FacturaCliente.php new file mode 100644 index 0000000..79dbfd5 --- /dev/null +++ b/Extension/Model/FacturaCliente.php @@ -0,0 +1,48 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ +namespace FacturaScripts\Plugins\Modelo347\Extension\Model; + +use Closure; + +/** + * Auxiliar class for special actions into the business document. + * - setSubject: Set Modelo347 attributes values from the subject of the document. + * + * @author Jose Antonio Cuello Principal + * + * @property bool excluir347 + */ +class FacturaCliente +{ + public function clear(): Closure + { + return function () { + $this->excluir347 = false; + }; + } + + public function setSubject(): Closure + { + return function ($subject) { + if (property_exists($subject, 'excluir347')) { + $this->excluir347 = $subject->excluir347; + } + }; + } +} diff --git a/Extension/Model/FacturaProveedor.php b/Extension/Model/FacturaProveedor.php new file mode 100644 index 0000000..ba85fab --- /dev/null +++ b/Extension/Model/FacturaProveedor.php @@ -0,0 +1,48 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ +namespace FacturaScripts\Plugins\Modelo347\Extension\Model; + +use Closure; + +/** + * Auxiliar class for special actions into the business document. + * - setSubject: Set Modelo347 attributes values from the subject of the document. + * + * @author Jose Antonio Cuello Principal + * + * @property bool excluir347 + */ +class FacturaProveedor +{ + public function clear(): Closure + { + return function () { + $this->excluir347 = false; + }; + } + + public function setSubject(): Closure + { + return function ($subject) { + if (property_exists($subject, 'excluir347')) { + $this->excluir347 = $subject->excluir347; + } + }; + } +} diff --git a/Extension/Model/Proveedor.php b/Extension/Model/Proveedor.php new file mode 100644 index 0000000..312446e --- /dev/null +++ b/Extension/Model/Proveedor.php @@ -0,0 +1,39 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ +namespace FacturaScripts\Plugins\Modelo347\Extension\Model; + +use Closure; + +/** + * Auxiliar class for special actions into the supplier. + * - Set excluir347 initial value. + * + * @author Jose Antonio Cuello Principal + * + * @property bool excluir347 + */ +class Proveedor +{ + public function clear(): Closure + { + return function () { + $this->excluir347 = false; + }; + } +} diff --git a/Extension/Table/clientes.xml b/Extension/Table/clientes.xml index cfba0bf..364d2bc 100644 --- a/Extension/Table/clientes.xml +++ b/Extension/Table/clientes.xml @@ -1,7 +1,7 @@ @@ -25,7 +24,7 @@ 0 - 1 + 1 diff --git a/Extension/XMLView/EditProveedor.xml b/Extension/XMLView/EditProveedor.xml index bc00cef..78dcaa7 100644 --- a/Extension/XMLView/EditProveedor.xml +++ b/Extension/XMLView/EditProveedor.xml @@ -1,7 +1,7 @@ - + 0 - 1 + 1 diff --git a/Init.php b/Init.php index a5c5399..6cb4f7b 100644 --- a/Init.php +++ b/Init.php @@ -1,7 +1,7 @@ + * Copyright (C) 2017-2025 Carlos Garcia Gomez * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -34,6 +34,10 @@ final class Init extends InitClass { public function init(): void { + $this->loadExtension(new Extension\Model\Cliente()); + $this->loadExtension(new Extension\Model\FacturaCliente()); + $this->loadExtension(new Extension\Model\FacturaProveedor()); + $this->loadExtension(new Extension\Model\Proveedor()); PurchasesHeaderHTML::addMod(new Mod\PurchasesHeaderHTMLMod()); SalesHeaderHTML::addMod(new Mod\SalesHeaderHTMLMod()); } diff --git a/Mod/SalesHeaderHTMLMod.php b/Mod/SalesHeaderHTMLMod.php index fba0b4b..254c92d 100644 --- a/Mod/SalesHeaderHTMLMod.php +++ b/Mod/SalesHeaderHTMLMod.php @@ -74,7 +74,7 @@ public function renderField(Translator $i18n, SalesDocument $model, string $fiel private static function excluir347(Translator $i18n, SalesDocument $model): string { - if (false === property_exists($model, 'excluir347') || empty($model->primaryColumnValue())) { + if (false === property_exists($model, 'excluir347')) { return ''; }