1.卡尔的合同制作,变更,付款申请。新增申请逻辑更改。

This commit is contained in:
zhangbb 2019-05-16 17:33:04 +08:00
parent d629b88c3b
commit f06d9d3ad2
4 changed files with 235 additions and 6 deletions

View File

@ -0,0 +1,203 @@
<?xml version="1.0" encoding="UTF-8"?>
<table-root
xmlns="http://www.tracywindy.org/table"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.tracywindy.org/table http://www.tracywindy.org/table/table-1.0.xsd">
<table>
<data>
<MYSQL>
<table_sql>
<![CDATA[
select
ID,
CONTRACT_NUMBER,
CONTRACT_NO,
PROJECT_ID,
PRODUCT_ID,
PROJECT_NAME,
customerid,
customername,
total,
usedlines,
relines,
plan_money,
afact_money,
allfact_money,
fee_adjust,
overmoney,
username from (
SELECT
lci.ID,
lci.CONTRACT_NUMBER,
lci.CONTRACT_NO,
lci.PROJECT_ID,
lci.PRODUCT_ID,
lci.PROJECT_NAME,
lul.customerid,
lul.customername,
di.total,
di.usedlines,
di.relines,
vlfp.plan_money,
IFNULL(lfi.allfact_money, 0) AS afact_money,
vlfp.allfact_money,
vlfp.fee_adjust,
vlfp.overmoney,
ui.username
FROM
LB_CONTRACT_INFO AS lci
LEFT JOIN
(SELECT
lu.contract_id,
ci.customerid,
ci.customername
FROM
LB_UNION_LESSEE lu,
CUSTOMER_INFO ci
WHERE lu.CUSTOMER_ID = ci.customerid
AND is_main = 'y') AS lul
ON lul.CONTRACT_ID = lci.ID
LEFT JOIN
(SELECT
vl.contract_id,
SUM(vl.plan_money) plan_money,
SUM(vl.allfact_money) allfact_money,
SUM(vl.fee_adjust) fee_adjust,
SUM(vl.overmoney) overmoney
FROM
vi_lc_fund_plan vl
WHERE vl.pay_type = 'pay_type_out'
AND vl.fee_type NOT IN ('feetype16', 'feetype17')
GROUP BY vl.contract_id) vlfp
ON vlfp.contract_id = lci.ID
LEFT JOIN
(SELECT
contract_id,
SUM(IFNULL(fact_money, 0)) + SUM(IFNULL(fee_adjust, 0)) AS allfact_money
FROM
lc_fund_income
WHERE pay_type = 'pay_type_out'
AND roll_back = '0'
AND pay_status = 'apply_pass'
GROUP BY contract_id) AS lfi
ON lfi.contract_id = lci.ID
LEFT JOIN user_info AS ui
ON lci.PROJECT_MANAGE = ui.userid
left join vi_distributor_lines di on lci.distributor_id=di.distributor_no
WHERE (
lci.contract_status = '21'
OR lci.contract_status = '25'
OR lci.contract_status = '26'
)
AND lci.BUSINESSTYPE='1'
AND lci.INPUTORGID='#orgid'
AND IFNULL(lfi.allfact_money, 0) < vlfp.plan_money
AND lci.ID NOT IN
(SELECT
contract_id
FROM
flow_bussiness_object fbo,
flow_object fo
WHERE fbo.flow_unid = fo.objectno
AND fbo.flow_name = '资金付款'
AND fo.phaseno NOT IN ('1000', '8000'))) tab where tab.overmoney>0
]]>
</table_sql>
</MYSQL>
<ORACLE>
<table_sql>
<![CDATA[
select
ID,
CONTRACT_NUMBER,
CONTRACT_NO,
PROJECT_ID,
PRODUCT_ID,
PROJECT_NAME,
customerid,
customername,
plan_money,
afact_money,
allfact_money,
fee_adjust,
overmoney,
username from (
SELECT
lci.ID,
lci.CONTRACT_NUMBER,
lci.CONTRACT_NO,
lci.PROJECT_ID,
lci.PRODUCT_ID,
lci.PROJECT_NAME,
lul.customerid,
lul.customername,
vlfp.plan_money,
(NVL(lfi.allfact_money, 0)) AS afact_money,
vlfp.allfact_money,
vlfp.fee_adjust,
vlfp.overmoney,
ui.username
FROM
LB_CONTRACT_INFO lci
LEFT JOIN
(SELECT
lu.contract_id,
ci.customerid,
ci.customername
FROM
LB_UNION_LESSEE lu,
CUSTOMER_INFO ci
WHERE lu.CUSTOMER_ID = ci.customerid
AND is_main = 'Y') lul
ON lul.CONTRACT_ID = lci.ID
LEFT JOIN
(SELECT
vl.contract_id,
SUM(vl.plan_money) plan_money,
SUM(vl.allfact_money) allfact_money,
SUM(vl.fee_adjust) fee_adjust,
SUM(vl.overmoney) overmoney
FROM
vi_lc_fund_plan vl
WHERE vl.pay_type = 'pay_type_out'
AND vl.fee_type NOT IN ('feetype16', 'feetype17')
GROUP BY vl.contract_id) vlfp
ON vlfp.contract_id = lci.ID
LEFT JOIN
(SELECT
contract_id,
SUM(NVL(fact_money, 0)) + SUM(NVL(fee_adjust, 0)) AS allfact_money
FROM
lc_fund_income
WHERE pay_type = 'pay_type_out'
AND roll_back = '0'
AND pay_status = 'apply_pass'
GROUP BY contract_id) lfi
ON lfi.contract_id = lci.ID
LEFT JOIN user_info ui
ON lci.PROJECT_MANAGE = ui.userid
WHERE (
lci.contract_status = '21'
OR lci.contract_status = '25'
OR lci.contract_status = '26'
)
AND NVL(lfi.allfact_money, 0) < vlfp.plan_money
AND lci.ID NOT IN
(SELECT
contract_id
FROM
flow_bussiness_object fbo,
flow_object fo
WHERE fbo.flow_unid = fo.objectno
AND fbo.flow_name = '资金付款'
AND fo.phaseno NOT IN ('1000', '8000'))) tab where tab.overmoney>0
]]>
</table_sql>
</ORACLE>
<dataSource>dataSource</dataSource>
<show_sql>false</show_sql>
</data>
</table>
</table-root>

View File

@ -9,14 +9,23 @@
})
function newApply()
{ var userid="<%=CurUser.getUserID()%>";
{
var userid="<%=CurUser.getUserID()%>";
var flowno="<%=CurPage.getParameter("ApplyType")%>";
var selname="";
var orgId="<%=CurUser.getOrgID()%>".substring(0,7);
var param="userid,"+userid;
var getorgid="<%=CurUser.getOrgID()%>";
var orgId="<%=CurUser.getOrgID()%>".substring(0,7);
var businessType="";
if(flowno=="BContractApproveApply"){
selname="SelectProjectForContract_Car";
businessType="1";
//¿¨¶û
if(getorgid=="8006009"){
selname="SelectProjectForContract_Car_KE";
param="orgid,"+getorgid;
}
}else{
selname="SelectProjectForContract";
if(orgId=="8009010"){
@ -28,7 +37,7 @@
return;
}
}
AsDialog.OpenSelector(selname,"userid,"+userid+",businessType,"+businessType,"dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
AsDialog.OpenSelector(selname,param+",businessType,"+businessType,"dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
if(!sReturn||sReturn=="_CANCEL_"||sReturn=="_NONE_"){
//alert(getHtmlMessage('1'));//请选择一条信息!
return;

View File

@ -5,8 +5,17 @@
/*~[Describe=新增记录;InputParam=无;OutPutParam=无;]~*/
function newApply()
{
var userid="<%=CurUser.getUserID()%>";
AsDialog.OpenSelector("SelectContractCar","userid,"+userid,"dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
debugger;
var selname="SelectContractCar";
var param="userid,"+userid;
var userid="<%=CurUser.getUserID()%>";
var orgid="<%=CurUser.getOrgID()%>";
//¿¨¶û
if(orgid=="8006009"){
selname="SelectContractCar_KE";
param="orgid,"+orgid;
}
AsDialog.OpenSelector(selname,param,"dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
if(!sReturn||sReturn=="_CANCEL_"||sReturn=="_NONE_"){
//alert(getHtmlMessage('1'));//请选择一条信息!
return;

View File

@ -5,7 +5,15 @@
/*~[Describe=新增记录;InputParam=无;OutPutParam=无;]~*/
function newApply(){
var userid="<%=CurUser.getUserID()%>";
AsDialog.OpenSelector("SelectContractPayment","userid,"+userid,"dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
var orgid="<%=CurUser.getOrgID()%>";
var selName="SelectContractPayment";
var param="userid,"+userid;
//¿¨¶û
if(orgid=="8006009"){
selName="SelectContractPayment_KE";
param="orgid,"+orgid;
}
AsDialog.OpenSelector(selName,param,"dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
if(!sReturn||sReturn=="_CANCEL_"){
return;
}