2015-03-03 07:41:18 CAT [28239-3] tad_customer_live LOG: duration: 52475.384 ms execute : select array_to_string(array_agg(fin_paymen0_.FIN_Payment_Scheduledetail_ID), ',') as col_0_0_, array_to_string(array_agg(order2_.DocumentNo), ',') as col_1_0_, invoice7_.DocumentNo as col_2_0_, coalesce(fin_paymen6_.Fin_Paymentmethod_ID, fin_paymen1_.Fin_Paymentmethod_ID) as col_3_0_, coalesce(fin_paymen10_.Name, fin_paymen5_.Name) as col_4_0_, coalesce(businesspa8_.C_BPartner_ID, businesspa3_.C_BPartner_ID) as col_5_0_, coalesce(businesspa8_.Name, businesspa3_.Name) as col_6_0_, coalesce(fin_paymen6_.ExpectedDate, fin_paymen1_.ExpectedDate) as col_7_0_, max(coalesce(fin_paymen6_.Amount, fin_paymen1_.Amount)) as col_8_0_, max(coalesce(invoice7_.GrandTotal, 0)) as col_9_0_, sum(fin_paymen0_.Amount+fin_paymen0_.Writeoffamt) as col_10_0_, coalesce(sum(fin_paymen13_.Amount), 0) as col_11_0_, case when sum(fin_paymen0_.Writeoffamt)<>0 then true else false end as col_12_0_, case when max(fin_paymen14_.Fin_Payment_ID) is not null then true else false end as col_13_0_ from FIN_Payment_ScheduleDetail fin_paymen0_ left outer join FIN_Payment_Schedule fin_paymen1_ on fin_paymen0_.FIN_Payment_Schedule_Order=fin_paymen1_.Fin_Payment_Schedule_ID left outer join C_Order order2_ on fin_paymen1_.C_Order_ID=order2_.C_Order_ID left outer join C_BPartner businesspa3_ on order2_.C_BPartner_ID=businesspa3_.C_BPartner_ID left outer join FIN_Payment_Priority fin_paymen4_ on fin_paymen1_.FIN_Payment_Priority_ID=fin_paymen4_.FIN_Payment_Priority_ID left outer join FIN_PaymentMethod fin_paymen5_ on fin_paymen1_.Fin_Paymentmethod_ID=fin_paymen5_.Fin_Paymentmethod_ID left outer join FIN_Payment_Schedule fin_paymen6_ on fin_paymen0_.FIN_Payment_Schedule_Invoice=fin_paymen6_.Fin_Payment_Schedule_ID left outer join C_Invoice invoice7_ on fin_paymen6_.C_Invoice_ID=invoice7_.C_Invoice_ID left outer join C_BPartner businesspa8_ on invoice7_.C_BPartner_ID=businesspa8_.C_BPartner_ID left outer join FIN_Payment_Priority fin_paymen9_ on fin_paymen6_.FIN_Payment_Priority_ID=fin_paymen9_.FIN_Payment_Priority_ID left outer join FIN_PaymentMethod fin_paymen10_ on fin_paymen6_.Fin_Paymentmethod_ID=fin_paymen10_.Fin_Paymentmethod_ID left outer join AD_Org organizati11_ on fin_paymen0_.AD_Org_ID=organizati11_.AD_Org_ID left outer join AD_OrgInfo organizati12_ on organizati11_.AD_Org_ID=organizati12_.AD_Org_ID left outer join FIN_Payment_Detail fin_paymen13_ on fin_paymen0_.FIN_Payment_Detail_ID=fin_paymen13_.Fin_Payment_Detail_ID left outer join FIN_Payment fin_paymen14_ on fin_paymen13_.Fin_Payment_ID=fin_paymen14_.Fin_Payment_ID where (fin_paymen0_.AD_Client_ID in ('0' , '7B27EAB5E42841E0A0957AF0B16CCB3B')) and (fin_paymen0_.AD_Org_ID in ('0' , '2577FC4107D04AC18B5C8C29F464D179' , '2D164FEBDD474277B5AE9858AD9CBA01' , '1A6DAE74F0D440DF919CA5FA5236F0FC')) and (fin_paymen0_.FIN_Payment_Detail_ID is null or fin_paymen14_.Fin_Payment_ID=$1 and (fin_paymen6_.Fin_Payment_Schedule_ID is not null or fin_paymen1_.Fin_Payment_Schedule_ID is not null)) and (fin_paymen0_.AD_Org_ID in ($2)) and (organizati12_.AD_Org_ID is null or organizati12_.IsActive='Y') and (fin_paymen14_.Fin_Payment_ID=$3 or (invoice7_.C_Invoice_ID is not null) and businesspa8_.C_BPartner_ID=$4 and invoice7_.IsSOTrx=$5 and invoice7_.C_Currency_ID=$6) group by invoice7_.DocumentNo , coalesce(fin_paymen6_.Fin_Paymentmethod_ID, fin_paymen1_.Fin_Paymentmethod_ID) , coalesce(fin_paymen10_.Name, fin_paymen5_.Name) , coalesce(fin_paymen6_.ExpectedDate, fin_paymen1_.ExpectedDate) , coalesce(fin_paymen9_.Priority, fin_paymen4_.Priority) , coalesce(businesspa8_.C_BPartner_ID, businesspa3_.C_BPartner_ID) , coalesce(businesspa8_.Name, businesspa3_.Name) having upper(coalesce(fin_paymen10_.Name, fin_paymen5_.Name)) like upper($7) escape '|' order by case when max(fin_paymen14_.Fin_Payment_ID) is not null then 0 else 1 end, coalesce(fin_paymen9_.Priority, fin_paymen4_.Priority), coalesce(fin_paymen6_.ExpectedDate, fin_paymen1_.ExpectedDate), invoice7_.DocumentNo limit $8 2015-03-03 07:41:18 CAT [28239-4] tad_halsteds@halsted_live DETAIL: parameters: $1 = '22186332529941FDB77C7B9AE14680F1', $2 = '2D164FEBDD474277B5AE9858AD9CBA01', $3 = '22186332529941FDB77C7B9AE14680F1', $4 = '283BE8E1E75448C78059FE45194C688C', $5 = 'N', $6 = '100', $7 = '%Cash%', $8 = '101'