sql=sql+getAndConSql(sql,BillNo," BillNo like '%"+BillNo+"%' ");
sql=sql+getAndConSql(sql,BillNo," BillNo like '%"+BillNo+"%' ");
varBsNo=form.findField('BsNo').getValue();
varBsNo=form.findField('BsNo').getValue();
sql=sql+getAndConSql(sql,BsNo," Billno in (select BILLNO from ch_fee_do where bsno in(select bsno from v_op_bs where Custno like '%" +BsNo+"%' OR MBLNO like '%"+BsNo+"%')) ");
sql=sql+getAndConSql(sql,BsNo,"exists (SELECT 1 FROM CH_FEE_DO d LEFT JOIN V_OP_BILL B ON (B.BSNO=D.BSNO) WHERE cm.BILLNO=d.BILLNO AND (b.CUSTNO+''+b.MBLNO+''+b.HBLNO+''+b.CUSTOMNO+''+b.ORDERNO) like '%" +BsNo+"%' )");
sql=sql+getAndConSql(sql,customNo,"BILLNO like '%" +customNo+"%'");
sql=sql+getAndConSql(sql,customNo,"(BILLNO like '%" +customNo+"%' or exists (SELECT 1 FROM CH_FEE_DO d LEFT JOIN V_OP_BILL B ON (B.BSNO=D.BSNO) WHERE cm.BILLNO=d.BILLNO AND (b.CUSTNO+''+b.MBLNO+''+b.HBLNO+''+b.CUSTOMNO+''+b.ORDERNO) like '%" +customNo+"%' ))");
varShenNo=form.findField('ShenNo').getValue();
varShenNo=form.findField('ShenNo').getValue();
sql=sql+getAndConSql(sql,ShenNo,"BILLNO in (SELECT DISTINCT BILLNO from v_fee_do_payapplication WHERE PAYBILLNO like '%"+ShenNo+"%')");
sql=sql+getAndConSql(sql,ShenNo,"BILLNO in (SELECT DISTINCT BILLNO from v_fee_do_payapplication WHERE PAYBILLNO like '%"+ShenNo+"%')");
sql=sql+getAndConSql(sql,customNo,"BILLNO like '%" +customNo+"%'");
sql=sql+getAndConSql(sql,customNo,"(BILLNO like '%" +customNo+"%' or exists (SELECT 1 FROM CH_FEE_DO d LEFT JOIN V_OP_BILL B ON (B.BSNO=D.BSNO) WHERE cm.BILLNO=d.BILLNO AND (b.CUSTNO+''+b.MBLNO+''+b.HBLNO+''+b.CUSTOMNO+''+b.ORDERNO) like '%" +customNo+"%' ))");
@ -5013,38 +5024,38 @@ this.storeConsignee.on('beforeload', function (store) {
varCUSTOMERNAME=this.MainEditRecord.CUSTOMERNAME;
varCUSTOMERNAME=this.MainEditRecord.CUSTOMERNAME;
this.storeShipper.load({params:{condition:"shippertype=2 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" },
//this.storeShipper.load({ params: { condition: "shippertype=2 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" },
this.storeConsignee.load({params:{condition:"shippertype=1 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" },
//this.storeConsignee.load({ params: { condition: "shippertype=1 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" },
this.storenotifyparty.load({params:{condition:"shippertype=3 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" },
//this.storenotifyparty.load({ params: { condition: "shippertype=3 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" },
this.storeagent.load({params:{condition:"shippertype=4 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" },
//this.storeagent.load({ params: { condition: "shippertype=4 AND (ISPUBLIC=1 OR CODENAME IN (SELECT CODENAME FROM info_client WHERE SHORTNAME='" + CUSTOMERNAME + "') )" },
sql=sql+getAndConSql(sql,MblNo,"(B.MblNo like '%"+MblNo+"%' or B.CONTRACTNO like '%"+MblNo+"%' or B.CUSTNO like '%"+MblNo+"%' or B.HBLNO like '%"
sql=sql+getAndConSql(sql,MblNo,"(B.MblNo like '%"+MblNo+"%' or B.CONTRACTNO like '%"+MblNo+"%' or B.CUSTNO like '%"+MblNo+"%' or B.HBLNO like '%"
+MblNo+"%' or B.ORDERNO like '%"+MblNo+"%' or B.APPLYNO like '%"+MblNo+"%' or B.SERVICECONTRACTNO like '%"+MblNo+"%' or exists (select 1 from crm_seaeorder where ORDNO like '%"+MblNo+"%' and BSNO= OP_SEAE.BSNO) )");
+MblNo+"%' or B.ORDERNO like '%"+MblNo+"%' or B.APPLYNO like '%"+MblNo+"%' or B.SERVICECONTRACTNO like '%"+MblNo+"%' or exists (select 1 from crm_seaeorder where ORDNO like '%"+MblNo+"%' and BSNO= B.BSNO) )");