|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
* Copyright (C) 2023 Joe Nilson <[email protected]> |
|
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\Mod; |
|
19
|
|
|
|
|
20
|
|
|
use FacturaScripts\Core\Model\Base\BusinessDocument; |
|
|
|
|
|
|
21
|
|
|
use FacturaScripts\Core\Model\Base\BusinessDocumentLine; |
|
|
|
|
|
|
22
|
|
|
use FacturaScripts\Core\Model\Base\SalesDocument; |
|
|
|
|
|
|
23
|
|
|
use FacturaScripts\Core\Model\Base\SalesDocumentLine; |
|
|
|
|
|
|
24
|
|
|
use FacturaScripts\Core\Base\Contract\CalculatorModInterface; |
|
|
|
|
|
|
25
|
|
|
|
|
26
|
|
|
class CalculatorMod implements CalculatorModInterface |
|
27
|
|
|
{ |
|
28
|
|
|
|
|
29
|
|
|
public function apply(BusinessDocument &$doc, array &$lines): bool |
|
30
|
|
|
{ |
|
31
|
|
|
//TODO: Implement apply() method. |
|
32
|
|
|
return true; |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
public function calculate(BusinessDocument &$doc, array &$lines): bool |
|
36
|
|
|
{ |
|
37
|
|
|
// calculamos el total de impuestos |
|
38
|
|
|
// $totalTaxes = 0.0; |
|
39
|
|
|
// foreach ($lines as $line) { |
|
40
|
|
|
// $totalTaxes += (($line->iva + $line->rdtaxisc + $line->rdtaxcdt) * $line->pvptotal) / 100.0; |
|
41
|
|
|
// } |
|
42
|
|
|
// $doc->totaliva = round($totalTaxes, FS_NF0); |
|
43
|
|
|
// $doc->total = $doc->neto + $doc->totaliva; |
|
44
|
|
|
return true; |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
public function calculateLine(BusinessDocument $doc, BusinessDocumentLine &$line): bool |
|
48
|
|
|
{ |
|
49
|
|
|
// TODO: Implement calculateLine() method. |
|
50
|
|
|
return true; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
public function clear(BusinessDocument &$doc, array &$lines): bool |
|
54
|
|
|
{ |
|
55
|
|
|
// TODO: Implement clear() method. |
|
56
|
|
|
return true; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
public function getSubtotals(array &$subtotals, BusinessDocument $doc, array $lines): bool |
|
60
|
|
|
{ |
|
61
|
|
|
// TODO: Implement getSubtotals() method. |
|
62
|
|
|
return true; |
|
63
|
|
|
} |
|
64
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths