Skip to content

Commit

Permalink
Accounting POHODA - mServer - synchronization for issued invoices - c…
Browse files Browse the repository at this point in the history
…hange

- retrieve invoices that are changed or paid on the same or next day as the last synchronisation date/time (otherwise they are not included as a change)
  • Loading branch information
Mapiiik committed Feb 2, 2025
1 parent 8f688c1 commit 74d5a75
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"giggsey/libphonenumber-for-php": "^8.13",
"league/oauth2-google": "^4.0",
"mapik/audit-log": "^5.0",
"mapik/pohoda-xml": "^1.16",
"mapik/pohoda-xml": "^1.22",
"mapik/radius-client": "^1.0",
"mlocati/ip-lib": "^1.18",
"mobiledetect/mobiledetectlib": "^4.8",
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions plugins/BookkeepingPohoda/src/Command/LoadInvoicesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,20 @@ private function generateXMLRequest(DateTime $lastChanges): string
]);

// Add filter for last changes
/*
$request->addFilter([
'lastChanges' => $lastChanges, # all records that have a "saved" date later than this date
]);
*/
$request->addQueryFilter([
'textName' => "(Uloženo >= {$lastChanges->toDateTimeString()}; Likv. >= {$lastChanges->toDateString()})",
'filter' =>
'('
. "FA.DatSave>=CONVERT(DATETIME, '{$lastChanges->format('m/d/Y H:i:s')}', 101)"
. ' OR '
. "FA.DatLikv>=CONVERT(DATETIME, '{$lastChanges->format('m/d/Y')}', 101)"
. ')',
]);

$pohoda->addItem('list_001', $request);

Expand Down

0 comments on commit 74d5a75

Please sign in to comment.