Skip to content

Commit

Permalink
PaulT: PO_SelectOSPurchOrder.php: Derived from Tim's code: add defaul…
Browse files Browse the repository at this point in the history
…t current dates. (there may not yet be any purchorders records) / PaulT: do not show the order list table when there are no records to show. (avoids a table heading output without any associated row data)
  • Loading branch information
TurboPT authored and timschofield committed Feb 27, 2018
1 parent 5a136ea commit 7b31072
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions PO_SelectOSPurchOrder.php
Expand Up @@ -156,8 +156,13 @@
FROM purchorders";
$DateResult = DB_query($DateSQL);
$DateRow = DB_fetch_array($DateResult);
if ($DateRow['fromdate'] != null) {
$DateFrom = $DateRow['fromdate'];
$DateTo = $DateRow['todate'];
} else {
$DateFrom = date('Y-m-d');
$DateTo = date('Y-m-d');
}
} else {
$DateFrom = FormatDateForSQL($_POST['DateFrom']);
$DateTo = FormatDateForSQL($_POST['DateTo']);
Expand Down Expand Up @@ -581,6 +586,7 @@
$ErrMsg = _('No orders were returned by the SQL because');
$PurchOrdersResult = DB_query($SQL, $ErrMsg);

if (DB_num_rows($PurchOrdersResult) > 0) {
/*show a table of the orders returned by the SQL */

echo '<table cellpadding="2" width="97%" class="selection">';
Expand Down Expand Up @@ -671,6 +677,7 @@
} //end of while loop around purchase orders retrieved

echo '</table>';
}
}
echo '</div>
</form>';
Expand Down
1 change: 1 addition & 0 deletions doc/Change.log
@@ -1,5 +1,6 @@
webERP Change Log

17/2/18 PaulT: PO_SelectOSPurchOrder.php: Derived from Tim's code: add default current dates. (there may not yet be any purchorders records) / PaulT: do not show the order list table when there are no records to show. (avoids a table heading output without any associated row data)
17/2/18 Tim (PaulT commit): MiscFunctions.js: Set the calendar click and change handlers to reference the localStorage DateFormat instead of the element's "alt" attribute value. (Know that this update requires the localStorage change applied with commit 7973)
17/2/18 PaulT: header.php: Set the DOCTYPE to html5 declaration format, update the meta tag with Content-Type info, and add localStorage with DateFormat and Theme for upcoming changes to table column sorting and calendar handling improvements.
17/2/18 PaulT: CustomerAllocations.php: Minor code shuffle to fix view page source message "Start tag 'div' seen in 'table'" reported in Firefox.
Expand Down

0 comments on commit 7b31072

Please sign in to comment.