获取`错误填充reportError执行sql语句`与MySQL

时间:2016-10-27 06:10:21

标签: mysql jasper-reports

我在项目中使用带有laravel的jasper报告,一切正常。

当我在控制台中使用jasper starter尝试输出命令时,我有一个在localhost上工作的报告没有错误。

问题是,服务器CentOS 6.8上的相同报告使用jasper starter在ssh终端中抛出错误: 填写reportError时执行sql语句的错误:"报告名称"

但是localhost上没有错误,服务器上也有相同的数据库。

有什么想法吗?

QUERY:

 SELECT
     *,
     invitemcatdivgrp.`id_inventoryitems_PRODUCTID` AS invitemcatdivgrp_id_inventoryitems_PRODUCTID,
     invitemcatdivgrp.`id_inventoryitems_BRANCHID` AS invitemcatdivgrp_id_inventoryitems_BRANCHID,
     invitemcatdivgrp.`id_inventoryitems_PRODUCTCODE` AS invitemcatdivgrp_id_inventoryitems_PRODUCTCODE,
     invitemcatdivgrp.`id_inventoryitems_PRODUCTDESCRIPTION` AS invitemcatdivgrp_id_inventoryitems_PRODUCTDESCRIPTION,
     invitemcatdivgrp.`id_inventoryitems_SUPPLIERID` AS invitemcatdivgrp_id_inventoryitems_SUPPLIERID,
     invitemcatdivgrp.`id_inventoryitems_UNITCOST` AS invitemcatdivgrp_id_inventoryitems_UNITCOST,
     invitemcatdivgrp.`id_inventoryitems_LOCATIONID` AS invitemcatdivgrp_id_inventoryitems_LOCATIONID,
     invitemcatdivgrp.`id_inventoryitems_GROUPID` AS invitemcatdivgrp_id_inventoryitems_GROUPID,
     invitemcatdivgrp.`id_inventoryitems_INVADJUSTMENT` AS invitemcatdivgrp_id_inventoryitems_INVADJUSTMENT,
     invitemcatdivgrp.`id_inventoryitems_AVERAGECOST` AS invitemcatdivgrp_id_inventoryitems_AVERAGECOST,
     invitemcatdivgrp.`id_inventoryitems_SELLINGPRICE` AS invitemcatdivgrp_id_inventoryitems_SELLINGPRICE,
     invitemcatdivgrp.`id_inventoryitems_SALESITEM` AS invitemcatdivgrp_id_inventoryitems_SALESITEM,
     invitemcatdivgrp.`id_inventoryitems_SHOWINREPORT` AS invitemcatdivgrp_id_inventoryitems_SHOWINREPORT,
     invitemcatdivgrp.`id_inventoryitems_BUIYINGFORMAT` AS invitemcatdivgrp_id_inventoryitems_BUIYINGFORMAT,
     invitemcatdivgrp.`id_inventoryitems_QTYINBUIYINGFORMAT` AS invitemcatdivgrp_id_inventoryitems_QTYINBUIYINGFORMAT,
     invitemcatdivgrp.`id_inventoryitems_INVENTORYFORMAT` AS invitemcatdivgrp_id_inventoryitems_INVENTORYFORMAT,
     invitemcatdivgrp.`id_inventoryitems_QTYINVENTORYFORMAT` AS invitemcatdivgrp_id_inventoryitems_QTYINVENTORYFORMAT,
     invitemcatdivgrp.`id_inventoryitems_USAGEFORMAT` AS invitemcatdivgrp_id_inventoryitems_USAGEFORMAT,
     invitemcatdivgrp.`id_inventoryitems_DISCOUNTINUED` AS invitemcatdivgrp_id_inventoryitems_DISCOUNTINUED,
     invitemcatdivgrp.`id_inventoryitems_OTHERCOST` AS invitemcatdivgrp_id_inventoryitems_OTHERCOST,
     invitemcatdivgrp.`id_inventoryitems_SHIPPINGCOST` AS invitemcatdivgrp_id_inventoryitems_SHIPPINGCOST,
     invitemcatdivgrp.`id_inventoryitems_CUSTOMSCOST` AS invitemcatdivgrp_id_inventoryitems_CUSTOMSCOST,
     invitemcatdivgrp.`id_inventoryitems_BARCODE` AS invitemcatdivgrp_id_inventoryitems_BARCODE,
     invitemcatdivgrp.`id_inventoryitems_PIC` AS invitemcatdivgrp_id_inventoryitems_PIC,
     invitemcatdivgrp.`id_inventoryitems_EXPNO` AS invitemcatdivgrp_id_inventoryitems_EXPNO,
     invitemcatdivgrp.`id_inventoryitems_SERNO` AS invitemcatdivgrp_id_inventoryitems_SERNO,
     invitemcatdivgrp.`id_inventoryitems_PRODIDBRANCHID` AS invitemcatdivgrp_id_inventoryitems_PRODIDBRANCHID,
     invitemcatdivgrp.`id_inventoryitems_SP1` AS invitemcatdivgrp_id_inventoryitems_SP1,
     invitemcatdivgrp.`id_inventoryitems_SP2` AS invitemcatdivgrp_id_inventoryitems_SP2,
     invitemcatdivgrp.`id_inventoryitems_SP3` AS invitemcatdivgrp_id_inventoryitems_SP3,
     invitemcatdivgrp.`id_inventoryitems_SP4` AS invitemcatdivgrp_id_inventoryitems_SP4,
     invitemcatdivgrp.`id_inventoryitems_PACKINGF` AS invitemcatdivgrp_id_inventoryitems_PACKINGF,
     invitemcatdivgrp.`id_inventoryitems_OTHERDESCRIPTION` AS invitemcatdivgrp_id_inventoryitems_OTHERDESCRIPTION,
     invitemcatdivgrp.`id_inventoryitems_SUPPORTCOLOR` AS invitemcatdivgrp_id_inventoryitems_SUPPORTCOLOR,
     invitemcatdivgrp.`id_inventoryitems_SUPPORTSIZE` AS invitemcatdivgrp_id_inventoryitems_SUPPORTSIZE,
     invitemcatdivgrp.`id_inventoryitems_SUPPORTSERIALNUMBER` AS invitemcatdivgrp_id_inventoryitems_SUPPORTSERIALNUMBER,
     invitemcatdivgrp.`id_inventoryitems_SUPPORTEXPIRYDATE` AS invitemcatdivgrp_id_inventoryitems_SUPPORTEXPIRYDATE,
     invitemcatdivgrp.`id_inventoryitems_INCLDAILYADJ` AS invitemcatdivgrp_id_inventoryitems_INCLDAILYADJ,
     invitemcatdivgrp.`id_inventoryitems_INCLWEEKLADJ` AS invitemcatdivgrp_id_inventoryitems_INCLWEEKLADJ,
     invitemcatdivgrp.`id_inventoryitems_QTYFORRECIPE` AS invitemcatdivgrp_id_inventoryitems_QTYFORRECIPE,
     invitemcatdivgrp.`id_inventoryitems_PTYPE` AS invitemcatdivgrp_id_inventoryitems_PTYPE,
     invitemcatdivgrp.`id_inventoryitems_PRODUCTIONLOCATION` AS invitemcatdivgrp_id_inventoryitems_PRODUCTIONLOCATION,
     invitemcatdivgrp.`id_inventoryitems_SHELFLIFEIND` AS invitemcatdivgrp_id_inventoryitems_SHELFLIFEIND,
     invitemcatdivgrp.`id_inventoryitems_TEXTID` AS invitemcatdivgrp_id_inventoryitems_TEXTID,
     invitemcatdivgrp.`id_inventoryitems_PRODUCTIONLEADTIMEF` AS invitemcatdivgrp_id_inventoryitems_PRODUCTIONLEADTIMEF,
     invitemcatdivgrp.`id_inventoryitems_PRODUCTIONLEADTIMET` AS invitemcatdivgrp_id_inventoryitems_PRODUCTIONLEADTIMET,
     invitemcatdivgrp.`id_inventoryitems_MAXPRODUCTIONQTY` AS invitemcatdivgrp_id_inventoryitems_MAXPRODUCTIONQTY,
     invitemcatdivgrp.`id_inventoryitems_SP5` AS invitemcatdivgrp_id_inventoryitems_SP5,
     invitemcatdivgrp.`id_inventoryitems_TAX1` AS invitemcatdivgrp_id_inventoryitems_TAX1,
     invitemcatdivgrp.`id_inventoryitems_TAX2` AS invitemcatdivgrp_id_inventoryitems_TAX2,
     invitemcatdivgrp.`id_inventoryitems_TAX3` AS invitemcatdivgrp_id_inventoryitems_TAX3,
     invitemcatdivgrp.`id_inventoryitems_TAX4` AS invitemcatdivgrp_id_inventoryitems_TAX4,
     invitemcatdivgrp.`id_inventoryitems_TAX5` AS invitemcatdivgrp_id_inventoryitems_TAX5,
     invitemcatdivgrp.`id_inventoryitems_DISCOUNT` AS invitemcatdivgrp_id_inventoryitems_DISCOUNT,
     invitemcatdivgrp.`id_inventoryitems_EXPIRYSALE` AS invitemcatdivgrp_id_inventoryitems_EXPIRYSALE,
     invitemcatdivgrp.`id_inventoryitems_NETWEIGHT` AS invitemcatdivgrp_id_inventoryitems_NETWEIGHT,
     invitemcatdivgrp.`id_inventoryitems_GROSSWEIGHT` AS invitemcatdivgrp_id_inventoryitems_GROSSWEIGHT,
     invitemcatdivgrp.`id_inventoryitems_PRICEVAR` AS invitemcatdivgrp_id_inventoryitems_PRICEVAR,
     invitemcatdivgrp.`id_inventoryitems_BARCODE2` AS invitemcatdivgrp_id_inventoryitems_BARCODE2,
     invitemcatdivgrp.`id_inventoryitems_BARCODENATIVE` AS invitemcatdivgrp_id_inventoryitems_BARCODENATIVE,
     invitemcatdivgrp.`id_inventoryitems_CALUSAGEFORM` AS invitemcatdivgrp_id_inventoryitems_CALUSAGEFORM,
     invitemcatdivgrp.`id_inventoryitems_CALORIESINITEM` AS invitemcatdivgrp_id_inventoryitems_CALORIESINITEM,
     invitemcatdivgrp.`id_inventoryitems_CALQTYPERUF` AS invitemcatdivgrp_id_inventoryitems_CALQTYPERUF,
     invitemcatdivgrp.`id_inventoryitems_PICRECEPIE1` AS invitemcatdivgrp_id_inventoryitems_PICRECEPIE1,
     invitemcatdivgrp.`id_inventoryitems_PICRECEPIE2` AS invitemcatdivgrp_id_inventoryitems_PICRECEPIE2,
     invitemcatdivgrp.`id_inventoryitems_MASTERITEM` AS invitemcatdivgrp_id_inventoryitems_MASTERITEM,
     invitemcatdivgrp.`id_inventoryitems_LINKTOMASTERITEM` AS invitemcatdivgrp_id_inventoryitems_LINKTOMASTERITEM,
     invitemcatdivgrp.`id_inventoryitems_BRAND_ID` AS invitemcatdivgrp_id_inventoryitems_BRAND_ID,
     invitemcatdivgrp.`id_inventorygroups_GROUPID` AS invitemcatdivgrp_id_inventorygroups_GROUPID,
     invitemcatdivgrp.`id_inventorygroups_BRANCHID` AS invitemcatdivgrp_id_inventorygroups_BRANCHID,
     invitemcatdivgrp.`id_inventorygroups_GROUPNAME` AS invitemcatdivgrp_id_inventorygroups_GROUPNAME,
     invitemcatdivgrp.`id_inventorygroups_DIVISIONID` AS invitemcatdivgrp_id_inventorygroups_DIVISIONID,
     invitemcatdivgrp.`id_inventorygroups_ASSETACCOUNT` AS invitemcatdivgrp_id_inventorygroups_ASSETACCOUNT,
     invitemcatdivgrp.`id_inventorygroups_REVENUEACCOUNT` AS invitemcatdivgrp_id_inventorygroups_REVENUEACCOUNT,
     invitemcatdivgrp.`id_inventorygroups_EXPENSEACCOUNT` AS invitemcatdivgrp_id_inventorygroups_EXPENSEACCOUNT,
     invitemcatdivgrp.`id_inventorygroups_TAX1` AS invitemcatdivgrp_id_inventorygroups_TAX1,
     invitemcatdivgrp.`id_inventorygroups_TAX2` AS invitemcatdivgrp_id_inventorygroups_TAX2,
     invitemcatdivgrp.`id_inventorygroups_TAX3` AS invitemcatdivgrp_id_inventorygroups_TAX3,
     invitemcatdivgrp.`id_inventorygroups_MARKUP` AS invitemcatdivgrp_id_inventorygroups_MARKUP,
     invitemcatdivgrp.`id_inventorygroups_STOCKVARIATIONACC` AS invitemcatdivgrp_id_inventorygroups_STOCKVARIATIONACC,
     invitemcatdivgrp.`id_inventorygroups_OTHERDESC` AS invitemcatdivgrp_id_inventorygroups_OTHERDESC,
     invitemcatdivgrp.`id_inventorygroups_TAX4` AS invitemcatdivgrp_id_inventorygroups_TAX4,
     invitemcatdivgrp.`id_inventorygroups_TAX5` AS invitemcatdivgrp_id_inventorygroups_TAX5,
     invitemcatdivgrp.`id_inventorygroups_DISCACC` AS invitemcatdivgrp_id_inventorygroups_DISCACC,
     invitemcatdivgrp.`id_inventorygroups_BRAND_ID` AS invitemcatdivgrp_id_inventorygroups_BRAND_ID,
     invitemcatdivgrp.`id_inventorydivisions_DIVISIONID` AS invitemcatdivgrp_id_inventorydivisions_DIVISIONID,
     invitemcatdivgrp.`id_inventorydivisions_DIVISIONNAME` AS invitemcatdivgrp_id_inventorydivisions_DIVISIONNAME,
     invitemcatdivgrp.`id_inventorydivisions_CATEGORYID` AS invitemcatdivgrp_id_inventorydivisions_CATEGORYID,
     invitemcatdivgrp.`id_inventorydivisions_BRANCHID` AS invitemcatdivgrp_id_inventorydivisions_BRANCHID,
     invitemcatdivgrp.`id_inventorydivisions_BRAND_ID` AS invitemcatdivgrp_id_inventorydivisions_BRAND_ID,
     invitemcatdivgrp.`id_inventorycateg_CATEGORYID` AS invitemcatdivgrp_id_inventorycateg_CATEGORYID,
     invitemcatdivgrp.`id_inventorycateg_CATEGORYNAME` AS invitemcatdivgrp_id_inventorycateg_CATEGORYNAME,
     invitemcatdivgrp.`id_inventorycateg_MENUID` AS invitemcatdivgrp_id_inventorycateg_MENUID,
     invitemcatdivgrp.`id_inventorycateg_BRANCHID` AS invitemcatdivgrp_id_inventorycateg_BRANCHID,
     invitemcatdivgrp.`id_inventorycateg_CATEGORYLINKID` AS invitemcatdivgrp_id_inventorycateg_CATEGORYLINKID,
     invitemcatdivgrp.`id_inventorycateg_PURCHASE_ACCOUNT` AS invitemcatdivgrp_id_inventorycateg_PURCHASE_ACCOUNT,
     invitemcatdivgrp.`id_inventorycateg_WASTAGE_ACCOUNT` AS invitemcatdivgrp_id_inventorycateg_WASTAGE_ACCOUNT,
     invitemcatdivgrp.`id_inventorycateg_ADJUSTMENT_ACCOUNT` AS invitemcatdivgrp_id_inventorycateg_ADJUSTMENT_ACCOUNT,
     invitemcatdivgrp.`id_inventorycateg_EMPLOYEESMEALS_ACCOUNT` AS invitemcatdivgrp_id_inventorycateg_EMPLOYEESMEALS_ACCOUNT,
     invitemcatdivgrp.`id_inventorycateg_FREEITEMS_ACCOUNT` AS invitemcatdivgrp_id_inventorycateg_FREEITEMS_ACCOUNT,
     invitemcatdivgrp.`id_inventorycateg_BRAND_ID` AS invitemcatdivgrp_id_inventorycateg_BRAND_ID,
     id_units.`UNITID` AS id_units_UNITID,
     id_units.`BRANCHID` AS id_units_BRANCHID,
     id_units.`UNITNAME` AS id_units_UNITNAME,
     id_units.`BRAND_ID` AS id_units_BRAND_ID,
     gc_branch.`BRANCHID` AS gc_branch_BRANCHID,
     gc_branch.`BRAND_ID` AS gc_branch_BRAND_ID,
     gc_branch.`OMEGA_CUSTID` AS gc_branch_OMEGA_CUSTID,
     gc_branch.`BARANCHNAME` AS gc_branch_BARANCHNAME,
     gc_branch.`MAINCURRENCY` AS gc_branch_MAINCURRENCY,
     gc_branch.`SECONDCURRENCY` AS gc_branch_SECONDCURRENCY,
     gc_branch.`STREET` AS gc_branch_STREET,
     gc_branch.`CITY` AS gc_branch_CITY,
     gc_branch.`STATE` AS gc_branch_STATE,
     gc_branch.`ZIPCODE` AS gc_branch_ZIPCODE,
     gc_branch.`PHONE1` AS gc_branch_PHONE1,
     gc_branch.`PHONE2` AS gc_branch_PHONE2,
     gc_branch.`PHONE3` AS gc_branch_PHONE3,
     gc_branch.`PHONE4` AS gc_branch_PHONE4,
     gc_branch.`FAX` AS gc_branch_FAX,
     gc_branch.`FEDID` AS gc_branch_FEDID,
     gc_branch.`FISCALSTART` AS gc_branch_FISCALSTART,
     gc_branch.`FISCALEND` AS gc_branch_FISCALEND,
     gc_branch.`LASTENDOFDAY` AS gc_branch_LASTENDOFDAY,
     gc_branch.`ADVERTONINVOICE` AS gc_branch_ADVERTONINVOICE,
     gc_branch.`MESSAGEONPOS1` AS gc_branch_MESSAGEONPOS1,
     gc_branch.`MESSAGEONPOS2` AS gc_branch_MESSAGEONPOS2,
     gc_branch.`MESSAGEONPOS3` AS gc_branch_MESSAGEONPOS3,
     gc_branch.`MESSAGEONPOS4` AS gc_branch_MESSAGEONPOS4,
     gc_branch.`MESSAGEONPOS5` AS gc_branch_MESSAGEONPOS5,
     gc_branch.`PIC` AS gc_branch_PIC,
     gc_branch.`LOCALOFFICEID` AS gc_branch_LOCALOFFICEID,
     gc_branch.`ACCOUNTINGDEPT` AS gc_branch_ACCOUNTINGDEPT,
     gc_branch.`HOSTSTRING` AS gc_branch_HOSTSTRING,
     gc_branch.`FRANCHISEE` AS gc_branch_FRANCHISEE,
     gc_branch.`SALESPRICE` AS gc_branch_SALESPRICE,
     gc_branch.`CUSTOMERID` AS gc_branch_CUSTOMERID,
     gc_branch.`IPADDRESS` AS gc_branch_IPADDRESS,
     gc_branch.`PORT` AS gc_branch_PORT,
     gc_branch.`EMAIL` AS gc_branch_EMAIL,
     gc_branch.`COUNTRY_ID` AS gc_branch_COUNTRY_ID,
     id_locations.`LOCATIONID` AS id_locations_LOCATIONID,
     id_locations.`BRANCHID` AS id_locations_BRANCHID,
     id_locations.`LOCATIONDESCRIPTION` AS id_locations_LOCATIONDESCRIPTION,
     id_locations.`FORBRANCH` AS id_locations_FORBRANCH,
     id_locations.`ACCDEPT` AS id_locations_ACCDEPT,
     id_locations.`BRAND_ID` AS id_locations_BRAND_ID,
     it_requisitions.`REQBRANCHID` AS it_requisitions_REQBRANCHID,
     it_requisitions.`REQID` AS it_requisitions_REQID,
     it_requisitions.`BRANCHID` AS it_requisitions_BRANCHID,
     it_requisitions.`USERID` AS it_requisitions_USERID,
     it_requisitions.`REQDATE` AS it_requisitions_REQDATE,
     it_requisitions.`PRDID` AS it_requisitions_PRDID,
     it_requisitions.`QTY` AS it_requisitions_QTY,
     it_requisitions.`SOURCE` AS it_requisitions_SOURCE,
     it_requisitions.`DESTINATION` AS it_requisitions_DESTINATION,
     it_requisitions.`EXP` AS it_requisitions_EXP,
     it_requisitions.`REQNO` AS it_requisitions_REQNO,
     it_requisitions.`OLDQTY` AS it_requisitions_OLDQTY,
     it_requisitions.`FROMBRANCH` AS it_requisitions_FROMBRANCH,
     it_requisitions.`TOBRANCH` AS it_requisitions_TOBRANCH,
     it_requisitions.`TRANSFERED` AS it_requisitions_TRANSFERED,
     it_requisitions.`FILENUMBER` AS it_requisitions_FILENUMBER,
     it_requisitions.`FILEBRANCHID` AS it_requisitions_FILEBRANCHID,
     it_requisitions.`EXPORTED` AS it_requisitions_EXPORTED,
     it_requisitions.`AVGCOST` AS it_requisitions_AVGCOST,
     it_requisitions.`COST` AS it_requisitions_COST,
     it_requisitions.`RECEIVED` AS it_requisitions_RECEIVED,
     it_requisitions.`BRAND_ID` AS it_requisitions_BRAND_ID,
     gc_branch_A.`BRANCHID` AS gc_branch_A_BRANCHID,
     gc_branch_A.`BRAND_ID` AS gc_branch_A_BRAND_ID,
     gc_branch_A.`OMEGA_CUSTID` AS gc_branch_A_OMEGA_CUSTID,
     gc_branch_A.`BARANCHNAME` AS gc_branch_A_BARANCHNAME,
     gc_branch_A.`MAINCURRENCY` AS gc_branch_A_MAINCURRENCY,
     gc_branch_A.`SECONDCURRENCY` AS gc_branch_A_SECONDCURRENCY,
     gc_branch_A.`STREET` AS gc_branch_A_STREET,
     gc_branch_A.`CITY` AS gc_branch_A_CITY,
     gc_branch_A.`STATE` AS gc_branch_A_STATE,
     gc_branch_A.`ZIPCODE` AS gc_branch_A_ZIPCODE,
     gc_branch_A.`PHONE1` AS gc_branch_A_PHONE1,
     gc_branch_A.`PHONE2` AS gc_branch_A_PHONE2,
     gc_branch_A.`PHONE3` AS gc_branch_A_PHONE3,
     gc_branch_A.`PHONE4` AS gc_branch_A_PHONE4,
     gc_branch_A.`FAX` AS gc_branch_A_FAX,
     gc_branch_A.`FEDID` AS gc_branch_A_FEDID,
     gc_branch_A.`FISCALSTART` AS gc_branch_A_FISCALSTART,
     gc_branch_A.`FISCALEND` AS gc_branch_A_FISCALEND,
     gc_branch_A.`LASTENDOFDAY` AS gc_branch_A_LASTENDOFDAY,
     gc_branch_A.`ADVERTONINVOICE` AS gc_branch_A_ADVERTONINVOICE,
     gc_branch_A.`MESSAGEONPOS1` AS gc_branch_A_MESSAGEONPOS1,
     gc_branch_A.`MESSAGEONPOS2` AS gc_branch_A_MESSAGEONPOS2,
     gc_branch_A.`MESSAGEONPOS3` AS gc_branch_A_MESSAGEONPOS3,
     gc_branch_A.`MESSAGEONPOS4` AS gc_branch_A_MESSAGEONPOS4,
     gc_branch_A.`MESSAGEONPOS5` AS gc_branch_A_MESSAGEONPOS5,
     gc_branch_A.`PIC` AS gc_branch_A_PIC,
     gc_branch_A.`LOCALOFFICEID` AS gc_branch_A_LOCALOFFICEID,
     gc_branch_A.`ACCOUNTINGDEPT` AS gc_branch_A_ACCOUNTINGDEPT,
     gc_branch_A.`HOSTSTRING` AS gc_branch_A_HOSTSTRING,
     gc_branch_A.`FRANCHISEE` AS gc_branch_A_FRANCHISEE,
     gc_branch_A.`SALESPRICE` AS gc_branch_A_SALESPRICE,
     gc_branch_A.`CUSTOMERID` AS gc_branch_A_CUSTOMERID,
     gc_branch_A.`IPADDRESS` AS gc_branch_A_IPADDRESS,
     gc_branch_A.`PORT` AS gc_branch_A_PORT,
     gc_branch_A.`EMAIL` AS gc_branch_A_EMAIL,
     gc_branch_A.`COUNTRY_ID` AS gc_branch_A_COUNTRY_ID,
     gc_branch_B.`BRANCHID` AS gc_branch_B_BRANCHID,
     gc_branch_B.`BRAND_ID` AS gc_branch_B_BRAND_ID,
     gc_branch_B.`OMEGA_CUSTID` AS gc_branch_B_OMEGA_CUSTID,
     gc_branch_B.`BARANCHNAME` AS gc_branch_B_BARANCHNAME,
     gc_branch_B.`MAINCURRENCY` AS gc_branch_B_MAINCURRENCY,
     gc_branch_B.`SECONDCURRENCY` AS gc_branch_B_SECONDCURRENCY,
     gc_branch_B.`STREET` AS gc_branch_B_STREET,
     gc_branch_B.`CITY` AS gc_branch_B_CITY,
     gc_branch_B.`STATE` AS gc_branch_B_STATE,
     gc_branch_B.`ZIPCODE` AS gc_branch_B_ZIPCODE,
     gc_branch_B.`PHONE1` AS gc_branch_B_PHONE1,
     gc_branch_B.`PHONE2` AS gc_branch_B_PHONE2,
     gc_branch_B.`PHONE3` AS gc_branch_B_PHONE3,
     gc_branch_B.`PHONE4` AS gc_branch_B_PHONE4,
     gc_branch_B.`FAX` AS gc_branch_B_FAX,
     gc_branch_B.`FEDID` AS gc_branch_B_FEDID,
     gc_branch_B.`FISCALSTART` AS gc_branch_B_FISCALSTART,
     gc_branch_B.`FISCALEND` AS gc_branch_B_FISCALEND,
     gc_branch_B.`LASTENDOFDAY` AS gc_branch_B_LASTENDOFDAY,
     gc_branch_B.`ADVERTONINVOICE` AS gc_branch_B_ADVERTONINVOICE,
     gc_branch_B.`MESSAGEONPOS1` AS gc_branch_B_MESSAGEONPOS1,
     gc_branch_B.`MESSAGEONPOS2` AS gc_branch_B_MESSAGEONPOS2,
     gc_branch_B.`MESSAGEONPOS3` AS gc_branch_B_MESSAGEONPOS3,
     gc_branch_B.`MESSAGEONPOS4` AS gc_branch_B_MESSAGEONPOS4,
     gc_branch_B.`MESSAGEONPOS5` AS gc_branch_B_MESSAGEONPOS5,
     gc_branch_B.`PIC` AS gc_branch_B_PIC,
     gc_branch_B.`LOCALOFFICEID` AS gc_branch_B_LOCALOFFICEID,
     gc_branch_B.`ACCOUNTINGDEPT` AS gc_branch_B_ACCOUNTINGDEPT,
     gc_branch_B.`HOSTSTRING` AS gc_branch_B_HOSTSTRING,
     gc_branch_B.`FRANCHISEE` AS gc_branch_B_FRANCHISEE,
     gc_branch_B.`SALESPRICE` AS gc_branch_B_SALESPRICE,
     gc_branch_B.`CUSTOMERID` AS gc_branch_B_CUSTOMERID,
     gc_branch_B.`IPADDRESS` AS gc_branch_B_IPADDRESS,
     gc_branch_B.`PORT` AS gc_branch_B_PORT,
     gc_branch_B.`EMAIL` AS gc_branch_B_EMAIL,
     gc_branch_B.`COUNTRY_ID` AS gc_branch_B_COUNTRY_ID,
     id_locations_A.`LOCATIONID` AS id_locations_A_LOCATIONID,
     id_locations_A.`BRANCHID` AS id_locations_A_BRANCHID,
     id_locations_A.`LOCATIONDESCRIPTION` AS id_locations_A_LOCATIONDESCRIPTION,
     id_locations_A.`FORBRANCH` AS id_locations_A_FORBRANCH,
     id_locations_A.`ACCDEPT` AS id_locations_A_ACCDEPT,
     id_locations_A.`BRAND_ID` AS id_locations_A_BRAND_ID
