|
From: <dai...@us...> - 2011-04-18 07:49:50
|
Revision: 4554
http://web-erp.svn.sourceforge.net/web-erp/?rev=4554&view=rev
Author: daintree
Date: 2011-04-18 07:49:36 +0000 (Mon, 18 Apr 2011)
Log Message:
-----------
pre 4.03.8
Modified Paths:
--------------
trunk/PO_Header.php
trunk/PO_Items.php
trunk/PO_PDFPurchOrder.php
trunk/PurchData.php
trunk/doc/Change.log.html
trunk/includes/ConnectDB.inc
trunk/includes/DefinePOClass.php
trunk/includes/PO_ReadInOrder.inc
trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo
trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po
trunk/locale/de_DE.utf8/LC_MESSAGES/messages.mo
trunk/locale/de_DE.utf8/LC_MESSAGES/messages.po
trunk/locale/el_GR.utf8/LC_MESSAGES/messages.mo
trunk/locale/el_GR.utf8/LC_MESSAGES/messages.po
trunk/locale/en_GB.utf8/LC_MESSAGES/messages.pot
trunk/locale/en_US.utf8/LC_MESSAGES/messages.mo
trunk/locale/en_US.utf8/LC_MESSAGES/messages.po
trunk/locale/es_ES.utf8/LC_MESSAGES/messages.mo
trunk/locale/es_ES.utf8/LC_MESSAGES/messages.po
trunk/locale/et_EE.utf8/LC_MESSAGES/messages.mo
trunk/locale/et_EE.utf8/LC_MESSAGES/messages.po
trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.mo
trunk/locale/fa_IR.utf8/LC_MESSAGES/messages.po
trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.mo
trunk/locale/fr_FR.utf8/LC_MESSAGES/messages.po
trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.mo
trunk/locale/hi_IN.utf8/LC_MESSAGES/messages.po
trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.mo
trunk/locale/hr_HR.utf8/LC_MESSAGES/messages.po
trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.mo
trunk/locale/hu_HU.utf8/LC_MESSAGES/messages.po
trunk/locale/id_ID.utf8/LC_MESSAGES/messages.mo
trunk/locale/id_ID.utf8/LC_MESSAGES/messages.po
trunk/locale/it_IT.utf8/LC_MESSAGES/messages.mo
trunk/locale/it_IT.utf8/LC_MESSAGES/messages.po
trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.mo
trunk/locale/ja_JP.utf8/LC_MESSAGES/messages.po
trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.mo
trunk/locale/lv_LV.utf8/LC_MESSAGES/messages.po
trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.mo
trunk/locale/nl_NL.utf8/LC_MESSAGES/messages.po
trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.mo
trunk/locale/pl_PL.utf8/LC_MESSAGES/messages.po
trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.mo
trunk/locale/pt_BR.utf8/LC_MESSAGES/messages.po
trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.mo
trunk/locale/pt_PT.utf8/LC_MESSAGES/messages.po
trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.mo
trunk/locale/ro_RO.utf8/LC_MESSAGES/messages.po
trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.mo
trunk/locale/ru_RU.utf8/LC_MESSAGES/messages.po
trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.mo
trunk/locale/sq_AL.utf8/LC_MESSAGES/messages.po
trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.mo
trunk/locale/sv_SE.utf8/LC_MESSAGES/messages.po
trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.mo
trunk/locale/sw_KE.utf8/LC_MESSAGES/messages.po
trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.mo
trunk/locale/tr_TR.utf8/LC_MESSAGES/messages.po
trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.mo
trunk/locale/vi_VN.utf8/LC_MESSAGES/messages.po
trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.mo
trunk/locale/zh_CN.utf8/LC_MESSAGES/messages.po
trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.mo
trunk/locale/zh_HK.utf8/LC_MESSAGES/messages.po
trunk/sql/mysql/upgrade3.11.1-4.00.sql
trunk/sql/mysql/weberp-demo.sql
trunk/sql/mysql/weberp-new.sql
Modified: trunk/PO_Header.php
===================================================================
--- trunk/PO_Header.php 2011-04-18 00:09:23 UTC (rev 4553)
+++ trunk/PO_Header.php 2011-04-18 07:49:36 UTC (rev 4554)
@@ -228,7 +228,7 @@
$_POST['RePrint'] = 0;
}
- echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>";
+ echo '<meta http-equiv="Refresh" content="0; url=' . $rootpath . '/PO_Items.php?identifier='.$identifier. '">';
echo '<p>';
prnMsg(_('You should automatically be forwarded to the entry of the purchase order line items page') . '. ' .
_('If this does not happen') . ' (' . _('if the browser does not support META Refresh') . ') ' .
@@ -613,6 +613,7 @@
purchdata.suppliersuom,
purchdata.suppliers_partno,
purchdata.conversionfactor,
+ purchdata.leadtime,
stockcategory.stockact
FROM stockmaster INNER JOIN stockcategory
ON stockmaster.categoryid=stockcategory.categoryid
@@ -626,6 +627,9 @@
if (!isset($PurchItemRow['conversionfactor'])) {
$PurchItemRow['conversionfactor']=1;
}
+ if (!isset($PurchItemRow['leadtime'])) {
+ $PurchItemRow['leadtime']=1;
+ }
$_SESSION['PO'.$identifier]->add_to_order( 1,
$Purch_Item,
@@ -644,18 +648,10 @@
0,
'',
$PurchItemRow['decimalplaces'],
- $Purch_Item,
$PurchItemRow['suppliersuom'],
$PurchItemRow['conversionfactor'],
- $PurchItemRow['suppliers_partno'],
- $Qty*$PurchItemRow['price'],
- '',
- 0,
- 0,
- 0,
- 0,
- $Qty,
- $Qty*$PurchItemRow['price']);
+ $PurchItemRow['leadtime'],
+ $PurchItemRow['suppliers_partno'] );
echo "<meta http-equiv='Refresh' content='0; url=" . $rootpath . '/PO_Items.php?identifier='.$identifier. "'>";
}
Modified: trunk/PO_Items.php
===================================================================
--- trunk/PO_Items.php 2011-04-18 00:09:23 UTC (rev 4553)
+++ trunk/PO_Items.php 2011-04-18 07:49:36 UTC (rev 4554)
@@ -49,7 +49,6 @@
} else { //ok to update the PO object variables
$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->Price=(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['SuppPrice'.$POLine->LineNo]))/$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ConversionFactor);
}
- $_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->NetWeight=$_POST['NetWeight'.$POLine->LineNo];
$_SESSION['PO'.$identifier]->LineItems[$POLine->LineNo]->ReqDelDate=$_POST['ReqDelDate'.$POLine->LineNo];
}
}
@@ -202,57 +201,39 @@
foreach ($_SESSION['PO'.$identifier]->LineItems as $POLine) {
if ($POLine->Deleted==False) {
$sql = "INSERT INTO purchorderdetails ( orderno,
- itemcode,
- deliverydate,
- itemdescription,
- glcode,
- unitprice,
- quantityord,
- shiptref,
- jobref,
- itemno,
- suppliersunit,
- suppliers_partno,
- subtotal_amount,
- package,
- pcunit,
- netweight,
- kgs,
- cuft,
- total_quantity,
- total_amount,
- assetid,
- conversionfactor )
- VALUES (
- '" . $_SESSION['PO'.$identifier]->OrderNo . "',
- '" . $POLine->StockID . "',
- '" . FormatDateForSQL($POLine->ReqDelDate) . "',
- '" . $POLine->ItemDescription . "',
- '" . $POLine->GLCode . "',
- '" . $POLine->Price . "',
- '" . $POLine->Quantity . "',
- '" . $POLine->ShiptRef . "',
- '" . $POLine->JobRef . "',
- '" . $POLine->ItemNo . "',
- '" . $POLine->SuppliersUnit . "',
- '" . $POLine->Suppliers_PartNo . "',
- '" . $POLine->SubTotal_Amount . "',
- '" . $POLine->Package . "',
- '" . $POLine->PcUnit . "',
- '" . $POLine->NetWeight . "',
- '" . $POLine->KGs . "',
- '" . $POLine->CuFt . "',
- '" . $POLine->Total_Quantity . "',
- '" . $POLine->Total_Amount . "',
- '" . $POLine->AssetID . "',
- '" . $POLine->ConversionFactor . "')";
+ itemcode,
+ deliverydate,
+ itemdescription,
+ glcode,
+ unitprice,
+ quantityord,
+ shiptref,
+ jobref,
+ suppliersunit,
+ suppliers_partno,
+ assetid,
+ conversionfactor )
+ VALUES (
+ '" . $_SESSION['PO'.$identifier]->OrderNo . "',
+ '" . $POLine->StockID . "',
+ '" . FormatDateForSQL($POLine->ReqDelDate) . "',
+ '" . $POLine->ItemDescription . "',
+ '" . $POLine->GLCode . "',
+ '" . $POLine->Price . "',
+ '" . $POLine->Quantity . "',
+ '" . $POLine->ShiptRef . "',
+ '" . $POLine->JobRef . "',
+ '" . $POLine->SuppliersUnit . "',
+ '" . $POLine->Suppliers_PartNo . "',
+ '" . $POLine->AssetID . "',
+ '" . $POLine->ConversionFactor . "')";
$ErrMsg =_('One of the purchase order detail records could not be inserted into the database because');
$DbgMsg =_('The SQL statement used to insert the purchase order detail record and failed was');
$result =DB_query($sql,$db,$ErrMsg,$DbgMsg,true);
}
} /* end of the loop round the detail line items on the order */
- echo '<p>';
+ echo '<p />';
prnMsg(_('Purchase Order') . ' ' . $_SESSION['PO'.$identifier]->OrderNo . ' ' . _('on') . ' ' .
$_SESSION['PO'.$identifier]->SupplierName . ' ' . _('has been created'),'success');
} else { /*its an existing order need to update the old order info */
@@ -315,17 +296,8 @@
quantityord,
shiptref,
jobref,
- itemno,
suppliersunit,
suppliers_partno,
- subtotal_amount,
- package,
- pcunit,
- netweight,
- kgs,
- cuft,
- total_quantity,
- total_amount,
assetid,
conversionfactor)
VALUES (
@@ -338,17 +310,8 @@
'" . $POLine->Quantity . "',
'" . $POLine->ShiptRef . "',
'" . $POLine->JobRef . "',
- '" . $POLine->ItemNo . "',
'" . $POLine->SuppliersUnit . "',
'" . $POLine->Suppliers_PartNo . "',
- '" . $POLine->SubTotal_Amount . "',
- '" . $POLine->Package . "',
- '" . $POLine->PcUnit . "',
- '" . $POLine->NetWeight . "',
- '" . $POLine->KGs . "',
- '" . $POLine->CuFt . "',
- '" . $POLine->Total_Quantity . "',
- '" . $POLine->Total_Amount . "',
'" . $POLine->AssetID . "',
'" . $POLine->ConversionFactor . "')";
@@ -362,17 +325,8 @@
quantityord='" . $POLine->Quantity . "',
shiptref='" . $POLine->ShiptRef . "',
jobref='" . $POLine->JobRef . "',
- itemno='" . $POLine->ItemNo . "',
suppliersunit='" . $POLine->SuppliersUnit . "',
suppliers_partno='" . $POLine->Suppliers_PartNo . "',
- subtotal_amount='" . $POLine->SubTotal_Amount . "',
- package='" . $POLine->Package . "',
- pcunit='" . $POLine->PcUnit . "',
- netweight='" . $POLine->NetWeight . "',
- kgs='" . $POLine->KGs . "',
- cuft='" . $POLine->CuFt . "',
- total_quantity='" . $POLine->Total_Quantity . "',
- total_amount='" . $POLine->Total_Amount . "',
completed=1,
assetid='" . $POLine->AssetID . "',
conversionfactor = '" . $POLine->ConversionFactor . "'
@@ -386,17 +340,8 @@
quantityord='" . $POLine->Quantity . "',
shiptref='" . $POLine->ShiptRef . "',
jobref='" . $POLine->JobRef . "',
- itemno='" . $POLine->ItemNo . "',
suppliersunit='" . $POLine->SuppliersUnit . "',
suppliers_partno='" . $POLine->Suppliers_PartNo . "',
- subtotal_amount='" . $POLine->SubTotal_Amount . "',
- package='" . $POLine->Package . "',
- pcunit='" . $POLine->PcUnit . "',
- netweight='" . $POLine->NetWeight . "',
- kgs='" . $POLine->KGs . "',
- cuft='" . $POLine->CuFt . "',
- total_quantity='" . $POLine->Total_Quantity . "',
- total_amount='" . $POLine->Total_Amount . "',
assetid='" . $POLine->AssetID . "',
conversionfactor = '" . $POLine->ConversionFactor . "'
WHERE podetailitem='" . $POLine->PODetailRec . "'";
@@ -540,19 +485,9 @@
0,
$GLAccountName,
2,
- '',
$_POST['SuppliersUnit'],
1,
'',
- '',
- ($_POST['Qty']*$_POST['Price']),
- '',
- '',
- '',
- '',
- '',
- $_POST['Qty'],
- ($_POST['Qty']*$_POST['Price']),
$_POST['AssetID']);
include ('includes/PO_UnsetFormVbls.php');
}
@@ -592,8 +527,6 @@
stockid,
units,
decimalplaces,
- kgs,
- netweight,
stockact,
accountname
FROM stockmaster INNER JOIN stockcategory
@@ -612,12 +545,10 @@
conversionfactor,
supplierdescription,
suppliersuom,
- unitname,
suppliers_partno,
leadtime,
MAX(purchdata.effectivefrom) AS latesteffectivefrom
- FROM purchdata LEFT JOIN unitsofmeasure
- ON purchdata.suppliersuom=unitsofmeasure.unitid
+ FROM purchdata
WHERE purchdata.supplierno = '" . $_SESSION['PO'.$identifier]->SupplierID . "'
AND purchdata.effectivefrom <='" . Date('Y-m-d') . "'
AND purchdata.stockid = '". $ItemCode . "'
@@ -625,7 +556,6 @@
purchdata.conversionfactor,
purchdata.supplierdescription,
purchdata.suppliersuom,
- unitsofmeasure.unitname,
purchdata.suppliers_partno,
purchdata.leadtime";
@@ -637,14 +567,14 @@
$PurchPrice = $PurchRow['price']/$PurchRow['conversionfactor'];
$ConversionFactor = $PurchRow['conversionfactor'];
$SupplierDescription = $PurchRow['suppliers_partno'] .' - ' . $PurchRow['supplierdescription'];
- $SuppliersUnitOfMeasure = $PurchRow['unitname'];
+ $SuppliersUnitOfMeasure = $PurchRow['suppliersuom'];
$SuppliersPartNo = $PurchRow['suppliers_partno'];
$LeadTime = $PurchRow['leadtime'];
} else { // no purchasing data setup
$PurchPrice = 0;
$ConversionFactor = 1;
$SupplierDescription = $ItemRow['description'];
- $SuppliersUnitOfMeasure = $ItemRow['units'];
+ $SuppliersUnitOfMeasure = $ItemRow['unitname'];
$SuppliersPartNo = '';
$LeadTime = 1;
}
@@ -666,19 +596,11 @@
0,
$Itemrow['accountname'],
$ItemRow['decimalplaces'],
- $ItemCode,
$SuppliersUnitOfMeasure,
$ConversionFactor,
$LeadTime,
- $SuppliersPartNo,
- $Quantity*$PurchPrice,
- '',
- 0,
- $ItemRow['netweight'],
- $ItemRow['kgs'],
- '',
- $Quantity,
- $Quantity*$PurchPrice );
+ $SuppliersPartNo
+ );
} else { //no rows returned by the SQL to get the item
prnMsg (_('The item code') . ' ' . $ItemCode . ' ' . _('does not exist in the database and therefore cannot be added to the order'),'error');
if ($debug==1){
@@ -711,15 +633,14 @@
echo '<tr>
<th>' . _('Item Code') . '</th>
<th>' . _('Description') . '</th>
- <th>' . _('Weight') . '</th>
<th>' . _('Quantity Our Units') . '</th>
<th>' . _('Our Unit') .'</th>
<th>' . _('Price Our Units') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th>
<th>' . _('Unit Conversion Factor') . '</th>
- <th>' . _('Quantity Supplier Units') . '</th>
+ <th>' . _('Order Quantity') . '<br />' . _('Supplier Units') . '</th>
<th>' . _('Supplier Unit') . '</th>
- <th>' . _('Price Supp Units') . ' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th>
- <th>' . _('Subtotal') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th>
+ <th>' . _('Order Price') . '<br />' . _('Supp Units') . ' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th>
+ <th>' . _('Sub-Total') .' ('.$_SESSION['PO'.$identifier]->CurrCode. ')</th>
<th>' . _('Deliver By') .'</th>
</tr>';
@@ -749,7 +670,6 @@
echo '<td>' . $POLine->StockID . '</td>
<td>' . $POLine->ItemDescription . '</td>
- <td><input type="text" class="number" name="NetWeight' . $POLine->LineNo . '" size="8" value="' . $POLine->NetWeight . '"></td>
<td class="number">' . number_format($POLine->Quantity,$POLine->DecimalPlaces) . '</td>
<td>' . $POLine->Units . '</td>
<td class="number">' . $DisplayPrice . '</td>
@@ -759,7 +679,7 @@
<td><input type="text" class="number" name="SuppPrice' . $POLine->LineNo . '" size="10" value="' .number_format(($POLine->Price *$POLine->ConversionFactor),2) .'"></td>
<td class="number">' . $DisplayLineTotal . '</td>
<td><input type="text" class="date" alt="' .$_SESSION['DefaultDateFormat'].'" name="ReqDelDate' . $POLine->LineNo.'" size="10" value="' .$POLine->ReqDelDate .'"></td>
- <td><a href="' . $_SERVER['PHP_SELF'] . '?' . SID . 'identifier='.$identifier. '&Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td></tr>';
+ <td><a href="' . $_SERVER['PHP_SELF'] . '?identifier='.$identifier. '&Delete=' . $POLine->LineNo . '">' . _('Delete') . '</a></td></tr>';
$_SESSION['PO'.$identifier]->Total = $_SESSION['PO'.$identifier]->Total + $LineTotal;
}
}
@@ -777,14 +697,15 @@
if (isset($_POST['NonStockOrder'])) {
- echo '<br /><table class=selection><tr><td>' . _('Item Description') . '</td>';
+ echo '<br /><table class="selection"><tr>
+ <td>' . _('Item Description') . '</td>';
echo '<td><input type=text name=ItemDescription size=40></td></tr>';
echo '<tr><td>' . _('General Ledger Code') . '</td>';
echo '<td><select name="GLCode">';
- $sql='SELECT accountcode,
+ $sql="SELECT accountcode,
accountname
FROM chartmaster
- ORDER BY accountcode ASC';
+ ORDER BY accountcode ASC";
$result=DB_query($sql, $db);
while ($myrow=DB_fetch_array($result)) {
@@ -793,7 +714,7 @@
echo '</select></td></tr>';
echo '<tr><td>'._('OR Asset ID'). '</td>
<td><select name="AssetID">';
- $AssetsResult = DB_query('SELECT assetid, description, datepurchased FROM fixedassets ORDER BY assetid DESC',$db);
+ $AssetsResult = DB_query("SELECT assetid, description, datepurchased FROM fixedassets ORDER BY assetid DESC",$db);
echo '<option selected value="Not an Asset">' . _('Not an Asset') . '</option>';
while ($AssetRow = DB_fetch_array($AssetsResult)){
if ($AssetRow['datepurchased']=='0000-00-00'){
@@ -831,42 +752,26 @@
$sql = "SELECT stockmaster.stockid,
stockmaster.description,
- stockmaster.units,
- purchdata.conversionfactor,
- unitsofmeasure.unitname
+ stockmaster.units
FROM stockmaster INNER JOIN stockcategory
ON stockmaster.categoryid=stockcategory.categoryid
- LEFT JOIN purchdata
- ON stockmaster.stockid=purchdata.stockid
- LEFT JOIN unitsofmeasure
- ON unitsofmeasure.unitid=purchdata.suppliersuom
WHERE stockmaster.mbflag<>'D'
AND stockmaster.mbflag<>'K'
AND stockmaster.mbflag<>'G'
AND stockmaster.discontinued<>1
AND stockmaster.description " . LIKE . " '" . $SearchString ."'
- AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."'
- OR purchdata.supplierno IS NULL)
ORDER BY stockmaster.stockid
LIMIT " .$_SESSION['DefaultDisplayRecordsMax'];
} else {
$sql = "SELECT stockmaster.stockid,
stockmaster.description,
- stockmaster.units,
- purchdata.conversionfactor,
- unitsofmeasure.unitname
+ stockmaster.units
FROM stockmaster INNER JOIN stockcategory
ON stockmaster.categoryid=stockcategory.categoryid
- LEFT JOIN purchdata
- ON stockmaster.stockid=purchdata.stockid
- LEFT JOIN unitsofmeasure
- ON unitsofmeasure.unitid=purchdata.suppliersuom
WHERE stockmaster.mbflag<>'D'
AND stockmaster.mbflag<>'K'
AND stockmaster.mbflag<>'G'
AND stockmaster.discontinued<>1
- AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."'
- OR purchdata.supplierno IS NULL)
AND stockmaster.description " . LIKE . " '". $SearchString ."'
AND stockmaster.categoryid='" . $_POST['StockCat'] . "'
ORDER BY stockmaster.stockid
@@ -880,42 +785,26 @@
if ($_POST['StockCat']=='All'){
$sql = "SELECT stockmaster.stockid,
stockmaster.description,
- stockmaster.units,
- purchdata.conversionfactor,
- unitsofmeasure.unitname
+ stockmaster.units
FROM stockmaster INNER JOIN stockcategory
ON stockmaster.categoryid=stockcategory.categoryid
- LEFT JOIN purchdata
- ON stockmaster.stockid=purchdata.stockid
- LEFT JOIN unitsofmeasure
- ON unitsofmeasure.unitid=purchdata.suppliersuom
WHERE stockmaster.mbflag<>'D'
AND stockmaster.mbflag<>'K'
AND stockmaster.mbflag<>'G'
AND stockmaster.discontinued<>1
- AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."'
- OR purchdata.supplierno IS NULL)
AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "'
ORDER BY stockmaster.stockid
LIMIT ".$_SESSION['DefaultDisplayRecordsMax'];
} else {
$sql = "SELECT stockmaster.stockid,
stockmaster.description,
- stockmaster.units,
- purchdata.conversionfactor,
- unitsofmeasure.unitname
+ stockmaster.units
FROM stockmaster INNER JOIN stockcategory
ON stockmaster.categoryid=stockcategory.categoryid
- LEFT JOIN purchdata
- ON stockmaster.stockid=purchdata.stockid
- LEFT JOIN unitsofmeasure
- ON unitsofmeasure.unitid=purchdata.suppliersuom
WHERE stockmaster.mbflag<>'D'
AND stockmaster.mbflag<>'K'
AND stockmaster.mbflag<>'G'
and stockmaster.discontinued<>1
- AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."'
- OR purchdata.supplierno IS NULL)
AND stockmaster.stockid " . LIKE . " '" . $_POST['StockCode'] . "'
AND stockmaster.categoryid='" . $_POST['StockCat'] . "'
ORDER BY stockmaster.stockid
@@ -926,41 +815,25 @@
if ($_POST['StockCat']=='All'){
$sql = "SELECT stockmaster.stockid,
stockmaster.description,
- stockmaster.units,
- purchdata.conversionfactor,
- unitsofmeasure.unitname
+ stockmaster.units
FROM stockmaster INNER JOIN stockcategory
ON stockmaster.categoryid=stockcategory.categoryid
- LEFT JOIN purchdata
- ON stockmaster.stockid=purchdata.stockid
- LEFT JOIN unitsofmeasure
- ON unitsofmeasure.unitid=purchdata.suppliersuom
WHERE stockmaster.mbflag<>'D'
AND stockmaster.mbflag<>'K'
AND stockmaster.mbflag<>'G'
AND stockmaster.discontinued<>1
- AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."'
- OR purchdata.supplierno IS NULL)
ORDER BY stockmaster.stockid
LIMIT " . $_SESSION['DefaultDisplayRecordsMax'];
} else {
$sql = "SELECT stockmaster.stockid,
stockmaster.description,
- stockmaster.units,
- purchdata.conversionfactor,
- unitsofmeasure.unitname
+ stockmaster.units
FROM stockmaster INNER JOIN stockcategory
ON stockmaster.categoryid=stockcategory.categoryid
- LEFT JOIN purchdata
- ON stockmaster.stockid=purchdata.stockid
- LEFT JOIN unitsofmeasure
- ON unitsofmeasure.unitid=purchdata.suppliersuom
WHERE stockmaster.mbflag<>'D'
AND stockmaster.mbflag<>'K'
AND stockmaster.mbflag<>'G'
AND stockmaster.discontinued<>1
- AND (purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID."'
- OR purchdata.supplierno IS NULL)
AND stockmaster.categoryid='" . $_POST['StockCat'] . "'
ORDER BY stockmaster.stockid
LIMIT " . $_SESSION['DefaultDisplayRecordsMax'];
@@ -994,11 +867,16 @@
$DbgMsg = _('The SQL used to retrieve the category details but failed was');
$result1 = DB_query($sql,$db,$ErrMsg,$DbgMsg);
- echo '<table class=selection><tr><th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>';
+ echo '<table class=selection>
+ <tr>
+ <th colspan=3><font size=3 color=blue>'. _('Search For Stock Items') . '</th>';
- echo ':</font></tr><tr><td><select name="StockCat">';
+ echo ':</font>
+ </tr>
+ <tr><td><select name="StockCat">';
- echo '<option selected value="All">' . _('All');
+ echo '<option selected value="All">' . _('All') . '</option>';
+
while ($myrow1 = DB_fetch_array($result1)) {
if (isset($_POST['StockCat']) and $_POST['StockCat']==$myrow1['categoryid']){
echo '<option selected value="'. $myrow1['categoryid'] . '">' . $myrow1['categorydescription'] . '</option>';
@@ -1019,16 +897,17 @@
}
echo '</select></td>
- <td>' . _('Enter text extracts in the description') . ":</td>
- <td><input type='text' name='Keywords' size=20 maxlength=25 value='" . $_POST['Keywords'] . "'></td></tr>
+ <td>' . _('Enter text extracts in the description') . ':</td>
+ <td><input type="text" name="Keywords" size=20 maxlength=25 value="' . $_POST['Keywords'] . '"></td></tr>
<tr><td></td>
- <td><font size=3><b>" . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') .
- ":</td>
- <td><input type='text' name='StockCode' size=15 maxlength=18 value='" . $_POST['StockCode'] . "'></td>
+ <td><font size=3><b>' . _('OR') . ' </b></font>' . _('Enter extract of the Stock Code') . ':</td>
+ <td><input type="text" name="StockCode" size=15 maxlength=18 value="' . $_POST['StockCode'] . '"></td>
</tr>
<tr><td></td>
- <td><font size=3><b>" . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php?">' . _('Create a New Stock Item') . '</a></td></tr>
- </table><br />
+ <td><font size=3><b>' . _('OR') . ' </b></font><a target="_blank" href="'.$rootpath.'/Stocks.php">' . _('Create a New Stock Item') . '</a></td></tr>
+ </table>
+ <br />
+
<div class="centre"><input type="submit" name="Search" value="' . _('Search Now') . '">
<input type="submit" name="NonStockOrder" value="' . _('Order a non stock item') . '">
</div><br />';
@@ -1070,9 +949,19 @@
$ImageSource = '<i>'._('No Image').'</i>';
}
- if (strlen($myrow['unitname'])>0) {
- $OrderUnits=$myrow['unitname'];
- $ConversionFactor =$myrow['conversionfactor'];
+ /*Get conversion factor and supplier units if any */
+ $sql = "SELECT purchdata.conversionfactor,
+ purchdata.suppliersuom
+ FROM purchdata
+ WHERE purchdata.supplierno='" . $_SESSION['PO'.$identifier]->SupplierID . "'
+ AND purchdata.stockid='" . $myrow['stockid'] . "'";
+ $ErrMsg = _('Could not retrieve the purchasing data for the item');
+ $PurchDataResult = DB_query($sql,$db,$ErrMsg);
+
+ if (DB_num_rows($PurchDataResult)>0) {
+ $PurchDataRow = DB_fetch_array($PurchDataResult);
+ $OrderUnits=$PurchDataRow['suppliersuom'];
+ $ConversionFactor =$PurchDataRow['conversionfactor'];
} else {
$OrderUnits=$myrow['units'];
$ConversionFactor =1;
Modified: trunk/PO_PDFPurchOrder.php
===================================================================
--- trunk/PO_PDFPurchOrder.php 2011-04-18 00:09:23 UTC (rev 4553)
+++ trunk/PO_PDFPurchOrder.php 2011-04-18 07:49:36 UTC (rev 4554)
@@ -1,6 +1,7 @@
<?php
+
/* $Id$*/
-//$PageSecurity = 2;
+
include('includes/session.inc');
include('includes/SQL_CommonFunctions.inc');
include('includes/DefinePOClass.php');
@@ -69,31 +70,31 @@
$ErrMsg = _('There was a problem retrieving the purchase order header details for Order Number'). ' ' . $OrderNo .
' ' . _('from the database');
$sql = "SELECT purchorders.supplierno,
- suppliers.suppname,
- suppliers.address1,
- suppliers.address2,
- suppliers.address3,
- suppliers.address4,
- purchorders.comments,
- purchorders.orddate,
- purchorders.rate,
- purchorders.dateprinted,
- purchorders.deladd1,
- purchorders.deladd2,
- purchorders.deladd3,
- purchorders.deladd4,
- purchorders.deladd5,
- purchorders.deladd6,
- purchorders.allowprint,
- purchorders.requisitionno,
- purchorders.initiator,
- purchorders.paymentterms,
- suppliers.currcode,
- purchorders.status,
- purchorders.stat_comment
- FROM purchorders INNER JOIN suppliers
- ON purchorders.supplierno = suppliers.supplierid
- WHERE purchorders.orderno='" . $OrderNo ."'";
+ suppliers.suppname,
+ suppliers.address1,
+ suppliers.address2,
+ suppliers.address3,
+ suppliers.address4,
+ purchorders.comments,
+ purchorders.orddate,
+ purchorders.rate,
+ purchorders.dateprinted,
+ purchorders.deladd1,
+ purchorders.deladd2,
+ purchorders.deladd3,
+ purchorders.deladd4,
+ purchorders.deladd5,
+ purchorders.deladd6,
+ purchorders.allowprint,
+ purchorders.requisitionno,
+ purchorders.initiator,
+ purchorders.paymentterms,
+ suppliers.currcode,
+ purchorders.status,
+ purchorders.stat_comment
+ FROM purchorders INNER JOIN suppliers
+ ON purchorders.supplierno = suppliers.supplierid
+ WHERE purchorders.orderno='" . $OrderNo ."'";
$result=DB_query($sql,$db, $ErrMsg);
if (DB_num_rows($result)==0){ /*There is no order header returned */
$title = _('Print Purchase Order Error');
@@ -101,16 +102,16 @@
echo '<div class="centre"><br /><br /><br />';
prnMsg( _('Unable to Locate Purchase Order Number') . ' : ' . $OrderNo . ' ', 'error');
echo '<br />
- <br />
- <br />
- <table class="table_index">
- <tr><td class="menu_group_item">
- <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li>
- <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li>
- </td>
- </tr>
- </table>
- </div><br /><br /><br />';
+ <br />
+ <br />
+ <table class="table_index">
+ <tr><td class="menu_group_item">
+ <li><a href="'. $rootpath . '/PO_SelectOSPurchOrder.php?'.SID .'">' . _('Outstanding Purchase Orders') . '</a></li>
+ <li><a href="'. $rootpath . '/PO_SelectPurchOrder.php?'. SID .'">' . _('Purchase Order Inquiry') . '</a></li>
+ </td>
+ </tr>
+ </table>
+ </div><br /><br /><br />';
include('includes/footer.inc');
exit();
} elseif (DB_num_rows($result)==1){ /*There is only one order header returned (as it should be!)*/
@@ -192,17 +193,17 @@
$ErrMsg = _('There was a problem retrieving the line details for order number') . ' ' . $OrderNo . ' ' .
_('from the database');
$sql = "SELECT itemcode,
- deliverydate,
- itemdescription,
- unitprice,
- suppliersunit,
- quantityord,
- decimalplaces,
- conversionfactor,
- suppliers_partno
- FROM purchorderdetails LEFT JOIN stockmaster
- ON purchorderdetails.itemcode=stockmaster.stockid
- WHERE orderno ='" . $OrderNo ."'";
+ deliverydate,
+ itemdescription,
+ unitprice,
+ suppliersunit,
+ quantityord,
+ decimalplaces,
+ conversionfactor,
+ suppliers_partno
+ FROM purchorderdetails LEFT JOIN stockmaster
+ ON purchorderdetails.itemcode=stockmaster.stockid
+ WHERE orderno ='" . $OrderNo ."'";
$result=DB_query($sql,$db);
}
if ($OrderNo=='Preview' or DB_num_rows($result)>0){
@@ -210,7 +211,8 @@
include('includes/PO_PDFOrderPageHeader.inc');
$YPos=$Page_Height - $FormDesign->Data->y;
$OrderTotal = 0;
- while ((isset($OrderNo) and $OrderNo=='Preview') or (isset($result) and $POLine=DB_fetch_array($result))) {
+ while ((isset($OrderNo) and $OrderNo=='Preview')
+ OR (isset($result) and $POLine=DB_fetch_array($result))) {
/* If we are previewing the order then fill the
* order line with dummy data */
if ($OrderNo=='Preview') {
@@ -306,33 +308,33 @@
$StatusComment = date($_SESSION['DefaultDateFormat']) .' - ' . _('Printed by') . '<a href="mailto:'.$_SESSION['UserEmail'] .'">'.$_SESSION['UsersRealName']. '</a><br />' . $POHeader['stat_comment'];
$sql = "UPDATE purchorders SET allowprint = 0,
- dateprinted = '" . Date('Y-m-d') . "',
- status = 'Printed',
- stat_comment = '" . $StatusComment . "'
- WHERE purchorders.orderno = '" . $OrderNo."'";
+ dateprinted = '" . Date('Y-m-d') . "',
+ status = 'Printed',
+ stat_comment = '" . $StatusComment . "'
+ WHERE purchorders.orderno = '" . $OrderNo."'";
$result = DB_query($sql,$db);
}
} /* There was enough info to either print or email the purchase order */
else { /*the user has just gone into the page need to ask the question whether to print the order or email it to the supplier */
include ('includes/header.inc');
- echo '<form action="' . $_SERVER['PHP_SELF'] . '?' . SID . '" method=post>';
+ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method=post>';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
if ($ViewingOnly==1){
- echo '<input type=hidden name="ViewingOnly" VALUE=1>';
+ echo '<input type=hidden name="ViewingOnly" value=1>';
}
echo '<br /><br />';
- echo '<input type=hidden name="OrderNo" VALUE="'. $OrderNo. '">';
+ echo '<input type=hidden name="OrderNo" value="'. $OrderNo. '">';
echo '<table><tr><td>'. _('Print or Email the Order'). '</td><td>
<select name="PrintOrEmail">';
if (!isset($_POST['PrintOrEmail'])){
$_POST['PrintOrEmail'] = 'Print';
}
if ($_POST['PrintOrEmail']=='Print'){
- echo '<option selected VALUE="Print">'. _('Print');
- echo '<option VALUE="Email">' . _('Email');
+ echo '<option selected value="Print">'. _('Print');
+ echo '<option value="Email">' . _('Email');
} else {
- echo '<option VALUE="Print">'. _('Print');
- echo '<option selected VALUE="Email">'. _('Email');
+ echo '<option value="Print">'. _('Print');
+ echo '<option selected value="Email">'. _('Email');
}
echo '</select></td></tr>';
echo '<tr><td>'. _('Show Amounts on the Order'). '</td><td>
@@ -341,29 +343,29 @@
$_POST['ShowAmounts'] = 'Yes';
}
if ($_POST['ShowAmounts']=='Yes'){
- echo '<option selected VALUE="Yes">'. _('Yes');
- echo '<option VALUE="No">' . _('No');
+ echo '<option selected value="Yes">'. _('Yes');
+ echo '<option value="No">' . _('No');
} else {
- echo '<option VALUE="Yes">'. _('Yes');
- echo '<option selected VALUE="No">'. _('No');
+ echo '<option value="Yes">'. _('Yes');
+ echo '<option selected value="No">'. _('No');
}
echo '</select></td></tr>';
if ($_POST['PrintOrEmail']=='Email'){
$ErrMsg = _('There was a problem retrieving the contact details for the supplier');
$SQL = "SELECT suppliercontacts.contact,
- suppliercontacts.email
- FROM suppliercontacts INNER JOIN purchorders
- ON suppliercontacts.supplierid=purchorders.supplierno
- WHERE purchorders.orderno='".$OrderNo."'";
+ suppliercontacts.email
+ FROM suppliercontacts INNER JOIN purchorders
+ ON suppliercontacts.supplierid=purchorders.supplierno
+ WHERE purchorders.orderno='".$OrderNo."'";
$ContactsResult=DB_query($SQL,$db, $ErrMsg);
if (DB_num_rows($ContactsResult)>0){
echo '<tr><td>'. _('Email to') .':</td><td><select name="EmailTo">';
while ($ContactDetails = DB_fetch_array($ContactsResult)){
if (strlen($ContactDetails['email'])>2 AND strpos($ContactDetails['email'],'@')>0){
if ($_POST['EmailTo']==$ContactDetails['email']){
- echo '<option selected VALUE="' . $ContactDetails['email'] . '">' . $ContactDetails['Contact'] . ' - ' . $ContactDetails['email'] . '</option>';
+ echo '<option selected value="' . $ContactDetails['email'] . '">' . $ContactDetails['Contact'] . ' - ' . $ContactDetails['email'] . '</option>';
} else {
- echo '<option VALUE="' . $ContactDetails['email'] . '">' . $ContactDetails['contact'] . ' - ' . $ContactDetails['email'] . '</option>';
+ echo '<option value="' . $ContactDetails['email'] . '">' . $ContactDetails['contact'] . ' - ' . $ContactDetails['email'] . '</option>';
}
}
}
@@ -377,7 +379,7 @@
} else {
echo '</table>';
}
- echo '<br /><div class="centre"><input type=submit name="DoIt" VALUE="' . _('OK') . '"></div>';
+ echo '<br /><div class="centre"><input type=submit name="DoIt" value="' . _('OK') . '"></div>';
echo '</form>';
include('includes/footer.inc');
}
Modified: trunk/PurchData.php
===================================================================
--- trunk/PurchData.php 2011-04-18 00:09:23 UTC (rev 4553)
+++ trunk/PurchData.php 2011-04-18 07:49:36 UTC (rev 4554)
@@ -32,34 +32,42 @@
}
if ((isset($_POST['AddRecord']) OR isset($_POST['UpdateRecord'])) AND isset($SupplierID)) { /*Validate Inputs */
- $InputError = 0; /*Start assuming the best */
- if ($StockID == '' OR !isset($StockID)) {
- $InputError = 1;
- prnMsg(_('There is no stock item set up enter the stock code or select a stock item using the search page'), 'error');
- }
- if (!is_numeric($_POST['Price'])) {
- $InputError = 1;
- unset($_POST['Price']);
- prnMsg(_('The price entered was not numeric and a number is expected. No changes have been made to the database'), 'error');
- }
- if ($_POST['Price'] == 0) {
- prnMsg(_('The price entered is zero') . ' ' . _('Is this intentional?'), 'warn');
- }
- if (!is_numeric($_POST['LeadTime'])) {
- $InputError = 1;
- unset($_POST['LeadTime']);
- prnMsg(_('The lead time entered was not numeric a number of days is expected no changes have been made to the database'), 'error');
- }
- if (!is_numeric($_POST['MinOrderQty'])) {
- $InputError = 1;
- unset($_POST['MinOrderQty']);
- prnMsg(_('The minimum order quantity was not numeric and a number is expected no changes have been made to the database'), 'error');
- }
- if (!is_numeric($_POST['ConversionFactor'])) {
- $InputError = 1;
- unset($_POST['ConversionFactor']);
- prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br />' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br /><br />' . _('No changes will be made to the database'), 'error');
- }
+ $InputError = 0; /*Start assuming the best */
+ if ($StockID == '' OR !isset($StockID)) {
+ $InputError = 1;
+ prnMsg(_('There is no stock item set up enter the stock code or select a stock item using the search page'), 'error');
+ }
+ if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price'])))) {
+ $InputError = 1;
+ unset($_POST['Price']);
+ prnMsg(_('The price entered was not numeric and a number is expected. No changes have been made to the database'), 'error');
+ } else {
+ $_POST['Price'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['Price']));
+ }
+ if ($_POST['Price'] == 0) {
+ prnMsg(_('The price entered is zero') . ' ' . _('Is this intentional?'), 'warn');
+ }
+ if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['LeadTime'])))) {
+ $InputError = 1;
+ unset($_POST['LeadTime']);
+ prnMsg(_('The lead time entered was not numeric a number of days is expected no changes have been made to the database'), 'error');
+ } else {
+ $_POST['LeadTime'] = doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['LeadTime']));
+ }
+ if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['MinOrderQty'])))) {
+ $InputError = 1;
+ unset($_POST['MinOrderQty']);
+ prnMsg(_('The minimum order quantity was not numeric and a number is expected no changes have been made to the database'), 'error');
+ } else {
+ $_POST['MinOrderQty'] =doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['MinOrderQty']));
+ }
+ if (!is_numeric(doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor'])))) {
+ $InputError = 1;
+ unset($_POST['ConversionFactor']);
+ prnMsg(_('The conversion factor entered was not numeric') . ' (' . _('a number is expected') . '). ' . _('The conversion factor is the number which the price must be divided by to get the unit price in our unit of measure') . '. <br />' . _('E.g.') . ' ' . _('The supplier sells an item by the tonne and we hold stock by the kg') . '. ' . _('The suppliers price must be divided by 1000 to get to our cost per kg') . '. ' . _('The conversion factor to enter is 1000') . '. <br /><br />' . _('No changes will be made to the database'), 'error');
+ } else {
+ $_POST['ConversionFactor'] =doubleval(str_replace($locale_info['thousands_sep'],'',$_POST['ConversionFactor']));
+ }
if ($InputError == 0 AND isset($_POST['AddRecord'])) {
$sql = "INSERT INTO purchdata (supplierno,
stockid,
@@ -137,23 +145,21 @@
if (!isset($_GET['Edit'])) {
echo '<p class="page_title_text"><img src="' . $rootpath . '/css/' . $theme . '/images/maintenance.png" title="' . _('Search') . '" alt="" />' . ' ' . $title . ' ' . _('For Stock Code') . ' - ' . $StockID . '</p><br />';
$sql = "SELECT purchdata.supplierno,
- suppliers.suppname,
- purchdata.price,
- suppliers.currcode,
- purchdata.effectivefrom,
- unitsofmeasure.unitname,
- purchdata.supplierdescription,
- purchdata.leadtime,
- purchdata.suppliers_partno,
- purchdata.minorderqty,
- purchdata.preferred,
- purchdata.conversionfactor
- FROM purchdata INNER JOIN suppliers
- ON purchdata.supplierno=suppliers.supplierid
- LEFT JOIN unitsofmeasure
- ON purchdata.suppliersuom=unitsofmeasure.unitid
- WHERE purchdata.stockid = '" . $StockID . "'
- ORDER BY purchdata.effectivefrom DESC";
+ suppliers.suppname,
+ purchdata.price,
+ suppliers.currcode,
+ purchdata.effectivefrom,
+ purchdata.suppliersuom,
+ purchdata.supplierdescription,
+ purchdata.leadtime,
+ purchdata.suppliers_partno,
+ purchdata.minorderqty,
+ purchdata.preferred,
+ purchdata.conversionfactor
+ FROM purchdata INNER JOIN suppliers
+ ON purchdata.supplierno=suppliers.supplierid
+ WHERE purchdata.stockid = '" . $StockID . "'
+ ORDER BY purchdata.effectivefrom DESC";
$ErrMsg = _('The supplier purchasing details for the selected part could not be retrieved because');
$PurchDataResult = DB_query($sql, $db, $ErrMsg);
if (DB_num_rows($PurchDataResult) == 0 and $StockID != '') {
@@ -206,7 +212,7 @@
</tr>",
$myrow['suppname'],
number_format($myrow['price'], 3),
- $myrow['unitname'],
+ $myrow['suppliersuom'],
$myrow['conversionfactor'],
number_format($myrow['price']/$myrow['conversionfactor'],2),
$myrow['currcode'],
@@ -260,7 +266,7 @@
echo '<td>' . _('Text in Supplier') . ' <b>' . _('CODE') . '</b>:</font></td>';
echo '<td><input type="Text" name="SupplierCode" size=15 maxlength=18></td>';
echo '</tr></table><br />';
- echo '<div class="centre"><input type=submit name="SearchSupplier" VALUE="' . _('Find Suppliers Now') . '"></div></form>';
+ echo '<div class="centre"><input type=submit name="SearchSupplier" value="' . _('Find Suppliers Now') . '"></div></form>';
include ('includes/footer.inc');
exit;
};
@@ -347,13 +353,20 @@
echo '<tr class="OddTableRows">';
$k++;
}
- printf("<td><font size=1><input type=submit name='SupplierID' VALUE='%s'</font></td>
- <td><font size=1>%s</font></td>
- <td><font size=1>%s</font></td>
- <td><font size=1>%s</font></td>
- <td><font size=1>%s</font></td>
- <td><font size=1>%s</font></td>
- </tr>", $myrow['supplierid'], $myrow['suppname'], $myrow['currcode'], $myrow['address1'], $myrow['address2'], $myrow['address3']);
+ printf('<td><font size=1><input type="submit" name="SupplierID" value="%s"</font></td>
+ <td><font size=1>%s</font></td>
+ <td><font size=1>%s</font></td>
+ <td><font size=1>%s</font></td>
+ <td><font size=1>%s</font></td>
+ <td><font size=1>%s</font></td>
+ </tr>',
+ $myrow['supplierid'],
+ $myrow['suppname'],
+ $myrow['currcode'],
+ $myrow['address1'],
+ $myrow['address2'],
+ $myrow['address3']);
+
echo '<input type=hidden name=StockID value="' . $StockID . '">';
echo '<input type=hidden name=StockUOM value="' . $StockUOM . '">';
@@ -405,17 +418,18 @@
$_POST['SupplierCode'] = $myrow['suppliers_partno'];
$StockUOM=$myrow['units'];
}
- echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post"><table class=selection>';
+ echo '<form action="' . $_SERVER['PHP_SELF'] . '" method="post">
+ <table class="selection">';
echo '<input type="hidden" name="FormID" value="' . $_SESSION['FormID'] . '" />';
if (!isset($SupplierID)) {
$SupplierID = '';
}
if (isset($_GET['Edit'])) {
echo '<tr><td>' . _('Supplier Name') . ':</td>
- <td><input type=hidden name="SupplierID" VALUE="' . $SupplierID . '">' . $SupplierID . ' - ' . $SuppName . '<input type=hidden name="WasEffectiveFrom" VALUE="' . $myrow['effectivefrom'] . '"></td></tr>';
+ <td><input type=hidden name="SupplierID" value="' . $SupplierID . '">' . $SupplierID . ' - ' . $SuppName . '<input type=hidden name="WasEffectiveFrom" value="' . $myrow['effectivefrom'] . '"></td></tr>';
} else {
echo '<tr><td>' . _('Supplier Name') . ':</td>
- <input type=hidden name="SupplierID" maxlength=10 size=11 VALUE="' . $SupplierID . '">';
+ <input type=hidden name="SupplierID" maxlength=10 size=11 value="' . $SupplierID . '">';
if ($SupplierID!='') {
echo '<td>'.$SuppName;
}
@@ -426,7 +440,7 @@
}
echo '</td></tr>';
}
- echo '<td><input type=hidden name="StockID" maxlength=10 size=11 VALUE="' . $StockID . '">';
+ echo '<td><input type=hidden name="StockID" maxlength=10 size=11 value="' . $StockID . '">';
if (!isset($CurrCode)) {
$CurrCode = '';
}
@@ -449,57 +463,48 @@
$_POST['MinOrderQty'] = '1';
}
echo '<tr><td>' . _('Currency') . ':</td>
- <td><input type=hidden name="CurrCode" . VALUE="' . $CurrCode . '">' . $CurrCode . '</td></tr>';
+ <td><input type=hidden name="CurrCode" . value="' . $CurrCode . '">' . $CurrCode . '</td></tr>';
echo '<tr><td>' . _('Price') . ' (' . _('in Supplier Currency') . '):</td>
- <td><input type="text" class="number" name="Price" maxlength=12 size=12 VALUE=' . number_format($_POST['Price'], $myrow['decimalplaces'] ,'.','') . '></td></tr>';
+ <td><input type="text" class="number" name="Price" maxlength=12 size=12 value=' . number_format($_POST['Price'], $myrow['decimalplaces']) . '></td></tr>';
echo '<tr><td>' . _('Date Updated') . ':</td>
- <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength=10 size=11 VALUE="' . $_POST['EffectiveFrom'] . '"></td></tr>';
+ <td><input type="text" class="date" alt="' . $_SESSION['DefaultDateFormat'] . '" name="EffectiveFrom" maxlength=10 size=11 value="' . $_POST['EffectiveFrom'] . '"></td></tr>';
echo '<tr><td>' . _('Our Unit of Measure') . ':</td>';
if (isset($SupplierID)) {
echo '<td>' . $StockUOM . '</td></tr>';
}
echo '<tr><td>' . _('Suppliers Unit of Measure') . ':</td>';
- echo '<td><select name="SuppliersUOM">';
- $sql = 'SELECT * FROM unitsofmeasure';
- $result = DB_query($sql, $db);
- while ($myrow = DB_fetch_array($result)) {
- if ($_POST['SuppliersUOM'] == $myrow['unitid']) {
- echo '<option selected value="' . $myrow['unitid'] . '">' . $myrow['unitname'] . '</option>';
- } else {
- echo '<option value="' . $myrow['unitid'] . '">' . $myrow['unitname'] . '</option>';
- }
- }
- echo '</td></tr>';
+ echo '<td><input type="text" name="SuppliersUOM" size="20" maxlength="20" value ="' . $_POST['SuppliersUOM'] . '"/>';
+ echo '</td></tr>';
if (!isset($_POST['ConversionFactor']) OR $_POST['ConversionFactor'] == "") {
$_POST['ConversionFactor'] = 1;
}
echo '<tr><td>' . _('Conversion Factor (to our UOM)') . ':</td>
- <td><input type=text class=number name="ConversionFactor" maxlength=12 size=12 VALUE=' . $_POST['ConversionFactor'] . '></td></tr>';
+ <td><input type=text class=number name="ConversionFactor" maxlength=12 size=12 value=' . $_POST['ConversionFactor'] . '></td></tr>';
echo '<tr><td>' . _('Supplier Stock Code') . ':</td>
- <td><input type=text name="SupplierCode" maxlength=15 size=15 VALUE="' . $_POST['SupplierCode'] . '"></td></tr>';
+ <td><input type=text name="SupplierCode" maxlength=15 size=15 value="' . $_POST['SupplierCode'] . '"></td></tr>';
echo '<tr><td>' . _('MinOrderQty') . ':</td>
- <td><input type=text class=number name="MinOrderQty" maxlength=15 size=15 VALUE="' . $_POST['MinOrderQty'] . '"></td></tr>';
+ <td><input type=text class=number name="MinOrderQty" maxlength=15 size=15 value="' . $_POST['MinOrderQty'] . '"></td></tr>';
echo '<tr><td>' . _('Supplier Stock Description') . ':</td>
- <td><input type=text name="SupplierDescription" maxlength=50 size=51 VALUE="' . $_POST['SupplierDescription'] . '"></td></tr>';
+ <td><input type=text name="SupplierDescription" maxlength=50 size=51 value="' . $_POST['SupplierDescription'] . '"></td></tr>';
if (!isset($_POST['LeadTime']) OR $_POST['LeadTime'] == "") {
$_POST['LeadTime'] = 1;
}
echo '<tr><td>' . _('Lead Time') . ' (' . _('in days from date of order') . '):</td>
- <td><input type=text class=number name="LeadTime" maxlength=4 size=5 VALUE=' . $_POST['LeadTime'] . '></td></tr>';
+ <td><input type=text class=number name="LeadTime" maxlength=4 size=5 value=' . $_POST['LeadTime'] . '></td></tr>';
echo '<tr><td>' . _('Preferred Supplier') . ':</td>
<td><select name="Preferred">';
if ($_POST['Preferred'] == 1) {
- echo '<option selected VALUE=1>' . _('Yes') . '</option>';
- echo '<option VALUE=0>' . _('No') . '</option>';
+ echo '<option selected value=1>' . _('Yes') . '</option>';
+ echo '<option value=0>' . _('No') . '</option>';
} else {
- echo '<option VALUE=1>' . _('Yes') . '</option>';
- echo '<option selected VALUE=0>' . _('No') . '</option>';
+ echo '<option value=1>' . _('Yes') . '</option>';
+ echo '<option selected value=0>' . _('No') . '</option>';
}
echo '</select></td></tr></table><br /><div class="centre">';
if (isset($_GET['Edit'])) {
- echo '<input type=submit name="UpdateRecord" VALUE="' . _('Update') . '">';
+ echo '<input type=submit name="UpdateRecord" value="' . _('Update') . '">';
} else {
- echo '<input type=submit name="AddRecord" VALUE="' . _('Add') . '">';
+ echo '<input type=submit name="AddRecord" value="' . _('Add') . '">';
}
echo '</div>';
echo '<div class="centre">';
Modified: trunk/doc/Change.log.html
===================================================================
--- trunk/doc/Change.log.html 2011-04-18 00:09:23 UTC (rev 4553)
+++ trunk/doc/Change.log.html 2011-04-18 07:49:36 UTC (rev 4554)
@@ -1,6 +1,11 @@
<p><font SIZE=4 COLOR=BLUE><b>webERP Change Log</b></font></p>
<p />
-
+<p />
+<p>18/4/11 - Version 4.03.8 Release
+<p>
+<p>18/4/11 Phil: Update zh_HK.utf8, pt_BR.utf8, fa_IR.utf8 from launchpad translations</p>
+<p>18/4/11 Phil: Changed PurchData.php back to now have free form text entry of unit of measure - as suggested by Brian May - think it works better this way</p>
+<p>18/4/11 Phil: Removed redundant fields that are not used anywhere from DefinePOClass and the various function to add lines to purchase orders and to update purhcase order lines - netweight, cuft, kgs, itemno, total_quantity etc. all this data can be retrieved without duplication in purchorderdetails</p>
<p>16/4/11 Phil: Tim's changes in launchpad fork to 4663 - xhtml syntax fixes</p>
<p>15/4/11 Phil: Copy Exson's traditional Chinese back to zh_HK.utf8</p>
<p>11/4/11 Ricard: new pcAuthorizeExpenses.php that shows the current balance of the tab to the authorizer. Before the authorizer did not see this information.</p>
Modified: trunk/includes/ConnectDB.inc
===================================================================
--- trunk/includes/ConnectDB.inc 2011-04-18 00:09:23 UTC (rev 4553)
+++ trunk/includes/ConnectDB.inc 2011-04-18 07:49:36 UTC (rev 4554)
@@ -4,7 +4,7 @@
* this value is saved in the $_SESSION['Versionumber'] when includes/GetConfig.php is run
* if VersionNumber is < $Version then the DB update script is run */
-$Version='4.03.7'; //must update manually every time there is a DB change
+$Version='4.03.8'; //must update manually every time there is a DB change
require_once ($PathPrefix .'includes/MiscFunctions.php');
Modified: trunk/includes/DefinePOClass.php
===================================================================
--- trunk/includes/DefinePOClass.php 2011-04-18 00:09:23 UTC (rev 4553)
+++ trunk/includes/DefinePOClass.php 2011-04-18 07:49:36 UTC (rev 4554)
@@ -73,19 +73,10 @@
$QtyRecd=0,
$GLActName='',
$DecimalPlaces=2,
- $ItemNo,
$SuppliersUnit,
$ConversionFactor=1,
$LeadTime=1,
$Suppliers_PartNo='',
- $SubTotal_Amount=0,
- $Package=0,
- $PcUnit=0,
- $NetWeight=0,
- $KGs=0,
- $CuFt=0,
- $Total_Quantity=0,
- $Total_Amount=0,
$AssetID=0){
if ($Qty!=0 && isset($Qty)){
@@ -107,19 +98,10 @@
$QtyRecd,
$GLActName,
$DecimalPlaces,
- $ItemNo,
$SuppliersUnit,
$ConversionFactor,
$LeadTime,
$Suppliers_PartNo,
- $SubTotal_Amount,
- $Package,
- $PcUnit,
- $NetWeight,
- $KGs,
- $CuFt,
- $Total_Quantity,
- $Total_Amount,
$AssetID);
$this->LinesOnOrder++;
Return 1;
@@ -136,19 +118,9 @@
$ReqDelDate,
$ShiptRef,
$JobRef ,
- $ItemNo,
$SuppliersUnit,
$ConversionFactor,
- $Suppliers_PartNo,
- $SubTotal_Amount,
- $Package,
- $PcUnit,
- $NetWeight,
- $KGs,
- $CuFt,
- $Total_Quantity,
- $Total_Amount,
- $SuppUOM){
+ $Suppliers_PartNo){
$this->LineItems[$LineNo]->ItemDescription = $ItemDescription;
$this->LineItems[$LineNo]->Quantity = $Qty;
@@ -158,19 +130,9 @@
$this->LineItems[$LineNo]->ReqDelDate = $ReqDelDate;
$this->LineItems[$LineNo]->ShiptRef = $ShiptRef;
$this->LineItems[$LineNo]->JobRef = $JobRef;
- $this->LineItems[$LineNo]->ItemNo = $ItemNo;
$this->LineItems[$LineNo]->SuppliersUnit = $SuppliersUnit;
$this->LineItems[$LineNo]->ConversionFactor = $ConversionFactor;
$this->LineItems[$LineNo]->Suppliers_PartNo = $Suppliers_PartNo;
- $this->LineItems[$LineNo]->Subtotal_Amount = $SubTotal_Amount;
- $this->LineItems[$LineNo]->Package = $Package;
- $this->LineItems[$LineNo]->PcUnit = $PcUnit;
- $this->LineItems[$LineNo]->NetWeight = $NetWeight;
- $this->LineItems[$LineNo]->KGs = $KGs;
- $this->LineItems[$LineNo]->CuFt = $CuFt;
- $this->LineItems[$LineNo]->Total_Quantity = $Total_Quantity;
- $this->LineItems[$LineNo]->Total_Amount = $Total_Amount;
- $this->LineItems[$LineNo]->SuppUOM = $SuppUOM;
}
function remove_from_order(&$LineNo){
@@ -248,19 +210,10 @@
var $ShiptRef;
var $Completed;
Var $JobRef;
- Var $ItemNo;
var $ConversionFactor;
var $SuppliersUnit;
Var $Suppliers_PartNo;
- Var $SubTotal_Amount;
Var $LeadTime;
- Var $Package;
- Var $PcUnit;
- Var $NetWeight;
- Var $KGs;
- Var $CuFt;
- Var $Total_Quantity;
- Var $Total_Amount;
Var $ReceiveQty; //this receipt of stock
Var $Deleted;
Var $Controlled;
@@ -285,19 +238,10 @@
$QtyRecd,
$GLActName,
$DecimalPlaces,
- $ItemNo,
$SuppliersUnit,
$ConversionFactor,
- $Suppliers_PartNo,
- $SubTotal_Amount,
$LeadTime,
- $Package,
- $PcUnit,
- $NetWeight,
- $KGs,
- $CuFt,
- $Total_Quantity,
- $Total_Amount,
+ $Suppliers_PartNo,
$AssetID) {
/* Constructor function to add a new LineDetail object with passed params */
@@ -315,18 +259,10 @@
$this->QtyInv = $QtyInv;
$this->GLCode = $GLCode;
$this->JobRef = $JobRef;
- $this->ItemNo = $ItemNo;
$this->SuppliersUnit = $SuppliersUnit;
$this->ConversionFactor = $ConversionFactor;
$this->Suppliers_PartNo = $Suppliers_PartNo;
- $this->Subtotal_Amount = $SubTotal_Amount;
$this->LeadTime = $LeadTime;
- $this->PcUnit = $PcUnit;
- $this->NetWeight = $NetWeight;
- $this->KGs = $KGs;
- $this->CuFt = $CuFt;
- $this->Total_Quantity = $Total_Quantity;
- $this->Total_Amount = $Total_Amount;
if (is_numeric($ShiptRef)){
$this->ShiptRef = $ShiptRef;
} else {
Modified: trunk/includes/PO_ReadInOrder.inc
===================================================================
--- trunk/includes/PO_ReadInOrder.inc 2011-04-18 00:09:23 UTC (rev 4553)
+++ trunk/includes/PO_ReadInOrder.inc 2011-04-18 07:49:36 UTC (rev 4554)
@@ -140,18 +140,9 @@
purchorderdetails.completed,
purchorderdetails.jobref,
purchorderdetails.stdcostunit,
- purchorderdetails.itemno,
stockmaster.controlled,
stockmaster.serialised,
stockmaster.decimalplaces,
- purchorderdetails.subtotal_amount,
- purchorderdetails.package,
- purchorderdetails.pcunit,
- purchorderdetails.netweight,
- purchorderdetails.kgs,
- purchorderdetails.cuft,
- purchorderdetails.total_quantity,
- purchorderdetails.total_amount,
purchorderdetails.assetid,
purchorderdetails.conversionfactor,
purchorderdetails.suppliersunit,
@@ -208,19 +199,10 @@
$myrow['quantityrecd'],
$myrow['accountname'],
$myrow['decimalplaces'],
- $myrow['itemno'],
$myrow['suppliersunit'],
$myrow['conversionfactor'],
+ 1,
$myrow['suppliers_partno'],
- $myrow['subtotal_amount'],
- 0,
- $myrow['package'],
- $myrow['pcunit'],
- $myrow['netweight'],
- $myrow['kgs'],
- $myrow['cuft'],
- $myrow['total_quantity'],
- $myrow['total_amount'],
$myrow['assetid'] );
$_SESSION['PO'.$identifier]->LineItems[$_SESSION['PO'.$identifier]->LinesOnOrder]->PODetailRec = $myrow['podetailitem'];
Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.mo
===================================================================
(Binary files differ)
Modified: trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po
===================================================================
--- trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-04-18 00:09:23 UTC (rev 4553)
+++ trunk/locale/cs_CZ.utf8/LC_MESSAGES/messages.po 2011-04-18 07:49:36 UTC (rev 4554)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: webERP 3.08\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-...
[truncated message content] |