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 new file mode 100644 index 0000000..364d2bc --- /dev/null +++ b/Extension/Table/clientes.xml @@ -0,0 +1,32 @@ + + + + + excluir347 + boolean + false + +
\ No newline at end of file diff --git a/Extension/Table/facturascli.xml b/Extension/Table/facturascli.xml index 6ff3358..43fb316 100644 --- a/Extension/Table/facturascli.xml +++ b/Extension/Table/facturascli.xml @@ -1,7 +1,7 @@ + + + excluir347 + boolean + false + +
\ No newline at end of file diff --git a/Extension/XMLView/EditCliente.xml b/Extension/XMLView/EditCliente.xml new file mode 100644 index 0000000..5e5697d --- /dev/null +++ b/Extension/XMLView/EditCliente.xml @@ -0,0 +1,32 @@ + + + + + + + + 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..78dcaa7 --- /dev/null +++ b/Extension/XMLView/EditProveedor.xml @@ -0,0 +1,32 @@ + + + + + + + + 0 + 1 + + + + + \ No newline at end of file diff --git a/Init.php b/Init.php index 01c8d0f..0a310cf 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 @@ -35,6 +35,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 ''; }