From: <dai...@us...> - 2012-11-10 09:12:40
|
Revision: 5738 http://sourceforge.net/p/web-erp/reponame/5738 Author: daintree Date: 2012-11-10 09:12:37 +0000 (Sat, 10 Nov 2012) Log Message: ----------- Modified Paths: -------------- trunk/Z_DeleteCreditNote.php trunk/Z_DeleteInvoice.php trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po Modified: trunk/Z_DeleteCreditNote.php =================================================================== --- trunk/Z_DeleteCreditNote.php 2012-11-08 07:34:28 UTC (rev 5737) +++ trunk/Z_DeleteCreditNote.php 2012-11-10 09:12:37 UTC (rev 5738) @@ -119,7 +119,16 @@ } /* Delete the stock movements */ +$SQL = "DELETE stockmovestaxes.* FROM stockmovestaxes INNER JOIN stockmoves + ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno + WHERE stockmoves.type=11 AND stockmoves.transno = '" . $_GET['CreditNoteNo'] . "'"; +$ErrMsg = _('SQL to delete the stock movement tax records failed with the message'); +$Result = DB_query($SQL, $db,$ErrMsg,$DbgMsg,true); +prnMsg(_('Deleted the credit note stock move taxes').'info'); +echo '<br /><br />'; + + $SQL = "DELETE FROM stockmoves WHERE type=11 AND transno = '" . $_GET['CreditNoteNo'] . "'"; @@ -128,6 +137,14 @@ prnMsg(_('Deleted the credit note stock movements').'info'); echo '<br /><br />'; + + + +$SQL = "DELETE FROM gltrans WHERE type=11 AND typeno= '" . $_GET['CreditNoteNo'] . "'"; +$ErrMsg = _('SQL to delete the gl transaction records failed with the message'); +$Result = DB_query($SQL, $db,$ErrMsg,$DbgMsg,true); +prnMsg(_('Deleted the credit note general ledger transactions').'info'); + $result = DB_Txn_Commit($db); prnMsg(_('Credit note number') . ' ' . $_GET['CreditNoteNo'] . ' ' . _('has been completely deleted') . '. ' . _('To ensure the integrity of the general ledger transactions must be reposted from the period the credit note was created'),'info'); Modified: trunk/Z_DeleteInvoice.php =================================================================== --- trunk/Z_DeleteInvoice.php 2012-11-08 07:34:28 UTC (rev 5737) +++ trunk/Z_DeleteInvoice.php 2012-11-10 09:12:37 UTC (rev 5738) @@ -138,18 +138,27 @@ have been previous sales to the same customer/branch for the same item Delete Sales Analysis records */ $SQL = "DELETE FROM salesanalysis - WHERE periodno = '" . $OrderLine['prd'] . "' - AND cust='" . $OrderLine['debtorno'] . "' - AND custbranch = '" . $OrderLine['branchcode'] . "' - AND qty = '" . $OrderLine['qty'] . "' - AND stockid = '" . $OrderLine['stockid'] . "'"; - + WHERE periodno = '" . $OrderLine['prd'] . "' + AND cust='" . $OrderLine['debtorno'] . "' + AND custbranch = '" . $OrderLine['branchcode'] . "' + AND qty = '" . $OrderLine['qty'] . "' + AND stockid = '" . $OrderLine['stockid'] . "'"; + $ErrMsg = _('The SQL to delete the sales analysis records failed because'); $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg,true); prnMsg(_('Sales analysis records deleted') . ' - ' . _('this deleted all sales analysis for the customer/branch and items on this invoice'),'info'); } +$SQL = "DELETE stockmovestaxes.* FROM stockmovestaxes INNER JOIN stockmoves + ON stockmovestaxes.stkmoveno=stockmoves.stkmoveno + WHERE stockmoves.type=10 AND stockmoves.transno = '" . $_GET['Invoi |