Skip to content

Commit

Permalink
Fix SQL error in Z_DeleteCreditNote.php
Browse files Browse the repository at this point in the history
Add DELETE sql for stockserialmoves causing FK error.

See:
http://www.weberp.org/forum/showthread.php?tid=8370
  • Loading branch information
TurboPT committed Jan 19, 2020
1 parent afbbb76 commit 9bdf62e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Z_DeleteCreditNote.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,18 @@

$ErrMsg = _('SQL to delete the stock movement tax records failed with the message');
$Result = DB_query($SQL,$ErrMsg,$DbgMsg,true);
prnMsg(_('Deleted the credit note stock move taxes').'info');
prnMsg(_('Deleted the credit note stock move taxes'), 'info');
echo '<br /><br />';


/* Delete the stock serial movements */
$SQL = "DELETE stockserialmoves.* FROM stockserialmoves INNER JOIN stockmoves
ON stockserialmoves.stkmoveno=stockmoves.stkmoveno
WHERE stockmoves.type=11 AND stockmoves.transno = '" . $_GET['CreditNoteNo'] . "'";

$ErrMsg = _('SQL to delete the stock serial moves records failed with the message');
$Result = DB_query($SQL,$ErrMsg,$DbgMsg,true);
prnMsg(_('Deleted the credit note stock move taxes'), 'info');
echo '<br /><br />';


Expand All @@ -133,7 +144,7 @@

$ErrMsg = _('SQL to delete the stock movement record failed with the message');
$Result = DB_query($SQL,$ErrMsg,$DbgMsg,true);
prnMsg(_('Deleted the credit note stock movements').'info');
prnMsg(_('Deleted the credit note stock movements'), 'info');
echo '<br /><br />';


Expand Down

0 comments on commit 9bdf62e

Please sign in to comment.