From: <Ex...@us...> - 2012-02-02 03:31:02
|
Revision: 4862 http://web-erp.svn.sourceforge.net/web-erp/?rev=4862&view=rev Author: ExsonQu Date: 2012-02-02 03:30:56 +0000 (Thu, 02 Feb 2012) Log Message: ----------- Fix bug 'GL entries created not balance' Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2012-01-31 21:48:58 UTC (rev 4861) +++ trunk/Credit_Invoice.php 2012-02-02 03:30:56 UTC (rev 4862) @@ -1354,7 +1354,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . -round($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' + '" . -round(($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting for the credit note could not be inserted because'); @@ -1516,4 +1516,4 @@ echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-02-02 03:31:02
|
Revision: 4862 http://web-erp.svn.sourceforge.net/web-erp/?rev=4862&view=rev Author: ExsonQu Date: 2012-02-02 03:30:56 +0000 (Thu, 02 Feb 2012) Log Message: ----------- Fix bug 'GL entries created not balance' Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2012-01-31 21:48:58 UTC (rev 4861) +++ trunk/Credit_Invoice.php 2012-02-02 03:30:56 UTC (rev 4862) @@ -1354,7 +1354,7 @@ '" . $PeriodNo . "', '" . $_SESSION['CompanyRecord']['debtorsact'] . "', '" . $_SESSION['CreditItems']->DebtorNo . "', - '" . -round($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' + '" . -round(($_SESSION['CreditItems']->total + $_SESSION['CreditItems']->FreightCost + $TaxTotal)/$_SESSION['CurrencyRate'],$_SESSION['CompanyRecord']['decimalplaces']) . "' )"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The total debtor GL posting for the credit note could not be inserted because'); @@ -1516,4 +1516,4 @@ echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-03-20 14:23:15
|
Revision: 5111 http://web-erp.svn.sourceforge.net/web-erp/?rev=5111&view=rev Author: ExsonQu Date: 2012-03-20 14:23:04 +0000 (Tue, 20 Mar 2012) Log Message: ----------- 20/3/2012 Exson: Fixed bugs that users push Process Credit button in Credit_Invoice.php directly without update will lead to unbalance Journal entry. Reported by Russ Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2012-03-20 12:39:40 UTC (rev 5110) +++ trunk/Credit_Invoice.php 2012-03-20 14:23:04 UTC (rev 5111) @@ -292,9 +292,28 @@ $k=0; //row colour counter $j=0; //row counter - +if(isset($_POST['AutoUpdate'])){//clear the $_SESSION value when users have not click update button and directly process the credit note + $_SESSION['CreditItems']->total = 0; + $_SESSION['CreditItems']->totalVolume = 0; + $_SESSION['CreditItems']->totalWeight = 0; +} foreach ($_SESSION['CreditItems']->LineItems as $LnItm) { $LineTotal = $LnItm->QtyDispatched * $LnItm->Price * (1 - $LnItm->DiscountPercent); + if (isset($_POST['AutoUpdate'])){//If users push Process Credit button instead of Update button, use this variable to update related information + $_SESSION['CreditItems']->total +=$LineTotal; + $_SESSION['CreditItems']->totalVolume += ($LnItm->QtyDispatched * $LnItm->Volume); + $_SESSION['CreditItems']->totalWeight += ($LnItm->QtyDispatched * $LnItm->Weight); + } + + + + + + + + + + $LineTotal = $LnItm->QtyDispatched * $LnItm->Price * (1 - $LnItm->DiscountPercent); if (!isset($_POST['ProcessCredit'])) { $_SESSION['CreditItems']->total += $LineTotal; $_SESSION['CreditItems']->totalVolume += ($LnItm->QtyDispatched * $LnItm->Volume); @@ -1512,6 +1531,7 @@ echo '<tr><td>' . _('Credit note text') . '</td><td><textarea tabindex="' . $j . '" name="CreditText" cols="31" rows="5">' . $_POST['CreditText'] . '</textarea></td></tr>'; echo '</table><br /><div class="centre"><input tabindex="' . $j . '" type="submit" name="Update" value="' . _('Update') . '" /><br />'; $j++; + echo '<input type="hidden" name="AutoUpdate" value="" />'; echo '<input type="submit" tabindex="'.$j++.'" name="ProcessCredit" value="' . _('Process Credit') .'" /></div>'; } echo '</div>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-03-20 14:23:15
|
Revision: 5111 http://web-erp.svn.sourceforge.net/web-erp/?rev=5111&view=rev Author: ExsonQu Date: 2012-03-20 14:23:04 +0000 (Tue, 20 Mar 2012) Log Message: ----------- 20/3/2012 Exson: Fixed bugs that users push Process Credit button in Credit_Invoice.php directly without update will lead to unbalance Journal entry. Reported by Russ Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2012-03-20 12:39:40 UTC (rev 5110) +++ trunk/Credit_Invoice.php 2012-03-20 14:23:04 UTC (rev 5111) @@ -292,9 +292,28 @@ $k=0; //row colour counter $j=0; //row counter - +if(isset($_POST['AutoUpdate'])){//clear the $_SESSION value when users have not click update button and directly process the credit note + $_SESSION['CreditItems']->total = 0; + $_SESSION['CreditItems']->totalVolume = 0; + $_SESSION['CreditItems']->totalWeight = 0; +} foreach ($_SESSION['CreditItems']->LineItems as $LnItm) { $LineTotal = $LnItm->QtyDispatched * $LnItm->Price * (1 - $LnItm->DiscountPercent); + if (isset($_POST['AutoUpdate'])){//If users push Process Credit button instead of Update button, use this variable to update related information + $_SESSION['CreditItems']->total +=$LineTotal; + $_SESSION['CreditItems']->totalVolume += ($LnItm->QtyDispatched * $LnItm->Volume); + $_SESSION['CreditItems']->totalWeight += ($LnItm->QtyDispatched * $LnItm->Weight); + } + + + + + + + + + + $LineTotal = $LnItm->QtyDispatched * $LnItm->Price * (1 - $LnItm->DiscountPercent); if (!isset($_POST['ProcessCredit'])) { $_SESSION['CreditItems']->total += $LineTotal; $_SESSION['CreditItems']->totalVolume += ($LnItm->QtyDispatched * $LnItm->Volume); @@ -1512,6 +1531,7 @@ echo '<tr><td>' . _('Credit note text') . '</td><td><textarea tabindex="' . $j . '" name="CreditText" cols="31" rows="5">' . $_POST['CreditText'] . '</textarea></td></tr>'; echo '</table><br /><div class="centre"><input tabindex="' . $j . '" type="submit" name="Update" value="' . _('Update') . '" /><br />'; $j++; + echo '<input type="hidden" name="AutoUpdate" value="" />'; echo '<input type="submit" tabindex="'.$j++.'" name="ProcessCredit" value="' . _('Process Credit') .'" /></div>'; } echo '</div>'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-05-08 05:01:21
|
Revision: 5321 http://web-erp.svn.sourceforge.net/web-erp/?rev=5321&view=rev Author: ExsonQu Date: 2012-05-08 05:01:15 +0000 (Tue, 08 May 2012) Log Message: ----------- 8/05/2012 Exson: Fixed the bug of Credit_Invoice.php the total will be doubled when use Update button. The bug is introduced for a fix of directly proceed the Credit. Reported by PakRichard. Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2012-05-08 04:57:50 UTC (rev 5320) +++ trunk/Credit_Invoice.php 2012-05-08 05:01:15 UTC (rev 5321) @@ -292,14 +292,14 @@ $k=0; //row colour counter $j=0; //row counter -if(isset($_POST['AutoUpdate'])){//clear the $_SESSION value when users have not click update button and directly process the credit note +if(isset($_POST['AutoUpdate']) and !isset($_POST['Update'])){//clear the $_SESSION value when users have not click update button and directly process the credit note $_SESSION['CreditItems']->total = 0; $_SESSION['CreditItems']->totalVolume = 0; $_SESSION['CreditItems']->totalWeight = 0; } foreach ($_SESSION['CreditItems']->LineItems as $LnItm) { $LineTotal = $LnItm->QtyDispatched * $LnItm->Price * (1 - $LnItm->DiscountPercent); - if (isset($_POST['AutoUpdate'])){//If users push Process Credit button instead of Update button, use this variable to update related information + if (isset($_POST['AutoUpdate']) and !isset($_POST['Update'])){//If users push Process Credit button instead of Update button, use this variable to update related information $_SESSION['CreditItems']->total +=$LineTotal; $_SESSION['CreditItems']->totalVolume += ($LnItm->QtyDispatched * $LnItm->Volume); $_SESSION['CreditItems']->totalWeight += ($LnItm->QtyDispatched * $LnItm->Weight); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ex...@us...> - 2012-05-08 05:01:21
|
Revision: 5321 http://web-erp.svn.sourceforge.net/web-erp/?rev=5321&view=rev Author: ExsonQu Date: 2012-05-08 05:01:15 +0000 (Tue, 08 May 2012) Log Message: ----------- 8/05/2012 Exson: Fixed the bug of Credit_Invoice.php the total will be doubled when use Update button. The bug is introduced for a fix of directly proceed the Credit. Reported by PakRichard. Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2012-05-08 04:57:50 UTC (rev 5320) +++ trunk/Credit_Invoice.php 2012-05-08 05:01:15 UTC (rev 5321) @@ -292,14 +292,14 @@ $k=0; //row colour counter $j=0; //row counter -if(isset($_POST['AutoUpdate'])){//clear the $_SESSION value when users have not click update button and directly process the credit note +if(isset($_POST['AutoUpdate']) and !isset($_POST['Update'])){//clear the $_SESSION value when users have not click update button and directly process the credit note $_SESSION['CreditItems']->total = 0; $_SESSION['CreditItems']->totalVolume = 0; $_SESSION['CreditItems']->totalWeight = 0; } foreach ($_SESSION['CreditItems']->LineItems as $LnItm) { $LineTotal = $LnItm->QtyDispatched * $LnItm->Price * (1 - $LnItm->DiscountPercent); - if (isset($_POST['AutoUpdate'])){//If users push Process Credit button instead of Update button, use this variable to update related information + if (isset($_POST['AutoUpdate']) and !isset($_POST['Update'])){//If users push Process Credit button instead of Update button, use this variable to update related information $_SESSION['CreditItems']->total +=$LineTotal; $_SESSION['CreditItems']->totalVolume += ($LnItm->QtyDispatched * $LnItm->Volume); $_SESSION['CreditItems']->totalWeight += ($LnItm->QtyDispatched * $LnItm->Weight); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ex...@us...> - 2013-12-22 14:21:06
|
Revision: 6509 http://sourceforge.net/p/web-erp/reponame/6509 Author: exsonqu Date: 2013-12-22 14:21:02 +0000 (Sun, 22 Dec 2013) Log Message: ----------- 22/12/2013 Exson: Add a fool-proof to Credit_Invoice.php to prevent an invoice was credit again and again. Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2013-12-22 11:28:30 UTC (rev 6508) +++ trunk/Credit_Invoice.php 2013-12-22 14:21:02 UTC (rev 6509) @@ -480,7 +480,27 @@ $DefaultDispatchDate = Date($_SESSION['DefaultDateFormat']); $OKToProcess = true; +//Here we just validate if there is no credit qty available since the credit items not retrieve from salesorders, so following method is not 100% correct. +if(isset($_POST['CreditType']) AND ($_POST['CreditType']=='WriteOff' OR $_POST['CreditType'] == 'Return' OR $_POST['CreditType']=='ReverseOverCharge')){ + foreach ($_SESSION['CreditItems' . $identifier]->LineItems as $CreditLine) { + $SQL = "SELECT count(*) FROM salesorderdetails WHERE orderno = '".$_SESSION['CreditItems'.$identifier]->OrderNo."' + AND stkcode = '".$CreditLine->StockID."' + AND quantity >=".$CreditLine->QtyDispatched." + AND qtyinvoiced >= ".$CreditLine->QtyDispatched; + $ErrMsg = _('Failed to retrieve salesoderdetails to compare if the credit is overkill'); + $DuplicateCreditResult = DB_query($SQL,$db,$ErrMsg); + $myrow1 = DB_fetch_array($DuplicateCreditResult); + if($myrow1[0] == 0){ + prnMsg(_('The credit quantity for ').$CreditLine->StockID.(' is over than quantity invoiced, must reduce the quantity to credit or you are duplicating the same invoice which is not allowed'),'error'); + $OKToProcess = false; + include('includes/footer.inc'); + exit; + } + } +} + + if ((isset($_POST['CreditType']) AND $_POST['CreditType']=='WriteOff') AND !isset($_POST['WriteOffGLCode'])){ prnMsg (_('The GL code to write off the credit value to must be specified. Please select the appropriate GL code for the selection box'),'info'); $OKToProcess = false; |
From: <dai...@us...> - 2013-12-23 02:11:33
|
Revision: 6511 http://sourceforge.net/p/web-erp/reponame/6511 Author: daintree Date: 2013-12-23 02:11:30 +0000 (Mon, 23 Dec 2013) Log Message: ----------- modification to strings for the credit note duplication traps - still a bit suspect! Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2013-12-22 14:21:44 UTC (rev 6510) +++ trunk/Credit_Invoice.php 2013-12-23 02:11:30 UTC (rev 6511) @@ -483,15 +483,15 @@ //Here we just validate if there is no credit qty available since the credit items not retrieve from salesorders, so following method is not 100% correct. if(isset($_POST['CreditType']) AND ($_POST['CreditType']=='WriteOff' OR $_POST['CreditType'] == 'Return' OR $_POST['CreditType']=='ReverseOverCharge')){ foreach ($_SESSION['CreditItems' . $identifier]->LineItems as $CreditLine) { - $SQL = "SELECT count(*) FROM salesorderdetails WHERE orderno = '".$_SESSION['CreditItems'.$identifier]->OrderNo."' - AND stkcode = '".$CreditLine->StockID."' - AND quantity >=".$CreditLine->QtyDispatched." - AND qtyinvoiced >= ".$CreditLine->QtyDispatched; - $ErrMsg = _('Failed to retrieve salesoderdetails to compare if the credit is overkill'); + $SQL = "SELECT count(*) FROM salesorderdetails WHERE orderno = '" . $_SESSION['CreditItems'.$identifier]->OrderNo . "' + AND stkcode = '" . $CreditLine->StockID . "' + AND quantity >=" . $CreditLine->QtyDispatched . " + AND qtyinvoiced >=" . $CreditLine->QtyDispatched; + $ErrMsg = _('Failed to retrieve salesoderdetails to compare if the order has been invoiced and that it is possible that the credit note may not already have been done'); $DuplicateCreditResult = DB_query($SQL,$db,$ErrMsg); $myrow1 = DB_fetch_array($DuplicateCreditResult); if($myrow1[0] == 0){ - prnMsg(_('The credit quantity for ').$CreditLine->StockID.(' is over than quantity invoiced, must reduce the quantity to credit or you are duplicating the same invoice which is not allowed'),'error'); + prnMsg(_('The credit quantity for the line for') . ' ' . $CreditLine->StockID . ' ' . ('is more than the quantity invoiced. This check is made to ensure that the credit note is not duplicated.'),'error'); $OKToProcess = false; include('includes/footer.inc'); exit; |
From: <ex...@us...> - 2014-11-22 05:29:31
|
Revision: 7001 http://sourceforge.net/p/web-erp/reponame/7001 Author: exsonqu Date: 2014-11-22 05:29:23 +0000 (Sat, 22 Nov 2014) Log Message: ----------- 22/11/14 Exson: Fix the qualitytext does not have default value for strict sql mode in Credit_Invoice.php. Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2014-11-22 02:40:09 UTC (rev 7000) +++ trunk/Credit_Invoice.php 2014-11-22 05:29:23 UTC (rev 7001) @@ -942,12 +942,14 @@ $SQL = "INSERT INTO stockserialitems (stockid, loccode, serialno, - quantity) + quantity, + qualitytext) VALUES ('" . $CreditLine->StockID . "', '" . $_SESSION['CreditItems' . $identifier]->Location . "', '" . $Item->BundleRef . "', - '". $Item->BundleQty ."')"; + '". $Item->BundleQty ."', + '')"; $ErrMsg = _('CRITICAL ERROR') . '! ' . _('NOTE DOWN THIS ERROR AND SEEK ASSISTANCE') . ': ' . _('The serial stock item record could not be updated because'); $DbgMsg = _('The following SQL to update the serial stock item record was used'); @@ -1607,4 +1609,4 @@ echo '</div>'; echo '</form>'; include('includes/footer.inc'); -?> \ No newline at end of file +?> |
From: <rc...@us...> - 2014-12-12 04:46:00
|
Revision: 7018 http://sourceforge.net/p/web-erp/reponame/7018 Author: rchacon Date: 2014-12-12 04:45:51 +0000 (Fri, 12 Dec 2014) Log Message: ----------- Fix tab index in input elements for "tab" button navigation. Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2014-12-12 01:15:44 UTC (rev 7017) +++ trunk/Credit_Invoice.php 2014-12-12 04:45:51 UTC (rev 7018) @@ -295,12 +295,13 @@ <th>' . _('Units') . '</th> <th>' . _('Credit') . '<br />' . _('Quantity') . '</th> <th>' . _('Price') . '</th> - <th>' . _('Discount') . ' %' . '</th> + <th>' . _('Discount Rate') . '</th> <th>' . _('Total') . '<br />' . _('Excl Tax') . '</th> <th>' . _('Tax Authority') . '</th> - <th>' . _('Tax') . ' %' . '</th> - <th>' . _('Tax') . '<br />' . _('Amount') . '</th> + <th>' . _('Tax Rate') . '</th> + <th>' . _('Tax Amount') . '</th> <th>' . _('Total') . '<br />' . _('Incl Tax') . '</th> + <th> </th> </tr>'; } $_SESSION['CreditItems' . $identifier]->total = 0; @@ -315,6 +316,7 @@ $k=0; //row colour counter $j=0; //row counter +$tabindex=1;// Tab order of an element when the "tab" button is used for navigating. foreach($_SESSION['CreditItems' . $identifier]->LineItems as $LnItm) { @@ -326,37 +328,40 @@ if(!isset($_POST['ProcessCredit'])) { if($k==1) { - echo '<tr class="EvenTableRows">'; + $RowClass='EvenTableRows'; $k=0; } else { - echo '<tr class="OddTableRows">'; + $RowClass='OddTableRows'; $k=1; } $j++; - - echo '<td>' . $LnItm->StockID . '</td> - <td title="'. $LnItm->LongDescription . '">' . $LnItm->ItemDescription . '</td> +// Use of htmlspecialchars to convert ampersand, double_quote, single_quote, less_than, and greater_than to html entities to to preserve their meanings. + echo '<tr class="'.$RowClass.'"> + <td>' . $LnItm->StockID . '</td> + <td title="'. htmlspecialchars($LnItm->LongDescription) . '">' . $LnItm->ItemDescription . '</td> <td class="number">' . locale_number_format($LnItm->Quantity,$LnItm->DecimalPlaces) . '</td> <td>' . $LnItm->Units . '</td>'; if($LnItm->Controlled==1) { - echo '<td><input type="hidden" class="number" name="Quantity_' . $LnItm->LineNumber .'" value="' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '" /><a ' .($j==1 ? 'autofocus="autofocus" ':'') . ' href="' . $RootPath . '/CreditItemsControlled.php?LineNo=' . $LnItm->LineNumber . '&CreditInvoice=Yes&identifier=' . $identifier . '">' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</a></td>'; + echo '<td><input class="number" type="hidden" name="Quantity_' . $LnItm->LineNumber .'" value="' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '" /><a ' . ($j==1 ? 'autofocus="autofocus" ':'') . ' href="' . $RootPath . '/CreditItemsControlled.php?LineNo=' . $LnItm->LineNumber . '&CreditInvoice=Yes&identifier=' . $identifier . '" tabindex="'.$tabindex++.'">' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '</a></td>'; } else { - echo '<td><input tabindex="' . $j . '" type="text" class="number" ' .($j==1 ? 'autofocus="autofocus" ':'') . 'required="required" title="' . _('Enter the quantity of this item to credit') . '" name="Quantity_' . $LnItm->LineNumber .'" maxlength="6" size="6" value="' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '" /></td>'; + echo '<td><input class="number" ' .($j==1 ? 'autofocus="autofocus" ':'') . ' maxlength="6" name="Quantity_' . $LnItm->LineNumber .'" required="required" size="6" tabindex="'.$tabindex++.'" title="' . _('Enter the quantity of this item to credit') . '" type="text" value="' . locale_number_format($LnItm->QtyDispatched,$LnItm->DecimalPlaces) . '" /></td>'; } $DisplayLineTotal = locale_number_format($LineTotal,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces); $j++; - echo '<td><input tabindex="' . $j . '" type="text" class="number" required="required" title="' . _('Enter the price at which to credit this item') . '" name="Price_' . $LnItm->LineNumber . '" maxlength="12" size="6" value="' . locale_number_format($LnItm->Price,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '" /></td> - <td><input tabindex="' . $j . '" type="text" class="number" required="required" name="Discount_' . $LnItm->LineNumber . '" maxlength="3" size="3" value="' . locale_number_format(($LnItm->DiscountPercent * 100),2) . '" /></td> - <td class="number">' . $DisplayLineTotal . '</td>'; + echo '<td><input class="number" maxlength="12" name="Price_' . $LnItm->LineNumber . '" required="required" size="6" tabindex="'.$tabindex++.'" title="' . _('Enter the price at which to credit this item') . '" type="text" value="' . locale_number_format($LnItm->Price,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '" /></td> + + <td><input class="number" maxlength="3" name="Discount_' . $LnItm->LineNumber . '" required="required" size="3" tabindex="'.$tabindex++.'" title="Discount percent" type="text" value="' . locale_number_format(($LnItm->DiscountPercent * 100),2) . '" /></td> + <td class="number">' . $DisplayLineTotal . '</td>'; + /*Need to list the taxes applicable to this line */ echo '<td>'; $i=0; @@ -381,8 +386,7 @@ echo '<br />'; } if(!isset($_POST['ProcessCredit'])) { - echo '<input type="text" class="number" required="required" name="' . $LnItm->LineNumber . $Tax->TaxCalculationOrder . - '_TaxRate" maxlength="4" size="4" value="' . locale_number_format($Tax->TaxRate*100,2) . '" />'; + echo '<input class="number" maxlength="4" name="' . $LnItm->LineNumber . $Tax->TaxCalculationOrder . '_TaxRate" required="required" size="4" type="text" value="' . locale_number_format($Tax->TaxRate*100,2) . '" tabindex="'.$tabindex++.'" />'; } $i++; if($Tax->TaxOnTax ==1) { @@ -404,12 +408,12 @@ echo '</td>'; echo '<td class="number">' . $DisplayTaxAmount . '</td> - <td class="number">' . $DisplayGrossLineTotal . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier=' . $identifier . '&Delete=' . $LnItm->LineNumber . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this item from the credit?') . '\');">' . _('Delete') . '</a></td> + <td class="number">' . $DisplayGrossLineTotal . '</td> + <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier=' . $identifier . '&Delete=' . $LnItm->LineNumber . '" onclick="return confirm(\'' . _('Are you sure you wish to delete this item from the credit?') . '\');" tabindex="'.$tabindex++.'">' . _('Delete') . '</a></td> </tr>'; - echo '<tr ' . $RowStarter . '> - <td colspan="12"><textarea tabindex="' . $j .'" name="Narrative_' . $LnItm->LineNumber . '" cols="100%" rows="1">' . $LnItm->Narrative . '</textarea> + echo '<tr class="'.$RowClass.'"> + <td colspan="13"><textarea tabindex="'.$tabindex++.'" name="Narrative_' . $LnItm->LineNumber . '" cols="100%" rows="1">' . $LnItm->Narrative . '</textarea> <br /> <hr /></td> </tr>'; @@ -423,11 +427,11 @@ if(!isset($_POST['ProcessCredit'])) { echo '<tr> - <td colspan="3" class="number">' . _('Freight cost charged on invoice') . '</td> + <td class="number" colspan="3">' . _('Freight cost charged on invoice') . '</td> <td class="number">' . locale_number_format($_SESSION['Old_FreightCost'],$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</td> <td></td> - <td colspan="2" class="number">' . _('Credit Freight Cost') . '</td> - <td><input tabindex="'.$j.'" type="text" class="number" size="6" maxlength="6" required="required" name="ChargeFreightCost" value="' . locale_number_format($_SESSION['CreditItems' . $identifier]->FreightCost,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '" /></td> + <td class="number" colspan="2">' . _('Credit Freight Cost') . '</td> + <td><input class="number" maxlength="6" name="ChargeFreightCost" required="required" size="6" tabindex="'.$tabindex++.'" type="text" value="' . locale_number_format($_SESSION['CreditItems' . $identifier]->FreightCost,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '" /></td> <td></td> <td>'; @@ -449,7 +453,7 @@ } if(!isset($_POST['ProcessCredit'])) { - echo '<input type="text" class="number" required="required" name="FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . '" maxlength="4" size="4" value="' . locale_number_format(($FreightTaxLine->TaxRate * 100),2) . '" />'; + echo '<input class="number" maxlength="4" name="FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder . '" required="required" size="4" type="text" value="' . locale_number_format(($FreightTaxLine->TaxRate * 100),2) . '" tabindex="'.$tabindex++.'" />'; } if($FreightTaxLine->TaxOnTax ==1) { $TaxTotals[$FreightTaxLine->TaxAuthID] +=($FreightTaxLine->TaxRate *($_SESSION['CreditItems' . $identifier]->FreightCost + $FreightTaxTotal)); @@ -465,6 +469,7 @@ echo '</td>'; echo '<td class="number">' . locale_number_format($FreightTaxTotal,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</td> <td class="number">' . locale_number_format($FreightTaxTotal+ $_SESSION['CreditItems' . $identifier]->FreightCost,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</td> + <td> </td> </tr>'; } @@ -473,12 +478,13 @@ if(!isset($_POST['ProcessCredit'])) { echo '<tr> - <td colspan="7" class="number">' . _('Credit Totals') . '</td> + <td class="number" colspan="7">' . _('Credit Totals') . '</td> <td class="number"><hr /><b>' . $DisplayTotal . '</b><hr /></td> - <td colspan="2"></td> + <td colspan="2"> </td> <td class="number"><hr /><b>' . locale_number_format($TaxTotal,$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</b><hr /></td> <td class="number"><hr /><b>' . locale_number_format($TaxTotal+($_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost),$_SESSION['CreditItems' . $identifier]->CurrDecimalPlaces) . '</b> <hr /></td> + <td> </td> </tr> </table>'; } @@ -1500,7 +1506,7 @@ <table class="selection"> <tr> <td>' . _('Credit Note Type') . '</td> - <td><select tabindex="' . $j .'" name="CreditType">'; + <td><select name="CreditType" tabindex="'.$tabindex++.'">'; if(!isset($_POST['CreditType']) OR $_POST['CreditType']=='Return') { echo '<option selected="selected" value="Return">' . _('Goods returned to store') . '</option>'; @@ -1525,7 +1531,7 @@ echo '<tr> <td>' . _('Goods returned to location') . '</td> - <td><select tabindex="'.$j.'" name="Location">'; + <td><select name="Location" tabindex="'.$tabindex++.'">'; $SQL="SELECT locations.loccode, locationname FROM locations INNER JOIN locationusers ON locationusers.loccode=locations.loccode AND locationusers.userid='" . $_SESSION['UserID'] . "' AND locationusers.canupd=1"; $Result = DB_query($SQL); @@ -1547,8 +1553,8 @@ } elseif($_POST['CreditType']=='WriteOff') { /* the goods are to be written off to somewhere */ echo '<tr> - <td>' . _('Write off the cost of the goods to') . '</td> - <td><select tabindex="' . $j .'" name="WriteOffGLCode">'; + <td>' . _('Write off the cost of the goods to') . '</td> + <td><select name="WriteOffGLCode" tabindex="'.$tabindex++.'">'; $SQL="SELECT accountcode, accountname @@ -1573,14 +1579,14 @@ $j++; echo '<tr> - <td>' . _('Sales person'). ':</td>'; + <td>' . _('Sales person'). '</td>'; if($_SESSION['SalesmanLogin'] != '') { echo '<td>'; echo $_SESSION['UsersRealName']; echo '</td>'; - }else{ - echo '<td><select tabindex="' . $j . '" name="SalesPerson">'; + } else { + echo '<td><select name="SalesPerson" tabindex="'.$tabindex++.'">'; $SalesPeopleResult = DB_query("SELECT salesmancode, salesmanname FROM salesman WHERE current=1"); /* SalesPerson will be set because it is an invoice being credited and the order salesperson would/should have been retrieved */ while($SalesPersonRow = DB_fetch_array($SalesPeopleResult)) { @@ -1590,27 +1596,26 @@ echo '<option value="' . $SalesPersonRow['salesmancode'] . '">' . $SalesPersonRow['salesmanname'] . '</option>'; } } - echo '</select></td>'; } echo '</tr>'; echo '<tr> <td>' . _('Credit note text') . '</td> - <td><textarea tabindex="' . $j . '" name="CreditText" cols="31" rows="5">' . $_POST['CreditText'] . '</textarea></td> + <td><textarea name="CreditText" cols="31" rows="5" tabindex="'.$tabindex++.'">' . $_POST['CreditText'] . '</textarea></td> </tr> </table> <br /> <div class="centre"> - <input tabindex="' . $j . '" type="submit" name="Update" value="' . _('Update') . '" /> + <input name="Update" tabindex="'.$tabindex++.'" type="submit" value="' . _('Update') . '" /> <br />'; $j++; if(!isset($_POST['CreditText'])) { $_POST['CreditText'] = ''; } - echo '<input type="submit" tabindex="'.$j++.'" name="ProcessCredit" value="' . _('Process Credit') .'" /> + echo '<input name="ProcessCredit" type="submit" tabindex="'.$tabindex++.'" value="' . _('Process Credit') .'" /> </div>'; } echo '</div>'; echo '</form>'; include('includes/footer.inc'); -?> +?> \ No newline at end of file |
From: <ex...@us...> - 2015-03-14 10:00:02
|
Revision: 7227 http://sourceforge.net/p/web-erp/reponame/7227 Author: exsonqu Date: 2015-03-14 09:59:55 +0000 (Sat, 14 Mar 2015) Log Message: ----------- 14/03/15 Exson: Fixed undefined index noise in Credit_Invoice.php. Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2015-03-13 02:42:53 UTC (rev 7226) +++ trunk/Credit_Invoice.php 2015-03-14 09:59:55 UTC (rev 7227) @@ -1609,6 +1609,9 @@ echo '</select></td>'; } echo '</tr>'; + if(!isset($_POST['CreditText'])){ + $_POST['CreditText'] = ''; + } echo '<tr> <td>' . _('Credit note text') . '</td> <td><textarea name="CreditText" cols="31" rows="5" tabindex="'.$tabindex++.'">' . $_POST['CreditText'] . '</textarea></td> |
From: <ex...@us...> - 2015-08-27 08:26:05
|
Revision: 7345 http://sourceforge.net/p/web-erp/reponame/7345 Author: exsonqu Date: 2015-08-27 08:26:02 +0000 (Thu, 27 Aug 2015) Log Message: ----------- 27/08/15 Exson: Fixed the allocation status of involved invoice and credit notes in Credit_Invoice.php. Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2015-08-19 15:02:21 UTC (rev 7344) +++ trunk/Credit_Invoice.php 2015-08-27 08:26:02 UTC (rev 7345) @@ -567,11 +567,12 @@ $SettledInvoice=0; if($myrow[0]>0) { /*the invoice is not already fully allocated */ - if($myrow[0] >($_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost + $TaxTotal)) { + if($myrow[0] > ($_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost + $TaxTotal)) { $Allocate_amount = $_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost + $TaxTotal; + $SettledInvoice = 0; $Settled = 1; - } else if($myrow[0] >($_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost + $TaxTotal)) { + } else if($myrow[0] < ($_SESSION['CreditItems' . $identifier]->total + $_SESSION['CreditItems' . $identifier]->FreightCost + $TaxTotal)) { /*the balance left to allocate is less than the credit note value */ $Allocate_amount = $myrow[0]; $SettledInvoice = 1; |
From: <ex...@us...> - 2016-11-30 05:11:54
|
Revision: 7689 http://sourceforge.net/p/web-erp/reponame/7689 Author: exsonqu Date: 2016-11-30 05:11:51 +0000 (Wed, 30 Nov 2016) Log Message: ----------- 30/11/16 Exson: Fixed the bug that write off option not work without freight cost input in Credit_Invoice.php. Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2016-11-27 08:20:37 UTC (rev 7688) +++ trunk/Credit_Invoice.php 2016-11-30 05:11:51 UTC (rev 7689) @@ -228,7 +228,7 @@ } } -if(isset($_POST['ChargeFreightCost'])) { +if(isset($_POST['ChargeFreightCost']) AND abs($_POST['ChargeFreightCost'])>0) { $_SESSION['CreditItems' . $identifier]->FreightCost = filter_number_format($_POST['ChargeFreightCost']); if (($TotalQtyCredited + abs($_POST['ChargeFreightCost']))<=0) { prnMsg(_('There are no item quantity or freight charge input'),'error'); |
From: <way...@us...> - 2017-01-11 05:50:39
|
Revision: 7720 http://sourceforge.net/p/web-erp/reponame/7720 Author: waynemcdougall Date: 2017-01-11 05:50:37 +0000 (Wed, 11 Jan 2017) Log Message: ----------- Bug fix: Tax rates were not being processed when updated/processed Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2017-01-06 04:30:38 UTC (rev 7719) +++ trunk/Credit_Invoice.php 2017-01-11 05:50:37 UTC (rev 7720) @@ -244,8 +244,9 @@ } } foreach ($_SESSION['CreditItems'.$identifier]->FreightTaxes as $FreightTaxKey=>$FreightTaxLine) { - if (is_numeric(filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder]))){ - $_SESSION['CreditItems'.$identifier]->FreightTaxes[$FreightTaxKey]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $FreightTaxKey])/100; + $tmp=filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder]); + if (is_numeric($tmp)){ + $_SESSION['CreditItems'.$identifier]->FreightTaxes[$FreightTaxKey]->TaxRate = $tmp/100; } } @@ -274,8 +275,9 @@ $_SESSION['CreditItems' . $identifier]->LineItems[$LineItem->LineNumber]->Narrative=$Narrative; } foreach ($LineItem->Taxes as $TaxKey=>$TaxLine) { - if (is_numeric(filter_number_format($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']))){ - $_SESSION['CreditItems'.$identifier]->LineItems[$LineItem->LineNumber]->Taxes[$TaxKey]->TaxRate = filter_number_format($_POST[$LineItem->LineNumber . $TaxKey . '_TaxRate'])/100; + $tmp=filter_number_format($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']); + if (is_numeric($tmp)){ + $_SESSION['CreditItems'.$identifier]->LineItems[$LineItem->LineNumber]->Taxes[$TaxKey]->TaxRate = $tmp/100; } } } |
From: <dai...@us...> - 2017-01-12 09:16:33
|
Revision: 7722 http://sourceforge.net/p/web-erp/reponame/7722 Author: daintree Date: 2017-01-12 09:16:31 +0000 (Thu, 12 Jan 2017) Log Message: ----------- reverse adding of superflous intermediary variable Modified Paths: -------------- trunk/Credit_Invoice.php Modified: trunk/Credit_Invoice.php =================================================================== --- trunk/Credit_Invoice.php 2017-01-12 09:09:25 UTC (rev 7721) +++ trunk/Credit_Invoice.php 2017-01-12 09:16:31 UTC (rev 7722) @@ -219,7 +219,7 @@ $myrow = DB_fetch_array($NewDispatchTaxProvResult); $_SESSION['CreditItems' . $identifier]->DispatchTaxProvince = $myrow['taxprovinceid']; - + $TotalQtyCredited = 0; foreach($_SESSION['CreditItems' . $identifier]->LineItems as $LineItem) { @@ -244,13 +244,11 @@ } } foreach ($_SESSION['CreditItems'.$identifier]->FreightTaxes as $FreightTaxKey=>$FreightTaxLine) { - $tmp=filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder]); - if (is_numeric($tmp)){ - $_SESSION['CreditItems'.$identifier]->FreightTaxes[$FreightTaxKey]->TaxRate = $tmp/100; + if (is_numeric(filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder]))){ + $_SESSION['CreditItems'.$identifier]->FreightTaxes[$FreightTaxKey]->TaxRate = filter_number_format($_POST['FreightTaxRate' . $FreightTaxLine->TaxCalculationOrder])/100; } } - if($_SESSION['CreditItems' . $identifier]->ItemsOrdered > 0 OR isset($_POST['NewItem'])) { if(isset($_GET['Delete'])) { @@ -275,9 +273,8 @@ $_SESSION['CreditItems' . $identifier]->LineItems[$LineItem->LineNumber]->Narrative=$Narrative; } foreach ($LineItem->Taxes as $TaxKey=>$TaxLine) { - $tmp=filter_number_format($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']); - if (is_numeric($tmp)){ - $_SESSION['CreditItems'.$identifier]->LineItems[$LineItem->LineNumber]->Taxes[$TaxKey]->TaxRate = $tmp/100; + if (is_numeric(filter_number_format($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate']))){ + $_SESSION['CreditItems'.$identifier]->LineItems[$LineItem->LineNumber]->Taxes[$TaxKey]->TaxRate = filter_number_format($_POST[$LineItem->LineNumber . $TaxLine->TaxCalculationOrder . '_TaxRate'])/100; } } } |