From: <dai...@us...> - 2010-12-09 07:22:57
|
Revision: 4181 http://web-erp.svn.sourceforge.net/web-erp/?rev=4181&view=rev Author: daintree Date: 2010-12-09 06:59:34 +0000 (Thu, 09 Dec 2010) Log Message: ----------- fix supplier invoice and credit due date calculations based on invoice/credit date not todays date Modified Paths: -------------- trunk/SupplierCredit.php trunk/SupplierInvoice.php trunk/doc/Change.log.html Modified: trunk/SupplierCredit.php =================================================================== --- trunk/SupplierCredit.php 2010-12-08 05:35:19 UTC (rev 4180) +++ trunk/SupplierCredit.php 2010-12-09 06:59:34 UTC (rev 4181) @@ -150,11 +150,15 @@ $_SESSION['SuppTrans']->TranDate = $_POST['TranDate']; if (substr( $_SESSION['SuppTrans']->Terms,0,1)=='1') { /*Its a day in the following month when due */ - $_SESSION['SuppTrans']->DueDate = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')+1, substr( $_SESSION['SuppTrans']->Terms,1),Date('y'))); + $DayInFollowingMonth = (int) substr( $_SESSION['SuppTrans']->Terms,1); + $DaysBeforeDue = 0; } else { /*Use the Days Before Due to add to the invoice date */ - $_SESSION['SuppTrans']->DueDate = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d') + (int) substr( $_SESSION['SuppTrans']->Terms,1),Date('y'))); + $DayInFollowingMonth = 0; + $DaysBeforeDue = (int) substr( $_SESSION['SuppTrans']->Terms,1); } - + + $_SESSION['SuppTrans']->DueDate = CalcDueDate($_SESSION['SuppTrans']->TranDate, $DayInFollowingMonth, $DaysBeforeDue); + $_SESSION['SuppTrans']->SuppReference = $_POST['SuppReference']; /*if (!isset($_POST['OvAmount'])) { Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2010-12-08 05:35:19 UTC (rev 4180) +++ trunk/SupplierInvoice.php 2010-12-09 06:59:34 UTC (rev 4181) @@ -133,11 +133,15 @@ $_SESSION['SuppTrans']->TranDate = $_POST['TranDate']; if (substr( $_SESSION['SuppTrans']->Terms,0,1)=='1') { /*Its a day in the following month when due */ - $_SESSION['SuppTrans']->DueDate = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m')+1, substr( $_SESSION['SuppTrans']->Terms,1),Date('y'))); + $DayInFollowingMonth = (int) substr( $_SESSION['SuppTrans']->Terms,1); + $DaysBeforeDue = 0; } else { /*Use the Days Before Due to add to the invoice date */ - $_SESSION['SuppTrans']->DueDate = Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d') + (int) substr( $_SESSION['SuppTrans']->Terms,1),Date('y'))); + $DayInFollowingMonth = 0; + $DaysBeforeDue = (int) substr( $_SESSION['SuppTrans']->Terms,1); } - + + $_SESSION['SuppTrans']->DueDate = CalcDueDate($_SESSION['SuppTrans']->TranDate, $DayInFollowingMonth, $DaysBeforeDue); + $_SESSION['SuppTrans']->SuppReference = $_POST['SuppReference']; if ( $_SESSION['SuppTrans']->GLLink_Creditors == 1){ Modified: trunk/doc/Change.log.html =================================================================== --- trunk/doc/Change.log.html 2010-12-08 05:35:19 UTC (rev 4180) +++ trunk/doc/Change.log.html 2010-12-09 06:59:34 UTC (rev 4181) @@ -1,5 +1,6 @@ <p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p> <p>/</p> +<p>9/12/10 James Murray: highlighted a bug in SupplierInvoice.php (and also in SupplierCredit.php) where the due date of the invoice/credit was not calculated correctly based on the terms - it was picking up the current date rather than the invoice/credit date. Now fixed</p> <p>8/12/10 James Murray: fixed bug in SuppPaymentRun.php - was not showing anything as the test to see if there was anything to see was using a non-existant result set!</p> <p>5/12/10 Phil: Fixed bug in purchase orders that did not actually delete purchase orders that were cancelled. I think the reason was a fraud prevention issue so instead I have made new tables for purchorders_deleted and purchorderdetails_deleted to copy the details of the deleted orders to - should investigation be required.</p> <p>3/12/10 Matt Elbrecht : Estonian translation</p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |