edi/load: entryYear field fixes
gitea/hedera-web/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2022-07-07 23:17:48 +02:00
parent 574c63ea4e
commit 13e61acb2a
3 changed files with 8 additions and 8 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.408.4) stable; urgency=low
hedera-web (1.408.5) stable; urgency=low
* Initial Release.

View File

@ -1,6 +1,6 @@
{
"name": "hedera-web",
"version": "1.408.4",
"version": "1.408.5",
"description": "Verdnatura web page",
"license": "GPL-3.0",
"repository": {

View File

@ -188,6 +188,9 @@ class Load extends Edi\Method {
if (isset($this->columns[$code]) && !empty($value))
$insertValues[$code] = $value;
$year = $ediValues['fec']->format('Y');
$insertValues['entryYear'] = $year;
$isNew = false;
$update = false;
@ -229,18 +232,15 @@ class Load extends Edi\Method {
}
}
$db->call('ekt_refresh', [$ektFk, $mailId]);
if ($isNew) $db->call('ekt_load', [$ektFk]);
$db->insert('exchange', [
'mailFk' => $mailId,
'typeFk' => $ediValues['bgm'],
'ektFk' => $ektFk
]);
$res = $db->call('ekt_refresh', [$ektFk]);
if ($isNew) $res = $db->call('ekt_load', [$ektFk]);
if (!$res)
throw new Exception('Failed to insert the line.');
$count++;
}