Исправлен расчёт НДС для документа

This commit is contained in:
2020-05-28 00:38:16 +08:00
parent 0bb194b1f8
commit a619b06a48
3 changed files with 13 additions and 22 deletions

View File

@@ -62,7 +62,11 @@ class VatArray extends Entity
public function add(Vat $vat)
{
if ($this->validateCount()) {
$this->vats[] = $vat;
if (isset($this->vats[$vat->getType()])) {
$this->vats[$vat->getType()]->addSum($vat->getSum());
} else {
$this->vats[$vat->getType()] = $vat;
}
}
return $this;
}