2017-04-04 11:03:41 CEST [10992-1] tad@mapex LOG: duration: 164576.508 ms execute S_8639/C_8640: select materialmg0_.M_InOutLine_ID as col_0_0_, materialmg0_.AD_Org_ID as col_1_0_, materialmg0_.AD_Client_ID as col_2_0_, materialmg0_.M_Product_ID as col_3_0_, materialmg0_.C_UOM_ID as col_4_0_, materialmg0_.M_InOutLine_ID as col_5_0_, materialmg0_.MovementQty as col_6_0_, materialmg2_.C_BPartner_ID as col_7_0_, materialmg2_.DocumentNo as col_8_0_, materialmg2_.MovementDate as col_9_0_, attributes1_.M_AttributeSetInstance_ID as col_10_0_, coalesce((select sum(orderline9_.QtyOrdered) from C_OrderLine orderline9_ inner join C_Order order10_ on orderline9_.C_Order_ID=order10_.C_Order_ID where orderline9_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID and order10_.Processed='Y' and order10_.DocStatus<>'VO'), 0)*-1 as col_11_0_, case when (select 'Y' from C_OrderLine orderline11_ where orderline11_.C_Order_ID=$1 and orderline11_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID) is null then false else true end as col_12_0_, coalesce((select orderline12_.QtyOrdered from C_OrderLine orderline12_ where orderline12_.C_Order_ID=$2 and orderline12_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID), 0)*-1 as col_13_0_, (select orderline13_.C_Return_Reason_ID from C_OrderLine orderline13_, C_Return_Reason returnreas14_ where orderline13_.C_Return_Reason_ID=returnreas14_.C_Return_Reason_ID and orderline13_.C_Order_ID=$3 and orderline13_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID) as col_14_0_, coalesce((select orderline15_.C_Tax_ID from C_OrderLine orderline15_ where orderline15_.C_Order_ID=$4 and orderline15_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID), (select orderline17_.C_Tax_ID from M_InOutLine materialmg16_, C_OrderLine orderline17_ where materialmg16_.C_OrderLine_ID=orderline17_.C_OrderLine_ID and materialmg16_.M_InOutLine_ID=materialmg0_.M_InOutLine_ID)) as col_15_0_, case when (select pricingpri19_.IsTaxIncluded from C_Order order18_, M_PriceList pricingpri19_ where order18_.M_PriceList_ID=pricingpri19_.M_PriceList_ID and order18_.C_Order_ID=$5)='Y' then coalesce((select orderline20_.PriceActual from C_OrderLine orderline20_ where orderline20_.C_Order_ID=$6 and orderline20_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID), (select orderline22_.Gross_Unit_Price from M_InOutLine materialmg21_, C_OrderLine orderline22_ where materialmg21_.C_OrderLine_ID=orderline22_.C_OrderLine_ID and materialmg21_.M_InOutLine_ID=materialmg0_.M_InOutLine_ID)) else coalesce((select orderline23_.PriceActual from C_OrderLine orderline23_ where orderline23_.C_Order_ID=$7 and orderline23_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID), (select orderline25_.PriceActual from M_InOutLine materialmg24_, C_OrderLine orderline25_ where materialmg24_.C_OrderLine_ID=orderline25_.C_OrderLine_ID and materialmg24_.M_InOutLine_ID=materialmg0_.M_InOutLine_ID)) end as col_16_0_, (select order28_.DocumentNo from M_InOutLine materialmg26_, C_OrderLine orderline27_, C_Order order28_ where materialmg26_.C_OrderLine_ID=orderline27_.C_OrderLine_ID and orderline27_.C_Order_ID=order28_.C_Order_ID and materialmg26_.M_InOutLine_ID=materialmg0_.M_InOutLine_ID) as col_17_0_, organizati4_.AD_Org_ID as AD1_554_0_, adclient5_.AD_Client_ID as AD1_30_1_, product6_.M_Product_ID as M1_598_2_, uom7_.C_UOM_ID as C1_684_3_, businesspa8_.C_BPartner_ID as C1_144_4_, attributes1_.M_AttributeSetInstance_ID as M1_137_5_, organizati4_.AD_Client_ID as AD2_554_0_, organizati4_.IsActive as IsActive554_0_, organizati4_.Created as Created554_0_, organizati4_.CreatedBy as CreatedBy554_0_, organizati4_.Updated as Updated554_0_, organizati4_.UpdatedBy as UpdatedBy554_0_, organizati4_.Value as Value554_0_, organizati4_.Name as Name554_0_, organizati4_.Description as Descrip10_554_0_, organizati4_.IsSummary as IsSummary554_0_, organizati4_.AD_Orgtype_ID as AD12_554_0_, organizati4_.IsPeriodControlAllowed as IsPerio13_554_0_, organizati4_.C_Calendar_ID as C14_554_0_, organizati4_.IsReady as IsReady554_0_, organizati4_.Social_Name as Social16_554_0_, organizati4_.C_Currency_ID as C17_554_0_, organizati4_.EM_OBRETCO_RetailOrgType as EM18_554_0_, organizati4_.EM_OBRETCO_Pricelist_ID as EM19_554_0_, organizati4_.C_Acctschema_ID as C20_554_0_, organizati4_.EM_OBMFM_Product_ID as EM21_554_0_, organizati4_.EM_OBRETCO_Productlist_ID as EM22_554_0_, organizati4_.EM_Obretco_C_Bpartner_ID as EM23_554_0_, organizati4_.EM_Obwpack_Uom_ID as EM24_554_0_, organizati4_.EM_Obretco_C_bp_Location_ID as EM25_554_0_, organizati4_.EM_Obretco_M_Warehouse_ID as EM26_554_0_, organizati4_.EM_Obretco_dbp_irulesid as EM27_554_0_, organizati4_.EM_Obretco_dbp_ptermid as EM28_554_0_, organizati4_.EM_Obretco_dbp_pmethodid as EM29_554_0_, organizati4_.EM_Obretco_dbp_bpcatid as EM30_554_0_, organizati4_.EM_Obretco_dbp_countryid as EM31_554_0_, organizati4_.EM_Obretco_dbp_orgid as EM32_554_0_, organizati4_.EM_Obretco_Showtaxid as EM33_554_0_, organizati4_.EM_OBPOSBD_Best_Deal_Case as EM34_554_0_, organizati4_.EM_Obpos_Ticket_Template_ID as EM35_554_0_, organizati4_.EM_Obretco_Showbpcategory as EM36_554_0_, organizati4_.EM_OBPOSBD_Prevent_Long_Ex as EM37_554_0_, organizati4_.EM_Obpos_Cashup_Template_ID as EM38_554_0_, organizati4_.EM_Obpos_Format_Decimal as EM39_554_0_, organizati4_.EM_Obpos_Format_Group as EM40_554_0_, organizati4_.EM_Obpos_Date_Format as EM41_554_0_, organizati4_.EM_Obpos_Closedreceipt_Tem_ID as EM42_554_0_, organizati4_.EM_Obpos_Invoice_Template_ID as EM43_554_0_, organizati4_.EM_Obpos_Ret_Inv_Template_ID as EM44_554_0_, organizati4_.EM_Obpos_Layaway_Template_ID as EM45_554_0_, organizati4_.EM_Obpos_Return_Template_ID as EM46_554_0_, organizati4_.EM_Obpos_Quot_Template_ID as EM47_554_0_, organizati4_.EM_Obpos_Count_Diff_Limit as EM48_554_0_, organizati4_.EM_Obpos_Select_Cc_Warehouse as EM49_554_0_, organizati4_.EM_Obpos_Warehouse_Selection as EM50_554_0_, organizati4_.EM_Obpos_Layaway_Anonymousbp as EM51_554_0_, organizati4_.EM_Obpos_Layaway_Partpaid as EM52_554_0_, organizati4_.EM_Obpos_Cashmgm_Template_ID as EM53_554_0_, organizati4_.EM_Obpos_Clo_Inv_Template_ID as EM54_554_0_, organizati4_.EM_Obpos_Canc_Rpt_Template_ID as EM55_554_0_, organizati4_.EM_OBRTM_TMReceiptTemplate as EM56_554_0_, adclient5_.AD_Org_ID as AD2_30_1_, adclient5_.IsActive as IsActive30_1_, adclient5_.Created as Created30_1_, adclient5_.CreatedBy as CreatedBy30_1_, adclient5_.Updated as Updated30_1_, adclient5_.UpdatedBy as UpdatedBy30_1_, adclient5_.Value as Value30_1_, adclient5_.Name as Name30_1_, adclient5_.Description as Descrip10_30_1_, adclient5_.SMTPHost as SMTPHost30_1_, adclient5_.RequestEMail as Request12_30_1_, adclient5_.RequestUser as Request13_30_1_, adclient5_.RequestUserPW as Request14_30_1_, adclient5_.RequestFolder as Request15_30_1_, adclient5_.AD_Language as AD16_30_1_, adclient5_.IsMultiLingualDocument as IsMulti17_30_1_, adclient5_.IsSmtpAuthorization as IsSmtpA18_30_1_, adclient5_.C_Currency_ID as C19_30_1_, adclient5_.Acctdim_Centrally_Maintained as Acctdim20_30_1_, adclient5_.Project_Acctdim_Isenable as Project21_30_1_, adclient5_.Project_Acctdim_Header as Project22_30_1_, adclient5_.Project_Acctdim_Lines as Project23_30_1_, adclient5_.Project_Acctdim_Breakdown as Project24_30_1_, adclient5_.Bpartner_Acctdim_Isenable as Bpartner25_30_1_, adclient5_.Bpartner_Acctdim_Header as Bpartner26_30_1_, adclient5_.Bpartner_Acctdim_Lines as Bpartner27_30_1_, adclient5_.Bpartner_Acctdim_Breakdown as Bpartner28_30_1_, adclient5_.Product_Acctdim_Isenable as Product29_30_1_, adclient5_.Product_Acctdim_Header as Product30_30_1_, adclient5_.Product_Acctdim_Lines as Product31_30_1_, adclient5_.Product_Acctdim_Breakdown as Product32_30_1_, adclient5_.Costcenter_Acctdim_Header as Costcenter33_30_1_, adclient5_.Costcenter_Acctdim_Lines as Costcenter34_30_1_, adclient5_.Costcenter_Acctdim_Breakdown as Costcenter35_30_1_, adclient5_.User1_Acctdim_Isenable as User36_30_1_, adclient5_.User1_Acctdim_Header as User37_30_1_, adclient5_.User1_Acctdim_Lines as User38_30_1_, adclient5_.User1_Acctdim_Breakdown as User39_30_1_, adclient5_.User2_Acctdim_Isenable as User40_30_1_, adclient5_.User2_Acctdim_Header as User41_30_1_, adclient5_.User2_Acctdim_Lines as User42_30_1_, adclient5_.User2_Acctdim_Breakdown as User43_30_1_, adclient5_.Costcenter_Acctdim_Isenable as Costcenter44_30_1_, adclient5_.Org_Acctdim_Isenable as Org45_30_1_, adclient5_.Org_Acctdim_Header as Org46_30_1_, adclient5_.Org_Acctdim_Lines as Org47_30_1_, adclient5_.Org_Acctdim_Breakdown as Org48_30_1_, adclient5_.EM_Obmobc_Auth_Key as EM49_30_1_, adclient5_.EM_Pricm_Invoiceschedule_ID as EM50_30_1_, adclient5_.DaysToPasswordExpiration as DaysToP51_30_1_, product6_.AD_Client_ID as AD2_598_2_, product6_.AD_Org_ID as AD3_598_2_, product6_.IsActive as IsActive598_2_, product6_.Created as Created598_2_, product6_.CreatedBy as CreatedBy598_2_, product6_.Updated as Updated598_2_, product6_.UpdatedBy as UpdatedBy598_2_, product6_.Value as Value598_2_, product6_.Name as Name598_2_, product6_.Description as Descrip11_598_2_, product6_.DocumentNote as Documen12_598_2_, product6_.Help as Help598_2_, product6_.UPC as UPC598_2_, product6_.SKU as SKU598_2_, product6_.C_UOM_ID as C16_598_2_, product6_.SalesRep_ID as SalesRep17_598_2_, product6_.IsSummary as IsSummary598_2_, product6_.IsStocked as IsStocked598_2_, product6_.IsPurchased as IsPurch20_598_2_, product6_.IsSold as IsSold598_2_, product6_.IsBOM as IsBOM598_2_, product6_.IsInvoicePrintDetails as IsInvoi23_598_2_, product6_.IsPickListPrintDetails as IsPickL24_598_2_, product6_.IsVerified as IsVerified598_2_, product6_.M_Product_Category_ID as M26_598_2_, product6_.Classification as Classif27_598_2_, product6_.Volume as Volume598_2_, product6_.Weight as Weight598_2_, product6_.ShelfWidth as ShelfWidth598_2_, product6_.ShelfHeight as ShelfHe31_598_2_, product6_.ShelfDepth as ShelfDepth598_2_, product6_.UnitsPerPallet as UnitsPe33_598_2_, product6_.C_TaxCategory_ID as C34_598_2_, product6_.S_Resource_ID as S35_598_2_, product6_.Discontinued as Discont36_598_2_, product6_.DiscontinuedBy as Discont37_598_2_, product6_.Processing as Processing598_2_, product6_.S_ExpenseType_ID as S39_598_2_, product6_.ProductType as Product40_598_2_, product6_.ImageURL as ImageURL598_2_, product6_.DescriptionURL as Descrip42_598_2_, product6_.GuaranteeDays as Guarant43_598_2_, product6_.VersionNo as VersionNo598_2_, product6_.M_AttributeSet_ID as M45_598_2_, product6_.M_AttributeSetInstance_ID as M46_598_2_, product6_.DownloadURL as Downloa47_598_2_, product6_.M_FreightCategory_ID as M48_598_2_, product6_.M_Locator_ID as M49_598_2_, product6_.AD_Image_ID as AD50_598_2_, product6_.C_BPartner_ID as C51_598_2_, product6_.Ispriceprinted as Isprice52_598_2_, product6_.Name2 as Name53_598_2_, product6_.Costtype as Costtype598_2_, product6_.Coststd as Coststd598_2_, product6_.Stock_Min as Stock56_598_2_, product6_.Enforce_Attribute as Enforce57_598_2_, product6_.Calculated as Calculated598_2_, product6_.MA_Processplan_ID as MA59_598_2_, product6_.Production as Production598_2_, product6_.Capacity as Capacity598_2_, product6_.Delaymin as Delaymin598_2_, product6_.MRP_Planner_ID as MRP63_598_2_, product6_.MRP_Planningmethod_ID as MRP64_598_2_, product6_.Qtymax as Qtymax598_2_, product6_.Qtymin as Qtymin598_2_, product6_.Qtystd as Qtystd598_2_, product6_.Qtytype as Qtytype598_2_, product6_.Stockmin as Stockmin598_2_, product6_.EM_Aeat347_Isleasebusiness as EM70_598_2_, product6_.Attrsetvaluetype as Attrset71_598_2_, product6_.EM_Aeat347_Situation as EM72_598_2_, product6_.Isquantityvariable as Isquant73_598_2_, product6_.Isdeferredrevenue as Isdefer74_598_2_, product6_.EM_Aeat347_Referenceid as EM75_598_2_, product6_.EM_Aeat347_Locationtype as EM76_598_2_, product6_.Revplantype as Revplan77_598_2_, product6_.EM_Aeat347_Streetname as EM78_598_2_, product6_.Periodnumber as Periodn79_598_2_, product6_.EM_Aeat347_Streetnumbertype as EM80_598_2_, product6_.Isdeferredexpense as Isdefer81_598_2_, product6_.EM_Aeat347_Streetnumber as EM82_598_2_, product6_.Expplantype as Expplan83_598_2_, product6_.EM_Aeat347_Streetnumberqua as EM84_598_2_, product6_.Periodnumber_Exp as Periodn85_598_2_, product6_.DefaultPeriod as Default86_598_2_, product6_.EM_Aeat347_Building as EM87_598_2_, product6_.DefaultPeriod_Exp as Default88_598_2_, product6_.EM_Aeat347_Hall as EM89_598_2_, product6_.Bookusingpoprice as Bookusi90_598_2_, product6_.EM_Aeat347_Hallway as EM91_598_2_, product6_.EM_Advcrm_Newactivity as EM92_598_2_, product6_.EM_Aeat347_Floor as EM93_598_2_, product6_.C_Uom_Weight_ID as C94_598_2_, product6_.M_Brand_ID as M95_598_2_, product6_.EM_Aeat347_Apartment as EM96_598_2_, product6_.EM_Gcnv_Giftcardtype as EM97_598_2_, product6_.EM_Aeat347_Complement as EM98_598_2_, product6_.EM_Gcnv_Amount as EM99_598_2_, product6_.IsGeneric as IsGeneric598_2_, product6_.EM_Aeat347_Location as EM101_598_2_, product6_.Generic_Product_ID as Generic102_598_2_, product6_.CreateVariants as Create103_598_2_, product6_.EM_Aeat347_County as EM104_598_2_, product6_.Characteristic_Desc as Charac105_598_2_, product6_.EM_Aeat347_Countycode as EM106_598_2_, product6_.EM_Obpos_Scale as EM107_598_2_, product6_.EM_Aeat347_Regioncode as EM108_598_2_, product6_.EM_Gcnv_Allowpartialreturn as EM109_598_2_, product6_.EM_Obpos_Groupedproduct as EM110_598_2_, product6_.Updateinvariants as Update111_598_2_, product6_.EM_Aeat347_Zipcode as EM112_598_2_, product6_.EM_Obpos_Showstock as EM113_598_2_, product6_.ManageVariants as Manage114_598_2_, product6_.EM_Obpos_Show_Ch_Desc as EM115_598_2_, product6_.Prod_Cat_Selection as Prod116_598_2_, product6_.Product_Selection as Product117_598_2_, product6_.Print_Description as Print118_598_2_, product6_.EM_OBPOS_AllowAnonymousSale as EM119_598_2_, product6_.Returnable as Returnable598_2_, product6_.Overdue_Return_Days as Overdue121_598_2_, product6_.Ispricerulebased as Ispric122_598_2_, product6_.Unique_Per_Document as Unique123_598_2_, product6_.EM_Prlab_Qtylabels as EM124_598_2_, product6_.EM_Obpos_Proposal_Type as EM125_598_2_, product6_.Islinkedtoproduct as Islink126_598_2_, product6_.EM_Obpos_Ismultiselectable as EM127_598_2_, product6_.Relateprodcattoservice as Relate128_598_2_, product6_.Relateprodtoservice as Relate129_598_2_, product6_.Quantity_Rule as Quantity130_598_2_, product6_.EM_Mb_Gama_ID as EM131_598_2_, product6_.EM_Mb_Linea_ID as EM132_598_2_, product6_.EM_Obpos_Printservices as EM133_598_2_, product6_.Allow_Deferred_Sell as Allow134_598_2_, product6_.Deferred_Sell_Max_Days as Deferred135_598_2_, product6_.EM_Mb_Set_Promotions as EM136_598_2_, uom7_.AD_Client_ID as AD2_684_3_, uom7_.AD_Org_ID as AD3_684_3_, uom7_.IsActive as IsActive684_3_, uom7_.Created as Created684_3_, uom7_.Updated as Updated684_3_, uom7_.CreatedBy as CreatedBy684_3_, uom7_.UpdatedBy as UpdatedBy684_3_, uom7_.X12DE355 as X9_684_3_, uom7_.UOMSymbol as UOMSymbol684_3_, uom7_.Name as Name684_3_, uom7_.Description as Descrip12_684_3_, uom7_.StdPrecision as StdPrec13_684_3_, uom7_.CostingPrecision as Costing14_684_3_, uom7_.IsDefault as IsDefault684_3_, uom7_.Breakdown as Breakdown684_3_, uom7_.UOM_Type as UOM17_684_3_, uom7_.EM_Obwpack_Isweight as EM18_684_3_, uom7_.Useinproduction as Useinpr19_684_3_, businesspa8_.AD_Client_ID as AD2_144_4_, businesspa8_.AD_Org_ID as AD3_144_4_, businesspa8_.IsActive as IsActive144_4_, businesspa8_.Created as Created144_4_, businesspa8_.CreatedBy as CreatedBy144_4_, businesspa8_.Updated as Updated144_4_, businesspa8_.UpdatedBy as UpdatedBy144_4_, businesspa8_.Value as Value144_4_, businesspa8_.Name as Name144_4_, businesspa8_.Name2 as Name11_144_4_, businesspa8_.Description as Descrip12_144_4_, businesspa8_.IsSummary as IsSummary144_4_, businesspa8_.C_BP_Group_ID as C14_144_4_, businesspa8_.IsOneTime as IsOneTime144_4_, businesspa8_.IsProspect as IsProspect144_4_, businesspa8_.IsVendor as IsVendor144_4_, businesspa8_.IsCustomer as IsCustomer144_4_, businesspa8_.IsEmployee as IsEmployee144_4_, businesspa8_.IsSalesRep as IsSalesRep144_4_, businesspa8_.ReferenceNo as Referen21_144_4_, businesspa8_.DUNS as DUNS144_4_, businesspa8_.URL as URL144_4_, businesspa8_.AD_Language as AD24_144_4_, businesspa8_.TaxID as TaxID144_4_, businesspa8_.IsTaxExempt as IsTaxEx26_144_4_, businesspa8_.C_InvoiceSchedule_ID as C27_144_4_, businesspa8_.Rating as Rating144_4_, businesspa8_.SalesVolume as SalesVo29_144_4_, businesspa8_.NumberEmployees as NumberE30_144_4_, businesspa8_.NAICS as NAICS144_4_, businesspa8_.FirstSale as FirstSale144_4_, businesspa8_.AcqusitionCost as Acqusit33_144_4_, businesspa8_.PotentialLifeTimeValue as Potenti34_144_4_, businesspa8_.ActualLifeTimeValue as ActualL35_144_4_, businesspa8_.ShareOfCustomer as ShareOf36_144_4_, businesspa8_.PaymentRule as Payment37_144_4_, businesspa8_.SO_CreditLimit as SO38_144_4_, businesspa8_.SO_CreditUsed as SO39_144_4_, businesspa8_.C_PaymentTerm_ID as C40_144_4_, businesspa8_.M_PriceList_ID as M41_144_4_, businesspa8_.IsDiscountPrinted as IsDisco42_144_4_, businesspa8_.SO_Description as SO43_144_4_, businesspa8_.POReference as PORefer44_144_4_, businesspa8_.PaymentRulePO as Payment45_144_4_, businesspa8_.PO_PriceList_ID as PO46_144_4_, businesspa8_.PO_PaymentTerm_ID as PO47_144_4_, businesspa8_.DocumentCopies as Documen48_144_4_, businesspa8_.C_Greeting_ID as C49_144_4_, businesspa8_.InvoiceRule as Invoice50_144_4_, businesspa8_.DeliveryRule as Deliver51_144_4_, businesspa8_.DeliveryViaRule as Deliver52_144_4_, businesspa8_.SalesRep_ID as SalesRep53_144_4_, businesspa8_.BPartner_Parent_ID as BPartner54_144_4_, businesspa8_.SOCreditStatus as SOCredi55_144_4_, businesspa8_.AD_Forced_Org_ID as AD56_144_4_, businesspa8_.ShowPriceInOrder as ShowPri57_144_4_, businesspa8_.Invoicegrouping as Invoice58_144_4_, businesspa8_.FixMonthDay as FixMont59_144_4_, businesspa8_.FixMonthDay2 as FixMont60_144_4_, businesspa8_.Fixmonthday3 as Fixmont61_144_4_, businesspa8_.Isworker as Isworker144_4_, businesspa8_.UPC as UPC144_4_, businesspa8_.C_Salary_Category_ID as C64_144_4_, businesspa8_.Invoice_Printformat as Invoice65_144_4_, businesspa8_.Last_Days as Last66_144_4_, businesspa8_.PO_Bankaccount_ID as PO67_144_4_, businesspa8_.PO_BP_TaxCategory_ID as PO68_144_4_, businesspa8_.PO_Fixmonthday as PO69_144_4_, businesspa8_.PO_Fixmonthday2 as PO70_144_4_, businesspa8_.PO_Fixmonthday3 as PO71_144_4_, businesspa8_.SO_Bankaccount_ID as SO72_144_4_, businesspa8_.SO_Bp_Taxcategory_ID as SO73_144_4_, businesspa8_.Fiscalcode as Fiscalcode144_4_, businesspa8_.Isofiscalcode as Isofisc75_144_4_, businesspa8_.EM_Einv_Einvoice as EM76_144_4_, businesspa8_.PO_C_Incoterms_ID as PO77_144_4_, businesspa8_.EM_Einv_Format_Id as EM78_144_4_, businesspa8_.SO_C_Incoterms_ID as SO79_144_4_, businesspa8_.EM_Einv_Platform_Id as EM80_144_4_, businesspa8_.FIN_Paymentmethod_ID as FIN81_144_4_, businesspa8_.EM_Einv_Email as EM82_144_4_, businesspa8_.PO_Paymentmethod_ID as PO83_144_4_, businesspa8_.FIN_Financial_Account_ID as FIN84_144_4_, businesspa8_.EM_Einv_Deliverymode as EM85_144_4_, businesspa8_.PO_Financial_Account_ID as PO86_144_4_, businesspa8_.Customer_Blocking as Customer87_144_4_, businesspa8_.Vendor_Blocking as Vendor88_144_4_, businesspa8_.SO_Payment_Blocking as SO89_144_4_, businesspa8_.PO_Payment_Blocking as PO90_144_4_, businesspa8_.SO_Invoice_Blocking as SO91_144_4_, businesspa8_.PO_Invoice_Blocking as PO92_144_4_, businesspa8_.SO_Order_Blocking as SO93_144_4_, businesspa8_.PO_Order_Blocking as PO94_144_4_, businesspa8_.SO_Goods_Blocking as SO95_144_4_, businesspa8_.PO_Goods_Blocking as PO96_144_4_, businesspa8_.Iscashvat as Iscashvat144_4_, businesspa8_.EM_Advcrm_Newactivity as EM98_144_4_, businesspa8_.EM_Rrhh_Exemployee as EM99_144_4_, businesspa8_.BP_Currency_ID as BP100_144_4_, businesspa8_.EM_Rrhh_Candidate as EM101_144_4_, businesspa8_.EM_Mb_Cambio_Org as EM102_144_4_, businesspa8_.EM_Mb_Parentbpartner_ID as EM103_144_4_, businesspa8_.EM_Mb_Print_Offers as EM104_144_4_, businesspa8_.EM_Obsepad_Mandate_Identifier as EM105_144_4_, businesspa8_.EM_Obsepad_Mandate_Date as EM106_144_4_, businesspa8_.EM_Mb_Activarfacturacion as EM107_144_4_, businesspa8_.EM_Pricm_Isintercompany as EM108_144_4_, businesspa8_.EM_Rrhh_Available_Days as EM109_144_4_, businesspa8_.EM_Rrhh_Available_Hours as EM110_144_4_, businesspa8_.EM_Pruti_Addbp as EM111_144_4_, businesspa8_.EM_OBTIK_Tax_ID_Key as EM112_144_4_, businesspa8_.Update_Currency as Update113_144_4_, attributes1_.AD_Client_ID as AD2_137_5_, attributes1_.AD_Org_ID as AD3_137_5_, attributes1_.IsActive as IsActive137_5_, attributes1_.Created as Created137_5_, attributes1_.CreatedBy as CreatedBy137_5_, attributes1_.Updated as Updated137_5_, attributes1_.UpdatedBy as UpdatedBy137_5_, attributes1_.M_AttributeSet_ID as M9_137_5_, attributes1_.SerNo as SerNo137_5_, attributes1_.Lot as Lot137_5_, attributes1_.GuaranteeDate as Guarant12_137_5_, attributes1_.Description as Descrip13_137_5_, attributes1_.M_Lot_ID as M14_137_5_, attributes1_.Islocked as Islocked137_5_, attributes1_.Lock_Description as Lock16_137_5_ from M_InOutLine materialmg0_ left outer join M_AttributeSetInstance attributes1_ on materialmg0_.M_AttributeSetInstance_ID=attributes1_.M_AttributeSetInstance_ID inner join M_InOut materialmg2_ on materialmg0_.M_InOut_ID=materialmg2_.M_InOut_ID inner join C_DocType documentty3_ on materialmg2_.C_DocType_ID=documentty3_.C_DocType_ID inner join C_BPartner businesspa8_ on materialmg2_.C_BPartner_ID=businesspa8_.C_BPartner_ID inner join AD_Org organizati4_ on materialmg0_.AD_Org_ID=organizati4_.AD_Org_ID inner join AD_Client adclient5_ on materialmg0_.AD_Client_ID=adclient5_.AD_Client_ID inner join M_Product product6_ on materialmg0_.M_Product_ID=product6_.M_Product_ID inner join C_UOM uom7_ on materialmg0_.C_UOM_ID=uom7_.C_UOM_ID where materialmg2_.C_BPartner_ID=$8 and documentty3_.IsReturn='N' and materialmg2_.Processed='Y' and materialmg2_.DocStatus<>'VO' and materialmg2_.IsSOTrx='Y' and materialmg0_.MovementQty+coalesce((select sum(orderline29_.QtyOrdered) from C_OrderLine orderline29_ inner join C_Order order30_ on orderline29_.C_Order_ID=order30_.C_Order_ID where orderline29_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID and order30_.Processed='Y' and order30_.DocStatus<>'VO'), 0)<>0 and ((select orderline31_.C_Order_Discount_ID from C_OrderLine orderline31_, C_Order_Discount orderdisco32_ where orderline31_.C_Order_Discount_ID=orderdisco32_.C_Order_Discount_ID and orderline31_.C_OrderLine_ID=materialmg0_.C_OrderLine_ID) is null) and (materialmg0_.AD_Client_ID in ('0' , '0EB94635A29640C880C9DC4D1A5775A3')) and (materialmg0_.AD_Org_ID in ('0' , '605F5A85AE3D4A9788C4B2E65BDF4A51' , 'F6859E902EC34244A4D73744F44C28E2' , 'D8FB85462A2B4333AA69EF2A0CAEEBE2' , '451631AD2163463B8BB90B9EE8D98C0F')) and (materialmg2_.MovementDate>=now()-90 or case when (select 'Y' from C_OrderLine orderline33_ where orderline33_.C_Order_ID=$9 and orderline33_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID) is null then false else true end=true) order by col_12_0_ desc, col_12_0_ desc, materialmg2_.MovementDate desc, materialmg2_.DocumentNo desc, materialmg0_.Line limit $10 2017-04-04 11:03:41 CEST [10992-2] tad@mapex DETAIL: parameters: $1 = 'E076700B48434B5E8E85F70FF388BA0F', $2 = 'E076700B48434B5E8E85F70FF388BA0F', $3 = 'E076700B48434B5E8E85F70FF388BA0F', $4 = 'E076700B48434B5E8E85F70FF388BA0F', $5 = 'E076700B48434B5E8E85F70FF388BA0F', $6 = 'E076700B48434B5E8E85F70FF388BA0F', $7 = 'E076700B48434B5E8E85F70FF388BA0F', $8 = 'A0265D97D63F4B65924C94C9C2463C7F', $9 = 'E076700B48434B5E8E85F70FF388BA0F', $10 = '101' 2017-04-04 11:04:11 CEST [10992-3] tad@mapex LOG: duration: 17991.887 ms execute S_8757/C_8758: select materialmg0_.M_InOutLine_ID as col_0_0_, materialmg0_.AD_Org_ID as col_1_0_, materialmg0_.AD_Client_ID as col_2_0_, materialmg0_.M_Product_ID as col_3_0_, materialmg0_.C_UOM_ID as col_4_0_, materialmg0_.M_InOutLine_ID as col_5_0_, materialmg0_.MovementQty as col_6_0_, materialmg2_.C_BPartner_ID as col_7_0_, materialmg2_.DocumentNo as col_8_0_, materialmg2_.MovementDate as col_9_0_, attributes1_.M_AttributeSetInstance_ID as col_10_0_, coalesce((select sum(orderline9_.QtyOrdered) from C_OrderLine orderline9_ inner join C_Order order10_ on orderline9_.C_Order_ID=order10_.C_Order_ID where orderline9_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID and order10_.Processed='Y' and order10_.DocStatus<>'VO'), 0)*-1 as col_11_0_, case when (select 'Y' from C_OrderLine orderline11_ where orderline11_.C_Order_ID=$1 and orderline11_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID) is null then false else true end as col_12_0_, coalesce((select orderline12_.QtyOrdered from C_OrderLine orderline12_ where orderline12_.C_Order_ID=$2 and orderline12_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID), 0)*-1 as col_13_0_, (select orderline13_.C_Return_Reason_ID from C_OrderLine orderline13_, C_Return_Reason returnreas14_ where orderline13_.C_Return_Reason_ID=returnreas14_.C_Return_Reason_ID and orderline13_.C_Order_ID=$3 and orderline13_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID) as col_14_0_, coalesce((select orderline15_.C_Tax_ID from C_OrderLine orderline15_ where orderline15_.C_Order_ID=$4 and orderline15_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID), (select orderline17_.C_Tax_ID from M_InOutLine materialmg16_, C_OrderLine orderline17_ where materialmg16_.C_OrderLine_ID=orderline17_.C_OrderLine_ID and materialmg16_.M_InOutLine_ID=materialmg0_.M_InOutLine_ID)) as col_15_0_, case when (select pricingpri19_.IsTaxIncluded from C_Order order18_, M_PriceList pricingpri19_ where order18_.M_PriceList_ID=pricingpri19_.M_PriceList_ID and order18_.C_Order_ID=$5)='Y' then coalesce((select orderline20_.PriceActual from C_OrderLine orderline20_ where orderline20_.C_Order_ID=$6 and orderline20_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID), (select orderline22_.Gross_Unit_Price from M_InOutLine materialmg21_, C_OrderLine orderline22_ where materialmg21_.C_OrderLine_ID=orderline22_.C_OrderLine_ID and materialmg21_.M_InOutLine_ID=materialmg0_.M_InOutLine_ID)) else coalesce((select orderline23_.PriceActual from C_OrderLine orderline23_ where orderline23_.C_Order_ID=$7 and orderline23_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID), (select orderline25_.PriceActual from M_InOutLine materialmg24_, C_OrderLine orderline25_ where materialmg24_.C_OrderLine_ID=orderline25_.C_OrderLine_ID and materialmg24_.M_InOutLine_ID=materialmg0_.M_InOutLine_ID)) end as col_16_0_, (select order28_.DocumentNo from M_InOutLine materialmg26_, C_OrderLine orderline27_, C_Order order28_ where materialmg26_.C_OrderLine_ID=orderline27_.C_OrderLine_ID and orderline27_.C_Order_ID=order28_.C_Order_ID and materialmg26_.M_InOutLine_ID=materialmg0_.M_InOutLine_ID) as col_17_0_, organizati4_.AD_Org_ID as AD1_554_0_, adclient5_.AD_Client_ID as AD1_30_1_, product6_.M_Product_ID as M1_598_2_, uom7_.C_UOM_ID as C1_684_3_, businesspa8_.C_BPartner_ID as C1_144_4_, attributes1_.M_AttributeSetInstance_ID as M1_137_5_, organizati4_.AD_Client_ID as AD2_554_0_, organizati4_.IsActive as IsActive554_0_, organizati4_.Created as Created554_0_, organizati4_.CreatedBy as CreatedBy554_0_, organizati4_.Updated as Updated554_0_, organizati4_.UpdatedBy as UpdatedBy554_0_, organizati4_.Value as Value554_0_, organizati4_.Name as Name554_0_, organizati4_.Description as Descrip10_554_0_, organizati4_.IsSummary as IsSummary554_0_, organizati4_.AD_Orgtype_ID as AD12_554_0_, organizati4_.IsPeriodControlAllowed as IsPerio13_554_0_, organizati4_.C_Calendar_ID as C14_554_0_, organizati4_.IsReady as IsReady554_0_, organizati4_.Social_Name as Social16_554_0_, organizati4_.C_Currency_ID as C17_554_0_, organizati4_.EM_OBRETCO_RetailOrgType as EM18_554_0_, organizati4_.EM_OBRETCO_Pricelist_ID as EM19_554_0_, organizati4_.C_Acctschema_ID as C20_554_0_, organizati4_.EM_OBMFM_Product_ID as EM21_554_0_, organizati4_.EM_OBRETCO_Productlist_ID as EM22_554_0_, organizati4_.EM_Obretco_C_Bpartner_ID as EM23_554_0_, organizati4_.EM_Obwpack_Uom_ID as EM24_554_0_, organizati4_.EM_Obretco_C_bp_Location_ID as EM25_554_0_, organizati4_.EM_Obretco_M_Warehouse_ID as EM26_554_0_, organizati4_.EM_Obretco_dbp_irulesid as EM27_554_0_, organizati4_.EM_Obretco_dbp_ptermid as EM28_554_0_, organizati4_.EM_Obretco_dbp_pmethodid as EM29_554_0_, organizati4_.EM_Obretco_dbp_bpcatid as EM30_554_0_, organizati4_.EM_Obretco_dbp_countryid as EM31_554_0_, organizati4_.EM_Obretco_dbp_orgid as EM32_554_0_, organizati4_.EM_Obretco_Showtaxid as EM33_554_0_, organizati4_.EM_OBPOSBD_Best_Deal_Case as EM34_554_0_, organizati4_.EM_Obpos_Ticket_Template_ID as EM35_554_0_, organizati4_.EM_Obretco_Showbpcategory as EM36_554_0_, organizati4_.EM_OBPOSBD_Prevent_Long_Ex as EM37_554_0_, organizati4_.EM_Obpos_Cashup_Template_ID as EM38_554_0_, organizati4_.EM_Obpos_Format_Decimal as EM39_554_0_, organizati4_.EM_Obpos_Format_Group as EM40_554_0_, organizati4_.EM_Obpos_Date_Format as EM41_554_0_, organizati4_.EM_Obpos_Closedreceipt_Tem_ID as EM42_554_0_, organizati4_.EM_Obpos_Invoice_Template_ID as EM43_554_0_, organizati4_.EM_Obpos_Ret_Inv_Template_ID as EM44_554_0_, organizati4_.EM_Obpos_Layaway_Template_ID as EM45_554_0_, organizati4_.EM_Obpos_Return_Template_ID as EM46_554_0_, organizati4_.EM_Obpos_Quot_Template_ID as EM47_554_0_, organizati4_.EM_Obpos_Count_Diff_Limit as EM48_554_0_, organizati4_.EM_Obpos_Select_Cc_Warehouse as EM49_554_0_, organizati4_.EM_Obpos_Warehouse_Selection as EM50_554_0_, organizati4_.EM_Obpos_Layaway_Anonymousbp as EM51_554_0_, organizati4_.EM_Obpos_Layaway_Partpaid as EM52_554_0_, organizati4_.EM_Obpos_Cashmgm_Template_ID as EM53_554_0_, organizati4_.EM_Obpos_Clo_Inv_Template_ID as EM54_554_0_, organizati4_.EM_Obpos_Canc_Rpt_Template_ID as EM55_554_0_, organizati4_.EM_OBRTM_TMReceiptTemplate as EM56_554_0_, adclient5_.AD_Org_ID as AD2_30_1_, adclient5_.IsActive as IsActive30_1_, adclient5_.Created as Created30_1_, adclient5_.CreatedBy as CreatedBy30_1_, adclient5_.Updated as Updated30_1_, adclient5_.UpdatedBy as UpdatedBy30_1_, adclient5_.Value as Value30_1_, adclient5_.Name as Name30_1_, adclient5_.Description as Descrip10_30_1_, adclient5_.SMTPHost as SMTPHost30_1_, adclient5_.RequestEMail as Request12_30_1_, adclient5_.RequestUser as Request13_30_1_, adclient5_.RequestUserPW as Request14_30_1_, adclient5_.RequestFolder as Request15_30_1_, adclient5_.AD_Language as AD16_30_1_, adclient5_.IsMultiLingualDocument as IsMulti17_30_1_, adclient5_.IsSmtpAuthorization as IsSmtpA18_30_1_, adclient5_.C_Currency_ID as C19_30_1_, adclient5_.Acctdim_Centrally_Maintained as Acctdim20_30_1_, adclient5_.Project_Acctdim_Isenable as Project21_30_1_, adclient5_.Project_Acctdim_Header as Project22_30_1_, adclient5_.Project_Acctdim_Lines as Project23_30_1_, adclient5_.Project_Acctdim_Breakdown as Project24_30_1_, adclient5_.Bpartner_Acctdim_Isenable as Bpartner25_30_1_, adclient5_.Bpartner_Acctdim_Header as Bpartner26_30_1_, adclient5_.Bpartner_Acctdim_Lines as Bpartner27_30_1_, adclient5_.Bpartner_Acctdim_Breakdown as Bpartner28_30_1_, adclient5_.Product_Acctdim_Isenable as Product29_30_1_, adclient5_.Product_Acctdim_Header as Product30_30_1_, adclient5_.Product_Acctdim_Lines as Product31_30_1_, adclient5_.Product_Acctdim_Breakdown as Product32_30_1_, adclient5_.Costcenter_Acctdim_Header as Costcenter33_30_1_, adclient5_.Costcenter_Acctdim_Lines as Costcenter34_30_1_, adclient5_.Costcenter_Acctdim_Breakdown as Costcenter35_30_1_, adclient5_.User1_Acctdim_Isenable as User36_30_1_, adclient5_.User1_Acctdim_Header as User37_30_1_, adclient5_.User1_Acctdim_Lines as User38_30_1_, adclient5_.User1_Acctdim_Breakdown as User39_30_1_, adclient5_.User2_Acctdim_Isenable as User40_30_1_, adclient5_.User2_Acctdim_Header as User41_30_1_, adclient5_.User2_Acctdim_Lines as User42_30_1_, adclient5_.User2_Acctdim_Breakdown as User43_30_1_, adclient5_.Costcenter_Acctdim_Isenable as Costcenter44_30_1_, adclient5_.Org_Acctdim_Isenable as Org45_30_1_, adclient5_.Org_Acctdim_Header as Org46_30_1_, adclient5_.Org_Acctdim_Lines as Org47_30_1_, adclient5_.Org_Acctdim_Breakdown as Org48_30_1_, adclient5_.EM_Obmobc_Auth_Key as EM49_30_1_, adclient5_.EM_Pricm_Invoiceschedule_ID as EM50_30_1_, adclient5_.DaysToPasswordExpiration as DaysToP51_30_1_, product6_.AD_Client_ID as AD2_598_2_, product6_.AD_Org_ID as AD3_598_2_, product6_.IsActive as IsActive598_2_, product6_.Created as Created598_2_, product6_.CreatedBy as CreatedBy598_2_, product6_.Updated as Updated598_2_, product6_.UpdatedBy as UpdatedBy598_2_, product6_.Value as Value598_2_, product6_.Name as Name598_2_, product6_.Description as Descrip11_598_2_, product6_.DocumentNote as Documen12_598_2_, product6_.Help as Help598_2_, product6_.UPC as UPC598_2_, product6_.SKU as SKU598_2_, product6_.C_UOM_ID as C16_598_2_, product6_.SalesRep_ID as SalesRep17_598_2_, product6_.IsSummary as IsSummary598_2_, product6_.IsStocked as IsStocked598_2_, product6_.IsPurchased as IsPurch20_598_2_, product6_.IsSold as IsSold598_2_, product6_.IsBOM as IsBOM598_2_, product6_.IsInvoicePrintDetails as IsInvoi23_598_2_, product6_.IsPickListPrintDetails as IsPickL24_598_2_, product6_.IsVerified as IsVerified598_2_, product6_.M_Product_Category_ID as M26_598_2_, product6_.Classification as Classif27_598_2_, product6_.Volume as Volume598_2_, product6_.Weight as Weight598_2_, product6_.ShelfWidth as ShelfWidth598_2_, product6_.ShelfHeight as ShelfHe31_598_2_, product6_.ShelfDepth as ShelfDepth598_2_, product6_.UnitsPerPallet as UnitsPe33_598_2_, product6_.C_TaxCategory_ID as C34_598_2_, product6_.S_Resource_ID as S35_598_2_, product6_.Discontinued as Discont36_598_2_, product6_.DiscontinuedBy as Discont37_598_2_, product6_.Processing as Processing598_2_, product6_.S_ExpenseType_ID as S39_598_2_, product6_.ProductType as Product40_598_2_, product6_.ImageURL as ImageURL598_2_, product6_.DescriptionURL as Descrip42_598_2_, product6_.GuaranteeDays as Guarant43_598_2_, product6_.VersionNo as VersionNo598_2_, product6_.M_AttributeSet_ID as M45_598_2_, product6_.M_AttributeSetInstance_ID as M46_598_2_, product6_.DownloadURL as Downloa47_598_2_, product6_.M_FreightCategory_ID as M48_598_2_, product6_.M_Locator_ID as M49_598_2_, product6_.AD_Image_ID as AD50_598_2_, product6_.C_BPartner_ID as C51_598_2_, product6_.Ispriceprinted as Isprice52_598_2_, product6_.Name2 as Name53_598_2_, product6_.Costtype as Costtype598_2_, product6_.Coststd as Coststd598_2_, product6_.Stock_Min as Stock56_598_2_, product6_.Enforce_Attribute as Enforce57_598_2_, product6_.Calculated as Calculated598_2_, product6_.MA_Processplan_ID as MA59_598_2_, product6_.Production as Production598_2_, product6_.Capacity as Capacity598_2_, product6_.Delaymin as Delaymin598_2_, product6_.MRP_Planner_ID as MRP63_598_2_, product6_.MRP_Planningmethod_ID as MRP64_598_2_, product6_.Qtymax as Qtymax598_2_, product6_.Qtymin as Qtymin598_2_, product6_.Qtystd as Qtystd598_2_, product6_.Qtytype as Qtytype598_2_, product6_.Stockmin as Stockmin598_2_, product6_.EM_Aeat347_Isleasebusiness as EM70_598_2_, product6_.Attrsetvaluetype as Attrset71_598_2_, product6_.EM_Aeat347_Situation as EM72_598_2_, product6_.Isquantityvariable as Isquant73_598_2_, product6_.Isdeferredrevenue as Isdefer74_598_2_, product6_.EM_Aeat347_Referenceid as EM75_598_2_, product6_.EM_Aeat347_Locationtype as EM76_598_2_, product6_.Revplantype as Revplan77_598_2_, product6_.EM_Aeat347_Streetname as EM78_598_2_, product6_.Periodnumber as Periodn79_598_2_, product6_.EM_Aeat347_Streetnumbertype as EM80_598_2_, product6_.Isdeferredexpense as Isdefer81_598_2_, product6_.EM_Aeat347_Streetnumber as EM82_598_2_, product6_.Expplantype as Expplan83_598_2_, product6_.EM_Aeat347_Streetnumberqua as EM84_598_2_, product6_.Periodnumber_Exp as Periodn85_598_2_, product6_.DefaultPeriod as Default86_598_2_, product6_.EM_Aeat347_Building as EM87_598_2_, product6_.DefaultPeriod_Exp as Default88_598_2_, product6_.EM_Aeat347_Hall as EM89_598_2_, product6_.Bookusingpoprice as Bookusi90_598_2_, product6_.EM_Aeat347_Hallway as EM91_598_2_, product6_.EM_Advcrm_Newactivity as EM92_598_2_, product6_.EM_Aeat347_Floor as EM93_598_2_, product6_.C_Uom_Weight_ID as C94_598_2_, product6_.M_Brand_ID as M95_598_2_, product6_.EM_Aeat347_Apartment as EM96_598_2_, product6_.EM_Gcnv_Giftcardtype as EM97_598_2_, product6_.EM_Aeat347_Complement as EM98_598_2_, product6_.EM_Gcnv_Amount as EM99_598_2_, product6_.IsGeneric as IsGeneric598_2_, product6_.EM_Aeat347_Location as EM101_598_2_, product6_.Generic_Product_ID as Generic102_598_2_, product6_.CreateVariants as Create103_598_2_, product6_.EM_Aeat347_County as EM104_598_2_, product6_.Characteristic_Desc as Charac105_598_2_, product6_.EM_Aeat347_Countycode as EM106_598_2_, product6_.EM_Obpos_Scale as EM107_598_2_, product6_.EM_Aeat347_Regioncode as EM108_598_2_, product6_.EM_Gcnv_Allowpartialreturn as EM109_598_2_, product6_.EM_Obpos_Groupedproduct as EM110_598_2_, product6_.Updateinvariants as Update111_598_2_, product6_.EM_Aeat347_Zipcode as EM112_598_2_, product6_.EM_Obpos_Showstock as EM113_598_2_, product6_.ManageVariants as Manage114_598_2_, product6_.EM_Obpos_Show_Ch_Desc as EM115_598_2_, product6_.Prod_Cat_Selection as Prod116_598_2_, product6_.Product_Selection as Product117_598_2_, product6_.Print_Description as Print118_598_2_, product6_.EM_OBPOS_AllowAnonymousSale as EM119_598_2_, product6_.Returnable as Returnable598_2_, product6_.Overdue_Return_Days as Overdue121_598_2_, product6_.Ispricerulebased as Ispric122_598_2_, product6_.Unique_Per_Document as Unique123_598_2_, product6_.EM_Prlab_Qtylabels as EM124_598_2_, product6_.EM_Obpos_Proposal_Type as EM125_598_2_, product6_.Islinkedtoproduct as Islink126_598_2_, product6_.EM_Obpos_Ismultiselectable as EM127_598_2_, product6_.Relateprodcattoservice as Relate128_598_2_, product6_.Relateprodtoservice as Relate129_598_2_, product6_.Quantity_Rule as Quantity130_598_2_, product6_.EM_Mb_Gama_ID as EM131_598_2_, product6_.EM_Mb_Linea_ID as EM132_598_2_, product6_.EM_Obpos_Printservices as EM133_598_2_, product6_.Allow_Deferred_Sell as Allow134_598_2_, product6_.Deferred_Sell_Max_Days as Deferred135_598_2_, product6_.EM_Mb_Set_Promotions as EM136_598_2_, uom7_.AD_Client_ID as AD2_684_3_, uom7_.AD_Org_ID as AD3_684_3_, uom7_.IsActive as IsActive684_3_, uom7_.Created as Created684_3_, uom7_.Updated as Updated684_3_, uom7_.CreatedBy as CreatedBy684_3_, uom7_.UpdatedBy as UpdatedBy684_3_, uom7_.X12DE355 as X9_684_3_, uom7_.UOMSymbol as UOMSymbol684_3_, uom7_.Name as Name684_3_, uom7_.Description as Descrip12_684_3_, uom7_.StdPrecision as StdPrec13_684_3_, uom7_.CostingPrecision as Costing14_684_3_, uom7_.IsDefault as IsDefault684_3_, uom7_.Breakdown as Breakdown684_3_, uom7_.UOM_Type as UOM17_684_3_, uom7_.EM_Obwpack_Isweight as EM18_684_3_, uom7_.Useinproduction as Useinpr19_684_3_, businesspa8_.AD_Client_ID as AD2_144_4_, businesspa8_.AD_Org_ID as AD3_144_4_, businesspa8_.IsActive as IsActive144_4_, businesspa8_.Created as Created144_4_, businesspa8_.CreatedBy as CreatedBy144_4_, businesspa8_.Updated as Updated144_4_, businesspa8_.UpdatedBy as UpdatedBy144_4_, businesspa8_.Value as Value144_4_, businesspa8_.Name as Name144_4_, businesspa8_.Name2 as Name11_144_4_, businesspa8_.Description as Descrip12_144_4_, businesspa8_.IsSummary as IsSummary144_4_, businesspa8_.C_BP_Group_ID as C14_144_4_, businesspa8_.IsOneTime as IsOneTime144_4_, businesspa8_.IsProspect as IsProspect144_4_, businesspa8_.IsVendor as IsVendor144_4_, businesspa8_.IsCustomer as IsCustomer144_4_, businesspa8_.IsEmployee as IsEmployee144_4_, businesspa8_.IsSalesRep as IsSalesRep144_4_, businesspa8_.ReferenceNo as Referen21_144_4_, businesspa8_.DUNS as DUNS144_4_, businesspa8_.URL as URL144_4_, businesspa8_.AD_Language as AD24_144_4_, businesspa8_.TaxID as TaxID144_4_, businesspa8_.IsTaxExempt as IsTaxEx26_144_4_, businesspa8_.C_InvoiceSchedule_ID as C27_144_4_, businesspa8_.Rating as Rating144_4_, businesspa8_.SalesVolume as SalesVo29_144_4_, businesspa8_.NumberEmployees as NumberE30_144_4_, businesspa8_.NAICS as NAICS144_4_, businesspa8_.FirstSale as FirstSale144_4_, businesspa8_.AcqusitionCost as Acqusit33_144_4_, businesspa8_.PotentialLifeTimeValue as Potenti34_144_4_, businesspa8_.ActualLifeTimeValue as ActualL35_144_4_, businesspa8_.ShareOfCustomer as ShareOf36_144_4_, businesspa8_.PaymentRule as Payment37_144_4_, businesspa8_.SO_CreditLimit as SO38_144_4_, businesspa8_.SO_CreditUsed as SO39_144_4_, businesspa8_.C_PaymentTerm_ID as C40_144_4_, businesspa8_.M_PriceList_ID as M41_144_4_, businesspa8_.IsDiscountPrinted as IsDisco42_144_4_, businesspa8_.SO_Description as SO43_144_4_, businesspa8_.POReference as PORefer44_144_4_, businesspa8_.PaymentRulePO as Payment45_144_4_, businesspa8_.PO_PriceList_ID as PO46_144_4_, businesspa8_.PO_PaymentTerm_ID as PO47_144_4_, businesspa8_.DocumentCopies as Documen48_144_4_, businesspa8_.C_Greeting_ID as C49_144_4_, businesspa8_.InvoiceRule as Invoice50_144_4_, businesspa8_.DeliveryRule as Deliver51_144_4_, businesspa8_.DeliveryViaRule as Deliver52_144_4_, businesspa8_.SalesRep_ID as SalesRep53_144_4_, businesspa8_.BPartner_Parent_ID as BPartner54_144_4_, businesspa8_.SOCreditStatus as SOCredi55_144_4_, businesspa8_.AD_Forced_Org_ID as AD56_144_4_, businesspa8_.ShowPriceInOrder as ShowPri57_144_4_, businesspa8_.Invoicegrouping as Invoice58_144_4_, businesspa8_.FixMonthDay as FixMont59_144_4_, businesspa8_.FixMonthDay2 as FixMont60_144_4_, businesspa8_.Fixmonthday3 as Fixmont61_144_4_, businesspa8_.Isworker as Isworker144_4_, businesspa8_.UPC as UPC144_4_, businesspa8_.C_Salary_Category_ID as C64_144_4_, businesspa8_.Invoice_Printformat as Invoice65_144_4_, businesspa8_.Last_Days as Last66_144_4_, businesspa8_.PO_Bankaccount_ID as PO67_144_4_, businesspa8_.PO_BP_TaxCategory_ID as PO68_144_4_, businesspa8_.PO_Fixmonthday as PO69_144_4_, businesspa8_.PO_Fixmonthday2 as PO70_144_4_, businesspa8_.PO_Fixmonthday3 as PO71_144_4_, businesspa8_.SO_Bankaccount_ID as SO72_144_4_, businesspa8_.SO_Bp_Taxcategory_ID as SO73_144_4_, businesspa8_.Fiscalcode as Fiscalcode144_4_, businesspa8_.Isofiscalcode as Isofisc75_144_4_, businesspa8_.EM_Einv_Einvoice as EM76_144_4_, businesspa8_.PO_C_Incoterms_ID as PO77_144_4_, businesspa8_.EM_Einv_Format_Id as EM78_144_4_, businesspa8_.SO_C_Incoterms_ID as SO79_144_4_, businesspa8_.EM_Einv_Platform_Id as EM80_144_4_, businesspa8_.FIN_Paymentmethod_ID as FIN81_144_4_, businesspa8_.EM_Einv_Email as EM82_144_4_, businesspa8_.PO_Paymentmethod_ID as PO83_144_4_, businesspa8_.FIN_Financial_Account_ID as FIN84_144_4_, businesspa8_.EM_Einv_Deliverymode as EM85_144_4_, businesspa8_.PO_Financial_Account_ID as PO86_144_4_, businesspa8_.Customer_Blocking as Customer87_144_4_, businesspa8_.Vendor_Blocking as Vendor88_144_4_, businesspa8_.SO_Payment_Blocking as SO89_144_4_, businesspa8_.PO_Payment_Blocking as PO90_144_4_, businesspa8_.SO_Invoice_Blocking as SO91_144_4_, businesspa8_.PO_Invoice_Blocking as PO92_144_4_, businesspa8_.SO_Order_Blocking as SO93_144_4_, businesspa8_.PO_Order_Blocking as PO94_144_4_, businesspa8_.SO_Goods_Blocking as SO95_144_4_, businesspa8_.PO_Goods_Blocking as PO96_144_4_, businesspa8_.Iscashvat as Iscashvat144_4_, businesspa8_.EM_Advcrm_Newactivity as EM98_144_4_, businesspa8_.EM_Rrhh_Exemployee as EM99_144_4_, businesspa8_.BP_Currency_ID as BP100_144_4_, businesspa8_.EM_Rrhh_Candidate as EM101_144_4_, businesspa8_.EM_Mb_Cambio_Org as EM102_144_4_, businesspa8_.EM_Mb_Parentbpartner_ID as EM103_144_4_, businesspa8_.EM_Mb_Print_Offers as EM104_144_4_, businesspa8_.EM_Obsepad_Mandate_Identifier as EM105_144_4_, businesspa8_.EM_Obsepad_Mandate_Date as EM106_144_4_, businesspa8_.EM_Mb_Activarfacturacion as EM107_144_4_, businesspa8_.EM_Pricm_Isintercompany as EM108_144_4_, businesspa8_.EM_Rrhh_Available_Days as EM109_144_4_, businesspa8_.EM_Rrhh_Available_Hours as EM110_144_4_, businesspa8_.EM_Pruti_Addbp as EM111_144_4_, businesspa8_.EM_OBTIK_Tax_ID_Key as EM112_144_4_, businesspa8_.Update_Currency as Update113_144_4_, attributes1_.AD_Client_ID as AD2_137_5_, attributes1_.AD_Org_ID as AD3_137_5_, attributes1_.IsActive as IsActive137_5_, attributes1_.Created as Created137_5_, attributes1_.CreatedBy as CreatedBy137_5_, attributes1_.Updated as Updated137_5_, attributes1_.UpdatedBy as UpdatedBy137_5_, attributes1_.M_AttributeSet_ID as M9_137_5_, attributes1_.SerNo as SerNo137_5_, attributes1_.Lot as Lot137_5_, attributes1_.GuaranteeDate as Guarant12_137_5_, attributes1_.Description as Descrip13_137_5_, attributes1_.M_Lot_ID as M14_137_5_, attributes1_.Islocked as Islocked137_5_, attributes1_.Lock_Description as Lock16_137_5_ from M_InOutLine materialmg0_ left outer join M_AttributeSetInstance attributes1_ on materialmg0_.M_AttributeSetInstance_ID=attributes1_.M_AttributeSetInstance_ID inner join M_InOut materialmg2_ on materialmg0_.M_InOut_ID=materialmg2_.M_InOut_ID inner join C_DocType documentty3_ on materialmg2_.C_DocType_ID=documentty3_.C_DocType_ID inner join C_BPartner businesspa8_ on materialmg2_.C_BPartner_ID=businesspa8_.C_BPartner_ID inner join AD_Org organizati4_ on materialmg0_.AD_Org_ID=organizati4_.AD_Org_ID inner join AD_Client adclient5_ on materialmg0_.AD_Client_ID=adclient5_.AD_Client_ID inner join M_Product product6_ on materialmg0_.M_Product_ID=product6_.M_Product_ID inner join C_UOM uom7_ on materialmg0_.C_UOM_ID=uom7_.C_UOM_ID where materialmg2_.C_BPartner_ID=$8 and documentty3_.IsReturn='N' and materialmg2_.Processed='Y' and materialmg2_.DocStatus<>'VO' and materialmg2_.IsSOTrx='Y' and materialmg0_.MovementQty+coalesce((select sum(orderline29_.QtyOrdered) from C_OrderLine orderline29_ inner join C_Order order30_ on orderline29_.C_Order_ID=order30_.C_Order_ID where orderline29_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID and order30_.Processed='Y' and order30_.DocStatus<>'VO'), 0)<>0 and ((select orderline31_.C_Order_Discount_ID from C_OrderLine orderline31_, C_Order_Discount orderdisco32_ where orderline31_.C_Order_Discount_ID=orderdisco32_.C_Order_Discount_ID and orderline31_.C_OrderLine_ID=materialmg0_.C_OrderLine_ID) is null) and (materialmg0_.AD_Client_ID in ('0' , '0EB94635A29640C880C9DC4D1A5775A3')) and (materialmg0_.AD_Org_ID in ('0' , '605F5A85AE3D4A9788C4B2E65BDF4A51' , 'F6859E902EC34244A4D73744F44C28E2' , 'D8FB85462A2B4333AA69EF2A0CAEEBE2' , '451631AD2163463B8BB90B9EE8D98C0F')) and (materialmg2_.MovementDate>=now()-90 or case when (select 'Y' from C_OrderLine orderline33_ where orderline33_.C_Order_ID=$9 and orderline33_.M_Inoutline_ID=materialmg0_.M_InOutLine_ID) is null then false else true end=true) order by col_12_0_ desc, col_12_0_ desc, materialmg2_.MovementDate desc, materialmg2_.DocumentNo desc, materialmg0_.Line limit $10 offset $11 2017-04-04 11:04:11 CEST [10992-4] tad@mapex DETAIL: parameters: $1 = 'E076700B48434B5E8E85F70FF388BA0F', $2 = 'E076700B48434B5E8E85F70FF388BA0F', $3 = 'E076700B48434B5E8E85F70FF388BA0F', $4 = 'E076700B48434B5E8E85F70FF388BA0F', $5 = 'E076700B48434B5E8E85F70FF388BA0F', $6 = 'E076700B48434B5E8E85F70FF388BA0F', $7 = 'E076700B48434B5E8E85F70FF388BA0F', $8 = 'A0265D97D63F4B65924C94C9C2463C7F', $9 = 'E076700B48434B5E8E85F70FF388BA0F', $10 = '101', $11 = '100'