X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Finquiry%2Fcustomer_inquiry.php;h=715de08ae6495e2f2a429cfb4c18657f37be6a81;hb=3e2a432dd72688dbac39a07716201b2b00c16c8b;hp=ab2cdd6172ebefcc3bc074a2b6d54bbc1fb9c93e;hpb=72af4496f87c438dc85a0a7573d36b7bd9e49624;p=fa-stable.git diff --git a/sales/inquiry/customer_inquiry.php b/sales/inquiry/customer_inquiry.php index ab2cdd61..715de08a 100644 --- a/sales/inquiry/customer_inquiry.php +++ b/sales/inquiry/customer_inquiry.php @@ -33,15 +33,15 @@ start_row(); customer_list_cells(_("Select a customer: "), 'customer_id', null, true); -date_cells(_("From:"), 'TransAfterDate', null, -30); -date_cells(_("To:"), 'TransToDate', null, 1); +date_cells(_("From:"), 'TransAfterDate', '', null, -30); +date_cells(_("To:"), 'TransToDate', '', null, 1); if (!isset($_POST['filterType'])) $_POST['filterType'] = 0; cust_allocations_list_cells(null, 'filterType', $_POST['filterType'], true); -submit_cells('Refresh Inquiry', _("Search")); +submit_cells('RefreshInquiry', _("Search"),'',_('Refresh Inquiry'), true); end_row(); end_table(); @@ -146,44 +146,51 @@ function get_transactions() } //------------------------------------------------------------------------------------------------ + +div_start('totals_tbl'); if ($_POST['customer_id'] != "" && $_POST['customer_id'] != reserved_words::get_all()) { - $customer_record = get_customer_details($_POST['customer_id']); + $customer_record = get_customer_details($_POST['customer_id'], $_POST['TransToDate']); display_customer_summary($customer_record); echo "
"; } - +div_end(); //------------------------------------------------------------------------------------------------ $result = get_transactions(); -if (db_num_rows($result) == 0) +//------------------------------------------------------------------------------------------------ +if(get_post('RefreshInquiry')) { - display_note(_("The selected customer has no transactions for the given dates."), 0, 2); - end_page(); - exit; + $Ajax->activate('trans_tbl'); + $Ajax->activate('totals_tbl'); } - //------------------------------------------------------------------------------------------------ - print_hidden_script(10); -start_table("$table_style width='80%'"); + +div_start('trans_tbl'); +if (db_num_rows($result) == 0) +{ + display_note(_("The selected customer has no transactions for the given dates."), 0, 2); +} else { + + start_table("$table_style width='80%'"); $th = array(_("Type"), _("#"), _("Order"), _("Reference"), _("Date"), _("Due Date"), _("Customer"), _("Branch"), _("Currency"), _("Debit"), _("Credit"), "", "","",""); -if ($_POST['customer_id'] != reserved_words::get_all()) { - unset($th[6], $th[8]); -} + if ($_POST['customer_id'] != reserved_words::get_all()) { + unset($th[6], $th[8]); + } -table_header($th); + table_header($th); -$j = 1; -$k = 0; //row colour counter -$over_due = false; -while ($myrow = db_fetch($result)) -{ + $j = 1; + $k = 0; //row colour counter + $over_due = false; + while ($myrow = db_fetch($result)) + { if ($myrow['OverDue'] == 1) { @@ -269,19 +276,20 @@ while ($myrow = db_fetch($result)) label_cell(''); end_row(); - $j++; - if ($j == 12) - { - $j = 1; - table_header($th); - } //end of page full new headings if -} //end of transaction while loop - -end_table(1); + $j++; + if ($j == 12) + { + $j = 1; + table_header($th); + } //end of page full new headings if + } //end of transaction while loop -if ($over_due) - display_note(_("Marked items are overdue."), 0, 1, "class='overduefg'"); + end_table(1); + if ($over_due) + display_note(_("Marked items are overdue."), 0, 1, "class='overduefg'"); +} +div_end(); end_page(); ?>