[Weberp-svn] SF.net SVN: weberp:[8049] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2011-08-30 20:17:36
|
Revision: 8049 http://weberp.svn.sourceforge.net/weberp/?rev=8049&view=rev Author: tim_schofield Date: 2011-08-30 20:17:30 +0000 (Tue, 30 Aug 2011) Log Message: ----------- Format currency and stock amounts correctly Modified Paths: -------------- trunk/SuppShiptChgs.php trunk/includes/DefineShiptClass.php Modified: trunk/SuppShiptChgs.php =================================================================== --- trunk/SuppShiptChgs.php 2011-08-30 20:17:18 UTC (rev 8048) +++ trunk/SuppShiptChgs.php 2011-08-30 20:17:30 UTC (rev 8049) @@ -17,10 +17,10 @@ include('includes/header.inc'); -if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ - echo '<a href="' . $rootpath . '/SupplierInvoice.php">' . _('Back to Invoice Entry') . '</a>'; -} else { - echo '<a href="' . $rootpath . '/SupplierCredit.php">' . _('Back to Credit Note Entry') . '</a>'; +foreach ($_POST as $key=>$value) { + if (substr($key, 0, 6)=='Amount') { + $_POST[$key] = filter_currency_input($value); + } } if (!isset($_SESSION['SuppTrans'])){ @@ -69,13 +69,19 @@ /*Show all the selected ShiptRefs so far from the SESSION['SuppInv']->Shipts array */ if ($_SESSION['SuppTrans']->InvoiceOrCredit=='Invoice'){ - echo '<p class="page_title_text">'. _('Shipment charges on Invoice') . ' '.'</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . '" alt="" />'. _('Shipment charges on Invoice') . ' '; } else { - echo '<p class="page_title_text">' . _('Shipment credits on Credit Note') . ' '.'</p>'; + echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . '" alt="" />' . _('Shipment credits on Credit Note') . ' '; } -echo '<p>'.$_SESSION['SuppTrans']->SuppReference . ' ' ._('From') . ' ' . $_SESSION['SuppTrans']->SupplierName.'</p>'; +echo '<br />' . $_SESSION['SuppTrans']->SuppReference . ' ' ._('From') . ' ' . $_SESSION['SuppTrans']->SupplierName.'</p>'; -echo '<table cellpadding="2" class="selection">'; +if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ + echo '<div class="centre"><a href="' . $rootpath . '/SupplierInvoice.php">' . _('Back to Invoice Entry') . '</a></div>'; +} else { + echo '<div class="centre"><a href="' . $rootpath . '/SupplierCredit.php">' . _('Back to Credit Note Entry') . '</a></div>'; +} + +echo '<br /><table cellpadding="2" class="selection">'; $TableHeader = '<tr><th>' . _('Shipment') . '</th> <th>' . _('Amount') . '</th></tr>'; echo $TableHeader; @@ -85,7 +91,7 @@ foreach ($_SESSION['SuppTrans']->Shipts as $EnteredShiptRef){ echo '<tr><td>' . $EnteredShiptRef->ShiptRef . '</td> - <td class="number">' . number_format($EnteredShiptRef->Amount,2) . '</td> + <td class="number">' . currency_number_format($EnteredShiptRef->Amount,$_SESSION['SuppTrans']->CurrCode) . '</td> <td><a href="' . $_SERVER['PHP_SELF'] . '?Delete=' . $EnteredShiptRef->Counter . '">' . _('Delete') . '</a></td></tr>'; $TotalShiptValue = $TotalShiptValue + $EnteredShiptRef->Amount; @@ -94,7 +100,7 @@ echo '<tr> <td class="number"><font size="2" color="navy">' . _('Total') . ':</font></td> - <td class="number"><font size="2" color="navy"><u>' . number_format($TotalShiptValue,2) . '</u></font></td> + <td class="number"><font size="2" color="navy"><u>' . currency_number_format($TotalShiptValue,$_SESSION['SuppTrans']->CurrCode) . '</u></font></td> </tr> </table><br />'; @@ -105,6 +111,13 @@ if (!isset($_POST['ShiptRef'])) { $_POST['ShiptRef']=''; } + +foreach ($_POST as $key=>$value) { + if (substr($key, 0, 6)=='Amount') { + $_POST[$key] = filter_currency_input($value); + } +} + echo '<table class="selection">'; echo '<tr><td>' . _('Shipment Reference') . ':</td> <td><input type="text" name="ShiptRef" size="12" maxlength="11" value="' . $_POST['ShiptRef'] . '" /></td></tr>'; @@ -134,7 +147,7 @@ $_POST['Amount']=0; } echo '<tr><td>' . _('Amount') . ':</td> - <td><input type="text" name="Amount" size="12" maxlength="11" value="' . $_POST['Amount'] . '" /></td></tr>'; + <td><input type="text" class="number" name="Amount" size="12" maxlength="11" value="' . currency_number_format($_POST['Amount'], $_SESSION['SuppTrans']->CurrCode) . '" /></td></tr>'; echo '</table>'; echo '<br /><div class="centre"><input type="submit" name="AddShiptChgToInvoice" value="' . _('Enter Shipment Charge') . '" /></div>'; Modified: trunk/includes/DefineShiptClass.php =================================================================== --- trunk/includes/DefineShiptClass.php 2011-08-30 20:17:18 UTC (rev 8048) +++ trunk/includes/DefineShiptClass.php 2011-08-30 20:17:30 UTC (rev 8049) @@ -4,17 +4,17 @@ Class Shipment { - Var $ShiptRef; /*unqique identifier for the shipment */ + var $ShiptRef; /*unqique identifier for the shipment */ var $LineItems; /*array of objects of class LineDetails using the product id as the pointer */ - Var $SupplierID; + var $SupplierID; var $SupplierName; var $CurrCode; var $VoyageRef; - Var $Vessel; - Var $ETA; - Var $StockLocation; - Var $Closed; + var $Vessel; + var $ETA; + var $StockLocation; + var $Closed; function Shipment(){ /*Constructor function initialises a new Shipment object */ @@ -43,7 +43,7 @@ $ErrMsg = _('There was an error updating the purchase order detail record to make it part of shipment') . ' ' . $this->ShiptRef . ' ' . _('the error reported was'); $result = DB_query($sql, $db, $ErrMsg); - Return 1; + return 1; } @@ -63,17 +63,17 @@ Class LineDetails { - Var $PODetailItem; - Var $OrderNo; - Var $StockID; - Var $ItemDescription; - Var $QtyInvoiced; - Var $UnitPrice; - Var $UOM; - Var $DelDate; - Var $QuantityOrd; - Var $QuantityRecd; - Var $StdCostUnit; + var $PODetailItem; + var $OrderNo; + var $StockID; + var $ItemDescription; + var $QtyInvoiced; + var $UnitPrice; + var $UOM; + var $DelDate; + var $QuantityOrd; + var $QuantityRecd; + var $StdCostUnit; function LineDetails ($PODetailItem, $OrderNo, $StockID, $ItemDescr, $QtyInvoiced, $UnitPrice, $UOM, $DelDate, $QuantityOrd, $QuantityRecd, $StdCostUnit){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |