|
From: <dai...@us...> - 2014-01-24 08:52:57
|
Revision: 6547
http://sourceforge.net/p/web-erp/reponame/6547
Author: daintree
Date: 2014-01-24 08:52:53 +0000 (Fri, 24 Jan 2014)
Log Message:
-----------
Tim: selection of purchase orders by order date
Modified Paths:
--------------
trunk/GLTrialBalance.php
trunk/PO_SelectOSPurchOrder.php
trunk/SelectOrderItems.php
trunk/api/api_php.php
trunk/doc/Change.log
trunk/includes/DefineCartClass.php
trunk/includes/UserLogin.php
trunk/sql/mysql/country_sql/default.sql
trunk/sql/mysql/upgrade4.11-4.12.sql
trunk/sql/mysql/upgrade4.11.2-4.11.3.sql
Modified: trunk/GLTrialBalance.php
===================================================================
--- trunk/GLTrialBalance.php 2014-01-19 15:36:10 UTC (rev 6546)
+++ trunk/GLTrialBalance.php 2014-01-24 08:52:53 UTC (rev 6547)
@@ -2,7 +2,7 @@
/* $Id$*/
-/*Through deviousness and cunning, this system allows trial balances for any date range that recalcuates the p & l balances
+/*Through deviousness AND cunning, this system allows trial balances for any date range that recalcuates the p & l balances
and shows the balance sheets as at the end of the period selected - so first off need to show the input of criteria screen
while the user is selecting the criteria the system is posting any unposted transactions */
@@ -257,7 +257,7 @@
$GrpPrdActual[$Level] =0;
$GrpPrdBduget[$Level] =0;
$Level--;
- } while ($Level>0 and $myrow['parentgroupname']!=$ParentGroups[$Level]);
+ } while ($Level>0 AND $myrow['parentgroupname']!=$ParentGroups[$Level]);
if ($Level>0){
$YPos -= $line_height;
@@ -354,7 +354,7 @@
} //end of while loop
- while ($Level>0 and $myrow['parentgroupname']!=$ParentGroups[$Level]) {
+ while ($Level>0 AND $myrow['parentgroupname']!=$ParentGroups[$Level]) {
$YPos -= (.5 * $line_height);
$pdf->line($Left_Margin+250, $YPos+$line_height,$Left_Margin+500, $YPos+$line_height);
@@ -446,7 +446,7 @@
echo '<table cellpadding="2" class="selection">';
echo '<tr>
- <th colspan="6"><b>' . _('Trial Balance for the month of ') . $PeriodToDate . _(' and for the ') . $NumberOfMonths . _(' months to ') . $PeriodToDate . '</b></th>
+ <th colspan="6"><b>' . _('Trial Balance for the month of ') . $PeriodToDate . _(' AND for the ') . $NumberOfMonths . _(' months to ') . $PeriodToDate . '</b></th>
</tr>';
$TableHeader = '<tr>
<th>' . _('Account') . '</th>
@@ -532,7 +532,7 @@
$Level--;
$j++;
- } while ($Level>0 and $myrow['groupname']!=$ParentGroups[$Level]);
+ } while ($Level>0 AND $myrow['groupname']!=$ParentGroups[$Level]);
if ($Level>0){
printf('<tr>
@@ -688,7 +688,7 @@
$Level--;
$j++;
- } while (isset($ParentGroups[$Level]) and ($myrow['groupname']!=$ParentGroups[$Level] and $Level>0));
+ } while (isset($ParentGroups[$Level]) AND ($myrow['groupname']!=$ParentGroups[$Level] AND $Level>0));
if ($Level >0){
printf('<tr>
@@ -738,4 +738,4 @@
</form>';
include('includes/footer.inc');
-?>
\ No newline at end of file
+?>
Modified: trunk/PO_SelectOSPurchOrder.php
===================================================================
--- trunk/PO_SelectOSPurchOrder.php 2014-01-19 15:36:10 UTC (rev 6546)
+++ trunk/PO_SelectOSPurchOrder.php 2014-01-24 08:52:53 UTC (rev 6547)
@@ -145,6 +145,19 @@
<td>' . _('Order Number') . ': <input type="text" name="OrderNumber" autofocus="autofocus" maxlength="8" size="9" /> ' . _('Into Stock Location') . ':
<select name="StockLocation">';
+ if (!isset($_POST['DateFrom'])) {
+ $DateSQL = "SELECT min(orddate) as fromdate,
+ max(orddate) as todate
+ FROM purchorders";
+ $DateResult = DB_query($DateSQL, $db);
+ $DateRow = DB_fetch_array($DateResult);
+ $DateFrom = $DateRow['fromdate'];
+ $DateTo = $DateRow['todate'];
+ } else {
+ $DateFrom = FormatDateForSQL($_POST['DateFrom']);
+ $DateTo = FormatDateForSQL($_POST['DateTo']);
+ }
+
$sql = "SELECT loccode, locationname FROM locations";
$resultStkLocs = DB_query($sql, $db);
while ($myrow = DB_fetch_array($resultStkLocs)) {
@@ -188,7 +201,12 @@
echo '<option value="Rejected">' . _('Rejected') . '</option>';
}
}
- echo '</select> <input type="submit" name="SearchOrders" value="' . _('Search Purchase Orders') . '" />
+ echo '</select>
+ ' . _('Orders Between') . ':
+ <input type="text" name="DateFrom" value="' . ConvertSQLDate($DateFrom) . '" class="date" size="10" alt="' . $_SESSION['DefaultDateFormat'] . '" />
+ ' . _('and') . ':
+ <input type="text" name="DateTo" value="' . ConvertSQLDate($DateTo) . '" class="date" size="10" alt="' . $_SESSION['DefaultDateFormat'] . '" />
+ <input type="submit" name="SearchOrders" value="' . _('Search Purchase Orders') . '" />
</td>
</tr>
</table>';
@@ -232,16 +250,15 @@
echo '<br />';
if (isset($StockItemsResult)) {
- echo '<table cellpadding="2" class="selection">';
- $TableHeader = '<tr>
- <th class="ascending">' . _('Code') . '</th>
- <th class="ascending">' . _('Description') . '</th>
- <th class="ascending">' . _('On Hand') . '</th>
- <th class="ascending">' . _('Orders') . '<br />' . _('Outstanding') . '</th>
- <th class="ascending">' . _('Units') . '</th>
- </tr>';
- echo $TableHeader;
- $j = 1;
+ echo '<table cellpadding="2" class="selection">
+ <tr>
+ <th class="ascending">' . _('Code') . '</th>
+ <th class="ascending">' . _('Description') . '</th>
+ <th class="ascending">' . _('On Hand') . '</th>
+ <th class="ascending">' . _('Orders') . '<br />' . _('Outstanding') . '</th>
+ <th class="ascending">' . _('Units') . '</th>
+ </tr>';
+
$k = 0; //row colour counter
while ($myrow = DB_fetch_array($StockItemsResult)) {
@@ -258,14 +275,12 @@
<td>%s</td>
<td class="number">%s</td>
<td class="number">%s</td>
- <td>%s</td></tr>', $myrow['stockid'], $myrow['description'], $myrow['qoh'], $myrow['qord'], $myrow['units']);
-
- $j++;
- If ($j == 12) {
- $j = 1;
- echo $TableHeader;
- } //$j == 12
- //end of page full new headings if
+ <td>%s</td></tr>',
+ $myrow['stockid'],
+ $myrow['description'],
+ $myrow['qoh'],
+ $myrow['qord'],
+ $myrow['units']);
} //end of while loop through search items
echo '</table>';
@@ -305,6 +320,8 @@
INNER JOIN currencies
ON suppliers.currcode=currencies.currabrev
WHERE purchorderdetails.completed=0
+ AND orddate>='" . FormatDateForSQL($_POST['DateFrom']) . "'
+ AND orddate<='" . FormatDateForSQL($_POST['DateTo']) . "'
AND purchorders.orderno='" . $OrderNumber . "'
GROUP BY purchorders.orderno ASC,
suppliers.suppname,
@@ -341,6 +358,8 @@
INNER JOIN currencies
ON suppliers.currcode=currencies.currabrev
WHERE purchorderdetails.completed=0
+ AND orddate>='" . FormatDateForSQL($_POST['DateFrom']) . "'
+ AND orddate<='" . FormatDateForSQL($_POST['DateTo']) . "'
AND purchorderdetails.itemcode='" . $SelectedStockItem . "'
AND purchorders.supplierno='" . $SelectedSupplier . "'
AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "'
@@ -375,6 +394,8 @@
INNER JOIN currencies
ON suppliers.currcode=currencies.currabrev
WHERE purchorderdetails.completed=0
+ AND orddate>='" . FormatDateForSQL($_POST['DateFrom']) . "'
+ AND orddate<='" . FormatDateForSQL($_POST['DateTo']) . "'
AND purchorders.supplierno='" . $SelectedSupplier . "'
AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "'
" . $StatusCriteria . "
@@ -414,6 +435,8 @@
INNER JOIN currencies
ON suppliers.currcode=currencies.currabrev
WHERE purchorderdetails.completed=0
+ AND orddate>='" . FormatDateForSQL($_POST['DateFrom']) . "'
+ AND orddate<='" . FormatDateForSQL($_POST['DateTo']) . "'
AND purchorderdetails.itemcode='" . $SelectedStockItem . "'
AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "'
" . $StatusCriteria . "
@@ -447,6 +470,8 @@
INNER JOIN currencies
ON suppliers.currcode=currencies.currabrev
WHERE purchorderdetails.completed=0
+ AND orddate>='" . FormatDateForSQL($_POST['DateFrom']) . "'
+ AND orddate<='" . FormatDateForSQL($_POST['DateTo']) . "'
AND purchorders.intostocklocation = '" . $_POST['StockLocation'] . "'
" . $StatusCriteria . "
GROUP BY purchorders.orderno ASC,
Modified: trunk/SelectOrderItems.php
===================================================================
--- trunk/SelectOrderItems.php 2014-01-19 15:36:10 UTC (rev 6546)
+++ trunk/SelectOrderItems.php 2014-01-24 08:52:53 UTC (rev 6547)
@@ -1083,8 +1083,7 @@
if(isset($_GET['Delete'])){
//page called attempting to delete a line - GET['Delete'] = the line number to delete
- $QuantityAlreadyDelivered = $_SESSION['Items'.$identifier]->Some_Already_Delivered($_GET['Delete']);
- if($QuantityAlreadyDelivered == 0){
+ if($_SESSION['Items'.$identifier]->Some_Already_Delivered($_GET['Delete']) == 0){
$_SESSION['Items'.$identifier]->remove_from_cart($_GET['Delete'], 'Yes', $identifier); /*Do update DB */
} else {
$_SESSION['Items'.$identifier]->LineItems[$_GET['Delete']]->Quantity = $QuantityAlreadyDelivered;
Modified: trunk/api/api_php.php
===================================================================
--- trunk/api/api_php.php 2014-01-19 15:36:10 UTC (rev 6546)
+++ trunk/api/api_php.php 2014-01-24 08:52:53 UTC (rev 6547)
@@ -61,4 +61,4 @@
include 'api_workorders.php';
include 'api_webERPsettings.php';
-?>
\ No newline at end of file
+?>
Modified: trunk/doc/Change.log
===================================================================
--- trunk/doc/Change.log 2014-01-19 15:36:10 UTC (rev 6546)
+++ trunk/doc/Change.log 2014-01-24 08:52:53 UTC (rev 6547)
@@ -2,7 +2,8 @@
19/01/14 Exson: Add sales man login control and modify the PDF to download to harmony with other files and solve backward failure problem in PrintCustStatements.php.
18/01/14 Paul T: Change property name value to uppercase to match use in the script. [causing input loss]
16/01/14 Exson: Fixed sql strict mode failure problem in StockTransfers.php by adding a '' to qualitytext fields.
-14/4/14 Tim: system would go to get currency rates even though they were set to manual - bug fixed.
+23/1/14 Tim: PO_SelectOSPurchOrder.php now allows selection of purchase orders based on order dates
+14/1/14 Tim: system would go to get currency rates even though they were set to manual - bug fixed.
14/1/14 Phil: Fixed bug that was not recording the standard cost against goods received - this would put all accounting out for both standard and weighted average journals.
13/1/14 Phil: Fixed SuppInvGRNs.php price variance was not calculated correctly because cost not brought accross correctly as reported by Don Grimes
11/1/14 CQZ: Fixed that no bank accounts recorded in gl in CounterReturns.php
Modified: trunk/includes/DefineCartClass.php
===================================================================
--- trunk/includes/DefineCartClass.php 2014-01-19 15:36:10 UTC (rev 6546)
+++ trunk/includes/DefineCartClass.php 2014-01-24 08:52:53 UTC (rev 6547)
@@ -235,7 +235,7 @@
/* something has been delivered. Clear the remaining Qty and Mark Completed */
$result = DB_query("UPDATE salesorderdetails SET quantity=qtyinvoiced,
completed=1
- WHERE orderno='".$_SESSION['ExistingOrder']."'
+ WHERE orderno='" . $_SESSION['ExistingOrder' . $identifier] ."'
AND orderlineno='" . $LineNumber . "'" ,
$db,
_('The order line could not be updated as completed because')
Modified: trunk/includes/UserLogin.php
===================================================================
--- trunk/includes/UserLogin.php 2014-01-19 15:36:10 UTC (rev 6546)
+++ trunk/includes/UserLogin.php 2014-01-24 08:52:53 UTC (rev 6547)
@@ -88,8 +88,9 @@
WHERE www_users.userid='" . $Name . "'";
$Auth_Result = DB_query($sql, $db);
/*get the security tokens that the user has access to */
- $sql = "SELECT tokenid FROM securitygroups
- WHERE secroleid = '" . $_SESSION['AccessLevel'] . "'";
+ $sql = "SELECT tokenid
+ FROM securitygroups
+ WHERE secroleid = '" . $_SESSION['AccessLevel'] . "'";
$Sec_Result = DB_query($sql, $db);
$_SESSION['AllowedPageSecurityTokens'] = array();
if (DB_num_rows($Sec_Result)==0){
Modified: trunk/sql/mysql/country_sql/default.sql
===================================================================
--- trunk/sql/mysql/country_sql/default.sql 2014-01-19 15:36:10 UTC (rev 6546)
+++ trunk/sql/mysql/country_sql/default.sql 2014-01-24 08:52:53 UTC (rev 6547)
@@ -2371,9 +2371,7 @@
`numericvalue` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`stkcatpropid`),
KEY `categoryid` (`categoryid`),
- CONSTRAINT `stockcatproperties_ibfk_1` FOREIGN KEY (`categoryid`) REFERENCES `stockcategory` (`categoryid`),
- CONSTRAINT `stockcatproperties_ibfk_2` FOREIGN KEY (`categoryid`) REFERENCES `stockcategory` (`categoryid`),
- CONSTRAINT `stockcatproperties_ibfk_3` FOREIGN KEY (`categoryid`) REFERENCES `stockcategory` (`categoryid`)
+ CONSTRAINT `stockcatproperties_ibfk_1` FOREIGN KEY (`categoryid`) REFERENCES `stockcategory` (`categoryid`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
Modified: trunk/sql/mysql/upgrade4.11-4.12.sql
===================================================================
--- trunk/sql/mysql/upgrade4.11-4.12.sql 2014-01-19 15:36:10 UTC (rev 6546)
+++ trunk/sql/mysql/upgrade4.11-4.12.sql 2014-01-24 08:52:53 UTC (rev 6547)
@@ -1,13 +1,3 @@
-ALTER TABLE `emailsettings` CHANGE `username` `username` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL
-CREATE TABLE IF NOT EXISTS `pricematrix` (
- `salestype` char(2) NOT NULL DEFAULT '',
- `stockid` varchar(20) NOT NULL DEFAULT '',
- `quantitybreak` int(11) NOT NULL DEFAULT '1',
- `price` double NOT NULL DEFAULT '0',
- PRIMARY KEY (`salestype`,`stockid`,`quantitybreak`),
- KEY `DiscountCategory` (`stockid`),
- KEY `SalesType` (`salestype`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-INSERT INTO scripts VALUES('PriceMatrix.php',11,'Mantain stock prices according to quantity break and sales types');
+
UPDATE config SET confvalue='4.12' WHERE confname='VersionNumber';
Modified: trunk/sql/mysql/upgrade4.11.2-4.11.3.sql
===================================================================
--- trunk/sql/mysql/upgrade4.11.2-4.11.3.sql 2014-01-19 15:36:10 UTC (rev 6546)
+++ trunk/sql/mysql/upgrade4.11.2-4.11.3.sql 2014-01-24 08:52:53 UTC (rev 6547)
@@ -1 +1,23 @@
ALTER table stockmoves CHANGE reference reference varchar(100) NOT NULL DEFAULT '';
+alter table stockcatproperties drop foreign key stockcatproperties_ibfk_2;
+alter table stockcatproperties drop foreign key stockcatproperties_ibfk_3;
+ALTER TABLE `emailsettings` CHANGE `username` `username` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL
+CREATE TABLE IF NOT EXISTS `pricematrix` (
+ `salestype` char(2) NOT NULL DEFAULT '',
+ `stockid` varchar(20) NOT NULL DEFAULT '',
+ `quantitybreak` int(11) NOT NULL DEFAULT '1',
+ `price` double NOT NULL DEFAULT '0',
+ PRIMARY KEY (`salestype`,`stockid`,`quantitybreak`),
+ KEY `DiscountCategory` (`stockid`),
+ KEY `SalesType` (`salestype`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO scripts VALUES('PriceMatrix.php',11,'Mantain stock prices according to quantity break and sales types');
+DELETE FROM scripts WHERE script='FixedAssetList.php';
+DELETE FROM scripts WHERE script='ManualContents.php';
+DELETE FROM scripts WHERE script='MenuAccess.php';
+DELETE FROM scripts WHERE script='OrderEntryDiscountPricing.php';
+DELETE FROM scripts WHERE script='PrintSalesOrder.php';
+DELETE FROM scripts WHERE script='ReportBug.php';
+DELETE FROM scripts WHERE script='ReportletContainer.php';
+DELETE FROM scripts WHERE script='SystemCheck.php';
+UPDATE config SET confvalue='4.11.3' WHERE confname='VersionNumber';
|