|
From: <dai...@us...> - 2014-06-17 09:50:37
|
Revision: 6758
http://sourceforge.net/p/web-erp/reponame/6758
Author: daintree
Date: 2014-06-17 09:50:35 +0000 (Tue, 17 Jun 2014)
Log Message:
-----------
Show supplier item code in PO without duplicating in the description
Modified Paths:
--------------
trunk/CustomerReceipt.php
trunk/PO_Items.php
trunk/PO_PDFPurchOrder.php
trunk/includes/PO_PDFOrderPageHeader.inc
Modified: trunk/CustomerReceipt.php
===================================================================
--- trunk/CustomerReceipt.php 2014-06-17 01:48:53 UTC (rev 6757)
+++ trunk/CustomerReceipt.php 2014-06-17 09:50:35 UTC (rev 6758)
@@ -132,9 +132,9 @@
$myrow = DB_fetch_array($result);
$SuggestedFunctionalExRate = $myrow['rate'];
$_SESSION['ReceiptBatch']->CurrDecimalPlaces = $myrow['decimalplaces'];
-
+
} //end else account currency != functional currency
-
+
if ($_POST['Currency']==$_SESSION['ReceiptBatch']->AccountCurrency){
$_SESSION['ReceiptBatch']->ExRate = 1; //ex rate between receipt currency and account currency
$SuggestedExRate=1;
@@ -146,7 +146,7 @@
/*Calculate cross rate to suggest appropriate exchange rate between receipt currency and account currency */
$SuggestedExRate = $TableExRate/$SuggestedFunctionalExRate;
}
-
+
$_SESSION['ReceiptBatch']->BankTransRef = $_POST['BankTransRef'];
$_SESSION['ReceiptBatch']->Narrative = $_POST['BatchNarrative'];
@@ -267,9 +267,8 @@
<p class="page_title_text">
<img src="'.$RootPath.'/css/'.$Theme.'/images/money_add.png" title="' . _('Allocate') . '" alt="" />' . ' ' . _('Summary of Receipt Batch').'
</p>
- <br />';
-
- echo '<table class="selection">
+ <br />
+ <table class="selection">
<tr>
<th>' . _('Batch Number') . '</th>
<th>' . _('Date Banked') . '</th>
@@ -412,7 +411,7 @@
$BatchDebtorTotal += (($ReceiptItem->Discount + $ReceiptItem->Amount)/$_SESSION['ReceiptBatch']->ExRate/$_SESSION['ReceiptBatch']->FunctionalExRate);
/*Create a DebtorTrans entry for each customer deposit */
- /*The rate of exchange required here is the rate between the functional (home) currency and the customer receipt currency
+ /*The rate of exchange required here is the rate between the functional (home) currency and the customer receipt currency
* We have the exchange rate between the bank account and the functional home currency $_SESSION['ReceiptBatch']->ExRate
* and the exchange rate betwen the currency being paid and the bank account */
@@ -624,7 +623,7 @@
WHERE debtortrans.transno " . LIKE . " '%" . $_POST['CustInvNo'] . "%'
AND debtorsmaster.currcode= '" . $_SESSION['ReceiptBatch']->Currency . "'";
}
-
+
if ($_SESSION['SalesmanLogin'] != '') {
$SQL .= " AND EXISTS (
SELECT *
@@ -779,7 +778,7 @@
$SQL = "SELECT bankaccountname,
bankaccounts.accountcode,
bankaccounts.currcode
- FROM bankaccounts
+ FROM bankaccounts
INNER JOIN chartmaster
ON bankaccounts.accountcode=chartmaster.accountcode
INNER JOIN bankaccountusers
@@ -908,7 +907,7 @@
<td><select tabindex="6" name="ReceiptType">';
include('includes/GetPaymentMethods.php');
-/* The array ReceiptTypes is defined from the setup tab of the main menu under
+/* The array ReceiptTypes is defined from the setup tab of the main menu under
payment methods - the array is populated from the include file GetPaymentMethods.php */
foreach ($ReceiptTypes as $RcptType) {
Modified: trunk/PO_Items.php
===================================================================
--- trunk/PO_Items.php 2014-06-17 01:48:53 UTC (rev 6757)
+++ trunk/PO_Items.php 2014-06-17 09:50:35 UTC (rev 6758)
@@ -51,8 +51,8 @@
} else { //ok to update the PO object variables
$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price = filter_number_format($_POST['SuppPrice'.$POLine->LineNo])/$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor;
}
- $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo];
- $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ItemDescription =$_POST['ItemDescription'.$POLine->LineNo];
+ $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate = $_POST['ReqDelDate'.$POLine->LineNo];
+ $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ItemDescription = $_POST['ItemDescription'.$POLine->LineNo];
}
}
}
@@ -634,15 +634,10 @@
}
$PurchPrice = ($PurchRow['price']*(1-$ItemDiscountPercent) - $ItemDiscountAmount)/$PurchRow['conversionfactor'];
$ConversionFactor = $PurchRow['conversionfactor'];
- if ($PurchRow['suppliers_partno']!= $ItemCode){ //only show supplier's part code if not the same as our item code
- $SupplierDescription = $PurchRow['suppliers_partno'] .' - ';
- } else {
- $SupplierDescription = '';
- }
if (mb_strlen($PurchRow['supplierdescription'])>2){
- $SupplierDescription .= $PurchRow['supplierdescription'];
+ $SupplierDescription = $PurchRow['supplierdescription'];
} else {
- $SupplierDescription .= $ItemRow['description'];
+ $SupplierDescription = $ItemRow['description'];
}
$SuppliersUnitOfMeasure = $PurchRow['suppliersuom'];
$SuppliersPartNo = $PurchRow['suppliers_partno'];
@@ -1073,7 +1068,7 @@
}
}
}
-
+
$SQLCount = substr($sql,strpos($sql, "FROM"));
$SQLCount = substr($SQLCount,0, strpos($SQLCount, "ORDER"));
$SQLCount = 'SELECT COUNT(*) '.$SQLCount;
@@ -1101,7 +1096,7 @@
if($Offset > $ListPageMax) {
$Offset = $ListPageMax;
}
-
+
$sql = $sql . "LIMIT " . $_SESSION['DisplayRecordsMax']." OFFSET " . strval($_SESSION['DisplayRecordsMax']*$Offset);
@@ -1196,9 +1191,9 @@
else
$PageBar .= '<input type="submit" name="Next" value="'._('Next').'" disabled="disabled"/>';
$PageBar .= '</td></tr>';
-
+
echo '<table cellpadding="1" class="selection">';
echo $PageBar;
$TableHeader = '<tr>
@@ -1261,7 +1256,7 @@
$PartsDisplayed++;
#end of page full new headings if
}
-
+
echo $PageBar;
#end of while loop
echo '</table>';
Modified: trunk/PO_PDFPurchOrder.php
===================================================================
--- trunk/PO_PDFPurchOrder.php 2014-06-17 01:48:53 UTC (rev 6757)
+++ trunk/PO_PDFPurchOrder.php 2014-06-17 09:50:35 UTC (rev 6758)
@@ -258,12 +258,16 @@
} else {
$DisplayLineTotal = '----';
}
- $Desc = /*- DELETED: $POLine['suppliers_partno'] . " " . -*/ $POLine['itemdescription']; /*- suppliers_partno is duplicated inside itemdescription -*/
-
+ /* If the supplier item code is set then use this to display on the PO rather than the businesses item code */
+ if (mb_strlen($POLine['suppliers_partno'])>0){
+ $ItemCode = $POLine['suppliers_partno'];
+ } else {
+ $ItemCode = $POLine['itemcode'];
+ }
$OrderTotal += ($POLine['unitprice'] * $POLine['quantityord']);
- $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x, $YPos, $FormDesign->Data->Column1->Length, $FormDesign->Data->Column1->FontSize, $POLine['itemcode'], 'left');
- $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x, $YPos, $FormDesign->Data->Column2->Length, $FormDesign->Data->Column2->FontSize, $Desc, 'left');
+ $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column1->x, $YPos, $FormDesign->Data->Column1->Length, $FormDesign->Data->Column1->FontSize, $ItemCode, 'left');
+ $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x, $YPos, $FormDesign->Data->Column2->Length, $FormDesign->Data->Column2->FontSize, $POLine['itemdescription'], 'left');
while (mb_strlen($LeftOvers) > 1) {
$YPos -= $line_height;
if ($YPos - $line_height <= $Bottom_Margin) {
Modified: trunk/includes/PO_PDFOrderPageHeader.inc
===================================================================
--- trunk/includes/PO_PDFOrderPageHeader.inc 2014-06-17 01:48:53 UTC (rev 6757)
+++ trunk/includes/PO_PDFOrderPageHeader.inc 2014-06-17 09:50:35 UTC (rev 6758)
@@ -12,7 +12,7 @@
$pdf->addText($FormDesign->OrderNumber->x,$Page_Height- $FormDesign->OrderNumber->y,$FormDesign->OrderNumber->FontSize, _('Purchase Order Number'). ' ' . $OrderNo);
if ($ViewingOnly!=0) {
$pdf->addText($FormDesign->ViewingOnly->x,$Page_Height - $FormDesign->ViewingOnly->y,$FormDesign->ViewingOnly->FontSize, _('FOR VIEWING ONLY') . ', ' . _('DO NOT SEND TO SUPPLIER') );
- $pdf->addText($FormDesign->ViewingOnly->x,$Page_Height - $FormDesign->ViewingOnly->y-$line_height,$FormDesign->ViewingOnly->FontSize, _('SUPPLIERS') . ' - ' . _('THIS IS NOT AN ORDER') );
+ $pdf->addText($FormDesign->ViewingOnly->x,$Page_Height - $FormDesign->ViewingOnly->y-$line_height,$FormDesign->ViewingOnly->FontSize, _('SUPPLIERS') . ' - ' . _('THIS IS NOT AN ORDER'));
}
$pdf->addText($FormDesign->PageNumber->x,$Page_Height - $FormDesign->PageNumber->y, $FormDesign->PageNumber->FontSize, _('Page') . ': ' .$PageNumber);
/*Now print out the company Tax authority reference */
@@ -81,4 +81,4 @@
$pdf->addText($FormDesign->Headings->Column7->x,$Page_Height - $FormDesign->Headings->Column7->y, $FormDesign->Headings->Column7->FontSize, _('Total') );
/*draw a rectangle to hold the data lines */
$pdf->Rectangle($FormDesign->DataRectangle->x, $Page_Height - $FormDesign->DataRectangle->y, $FormDesign->DataRectangle->width,$FormDesign->DataRectangle->height);
-?>
+?>
\ No newline at end of file
|