FROM
     `id_units` id_units INNER JOIN `invitemcatdivgrp` invitemcatdivgrp ON id_units.`UNITID` = invitemcatdivgrp.`id_inventoryitems_INVENTORYFORMAT`
     AND id_units.`BRAND_ID` = invitemcatdivgrp.`id_inventorycateg_BRAND_ID`
     INNER JOIN `gc_branch` gc_branch ON id_units.`BRANCHID` = gc_branch.`BRANCHID`
     INNER JOIN `gc_branch` gc_branch_B ON id_units.`BRANCHID` = gc_branch_B.`BRANCHID`
     AND invitemcatdivgrp.`id_inventorycateg_BRAND_ID` = gc_branch_B.`BRAND_ID`
     INNER JOIN `it_requisitions` it_requisitions ON gc_branch_B.`BRANCHID` = it_requisitions.`BRANCHID`
     INNER JOIN `id_locations` id_locations ON gc_branch_B.`BRAND_ID` = id_locations.`BRAND_ID`
     AND it_requisitions.`SOURCE` = id_locations.`LOCATIONID`
     AND id_locations.`FORBRANCH` = it_requisitions.`FROMBRANCH`
     AND invitemcatdivgrp.`id_inventorycateg_BRAND_ID` = id_locations.`BRAND_ID`
     INNER JOIN `gc_branch` gc_branch_A ON id_locations.`BRAND_ID` = gc_branch_A.`BRAND_ID`
     INNER JOIN `id_locations` id_locations_A ON id_locations.`BRAND_ID` = id_locations_A.`BRAND_ID`
     AND it_requisitions.`DESTINATION` = id_locations_A.`LOCATIONID`
     AND id_locations_A.`FORBRANCH` = it_requisitions.`TOBRANCH`
     AND it_requisitions.`FROMBRANCH` = gc_branch_A.`BRANCHID`
     AND invitemcatdivgrp.`id_inventorycateg_BRAND_ID` = it_requisitions.`BRAND_ID`
     AND invitemcatdivgrp.`id_inventoryitems_PRODUCTID` = it_requisitions.`PRDID`
     AND gc_branch.`BRANCHID` = it_requisitions.`BRANCHID`
     AND invitemcatdivgrp.`id_inventorycateg_BRAND_ID` = gc_branch.`BRAND_ID`

WHERE
     invitemcatdivgrp.`id_inventorycateg_BRAND_ID` = $P{Brandid} and
     it_requisitions.`REQDATE`  >= $P{FromDate} and  it_requisitions.`REQDATE` <=  $P{ToDate} and

(CASE WHEN $P{Frombranchid} > 0
    THEN gc_branch_A.`BRANCHID` >= $P{Frombranchid}
    ELSE IT_REQUISITIONS.`FROMBRANCH` = gc_branch_A.`BRANCHID`
END)

ORDER BY
     gc_branch.`BARANCHNAME` ASC,
     invitemcatdivgrp.`id_inventorycateg_CATEGORYNAME` ASC,
     invitemcatdivgrp.`id_inventorydivisions_DIVISIONNAME` ASC,
     invitemcatdivgrp.`id_inventorygroups_GROUPNAME` ASC,
     it_requisitions.`REQDATE` ASC,
     it_requisitions.`SOURCE` ASC,
     it_requisitions.`DESTINATION` ASC,
     invitemcatdivgrp.`id_inventoryitems_PRODUCTDESCRIPTION` ASC

0 个答案:

没有答案