forked from verdnatura/hedera-web
edi/load: fixes
This commit is contained in:
parent
13e61acb2a
commit
2887497730
|
@ -1,4 +1,4 @@
|
|||
hedera-web (1.408.5) stable; urgency=low
|
||||
hedera-web (1.408.6) stable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "hedera-web",
|
||||
"version": "1.408.5",
|
||||
"version": "1.408.6",
|
||||
"description": "Verdnatura web page",
|
||||
"license": "GPL-3.0",
|
||||
"repository": {
|
||||
|
|
|
@ -206,25 +206,25 @@ class Load extends Edi\Method {
|
|||
}
|
||||
|
||||
if ($update) {
|
||||
$updateExistent = $db->getValue(
|
||||
$ektFk = $db->getValue(
|
||||
"SELECT id
|
||||
FROM ekt
|
||||
WHERE deliveryNumber = #deliveryNumber
|
||||
AND entryYear = YEAR(#fec)",
|
||||
$ediValues
|
||||
);
|
||||
|
||||
$canUpdate = $ektFk && $db->getValue(
|
||||
"SELECT COUNT(*) = 0
|
||||
FROM ekt t
|
||||
JOIN `exchange` b ON b.ektFk = t.id
|
||||
JOIN exchangeConfig c
|
||||
WHERE t.deliveryNumber = #deliveryNumber
|
||||
AND t.entryYear = YEAR(#fec)
|
||||
WHERE t.id = #
|
||||
AND b.typeFk != c.presaleFk",
|
||||
$ediValues
|
||||
$ektFk
|
||||
);
|
||||
|
||||
if ($updateExistent) {
|
||||
$ektFk = $db->getValue(
|
||||
"SELECT id
|
||||
FROM ekt
|
||||
WHERE deliveryNumber = #deliveryNumber
|
||||
AND entryYear = YEAR(#fec)",
|
||||
$ediValues
|
||||
);
|
||||
if ($canUpdate) {
|
||||
$db->update('ekt',
|
||||
$insertValues,
|
||||
['id' => $ektFk]
|
||||
|
|
Loading…
Reference in New Issue