Skip to content

Commit 117830c

Browse files
committed
Overpayments handling works now
1 parent 89a3369 commit 117830c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/AbraFlexi/FakturaVydana.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ public function sparujPlatbu($doklad, $zbytek = 'ignorovat', string $overpayTo =
5959
$sparovani['uhrazovanaFak@type'] = $this->evidence;
6060
$sparovani['zbytek'] = $zbytek;
6161

62-
if ($overpayTo){
63-
$sparovani['preplatek']['typDokl'] = \AbraFlexi\Functions::code($overpayTo);
62+
$match = ['id' => $doklad, 'sparovani' => $sparovani];
63+
64+
if ($overpayTo) {
65+
$match['preplatek']['typDokl'] = \AbraFlexi\Functions::code($overpayTo);
6466
}
6567

66-
$doklad->insertToAbraFlexi(['id' => $doklad, 'sparovani' => $sparovani]);
68+
$doklad->insertToAbraFlexi($match);
6769

6870
return $doklad->lastResponseCode === 201;
6971
}

0 commit comments

Comments
 (0)