|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
* Copyright (C) 2026 Joe Nilson <joenilson at gmail.com> |
|
4
|
|
|
* |
|
5
|
|
|
* This program is free software: you can redistribute it and/or modify |
|
6
|
|
|
* it under the terms of the GNU Lesser General Public License as |
|
7
|
|
|
* published by the Free Software Foundation, either version 3 of the |
|
8
|
|
|
* License, or (at your option) any later version. |
|
9
|
|
|
* |
|
10
|
|
|
* This program is distributed in the hope that it will be useful, |
|
11
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13
|
|
|
* GNU Lesser General Public License for more details. |
|
14
|
|
|
* You should have received a copy of the GNU Lesser General Public License |
|
15
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16
|
|
|
*/ |
|
17
|
|
|
|
|
18
|
|
|
namespace FacturaScripts\Plugins\fsRepublicaDominicana\Extension\Model; |
|
19
|
|
|
|
|
20
|
|
|
use Closure; |
|
21
|
|
|
use FacturaScripts\Core\Tools; |
|
22
|
|
|
use FacturaScripts\Dinamic\Model\Cliente; |
|
|
|
|
|
|
23
|
|
|
use FacturaScripts\Plugins\fsRepublicaDominicana\Lib\DGII\CommonModelFunctions; |
|
24
|
|
|
|
|
25
|
|
|
class LineaAlbaranCliente |
|
26
|
|
|
{ |
|
27
|
|
|
/** |
|
28
|
|
|
* @var float |
|
29
|
|
|
*/ |
|
30
|
|
|
public $rdtaxcdt; |
|
31
|
|
|
/** |
|
32
|
|
|
* @var string |
|
33
|
|
|
*/ |
|
34
|
|
|
public $rdtaxcodcdt; |
|
35
|
|
|
/** |
|
36
|
|
|
* @var string |
|
37
|
|
|
*/ |
|
38
|
|
|
public $rdtaxcodfirstplate; |
|
39
|
|
|
/** |
|
40
|
|
|
* @var string |
|
41
|
|
|
*/ |
|
42
|
|
|
public $rdtaxcodisc; |
|
43
|
|
|
/** |
|
44
|
|
|
* @var string |
|
45
|
|
|
*/ |
|
46
|
|
|
public $rdtaxcodlegaltip; |
|
47
|
|
|
/** |
|
48
|
|
|
* @var float |
|
49
|
|
|
*/ |
|
50
|
|
|
public $rdtaxfirstplate; |
|
51
|
|
|
/** |
|
52
|
|
|
* @var float |
|
53
|
|
|
*/ |
|
54
|
|
|
public $rdtaxisc; |
|
55
|
|
|
/** |
|
56
|
|
|
* @var float |
|
57
|
|
|
*/ |
|
58
|
|
|
public $rdtaxlegaltip; |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* @var float |
|
62
|
|
|
*/ |
|
63
|
|
|
public $totalplustaxes; |
|
64
|
|
|
|
|
65
|
|
|
public function clear(): Closure |
|
66
|
|
|
{ |
|
67
|
|
|
return function () { |
|
68
|
|
|
$this->rdtaxisc = 0.0; |
|
69
|
|
|
$this->rdtaxcdt = 0.0; |
|
70
|
|
|
$this->rdtaxlegaltip = 0.0; |
|
71
|
|
|
$this->rdtaxfirstplate = 0.0; |
|
72
|
|
|
$this->rdtaxcodisc = null; |
|
73
|
|
|
$this->rdtaxcodcdt = null; |
|
74
|
|
|
$this->rdtaxcodlegaltip = null; |
|
75
|
|
|
$this->rdtaxcodfirstplate = null; |
|
76
|
|
|
}; |
|
77
|
|
|
} |
|
78
|
|
|
} |
Let?s assume that you have a directory layout like this:
. |-- OtherDir | |-- Bar.php | `-- Foo.php `-- SomeDir `-- Foo.phpand let?s assume the following content of
Bar.php:If both files
OtherDir/Foo.phpandSomeDir/Foo.phpare loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.phpHowever, as
OtherDir/Foo.phpdoes not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: