ihave this page which helps you find an invoice...it is basically a search for details of invoice.you can search by multiple fields on that page.
following are the feilds listed:
PRO/Air Bill Number:
PRO/Airbill Number:
Carrier's Invoice Number :
Carrier Account Number:
Purchase Order Number :
Carrier Customer Cost Object:
Payment Date Pick Date on Calendar THROUGH
Invoice Receipt Date
Pick Date on Calendar THROUGH
Check Number
the first field PRO/Air bill number...currently the users put a pro number and hit search and they get result.wht we want is to be able to enter tracking number in that field and hit search.
so if a pro is entered the query will search by pro number while if i enter tracking number instead ..the query shud then search by tracking number.
so either ways the query shud search...may be first by pro number and if that search comes blank then it shud search by tracking number.
we are using that field to take 2 kinds of input-PRO number or tracking number.
this is the query which we are using right now which pulls the record by different search criterias and i am confused as to where i can modify to make the search critirea get the results which i am looking for:
var $browse_query = "
SELECT am_client.client_name,
am_invoice_line_item.batch_id,
am_batch_status.status_text,
am_invoice.invoice_date_received,
am_payment_group.payment_group_create_date,
am_invoice_line_item.payment_id AS check_number,
am_payment.payment_date AS check_date,
carrier.company_name AS carrier_company,
am_invoice_line_item.line_item_pro,
am_invoice_line_item.line_item_amount_billed,
am_invoice_line_item.line_item_amount_paid,
am_invoice_line_item_billing.ilib_amount,
(NOT am_invoice_line_item_billing.ilib_amount =
am_invoice_line_item.line_item_amount_paid) AS split,
am_short_pay.short_reason,
am_invoice.carrier_invoice_number,
billing.company_name AS billing_company,
coalesce(am_purchase_order.po_number,
am_invoice_line_item.line_item_purchase_order) AS po_number,
am_invoice_line_item.line_item_ardmore_invoice,
am_invoice.invoice_id,
am_invoice_line_item.line_item_id,
am_invoice.carrier_account_number,
am_invoice.invoice_problem_flag
FROM am_invoice
LEFT OUTER JOIN am_invoice_line_item USING ( invoice_id )
LEFT OUTER JOIN am_invoice_line_item_billing USING ( line_item_id )
LEFT OUTER JOIN fw_company carrier ON
( carrier.company_id = am_invoice.carrier_id )
LEFT OUTER JOIN am_invoice_batch USING ( batch_id )
LEFT OUTER JOIN am_client using ( client_id )
LEFT OUTER JOIN am_batch_status
ON ( am_batch_status.status_code =
am_invoice_batch.batch_status )
LEFT OUTER JOIN fw_company billing ON ( billing.company_id =
am_invoice_line_item_billing.ilib_company_id )
LEFT OUTER JOIN am_short_pay ON ( am_short_pay.short_code =
am_invoice_line_item.line_item_short_pay_reason )
LEFT OUTER JOIN am_purchase_order ON ( am_purchase_order.po_id =
am_invoice_line_item.purchase_order_id )
LEFT OUTER JOIN am_payment USING ( payment_id )
LEFT OUTER JOIN am_payment_group USING ( payment_group_id )
WHERE TRUE ";