|
From: <dai...@us...> - 2011-06-25 10:55:09
|
Revision: 4605
http://web-erp.svn.sourceforge.net/web-erp/?rev=4605&view=rev
Author: daintree
Date: 2011-06-25 10:55:02 +0000 (Sat, 25 Jun 2011)
Log Message:
-----------
multiple line PO descriptions
Modified Paths:
--------------
trunk/ContractBOM.php
trunk/ContractCosting.php
trunk/Contracts.php
trunk/Credit_Invoice.php
trunk/PO_PDFPurchOrder.php
trunk/SalesInquiry.php
trunk/SupplierCredit.php
trunk/includes/class.pdf.php
Modified: trunk/ContractBOM.php
===================================================================
--- trunk/ContractBOM.php 2011-06-23 09:44:04 UTC (rev 4604)
+++ trunk/ContractBOM.php 2011-06-25 10:55:02 UTC (rev 4605)
@@ -19,8 +19,6 @@
}
include('includes/header.inc');
-$Maximum_Number_Of_Parts_To_Show=50;
-
if (isset($_POST['UpdateLines']) OR isset($_POST['BackToHeader'])) {
if($_SESSION['Contract'.$identifier]->Status!=2){ //dont do anything if the customer has committed to the contract
foreach ($_SESSION['Contract'.$identifier]->ContractBOM as $ContractComponent) {
@@ -201,11 +199,11 @@
if ($myrow = DB_fetch_array($result1)){
$_SESSION['Contract'.$identifier]->Add_To_ContractBOM ($ItemCode,
- $myrow['description'],
- $DefaultWorkCentre,
- $Quantity, /* Qty */
- $myrow['unitcost'],
- $myrow['units']);
+ $myrow['description'],
+ $DefaultWorkCentre,
+ $Quantity, /* Qty */
+ $myrow['unitcost'],
+ $myrow['units']);
} else {
prnMsg (_('The item code') . ' ' . $ItemCode . ' ' . _('does not exist in the database and therefore cannot be added to the contract BOM'),'error');
if ($debug==1){
@@ -375,18 +373,17 @@
</tr>';
$PartsDisplayed++;
- if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){
+ if ($PartsDisplayed == $_SESSION['DisplayRecordsMax']){
break;
}
#end of page full new headings if
}
#end of while loop
echo '</table>';
- if ($PartsDisplayed == $Maximum_Number_Of_Parts_To_Show){
+ if ($PartsDisplayed == $_SESSION['DisplayRecordsMax']){
- /*$Maximum_Number_Of_Parts_To_Show defined in config.php */
- prnMsg( _('Only the first') . ' ' . $Maximum_Number_Of_Parts_To_Show . ' ' . _('can be displayed') . '. ' .
+ prnMsg( _('Only the first') . ' ' . $_SESSION['DisplayRecordsMax'] . ' ' . _('can be displayed') . '. ' .
_('Please restrict your search to only the parts required'),'info');
}
echo '<br /><div class="centre"><input type="submit" name="NewItem" value="' . _('Add to Contract Bill Of Material') .'" /></div>';
Modified: trunk/ContractCosting.php
===================================================================
--- trunk/ContractCosting.php 2011-06-23 09:44:04 UTC (rev 4604)
+++ trunk/ContractCosting.php 2011-06-25 10:55:02 UTC (rev 4605)
@@ -64,11 +64,15 @@
echo '<table class="selection">
<tr>
<th colspan="6">' . _('Original Costing') .'</th>
- <th colspan="6">' . _('Actual Costs') .'</th></tr>';
+ <th colspan="6">' . _('Actual Costs') .'</th>
+ </tr>';
-echo '<tr><th colspan="12">' . _('Inventory Required') . '</th></tr>';
+echo '<tr>
+ <th colspan="12">' . _('Inventory Required') . '</th>
+ </tr>';
-echo '<tr><th>' . _('Item Code') . '</th>
+echo '<tr>
+ <th>' . _('Item Code') . '</th>
<th>' . _('Item Description') . '</th>
<th>' . _('Quantity') . '</th>
<th>' . _('Unit') . '</th>
@@ -81,56 +85,70 @@
<th>' . _('Unit Cost') . '</th>
<th>' . _('Total Cost') . '</th>
</tr>';
+
$ContractBOMBudget = 0;
$ContractBOMActual = 0;
foreach ($_SESSION['Contract'.$identifier]->ContractBOM as $Component) {
- echo '<tr><td>' . $Component->StockID . '</td>
- <td>' . $Component->ItemDescription . '</td>
- <td class="number">' . $Component->Quantity . '</td>
- <td>' . $Component->UOM . '</td>
- <td class="number">' . number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
- <td class="number">' . number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>';
+ echo '<tr>
+ <td>' . $Component->StockID . '</td>
+ <td>' . $Component->ItemDescription . '</td>
+ <td class="number">' . $Component->Quantity . '</td>
+ <td>' . $Component->UOM . '</td>
+ <td class="number">' . number_format($Component->ItemCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td class="number">' . number_format(($Component->ItemCost * $Component->Quantity),$_SESSION['CompanyRecord']['decimalplaces']) . '</td>';
+
$ContractBOMBudget += ($Component->ItemCost * $Component->Quantity);
+
if (isset($InventoryIssues[$Component->StockID])){
$InventoryIssues[$Component->StockID]->Matched=1;
echo '<td colspan="2" align="center">' . _('Actual usage') . '</td>
- <td class="number">' . -$InventoryIssues[$Component->StockID]->Quantity . '</td>
- <td>' . $InventoryIssues[$Component->StockID]->Units . '</td>
- <td class="number">' . number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
- <td>' . number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>';
+ <td class="number">' . -$InventoryIssues[$Component->StockID]->Quantity . '</td>
+ <td>' . $InventoryIssues[$Component->StockID]->Units . '</td>
+ <td class="number">' . number_format($InventoryIssues[$Component->StockID]->TotalCost/$InventoryIssues[$Component->StockID]->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ <td>' . number_format(-$InventoryIssues[$Component->StockID]->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ </tr>';
} else {
- echo '<td colspan="6"></td></tr>';
+ echo '<td colspan="6"></td>
+ </tr>';
}
}
foreach ($InventoryIssues as $Component) { //actual inventory components used
$ContractBOMActual -=$Component->TotalCost;
if ($Component->Matched == 0) { //then its a component that wasn't budget for
- echo '<tr><td colspan="6"></td>
+ echo '<tr>
+ <td colspan="6"></td>
<td>' . $Component->StockID . '</td>
<td>' . $Component->Description . '</td>
<td class="number">' . -$Component->Quantity . '</td>
<td>' . $Component->Units . '</td>
<td class="number">' . number_format($Component->TotalCost/$Component->Quantity,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
- <td class="number">' . number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>';
+ <td class="number">' . number_format(-$Component->TotalCost,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ </tr>';
} //end if its a component not originally budget for
}
-echo '<tr><td class="number" colspan="5">' . _('Total Inventory Budgeted Cost') . ':</td>
+echo '<tr>
+ <td class="number" colspan="5">' . _('Total Inventory Budgeted Cost') . ':</td>
<td class="number">' . number_format($ContractBOMBudget,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
<td class="number" colspan="5">' . _('Total Inventory Actual Cost') . ':</td>
- <td class="number">' . number_format($ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td></tr>';
+ <td class="number">' . number_format($ContractBOMActual,$_SESSION['CompanyRecord']['decimalplaces']) . '</td>
+ </tr>';
-echo '<tr><th colspan="12" align="center">' . _('Other Costs') . '</th></tr>';
+echo '<tr>
+ <th colspan="12" align="center">' . _('Other Costs') . '</th>
+ </tr>';
$OtherReqtsBudget = 0;
//other requirements budget sub-table
-echo '<tr><td colspan="6"><table class="selection">
- <tr><th>' . _('Requirement') . '</th>
- <th>' . _('Quantity') . '</th>
- <th>' . _('Unit Cost') . '</th>
- <th>' . _('Total Cost') . '</th>
- </tr>';
+echo '<tr>
+ <td colspan="6"><table class="selection">
+ <tr>
+ <th>' . _('Requirement') . '</th>
+ <th>' . _('Quantity') . '</th>
+ <th>' . _('Unit Cost') . '</th>
+ <th>' . _('Total Cost') . '</th>
+ </tr>';
foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $Requirement) {
echo '<tr><td>' . $Requirement->Requirement . '</td>
Modified: trunk/Contracts.php
===================================================================
--- trunk/Contracts.php 2011-06-23 09:44:04 UTC (rev 4604)
+++ trunk/Contracts.php 2011-06-25 10:55:02 UTC (rev 4605)
@@ -38,21 +38,21 @@
}
if (isset($_GET['NewContract']) AND isset($_GET['SelectedCustomer'])) {
- /*
- * initialize a new contract
- */
- $_SESSION['ExistingContract']=0;
- unset($_SESSION['Contract'.$identifier]->ContractBOM);
- unset($_SESSION['Contract'.$identifier]->ContractReqts);
- unset($_SESSION['Contract'.$identifier]);
- /* initialize new class object */
- $_SESSION['Contract'.$identifier] = new Contract;
+ /*
+ * initialize a new contract
+ */
+ $_SESSION['ExistingContract']=0;
+ unset($_SESSION['Contract'.$identifier]->ContractBOM);
+ unset($_SESSION['Contract'.$identifier]->ContractReqts);
+ unset($_SESSION['Contract'.$identifier]);
+ /* initialize new class object */
+ $_SESSION['Contract'.$identifier] = new Contract;
- $_POST['SelectedCustomer'] = $_GET['SelectedCustomer'];
+ $_POST['SelectedCustomer'] = $_GET['SelectedCustomer'];
- /*The customer is checked for credit and the Contract Object populated
- * using the usual logic of when a customer is selected
- * */
+ /*The customer is checked for credit and the Contract Object populated
+ * using the usual logic of when a customer is selected
+ * */
}
if (isset($_SESSION['Contract'.$identifier]) AND
@@ -139,9 +139,9 @@
if (isset($_GET['ModifyContractRef'])){
if (isset($_SESSION['Contract'.$identifier])){
- unset ($_SESSION['Contract'.$identifier]->ContractBOM);
- unset ($_SESSION['Contract'.$identifier]->ContractReqts);
- unset ($_SESSION['Contract'.$identifier]);
+ unset ($_SESSION['Contract'.$identifier]->ContractBOM);
+ unset ($_SESSION['Contract'.$identifier]->ContractReqts);
+ unset ($_SESSION['Contract'.$identifier]);
}
$_SESSION['ExistingContract']=$_GET['ModifyContractRef'];
@@ -178,7 +178,7 @@
if ($_SESSION['Contract'.$identifier]->Status==1){
$sql = "DELETE FROM salesorderdetails WHERE orderno='" . $_SESSION['Contract'.$identifier]->OrderNo . "'";
- $ErrMsg = _('The quotation line for the contract could not be deleted because');
+ $ErrMsg = _('The quotation lines for the contract could not be deleted because');
$DelResult=DB_query($sql,$db,$ErrMsg);
$sql = "DELETE FROM salesorders WHERE orderno='" . $_SESSION['Contract'.$identifier]->OrderNo . "'";
$ErrMsg = _('The quotation for the contract could not be deleted because');
@@ -220,11 +220,11 @@
//First update the session['Contract'.$identifier] variable with all inputs from the form
$InputError = False; //assume no errors on input then test for errors
- if (strlen($_POST['ContractRef'])<2){
+ if (strlen($_POST['ContractRef']) < 2){
prnMsg(_('The contract reference is expected to be more than 2 characters long. Please alter the contract reference before proceeding.'),'error');
$InputError = true;
}
- if(ContainsIllegalCharacters($_POST['ContractRef'])){
+ if(ContainsIllegalCharacters($_POST['ContractRef']) OR strpos($_POST['ContractRef'],' ')>0){
prnMsg(_('The contract reference cannot contain any spaces, slashes, or inverted commas. Please alter the contract reference before proceeding.'),'error');
$InputError = true;
}
@@ -807,7 +807,7 @@
//end of page full new headings if
}
//end of while loop
- echo '<input type="hidden" name="JustSelectedACustomer" value="Yes">';
+ echo '<input type="hidden" name="JustSelectedACustomer" value="Yes" />';
echo '</table></form>';
@@ -938,7 +938,9 @@
<th>' . _('Quantity') . '</th>
<th>' . _('Unit') . '</th>
<th>' . _('Unit Cost') . '</th>
- <th>' . _('Total Cost') . '</th></tr>';
+ <th>' . _('Total Cost') . '</th>
+ </tr>';
+
foreach ($_SESSION['Contract'.$identifier]->ContractBOM as $Component) {
echo '<tr><td>' . $Component->StockID . '</td>
<td>' . $Component->ItemDescription . '</td>
@@ -949,22 +951,32 @@
</tr>';
$ContractBOMCost += ($Component->ItemCost * $Component->Quantity);
}
- echo '<tr><th colspan="5"><b>' . _('Total stock cost') . '</b></th>
- <th class="number"><b>' . number_format($ContractBOMCost,2) . '</b></th></tr>';
+ echo '<tr>
+ <th colspan="5"><b>' . _('Total stock cost') . '</b></th>
+ <th class="number"><b>' . number_format($ContractBOMCost,2) . '</b></th>
+ </tr>';
} else { //there are no items set up against this contract
- echo '<tr><td colspan="6"><i>' . _('None Entered') . '</i></td></tr>';
+ echo '<tr>
+ <td colspan="6"><i>' . _('None Entered') . '</i></td>
+ </tr>';
}
echo '</table></td>'; //end of contract BOM table
echo '<td valign="top">
- <table class="selection"><tr><th colspan="4">' . _('Other Requirements') . '</th></tr>';
+ <table class="selection">
+ <tr>
+ <th colspan="4">' . _('Other Requirements') . '</th>
+ </tr>';
$ContractReqtsCost = 0;
if (count($_SESSION['Contract'.$identifier]->ContractReqts)!=0){
- echo '<tr><th>' . _('Requirement') . '</th>
- <th>' . _('Quantity') . '</th>
- <th>' . _('Unit Cost') . '</th>
- <th>' . _('Total Cost') . '</th></tr>';
+ echo '<tr>
+ <th>' . _('Requirement') . '</th>
+ <th>' . _('Quantity') . '</th>
+ <th>' . _('Unit Cost') . '</th>
+ <th>' . _('Total Cost') . '</th>
+ </tr>';
foreach ($_SESSION['Contract'.$identifier]->ContractReqts as $Requirement) {
- echo '<tr><td>' . $Requirement->Requirement . '</td>
+ echo '<tr>
+ <td>' . $Requirement->Requirement . '</td>
<td class="number">' . $Requirement->Quantity . '</td>
<td class="number">' . $Requirement->CostPerUnit . '</td>
<td class="number">' . number_format(($Requirement->CostPerUnit * $Requirement->Quantity),2) . '</td>
Modified: trunk/Credit_Invoice.php
===================================================================
--- trunk/Credit_Invoice.php 2011-06-23 09:44:04 UTC (rev 4604)
+++ trunk/Credit_Invoice.php 2011-06-25 10:55:02 UTC (rev 4605)
@@ -1523,7 +1523,7 @@
}
$j++;
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') . '><p>';
+ echo '</table><br /><div class="centre"><input tabindex=' . $j . ' type=submit name=Update value=' . _('Update') . '><p>';
$j++;
echo '<input type="submit" tabindex='.$j++.' name="ProcessCredit" Value="' . _('Process Credit') .'"></div>';
}
Modified: trunk/PO_PDFPurchOrder.php
===================================================================
--- trunk/PO_PDFPurchOrder.php 2011-06-23 09:44:04 UTC (rev 4604)
+++ trunk/PO_PDFPurchOrder.php 2011-06-25 10:55:02 UTC (rev 4605)
@@ -245,6 +245,16 @@
$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');
+ while (strlen($LeftOvers) > 1){
+ $YPos-=$line_height;
+ if ($YPos-$line_height <= $Bottom_Margin){
+ /* We reached the end of the page so finsih off the page and start a newy */
+ $PageNumber++;
+ $YPos=$Page_Height - $FormDesign->Data->y;
+ include ('includes/PO_PDFOrderPageHeader.inc');
+ }
+ $LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column2->x,$YPos,$FormDesign->Data->Column2->Length,$FormDesign->Data->Column2->FontSize,$LeftOvers, 'left');
+ } //end if need a new page headed up
$LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column3->x,$YPos,$FormDesign->Data->Column3->Length,$FormDesign->Data->Column3->FontSize,$DisplayQty, 'left');
$LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column4->x,$YPos,$FormDesign->Data->Column4->Length,$FormDesign->Data->Column4->FontSize,$POLine['suppliersunit'], 'left');
$LeftOvers = $pdf->addTextWrap($FormDesign->Data->Column5->x,$YPos,$FormDesign->Data->Column5->Length,$FormDesign->Data->Column5->FontSize,$DisplayDelDate, 'left');
Modified: trunk/SalesInquiry.php
===================================================================
--- trunk/SalesInquiry.php 2011-06-23 09:44:04 UTC (rev 4604)
+++ trunk/SalesInquiry.php 2011-06-25 10:55:02 UTC (rev 4605)
@@ -56,8 +56,7 @@
//####_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT_SUBMIT####
-function submit(&$db,$PartNumber,$PartNumberOp,$DebtorNo,$DebtorNoOp,$DebtorName,$DebtorNameOp,$savesummarytype)
-{
+function submit(&$db,$PartNumber,$PartNumberOp,$DebtorNo,$DebtorNoOp,$DebtorName,$DebtorNameOp,$savesummarytype) {
//initialize no input errors
$InputError = 0;
@@ -76,13 +75,13 @@
prnMsg(_('Invalid To Date'),'error');
}
- if ($_POST['ReportType'] == 'Summary' && $_POST['DateType'] == 'Order' && $_POST['SummaryType'] == 'transno') {
+ if ($_POST['ReportType'] == 'Summary' AND $_POST['DateType'] == 'Order' AND $_POST['SummaryType'] == 'transno') {
$InputError = 1;
prnMsg(_('Cannot summarize by transaction number with a date type of Order Date'),'error');
return;
}
- if ($_POST['ReportType'] == 'Detail' && $_POST['DateType'] == 'Order' && $_POST['SortBy'] == 'tempstockmoves.transno,salesorderdetails.stkcode') {
+ if ($_POST['ReportType'] == 'Detail' AND $_POST['DateType'] == 'Order' AND $_POST['SortBy'] == 'tempstockmoves.transno,salesorderdetails.stkcode') {
$InputError = 1;
prnMsg(_('Cannot sort by transaction number with a date type of Order Date'),'error');
return;
@@ -99,7 +98,7 @@
# Add more to WHERE statement, if user entered something for the part number,debtorno, name
// Variables that end with Op - meaning operator - are either = or LIKE
$WherePart = ' ';
- if (strlen($PartNumber) > 0 && $PartNumberOp == 'LIKE') {
+ if (strlen($PartNumber) > 0 AND $PartNumberOp == 'LIKE') {
$PartNumber = $PartNumber . '%';
} else {
$PartNumberOp = '=';
@@ -119,7 +118,7 @@
}
$WhereDebtorName = ' ';
- if (strlen($DebtorName) > 0 && $DebtorNameOp == 'LIKE') {
+ if (strlen($DebtorName) > 0 AND $DebtorNameOp == 'LIKE') {
$DebtorName = $DebtorName . '%';
} else {
$DebtorNameOp = '=';
@@ -1105,7 +1104,7 @@
echo '</select></td></tr>';
echo '<tr><td>' . _('For Sales Man') . ':</td><td><select name="Salesman">';
- $sql='SELECT salesmancode, salesmanname FROM salesman';
+ $sql="SELECT salesmancode, salesmanname FROM salesman";
$SalesmanResult= DB_query($sql,$db);
echo '<option selected value="All">' . _('All Salesmen') . '</option>';
While ($myrow = DB_fetch_array($SalesmanResult)){
@@ -1164,8 +1163,7 @@
} // End of function display()
-function TempStockmoves(&$db)
-{
+function TempStockmoves(&$db) {
// When report based on Invoice Date, use stockmoves as the main file, but credit
// notes, which are type 11 in stockmoves, do not have the order number in the
// reference field; instead they have "Ex Inv - " and then the transno from the
Modified: trunk/SupplierCredit.php
===================================================================
--- trunk/SupplierCredit.php 2011-06-23 09:44:04 UTC (rev 4604)
+++ trunk/SupplierCredit.php 2011-06-25 10:55:02 UTC (rev 4605)
@@ -279,16 +279,16 @@
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
echo '<br /><table class=selection>';
-echo '<tr><td><font color=red>' . _('Supplier Credit Note Reference') . ":</font></td>
- <td><font size=2><input type=TEXT size=20 maxlength=20 name=SuppReference value='" . $_SESSION['SuppTrans']->SuppReference . "'></td>";
+echo '<tr><td><font color=red>' . _('Supplier Credit Note Reference') . ':</font></td>
+ <td><font size=2><input type="text" size=20 maxlength=20 name="SuppReference" value="' . $_SESSION['SuppTrans']->SuppReference . '"></td>';
if (!isset($_SESSION['SuppTrans']->TranDate)){
$_SESSION['SuppTrans']->TranDate= Date($_SESSION['DefaultDateFormat'], Mktime(0,0,0,Date('m'),Date('d')-1,Date('y')));
}
-echo '<td><font color=red>' . _('Credit Note Date') . ' (' . _('in format') . ' ' . $_SESSION['DefaultDateFormat'] . ") :</font></td>
- <td><input type=TEXT class='date' alt='".$_SESSION['DefaultDateFormat']. "' size=11 maxlength=10 name='TranDate' value=" . $_SESSION['SuppTrans']->TranDate . '></td>';
-echo '<td><font color=red>' . _('Exchange Rate') . ":</font></td>
- <td><input type=TEXT class='number' size=11 maxlength=10 name='ExRate' value=" . $_SESSION['SuppTrans']->ExRate . '></td></tr>';
+echo '<td><font color=red>' . _('Credit Note Date') . ' (' . _('in format') . ' ' . $_SESSION['DefaultDateFormat'] . ') :</font></td>
+ <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" size=11 maxlength=10 name="TranDate" value="' . $_SESSION['SuppTrans']->TranDate . '"></td>';
+echo '<td><font color=red>' . _('Exchange Rate') . ':</font></td>
+ <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"><input type="submit" name="GRNS" value="' . _('Purchase Orders') . '"> ';
@@ -315,7 +315,7 @@
<th>' . _('Line Total') . '<br />' . _('in') . ' ' . $_SESSION['SuppTrans']->CurrCode . '</th>
</tr>';
echo $TableHeader;
- $TotalGRNvalue=0;
+ $TotalGRNValue=0;
foreach ($_SESSION['SuppTrans']->GRNs as $EnteredGRN){
@@ -344,7 +344,7 @@
<th>' . _('Amount') . '</th></tr>';
echo $TableHeader;
- $TotalShiptvalue=0;
+ $TotalShiptValue=0;
$i=0;
@@ -443,7 +443,7 @@
<th>' . _('Narrative') . '</th></tr>';
echo $TableHeader;
- $TotalGLvalue=0;
+ $TotalGLValue=0;
foreach ($_SESSION['SuppTrans']->GLCodes as $EnteredGLCode){
@@ -467,13 +467,13 @@
}
if (!isset($TotalGRNValue)) {
- $TotalGRNvalue=0;
+ $TotalGRNValue=0;
}
if (!isset($TotalGLValue)) {
- $TotalGLvalue=0;
+ $TotalGLValue=0;
}
if (!isset($TotalShiptValue)) {
- $TotalShiptvalue=0;
+ $TotalShiptValue=0;
}
if (!isset($TotalContractsValue)){
$TotalContractsValue = 0;
@@ -560,7 +560,7 @@
echo '<table class=selection><tr><td><font color=red>' . _('Comments') . '</font></td><td><textarea name=Comments cols=40 rows=2>' .
$_SESSION['SuppTrans']->Comments . '</textarea></td></tr></table>';
-echo "<p><div class='centre'><input type=submit name='PostCreditNote' value='" . _('Enter Credit Note') . "'></div>";
+echo '<p><div class="centre"><input type=submit name="PostCreditNote" value="' . _('Enter Credit Note') . '"></div>';
if (isset($_POST['PostCreditNote'])){
Modified: trunk/includes/class.pdf.php
===================================================================
--- trunk/includes/class.pdf.php 2011-06-23 09:44:04 UTC (rev 4604)
+++ trunk/includes/class.pdf.php 2011-06-25 10:55:02 UTC (rev 4605)
@@ -70,11 +70,11 @@
TCPDF::Line ($x1,$this->h-$y1,$x2,$this->h-$y2,$style);
}
- function addText($xb,$yb,$size,$text)//,$angle=0,$wordSpaceAdjust=0)
+ function addText($xb,$YPos,$size,$text)//,$angle=0,$wordSpaceAdjust=0)
{
// Javier $text = html_entity_decode($text);
$this->SetFontSize($size);
- $this->Text($xb, $this->h-$yb, $text);
+ $this->Text($xb, $this->h-$YPos, $text);
}
function addInfo($label, $value) {
@@ -103,8 +103,8 @@
}
- function addJpegFromFile($img,$x,$y,$w=0,$h=0){
- $this->Image($img, $x, $this->h-$y-$h, $w, $h);
+ function addJpegFromFile($img,$XPos,$y,$Width=0,$Height=0){
+ $this->Image($img, $XPos, $this->h-$y-$Height, $Width, $Height);
}
/*
@@ -242,33 +242,35 @@
$this->line($XPos, $YPos-$Height, $XPos, $YPos);
}
- function addTextWrap($x, $yb, $w, $h, $txt, $align='J', $border=0, $fill=0) {
-
- //$txt = html_entity_decode($txt);
-
+ function addTextWrap($XPos, $YPos, $Width, $Height, $Text, $Align='J', $border=0, $fill=0) {
+
+ /* Returns the balance of the string that could not fit in the width
+ * XPos = pdf horizontal coordinate
+ * YPos = pdf vertical coordiante
+ */
//some special characters are html encoded
//this code serves to make them appear human readable in pdf file
- $txt = html_entity_decode($txt, ENT_QUOTES, 'UTF-8');
+ $Text = html_entity_decode($Text, ENT_QUOTES, 'UTF-8');
- $this->x = $x;
- $this->y = $this->h - $yb - $h;
+ $this->x = $XPos;
+ $this->y = $this->h - $YPos - $Height;
- switch($align) {
+ switch($Align) {
case 'right':
- $align = 'R'; break;
+ $Align = 'R'; break;
case 'center':
- $align = 'C'; break;
+ $Align = 'C'; break;
default:
- $align = 'L';
+ $Align = 'L';
}
- $this->SetFontSize($h);
+ $this->SetFontSize($Height);
$cw=&$this->CurrentFont['cw'];
- if($w==0) {
- $w=$this->w-$this->rMargin-$this->x;
+ if($Width==0) {
+ $Width=$this->w-$this->rMargin-$this->x;
}
- $wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
- $s=str_replace("\r",'',$txt);
+ $wmax=($Width-2*$this->cMargin)*1000/$this->FontSize;
+ $s=str_replace("\r",'',$Text);
$s=str_replace("\n",' ',$s);
$s = trim($s).' ';
$nb=strlen($s);
@@ -318,13 +320,13 @@
}
$sep = $i;
} else {
- if($align=='J') {
+ if($Align=='J') {
$this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0;
$this->_out(sprintf('%.3f Tw',$this->ws*$this->k));
}
}
- $this->Cell($w,$h,substr($s,0,$sep),$b,2,$align,$fill);
+ $this->Cell($Width,$Height,substr($s,0,$sep),$b,2,$Align,$fill);
$this->x=$this->lMargin;
return substr($s, $sep);
} //end function addTextWrap
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|