|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * This file is part of FacturaScripts |
| 4 | + * Copyright (C) 2017-2025 Carlos Garcia Gomez <carlos@facturascripts.com> |
| 5 | + * |
| 6 | + * This program is free software: you can redistribute it and/or modify |
| 7 | + * it under the terms of the GNU Lesser General Public License as |
| 8 | + * published by the Free Software Foundation, either version 3 of the |
| 9 | + * License, or (at your option) any later version. |
| 10 | + * |
| 11 | + * This program is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | + * GNU Lesser General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU Lesser General Public License |
| 17 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | + */ |
| 19 | +namespace FacturaScripts\Plugins\Modelo347\Extension\Model; |
| 20 | + |
| 21 | +use Closure; |
| 22 | + |
| 23 | +/** |
| 24 | + * Auxiliar class for special actions into the business document. |
| 25 | + * - setSubject: Set Modelo347 attributes values from the subject of the document. |
| 26 | + * |
| 27 | + * @author Jose Antonio Cuello Principal <yopli2000@gmail.com> |
| 28 | + * |
| 29 | + * @property bool excluir347 |
| 30 | + */ |
| 31 | +class FacturaCliente |
| 32 | +{ |
| 33 | + public function clear(): Closure |
| 34 | + { |
| 35 | + return function () { |
| 36 | + $this->excluir347 = false; |
| 37 | + }; |
| 38 | + } |
| 39 | + |
| 40 | + public function setSubject(): Closure |
| 41 | + { |
| 42 | + return function ($subject) { |
| 43 | + if (property_exists($subject, 'excluir347')) { |
| 44 | + $this->excluir347 = $subject->excluir347; |
| 45 | + } |
| 46 | + }; |
| 47 | + } |
| 48 | +} |
0 commit comments