[Weberp-svn] SF.net SVN: weberp:[9515] trunk
Brought to you by:
sotandeka,
tim_schofield
From: <tim...@us...> - 2012-08-16 22:08:45
|
Revision: 9515 http://weberp.svn.sourceforge.net/weberp/?rev=9515&view=rev Author: tim_schofield Date: 2012-08-16 22:08:37 +0000 (Thu, 16 Aug 2012) Log Message: ----------- Update supplier invoicing system for new interface Modified Paths: -------------- trunk/SuppContractChgs.php trunk/SuppFixedAssetChgs.php trunk/SuppInvGRNs.php trunk/SuppShiptChgs.php trunk/SuppTransGLAnalysis.php trunk/SupplierInvoice.php trunk/css/silverwolf/images/contract.png trunk/includes/DefineSuppTransClass.php Added Paths: ----------- trunk/css/silverwolf/images/fixed_asset.png trunk/css/silverwolf/images/shipment.png Modified: trunk/SuppContractChgs.php =================================================================== --- trunk/SuppContractChgs.php 2012-08-16 13:09:18 UTC (rev 9514) +++ trunk/SuppContractChgs.php 2012-08-16 22:08:37 UTC (rev 9515) @@ -22,7 +22,7 @@ if (!isset($_SESSION['SuppTrans'])){ prnMsg(_('Contract charges or credits are entered against supplier invoices or credit notes respectively. To enter supplier transactions the supplier must first be selected from the supplier selection screen, then the link to enter a supplier invoice or credit note must be clicked on'),'info'); - echo '<br /><a href="' . $rootpath . '/SelectSupplier.php?">' . _('Select A Supplier') . '</a>'; + echo '<br />' . InternalLink('', 'SelectSupplier.php', _('Select A Supplier')); exit; /*It all stops here if there aint no supplier selected and invoice/credit initiated ie $_SESSION['SuppTrans'] started off*/ } @@ -61,22 +61,26 @@ $_SESSION['SuppTrans']->Remove_Contract_From_Trans($_GET['Delete']); } +echo '<br /><table cellpadding="2" class="selection">'; + /*Show all the selected ContractRefs so far from the SESSION['SuppInv']->Contracts array */ if ($_SESSION['SuppTrans']->InvoiceOrCredit=='Invoice'){ - echo '<div class="centre"><p class="page_title_text">' . _('Contract charges on Invoice') . ' ' . $_SESSION['SuppTrans']->SuppReference . ' ' . - _('From') . ' ' . $_SESSION['SuppTrans']->SupplierName . '</p></div>'; + echo '<tr> + <th colspan="5" class="header"> + <img src="'.$rootpath.'/css/'.$theme.'/images/contract.png" title="' . _('General Ledger') . '" alt="" /> + ' . _('Contract charges on Invoice') . ' ' . $_SESSION['SuppTrans']->SuppReference . ' ' . _('From') . ' ' . $_SESSION['SuppTrans']->SupplierName . '</th> + </tr>'; } else { echo '<div class="centre"><p class="page_title_text">' . _('Contract credits on Credit Note') . ' ' . $_SESSION['SuppTrans']->SuppReference . ' ' ._('From') . ' ' . $_SESSION['SuppTrans']->SupplierName . '</p></div>'; } -echo '<table cellpadding="2" class="selection">'; -$TableHeader = '<tr><th>' . _('Contract') . '</th> - <th>' . _('Amount') . '</th> - <th>' . _('Narrative') . '</th> - <th>' . _('Anticipated') . '</th> - </tr>'; -echo $TableHeader; +echo '<tr> + <th>' . _('Contract') . '</th> + <th>' . _('Amount') . '</th> + <th>' . _('Narrative') . '</th> + <th>' . _('Anticipated') . '</th> + </tr>'; $TotalContractsValue = 0; @@ -87,11 +91,13 @@ } else { $AnticipatedCost = _('No'); } - echo '<tr><td>' . $EnteredContract->ContractRef . '</td> - <td class="number">' . locale_money_format($EnteredContract->Amount,$_SESSION['SuppTrans']->CurrCode) . '</td> - <td>' . $EnteredContract->Narrative . '</td> - <td>' . $AnticipatedCost . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Delete=' . $EnteredContract->Counter . '">' . _('Delete') . '</a></td></tr>'; + echo '<tr> + <td>' . $EnteredContract->ContractRef . '</td> + <td class="number">' . locale_money_format($EnteredContract->Amount,$_SESSION['SuppTrans']->CurrCode) . '</td> + <td>' . $EnteredContract->Narrative . '</td> + <td>' . $AnticipatedCost . '</td> + <td>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Delete=' . $EnteredContract->Counter, _('Delete')) . '</td> + </tr>'; $TotalContractsValue += $EnteredContract->Amount; @@ -104,9 +110,9 @@ </table>'; if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ - echo '<br /><div class="centre"><a href="' . $rootpath . '/SupplierInvoice.php">' . _('Back to Invoice Entry') . '</a></div><br />'; + echo '<br /><div class="centre">' . InternalLink('', 'SupplierInvoice.php', _('Back to Invoice Entry')) . '</div><br />'; } else { - echo '<br /><div class="centre"><a href="' . $rootpath . '/SupplierCredit.php">' . _('Back to Credit Note Entry') . '</a></div><br />'; + echo '<br /><div class="centre">' . InternalLink('', 'SupplierCredit.php', _('Back to Credit Note Entry')) . '</div><br />'; } /*Set up a form to allow input of new Contract charges */ @@ -156,7 +162,7 @@ echo '<input type="checkbox" name="AnticipatedCost" />'; } -echo '</td></tr></table><br />'; +echo '</td></tr></table>'; echo '<div class="centre"><button type="submit" name="AddContractChgToInvoice">' . _('Enter Contract Charge') . '</button></div>'; Modified: trunk/SuppFixedAssetChgs.php =================================================================== --- trunk/SuppFixedAssetChgs.php 2012-08-16 13:09:18 UTC (rev 9514) +++ trunk/SuppFixedAssetChgs.php 2012-08-16 22:08:37 UTC (rev 9515) @@ -17,7 +17,7 @@ if (!isset($_SESSION['SuppTrans'])){ prnMsg(_('Fixed asset additions or credits are entered against supplier invoices or credit notes respectively') . '. ' . _('To enter supplier transactions the supplier must first be selected from the supplier selection screen') . ', ' . _('then the link to enter a supplier invoice or credit note must be clicked on'),'info'); - echo '<br /><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select A Supplier') . '</a>'; + echo '<br />' . InternalLink('', 'SelectSupplier.php', _('Select A Supplier')); exit; /*It all stops here if there aint no supplier selected and invoice/credit initiated ie $_SESSION['SuppTrans'] started off*/ } @@ -63,19 +63,21 @@ $_SESSION['SuppTrans']->Remove_Asset_From_Trans($_GET['Delete']); } +echo '<br /><table cellpadding="2" class="selection">'; + /*Show all the selected ShiptRefs so far from the SESSION['SuppInv']->Shipts array */ if ($_SESSION['SuppTrans']->InvoiceOrCredit=='Invoice'){ - echo '<div class="centre"><p class="page_title_text">'. _('Fixed Assets on Invoice') . ' </p></div>'; + echo '<tr><th colspan="4" class="header"><img src="'.$rootpath.'/css/'.$theme.'/images/fixed_asset.png" title="' . _('General Ledger') . '" alt="" />'. _('Fixed Assets on Invoice'); } else { - echo '<div class="centre"><p class="page_title_text">' . _('Fixed Asset credits on Credit Note') . ' </p>'; + echo '<tr><th colspan="4" class="header"><img src="'.$rootpath.'/css/'.$theme.'/images/fixed_asset.png" title="' . _('General Ledger') . '" alt="" />' . _('Fixed Asset credits on Credit Note'); } -echo'<div class="centre"><p class="page_title_text">' . $_SESSION['SuppTrans']->SuppReference . ' ' ._('From') . ' ' . $_SESSION['SuppTrans']->SupplierName . '</p></div>'; +echo' ' . $_SESSION['SuppTrans']->SuppReference . ' ' ._('From') . ' ' . $_SESSION['SuppTrans']->SupplierName . '</th></tr>'; -echo '<table cellpadding="2" class="selection">'; -$TableHeader = '<tr><th>' . _('Asset ID') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Amount') . '</th></tr>'; -echo $TableHeader; +echo '<tr> + <th>' . _('Asset ID') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Amount') . '</th> + </tr>'; $TotalAssetValue = 0; @@ -84,7 +86,7 @@ echo '<tr><td>' . $EnteredAsset->AssetID . '</td> <td>' . $EnteredAsset->Description . '</td> <td class="number">' . locale_money_format($EnteredAsset->Amount,$_SESSION['SuppTrans']->CurrCode) . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '&Delete=' . $EnteredAsset->Counter . '">' . _('Delete') . '</a></td></tr>'; + <td>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '&Delete=' . $EnteredAsset->Counter, _('Delete')) . '</td></tr>'; $TotalAssetValue += $EnteredAsset->Amount; @@ -97,9 +99,9 @@ </table><br />'; if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ - echo '<div class="centre"><a href="' . $rootpath . '/SupplierInvoice.php">' . _('Back to Invoice Entry') . '</a></div>'; + echo '<div class="centre">' . InternalLink('', 'SupplierInvoice.php', _('Back to Invoice Entry')) . '</div>'; } else { - echo '<div class="centre"><a href="' . $rootpath . '/SupplierCredit.php">' . _('Back to Credit Note Entry') . '</a></div>'; + echo '<div class="centre">' . InternalLink('', 'SupplierCredit.php', _('Back to Credit Note Entry')) . '</div>'; } /*Set up a form to allow input of new Shipment charges */ @@ -112,10 +114,11 @@ prnMsg(_('If you know the code enter it in the Asset ID input box, otherwise select the asset from the list below. Only assets with no cost will show in the list'),'info'); -echo '<br /><table class="selection">'; +echo '<table class="selection">'; echo '<tr><td>' . _('Enter Asset ID') . ':</td> - <td><input type="text" name="AssetID" size="5" maxlength="6" value="' . $_POST['AssetID'] . '" /> <a href="FixedAssetItems.php" target=_blank>'. _('New Fixed Asset') . '</a></td></tr>'; + <td><input type="text" name="AssetID" size="5" maxlength="6" value="' . $_POST['AssetID'] . '" />' . + InternalLink('', 'FixedAssetItems.php', _('New Fixed Asset')) . '</td></tr>'; echo '<tr><td><b>' . _('OR') .' </b>'. _('Select from list') . ':</td><td><select name="AssetSelection">'; $sql = "SELECT assetid, @@ -143,7 +146,7 @@ <td><input type="text" class="number" name="Amount" size="12" maxlength="11" value="' . locale_money_format($_POST['Amount'], $_SESSION['SuppTrans']->CurrCode) . '" /></td></tr>'; echo '</table>'; -echo '<br /><div class="centre"><button type="submit" name="AddAssetToInvoice">' . _('Enter Fixed Asset') . '</button></div>'; +echo '<div class="centre"><button type="submit" name="AddAssetToInvoice">' . _('Enter Fixed Asset') . '</button></div>'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/SuppInvGRNs.php =================================================================== --- trunk/SuppInvGRNs.php 2012-08-16 13:09:18 UTC (rev 9514) +++ trunk/SuppInvGRNs.php 2012-08-16 22:08:37 UTC (rev 9515) @@ -12,12 +12,10 @@ $title = _('Enter Supplier Invoice Against Goods Received'); include('includes/header.inc'); -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/magnifier.png" title="' . _('Dispatch') . '" alt="" />' . ' ' . $title . '</p>'; - $Complete=false; if (!isset($_SESSION['SuppTrans'])){ prnMsg(_('To enter a supplier transactions the supplier must first be selected from the supplier selection screen') . ', ' . _('then the link to enter a supplier invoice must be clicked on'),'info'); - echo '<br /><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select A Supplier to Enter a Transaction For') . '</a>'; + echo '<br />' . InternalLink('', 'SelectSupplier.php', _('Select A Supplier to Enter a Transaction For')); include('includes/footer.inc'); exit; /*It all stops here if there aint no supplier selected and invoice initiated ie $_SESSION['SuppTrans'] started off*/ @@ -110,41 +108,36 @@ /*Show all the selected GRNs so far from the SESSION['SuppTrans']->GRNs array */ -echo '<table cellpadding="1" class="selection">'; -echo '<tr><th colspan="8" class="header">' . _('Invoiced Goods Received Selected') . '</th></tr>'; +echo '<br /><table cellpadding="1" class="selection">'; +echo '<tr> + <th colspan="8" class="header">' . _('Invoiced Goods Received Selected') . '</th> + </tr>'; -$tableheader = '<tr> - <th>' . _('Sequence') . ' #</th> - <th>' . _('Item Code') . '</th> - <th>' . _('Description') . '</th> - <th>' . _('Quantity Charged') . '</th> - <th>' . _('Price Charge in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - <th>' . _('Line Value in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th></tr>'; +echo '<tr> + <th>' . _('Sequence') . ' #</th> + <th>' . _('Item Code') . '</th> + <th>' . _('Description') . '</th> + <th>' . _('Quantity Charged') . '</th> + <th>' . _('Price Charge in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th>' . _('Line Value in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + </tr>'; -echo $tableheader; - $TotalValueCharged=0; -$i=0; foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){ - echo '<tr><td>' . $EnteredGRN->GRNNo . '</td> - <td>' . $EnteredGRN->ItemCode . '</td> - <td>' . $EnteredGRN->ItemDescription . '</td> - <td class="number">' . locale_number_format($EnteredGRN->This_QuantityInv,$EnteredGRN->DecimalPlaces) . '</td> - <td class="number">' . locale_money_format($EnteredGRN->ChgPrice,$_SESSION['SuppTrans']->CurrCode) . '</td> - <td class="number">' . locale_money_format($EnteredGRN->ChgPrice * $EnteredGRN->This_QuantityInv,$_SESSION['SuppTrans']->CurrCode) . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Modify=' . $EnteredGRN->GRNNo . '">'. _('Modify') . '</a></td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Delete=' . $EnteredGRN->GRNNo . '">' . _('Delete') . '</a></td> - </tr>'; + echo '<tr> + <td>' . $EnteredGRN->GRNNo . '</td> + <td>' . $EnteredGRN->ItemCode . '</td> + <td>' . $EnteredGRN->ItemDescription . '</td> + <td class="number">' . locale_number_format($EnteredGRN->This_QuantityInv,$EnteredGRN->DecimalPlaces) . '</td> + <td class="number">' . locale_money_format($EnteredGRN->ChgPrice,$_SESSION['SuppTrans']->CurrCode) . '</td> + <td class="number">' . locale_money_format($EnteredGRN->ChgPrice * $EnteredGRN->This_QuantityInv,$_SESSION['SuppTrans']->CurrCode) . '</td> + <td>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Modify=' . $EnteredGRN->GRNNo, _('Modify')) . '</td> + <td>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Delete=' . $EnteredGRN->GRNNo, _('Delete')) . '</td> + </tr>'; $TotalValueCharged = $TotalValueCharged + ($EnteredGRN->ChgPrice * $EnteredGRN->This_QuantityInv); - - $i++; - if ($i>15){ - $i=0; - echo $tableheader; - } } echo '<tr> @@ -152,7 +145,7 @@ <th class="number">' . locale_money_format($TotalValueCharged,$_SESSION['SuppTrans']->CurrCode) . '</th> </tr>'; echo '</table>'; -echo '<br /><div class="centre"><a href="' . $rootpath . '/SupplierInvoice.php">' . _('Back to Invoice Entry') . '</a></div><br />'; +echo '<br /><div class="centre">' . InternalLink('', 'SupplierInvoice.php', _('Back to Invoice Entry')) . '</div><br />'; /* Now get all the outstanding GRNs for this supplier from the database*/ @@ -185,8 +178,9 @@ if (DB_num_rows($GRNResults)==0){ prnMsg(_('There are no outstanding goods received from') . ' ' . $_SESSION['SuppTrans']->SupplierName . ' ' . _('that have not been invoiced by them') . '<br />' . _('The goods must first be received using the link below to select purchase orders to receive'),'warn'); - echo '<div class="centre"><p><a href="'.$rootpath.'/PO_SelectOSPurchOrder.php?SupplierID=' . $_SESSION['SuppTrans']->SupplierID .'">' . - _('Select Purchase Orders to Receive') .'</a></p></div>'; + echo '<div class="centre"> + ' . InternalLink('', 'PO_SelectOSPurchOrder.php?SupplierID=' . $_SESSION['SuppTrans']->SupplierID, _('Select Purchase Orders to Receive')) .' + </div>'; include('includes/footer.inc'); exit; } Modified: trunk/SuppShiptChgs.php =================================================================== --- trunk/SuppShiptChgs.php 2012-08-16 13:09:18 UTC (rev 9514) +++ trunk/SuppShiptChgs.php 2012-08-16 22:08:37 UTC (rev 9515) @@ -25,7 +25,7 @@ if (!isset($_SESSION['SuppTrans'])){ prnMsg(_('Shipment charges or credits are entered against supplier invoices or credit notes respectively') . '. ' . _('To enter supplier transactions the supplier must first be selected from the supplier selection screen') . ', ' . _('then the link to enter a supplier invoice or credit note must be clicked on'),'info'); - echo '<br /><a href="' . $rootpath . '/SelectSupplier.php">' . _('Select A Supplier') . '</a>'; + echo '<br />' . InternalLink('', 'SelectSupplier.php', _('Select A Supplier')); exit; /*It all stops here if there aint no supplier selected and invoice/credit initiated ie $_SESSION['SuppTrans'] started off*/ } @@ -67,32 +67,32 @@ $_SESSION['SuppTrans']->Remove_Shipt_From_Trans($_GET['Delete']); } +echo '<br /><table cellpadding="2" class="selection">'; + /*Show all the selected ShiptRefs so far from the SESSION['SuppInv']->Shipts array */ if ($_SESSION['SuppTrans']->InvoiceOrCredit=='Invoice'){ - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . '" alt="" />'. _('Shipment charges on Invoice') . ' '; + echo '<tr> + <th colspan="4" class="header"><img src="'.$rootpath.'/css/'.$theme.'/images/shipment.png" title="' . _('Search') . '" alt="" />'. _('Shipment charges on Invoice') . ' '; } else { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Search') . '" alt="" />' . _('Shipment credits on Credit Note') . ' '; + echo '<tr> + <th colspan="4" class="header"><img src="'.$rootpath.'/css/'.$theme.'/images/shipment.png" title="' . _('Search') . '" alt="" />' . _('Shipment credits on Credit Note') . ' '; } -echo '<br />' . $_SESSION['SuppTrans']->SuppReference . ' ' ._('From') . ' ' . $_SESSION['SuppTrans']->SupplierName.'</p>'; +echo '<br />' . $_SESSION['SuppTrans']->SuppReference . ' ' ._('From') . ' ' . $_SESSION['SuppTrans']->SupplierName.'</th></tr>'; -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 '<tr> + <th>' . _('Shipment') . '</th> + <th>' . _('Amount') . '</th> + </tr>'; -echo '<br /><table cellpadding="2" class="selection">'; -$TableHeader = '<tr><th>' . _('Shipment') . '</th> - <th>' . _('Amount') . '</th></tr>'; -echo $TableHeader; - $TotalShiptValue = 0; foreach ($_SESSION['SuppTrans']->Shipts as $EnteredShiptRef){ - echo '<tr><td>' . $EnteredShiptRef->ShiptRef . '</td> - <td class="number">' . locale_money_format($EnteredShiptRef->Amount,$_SESSION['SuppTrans']->CurrCode) . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Delete=' . $EnteredShiptRef->Counter . '">' . _('Delete') . '</a></td></tr>'; + echo '<tr> + <td>' . $EnteredShiptRef->ShiptRef . '</td> + <td class="number">' . locale_money_format($EnteredShiptRef->Amount,$_SESSION['SuppTrans']->CurrCode) . '</td> + <td>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Delete=' . $EnteredShiptRef->Counter, _('Delete')) . '</td> + </tr>'; $TotalShiptValue = $TotalShiptValue + $EnteredShiptRef->Amount; @@ -104,8 +104,14 @@ </tr> </table><br />'; +if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ + echo '<div class="centre">' . InternalLink('', 'SupplierInvoice.php', _('Back to Invoice Entry')) . '</div>'; +} else { + echo '<div class="centre">' . InternalLink('', 'SupplierCredit.php', _('Back to Credit Note Entry')) . '</div>'; +} + /*Set up a form to allow input of new Shipment charges */ -echo '<form onsubmit="return SubmitForm(this, \'\')" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; +echo '<br /><form onsubmit="return SubmitForm(this, \'\')" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; if (!isset($_POST['ShiptRef'])) { @@ -150,7 +156,7 @@ <td><input type="text" class="number" name="Amount" size="12" maxlength="11" value="' . locale_money_format($_POST['Amount'], $_SESSION['SuppTrans']->CurrCode) . '" /></td></tr>'; echo '</table>'; -echo '<br /><div class="centre"><button type="submit" name="AddShiptChgToInvoice">' . _('Enter Shipment Charge') . '</button></div>'; +echo '<div class="centre"><button type="submit" name="AddShiptChgToInvoice">' . _('Enter Shipment Charge') . '</button></div>'; echo '</form>'; include('includes/footer.inc'); Modified: trunk/SuppTransGLAnalysis.php =================================================================== --- trunk/SuppTransGLAnalysis.php 2012-08-16 13:09:18 UTC (rev 9514) +++ trunk/SuppTransGLAnalysis.php 2012-08-16 22:08:37 UTC (rev 9515) @@ -70,12 +70,14 @@ $GLActName, $_POST['Amount'], $_POST['JobRef'], - $_POST['Narrative']); + $_POST['Narrative'], + $_POST['Tag']); unset($_POST['GLCode']); unset($_POST['Amount']); unset($_POST['JobRef']); unset($_POST['Narrative']); unset($_POST['AcctSelection']); + unset($_POST['Tag']); } } @@ -92,57 +94,67 @@ $_SESSION['SuppTrans']->Remove_GLCodes_From_Trans($_GET['Edit']); } +echo '<br /><table cellpadding="2" class="selection">'; + /*Show all the selected GLCodes so far from the SESSION['SuppInv']->GLCodes array */ if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger') . '" alt="" />' . ' ' - . _('General Ledger Analysis of Invoice From') . ' ' . $_SESSION['SuppTrans']->SupplierName. '</p>'; + echo '<tr> + <th colspan="7" class="header"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger') . '" alt="" />' . ' '. _('General Ledger Analysis of Invoice From') . ' ' . $_SESSION['SuppTrans']->SupplierName. + '</th> + </tr>'; } else { - echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger') . '" alt="" />' . ' ' - . _('General Ledger Analysis of Credit Note From') . ' ' . $_SESSION['SuppTrans']->SupplierName. '</p>'; + echo '<tr> + <th colspan="7" class="header"> + <img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('General Ledger') . '" alt="" />' . ' '. _('General Ledger Analysis of Credit Note From') . ' ' . $_SESSION['SuppTrans']->SupplierName. + '</th> + </tr>'; } -echo '<table cellpadding="2" class="selection">'; -$TableHeader = '<tr> - <th>' . _('Account') . '</th> - <th>' . _('Name') . '</th> - <th>' . _('Amount') . '<br />' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> - <th>' . _('Narrative') . '</th> - </tr>'; -echo $TableHeader; +echo '<tr> + <th class="SortableColumn" onclick="SortSelect(this)">' . _('Account') . '</th> + <th class="SortableColumn" onclick="SortSelect(this)">' . _('Name') . '</th> + <th class="SortableColumn" onclick="SortSelect(this)">' . _('Amount') . '<br />' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> + <th class="SortableColumn" onclick="SortSelect(this)">' . _('Narrative') . '</th> + <th class="SortableColumn" onclick="SortSelect(this)">' . _('Tag') . '</th> + </tr>'; + $TotalGLValue=0; -$i=0; foreach ( $_SESSION['SuppTrans']->GLCodes as $EnteredGLCode){ + $TagSQL = "SELECT tagdescription FROM tags WHERE tagref='" . $EnteredGLCode->Tag . "'"; + $TagResult = DB_query($TagSQL, $db); + $TagRow = DB_fetch_array($TagResult); + if ($EnteredGLCode->Tag==0) { + $TagRow['tagdescription'] = _('None'); + } + echo '<tr> - <td>' . $EnteredGLCode->GLCode . '</td> - <td>' . $EnteredGLCode->GLActName . '</td> - <td class="number">' . locale_money_format($EnteredGLCode->Amount,$_SESSION['SuppTrans']->CurrCode) . '</td> - <td>' . $EnteredGLCode->Narrative . '</td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Edit=' . $EnteredGLCode->Counter . '">' . _('Edit') . '</a></td> - <td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Delete=' . $EnteredGLCode->Counter . '">' . _('Delete') . '</a></td> + <td>' . $EnteredGLCode->GLCode . '</td> + <td>' . $EnteredGLCode->GLActName . '</td> + <td class="number">' . locale_money_format($EnteredGLCode->Amount,$_SESSION['SuppTrans']->CurrCode) . '</td> + <td>' . $EnteredGLCode->Narrative . '</td> + <td>' . $EnteredGLCode->Tag . ' - ' . $TagRow['tagdescription'] . '</td> + <td>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Edit=' . $EnteredGLCode->Counter, _('Edit')) . '</td> + <td>' . InternalLink('', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '?Delete=' . $EnteredGLCode->Counter, _('Delete')) . '</td> </tr>'; $TotalGLValue += $EnteredGLCode->Amount; - $i++; - if ($i>15){ - $i = 0; - echo $TableHeader; - } } echo '<tr> - <th colspan="2" class="header">' . _('Total') . ':</th> - <th class="header"><u>' . locale_money_format($TotalGLValue,$_SESSION['SuppTrans']->CurrCode) . '</u></th> + <th colspan="2" class="header">' . _('Total') . ':</th> + <th style="text-align:right"><u>' . locale_money_format($TotalGLValue,$_SESSION['SuppTrans']->CurrCode) . '</u></th> </tr> </table>'; if ($_SESSION['SuppTrans']->InvoiceOrCredit == 'Invoice'){ - echo '<div class="centre"><br /><a href="' . $rootpath . '/SupplierInvoice.php">' . _('Back to Invoice Entry') . '</a></div>'; + echo '<div class="centre"><br />' . InternalLink('', 'SupplierInvoice.php', _('Back to Invoice Entry')) . '</div>'; } else { - echo '<div class="centre"><br /><a href="' . $rootpath . '/SupplierCredit.php">' . _('Back to Credit Note Entry') . '</a></div>'; + echo '<div class="centre"><br />' . InternalLink('', 'SupplierCredit.php', _('Back to Credit Note Entry')) . '</div>'; } /*Set up a form to allow input of new GL entries */ @@ -177,6 +189,31 @@ echo '</select> </td> </tr>'; + +echo '<tr> + <td>' . _('Select GL Tag') . '</td> + <td> + <select name="Tag">'; + +$SQL = "SELECT tagref, + tagdescription + FROM tags + ORDER BY tagref"; + +$result=DB_query($SQL,$db); +echo '<option value="0">0 - None</option>'; +while ($myrow=DB_fetch_array($result)){ + if (isset($_POST['Tag']) and $_POST['Tag']==$myrow['tagref']){ + echo '<option selected="True" value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'].'</option>'; + } else { + echo '<option value="' . $myrow['tagref'] . '">' . $myrow['tagref'].' - ' .$myrow['tagdescription'].'</option>'; + } +} +echo '</select> + </td> + </tr>'; +// End select tag + if (!isset($_POST['Amount'])) { $_POST['Amount']=0; } @@ -192,7 +229,7 @@ <td>' . _('Narrative') . ':</td> <td><textarea name="Narrative" cols=40 rows=2>' . $_POST['Narrative'] . '</textarea></td> </tr> - </table><br />'; + </table>'; echo '<div class="centre"><button type="submit" name="AddGLCodeToTrans">' . _('Enter GL Line') . '</button></div>'; Modified: trunk/SupplierInvoice.php =================================================================== --- trunk/SupplierInvoice.php 2012-08-16 13:09:18 UTC (rev 9514) +++ trunk/SupplierInvoice.php 2012-08-16 22:08:37 UTC (rev 9515) @@ -31,8 +31,6 @@ $SupplierName=$_SESSION['SuppTrans']->SupplierName; } -echo '<p class="page_title_text"><img src="'.$rootpath.'/css/'.$theme.'/images/transactions.png" title="' . _('Supplier Invoice') . '" alt="" />' . ' ' . _('Enter Supplier Invoice:') . ' ' . $SupplierName; -echo '</p>'; if (isset($_GET['SupplierID']) and $_GET['SupplierID']!=''){ /*It must be a new invoice entry - clear any existing invoice details from the SuppTrans object and initiate a newy*/ @@ -59,6 +57,7 @@ paymentterms.dayinfollowingmonth, suppliers.currcode, currencies.rate AS exrate, + currencies.decimalplaces, suppliers.taxgroupid, taxgroups.taxgroupdescription FROM suppliers, @@ -82,6 +81,7 @@ $_SESSION['SuppTrans']->TermsDescription = $myrow['terms']; $_SESSION['SuppTrans']->CurrCode = $myrow['currcode']; $_SESSION['SuppTrans']->ExRate = $myrow['exrate']; + $_SESSION['SuppTrans']->CurrDecimalPlaces = $myrow['decimalplaces']; $_SESSION['SuppTrans']->TaxGroup = $myrow['taxgroupid']; $_SESSION['SuppTrans']->TaxGroupDescription = $myrow['taxgroupdescription']; $_SESSION['SuppTrans']->SupplierID = $myrow['supplierid']; @@ -127,7 +127,7 @@ /* Set the session variables to the posted data from the form if the page has called itself */ if (isset($_POST['ExRate'])){ - $_SESSION['SuppTrans']->ExRate = $_POST['ExRate']; + $_SESSION['SuppTrans']->ExRate = filter_number_input($_POST['ExRate']); $_SESSION['SuppTrans']->Comments = $_POST['Comments']; $_SESSION['SuppTrans']->TranDate = $_POST['TranDate']; @@ -174,66 +174,30 @@ $_SESSION['SuppTrans']->OvAmount += $FixedAsset->Amount; } } - $_SESSION['SuppTrans']->OvAmount = round($_SESSION['SuppTrans']->OvAmount,2); + $_SESSION['SuppTrans']->OvAmount = round($_SESSION['SuppTrans']->OvAmount,$_SESSION['SuppTrans']->CurrDecimalPlaces); }else { /*OvAmount must be entered manually */ - $_SESSION['SuppTrans']->OvAmount = round(filter_currency_input($_POST['OvAmount']),2); + $_SESSION['SuppTrans']->OvAmount = round(filter_currency_input($_POST['OvAmount']),$_SESSION['SuppTrans']->CurrDecimalPlaces); } } - -if (!isset($_POST['PostInvoice'])){ - - if (isset($_POST['GRNS'])){ - /*This ensures that any changes in the page are stored in the session before calling the grn page */ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppInvGRNs.php">'; - echo '<div class="centre">' . _('You should automatically be forwarded to the entry of invoices against goods received page') . - '. ' . _('If this does not happen') .' (' . _('if the browser does not support META Refresh') . ') ' . - '<a href="' . $rootpath . '/SuppInvGRNs.php">' . _('click here') . '</a> ' . _('to continue') . '</div><br />'; - exit; - } - if (isset($_POST['Shipts'])){ - /*This ensures that any changes in the page are stored in the session before calling the shipments page */ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppShiptChgs.php">'; - echo '<div class="centre">' . _('You should automatically be forwarded to the entry of invoices against shipments page') . - '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh'). ') ' . - '<a href="' . $rootpath . '/SuppShiptChgs.php">' . _('click here') . '</a> ' . _('to continue') . '.</div><br />'; - exit; - } - if (isset($_POST['GL'])){ - /*This ensures that any changes in the page are stored in the session before calling the shipments page */ - echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/SuppTransGLAnalysis.php">'; - echo '<div class="centre">' . _('You should automatically be forwarded to the entry of invoices against the general ledger page') . - '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh'). ') ' . - '<a href="' . $rootpath . '/SuppTransGLAnalysis.php">' . _('click here') . '</a> ' . _('to continue') . '.</div><br />'; - exit; - } - if (isset($_POST['Contracts'])){ - /*This ensures that any changes in the page are stored in the session before calling the shipments page */ - echo '<meta http-equiv="refresh" content="0; url=' . $rootpath . '/SuppContractChgs.php">'; - echo '<div class="centre">' . _('You should automatically be forwarded to the entry of invoices against contracts page') . - '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh'). ') ' . - '<a href="' . $rootpath . '/SuppContractChgs.php">' . _('click here') . '</a> ' . _('to continue') . '.</div><br />'; - exit; - } - if (isset($_POST['FixedAssets'])){ - /*This ensures that any changes in the page are stored in the session before calling the shipments page */ - echo '<meta http-equiv="refresh" content="0; url=' . $rootpath . '/SuppFixedAssetChgs.php">'; - echo '<DIV class="centre">' . _('You should automatically be forwarded to the entry of invoice amounts against fixed assets page') . - '. ' . _('If this does not happen') . ' (' . _('if the browser does not support META Refresh'). ') ' . - '<a href="' . $rootpath . '/SuppFixedAssetChgs.php">' . _('click here') . '</a> ' . _('to continue') . '.</div><br />'; - exit; - } +if (!isset($_POST['PostInvoice']) or $_POST['PostInvoice']==''){ /* everything below here only do if a Supplier is selected fisrt add a header to show who we are making an invoice for */ - echo '<br /><table class="selection"> - <tr> - <th>' . _('Supplier') . '</th> - <th>' . _('Currency') . '</th> - <th>' . _('Terms') . '</th> - <th>' . _('Tax Authority') . '</th> - </tr>'; + echo '<br /> + <table class="selection"> + <tr> + <th colspan="4" class="header"> + <img src="'.$rootpath.'/css/'.$theme.'/images/supplier.png" title="' . _('Supplier Invoice') . '" alt="" />' . ' ' . _('Enter Supplier Invoice:') . ' ' . $SupplierName . + '</th> + </tr> + <tr> + <th>' . _('Supplier') . '</th> + <th>' . _('Currency') . '</th> + <th>' . _('Terms') . '</th> + <th>' . _('Tax Authority') . '</th> + </tr>'; echo '<tr><th class="header"><font size="1"><b>' . $_SESSION['SuppTrans']->SupplierID . ' - ' . $_SESSION['SuppTrans']->SupplierName . '</b></font></td> <th class="header"><font size="1"><b>' . $_SESSION['SuppTrans']->CurrCode . '</b></font></th> @@ -242,7 +206,7 @@ </tr> </table>'; - echo '<br /><form onsubmit="return SubmitForm(this, \'\')" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post" name="form1">'; + echo '<form onsubmit="return SubmitForm(this, \'\')" action="' . htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8') . '" method="post" name="form1" id="form1">'; echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />'; echo '<br /><table class="selection">'; @@ -260,22 +224,22 @@ <td><input type="text" class="number" size="11" maxlength="10" name="ExRate" value="' . $_SESSION['SuppTrans']->ExRate . '" /></td></tr>'; echo '</table>'; - echo '<br /><div class="centre"><button type="submit" name="GRNS">' . _('Purchase Orders') . '</button>'; + echo '<div class="centre"><button onclick="return SubmitForm(form1, \'SuppInvGRNs.php\')" type="submit" name="GRNS">' . _('Purchase Orders') . '</button>'; - echo '<button type="submit" name="Shipts">' . _('Shipments') . '</button>'; - echo '<button type="submit" name="Contracts">' . _('Contracts') . '</button>'; + echo '<button onclick="return SubmitForm(form1, \'SuppShiptChgs.php\')" type="submit" name="Shipts">' . _('Shipments') . '</button>'; + echo '<button onclick="return SubmitForm(form1, \'SuppContractChgs.php\')" type="submit" name="Contracts">' . _('Contracts') . '</button>'; if ( $_SESSION['SuppTrans']->GLLink_Creditors == 1){ - echo '<button type="submit" name="GL">' . _('General Ledger') . '</button>'; + echo '<button onclick="return SubmitForm(form1, \'SuppTransGLAnalysis.php\')" type="submit" name="GL">' . _('General Ledger') . '</button>'; } - echo ' <button type="submit" name="FixedAssets">' . _('Fixed Assets') . '</button></div>'; + echo ' <button onclick="return SubmitForm(form1, \'SuppFixedAssetChgs.php\')" type="submit" name="FixedAssets">' . _('Fixed Assets') . '</button></div>'; $TotalGRNValue = 0; if (count( $_SESSION['SuppTrans']->GRNs)>0){ /*if there are any GRNs selected for invoicing then */ /*Show all the selected GRNs so far from the SESSION['SuppInv']->GRNs array */ - echo '<br /><table cellpadding="2" class="selection"> + echo '<table cellpadding="2" class="selection"> <tr><th colspan="6">' . _('Purchase Order Charges') . '</th></tr>'; $tableheader = '<tr> <th>' . _('Seq') . ' #</th> @@ -310,7 +274,7 @@ if (count( $_SESSION['SuppTrans']->Shipts) > 0){ /*if there are any Shipment charges on the invoice*/ - echo '<br /><table cellpadding="2" class="selection"> + echo '<table cellpadding="2" class="selection"> <tr> <th colspan="2">' . _('Shipment Charges') . '</th> </tr>'; @@ -342,7 +306,7 @@ if (count( $_SESSION['SuppTrans']->Assets) > 0){ /*if there are any fixed assets on the invoice*/ - echo '<br /><table cellpadding="2" class="selection"> + echo '<table cellpadding="2" class="selection"> <tr> <th colspan="3">' . _('Fixed Asset Additions') . '</th> </tr>'; @@ -380,7 +344,7 @@ if (count( $_SESSION['SuppTrans']->Contracts) > 0){ /*if there are any contract charges on the invoice*/ - echo '<br /><table cellpadding="2" class="selection"> + echo '<table cellpadding="2" class="selection"> <tr> <th colspan="3">' . _('Contract Charges') . '</th> </tr>'; @@ -420,7 +384,7 @@ if ( $_SESSION['SuppTrans']->GLLink_Creditors == 1){ if (count($_SESSION['SuppTrans']->GLCodes) > 0){ - echo '<br /><table cellpadding="2" class="selection"> + echo '<table cellpadding="2" class="selection"> <tr> <th colspan="5">' . _('General Ledger Analysis') . '</th> </tr>'; @@ -430,16 +394,25 @@ <th>' . _('Name') . '</th> <th>' . _('Amount') . '<br />' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th> <th>' . _('Narrative') . '</th> + <th>' . _('Tag') . '</th> </tr>'; echo $TableHeader; foreach ($_SESSION['SuppTrans']->GLCodes as $EnteredGLCode){ + $TagSQL = "SELECT tagdescription FROM tags WHERE tagref='" . $EnteredGLCode->Tag . "'"; + $TagResult = DB_query($TagSQL, $db); + $TagRow = DB_fetch_array($TagResult); + if ($EnteredGLCode->Tag==0) { + $TagRow['tagdescription'] = _('None'); + } + echo '<tr> <td>' . $EnteredGLCode->GLCode . '</td> <td>' . $EnteredGLCode->GLActName . '</td> <td class="number">' . locale_money_format($EnteredGLCode->Amount,$_SESSION['SuppTrans']->CurrCode) . '</td> <td>' . $EnteredGLCode->Narrative . '</td> + <td>' . $EnteredGLCode->Tag . ' - ' . $TagRow['tagdescription'] . '</td> </tr>'; $TotalGLValue += $EnteredGLCode->Amount; @@ -454,13 +427,13 @@ $_SESSION['SuppTrans']->OvAmount = ($TotalGRNValue + $TotalGLValue + $TotalAssetValue + $TotalShiptValue + $TotalContractsValue); - echo '<br /><table class="selection"> + echo '<table class="selection"> <tr> <td>' . _('Amount in supplier currency') . ':</td> <td colspan="2" class="number">' . locale_money_format( $_SESSION['SuppTrans']->OvAmount,$_SESSION['SuppTrans']->CurrCode) . '</td> </tr>'; } else { - echo '<br /><table class="selection"> + echo '<table class="selection"> <tr> <td>' . _('Amount in supplier currency') . ':</td> <td colspan="2" class="number"><input type="text" size="12" maxlength="10" name="OvAmount" value="' . locale_money_format( $_SESSION['SuppTrans']->OvAmount,$_SESSION['SuppTrans']->CurrCode) . '" /></td> @@ -542,7 +515,7 @@ <td>' . _('Comments') . '</td><td><textarea name="Comments" cols="40" rows="2">' . $_SESSION['SuppTrans']->Comments . '</textarea></td> </tr></table>'; - echo '<p><div class="centre"><button type="submit" name="PostInvoice">' . _('Enter Invoice') . '</button></div></p>'; + echo '<p><div class="centre"><button type="submit" name="PostInvoice" onclick="ChangeButtonValue(this, this.name)">' . _('Enter Invoice') . '</button></div></p>'; } else { //do the postings -and dont show the button to process Modified: trunk/css/silverwolf/images/contract.png =================================================================== --- trunk/css/silverwolf/images/contract.png 2012-08-16 13:09:18 UTC (rev 9514) +++ trunk/css/silverwolf/images/contract.png 2012-08-16 22:08:37 UTC (rev 9515) @@ -1,10 +1,19 @@ \x89PNG |