From: <dai...@us...> - 2014-02-14 23:06:46
|
Revision: 6572 http://sourceforge.net/p/web-erp/reponame/6572 Author: daintree Date: 2014-02-14 23:06:44 +0000 (Fri, 14 Feb 2014) Log Message: ----------- Andrew Galuski: WO status fix Modified Paths: -------------- trunk/WorkOrderStatus.php trunk/doc/Change.log trunk/includes/LanguageSetup.php trunk/includes/LanguagesArray.php trunk/includes/Z_POSDataCreation.php Modified: trunk/WorkOrderStatus.php =================================================================== --- trunk/WorkOrderStatus.php 2014-02-12 05:43:11 UTC (rev 6571) +++ trunk/WorkOrderStatus.php 2014-02-14 23:06:44 UTC (rev 6572) @@ -106,7 +106,8 @@ qtypu FROM worequirements INNER JOIN stockmaster ON worequirements.stockid=stockmaster.stockid - WHERE wo='" . $SelectedWO . "'", + WHERE wo='" . $SelectedWO . "' + AND worequirements.parentstockid='" . $StockID . "'", $db); while ($RequirementsRow = DB_fetch_array($RequirmentsResult)){ @@ -134,4 +135,4 @@ include('includes/footer.inc'); -?> \ No newline at end of file +?> Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2014-02-12 05:43:11 UTC (rev 6571) +++ trunk/doc/Change.log 2014-02-14 23:06:44 UTC (rev 6572) @@ -1,5 +1,8 @@ webERP Change Log + +15/2/14 Phil: Fixed POSDataCreation script to send all current prices in the POS currency including debtorno info so the POS can now deal with customer specific prices correctly. +15/2/14 Andrew Galuski: WorkOrderStatus.php now shows requirements for multiple parent item works orders. 12/2/14 Andrew Galuski: WOSerialNos.php - added filter number format on quantity 12/2/14 Exson: Fixed the Earliest date calculation when is over Friday cutoff Time in DateFunctions.inc. Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2014-02-12 05:43:11 UTC (rev 6571) +++ trunk/includes/LanguageSetup.php 2014-02-14 23:06:44 UTC (rev 6572) @@ -26,7 +26,7 @@ //Check users' locale format via their language //Then pass this information to the js for number validation purpose -$Collect = array('US'=> array('en_US.utf8','en_GB.utf8','ja_JP.utf8','hi_IN.utf8','sw_KE.utf8','tr_TR.utf8','vi_VN.utf8','zh_CN.utf8','zh_HK.utf8','zh_TW.utf8'), +$Collect = array('US'=> array('en_US.utf8','en_GB.utf8','ja_JP.utf8','hi_IN.utf8','mr_IN.utf8','sw_KE.utf8','tr_TR.utf8','vi_VN.utf8','zh_CN.utf8','zh_HK.utf8','zh_TW.utf8'), 'IN'=>array('en_IN.utf8'), 'EE'=>array('ar_EG.utf8','cz_CZ.utf8','fr_CA.utf8','fr_FR.utf8','hr_HR.utf8','pl_PL.utf8','ru_RU.utf8','sq_AL.utf8','sv_SE.utf8'), 'FR'=>array('ar_EG.utf8','cz_CZ.utf8','fr_CA.utf8','fr_FR.utf8','hr_HR.utf8','pl_PL.utf8','ru_RU.utf8','sq_AL.utf8','sv_SE.utf8'), @@ -40,7 +40,6 @@ } - /*Since LanguagesArray requires the function _() to translate the language names - we must provide a substitute if it doesn't exist aready before we include includes/LanguagesArray.php * */ if (!function_exists('gettext')) { Modified: trunk/includes/LanguagesArray.php =================================================================== --- trunk/includes/LanguagesArray.php 2014-02-12 05:43:11 UTC (rev 6571) +++ trunk/includes/LanguagesArray.php 2014-02-14 23:06:44 UTC (rev 6572) @@ -66,6 +66,11 @@ $LanguagesArray['hi_IN.utf8']['DecimalPoint'] = '.'; $LanguagesArray['hi_IN.utf8']['ThousandsSeparator'] = ','; +$LanguagesArray['mr_IN.utf8']['LanguageName'] = _('Marathi'); +$LanguagesArray['mr_IN.utf8']['WindowsLocale'] = 'marathi'; +$LanguagesArray['mr_IN.utf8']['DecimalPoint'] = '.'; +$LanguagesArray['mr_IN.utf8']['ThousandsSeparator'] = ','; + $LanguagesArray['hr_HR.utf8']['LanguageName'] = 'Magyar'; $LanguagesArray['hr_HR.utf8']['WindowsLocale'] = 'hungarian'; $LanguagesArray['hr_HR.utf8']['DecimalPoint'] = ','; Modified: trunk/includes/Z_POSDataCreation.php =================================================================== --- trunk/includes/Z_POSDataCreation.php 2014-02-12 05:43:11 UTC (rev 6571) +++ trunk/includes/Z_POSDataCreation.php 2014-02-14 23:06:44 UTC (rev 6572) @@ -25,8 +25,8 @@ } $CurrCode = $CustomerRow['currcode']; $SalesType = $CustomerRow['salestype']; + - $FileHandle = fopen($PathPrefix . $ReportDir . '/POS.sql','w'); if ($FileHandle == false){ @@ -120,25 +120,39 @@ } fwrite($FileHandle,"DELETE FROM stockmaster;\n"); - $result = DB_query("SELECT stockid, categoryid, description, longdescription, units, barcode, taxcatid, decimalplaces FROM stockmaster WHERE (mbflag='B' OR mbflag='M') AND discontinued=0 AND controlled=0",$db); - while ($myrow = DB_fetch_array($result)) { - fwrite($FileHandle,"INSERT INTO stockmaster VALUES ('" . SQLite_Escape ($myrow['stockid']) . "', '" . SQLite_Escape ($myrow['categoryid']) . "', '" . SQLite_Escape ($myrow['description']) . "', '" . SQLite_Escape (str_replace("\n", '', $myrow['longdescription'])) . "', '" . SQLite_Escape ($myrow['units']) . "', '" . SQLite_Escape ($myrow['barcode']) . "', '" . $myrow['taxcatid'] . "', '" . $myrow['decimalplaces'] . "');\n"); - fwrite($FileHandle,"DELETE FROM prices WHERE stockid='" . $myrow['stockid'] . "';\n"); + $result = DB_query("SELECT stockid, categoryid, description, longdescription, units, barcode, taxcatid, decimalplaces FROM stockmaster WHERE (mbflag='B' OR mbflag='M') AND discontinued=0 AND controlled=0",$db); - $Price = GetPriceQuick ($myrow['stockid'], $POSDebtorNo, $POSBranchCode, $DefaultPriceList, $db); - if ($Price!=0) { - fwrite($FileHandle,"INSERT INTO prices (stockid, currabrev, typeabbrev, price) VALUES('" . $myrow['stockid'] . "', '" . $CurrCode . "', '" . $SalesType . "', '" . $Price . "');\n"); - } + while ($myrow = DB_fetch_array($result)) { + fwrite($FileHandle,"INSERT INTO stockmaster VALUES ('" . SQLite_Escape ($myrow['stockid']) . "', '" . SQLite_Escape ($myrow['categoryid']) . "', '" . SQLite_Escape ($myrow['description']) . "', '" . SQLite_Escape (str_replace("\n", '', $myrow['longdescription'])) . "', '" . SQLite_Escape ($myrow['units']) . "', '" . SQLite_Escape ($myrow['barcode']) . "', '" . $myrow['taxcatid'] . "', '" . $myrow['decimalplaces'] . "');\n"); } + fwrite($FileHandle,"DELETE FROM prices;\n"); + $result = DB_query("SELECT prices.stockid, + prices.typeabbrev, + prices.currabrev, + prices.debtorno, + prices.price + FROM prices INNER JOIN stockmaster + ON prices.stockid=stockmaster.stockid + WHERE (mbflag='B' OR mbflag='M') + AND discontinued=0 + AND controlled=0 + AND prices.branchcode='' + AND prices.currabrev='" . $CurrCode . "' + AND prices.startdate <='" . Date('Y-m-d:23.59') . "' + AND (prices.enddate >='" . Date('Y-m-d:23.59') . "' OR prices.enddate='0000-00-00')",$db); + while ($myrow = DB_fetch_array($result)) { + + fwrite($FileHandle,"INSERT INTO prices VALUES ('" . SQLite_Escape ($myrow['stockid']) . "', '" . SQLite_Escape ($myrow['typeabbrev']) . "', '" . SQLite_Escape ($myrow['currabrev']) . "', '" . SQLite_Escape ($myrow['debtorno']) . "', '" . SQLite_Escape ($myrow['price']) . "', '');\n"); + } + fwrite($FileHandle,"DELETE FROM debtorsmaster;\n"); $result = DB_query("SELECT debtorno, name, currcode, salestype, holdreason, paymentterms, discount, creditlimit, discountcode FROM debtorsmaster WHERE currcode='". $CurrCode . "'",$db); while ($myrow = DB_fetch_array($result)) { fwrite($FileHandle,"INSERT INTO debtorsmaster VALUES ('" . $myrow['debtorno'] . "', '" . SQLite_Escape ($myrow['name']) . "', '" . $myrow['currcode'] . "', '" . $myrow['salestype'] . "', '" . $myrow['holdreason'] . "', '" . SQLite_Escape ($myrow['paymentterms']) . "', '" . $myrow['discount'] . "', '" . $myrow['creditlimit'] . "', '" . $myrow['discountcode'] . "');\n"); - } fwrite($FileHandle,"DELETE FROM custbranch;\n"); $result = DB_query("SELECT branchcode, debtorsmaster.debtorno, brname, contactname, specialinstructions,taxgroupid FROM custbranch INNER JOIN debtorsmaster ON custbranch.debtorno=debtorsmaster.debtorno WHERE debtorsmaster.currcode='". $CurrCode . "'",$db); @@ -195,59 +209,4 @@ } } -function GetPriceQuick ($StockID, $DebtorNo, $BranchCode, $DefaultPriceList,$db){ - - $sql="SELECT prices.price, prices.debtorno, prices.branchcode, prices.enddate, prices.typeabbrev - FROM prices INNER JOIN debtorsmaster - ON prices.currabrev = debtorsmaster.currcode - WHERE debtorsmaster.debtorno='" . $DebtorNo . "' - AND (prices.typeabbrev = debtorsmaster.salestype OR prices.typeabbrev='" . $DefaultPriceList . "') - AND prices.stockid = '" . $StockID . "' - AND (prices.debtorno=debtorsmaster.debtorno OR prices.debtorno='') - AND (prices.branchcode='" . $BranchCode . "' OR prices.branchcode='') - AND prices.startdate <='" . Date('Y-m-d:23.59') . "' - AND (prices.enddate >='" . Date('Y-m-d:23.59') . "' OR prices.enddate='0000-00-00')"; - - $ErrMsg = _('There is a problem in retrieving the pricing information for part') . ' ' . $StockID . ' ' . _('and for Customer') . ' ' . $DebtorNo . ' ' . _('the error message returned by the SQL server was'); - $result = DB_query($sql, $db,$ErrMsg); - if (DB_num_rows($result)==0){ - return 0; - } else { - $PricesArray = array(); - $RankArray = array(); - $i = 0; - while ($myrow=DB_fetch_array($result)){ - $Prices[$i]['Price'] = $myrow['price']; - $Prices[$i]['DebtorNo'] = $myrow['debtorno']; - $Prices[$i]['BranchCode'] = $myrow['branchcode']; - $Prices[$i]['EndDate'] = $myrow['enddate']; - if ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode AND $myrow['enddate']!='0000-00-00') { - $RankArray[$i] = 1; - } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']==$BranchCode) { - $RankArray[$i] = 2; - } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ - $RankArray[$i] = 3; - } elseif ($myrow['debtorno']==$DebtorNo AND $myrow['branchcode']=='' ){ - $RankArray[$i] = 4; - } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$DefaultPriceList AND $myrow['enddate']!='0000-00-00'){ - $RankArray[$i] = 5; - } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['typeabbrev']!=$DefaultPriceList){ - $RankArray[$i] = 6; - } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']=='' AND $myrow['enddate']!='0000-00-00'){ - $RankArray[$i] = 7; - } elseif ($myrow['debtorno']=='' AND $myrow['branchcode']==''){ - $RankArray[$i] = 8; - } - $i++; - } - $LowestRank = 10; - foreach ($RankArray as $ArrayElement=>$Ranking) { - if ($Ranking < $LowestRank){ - $LowestRankElement = $ArrayElement; - $LowestRank = $Ranking; - } - } - return $Prices[$ArrayElement]['Price']; - } -} -?> \ No newline at end of file +?> |