@ -101,8 +101,9 @@ if($_GET['search']==''){
$search_state = '';
}
// currently used for links in reports, and not for transaction_log page search mechanism
// // currently used for links in reports, and not for transaction_log page search mechanism
// Shop Transaction Totals (stats_shoptransactiontotals.php) - by shop
if($_GET['shop_id_search']==''){
$shop_id_search = '';
} elseif(isset($_GET['shop_id_search'])) {
@ -111,7 +112,16 @@ if($_GET['shop_id_search']==''){
$shop_id_search = '';
}
//record_count (SQL or state)
// Sales Tax Report (stats_monthlysalestax.php)- by month
if($_GET['month_search']==''){
$month_search = '';
} elseif(isset($_GET['month_search'])) {
$month_search = "AND DATE(date) >='" . $_GET['month_search'] . "' AND DATE(date) < = LAST_DAY('" . $_GET['month_search'] . "')";
} else {
$month_search = '';
}
//// record_count (SQL or state)
if($_GET['record_count']>0){
$record_count = $_GET['record_count'];
$number_of_transactions = $record_count;
@ -144,6 +154,27 @@ foreach ( $search_state_array as $key => $value ) {
// What is seen on the main page.
mysql_select_db($database_YBDB, $YBDB);
// count for $month_search and $shop_id_search
if($month_search || $shop_id_search) {
$query_Recordset1 = "SELECT *,
DATE_FORMAT(date,'%m/%d/%y (%a)') as date_wday,
CONCAT('$',FORMAT(amount,2)) as format_amount,
CONCAT(contacts.last_name, ', ', contacts.first_name, ' ',contacts.middle_initial) AS full_name,
LEFT(IF(show_startdate, CONCAT(' [',
DATE_FORMAT(DATE_ADD(date_startstorage,INTERVAL $storage_period DAY),'%W, %M %D'), '] ', transaction_log.description),
IF(community_bike,CONCAT('Quantity(', quantity, ') ', transaction_log.description), description)),2000)
as description_with_locations
FROM transaction_log
LEFT JOIN contacts ON transaction_log.sold_to=contacts.contact_id
LEFT JOIN transaction_types ON transaction_log.transaction_type=transaction_types.transaction_type_id
WHERE 1=1 {$trans_date} {$shop_dayname} {$trans_type} {$contact_id} {$search} {$shop_id_search} {$month_search};";
$Recordset1 = mysql_query($query_Recordset1, $YBDB) or die(mysql_error());
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
//$handler->debug($totalRows_Recordset1);
$record_count = $totalRows_Recordset1;
}
$query_Recordset1 = "SELECT *,
DATE_FORMAT(date,'%m/%d/%y (%a)') as date_wday,
CONCAT('$',FORMAT(amount,2)) as format_amount,
@ -155,10 +186,13 @@ LEFT(IF(show_startdate, CONCAT(' [',
FROM transaction_log
LEFT JOIN contacts ON transaction_log.sold_to=contacts.contact_id
LEFT JOIN transaction_types ON transaction_log.transaction_type=transaction_types.transaction_type_id
WHERE 1=1 {$trans_date} {$shop_dayname} {$trans_type} {$contact_id} {$search} {$shop_id_search} ORDER BY transaction_id DESC LIMIT 0, $record_count;";
WHERE 1=1 {$trans_date} {$shop_dayname} {$trans_type} {$contact_id} {$search} {$shop_id_search} {$month_search} ORDER BY transaction_id DESC LIMIT 0, $record_count;";
$Recordset1 = mysql_query($query_Recordset1, $YBDB) or die(mysql_error());
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
//$handler->debug($query_Recordset1);
//Action on form update
$editFormAction = "";
@ -676,6 +710,7 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
< td colspan = "9" >< p >< strong > Start New Transaction:</ strong >< br /> Select Type: <?php list_transaction_types ( 'transaction_type' , $default_transaction_type ); ?>
< input type = "submit" name = "Submit43" value = "Create Transaction" / > < span id = "current_shop" > < / span >
< / p >
< div > < / div >
< / td >
< / tr >
< input type = "hidden" name = "MM_insert" value = "FormNew" / >