Commit 7056617a authored by gzj34291's avatar gzj34291

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/main/webapp/modules/cont/CON505/con_contract_modify.lview
parents 410dbb99 b752fb94
......@@ -113,6 +113,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.32</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.hand.hls</groupId>
<artifactId>leaf-core-db</artifactId>
......@@ -200,6 +206,16 @@
<artifactId>activation</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.55</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.14</version>
</dependency>
</dependencies>
<build>
<finalName>hlcm</finalName>
......
......@@ -22,6 +22,9 @@ values ('CONTRACT', 'CON_CONTRACT_REPO_MODIFY_LV', 'VIEW', -1, sysdate, -1, sysd
insert into HLS_DOC_CATEGORY_DB_OBJECT (DOCUMENT_CATEGORY, OBJECT_NAME, OBJECT_TYPE, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE)
values ('CONTRACT', 'CON_CONTRACT_CCR_Q_LV', 'VIEW', -1, sysdate, -1, sysdate);
insert into HLS_DOC_CATEGORY_DB_OBJECT (DOCUMENT_CATEGORY, OBJECT_NAME, OBJECT_TYPE, CREATED_BY, CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE)
values ('CONTRACT', 'con_contract_history_lv', 'VIEW', -1, sysdate, -1, sysdate);
end;
/
commit;
......
......@@ -9,6 +9,9 @@ set define off
begin
sys_function_assign_pkg.func_bm_load('ZJWFL5110','zjwfl.ZJWFL5110.cus_zj_wfl_instance_node_recipient');
sys_function_assign_pkg.func_bm_load('ZJWFL5110','basic.hls_bp_master_v_for_agent_lov');
sys_function_assign_pkg.func_bm_load('acr.ACR515.acr515_invoice_hd_v','acr.ACR515.acr515_invoice_hd_v');
end;
/
......
package com.hand.hsbc;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
public class AuthTypeMode {
public String authType;
public String authValue;
public AuthTypeMode(String authType, String authValue) {
this.authType = authType;
this.authValue = authValue;
}
String getAuthType() {
return authType;
}
String getAuthValue() {
return authValue;
}
public static String getProperties(String item) {
String value = "";
System.out.println("连接成功建立333" + item);
System.out.println("连接成功建立444" + Thread.currentThread().getContextClassLoader().getResource("").getPath());
Properties prop = new Properties();
try {
//
InputStream in = new BufferedInputStream(new FileInputStream(Thread
.currentThread().getContextClassLoader().getResource("")
.getPath()
+ "/paraconfig.properties"));
//
prop.load(in);
value = prop.getProperty(item);
in.close();
} catch (Exception e) {
}
return value;
}
}
package com.hand.hsbc;
import java.io.File;
import java.util.List;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.Namespace;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;
public class SaxReaderXml {
/**
* <p>
* 解析汇丰银行确认文件1,确认文件1无误则有2
* </p>
*
* @author keyouyuan16914
* @version 1.0.0
* @date 2020/01/18
*/
public static String parseacKnowledge1(String path) {
path = "C:\\Users\\User\\Desktop\\testfiledir\\down_confirm\\error1.xml";
SAXReader reader = new SAXReader();
Document document;
String error_msg = "";
try {
document = reader.read(new File(path));
Element root = document.getRootElement();
Element Body = root.element("CstmrPmtStsRpt");
List<Element> OrgnlGrpInfAndSts = Body.element("OrgnlGrpInfAndSts").elements();
for (int i = 0; i < OrgnlGrpInfAndSts.size(); i++) {
Element item = OrgnlGrpInfAndSts.get(i);
String GrpSts = null;
if (item.getName() == "GrpSts") {
GrpSts = item.getTextTrim();
/* System.out.println(GrpSts); */
if ("".equals(GrpSts)) {
GrpSts = null;
}
}
if (GrpSts == "ACCP") {
return "SUCCESS";
} else {
if (item.getName() == "StsRsnInf") {
List<Element> StsRsnInfs = item.elements();
for (int j = 0; j < StsRsnInfs.size(); j++) {
Element item2 = StsRsnInfs.get(j);
if (item2.getName() == "AddtlInf") {
error_msg += item2.getTextTrim();
}
}
}
/* System.out.println(error_msg); */
}
}
} catch (DocumentException e) {
e.printStackTrace();
}
return error_msg;
}
/**
* <p>
* 解析汇丰银行确认文件2
* </p>
*
* @author keyouyuan16914
* @version 1.0.0
* @date 2020/01/18
*/
public static String parseacKnowledge2(String path) {
path = "C:\\Users\\User\\Desktop\\testfiledir\\down_confirm\\正确确认文件2.xml";
SAXReader reader = new SAXReader();
Document document;
String error_msg = "";
try {
document = reader.read(new File(path));
Element root = document.getRootElement();
Element Body = root.element("CstmrPmtStsRpt");
List<Element> OrgnlGrpInfAndSts = Body.element("OrgnlPmtInfAndSts").elements();
for (int i = 0; i < OrgnlGrpInfAndSts.size(); i++) {
Element item = OrgnlGrpInfAndSts.get(i);
String PmtInfSts = null;
if (item.getName() == "PmtInfSts") {
PmtInfSts = item.getTextTrim();
/* System.out.println(GrpSts); */
if ("".equals(PmtInfSts)) {
PmtInfSts = null;
}
}
if (PmtInfSts == "ACCP") {
return "SUCCESS";
} else {
// 此处需要进行判断
/*
* if(item.getName()=="StsRsnInf") { List<Element> StsRsnInfs=item.elements();
* for (int j=0; j<StsRsnInfs.size(); j++) { Element item2 = StsRsnInfs.get(j);
* if(item2.getName()=="AddtlInf"){ error_msg+= item2.getTextTrim();
*
* } }
*
* }
*/
/* System.out.println(error_msg); */
}
}
} catch (DocumentException e) {
e.printStackTrace();
}
return error_msg;
}
/**
* <p>
* 解析汇丰银行日中文件2
* </p>
*
* @author keyouyuan16914
* @version 1.0.0
* @date 2020/01/18
*/
public static String parseDayMidFile(String path, String cdValue) {
cdValue="ITBD";
path = "C:\\Users\\User\\Desktop\\testfiledir\\down_day_mid_result\\testMid.xml";
SAXReader reader = new SAXReader();
Document document;
String error_msg = "";
try {
document = reader.read(new File(path));
Element root = document.getRootElement();
Element Body = root.element("BkToCstmrAcctRpt");
Element Rpt = Body.element("Rpt");
List<Element> Rpts = Rpt.elements();
System.out.println(Rpts.size());
for (int i = 0; i < Rpts.size(); i++) {
Element item = Rpts.get(i);
String amt = null;
if (item.getName() == "Bal") {
System.out.println(item.element("Tp").getName());
System.out.println(item.element("Tp").element("CdOrPrtry").getName());
System.out.println(item.element("Tp").element("CdOrPrtry").element("Cd").getName());
System.out.println(item.element("Tp").element("CdOrPrtry").element("Cd").getTextTrim());
String ss=item.element("Tp").element("CdOrPrtry").element("Cd").getTextTrim();
System.out.println("1111");
System.out.println(ss.toString());
if(ss.toString().equals(cdValue)) {
System.out.println("2222");
System.out.println(item.element("Amt").getTextTrim());
}
}
if (amt == "ACCP") {
return "SUCCESS";
} else {
// 此处需要进行判断
/*
* if(item.getName()=="StsRsnInf") { List<Element> StsRsnInfs=item.elements();
* for (int j=0; j<StsRsnInfs.size(); j++) { Element item2 = StsRsnInfs.get(j);
* if(item2.getName()=="AddtlInf"){ error_msg+= item2.getTextTrim();
*
* } }
*
* }
*/
/* System.out.println(error_msg); */
}
}
} catch (DocumentException e) {
e.printStackTrace();
}
return error_msg;
}
public static String xmlToString(String xmlFileName){
SAXReader saxReader=new SAXReader();
org.dom4j.Document document;
String xmlString="";
try {
document = saxReader.read(new File(xmlFileName));
xmlString=document.asXML();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
xmlString="";
}
//String xmlString = document.asXML();
return xmlString;
}
public static void main(String[] args) throws Exception {
System.out.println(xmlToString("C:\\Users\\User\\Desktop\\testfiledir\\down_confirm\\ACK1PSRV3.PC000018926.20201231113053992299.20210121114031002.XML"));
}
}
package com.hand.hsbc;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.SftpException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;
import java.io.*;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.Vector;
/**
* <p>
* Sftp工具类
* </p>
*
* @author huqingniu
* @version 1.0.0
* @date 2018/12/24
*/
public class SftpTool {
public static final Logger logger = LoggerFactory.getLogger(SftpTool.class);
private String host;
private String username;
private int port;
public SftpTool(String host, String username, int port) {
this.host = host;
this.username = username;
this.port = port;
}
/**
* 登陆sftp
*
* @param authTypeMode 认证方式
* @return 登陆信息
*/
public Map<String, Object> loginIn(AuthTypeMode authTypeMode) {
// 解决JSch日志打印问题
/* JSch.setLogger(new SettleJschLogPrint()); */
System.setProperty("java.net.preferIPv4Stack", "true");
try {
ChannelSftp sftp = null;
Session session = null;
JSch jsch = new JSch();
/* logger.info("获取SFTP服务器连接username:{},host:{},port:{}",username,host,port); */
session = jsch.getSession(username, host, port);
logger.info("连接成功建立");
System.out.println("连接成功建立" + "333333");
System.out.println("连接成功建立" + username);
System.out.println("连接成功建立" + host);
System.out.println("连接成功建立" + port);
if (AuthTypeEnum.RSA.getCode().equals(authTypeMode.getAuthType())) {
jsch.addIdentity(authTypeMode.getAuthValue(), "");
} else {
session.setPassword(authTypeMode.getAuthValue());
}
Properties sshConfig = new Properties();
sshConfig.put("StrictHostKeyChecking", "no");
sshConfig.put("PreferredAuthentications", "publickey,gssapi-with-mic,keyboard-interactive,password");
session.setConfig(sshConfig);
session.connect();
logger.info("用户" + username + "成功登陆");
System.out.println("成功登陆" + "333333");
Channel channel = session.openChannel("sftp");
channel.connect();
sftp = (ChannelSftp) channel;
HashMap<String, Object> loginInfo = new HashMap<>();
loginInfo.put("sftp", sftp);
loginInfo.put("session", session);
return loginInfo;
} catch (JSchException e) {
throw new RuntimeException("user login SFTP server occur exception:" + e);
}
}
/**
* 退出登陆
*
* @param sftp sftp对象
* @param session session对象
*/
public void loginOut(ChannelSftp sftp, Session session) {
try {
if (null != sftp && sftp.isConnected()) {
sftp.disconnect();
}
if (null != session && session.isConnected()) {
session.disconnect();
}
} catch (Exception e) {
logger.warn("用户退出SFTP服务器出现异常:" + e);
}
}
/**
* 下载文件
*
* @param downloadFilePath 要下载的文件所在绝对路径
* @param downloadFileName 要下载的文件名(sftp服务器上的文件名)
* @param saveFile 文件存放位置(文件所在绝对路径)
* @param authTypeMode 用户认证方式
*/
/*public String download(String downloadFilePath, String downloadFileName, String saveFile, AuthTypeMode authTypeMode)
throws Exception {
Assert.notNull(downloadFilePath, "download file absolute path is not null");
Assert.notNull(downloadFileName, "download file is not null");
Assert.notNull(saveFile, "save file location is not null");
Assert.notNull(authTypeMode, "auth type way is not null");
OutputStream outputStream = null;
ChannelSftp sftp = null;
Session session = null;
try {
Map<String, Object> loginInfo = loginIn(authTypeMode);
sftp = (ChannelSftp) loginInfo.get("sftp");
session = (Session) loginInfo.get("session");
logger.info("待下载文件地址为:" + downloadFilePath + ",文件名为:" + downloadFileName + ",认证方式:"
+ authTypeMode.getAuthValue());
sftp.cd(downloadFilePath);
*//* sftp.ls(downloadFilePath); *//*
Vector vector = sftp.ls(downloadFilePath);
Iterator iterator = vector.iterator();
String returnFileName ="";
String conn="";
while (iterator.hasNext()) {
ChannelSftp.LsEntry file = (ChannelSftp.LsEntry) iterator.next();
// 文件名称
String fileName = file.getFilename();
if (fileName.indexOf(".XML") != -1) {
if (returnFileName!="") {
conn=";";
}
outputStream = new FileOutputStream(saveFile + "\\" + fileName);
System.out.println(fileName + "fileName");
sftp.get(fileName, outputStream);
returnFileName=returnFileName+conn+fileName;
}
}
System.out.println("下载成功" + "333333");
return returnFileName;
*//*
* outputStream = new FileOutputStream(saveFile); sftp.get(downloadFileName,
* outputStream);
*//*
*//* logger.info("文件下载完成!"); *//*
} finally {
if (null != outputStream) {
outputStream.close();
}
loginOut(sftp, session);
}
}*/
/**
* 下载文件
* CAMT52V2 日中对账单按照付款账号下载
* CAMT53V2 日间对账单按照付款账号下载
* ACK1PSRV3 ACK1文件按照02下载
* ACK2PSRV3 ACK2文件按照02下载
* ACKMT999 ACK3 ACK4只有建机系统下载
* @param downloadFilePath 要下载的文件所在绝对路径
* @param systemflag 区分汽车系统和建机系统,01:汽车系统;02:建机系统
* @param accountnumber 付款账号
* @param saveFile 文件存放位置(文件所在绝对路径)
* @param authTypeMode 用户认证方式
*/
public String downloaddiff(String downloadFilePath, String systemflag, String accountnumber, String saveFile, AuthTypeMode authTypeMode)
throws Exception {
Assert.notNull(downloadFilePath, "download file absolute path is not null");
Assert.notNull(saveFile, "save file location is not null");
Assert.notNull(authTypeMode, "auth type way is not null");
OutputStream outputStream = null;
ChannelSftp sftp = null;
Session session = null;
try {
Map<String, Object> loginInfo = loginIn(authTypeMode);
sftp = (ChannelSftp) loginInfo.get("sftp");
session = (Session) loginInfo.get("session");
sftp.cd(downloadFilePath);
/* sftp.ls(downloadFilePath); */
Vector vector = sftp.ls(downloadFilePath);
Iterator iterator = vector.iterator();
String returnFileName ="";
String conn="";
String downflag = "N";
while (iterator.hasNext()) {
ChannelSftp.LsEntry file = (ChannelSftp.LsEntry) iterator.next();
// 文件名称
String fileName = file.getFilename();
if (fileName.indexOf(".XML") != -1) {
if (fileName.indexOf("ACK1PSRV3") != -1 || fileName.indexOf("ACK2PSRV3") != -1) {
String reqsn = fileName.substring(fileName.indexOf(".", fileName.indexOf(".")+1) + 1,fileName.indexOf(".", fileName.indexOf(".", fileName.indexOf(".")+1)+1));
if (reqsn.substring(reqsn.length()-2).equals(systemflag)){
downflag = "Y";
}
}else if(fileName.indexOf("CAMT52V2") != -1 || fileName.indexOf("CAMT53V2") != -1){
String accountno = fileName.substring(fileName.indexOf(".", fileName.indexOf(".")+1) + 1,fileName.indexOf(".", fileName.indexOf(".", fileName.indexOf(".")+1)+1));
if (accountno.equals(accountnumber)){
downflag = "Y";
}
}else{
downflag = "Y";
}
if (downflag.equals("Y")){
if (returnFileName!="") {
conn=";";
}
outputStream = new FileOutputStream(saveFile + "\\" + fileName);
System.out.println(fileName + "fileName");
sftp.get(fileName, outputStream);
returnFileName=returnFileName+conn+fileName;
}
downflag = "N";
}
}
System.out.println("下载成功" + "333333");
return returnFileName;
/*
* outputStream = new FileOutputStream(saveFile); sftp.get(downloadFileName,
* outputStream);
*/
/* logger.info("文件下载完成!"); */
} finally {
if (null != outputStream) {
outputStream.close();
}
loginOut(sftp, session);
}
}
/**
* 上传文件
*
* @param uploadPath 上传SFTP完整路径
* @param uploadFile 上传文件(完整路径)
* @param authTypeMode 认证方式
*/
public String upload(String uploadPath, String uploadFile, AuthTypeMode authTypeMode) throws Exception {
Assert.notNull(uploadPath, "upload path is not null");
Assert.notNull(uploadFile, "upload file is not null");
Assert.notNull(authTypeMode, "auth type way is not null");
InputStream inputStream = null;
ChannelSftp sftp = null;
Session session = null;
try {
Map<String, Object> loginInfo = loginIn(authTypeMode);
sftp = (ChannelSftp) loginInfo.get("sftp");
session = (Session) loginInfo.get("session");
logger.info("待上传文件为:" + uploadFile + ",上传SFTP服务器路径:" + uploadPath + ",认证方式:" + authTypeMode.getAuthValue());
File file = new File(uploadFile);
inputStream = new FileInputStream(file);
try {
sftp.cd(uploadPath);
} catch (SftpException e) {
return e.getMessage();
/*
* logger.error("SFTP器服务存放文件路径不存在");
*
* throw new RuntimeException("upload path is not exist");
*/
}
sftp.put(inputStream, file.getName());
System.out.println("上传文件成功" + "333333");
logger.info("上传文件成功!");
return "UPLOAD_SUCCESS";
} finally {
if (null != inputStream) {
inputStream.close();
}
loginOut(sftp, session);
}
}
/**
* authType = PASSWORD,authValue = password authType = rsa,authValue = rsa文件路径
*/
/*
* class AuthTypeMode{ private String authType;
*
* private String authValue;
*
* AuthTypeMode(String authType, String authValue){ this.authType = authType;
* this.authValue = authValue; }
*
* String getAuthType(){ return authType; }
*
* String getAuthValue(){ return authValue; } }
*/
/**
* 在slf4j日志框架里打印JSch日志
*/
/*
* class SettleJschLogPrint implements com.jcraft.jsch.Logger {
*
* @Override public boolean isEnabled(int i) { return true; }
*
* @Override public void log(int i, String s) { logger.info(s); } }
*/
enum AuthTypeEnum {
PASSWORD("PASSWORD", "密码认证"),
RSA("RSA", "rsa密钥认证");
private String code;
private String desc;
AuthTypeEnum(String code, String desc) {
this.code = code;
this.desc = desc;
}
public String getCode() {
return this.code;
}
}
public static void main(String[] args) throws Exception {
// test
SftpTool sftpTool = new SftpTool("ecom-sftp.fgcn-pprd.hsbc.com","PC000018926_19960", 10022);
//sftpTool.upload("\\", "C:\\Users\\User\\Desktop\\testfiledir\\upload\\20201231113053992298.xml", new AuthTypeMode(AuthTypeEnum.RSA.getCode(),"C:\\Users\\User\\Desktop\\hsbstestnew"));
//sftpTool.download("\\", "", "C:\\Users\\User\\Desktop\\testfiledir\\down_confirm\\", new AuthTypeMode(AuthTypeEnum.RSA.getCode(),"C:\\Users\\User\\Desktop\\hsbstestnew"));
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: DJ
$Date: 2013-9-2 上午10:16:09
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="acr515_invoice_hd_v" defaultOrderBy="">
<bm:fields>
<bm:field name="invoice_hd_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INVOICE_HD_ID"/>
<bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID"/>
<bm:field name="document_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_NUMBER" prompt="HLS.DOCUMENT_NUMBER"/>
<bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE" prompt="HLS.DOCUMENT_TYPE"/>
<bm:field name="document_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE_DESC" prompt="HLS.DOCUMENT_TYPE_DESC"/>
<bm:field name="document_category" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY" prompt="HLS.DOCUMENT_CATEGORY"/>
<bm:field name="document_category_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_CATEGORY_DESC" prompt="HLS.DOCUMENT_CATEGORY_DESC"/>
<bm:field name="business_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE" prompt="HLS.BUSINESS_TYPE"/>
<bm:field name="business_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE_DESC" prompt="HLS.BUSINESS_TYPE_DESC"/>
<bm:field name="billing_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_METHOD" prompt="ACR.BILLING_METHOD"/>
<bm:field name="billing_method_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BILLING_METHOD_DESC" prompt="ACR.BILLING_METHOD_DESC"/>
<bm:field name="lease_organization" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_ORGANIZATION" prompt="HLS.LEASE_ORGANIZATION"/>
<bm:field name="lease_organization_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_ORGANIZATION_DESC" prompt="HLS.LEASE_ORGANIZATION_DESC"/>
<bm:field name="lease_channel" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL" prompt="HLS.LEASE_CHANNEL"/>
<bm:field name="lease_channel_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL_DESC" prompt="HLS.LEASE_CHANNEL_DESC"/>
<bm:field name="division" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DIVISION" prompt="HLS.DIVISION"/>
<bm:field name="division_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DIVISION_DESC" prompt="HLS.DIVISION_DESC"/>
<bm:field name="manual_invoice_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="MANUAL_INVOICE_FLAG" prompt="ACR.MANUAL_INVOICE_FLAG"/>
<bm:field name="invoice_bp_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INVOICE_BP_ID"/>
<bm:field name="invoice_bp_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_BP_CODE" prompt="ACR.INVOICE_BP_CODE"/>
<bm:field name="invoice_bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_BP_NAME" prompt="ACR.INVOICE_BP_NAME"/>
<bm:field name="invoice_title" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_TITLE" prompt="ACR.INVOICE_TITLE"/>
<bm:field name="bp_tax_registry_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_TAX_REGISTRY_NUM" prompt="ACR.BP_TAX_REGISTRY_NUM"/>
<bm:field name="bp_address_phone_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_ADDRESS_PHONE_NUM" prompt="ACR.BP_ADDRESS_PHONE_NUM"/>
<bm:field name="bp_bank_account" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_BANK_ACCOUNT" prompt="ACR.BP_BANK_ACCOUNT"/>
<bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION" prompt="HLS.DESCRIPTION"/>
<bm:field name="total_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TOTAL_AMOUNT" prompt="ACR.TOTAL_AMOUNT"/>
<bm:field name="tax_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="TAX_AMOUNT" prompt="ACR.TAX_AMOUNT"/>
<bm:field name="return_tax_amount" databaseType="NUMBER" datatype="java.lang.Double" prompt="金税返回税额"/>
<bm:field name="dif_tax_amount" prompt="税额差"/>
<bm:field name="net_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="NET_AMOUNT" prompt="不含税金额"/>
<bm:field name="currency" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY" prompt="HLS.CURRENCY"/>
<bm:field name="currency_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY_DESC" prompt="HLS.CURRENCY_DESC"/>
<bm:field name="exchange_rate_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_TYPE" prompt="HLS.EXCHANGE_RATE_TYPE"/>
<bm:field name="exchange_rate_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_TYPE_DESC" prompt="HLS.EXCHANGE_RATE_TYPE_DESC"/>
<bm:field name="exchange_rate_quotation" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXCHANGE_RATE_QUOTATION" prompt="ACR.EXCHANGE_RATE_QUOTATION"/>
<bm:field name="exchange_rate" databaseType="NUMBER" datatype="java.lang.Double" physicalName="EXCHANGE_RATE" prompt="HLS.EXCHANGE_RATE"/>
<bm:field name="distribution_set_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DISTRIBUTION_SET_ID"/>
<bm:field name="internal_period_num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INTERNAL_PERIOD_NUM" prompt="ACR.INTERNAL_PERIOD_NUM"/>
<bm:field name="period_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PERIOD_NAME" prompt="HLS.PERIOD_NAME"/>
<bm:field name="accounting_date" databaseType="DATE" datatype="java.util.Date" physicalName="ACCOUNTING_DATE" prompt="ACR.ACCOUNTING_DATE"/>
<bm:field name="invoice_date" databaseType="DATE" datatype="java.util.Date" physicalName="INVOICE_DATE" prompt="ACR.INVOICE_DATE"/>
<bm:field name="invoice_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_NUMBER" prompt="ACR.INVOICE_NUMBER"/>
<bm:field name="invoice_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_STATUS" prompt="ACR.INVOICE_STATUS"/>
<bm:field name="invoice_status_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_STATUS_DESC" prompt="ACR.INVOICE_STATUS"/>
<bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID"/>
<bm:field name="project_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NUMBER" prompt="HLS.PROJECT_NUMBER"/>
<bm:field name="project_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_NAME" prompt="HLS.PROJECT_NAME"/>
<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID"/>
<bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="HLS.CONTRACT_NUMBER"/>
<bm:field name="contract_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NAME" prompt="HLS.CONTRACT_NAME"/>
<bm:field name="reversed_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REVERSED_FLAG" prompt="ACR.REVERSED_FLAG"/>
<bm:field name="source_invoice_header_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SOURCE_INVOICE_HEADER_ID"/>
<bm:field name="create_je_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CREATE_JE_FLAG" prompt="ACR.CREATE_JE_FLAG"/>
<bm:field name="gld_interface_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="GLD_INTERFACE_FLAG" prompt="ACR.GLD_INTERFACE_FLAG"/>
<bm:field name="confirmed_date" databaseType="DATE" datatype="java.util.Date" physicalName="CONFIRMED_DATE" prompt="ACR.CONFIRMED_DATE"/>
<bm:field name="confirmed_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONFIRMED_BY"/>
<bm:field name="confirmed_by_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONFIRMED_BY_NAME" prompt="ACR.CONFIRMED_BY_NAME"/>
<bm:field name="posted_date" databaseType="DATE" datatype="java.util.Date" physicalName="POSTED_DATE" prompt="ACR.POSTED_DATE"/>
<bm:field name="posted_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="POSTED_BY"/>
<bm:field name="posted_by_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="POSTED_BY_NAME" prompt="ACR.POSTED_BY_NAME"/>
<bm:field name="created_by_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CREATED_BY_NAME" prompt="ACR.CREATED_BY_NAME"/>
<bm:field name="invoice_kind" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND" prompt="ACR.INVOICE_KIND"/>
<bm:field name="invoice_kind_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVOICE_KIND_DESC" prompt="ACR.INVOICE_KIND_DESC"/>
<bm:field name="vat_interface_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VAT_INTERFACE_STATUS" prompt="ACR.VAT_INTERFACE_STATUS"/>
<bm:field name="vat_interface_status_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VAT_INTERFACE_STATUS_DESC" prompt="金税状态"/>
<bm:field name="vat_invoice_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VAT_INVOICE_CODE" prompt="ACR.VAT_INVOICE_CODE"/>
<bm:field name="vat_invoice_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VAT_INVOICE_STATUS"/>
<bm:field name="vat_red_notice_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VAT_RED_NOTICE_NUM"/>
<bm:field name="ref_vat_invoice_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_VAT_INVOICE_CODE"/>
<bm:field name="ref_invoice_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_INVOICE_NUMBER"/>
<bm:field name="ref_v01" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V01" prompt="ACR_INVOICE_HD_V.REF_V01"/>
<bm:field name="ref_v02" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V02" prompt="ACR_INVOICE_HD_V.REF_V02"/>
<bm:field name="ref_v03" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V03" prompt="ACR_INVOICE_HD_V.REF_V03"/>
<bm:field name="ref_v04" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V04" prompt="ACR_INVOICE_HD_V.REF_V04"/>
<bm:field name="ref_v05" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V05" prompt="ACR_INVOICE_HD_V.REF_V05"/>
<bm:field name="ref_v06" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V06" prompt="ACR_INVOICE_HD_V.REF_V06"/>
<bm:field name="ref_v07" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V07" prompt="ACR_INVOICE_HD_V.REF_V07"/>
<bm:field name="ref_v08" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V08" prompt="ACR_INVOICE_HD_V.REF_V08"/>
<bm:field name="ref_v09" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V09" prompt="ACR_INVOICE_HD_V.REF_V09"/>
<bm:field name="ref_v10" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_V10" prompt="ACR_INVOICE_HD_V.REF_V10"/>
<bm:field name="ref_n01" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N01" prompt="ACR_INVOICE_HD_V.REF_N01"/>
<bm:field name="ref_n02" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N02" prompt="ACR_INVOICE_HD_V.REF_N02"/>
<bm:field name="ref_n03" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N03" prompt="ACR_INVOICE_HD_V.REF_N03"/>
<bm:field name="ref_n04" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N04" prompt="ACR_INVOICE_HD_V.REF_N04"/>
<bm:field name="ref_n05" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N05" prompt="ACR_INVOICE_HD_V.REF_N05"/>
<bm:field name="ref_n06" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N06" prompt="ACR_INVOICE_HD_V.REF_N06"/>
<bm:field name="ref_n07" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N07" prompt="ACR_INVOICE_HD_V.REF_N07"/>
<bm:field name="ref_n08" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N08" prompt="ACR_INVOICE_HD_V.REF_N08"/>
<bm:field name="ref_n09" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N09" prompt="ACR_INVOICE_HD_V.REF_N09"/>
<bm:field name="ref_n10" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_N10" prompt="ACR_INVOICE_HD_V.REF_N10"/>
<bm:field name="ref_d01" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D01" prompt="ACR_INVOICE_HD_V.REF_D01"/>
<bm:field name="ref_d02" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D02" prompt="ACR_INVOICE_HD_V.REF_D02"/>
<bm:field name="ref_d03" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D03" prompt="ACR_INVOICE_HD_V.REF_D03"/>
<bm:field name="ref_d04" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D04" prompt="ACR_INVOICE_HD_V.REF_D04"/>
<bm:field name="ref_d05" databaseType="DATE" datatype="java.util.Date" physicalName="REF_D05" prompt="ACR_INVOICE_HD_V.REF_D05"/>
<bm:field name="owner_user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OWNER_USER_ID"/>
<bm:field name="owner_user_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="OWNER_USER_NAME" prompt="ACR.OWNER_USER_NAME"/>
<bm:field name="express_date" databaseType="DATE" datatype="java.util.Date" physicalName="EXPRESS_DATE" prompt="ACR.EXPRESS_DATE"/>
<bm:field name="express_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_STATUS" prompt="ACR.EXPRESS_STATUS"/>
<bm:field name="express_num" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_NUM" prompt="ACR.EXPRESS_NUM"/>
<bm:field name="express_company" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_COMPANY" prompt="ACR.EXPRESS_COMPANY"/>
<bm:field name="express_by" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EXPRESS_BY"/>
<bm:field name="express_note" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="EXPRESS_NOTE" prompt="ACR.EXPRESS_NOTE"/>
<bm:field name="billing_way_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="billing_way_desc" prompt="开票方式"/>
<bm:field name="invoice_apply_num" databaseType="VARCHAR2" datatype="java.lang.String" />
<bm:field name="invoice_apply_id" databaseType="NUMBER" datatype="java.lang.Long"/>
<bm:field name="invoice_kind_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="invoice_kind_type" prompt="发票种类"/>
<bm:field name="invoice_kind_type_n" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="invoice_kind_type_n" prompt="发票种类"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="document_number_f" queryExpression="t1.document_number &gt;= ${@document_number_f}"/>
<bm:query-field name="document_number_t" queryExpression="t1.document_number &lt;= ${@document_number_t}"/>
<bm:query-field name="contract_number_f" queryExpression="t1.contract_number &gt;= ${@contract_number_f}"/>
<bm:query-field name="contract_number_t" queryExpression="t1.contract_number &lt;= ${@contract_number_t}"/>
<bm:query-field name="invoice_number_f" queryExpression="t1.invoice_number &gt;= ${@invoice_number_f}"/>
<bm:query-field name="invoice_number_t" queryExpression="t1.invoice_number &lt;= ${@invoice_number_t}"/>
<bm:query-field name="invoice_date_f" queryExpression="t1.invoice_date &gt;= to_date(${@invoice_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="invoice_date_t" queryExpression="t1.invoice_date &lt;= to_date(${@invoice_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_f" queryExpression="t1.accounting_date &gt;= to_date(${@accounting_date_f},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="accounting_date_t" queryExpression="t1.accounting_date &lt;= to_date(${@accounting_date_t},&apos;yyyy-mm-dd&apos;)"/>
<bm:query-field name="total_amount_f" queryExpression="t1.total_amount &gt;= ${@total_amount_f}"/>
<bm:query-field name="total_amount_t" queryExpression="t1.total_amount &lt;= ${@total_amount_t}"/>
<bm:query-field name="invoice_bp_code_f" queryExpression="t1.invoice_bp_code &gt;= ${@invoice_bp_code_f}"/>
<bm:query-field name="invoice_bp_code_t" queryExpression="t1.invoice_bp_code &lt;= ${@invoice_bp_code_t}"/>
<bm:query-field name="currency" queryExpression="t1.currency = ${@currency}"/>
<bm:query-field name="invoice_status" queryExpression="t1.invoice_status = ${@invoice_status}"/>
<bm:query-field name="vat_interface_status" queryExpression="t1.vat_interface_status = ${@vat_interface_status}"/>
<bm:query-field name="business_type" queryExpression="t1.business_type = ${@business_type}"/>
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
<bm:query-field name="invoice_title" queryExpression="t1.invoice_title like ${@invoice_title}"/>
<bm:query-field name="created_by" queryExpression="t1.created_by = ${@created_by}"/>
<bm:query-field name="received_flag" queryExpression="(nvl(t1.express_status,&apos;UNDELIVERED&apos;) !=&apos;RECEIVED&apos; or ${@received_flag}=&apos;Y&apos;)"/>
<bm:query-field name="express_status" queryExpression="t1.express_status = ${@express_status}"/>
<bm:query-field name="confirmed_by" queryExpression="t1.confirmed_by = ${@confirmed_by}"/>
<bm:query-field name="query_contract_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, con_contract cc where df.contract_id = cc.contract_id and df.ar_invoice_hd_id = t1.invoice_hd_id and cc.contract_number between nvl(${@contract_number_f}, cc.contract_number) and nvl(${@contract_number_t}, cc.contract_number))"/>
<bm:query-field name="query_project_number" queryExpression="exists (select 1 from hls_document_flow_all_v df, prj_project pp where df.ar_invoice_hd_id = t1.invoice_hd_id and df.project_id = pp.project_id and pp.project_number between nvl(${@project_number_f}, pp.project_number) and nvl(${@project_number_t}, pp.project_number))"/>
<bm:query-field name="invoice_apply_num" queryExpression="( exists(select 1 from acr_invoice_apply ap, acr_invoice_hd_wfl aw where ap.wfl_apply_status = 'APPROVED' and ap.apply_mode = 'APPLY' and ap.invoice_apply_id = aw.invoice_apply_id and aw.invoice_hd_id = t1.invoice_hd_id and ap.invoice_apply_num=${@invoice_apply_num}) or exists(select ap.invoice_apply_num from acr_invoice_apply ap, acr_invoice_hd_wfl aw where ap.wfl_apply_status = 'APPROVED' and ap.apply_mode = 'REVERSE' and ap.invoice_apply_id = aw.invoice_apply_id and aw.invoice_hd_id = t1.source_invoice_header_id and ap.invoice_apply_num=${@invoice_apply_num}) )"/>
<bm:query-field name="invoice_kind_type" queryExpression="t1.invoice_kind_type = ${@invoice_kind_type}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.company_id = ${/session/@company_id} and t1.reversed_flag in( &apos;N&apos;,&apos;O&apos;)"/>
<bm:data-filter enforceOperations="query" expression="(t1.invoice_status=&apos;CONFIRM&apos; OR t1.invoice_status=&apos;POST&apos;)"/>
<bm:data-filter enforceOperations="query" expression="(t1.invoice_kind = &apos;0&apos; or t1.invoice_kind = &apos;2&apos;)"/>
</bm:data-filters>
<bm:features>
<f:standard-who/>
</bm:features>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: lijingjing
$Date: 2018-11_03 上午11:00:06
$Revision: 3.0
$Purpose:
-->
<!--
$Author: lijingjing
$Date: 2018-11_03 上午11:00:06
$Revision: 3.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
prj_project_check_pkg.check_prj_lease_item(
p_project_id =>${@project_id},
p_machine_number =>${@machine_number},
p_user_id => ${/session/@user_id}
);
end;
]]></bm:update-sql>
</bm:operation>
</bm:operation>
</bm:operations>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select to_char(t.bp_birth, 'yyyy-mm-dd') bp_birth,
t.BP_MARRIAGE,
bp_marriage_n,
t.BP_HEALTH,
t.BP_HEALTH_n,
t.BP_BORN,
t.BP_BORN_n,
t.PROPERTY_BELONG,
t.PROPERTY_BELONG_n,
t.OWN_PROPERTY_ADDRESS,
t.HOUSE_AREA,
t.HOUSE_VALUE,
t.OWN_MONEY,
t.BANK_CREDIT_APPROVAL,
t.BANK_CREDIT_APPROVAL_n,
t.OTHER_OWN_ASSETS,
t.FAMILY_SOURCE_INCOME,
t.FAMILY_AVG_INCOME,
t.FAMILY_MONTH_AVG_OUTCOME,
t.BANK_LOAN,
t.OTHER_LOAN,
t.FIXED_ASSETS,
t.CAPITAL,
t.CAPITAL_PLACE,
t.CAR_TYPE,
t.CAR_BRAND,
t.CAR_NUM,
t.CAR_BUY_DATE,
t.CAR_BUY_MONEY,
t.WORK_EXPERIENCE,
t.WORK_EXPERIENCE_n,
t.WORK_OPERATOR,
t.WORK_OPERATOR_n,
t.WORK_TYPE,
t.WORK_TYPE_n,
t.WORK_AVG_MONTH_INCOME,
t.WORK_AVG_MONTH_OUTCOME,
t.OTHER_DESCRIPTION,
t.PAYMENT_SOURCE,
t.E_PLACE,
t.E_CONTRACT_AMOUNT,
t.CONTRACT_COPY,
t.CONTRACT_COPY_n,
t.E_CON_AUTHENTICITY,
t.E_CON_AUTHENTICITY_n,
t.SURVEY_FIT,
t.SURVEY_FIT_n,
t.DAILY_CREDIT,
t.DAILY_CREDIT_n,
t.BORROW_SITUATION,
t.BORROW_SITUATION_n,
t.RENT_REPAYMENT,
t.RENTAL_BALANCE,
t.LIQUIDATED_DAMAGES,
t.GUAR_MORTGAGE_STATUS,
t.GUAR_MORTGAGE_STATUS_n,
t.PAST_CONT_EXE_STATUS,
t.PAST_CONT_EXE_STATUS_n,
t.INDUSTRY_JUDGEMENT,
t.INDUSTRY_JUDGEMENT_n,
t.THIRD_PARTY_GUARANTEE,
t.THIRD_PARTY_GUARANTEE_n,
t.THIRD_PARTY_CREDIBILITY,
t.THIRD_PARTY_CREDIBILITY_n,
t.E_PLACE_n,
t.BP_AGE,
t.score_name,
t.third_guar_score
from (select a.*
from (select t1.bp_birth,
t1.BP_MARRIAGE,
t1.bp_marriage_n,
t1.BP_HEALTH,
t1.BP_HEALTH_n,
t1.BP_BORN,
t1.BP_BORN_n,
t1.PROPERTY_BELONG,
t1.PROPERTY_BELONG_n,
t1.OWN_PROPERTY_ADDRESS,
t1.HOUSE_AREA,
t1.HOUSE_VALUE,
t1.OWN_MONEY,
t1.BANK_CREDIT_APPROVAL,
t1.BANK_CREDIT_APPROVAL_n,
t1.OTHER_OWN_ASSETS,
t1.FAMILY_SOURCE_INCOME,
t1.FAMILY_AVG_INCOME,
t1.FAMILY_MONTH_AVG_OUTCOME,
t1.BANK_LOAN,
t1.OTHER_LOAN,
t1.FIXED_ASSETS,
t1.CAPITAL,
t1.CAPITAL_PLACE,
t1.CAR_TYPE,
t1.CAR_BRAND,
t1.CAR_NUM,
t1.CAR_BUY_DATE,
t1.CAR_BUY_MONEY,
t1.WORK_EXPERIENCE,
t1.WORK_EXPERIENCE_n,
t1.WORK_OPERATOR,
t1.WORK_OPERATOR_n,
t1.WORK_TYPE,
t1.WORK_TYPE_n,
t1.WORK_AVG_MONTH_INCOME,
t1.WORK_AVG_MONTH_OUTCOME,
t1.OTHER_DESCRIPTION,
t1.PAYMENT_SOURCE,
t1.E_PLACE,
t1.E_CONTRACT_AMOUNT,
t1.CONTRACT_COPY,
t1.CONTRACT_COPY_n,
t1.E_CON_AUTHENTICITY,
t1.E_CON_AUTHENTICITY_n,
t1.SURVEY_FIT,
t1.SURVEY_FIT_n,
t1.DAILY_CREDIT,
t1.DAILY_CREDIT_n,
t1.BORROW_SITUATION,
t1.BORROW_SITUATION_n,
t1.RENT_REPAYMENT,
t1.RENTAL_BALANCE,
t1.LIQUIDATED_DAMAGES,
t1.GUAR_MORTGAGE_STATUS,
t1.GUAR_MORTGAGE_STATUS_n,
t1.PAST_CONT_EXE_STATUS,
t1.PAST_CONT_EXE_STATUS_n,
t1.INDUSTRY_JUDGEMENT,
t1.INDUSTRY_JUDGEMENT_n,
t1.THIRD_PARTY_GUARANTEE,
t1.THIRD_PARTY_GUARANTEE_n,
t1.THIRD_PARTY_CREDIBILITY,
t1.THIRD_PARTY_CREDIBILITY_n,
t1.E_PLACE_n,
t1.BP_AGE,
t1.score_name,
t1.third_guar_score,
t1.tj_score
from bp_tenant_rate_detail_v t1
where exists
(select 1
from prj_project p
where p.project_id = t1.PROJECT_ID
and p.bp_id_tenant = ${@bp_id}
and p.project_status not in ('CLOSED'))
order by t1.project_id desc) a
where rownum = 1
union
SELECT h.date_of_birth bp_birth,
h.marital_status bp_marriage,
(SELECT code_value_name
FROM sys_code_values_v
WHERE code LIKE 'MARITAL_STATUS'
AND code_value_enabled_flag = 'Y'
AND code_value = h.marital_status) bp_marriage_n,
null BP_HEALTH,
null BP_HEALTH_n,
null BP_BORN,
null BP_BORN_n,
null PROPERTY_BELONG,
null PROPERTY_BELONG_n,
null OWN_PROPERTY_ADDRESS,
null HOUSE_AREA,
null HOUSE_VALUE,
null OWN_MONEY,
null BANK_CREDIT_APPROVAL,
null BANK_CREDIT_APPROVAL_n,
null OTHER_OWN_ASSETS,
null FAMILY_SOURCE_INCOME,
null FAMILY_AVG_INCOME,
null FAMILY_MONTH_AVG_OUTCOME,
null BANK_LOAN,
null OTHER_LOAN,
null FIXED_ASSETS,
null CAPITAL,
null CAPITAL_PLACE,
null CAR_TYPE,
null CAR_BRAND,
null CAR_NUM,
null CAR_BUY_DATE,
null CAR_BUY_MONEY,
null WORK_EXPERIENCE,
null WORK_EXPERIENCE_n,
null WORK_OPERATOR,
null WORK_OPERATOR_n,
h.industry work_type,
(SELECT code_value_name
FROM sys_code_values_v
WHERE code LIKE 'INDUSTRY_HL'
AND code_value_enabled_flag = 'Y'
AND code_value = h.industry) WORK_TYPE_n,
null WORK_AVG_MONTH_INCOME,
null WORK_AVG_MONTH_OUTCOME,
null OTHER_DESCRIPTION,
null PAYMENT_SOURCE,
null E_PLACE,
null E_CONTRACT_AMOUNT,
null CONTRACT_COPY,
null CONTRACT_COPY_n,
null E_CON_AUTHENTICITY,
null E_CON_AUTHENTICITY_n,
null SURVEY_FIT,
null SURVEY_FIT_n,
null DAILY_CREDIT,
null DAILY_CREDIT_n,
null BORROW_SITUATION,
null BORROW_SITUATION_n,
null RENT_REPAYMENT,
null RENTAL_BALANCE,
null LIQUIDATED_DAMAGES,
null GUAR_MORTGAGE_STATUS,
null GUAR_MORTGAGE_STATUS_n,
null PAST_CONT_EXE_STATUS,
null PAST_CONT_EXE_STATUS_n,
null INDUSTRY_JUDGEMENT,
null INDUSTRY_JUDGEMENT_n,
null THIRD_PARTY_GUARANTEE,
null THIRD_PARTY_GUARANTEE_n,
null THIRD_PARTY_CREDIBILITY,
null THIRD_PARTY_CREDIBILITY_n,
null E_PLACE_n,
null BP_AGE,
DECODE(h.bp_class, 'NP',h.bp_name, 'ORG', h.legal_person) score_name,
null third_guar_score,
null tj_score
FROM hls_bp_master h
where h.bp_id = ${@bp_id}) t
where rownum = 1
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT
*
FROM
(SELECT
t1.bank_account_id,
t1.bank_account_code,
t3.bank_short_name,
t2.bank_branch_name,
t1.bank_account_name,
t1.bank_account_num,
t3.bank_code
FROM
csh_bank_account t1,
csh_bank_branch t2,
csh_bank t3
WHERE
t1.bank_branch_id = t2.bank_branch_id AND
t2.bank_id = t3.bank_id AND
t1.enabled_flag = 'Y' AND
t2.enabled_flag = 'Y' AND
t3.enabled_flag = 'Y'
) v #WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="bank_account_id" databaseType="NUMBER" datatype="java.lang.Long"/>
<bm:field name="bank_account_code" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" prompt="账户代码"/>
<bm:field name="bank_short_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" forQuery="true" prompt="银行简称" queryWidth="100"/>
<bm:field name="bank_branch_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" forQuery="true" prompt="分行名称" queryWidth="100"/>
<bm:field name="bank_account_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" prompt="账户名"/>
<bm:field name="bank_account_num" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="100" forDisplay="true" prompt="银行账号"/>
</bm:fields>
<bm:query-fields>
<bm:query-field name="bank_short_name" queryExpression="v.bank_short_name like ${@bank_short_name}"/>
<bm:query-field name="bank_branch_name" queryExpression="v.bank_branch_name like ${@bank_branch_name}"/>
</bm:query-fields>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="v.bank_code IN ('019')"/>
</bm:data-filters>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
delete from hl_hsbc_doc_temp t where t.session_id = ${/session/@session_id}
]]></bm:update-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
hl_hsbc_interface_pkg.insert_doc_temp(
p_session_id=>${/session/@session_id},
p_payment_req_ln_id=>${@payment_req_ln_id},
p_payment_req_id=>${@payment_req_id},
p_tranamount =>${@unpaid_amount},
p_user_id=>${/session/@user_id},
p_button_id => ${/parameter/@button_id},
p_division => '70'
);
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
hl_hsbc_interface_pkg.create_batch(p_session_id => ${/session/@session_id},
p_bank_account_id => ${@bank_account_id},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select decode(count(1), 0, 'N', 'Y') as flag
from (select u.user_id id
from sys_user u
where u.user_id = ${/session/@user_id}
and u.user_name in ('XUEJINGYAN','WUYING','KATO','HAND'))
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="reqsn" databaseType="VARCHAR2" datatype="java.lang.String"/>
</bm:fields>
<bm:operations>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
delete from HL_HSBC_BATCH_TEMP t where t.session_id = ${/session/@session_id}
]]></bm:update-sql>
</bm:operation>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
hl_hsbc_interface_pkg.init_hl_hsbc_batch_temp(
p_session_id=> ${/session/@session_id},
p_reqsn=>${@reqsn},
p_user_id => '-1');
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
hl_hsbc_interface_pkg.init_hl_hsbc_batch_temp(
p_session_id=> ${/session/@session_id},
p_reqsn=>${@reqsn},
p_user_id => '-1');
end;
]]></bm:update-sql>
</bm:operation>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select t2.reqsn
from hl_hsbc_paying_batch t2
where t2.status = 'SEND_MID'
order by 1
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="log_id" databaseType="NUMBER" datatype="java.lang.Long"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select hl_hsbc_interface_log_s.nextval as log_id from dual
]]></bm:query-sql>
</bm:operation>
<bm:operation name="insert">
<bm:query-sql><![CDATA[
BEGIN
hl_hsbc_interface_pkg.insert_log(
p_log_id => ${@log_id},
p_interface_code=> ${@interface_code},
p_reqsn => ${@reqsn},
p_request => ${@request},
p_send_return_code => ${@send_return_code},
p_user_id => ${/session/@user_id}
);
END;
]]></bm:query-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select hl_hsbc_interface_pkg.get_HSBC_content(${@reqsn}) xml_content from dual
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="xml_content" databaseType="CLOB" datatype="java.lang.String"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="delete">
<bm:update-sql><![CDATA[
BEGIN
hl_hsbc_interface_pkg.close_paying_batch(
p_reqsn => ${@reqsn},
p_bank_item => ${@bank_item},
p_user_id => ${/session/@user_id}
);
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="execute">
<bm:update-sql><![CDATA[
begin
hl_hsbc_interface_pkg.change_to_manual_pay(p_reqsn=>${@reqsn},
p_bank_item=>${@bank_item},
p_user_id => ${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
hl_hsbc_interface_pkg.update_upload_file(
p_reqsn=> ${@reqsn},
p_upload_msg=> ${@upload_msg},
p_user_id => '-1');
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="server_id" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="server_port" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="request_clob" databaseType="CLOB" datatype="java.lang.String"/>
</bm:fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:operations>
<bm:operation name="insert">
<bm:update-sql><![CDATA[
begin
hl_hsbc_interface_pkg.update_download_file(
p_file_name=> ${@file_name},
p_file_path=>${@file_path},
p_xml_str=> ${@xml_str},
p_user_id => '-1');
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:fields>
<bm:field name="file_path" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="file_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
<bm:field name="xml_str" databaseType="CLOB" datatype="java.lang.String"/>
</bm:fields>
</bm:model>
......@@ -109,7 +109,16 @@
}
}
}
function remove_query_field(name) {
importClass(Packages.uncertain.composite.CompositeUtil);
var qf_root = $this.getObjectContext().getChild("query-fields");
var query_field = CompositeUtil.findChild(qf_root, "query-field", "field", name);
if (query_field) {
qf_root.removeChild(query_field);
}
}
function import_server_bm_tplt() {
var cx = Packages.leaf.javascript.Context.getCurrentContext();
try {
......
#sftp网址
URL=ecom-sftp.fgcn-pprd.hsbc.com
#sftp用户名
USER_NAME=PC000018926_19960
#sftp端口
PORT=10022
#sftp根路径
ROOT_PATH=\\
#sftp秘钥路径 在这里就正常路径,在svc 或者java 要双斜杠转义
KEY_PATH=F:\\jjhf\\hsbc_key\\hsbstestnew
#sftp待上传文件存放路径
UPLOAD_FILEDIR=F:\\jjhf\\upload\\
#sftp 加密方式 RSA秘钥 PASSWORD 密码
AUTH_CODE=RSA
#sftp 待下载文件存放路径
DOWN_FILEDIR=F:\\jjhf\\down_confirm\\
#sftp 日中对账单文件存放路径
DAY_MID_FILEDIR=F:\\jjhf\\down_day_mid_result\\
#sftp 汇丰银行账号
HSBC_BANK_CODE=715009700011
#sftp 区分汽车系统和建机系统,01:汽车系统;02:建机系统
SYSTEM_FLAG=02
PATH=C:\Users\User\Desktop\testfiledir\down_confirm\TWO.XML
......@@ -92,6 +92,9 @@
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
FROM hls_bp_master h)
ORDER BY bp_detail_id DESC) t1
......
......@@ -681,7 +681,84 @@
WHERE v.code = 'BRANCH_CODE_SZMP'
AND v.code_enabled_flag = 'Y'
AND v.code_value_enabled_flag = 'Y'
AND v.code_value = ct.branch_code) branch_code_n
AND v.code_value = ct.branch_code) branch_code_n,
(select decode(bp.bp_class, 'NP', '自然人', '法人')
from con_contract_bp bp
where bp.contract_id = ct.contract_id
and bp.bp_category = 'TENANT') bp_class_n,
(select b.description
from hls_business_type b
where b.business_type = ct.business_type) business_type_n,
NVL((Select h1.code_value_name value_name
From sys_code_values_v h1
Where h1.code = 'SECONDARY_LEASE'
And h1.code_enabled_flag = 'Y'
And h1.code_value_enabled_flag = 'Y'
AND H1.code_value = CT.SECONDARY_LEASE),
'否') SECONDARY_LEASE_N,
(select d.description from hls_division d where d.division = ct.division) division_n,
nvl((select '是'
from con_contract_change_req ccr
where ccr.contract_id = ct.contract_id
and ccr.req_status = 'APPROVED'
and ccr.document_type = 'LEASE_CHAG'
and rownum = 1),
'否') tenant_change_flag_n,
nvl((select '是'
from dual
where not exists (select 1
from con_contract_cashflow ccc
where ccc.cf_item = 1
and ccc.times <= 12
and ccc.contract_id = ct.contract_id
and ccc.write_off_flag != 'FULL'
and ccc.cf_direction = 'INFLOW')
and exists (select 1
from con_contract_cashflow ccc
where ccc.cf_item = 1
and ccc.times = 12
and ccc.contract_id = ct.contract_id
and ccc.write_off_flag = 'FULL'
and ccc.cf_direction = 'INFLOW')),
'否') rental_12_pay_flag,
nvl((select '是'
from con_contract_cashflow ccc
where ccc.cf_item = 9
and ccc.cf_direction = 'INFLOW'
and ccc.contract_id = ct.contract_id
and (ccc.due_amount > 0 or exists
(select 1
from CON_CONTRACT_CASE_RECORD cr,
CON_CONTRACT_PENALTY_REDUCE pr,
CON_CONTRACT_PENALTY_INFO pi
where cr.record_id = pr.record_id
and pr.penalty_reduce_id = pi.penalty_reduce_id
and pr.contract_id = ccc.contract_id
and pi.penalty_reduce_amount > 0
and cr.status = 'APPROVED'))
and rownum = 1),
'否') cf_9_exists_flag,
nvl((select '是'
from con_contract_cashflow ccc
where ccc.cf_item = 9
and ccc.cf_direction = 'INFLOW'
and ccc.contract_id = ct.contract_id
and (ccc.due_amount > 0 or exists
(select 1
from CON_CONTRACT_CASE_RECORD cr,
CON_CONTRACT_PENALTY_REDUCE pr,
CON_CONTRACT_PENALTY_INFO pi,
con_contract_cashflow cf
where cr.record_id = pr.record_id
and pr.penalty_reduce_id = pi.penalty_reduce_id
and pr.contract_id = ccc.contract_id
and pi.penalty_reduce_amount > 0
and cr.status = 'APPROVED'
and pi.cashflow_id = cf.cashflow_id
and cf.times > 1))
and ccc.times > 1
and rownum = 1),
'否') cf_9_notfirsttime_exists_flag
FROM con_contract ct
WHERE ct.contract_status NOT IN ('CANCEL')
AND ct.data_class = 'NORMAL'
......@@ -753,6 +830,14 @@
<bm:field name="residual_date"/>
<bm:field name="terminate_date"/>
<bm:field name="is_buyout_n"/>
<bm:field name="bp_class_n"/>
<bm:field name="business_type_n"/>
<bm:field name="division_n"/>
<bm:field name="tenant_change_flag_n"/>
<bm:field name="rental_12_pay_flag"/>
<bm:field name="cf_9_exists_flag"/>
<bm:field name="cf_9_notfirsttime_exists_flag"/>
<bm:field name="secondary_lease_n"/>
</bm:fields>
<!-- <bm:query-fields>-->
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: ZLF
$Date: 2015-1-21 下午3:09:38
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT * FROM (
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
decode(reference6, NULL, 0, NVL(round(l.amount_cr,2),0)) amount_tax,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
'违约金',
'HL_SALES_TAX_ACT_NEW',
(SELECT DECODE(cf_item,
2,
'首付款',
8,
'留购价',
1,
times,
200,
'提前结清款',
250,
'回购款',
0,
'设备款')
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id),
'CON_REPURCHASE',
'违约金') times,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
h.journal_date,
'HL_SALES_TAX_ACT_NEW',
(SELECT due_date
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id),
'CON_REPURCHASE',
h.journal_date) due_date,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
decode(reference6, NULL, l.amount_dr, 0),
'HL_SALES_TAX_ACT_NEW',
(SELECT due_amount
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id),
decode(reference6, NULL, l.amount_dr, 0),
'CON_REPURCHASE',
decode(reference6, NULL, l.amount_dr, 0)) due_amount,
(SELECT principal
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id) principal,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
decode(reference6, NULL, l.amount_dr, 0),
'HL_SALES_TAX_ACT_NEW',
(SELECT decode(cf_item, 8, due_amount, interest)
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id),
'CON_REPURCHASE',
decode(reference6, NULL, l.amount_dr, 0)
) interest,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
decode(reference6, NULL, 0, NVL(l.amount_cr,0)),
'HL_SALES_TAX_ACT_NEW',
(SELECT vat_due_amount
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id),
'CON_REPURCHASE',
decode(reference6, NULL, 0, NVL(l.amount_cr,0))) vat_due_amount,
nvl(ROUND((DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
l.amount_cr/(l.reference7-l.amount_cr),
'HL_SALES_TAX_ACT_NEW',
(SELECT vat_due_amount/(due_amount-vat_due_amount)
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id),
l.amount_cr/(l.reference7-l.amount_cr),
'CON_REPURCHASE',
l.amount_cr/(l.reference7-l.amount_cr))),2) * 100,0)|| '%' vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
AND ((h.je_transaction_code IN
('HL_SALES_TAX_ACT_NEW', 'HL_CSH_CONSOLIDATION_DALAY')
)or(h.je_transaction_code = 'CON_REPURCHASE' and
instr(h.description, '调平') > 0))
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND not EXISTS (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date,'yyyymm') <= ${@base_period}
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n04 = l.journal_line_id))
UNION
select vl.*
from ET_VAT_JOURNAL_LV vl
where not EXISTS
(SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date, 'yyyymm') <= ${@base_period}
AND (li.cashflow_id = vl.cashflow_id))
UNION
select rl.*
from REPURSE_VAT_JOURNAL_LV rl
where not EXISTS
(SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date, 'yyyymm') <= ${@base_period}
AND (li.cashflow_id = rl.cashflow_id))
UNION
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND hi.vat_interface_status = 'BACK'
AND li.cf_item = 2
and hi.contract_id = l.source_doc_id
AND ROWNUM = 1) invoice_date,
round(l.amount_dr,2) amount_tax,
'首付款' times,
(SELECT due_date
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1) due_date,
(SELECT due_amount
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1)
due_amount,
(SELECT due_amount
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1) principal,
(SELECT interest
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1) interest,
(SELECT vat_due_amount
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1) vat_due_amount,
NVL(ROUND(
(SELECT vat_due_amount/net_due_amount
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1),
2) * 100,
0) || '%' vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.reversed_flag='N'
AND h.je_transaction_code = 'LEASE_INCEPT'
AND l.je_template_ln_id = 8797
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND not EXISTS
(SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date,'yyyymm') <= ${@base_period}
AND ((hi.contract_id = l.source_doc_id AND li.cf_item IN (2))))
) t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="to_char(t1.journal_date,'yyyymm') = ${@base_period}"/>
<bm:data-filter enforceOperations="query" expression="t1.amount_tax > 0"/>
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/>
<bm:query-field name="bp_name" queryExpression="t1.bp_name = ${@bp_name}"/>
<bm:query-field name="journal_date" queryExpression="to_char(t1.journal_date,'yyyy-mm-dd') = ${@journal_date}"/>
<bm:query-field name="invoice_date" queryExpression="to_char(t1.invoice_date,'yyyy-mm-dd') = ${@invoice_date}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: ZLF
$Date: 2015-1-21 下午3:09:38
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT * FROM (
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
l.amount_cr-nvl((select sum(al.tax_amount) from acr_invoice_hd ah,acr_invoice_ln al where ah.contract_id=h.source_id
and ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and ah.invoice_status='CONFIRM'
and al.cf_item = 2
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') < =${@base_period}
and ah.invoice_status = 'CONFIRM'),0) amount_tax,
'首付款' times,
(select ccc.due_date from con_contract_cashflow ccc where ccc.contract_id=h.source_id
and ccc.cf_item=2) due_date,
(select ccc.due_amount from con_contract_cashflow ccc where ccc.contract_id=h.source_id
and ccc.cf_item=2) due_amount,
(select ccc.due_amount from con_contract_cashflow ccc where ccc.contract_id=h.source_id
and ccc.cf_item=2) principal,
null interest,
l.amount_cr-nvl((select sum(al.tax_amount) from acr_invoice_hd ah,acr_invoice_ln al where ah.contract_id=h.source_id
and ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and ah.invoice_status='CONFIRM'
and al.cf_item = 2
AND to_char(ah.invoice_date,'yyyymm') <= ${@base_period}
and ah.invoice_kind in ('0', '2')
AND ah.vat_interface_status = 'BACK'
and ah.invoice_status = 'CONFIRM'),0) vat_due_amount,
(select round(ccc.vat_due_amount/ccc.net_due_amount,2) from con_contract_cashflow ccc where ccc.contract_id=h.source_id
and ccc.cf_item=2) vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
and h.internal_period_num=to_number(${@base_period})
AND (h.je_transaction_code= 'LEASE_INCEPT')
and exists (select 1
from gld_je_template_hds hd
where hd.je_template_hd_id =
h.je_template_hd_id
and hd.je_template_code =
'HL_INCEPT_DOWN_PAYMENT_CF')
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
l.amount_cr-nvl((select sum(al.tax_amount) from acr_invoice_hd ah,acr_invoice_ln al where ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and al.cashflow_id=l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') < =${@base_period}
and ah.invoice_status = 'CONFIRM'),0) amount_tax,
(select decode(ccc.cf_item,
8,
'留购价',
to_char(ccc.times)) from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) times,
(select ccc.due_date from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) due_date,
(select case
when ccc.cf_item = 1 and cc.business_type = 'LEASEBACK' then
nvl(ccc.interest, 0) -
nvl((select sum(al.tax_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),
0)
when ccc.cf_item = 1 and cc.business_type != 'LEASEBACK' then
ccc.due_amount -
nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),
0)
else
ccc.due_amount -
nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),
0)
end
from con_contract cc, con_contract_cashflow ccc
where ccc.cashflow_id = l.cashflow_id
and ccc.contract_id = cc.contract_id) due_amount,
(select case
when ccc.cf_item = 1 and cc.business_type = 'LEASEBACK' then
0
when ccc.cf_item = 1 and cc.business_type != 'LEASEBACK' and
nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <=
${@base_period}
and ah.invoice_status = 'CONFIRM'),
0) > nvl(ccc.interest,0) then
ccc.due_amount-nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <=
${@base_period}
and ah.invoice_status = 'CONFIRM'),
0)
when ccc.cf_item = 1 and cc.business_type != 'LEASEBACK' and
nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <=
${@base_period}
and ah.invoice_status = 'CONFIRM'),
0) <=nvl(ccc.interest,0) then
nvl(ccc.principal, 0)
else
ccc.principal
end
from con_contract cc, con_contract_cashflow ccc
where ccc.cashflow_id = l.cashflow_id
and ccc.contract_id = cc.contract_id) principal,
(select case
when ccc.cf_item = 1 and cc.business_type = 'LEASEBACK' then
nvl(ccc.interest, 0) -
nvl((select sum(al.tax_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),
0)
when ccc.cf_item = 1 and cc.business_type != 'LEASEBACK' and
nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <=
${@base_period}
and ah.invoice_status = 'CONFIRM'),
0) >nvl(ccc.interest,0) then
0
when ccc.cf_item = 1 and cc.business_type != 'LEASEBACK' and
nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <=
${@base_period}
and ah.invoice_status = 'CONFIRM'),
0) <= nvl(ccc.interest,0) then
nvl(ccc.interest, 0)-nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <=
${@base_period}
and ah.invoice_status = 'CONFIRM'),
0)
else
ccc.due_amount
end
from con_contract cc, con_contract_cashflow ccc
where ccc.cashflow_id = l.cashflow_id
and ccc.contract_id = cc.contract_id) interest,
l.amount_cr-nvl((select sum(al.tax_amount) from acr_invoice_hd ah,acr_invoice_ln al where
ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and al.cashflow_id=l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),0) vat_due_amount,
(select
DECODE( ccc.cf_item,1,
decode(cc.business_type,'LEASEBACK',
round(ccc.vat_interest/ccc.net_interest,2),
round(ccc.vat_due_amount/ccc.net_due_amount,2)), round(ccc.vat_due_amount/ccc.net_due_amount,2))
from
con_contract cc,con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id
and cc.contract_id=ccc.contract_id) vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
and h.internal_period_num=to_number(${@base_period})
AND (h.je_transaction_code= 'HL_SALES_TAX_ACT_NEW')
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
round(l.amount_cr -
nvl((select sum(al.tax_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.contract_id = h.source_id
and ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.ref_n03 = l.journal_header_id
and al.ref_n04 = l.journal_line_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') < =${@base_period}
and ah.invoice_status = 'CONFIRM'),
0),2) amount_tax,
'违约金' times,
h.journal_date due_date,
(select d.amount_dr
from hls_journal_detail d
where d.journal_header_id = h.journal_header_id
and exists
(select 1
from gld_accounts g
where g.account_id = d.account_id
and g.account_code in ('1122000001', '1122000002'))
and rownum = 1) due_amount,
null principal,
(select d.amount_dr
from hls_journal_detail d
where d.journal_header_id = h.journal_header_id
and exists
(select 1
from gld_accounts g
where g.account_id = d.account_id
and g.account_code in ('1122000001', '1122000002'))
and rownum = 1) interest,
round(l.amount_cr -
nvl((select sum(al.tax_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.contract_id = h.source_id
and ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.ref_n03 = l.journal_header_id
and al.ref_n04 = l.journal_line_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') < =${@base_period}
and ah.invoice_status = 'CONFIRM'),
0),2) vat_due_amount,
(select DECODE(CC.BUSINESS_TYPE, 'LEASEBACK', 0.06, 0.13)
from con_contract cc
WHERE cc.contract_number = l.reference3
and cc.data_class = 'NORMAL') vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l, gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr != 0
and ga.account_id = l.account_id
and ga.account_code in ('2221001020', '2221001023')
and h.reversed_flag = 'N'
and h.internal_period_num = to_number(${@base_period})
And (h.je_transaction_code =
'HL_CSH_CONSOLIDATION_DALAY' or
(h.je_transaction_code =
'CON_REPURCHASE' and exists
(select 1
from gld_je_template_hds ga
where ga.je_template_hd_id =
h.je_template_hd_id
and ga.je_template_code =
'HL_GLD_BALANCE_REPURCHASE')))
and not exists (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
and hi.invoice_status = 'CONFIRM'
AND to_char(hi.invoice_date, 'yyyymm') < =${@base_period}
and li.ref_n03 = l.journal_header_id
and li.ref_n04 = l.journal_line_id)
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
l.amount_cr-nvl((select sum(al.tax_amount) from acr_invoice_hd ah,acr_invoice_ln al where
ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and al.cashflow_id=l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') < =${@base_period}
and ah.invoice_status = 'CONFIRM'),0) amount_tax,
(select decode(ccc.cf_item,
8,
'留购价',
to_char(ccc.times)) from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) times,
(select ccc.due_date from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) due_date,
(select
case when ccc.cf_item=200 then
ccc.due_amount-nvl((select sum(al.total_amount) from acr_invoice_hd ah,acr_invoice_ln al where
ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and al.cashflow_id=l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') < =${@base_period}
and ah.invoice_status = 'CONFIRM'),0)
else
ccc.due_amount
end
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) due_amount,
(select case when ccc.cf_item=200 then
ccc.due_amount-nvl((select sum(al.total_amount) from acr_invoice_hd ah,acr_invoice_ln al where
ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and al.cashflow_id=l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') < =${@base_period}
and ah.invoice_status = 'CONFIRM'),0)
else
0
end
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) principal,
(select decode(ccc.cf_item,'200',0,ccc.due_amount)
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) interest,
l.amount_cr-nvl((select sum(al.tax_amount) from acr_invoice_hd ah,acr_invoice_ln al where
ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and al.cashflow_id=l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),0) vat_due_amount,
(select
round(ccc.vat_due_amount/ccc.net_due_amount,2)
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
and h.internal_period_num=to_number(${@base_period})
And exists (selEct 1
from gld_je_template_hds hd
where hd.je_template_hd_id =
h.je_template_hd_id
and hd.je_template_code in
('HL_CON_TAX_ET',
'HL_CON_TAX_ET_N',
'HL_CON_FIN_ETFEE',
'HL_CON_FIN_ETFEE_N'))
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
l.amount_cr amount_tax,
(select decode(ccc.cf_item,
8,
'留购价',
'解约回购利息/'||to_char(ccc.times)) from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) times,
(select ccc.due_date from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) due_date,
(select decode(ccc.cf_item,
250,
ccc.interest,
ccc.due_amount)
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) due_amount,
null principal,
(select decode(ccc.cf_item,250,ccc.interest,ccc.due_amount)
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) interest,
l.amount_cr vat_due_amount,
(select
decode(ccc.cf_item,250,round(ccc.vat_interest/ccc.net_interest,2),
round(ccc.vat_due_amount/ccc.net_due_amount,2))
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
and h.internal_period_num=to_number(${@base_period})
AND not EXISTS (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
and hi.invoice_status='CONFIRM'
AND to_char(hi.invoice_date,'yyyymm') < =${@base_period}
and li.cashflow_id=l.cashflow_id )
And exists (selEct 1
from gld_je_template_hds hd
where hd.je_template_hd_id =
h.je_template_hd_id
and hd.je_template_code in
('HL_FIN_INCOME_REPURCHASE',
'HL_FIN_INCOME_REPURCHASE_N'))
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
nvl((select sum(ccc.vat_principal) FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and ccc.cf_item=250
and ccc.contract_id=cc.contract_id
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
and ccc.billing_status!='FULL'
),0) amount_tax,
'解约回购本金' times,
h.journal_date due_date,
nvl((select sum(ccc.principal) FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and ccc.contract_id=cc.contract_id
and ccc.cf_item=250
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
),0) due_amount,
nvl((select sum(ccc.principal) FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and ccc.contract_id=cc.contract_id
and ccc.cf_item=250
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
),0) principal,
null interest,
nvl((select sum(ccc.vat_principal) FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and ccc.cf_item=250
and ccc.contract_id=cc.contract_id
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
and ccc.billing_status!='FULL'
),0) vat_due_amount,
(select round(ccc.vat_principal/ccc.net_principal,2)
FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and ccc.cf_item=250
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
and ccc.billing_status='FULL'
and ccc.principal>0
and rownum=1
) vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and l.line_description like '%本金%'
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
and h.internal_period_num=to_number(${@base_period})
And exists (selEct 1
from gld_je_template_hds hd
where hd.je_template_hd_id =
h.je_template_hd_id
and hd.je_template_code in
('HL_CON_CHANGE_REPURCHASE_VAT'))
AND EXISTS (SELECT 1
FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and ccc.cf_item=250
and cc.contract_id=ccc.contract_id
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
and ccc.billing_status!='FULL' )
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
l.amount_cr amount_tax,
'留购金' times,
h.journal_date due_date,
to_number(l.reference7) due_amount,
null principal,
to_number(l.reference7) interest,
l.amount_cr vat_due_amount,
round( l.amount_cr/(l.reference7-l.amount_cr),2) vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and l.line_description like '%留购金%'
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
and h.internal_period_num=to_number(${@base_period})
And exists (selEct 1
from gld_je_template_hds hd
where hd.je_template_hd_id =
h.je_template_hd_id
and hd.je_template_code in
('HL_CON_CHANGE_REPURCHASE_VAT'))
AND EXISTS (SELECT 1
FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and cc.contract_id=ccc.contract_id
and ccc.cf_item=250
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
and ccc.billing_status!='FULL' )
) t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.amount_tax &lt;&gt;0"/>
<bm:data-filter enforceOperations="query" expression="exists(select 1 from con_contract cc where cc.contract_number=t1.contract_number and cc.data_class='NORMAL')"/>
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/>
<bm:query-field name="bp_name" queryExpression="t1.bp_name = ${@bp_name}"/>
<bm:query-field name="journal_date" queryExpression="to_char(t1.journal_date,'yyyy-mm-dd') = ${@journal_date}"/>
<bm:query-field name="invoice_date" queryExpression="to_char(t1.invoice_date,'yyyy-mm-dd') = ${@invoice_date}"/>
<bm:query-field name="vat_6_flag" queryExpression="((${@vat_6_flag}='Y' and t1.vat_rate=0.06) or (${@vat_6_flag}!='Y' and nvl(t1.vat_rate,0)!=0.06))"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: ZLF
$Date: 2015-1-21 下午3:09:38
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT * FROM (
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
decode(reference6, NULL, 0, NVL(round(l.amount_cr,2),0)) amount_tax,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
'违约金',
'HL_SALES_TAX_ACT_NEW',
(SELECT DECODE(cf_item,
2,
'首付款',
8,
'留购价',
1,
times,
200,
'提前结清款',
250,
'回购款',
0,
'设备款')
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id),
'CON_REPURCHASE',
'违约金') times,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
h.journal_date,
'HL_SALES_TAX_ACT_NEW',
(SELECT due_date
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id),
'CON_REPURCHASE',
h.journal_date) due_date,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
decode(reference6, NULL, l.amount_dr, 0),
'HL_SALES_TAX_ACT_NEW',
(SELECT due_amount
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id),
decode(reference6, NULL, l.amount_dr, 0),
'CON_REPURCHASE',
decode(reference6, NULL, l.amount_dr, 0)) due_amount,
(SELECT principal
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id) principal,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
decode(reference6, NULL, l.amount_dr, 0),
'HL_SALES_TAX_ACT_NEW',
(SELECT decode(cf_item, 8, due_amount, interest)
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id),
'CON_REPURCHASE',
decode(reference6, NULL, l.amount_dr, 0)
) interest,
DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
decode(reference6, NULL, 0, NVL(l.amount_cr,0)),
'HL_SALES_TAX_ACT_NEW',
(SELECT vat_due_amount
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id),
'CON_REPURCHASE',
decode(reference6, NULL, 0, NVL(l.amount_cr,0))) vat_due_amount,
nvl(ROUND((DECODE(h.je_transaction_code,
'HL_CSH_CONSOLIDATION_DALAY',
l.amount_cr/(l.reference7-l.amount_cr),
'HL_SALES_TAX_ACT_NEW',
(SELECT vat_due_amount/(due_amount-vat_due_amount)
FROM con_contract_cashflow
WHERE cashflow_id = l.cashflow_id),
l.amount_cr/(l.reference7-l.amount_cr),
'CON_REPURCHASE',
l.amount_cr/(l.reference7-l.amount_cr))),2) * 100,0)|| '%' vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
AND ((h.je_transaction_code IN
('HL_SALES_TAX_ACT_NEW', 'HL_CSH_CONSOLIDATION_DALAY')
)or(h.je_transaction_code = 'CON_REPURCHASE' and
instr(h.description, '调平') > 0))
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND not EXISTS (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date,'yyyymm') < ${@base_period}
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n04 = l.journal_line_id))
UNION
select vl.*
from ET_VAT_JOURNAL_LV vl
where not EXISTS
(SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date, 'yyyymm') < ${@base_period}
AND (li.cashflow_id = vl.cashflow_id))
UNION
select rl.*
from REPURSE_VAT_JOURNAL_LV rl
where not EXISTS
(SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date, 'yyyymm') < ${@base_period}
AND (li.cashflow_id = rl.cashflow_id))
UNION
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND hi.vat_interface_status = 'BACK'
AND li.cf_item = 2
and hi.contract_id = l.source_doc_id
AND ROWNUM = 1) invoice_date,
round(l.amount_dr,2) amount_tax,
'首付款' times,
(SELECT due_date
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1) due_date,
(SELECT due_amount
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1)
due_amount,
(SELECT due_amount
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1) principal,
(SELECT interest
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1) interest,
(SELECT vat_due_amount
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1) vat_due_amount,
NVL(ROUND(
(SELECT vat_due_amount/net_due_amount
FROM con_contract_cashflow
WHERE contract_id = l.source_doc_id
AND cf_item = 2
AND ROWNUM = 1),
2) * 100,
0) || '%' vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.reversed_flag='N'
AND h.je_transaction_code = 'LEASE_INCEPT'
AND l.je_template_ln_id = 8797
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND not EXISTS
(SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
AND to_char(hi.invoice_date,'yyyymm') < ${@base_period}
AND ((hi.contract_id = l.source_doc_id AND li.cf_item IN (2))))
) t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter enforceOperations="query"
expression="t1.journal_date &lt;= add_months(last_day(to_date(${@base_period},'yyyymm')),-1)"/>
<bm:data-filter enforceOperations="query" expression="t1.amount_tax > 0"/>
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/>
<bm:query-field name="bp_name" queryExpression="t1.bp_name = ${@bp_name}"/>
<bm:query-field name="journal_date" queryExpression="to_char(t1.journal_date,'yyyy-mm-dd') = ${@journal_date}"/>
<bm:query-field name="base_period"
queryExpression="to_number(to_char(t1.journal_date,'yyyymm')) &lt; to_number(${@base_period})"/>
<bm:query-field name="invoice_date" queryExpression="to_char(t1.invoice_date,'yyyy-mm-dd') = ${@invoice_date}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: ZLF
$Date: 2015-1-21 下午3:09:38
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT * FROM (
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
l.amount_cr-nvl((select sum(al.tax_amount) from acr_invoice_hd ah,acr_invoice_ln al where ah.contract_id=h.source_id
and ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and ah.invoice_status='CONFIRM'
and al.cf_item = 2
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),0) amount_tax,
'首付款' times,
(select ccc.due_date from con_contract_cashflow ccc where ccc.contract_id=h.source_id
and ccc.cf_item=2) due_date,
(select ccc.due_amount from con_contract_cashflow ccc where ccc.contract_id=h.source_id
and ccc.cf_item=2) due_amount,
(select ccc.due_amount from con_contract_cashflow ccc where ccc.contract_id=h.source_id
and ccc.cf_item=2) principal,
null interest,
l.amount_cr-nvl((select sum(al.tax_amount) from acr_invoice_hd ah,acr_invoice_ln al where ah.contract_id=h.source_id
and ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and ah.invoice_status='CONFIRM'
and al.cf_item = 2
AND to_char(ah.invoice_date,'yyyymm') < =${@base_period}
and ah.invoice_kind in ('0', '2')
AND ah.vat_interface_status = 'BACK'
and ah.invoice_status = 'CONFIRM'),0) vat_due_amount,
(select round(ccc.vat_due_amount/ccc.net_due_amount,2) from con_contract_cashflow ccc where ccc.contract_id=h.source_id
and ccc.cf_item=2) vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
and h.internal_period_num<to_number(${@base_period})
AND (h.je_transaction_code= 'LEASE_INCEPT')
and exists (select 1
from gld_je_template_hds hd
where hd.je_template_hd_id =
h.je_template_hd_id
and hd.je_template_code =
'HL_INCEPT_DOWN_PAYMENT_CF')
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND not EXISTS (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
and hi.invoice_status='CONFIRM'
AND to_char(hi.invoice_date,'yyyymm') < ${@base_period}
AND hi.contract_id=h.source_id
and li.cf_item=2 )
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
l.amount_cr-nvl((select sum(al.tax_amount) from acr_invoice_hd ah,acr_invoice_ln al where
ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and al.cashflow_id=l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),0) amount_tax,
(select decode(ccc.cf_item,
8,
'留购价',
to_char(ccc.times)) from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) times,
(select ccc.due_date from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) due_date,
(select case
when ccc.cf_item = 1 and cc.business_type = 'LEASEBACK' then
nvl(ccc.interest, 0) -
nvl((select sum(al.tax_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),
0)
when ccc.cf_item = 1 and cc.business_type != 'LEASEBACK' then
ccc.due_amount -
nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),
0)
else
ccc.due_amount -
nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),
0)
end
from con_contract cc, con_contract_cashflow ccc
where ccc.cashflow_id = l.cashflow_id
and ccc.contract_id = cc.contract_id) due_amount,
(select case
when ccc.cf_item = 1 and cc.business_type = 'LEASEBACK' then
0
when ccc.cf_item = 1 and cc.business_type != 'LEASEBACK' and
nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <=
${@base_period}
and ah.invoice_status = 'CONFIRM'),
0) > nvl(ccc.interest,0) then
ccc.due_amount-nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <=
${@base_period}
and ah.invoice_status = 'CONFIRM'),
0)
when ccc.cf_item = 1 and cc.business_type != 'LEASEBACK' and
nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <=
${@base_period}
and ah.invoice_status = 'CONFIRM'),
0) <=nvl(ccc.interest,0) then
nvl(ccc.principal, 0)
else
ccc.principal
end
from con_contract cc, con_contract_cashflow ccc
where ccc.cashflow_id = l.cashflow_id
and ccc.contract_id = cc.contract_id) principal,
(select case
when ccc.cf_item = 1 and cc.business_type = 'LEASEBACK' then
nvl(ccc.interest, 0) -
nvl((select sum(al.tax_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),
0)
when ccc.cf_item = 1 and cc.business_type != 'LEASEBACK' and
nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <=
${@base_period}
and ah.invoice_status = 'CONFIRM'),
0) >nvl(ccc.interest,0) then
0
when ccc.cf_item = 1 and cc.business_type != 'LEASEBACK' and
nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <=
${@base_period}
and ah.invoice_status = 'CONFIRM'),
0) <= nvl(ccc.interest,0) then
nvl(ccc.interest, 0)-nvl((select sum(al.total_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.cashflow_id = l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <=
${@base_period}
and ah.invoice_status = 'CONFIRM'),
0)
else
ccc.due_amount
end
from con_contract cc, con_contract_cashflow ccc
where ccc.cashflow_id = l.cashflow_id
and ccc.contract_id = cc.contract_id) interest,
l.amount_cr-nvl((select sum(al.tax_amount) from acr_invoice_hd ah,acr_invoice_ln al where
ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and al.cashflow_id=l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') < =${@base_period}
and ah.invoice_status = 'CONFIRM'),0) vat_due_amount,
(select
DECODE( ccc.cf_item,1,
decode(cc.business_type,'LEASEBACK',
round(ccc.vat_interest/ccc.net_interest,2),
round(ccc.vat_due_amount/ccc.net_due_amount,2)), round(ccc.vat_due_amount/ccc.net_due_amount,2))
from
con_contract cc,con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id
and cc.contract_id=ccc.contract_id) vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
and h.internal_period_num<to_number(${@base_period})
AND (h.je_transaction_code= 'HL_SALES_TAX_ACT_NEW')
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND ( not EXISTS (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
and hi.invoice_status='CONFIRM'
AND to_char(hi.invoice_date,'yyyymm') < ${@base_period}
and li.cashflow_id=l.cashflow_id )
or
--日立返还金额外判断
exists( SELECT 1
FROM con_contract_cashflow ccc
WHERE
ccc.cashflow_id=l.cashflow_id
and ccc.cf_item=1
and acr_invoice_pkg.check_rl_flag(ccc.contract_id) = 'Y' and
acr_invoice_pkg.get_rl_amount(ccc.contract_id,
1,
ccc.times) > 0
))
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
round(l.amount_cr -
nvl((select sum(al.tax_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.contract_id = h.source_id
and ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.ref_n03 = l.journal_header_id
and al.ref_n04 = l.journal_line_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),
0),2) amount_tax,
'违约金' times,
h.journal_date due_date,
(select d.amount_dr
from hls_journal_detail d
where d.journal_header_id = h.journal_header_id
and exists
(select 1
from gld_accounts g
where g.account_id = d.account_id
and g.account_code in ('1122000001', '1122000002'))
and rownum = 1) due_amount,
null principal,
(select d.amount_dr
from hls_journal_detail d
where d.journal_header_id = h.journal_header_id
and exists
(select 1
from gld_accounts g
where g.account_id = d.account_id
and g.account_code in ('1122000001', '1122000002'))
and rownum = 1) interest,
round(l.amount_cr -
nvl((select sum(al.tax_amount)
from acr_invoice_hd ah, acr_invoice_ln al
where ah.contract_id = h.source_id
and ah.invoice_hd_id = al.invoice_hd_id
and ah.reversed_flag = 'N'
and al.ref_n03 = l.journal_header_id
and al.ref_n04 = l.journal_line_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date, 'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),
0),2) vat_due_amount,
(select DECODE(CC.BUSINESS_TYPE, 'LEASEBACK', 0.06, 0.13)
from con_contract cc
WHERE cc.contract_number = l.reference3
and cc.data_class = 'NORMAL') vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l, gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr != 0
and ga.account_id = l.account_id
and ga.account_code in ('2221001020', '2221001023')
and h.reversed_flag = 'N'
and h.internal_period_num < to_number(${@base_period})
And (h.je_transaction_code =
'HL_CSH_CONSOLIDATION_DALAY' or
(h.je_transaction_code =
'CON_REPURCHASE' and exists
(select 1
from gld_je_template_hds ga
where ga.je_template_hd_id =
h.je_template_hd_id
and ga.je_template_code =
'HL_GLD_BALANCE_REPURCHASE')))
and ((trunc(h.journal_date) <=
trunc(to_date('2020-01-31', 'yyyy-mm-dd')) and
h.description = 'MANUAL_IMPORT') or
(trunc(h.journal_date) > trunc(to_date('2020-01-31', 'yyyy-mm-dd'))))
AND not EXISTS
(SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
and hi.invoice_status = 'CONFIRM'
AND to_char(hi.invoice_date, 'yyyymm') < ${@base_period}
and li.ref_n03 = l.journal_header_id
and li.ref_n04 = l.journal_line_id)
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
l.amount_cr-nvl((select sum(al.tax_amount) from acr_invoice_hd ah,acr_invoice_ln al where
ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and al.cashflow_id=l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') < =${@base_period}
and ah.invoice_status = 'CONFIRM'),0) amount_tax,
(select decode(ccc.cf_item,
8,
'留购价',
to_char(ccc.times)) from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) times,
(select ccc.due_date from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) due_date,
(select
case when ccc.cf_item=200 then
ccc.due_amount-nvl((select sum(al.total_amount) from acr_invoice_hd ah,acr_invoice_ln al where
ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and al.cashflow_id=l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') < =${@base_period}
and ah.invoice_status = 'CONFIRM'),0)
else
ccc.due_amount
end
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) due_amount,
(select case when ccc.cf_item=200 then
ccc.due_amount-nvl((select sum(al.total_amount) from acr_invoice_hd ah,acr_invoice_ln al where
ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and al.cashflow_id=l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') < =${@base_period}
and ah.invoice_status = 'CONFIRM'),0)
else
0
end
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) principal,
(select decode(ccc.cf_item,'200',0,ccc.due_amount)
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) interest,
l.amount_cr-nvl((select sum(al.tax_amount) from acr_invoice_hd ah,acr_invoice_ln al where
ah.invoice_hd_id=al.invoice_hd_id
and ah.reversed_flag='N'
and al.cashflow_id=l.cashflow_id
and ah.invoice_kind in ('0', '2')
AND to_char(ah.invoice_date,'yyyymm') <= ${@base_period}
and ah.invoice_status = 'CONFIRM'),0) vat_due_amount,
(select
round(ccc.vat_due_amount/ccc.net_due_amount,2)
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
and h.internal_period_num<to_number(${@base_period})
And exists (selEct 1
from gld_je_template_hds hd
where hd.je_template_hd_id =
h.je_template_hd_id
and hd.je_template_code in
('HL_CON_TAX_ET',
'HL_CON_TAX_ET_N',
'HL_CON_FIN_ETFEE',
'HL_CON_FIN_ETFEE_N'))
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND ( not EXISTS (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
and hi.invoice_status='CONFIRM'
AND to_char(hi.invoice_date,'yyyymm') < ${@base_period}
and li.cashflow_id=l.cashflow_id )
or
--日立返还金额外判断
exists( SELECT 1
FROM con_contract_cashflow ccc
WHERE
ccc.cashflow_id=l.cashflow_id
and ccc.cf_item=200
and acr_invoice_pkg.check_rl_flag(ccc.contract_id) = 'Y' and
acr_invoice_pkg.get_rl_amount(ccc.contract_id,
200,
ccc.times) > 0
))
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
l.amount_cr amount_tax,
(select decode(ccc.cf_item,
8,
'留购价',
'解约回购利息/'||to_char(ccc.times)) from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) times,
(select ccc.due_date from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) due_date,
(select decode(ccc.cf_item,
250,
ccc.interest,
ccc.due_amount)
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) due_amount,
null principal,
(select decode(ccc.cf_item,250,ccc.interest,ccc.due_amount)
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) interest,
l.amount_cr vat_due_amount,
(select
decode(ccc.cf_item,250,round(ccc.vat_interest/ccc.net_interest,2),
round(ccc.vat_due_amount/ccc.net_due_amount,2))
from con_contract_cashflow ccc where ccc.cashflow_id=l.cashflow_id) vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
and h.internal_period_num<to_number(${@base_period})
And exists (selEct 1
from gld_je_template_hds hd
where hd.je_template_hd_id =
h.je_template_hd_id
and hd.je_template_code in
('HL_FIN_INCOME_REPURCHASE',
'HL_FIN_INCOME_REPURCHASE_N'))
and( (trunc(h.journal_date)<=trunc(to_date('2020-01-31','yyyy-mm-dd')) and h.description='MANUAL_IMPORT')or(trunc(h.journal_date)>trunc(to_date('2020-01-31','yyyy-mm-dd'))))
AND not EXISTS (SELECT 1
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.vat_interface_status = 'BACK'
and hi.invoice_status='CONFIRM'
AND to_char(hi.invoice_date,'yyyymm') < ${@base_period}
and li.cashflow_id=l.cashflow_id )
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
nvl((select sum(ccc.vat_principal) FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and ccc.cf_item=250
and ccc.contract_id=cc.contract_id
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
and ccc.billing_status!='FULL'
),0) amount_tax,
'解约回购本金' times,
h.journal_date due_date,
nvl((select sum(ccc.principal) FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and ccc.contract_id=cc.contract_id
and ccc.cf_item=250
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
),0) due_amount,
nvl((select sum(ccc.principal) FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and ccc.contract_id=cc.contract_id
and ccc.cf_item=250
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
),0) principal,
null interest,
nvl((select sum(ccc.vat_principal) FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and ccc.cf_item=250
and ccc.contract_id=cc.contract_id
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
and ccc.billing_status!='FULL'
),0) vat_due_amount,
(select round(ccc.vat_principal/ccc.net_principal,2)
FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and ccc.cf_item=250
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
and ccc.billing_status='FULL'
and ccc.principal>0
and rownum=1
) vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and l.line_description like '%本金%'
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
and h.internal_period_num<to_number(${@base_period})
And exists (selEct 1
from gld_je_template_hds hd
where hd.je_template_hd_id =
h.je_template_hd_id
and hd.je_template_code in
('HL_CON_CHANGE_REPURCHASE_VAT'))
AND EXISTS (SELECT 1
FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and ccc.cf_item=250
and cc.contract_id=ccc.contract_id
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
and ccc.billing_status!='FULL' )
union
SELECT h.period_year,
h.period_num,
h.internal_period_num,
h.journal_date,
h.sbo_num journal_num,
reference3 contract_number,
reference1 bp_code,
(SELECT BP_NAME
FROM hls_bp_master
WHERE bp_code = reference1
AND ROWNUM = 1) bp_name,
l.journal_header_id,
(SELECT hi.invoice_date
FROM acr_invoice_hd hi, acr_invoice_ln li
WHERE hi.invoice_hd_id = li.invoice_hd_id
AND hi.reversed_flag = 'N'
AND (li.cashflow_id = l.cashflow_id OR
li.ref_n03 = l.journal_header_id)
AND ROWNUM = 1) invoice_date,
l.amount_cr amount_tax,
'留购金' times,
h.journal_date due_date,
to_number(l.reference7) due_amount,
null principal,
to_number(l.reference7) interest,
l.amount_cr vat_due_amount,
round( l.amount_cr/(l.reference7-l.amount_cr),2) vat_rate,
h.je_transaction_code,
l.cashflow_id
FROM hls_journal_header h, hls_journal_detail l,gld_accounts ga
WHERE h.journal_header_id = l.journal_header_id
and h.sbo_num is not null
and h.total_amount_dr!=0
and ga.account_id=l.account_id
and l.line_description like '%留购金%'
and ga.account_code in('2221001020','2221001023')
and h.reversed_flag='N'
and h.internal_period_num<to_number(${@base_period})
And exists (selEct 1
from gld_je_template_hds hd
where hd.je_template_hd_id =
h.je_template_hd_id
and hd.je_template_code in
('HL_CON_CHANGE_REPURCHASE_VAT'))
AND EXISTS (SELECT 1
FROM con_contract cc,con_contract_cashflow ccc
where cc.contract_number=l.reference3
and cc.data_class='NORMAL'
and cc.contract_id=ccc.contract_id
and ccc.cf_item=250
and ccc.cf_status='RELEASE'
and ccc.cf_direction='INFLOW'
and ccc.billing_status!='FULL' )
) t1
#WHERE_CLAUSE#
]]></bm:query-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter enforceOperations="query" expression="t1.amount_tax > 0"/>
<bm:data-filter enforceOperations="query" expression="exists(select 1 from con_contract cc where cc.contract_number=t1.contract_number and cc.data_class='NORMAL')"/>
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/>
<bm:query-field name="bp_name" queryExpression="t1.bp_name = ${@bp_name}"/>
<bm:query-field name="journal_date" queryExpression="to_char(t1.journal_date,'yyyy-mm-dd') = ${@journal_date}"/>
<bm:query-field name="base_period"
queryExpression="to_number(to_char(t1.journal_date,'yyyymm')) &lt; to_number(${@base_period})"/>
<bm:query-field name="invoice_date" queryExpression="to_char(t1.invoice_date,'yyyy-mm-dd') = ${@invoice_date}"/>
<bm:query-field name="vat_6_flag" queryExpression="((${@vat_6_flag}='Y' and t1.vat_rate=0.06) or (${@vat_6_flag}!='Y' and nvl(t1.vat_rate,0)!=0.06))"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: ZLF
$Date: 2015-1-21 下午3:09:38
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (
SELECT t.contract_id,
t.invoice_hd_id,
t.invoice_line_id,
(SELECT v.code_value_name
FROM sys_code_values_v v
WHERE v.code = 'ACR510_INVOICE_KIND'
AND v.code_value = t.invoice_kind)invoice_kind_n,
t.cashflow_id,
t.tax_apply_month invoice_month,
t.invoice_date,
t.invoice_number,
t.invoice_tax_amount total_amount,
t.apply_flag for_invoice_flag,
t.tenant_name bp_name,
t.contract_number,
t.acr_tax_amount return_tax_amount,
t.journal_tax_amount amount_cr,
t.journal_month je_month,
t.journal_date je_date,
t.journal_num,
t.times,
t.due_date,
t.due_amount,
t.principal,
t.interest,
t.tax_amount vat_due_amount,
t.created_by,
t.creation_date,
t.last_updated_by,
t.last_update_date
FROM vat_account_tmp t
WHERE t.session_id=${/session/@session_id}
) t1
#WHERE_CLAUSE#
order by invoice_hd_id,due_date ASC,invoice_number asc
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
acr_invoice_pkg.vat_account_data_process(p_base_period => ${@base_period},
p_session_id => ${/session/@session_id},
p_user_id => ${/session/@user_id} );
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<!-- <bm:data-filter enforceOperations="query" expression="to_char(t1.invoice_date,'yyyymm') = ${@base_period}"/>-->
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/>
<bm:query-field name="bp_name" queryExpression="t1.bp_name = ${@bp_name}"/>
<!-- <bm:query-field name="journal_date" queryExpression="to_char(t1.journal_date,'yyyy-mm-dd') = ${@journal_date}"/>-->
<bm:query-field name="invoice_date" queryExpression="to_char(t1.invoice_date,'yyyy-mm-dd') = ${@invoice_date}"/>
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: ZLF
$Date: 2015-1-21 下午3:09:38
$Revision: 1.0
$Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
select * from (
SELECT t.contract_id,
t.invoice_hd_id,
t.invoice_line_id,
(SELECT v.code_value_name
FROM sys_code_values_v v
WHERE v.code = 'ACR510_INVOICE_KIND'
AND v.code_value = t.invoice_kind)invoice_kind_n,
t.cashflow_id,
t.tax_apply_month invoice_month,
t.invoice_date,
t.invoice_number,
t.invoice_tax_amount total_amount,
t.apply_flag for_invoice_flag,
t.tenant_name bp_name,
t.contract_number,
t.acr_tax_amount return_tax_amount,
t.journal_tax_amount amount_cr,
t.journal_month je_month,
t.journal_date je_date,
t.journal_num,
t.times,
t.due_date,
t.due_amount,
t.principal,
t.interest,
t.tax_amount vat_due_amount,
t.created_by,
t.creation_date,
t.last_updated_by,
t.last_update_date,
t.tax_type_rate
FROM vat_account_tmp t
WHERE t.session_id=${/session/@session_id}
) t1
#WHERE_CLAUSE#
--order by invoice_hd_id,due_date ASC,invoice_line_id asc
order by invoice_hd_id, invoice_number asc, due_date ASC
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
BEGIN
hl_cm_vat_report_pkg.vat_account_data_process(p_base_period => ${@base_period},
p_session_id => ${/session/@session_id},
p_user_id => ${/session/@user_id} );
END;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<!-- <bm:data-filter enforceOperations="query" expression="to_char(t1.invoice_date,'yyyymm') = ${@base_period}"/>-->
</bm:data-filters>
<bm:query-fields>
<bm:query-field name="contract_number" queryExpression="t1.contract_number = ${@contract_number}"/>
<bm:query-field name="bp_name" queryExpression="t1.bp_name = ${@bp_name}"/>
<!-- <bm:query-field name="journal_date" queryExpression="to_char(t1.journal_date,'yyyy-mm-dd') = ${@journal_date}"/>-->
<bm:query-field name="invoice_date" queryExpression="to_char(t1.invoice_date,'yyyy-mm-dd') = ${@invoice_date}"/>
<bm:query-field name="invoice_kind" queryExpression="t1.invoice_kind = ${@invoice_kind}"/>
<bm:query-field name="vat_6_flag" queryExpression="((${@vat_6_flag}='Y' and t1.tax_type_rate=0.06) or(${@vat_6_flag}!='Y' and t1.tax_type_rate!=0.06))"/>
</bm:query-fields>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
<bm:fields>
<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID"
required="true"/>
<bm:field name="calc_session_id" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="CALC_SESSION_ID"/>
<bm:field name="data_class" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DATA_CLASS"
required="true"/>
<bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="CONTRACT_NUMBER"/>
<bm:field name="contract_name" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="CONTRACT_NAME"/>
<bm:field name="business_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BUSINESS_TYPE"
required="true"/>
<bm:field name="document_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DOCUMENT_TYPE"
required="true"/>
<bm:field name="document_category" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="DOCUMENT_CATEGORY" required="true"/>
<bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID"/>
<bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID"
required="true"/>
<bm:field name="spv_company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SPV_COMPANY_ID"/>
<bm:field name="lease_organization" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="LEASE_ORGANIZATION" required="true"/>
<bm:field name="lease_channel" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LEASE_CHANNEL"
required="true"/>
<bm:field name="division" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DIVISION"
required="true"/>
<bm:field name="bp_id_tenant" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BP_ID_TENANT"/>
<bm:field name="bp_id_agent_level1" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="BP_ID_AGENT_LEVEL1"/>
<bm:field name="bp_id_agent_level2" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="BP_ID_AGENT_LEVEL2"/>
<bm:field name="bp_id_agent_level3" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="BP_ID_AGENT_LEVEL3"/>
<bm:field name="owner_user_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OWNER_USER_ID"/>
<bm:field name="employee_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EMPLOYEE_ID"/>
<bm:field name="unit_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="UNIT_ID"/>
<bm:field name="employee_id_of_manager" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="EMPLOYEE_ID_OF_MANAGER"/>
<bm:field name="search_term_1" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="SEARCH_TERM_1"/>
<bm:field name="search_term_2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SEARCH_TERM_2"/>
<bm:field name="factoring_type" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="FACTORING_TYPE"/>
<bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DESCRIPTION"/>
<bm:field name="price_list" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PRICE_LIST"/>
<bm:field name="calc_method" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CALC_METHOD"/>
<bm:field name="calc_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CALC_TYPE"/>
<bm:field name="cdd_list_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CDD_LIST_ID"/>
<bm:field name="inception_of_lease" databaseType="DATE" datatype="java.util.Date"
physicalName="INCEPTION_OF_LEASE"/>
<bm:field name="lease_start_date" databaseType="DATE" datatype="java.util.Date"
physicalName="LEASE_START_DATE"/>
<bm:field name="first_pay_date" databaseType="DATE" datatype="java.util.Date" physicalName="FIRST_PAY_DATE"/>
<bm:field name="last_pay_date" databaseType="DATE" datatype="java.util.Date" physicalName="LAST_PAY_DATE"/>
<bm:field name="lease_end_date" databaseType="DATE" datatype="java.util.Date" physicalName="LEASE_END_DATE"/>
<bm:field name="lease_times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_TIMES"/>
<bm:field name="pay_times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PAY_TIMES"/>
<bm:field name="annual_pay_times" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="ANNUAL_PAY_TIMES"/>
<bm:field name="lease_term" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_TERM"/>
<bm:field name="pay_type" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PAY_TYPE"/>
<bm:field name="currency" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY"/>
<bm:field name="currency_precision" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="CURRENCY_PRECISION"/>
<bm:field name="machinery_amount" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="MACHINERY_AMOUNT"/>
<bm:field name="parts_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PARTS_AMOUNT"/>
<bm:field name="lease_item_amount" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="LEASE_ITEM_AMOUNT"/>
<bm:field name="net_lease_item_amount" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NET_LEASE_ITEM_AMOUNT"/>
<bm:field name="vat_input" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_INPUT"/>
<bm:field name="lease_item_cost" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="LEASE_ITEM_COST"/>
<bm:field name="main_business_income" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="MAIN_BUSINESS_INCOME"/>
<bm:field name="main_business_cost" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="MAIN_BUSINESS_COST"/>
<bm:field name="financing_cost" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FINANCING_COST"/>
<bm:field name="calc_prompt" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CALC_PROMPT"/>
<bm:field name="calc_prompt_msg" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="CALC_PROMPT_MSG"/>
<bm:field name="lease_item_price_agent" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="LEASE_ITEM_PRICE_AGENT"/>
<bm:field name="down_payment_ratio" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="DOWN_PAYMENT_RATIO"/>
<bm:field name="down_payment" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DOWN_PAYMENT"/>
<bm:field name="net_down_payment" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NET_DOWN_PAYMENT"/>
<bm:field name="vat_down_payment" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_DOWN_PAYMENT"/>
<bm:field name="finance_amount" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FINANCE_AMOUNT"/>
<bm:field name="net_finance_amount" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NET_FINANCE_AMOUNT"/>
<bm:field name="vat_finance_amount" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_FINANCE_AMOUNT"/>
<bm:field name="actual_finance_amount" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="ACTUAL_FINANCE_AMOUNT"/>
<bm:field name="total_rental" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TOTAL_RENTAL"/>
<bm:field name="net_total_rental" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NET_TOTAL_RENTAL"/>
<bm:field name="vat_total_rental" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_TOTAL_RENTAL"/>
<bm:field name="total_interest" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TOTAL_INTEREST"/>
<bm:field name="net_total_interest" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NET_TOTAL_INTEREST"/>
<bm:field name="vat_total_interest" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_TOTAL_INTEREST"/>
<bm:field name="total_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TOTAL_FEE"/>
<bm:field name="net_total_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NET_TOTAL_FEE"/>
<bm:field name="vat_total_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_TOTAL_FEE"/>
<bm:field name="finance_income" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FINANCE_INCOME"/>
<bm:field name="net_finance_income" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NET_FINANCE_INCOME"/>
<bm:field name="vat_finance_income" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_FINANCE_INCOME"/>
<bm:field name="contract_amount" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="CONTRACT_AMOUNT"/>
<bm:field name="tax_type_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TAX_TYPE_ID"/>
<bm:field name="vat_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="VAT_FLAG"/>
<bm:field name="vat_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_RATE"/>
<bm:field name="vat_rate_of_interest" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_RATE_OF_INTEREST"/>
<bm:field name="vat_rate_of_fee" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_RATE_OF_FEE"/>
<bm:field name="vat_rate_reserved1" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_RATE_RESERVED1"/>
<bm:field name="lease_charge_ratio" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="LEASE_CHARGE_RATIO"/>
<bm:field name="lease_charge" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_CHARGE"/>
<bm:field name="net_lease_charge" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NET_LEASE_CHARGE"/>
<bm:field name="vat_lease_charge" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_LEASE_CHARGE"/>
<bm:field name="lease_mgt_fee_ratio" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="LEASE_MGT_FEE_RATIO"/>
<bm:field name="lease_mgt_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LEASE_MGT_FEE"/>
<bm:field name="net_lease_mgt_fee" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NET_LEASE_MGT_FEE"/>
<bm:field name="vat_lease_mgt_fee" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_LEASE_MGT_FEE"/>
<bm:field name="lease_mgt_fee_rule" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="LEASE_MGT_FEE_RULE"/>
<bm:field name="deposit_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DEPOSIT_RATIO"/>
<bm:field name="deposit" databaseType="NUMBER" datatype="java.lang.Long" physicalName="DEPOSIT"/>
<bm:field name="deposit_deduction" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="DEPOSIT_DEDUCTION"/>
<bm:field name="residual_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RESIDUAL_RATIO"/>
<bm:field name="residual_value" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RESIDUAL_VALUE"/>
<bm:field name="net_residual_value" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NET_RESIDUAL_VALUE"/>
<bm:field name="vat_residual_value" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_RESIDUAL_VALUE"/>
<bm:field name="balloon_ratio" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BALLOON_RATIO"/>
<bm:field name="balloon" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BALLOON"/>
<bm:field name="net_balloon" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NET_BALLOON"/>
<bm:field name="vat_balloon" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_BALLOON"/>
<bm:field name="interim_rent_period" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="INTERIM_RENT_PERIOD"/>
<bm:field name="interim_times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INTERIM_TIMES"/>
<bm:field name="interim_rental" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INTERIM_RENTAL"/>
<bm:field name="net_interim_rental" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NET_INTERIM_RENTAL"/>
<bm:field name="vat_interim_rental" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_INTERIM_RENTAL"/>
<bm:field name="insurance_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSURANCE_RATE"/>
<bm:field name="insurance_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INSURANCE_FEE"/>
<bm:field name="net_insurance_fee" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NET_INSURANCE_FEE"/>
<bm:field name="vat_insurance_fee" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_INSURANCE_FEE"/>
<bm:field name="insurance_fee_payable" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="INSURANCE_FEE_PAYABLE"/>
<bm:field name="notarial_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NOTARIAL_FEE"/>
<bm:field name="net_notarial_fee" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NET_NOTARIAL_FEE"/>
<bm:field name="vat_notarial_fee" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_NOTARIAL_FEE"/>
<bm:field name="notarial_fee_payable" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NOTARIAL_FEE_PAYABLE"/>
<bm:field name="commission_receivable" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="COMMISSION_RECEIVABLE"/>
<bm:field name="net_commission_receivable" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="NET_COMMISSION_RECEIVABLE"/>
<bm:field name="vat_commission_receivable" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="VAT_COMMISSION_RECEIVABLE"/>
<bm:field name="commission_payable" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="COMMISSION_PAYABLE"/>
<bm:field name="third_party_deposit" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="THIRD_PARTY_DEPOSIT"/>
<bm:field name="promise_to_pay" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROMISE_TO_PAY"/>
<bm:field name="other_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OTHER_FEE"/>
<bm:field name="net_other_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NET_OTHER_FEE"/>
<bm:field name="vat_other_fee" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_OTHER_FEE"/>
<bm:field name="other_fee2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OTHER_FEE2"/>
<bm:field name="net_other_fee2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NET_OTHER_FEE2"/>
<bm:field name="vat_other_fee2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_OTHER_FEE2"/>
<bm:field name="other_fee3" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OTHER_FEE3"/>
<bm:field name="net_other_fee3" databaseType="NUMBER" datatype="java.lang.Long" physicalName="NET_OTHER_FEE3"/>
<bm:field name="vat_other_fee3" databaseType="NUMBER" datatype="java.lang.Long" physicalName="VAT_OTHER_FEE3"/>
<bm:field name="other_payment" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OTHER_PAYMENT"/>
<bm:field name="other_payment2" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OTHER_PAYMENT2"/>
<bm:field name="other_payment3" databaseType="NUMBER" datatype="java.lang.Long" physicalName="OTHER_PAYMENT3"/>
<bm:field name="rounding_object" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="ROUNDING_OBJECT"/>
<bm:field name="rounding_method" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="ROUNDING_METHOD"/>
<bm:field name="int_rate_fixing_way" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="INT_RATE_FIXING_WAY"/>
<bm:field name="int_rate_fixing_range" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="INT_RATE_FIXING_RANGE"/>
<bm:field name="int_rate_display" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="INT_RATE_DISPLAY"/>
<bm:field name="base_rate_type" databaseType="VARCHAR2" datatype="java.lang.String"
physicalName="BASE_RATE_TYPE"/>
<bm:field name="base_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BASE_RATE"/>
<bm:field name="int_rate" databaseType="NUMBER" datatype="java.lang.Long" physicalName="INT_RATE"/>
<bm:field name="int_rate_implicit" databaseType="NUMBER" datatype="java.lang.Long"
physicalName="INT_RATE_IMPLICIT"/>
</bm:fields>
<bm:operations>
<bm:operation name="query">
<bm:query-sql><![CDATA[
SELECT *
FROM con_contract t
WHERE t.contract_id IN
(Select cc.contract_id
From con_contract_cashflow cc
Where TRUNC(Sysdate) - TRUNC(cc.due_date) = 5
and cc.write_off_flag != 'FULL'
And cc.cf_item = 1
And cc.overdue_status = 'Y'
and cc.cf_direction = 'INFLOW'
AND CC.cf_status = 'RELEASE'
union
select cc.contract_id
from CON_CONTRACT_CASHFLOW cc
where TRUNC(cc.due_date) - TRUNC(Sysdate) = 5
and cc.write_off_flag != 'FULL'
And cc.cf_item = 1
And cc.overdue_status = 'N'
and cc.cf_direction = 'INFLOW'
AND CC.cf_status = 'RELEASE')
AND t.contract_status = 'INCEPT'
AND t.data_class = 'NORMAL'
and t.send_message = 'YES'
and t.phone_status != 'APPROVING'
]]></bm:query-sql>
</bm:operation>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
hls_payment_msm_send_pkg.sys_collection_t5_sms_loop(p_user_id =>${/session/@user_id}, p_batch_id =>${@batch_id});
end;
]]></bm:update-sql>
<bm:parameters>
<bm:parameter name="batch_id" dataType="java.lang.Long" input="true" output="true"
outputPath="/parameter/@batch_id"/>
</bm:parameters>
</bm:operation>
</bm:operations>
</bm:model>
<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="SYS_SMS_LIST">
<bm:fields>
<bm:field name="sms_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SMS_ID" prompt="SYS_SMS_LIST.SMS_ID"/>
<bm:field name="sms_date" databaseType="DATE" datatype="java.util.Date" physicalName="SMS_DATE" prompt="SYS_SMS_LIST.SMS_DATE"/>
<bm:field name="priority" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PRIORITY" prompt="SYS_SMS_LIST.PRIORITY"/>
<bm:field name="phone_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PHONE_NUMBER" prompt="SYS_SMS_LIST.PHONE_NUMBER"/>
<bm:field name="text" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TEXT" prompt="SYS_SMS_LIST.TEXT"/>
<bm:field name="error_status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ERROR_STATUS" prompt="SYS_SMS_LIST.ERROR_STATUS"/>
<bm:field name="error_msg" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ERROR_MSG" prompt="SYS_SMS_LIST.ERROR_MSG"/>
<bm:field name="status" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="STATUS" prompt="SYS_SMS_LIST.STATUS"/>
<bm:field name="project_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID" prompt="SYS_SMS_LIST.PROJECT_ID"/>
<bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_NUMBER" prompt="SYS_SMS_LIST.CONTRACT_NUMBER"/>
<bm:field name="bp_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="BP_NAME" prompt="SYS_SMS_LIST.BP_NAME"/>
<bm:field name="sms_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="SMS_TYPE" prompt="SYS_SMS_LIST.SMS_TYPE"/>
<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="SYS_SMS_LIST.CONTRACT_ID"/>
<bm:field name="batch_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BATCH_ID" prompt="SYS_SMS_LIST.BATCH_ID"/>
</bm:fields>
<bm:features>
<f:standard-who/>
</bm:features>
<bm:primary-key>
<bm:pk-field name="sms_id"/>
</bm:primary-key>
<bm:operations>
<bm:operation name="update">
<bm:update-sql><![CDATA[
begin
hls_payment_msm_send_pkg.after_sys_sms_send_loop(p_sms_id =>${@sms_id},
p_send_result =>${@result},
p_user_id =>${/session/@user_id});
end;
]]></bm:update-sql>
</bm:operation>
</bm:operations>
<bm:data-filters>
<bm:data-filter name="query" enforceOperations="query" expression="t1.status = &apos;NEW&apos; and t1.batch_id=${@batch_id}"/>
</bm:data-filters>
</bm:model>
......@@ -24,10 +24,13 @@
(select hm.id_card_no_leg
from hls_bp_master hm
where hm.bp_id = t1.bp_id_agent_level1) id_card_no_agent,
(SELECT i.machine_number
decode(t1.division,70,(SELECT i.machine_number_70
FROM con_contract_lease_item i
WHERE i.contract_id = t1.contract_id
AND i.equipment_type = 'MAIN'),(SELECT i.machine_number
FROM con_contract_lease_item i
WHERE i.contract_id = t1.contract_id
AND i.equipment_type = 'MAIN') machine_number, --机号
AND i.equipment_type = 'MAIN')) machine_number, --机号
t1.contract_status,
(select v.code_value_name
from sys_code_values_v v
......
......@@ -36,22 +36,27 @@ select *
from con_contract_lease_item ci
where ci.contract_id = t1.contract_id
and ci.equipment_type = 'MAIN') brand_id,
NVL((SELECT a.description
decode(t1.division,70,(select a.brand_value --update by xsh35973 20220323
from CON_CONTRACT_LEASE_ITEM a
where a.contract_id = t1.contract_id),NVL((SELECT a.description
FROM hls_car_brands_vl a
WHERE a.brand_id =
(select ci.brand_id
from con_contract_lease_item ci
where ci.contract_id = t1.contract_id
and ci.equipment_type = 'MAIN')),
'日立') brand_id_n,
'日立')) brand_id_n,
(select ci.modelcd
from con_contract_lease_item ci
where ci.contract_id = t1.contract_id
and ci.equipment_type = 'MAIN') modelcd, --机型
(SELECT i.machine_number
decode(t1.division,70,(SELECT i.machine_number_70 --update by xsh35973 20220323
FROM con_contract_lease_item i
WHERE i.contract_id = t1.contract_id
AND i.equipment_type = 'MAIN') machine_number, --机号
AND i.equipment_type = 'MAIN'),(SELECT i.machine_number
FROM con_contract_lease_item i
WHERE i.contract_id = t1.contract_id
AND i.equipment_type = 'MAIN')) machine_number, --机号
t1.lease_times, --期数
t1.lease_start_date, --起租日
(NVL(t1.down_payment, 0) + NVL(t1.residual_value, 0) +
......
......@@ -44,7 +44,21 @@ select fa.file_name,fa.file_path,fa.attachment_id
'S_LEASE_SURE_BUS_OEC','GUARANTEE_LETTER_OEC',
'S_LEASE_ORDER_OEC','ITEM_TRAN_NOTICE',
'S_LEASE_PAY_REQ_OEC','PAYMENT_REQ',
'S_LEASE_MOR_OEC','MORT_CONTRACT')
'S_LEASE_MOR_OEC','MORT_CONTRACT',
'FINANCE_LEASE_CONTRACT_TJ_S_E', --update by xsh35973 铁甲电子签约
'FINANCE_LEASE_CONTRACT_TJ_S_E',
'FINANCE_LEASE_CONTRACT_TJ_E',
'FINANCE_LEASE_CONTRACT_TJ_E',
'CON_COLLECTION_PAYMENT_TJ_E',
'CON_COLLECTION_PAYMENT_TJ_E',
'CON_CONTRACT_MORTGAGE_TJ_E',
'CON_CONTRACT_MORTGAGE_TJ_E',
'PERSONAL_CREDIT',
'PERSONAL_CREDIT',
'FINANCE_LEASE_CONTRACT_TJ_FR_E',
'FINANCE_LEASE_CONTRACT_TJ_FR_E',
'CON_GUR_NP',
'CON_GUR_NP')
from con_ele_signer_file cf, con_contract_ele_signer cs
where cf.con_ele_signer_id = cs.con_ele_signer_id
and cs.contract_id = ${@contract_id}
......
var override_queryfields = [
{
name: 'contract_number',
queryexpression: "t1.contract_number = ${@contract_number}"
},
{
name: 'bp_name',
queryexpression: "t1.bp_name = ${@bp_name}"
},
{
name: 'journal_date',
queryexpression: "to_char(t1.journal_date,'yyyy-mm-dd') = ${@journal_date}"
},
{
name: 'base_period',
queryexpression: "to_char(t1.journal_date,'yyyymm') < ${@base_period}"
}
];
var add_datafilters = [{
name: 'base_period',
expression: "t1.journal_date <= add_months(last_day(to_date(${@base_period},'yyyymm')),-1) and (t1.invoice_date is null or t1.invoice_date >= TRUNC(to_date(${@base_period},'yyyymm'),'dd'))"
}];
override();
add_datafilter();
\ No newline at end of file
var override_queryfields = [
{
name: 'contract_number',
queryexpression: "t1.contract_number = ${@contract_number}"
},
{
name: 'bp_name',
queryexpression: "t1.bp_name = ${@bp_name}"
},
{
name: 'journal_date',
queryexpression: "to_char(t1.journal_date,'yyyy-mm-dd') = ${@journal_date}"
},
{
name: 'base_period',
queryexpression: "to_char(t1.journal_date,'yyyymm') = ${@base_period}"
}
];
var add_datafilters = [{
name: 'base_period',
expression: " to_char(t1.journal_date,'yyyymm') = ${@base_period} and (t1.invoice_date is null or to_char(t1.invoice_date,'yyyymm') < ${@base_period})"
}];
override();
add_datafilter();
\ No newline at end of file
var override_queryfields = [
{
name: 'invoice_kind',
queryexpression: "t1.invoice_kind = ${@invoice_kind}"
},
{
name: 'contract_number',
queryexpression: "t1.contract_number = ${@contract_number}"
},
{
name: 'bp_name',
queryexpression: "t1.bp_name = ${@bp_name}"
},
{
name: 'journal_date',
queryexpression: "to_char(t1.je_date,'yyyy-mm-dd') = ${@journal_date}"
},
{
name: 'invoice_date',
queryexpression: "to_char(t1.invoice_date,'yyyy-mm-dd') = ${@invoice_date}"
},
{
name: 'base_period',
queryexpression: "to_char(t1.je_date,'yyyymm') <= ${@base_period}"
}
];
var add_datafilters = [{
name: 'base_period',
expression: "to_char(t1.invoice_date,'yyyymm') = ${@base_period}"
}];
override();
add_datafilter();
\ No newline at end of file
remove_query_field('CONTRACT_ID');
remove_datafilter('contract_id');
var add_datafilters=[
{
name:'bp_id',
expression:'(t1.bp_id = ${@bp_id})'
}
];
add_datafilter();
\ No newline at end of file
var override_queryfields = [
{
name : 'approval_date_from',
queryexpression : "trunc(t1.approval_date) >= to_date(${@approval_date_from},'yyyy-mm-dd')"
},
{
name : 'approval_date_to',
queryexpression : "trunc(t1.approval_date) <= to_date(${@approval_date_to},'yyyy-mm-dd')"
}
];
override();
var override_queryfields = [
{
name : 'creationdate_from',
queryexpression : "trunc(t1.creationdate) >= to_date(${@creationdate_from},'yyyy-mm-dd')"
},
{
name : 'creationdate_to',
queryexpression : "trunc(t1.creationdate) <= to_date(${@creationdate_to},'yyyy-mm-dd')"
}
];
var add_datafilters = [
{
name : 'init_filter',
expression : "t1.status in ('NEW','ERROR','FINISHED','SEND_MID','CONFIRM1_ERROR','CONFIRM2_FULL_ERROR')"
}
];
add_datafilter();
override();
var override_queryfields = [
{
name : 'send_date',
queryexpression : "trunc(t1.send_date) = to_date(${@send_date},'yyyy-mm-dd')"
},
{
name : 'hsbc_status',
queryexpression : "t1.status = ${@hsbc_status}"
}
];
var add_datafilters = [
{
name : 'init_filter',
expression : "t1.status in ('BANK_RECEIVED','BANK_HALF_BACKED','BANK_BACKED','FINISHED','CONFIRM1','CONFIRM1_ERROR','CONFIRM2','CONFIRM2_FULL_ERROR','CONFIRM2_PART_ERROR','SENDING','SEND_MID','CLOSED')"
}
];
add_datafilter();
override();
var override_queryfields = [
{
name : 'rptdate',
queryexpression : "trunc(t1.rptdate) >= to_date(${@rptdate},'yyyy-mm-dd')"
}
];
override();
......@@ -321,5 +321,10 @@ var enableLayoutConfig = {
'modules/rent/rent200/con_collection_income.lview':true,
'modules/cont/CON316/contract_cost_query_entrance.lview':true,
'modules/lon/LON140/loan_fee_create_entrance.lview':true,
'modules/form/FORM_LON120H/loan_contract_query.lview':true
'modules/form/FORM_LON120H/loan_contract_query.lview':true,
'modules/hsbc/HSBC100/hsbc_paying_batch_create.lview':true,
'modules/hsbc/HSBC110/hsbc_paying_batch_modify.lview':true,
'modules/hsbc/HSBC110/hsbc_paying_batch_detail.lview':true,
'modules/hsbc/HSBC120/hsbc_paying_batch_query.lview':true,
'modules/hsbc/HSBC130/pingan_account_hisbalance_query.lview':true
};
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app">
<session-descriptor>
<cookie-name>JSESSIONID1</cookie-name>
<persistent-store-type>replicated_if_clustered</persistent-store-type>
</session-descriptor>
<container-descriptor>
<!--<prefer-web-inf-classes>true</prefer-web-inf-classes>-->
<prefer-application-packages>
<package-name>oracle.*</package-name>
</prefer-application-packages>
<show-archived-real-path-enabled>true</show-archived-real-path-enabled>
</container-descriptor>
<virtual-directory-mapping>
<local-path>/u01</local-path>
<url-pattern>/hls_file/*</url-pattern>
</virtual-directory-mapping>
</weblogic-web-app>
\ No newline at end of file
......@@ -359,7 +359,7 @@
<a:datas dataSource="/model/acr515_currency_list"/>
</a:dataSet>
<a:dataSet id="acr515_invoiceVatParaDs" autoCreate="true" model="acr.acr_invoice_hd_v">
<a:dataSet id="acr515_invoiceVatParaDs" autoCreate="true" model="acr.ACR515.acr515_invoice_hd_v">
<a:fields>
<a:field name="currency_desc" displayField="currency_name" options="acr515_currencyDs"
returnField="currency" valueField="currency_code"/>
......@@ -443,7 +443,7 @@
<a:event name="update" handler="onUpdate_acr515_invoiceVatParaDs"/>
</a:events>
</a:dataSet>
<a:dataSet id="acr515_invoiceVatDs" autoPageSize="true" maxPageSize="10000" model="acr.acr_invoice_hd_v"
<a:dataSet id="acr515_invoiceVatDs" autoPageSize="true" maxPageSize="10000" model="acr.ACR515.acr515_invoice_hd_v"
queryDataSet="acr515_invoiceVatParaDs" selectable="true">
<a:fields><![CDATA[
]]></a:fields>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -30,12 +30,19 @@
url="${/request/@context_path}/downloadFile.lview"/>
<a:link id="con731_hls_bp_master_query_link"
url="${/request/@context_path}/modules/cont/CON505/hls_bp_master_query.lview"/>
<a:link id="${/parameter/@layout_code}hls_bp_master_query_link"
url="${/request/@context_path}/modules/hls/HLS215N/hls_bp_master_query.lview"/>
<a:link id="${/parameter/@layout_code}_con_contract_get_layout_code_link_id"
model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="con_buyback_info_print_link_id"
url="${/request/@context_path}/modules/csh/CSH501/csh_con_req_history_pdf_print.lsc"/>
<a:link id="con_check_deduction_limit_link" model="check_after_save_bm.con_check_deduction_limit_after_save"
modelaction="update"/>
<a:link id="${/parameter/@layout_code}contract_number_query_link"
url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
<a:link id="${/parameter/@layout_code}_tenant_rate_query_link"
url="${/request/@context_path}/modules/prj/PRJ902/prj_project_score_result.lview"/>
<a:link id="${/parameter/@layout_code}get_bp_tenant_rate_detail_link" model="cont.CON731.get_bp_tenant_rate_detail" modelaction="query"></a:link>
<script type="text/javascript"><![CDATA[
Ext.ux.Lightbox.register('a[ref=img]', true);
Leaf.onReady(function () {
......@@ -130,11 +137,61 @@
};
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function (ds, record, name, value, old_value, bp_seq) {
var ds_con_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_QUOTATION_01', 'con_contract');
if (ds.id == ds_con_id) {
// 承租人变更
if ('${/parameter/@layout_code}' == 'CON_TENANT_CHANGE_MODIFY') {
if(name=='bp_id_tenant'){
//让历史信息查询
var history_con_id=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'T_HISTORY_INGO', 'hls_bp_master');
$(history_con_id).setQueryParameter('bp_id', value);
$(history_con_id).query();
var tennat_score_ds_id=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
var tenant_score_record=$(tennat_score_ds_id).getAt(0);
if(tenant_score_record){
debugger;
Leaf.request({
url: $('${/parameter/@layout_code}get_bp_tenant_rate_detail_link').getUrl(),
para: {
bp_id: value
},
success: function (data) {
if (data.result.record && !data.result.record.length) {
//评分信息
for (var name in tenant_score_record.data) {
if (name != 'bp_detail_id' && name != 'project_id'&& name != 'contract_id') {
if(data.result.record[name]){
tenant_score_record.set(name, data.result.record[name]);
}else{
tenant_score_record.set(name, '');
}
}
}
}else{
//未找到则置空
for (var name in tenant_score_record.data) {
if (name != 'bp_detail_id' && name != 'project_id'&& name != 'contract_id') {
tenant_score_record.set(name, '');
}
}
}
},
failure: function () {
},
error: function () {
},
scope: this
});
}
}
// 承租人变更日計算未收金額相關信息
if (name == 'ccr_lease_date' && value) {
Leaf.request({
......@@ -307,6 +364,21 @@
}
}
}
if('${/parameter/@layout_code}' == 'CON_TENANT_CHANGE_MODIFY'){
var tennat_score_ds_id1=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if(ds.id==tennat_score_ds_id1){
if(name=='third_guar_score'&&!Ext.isEmpty(value)){
if(value<0||value>10){
setTimeout(function () {
record.set('third_guar_score', '');
}, 0);
Leaf.showInfoMessage("提示", "第三方担保附件分数范围为0-10,请重新输入!");
}
}
}
}
};
//新增和加载时调用form
......@@ -347,6 +419,15 @@
document.getElementById('${/parameter/@layout_code}_F_QUOTATION_01_CON_CONTRACT_DEDUCTION_LIMIT_S').style.display = 'none';
}
}
var tennat_score_ds_id=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if(tennat_score_ds_id){
var division=record.get('division');
if(division!='70'){
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE').style.display = 'none';
}
}
}
if ('${/parameter/@function_code}' == 'CON_REPO001D_WQ') {
if (!record.get('rec_residue_amount')) {
......@@ -354,6 +435,19 @@
record.set('rec_residue_amount', rec_residue_amount);
}
}
var tennat_score_ds_id1=get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if(ds.id==tennat_score_ds_id1&&tennat_score_ds_id1){
var con_record=$(ds_id).getCurrentRecord();
if(con_record){
var division=con_record.get('division');
if(division!='70'){
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE').style.display = 'none';
}
}
}
};
window['${/parameter/@layout_code}_submit_approval_layout_dynamic_click'] = function () {
......@@ -495,6 +589,40 @@
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
};
window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function () {
var ds_con_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_QUOTATION_01', 'con_contract');
var record = $(ds_con_id).getCurrentRecord();
if (record) {
var param = record.data;
if (record.get('contract_id')) {
param['project_id'] = record.get('contract_id');
param['winid'] = 'hl_tenant_score_rate_win_id';
param['url_title'] = '客户评分明细';
var score_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
var r = $(score_ds_id).getCurrentRecord();
if (r.dirty && '${/parameter/@function_usage}' == 'MODIFY') {
Leaf.showInfoMessage('提示', '评分数据发生修改,请先保存再进行评分');
return;
}
if ($(ds_con_id).validate()) {
var win = new Leaf.Window({
id: param['winid'],
params: param,
url: $('${/parameter/@layout_code}_tenant_rate_query_link').getUrl(),
title: param['url_title'],
fullScreen: true,
draggable: true
});
}
} else {
Leaf.showMessage('${l:PROMPT}', '请先保存');
}
}
}
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function () {
// $('${/parameter/@layout_code}_user_button1').disable();
......@@ -550,13 +678,50 @@
}
}
function con731n_bp_code_renderer(id, name, query_only) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = {};
param['bp_id'] = record.get('bp_id');
param['bp_class'] = record.get('bp_class');
if (record.get('bp_category') == 'AGENT') {
param['function_code'] = 'HLS303_Q';
param['function_usage'] = 'QUERY';
} else {
param['function_code'] = 'HLS215D';
param['function_usage'] = 'QUERY';
}
param['winid'] = '${/parameter/@layout_code}_bp_win_id';
param['url_title'] = '${l:HLS212.BP_MASTER_MAINTAIN}';
hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}hls_bp_master_query_link', record.ds.id, '${/parameter/@layout_code}');
}
function con731n_contract_number_renderer(id, name, query_only) {
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = {};
param['contract_id'] = record.get('contract_id');
param['function_code'] = 'CON301';
param['function_usage'] = 'QUERY';
param['winid'] = '${/parameter/@layout_code}_project_number_win_id';
param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}contract_number_query_link', record.ds.id, '${/parameter/@layout_code}');
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function (value, record, name, config_record) {
var link_function = '';
window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
if (name == 'bp_link' && record.get('bp_id') && record.get('record_id')) {
link_function = '${/parameter/@layout_code}_open_bp_detail_window';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\');">' + config_record.get('prompt') + '</a>';
} else if (name == 'attachment') {
} else if (name == 'bp_link1' && !record.isNew) {
link_function = 'con731n_bp_code_renderer';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
} else if (name == 'contract_number') {
link_function = 'con731n_contract_number_renderer';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + value + '</a>';
}else if (name == 'attachment') {
link_function = 'con_repo001_upload_file';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
} else if (name == 'attach_file_name') {
......@@ -600,7 +765,6 @@
};
window['${/parameter/@layout_code}_open_bp_detail_window'] = function (id, name) {
debugger;
var record = window['${/parameter/@layout_code}_hls_link_render_record'][id + '---' + name];
var param = {};//record.data;
param['bp_id'] = record.get('bp_id');
......@@ -626,12 +790,19 @@
};
//加载时调用(grid,table,gridBox)
/*window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, record, config_records, bp_seq) {
if(record.get('bp_category') == 'TENANT' || record.get('bp_category') == 'AGENT'){
record.getField('bp_id').setReadOnly(true);
record.getField('bp_id_n').setReadOnly(true);
var query_count = 1;
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_load'] = function(ds, record, config_records, bp_seq) {
if ('${/parameter/@layout_code}' == 'CON_TENANT_CHANGE_MODIFY'){
var project_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_QUOTATION_01', 'con_contract');
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
if(ds.id==ds_id&& ds_id && query_count == 1) {
query_count = query_count + 1;
var bp_id = $(project_ds_id).getAt(0).get('bp_id_tenant');
$(ds_id).setQueryParameter('bp_id', bp_id);
$(ds_id).query();
}
};*/
}
};
//选择事件(grid,attach,gridbox,table)
/*window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_grid_before_select'] = function(ds, record, bp_seq) {
if((record.get('bp_category') == 'TENANT' || record.get('bp_category') == 'AGENT') && record.isSelected){
......@@ -642,7 +813,6 @@
};*/
//add by lihh 20210330审批记录打印
window['${/parameter/@layout_code}_user_button4_layout_dynamic_click'] = function () {
debugger;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
var records = $(ds_id).getCurrentRecord();
var document_id = records.get('contract_id');
......@@ -664,7 +834,6 @@
};
//保存前调用
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_before_submit'] = function (ds, record) {
debugger;
var check_flag = true;
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract');
......@@ -714,6 +883,40 @@
}
}
}
if('${/parameter/@layout_code}' == 'CON_TENANT_CHANGE_MODIFY'){
var score_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
var bp_tenant_detail_r = $(score_ds_id).getCurrentRecord();
if (bp_tenant_detail_r && ds.id == ds_id) {
var con_record=$(ds_id).getCurrentRecord();
var division=con_record.get('divison');
for (var key in bp_tenant_detail_r.data) {
if(division!='70'){
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age' && key != 'project_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n'&& key != 'third_guar_score'&&key != 'tj_score') {
//if (!bp_tenant_detail_r.get(key)) {
if (typeof bp_tenant_detail_r.get(key) == "null" || typeof bp_tenant_detail_r.get(key) == "undefined" || bp_tenant_detail_r.get(key) === "") {
Leaf.showInfoMessage("提示", "承租人评分信息区域的所有字段,除\"第三方担保附件得分\"外,其他都为必输字段,请填写!");
check_flag = false;
break;
} else {
check_flag = true;
}
}
}else{
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age' && key != 'project_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n'&& key != 'third_guar_score') {
//if (!bp_tenant_detail_r.get(key)) {
if (typeof bp_tenant_detail_r.get(key) == "null" || typeof bp_tenant_detail_r.get(key) == "undefined" || bp_tenant_detail_r.get(key) === "") {
Leaf.showInfoMessage("提示", "承租人评分信息区域的所有字段,除\"第三方担保附件得分\"外,其他都为必输字段,请填写!");
check_flag = false;
break;
} else {
check_flag = true;
}
}
}
}
}
}
return check_flag;
};
......
......@@ -48,6 +48,8 @@
}
//对是否为同一个厂商进行检查
var vender_name = record.get('vender_name_n');
//对铁甲和非铁甲的校验
var division = record.get('division');
var vender_flag = true;
var leaseback_count = 0, lease_count = 0;
......@@ -59,6 +61,11 @@
$L.showErrorMessage("提示", '请选择厂商相同的现金流信息!');
return;
}
//对铁甲和非铁甲的校验 add 18943
if (a[i].get('division') != division) {
$L.showErrorMessage("提示", '铁甲业务合同和非铁甲业务合同不可同一批次申请,请确认!');
return;
}
//暂时去掉
// if(a[i].get('billing_status_n')!='已开票' ||a[i].get('invoice_status_n')!='已确认'){
// $L.showErrorMessage("提示",'请选择开票状态为已开票,发票状态为已确认的现金流!');
......@@ -336,6 +343,7 @@
selectable="true">
<a:field name="cf_item"/>
<a:field name="first_contract_day"/>
<a:field name="division"/>
<a:events>
<a:event name="query" handler="aut_authority_list_validate_query"/>
</a:events>
......
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:view>
<a:link id="hsbc_paying_batch_create_link_id" url="${/request/@context_path}/modules/hsbc/HSBC100/hsbc_paying_batch_create.lsc"/>
<script><![CDATA[
function create_paying_batch() {
Leaf.Masker.mask(Ext.getBody(), '付款单生成中...');
var account_ds = $('csh_bank_account');
var bank_account_id = account_ds.getAt(0).get('bank_account_id');
if (Ext.isEmpty(bank_account_id)) {
Leaf.showMessage('提示', '请先选择账户代码!');
Leaf.Masker.unmask(Ext.getBody());
} else {
var req_ln_ds = $('${/parameter/@ds_id}');
var button_id = '${/parameter/@button_id}';
var records = req_ln_ds.getSelected();
var param = {};
var saveData = [];
for (var i = 0;i < records.length;i++) {
var rec;
rec = records[i];
rec.set('_status', 'insert');
saveData.push(rec.data);
}
param['details'] = saveData;
param['bank_account_id'] = bank_account_id;
param['button_id'] = button_id;
Leaf.request({
url: $('hsbc_paying_batch_create_link_id').getUrl(),
para: param,
success: function() {
Leaf.SideBar.show({
msg: '付款单生成成功!',
duration: 2000
});
Leaf.Masker.unmask(Ext.getBody());
$('${/parameter/@winId}').close();
req_ln_ds.query();
},
failure: function() {
Leaf.Masker.unmask(Ext.getBody());
},
error: function() {
Leaf.Masker.unmask(Ext.getBody());
},
scope: this
});
}
}
]]></script>
<a:dataSets>
<a:dataSet id="csh_bank_account" autoCreate="true">
<a:fields>
<a:field name="bank_account_id" readOnly="true"/>
<a:field name="bank_account_code" lovGridHeight="300" lovHeight="450" lovService="hsbc.HSBC100.csh_bank_account" lovWidth="800" required="true" title="支付账号选择">
<a:mapping>
<a:map from="bank_account_id" to="bank_account_id"/>
<a:map from="bank_account_code" to="bank_account_code"/>
<a:map from="bank_short_name" to="bank_short_name"/>
<a:map from="bank_branch_name" to="bank_branch_name"/>
<a:map from="bank_account_name" to="bank_account_name"/>
<a:map from="bank_account_num" to="bank_account_num"/>
</a:mapping>
</a:field>
<a:field name="bank_short_name" readOnly="true"/>
<a:field name="bank_branch_name" readOnly="true"/>
<a:field name="bank_account_name" readOnly="true"/>
<a:field name="bank_account_num" readOnly="true"/>
</a:fields>
</a:dataSet>
</a:dataSets>
<a:screenBody>
<a:screenTopToolbar>
<a:gridButton click="create_paying_batch" text="付款单生成"/>
</a:screenTopToolbar>
<a:form column="2" title=" ">
<a:lov name="bank_account_code" bindTarget="csh_bank_account" prompt="账户代码"/>
<a:textField name="bank_short_name" bindTarget="csh_bank_account" prompt="银行简称"/>
<a:textField name="bank_branch_name" bindTarget="csh_bank_account" prompt="分行名称"/>
<a:textField name="bank_account_name" bindTarget="csh_bank_account" prompt="账户名"/>
<a:textField name="bank_account_num" bindTarget="csh_bank_account" prompt="银行账号"/>
</a:form>
</a:screenBody>
</a:view>
</a:screen>
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
<a:init-procedure>
<a:model-delete model="hsbc.HSBC100.hsbc_paying_batch_create"/>
<batch-apply sourcePath="/parameter/details">
<a:model-insert model="hsbc.HSBC100.hsbc_paying_batch_create"/>
</batch-apply>
<a:model-update model="hsbc.HSBC100.hsbc_paying_batch_create"/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: Hongquan.Dai 代宏全
$Date: 2018-1-22 上午10:36:25
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true">
<a:init-procedure/>
<a:view>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="pageLink_choose_acount" url="${/request/@context_path}/modules/hsbc/HSBC100/csh_bank_account_choose.lview"/>
<script type="text/javascript"><![CDATA[
//创建代付单
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var req_ln_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var req_ln_ds = $(req_ln_ds_id);
var req_ln_records = req_ln_ds.getSelected();
new Leaf.Window({
id: 'choose_acount_window',
url: $('pageLink_choose_acount').getUrl(),
params: {
winId: 'choose_acount_window',
ds_id: req_ln_ds_id,
button_id: 'create_with_sbo'
},
title: '支付账号选择',
height: 260,
width: 680
});
};
//创建强制付款单生成
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
var req_ln_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_ln');
var req_ln_ds = $(req_ln_ds_id);
var req_ln_records = req_ln_ds.getSelected();
new Leaf.Window({
id: 'choose_acount_window',
url: $('pageLink_choose_acount').getUrl(),
params: {
winId: 'choose_acount_window',
ds_id: req_ln_ds_id,
button_id: 'create_without_sbo'
},
title: '支付账号选择',
height: 260,
width: 680
});
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: Hongquan.Dai 代宏全
$Date: 2018-1-22 上午10:36:25
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true">
<a:init-procedure/>
<a:view>
<a:link id="prj_project_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="prj_project_query_link" url="${/request/@context_path}/modules/prj/PRJ501DF/prj_project_maintain.screen"/>
<a:link id="${/parameter/@layout_code}_df_csh_payment_apply_link" url="${/request/@context_path}/modules/csh/CSH770/df_csh_payment_apply_wfl.screen"/>
<script><![CDATA[
function open_project_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = {};
param['project_id'] = record.get('contract_id');
param['lease_channel'] = '01';
param['bp_class'] = 'ORG';
param['function_code'] = 'PRJ501D_DDF';
param['function_usage'] = 'QUERY';
param['maintain_type'] = 'QUERY';
param['winid'] = 'prj_porject_query_win_id';
param['url_title'] = '${l:HLS.PROJECT_MAITAIN_DF}';
hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, 'prj_project_query_link', ds_id,'${/parameter/@layout_code}');
}
window['${/parameter/@layout_code}_payment_req_number_win'] = function(payment_req_id,ds_id) {
var param = {};
param['document_id'] = payment_req_id;
param['payment_req_id'] = payment_req_id;
param['function_code'] = 'CSH770';
param['maintain_type'] = 'QUERY';
param['url_title'] = '付款明细';
param['winid'] = 'payment_req_number_link';
hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, '${/parameter/@layout_code}_df_csh_payment_apply_link', ds_id,'${/parameter/@layout_code}');
};
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
if (name == 'contract_number' && value && '${/parameter/@lease_channel}' == '01') {
return '<a href="javascript:open_project_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
}
if (name == 'payment_req_number' && value && '${/parameter/@lease_channel}' == '01') {
link_function = '${/parameter/@layout_code}_payment_req_number_win';
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.get('payment_req_id') + '\',\'' + record.ds.id + '\',\'' + '\');">' + value + '</a>';
}
if (name == 'payment_req_number' && value && '${/parameter/@lease_channel}' == '01') {
return value;
}
return value;
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
<script><![CDATA[/*
Aurora.onReady(init);
function init() {
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hl_hsbc_paying_batch');
if(ds_id){
$(ds_id).setQueryParameter('bank_item', '${/parameter/@bank_item}');
$(ds_id).query();
}
var doc_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hl_hsbc_paying_doc');
if(doc_ds_id){
$(doc_ds_id).setQueryParameter('bank_item', '${/parameter/@bank_item}');
$(doc_ds_id).query();
}
}*/
]]></script>
</a:view>
</a:screen>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: Hongquan.Dai 代宏全
$Date: 2018-1-22 上午10:36:25
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true">
<a:init-procedure>
<a:model-query model="hsbc.HSBC110.get_limited_user" rootPath="limited_user_path"/>
</a:init-procedure>
<a:view>
<a:link id="${/parameter/@layout_code}_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="batch_hsbc_send_link" url="${/request/@context_path}/modules/hsbc/HSBC110/hsbc_paying_batch_send.lsc"/>
<a:link id="batch_detail_link" url="${/request/@context_path}/modules/hsbc/HSBC110/hsbc_paying_batch_detail.lview"/>
<a:link id="manual_modify_link" model="hsbc.HSBC110.hsbc_paying_manual_modify" modelaction="execute"/>
<a:link id="batch_cancel_link" model="hsbc.HSBC110.hsbc_paying_batch_cancel" modelaction="delete"/>
<script type="text/javascript"><![CDATA[
function open_batch_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_code'] = 'HSBC110D';
param['maintain_type'] = 'QUERY';
param['url_title'] = '付款单明细';
hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'batch_detail_link', ds_id);
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
if (name == 'reqsn' && value) {
return '<a href="javascript:open_batch_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
}
return value;
};
//代付单发送
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_RESULT', 'hl_hsbc_paying_batch');
var batch_ds = $(ds_id);
var records = batch_ds.getSelected();
if (records.length == 0) {
Leaf.showMessage('${l:PROMPT}', '请选择至少一条数据!');
return;
}
var param = {};
var saveData = [];
var length = 0;
var send_url;
var bank_note='汇丰银行';
for (var i = 0;i < records.length;i++) {
var rec;
rec = records[i];
rec.set('_status', 'insert');
saveData.push(rec.data);
}
length = records.length;
param['details'] = saveData;
send_url=$('batch_hsbc_send_link').getUrl();
Leaf.showConfirm('${l:HLS.PROMPT}', '共选中<font color="red">' + length + '</font>条付款单,确认发送到<font color="red">'+bank_note+'</font>?', function() {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: send_url,
para: param,
success: function(res) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
batch_ds.query();
},
failure: function(res) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
batch_ds.query();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
batch_ds.query();
},
scope: this
});
});
};
//人工支付 --add by 24976
window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_RESULT', 'hl_hsbc_paying_batch');
var batch_ds = $(ds_id);
var records = batch_ds.getSelected();
var lease_channel;
var reqsn;
var batch_id;
var bank_item;
if (records.length != 1) {
Leaf.showMessage('${l:PROMPT}', '请选择一条数据!');
return;
}
var win = new Leaf.showConfirm('${l:HLS.PROMPT}', '使用人工支付将不能再使用银企直连,确认进行人工支付?', function() {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('manual_modify_link').getUrl(),
para: {
batch_id : records[0].get('batch_id'),
reqsn : records[0].get('reqsn'),
bank_item : records[0].get('bank_item')
},
success: function(res) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
batch_ds.query();
},
failure: function(res) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
});
};
//付款单取消
window['${/parameter/@layout_code}_user_button3_layout_dynamic_click'] = function() {
var ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_RESULT', 'hl_hsbc_paying_batch');
var batch_ds = $(ds_id);
var records = batch_ds.getSelected();
if (records.length != 1 ) {
Leaf.showMessage('${l:PROMPT}', '请选择一条数据!');
return;
}
Leaf.showConfirm('${l:HLS.PROMPT}', '确认取消?', function() {
window['${/parameter/@layout_code}_lock_layout_dynamic_window']();
Leaf.request({
url: $('batch_cancel_link').getUrl(),
para: {
batch_id : records[0].get('batch_id'),
reqsn : records[0].get('reqsn'),
bank_item : records[0].get('bank_item')
},
success: function(res) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
batch_ds.query();
},
failure: function(res) {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
error: function() {
window['${/parameter/@layout_code}_unlock_layout_dynamic_window']();
},
scope: this
});
});
};
Leaf.onReady(function() {
if ('${/model/limited_user_path/record/@flag}'=='N') {
$('${/parameter/@layout_code}_user_button1').hide();
$('${/parameter/@layout_code}_user_button2').hide();
$('${/parameter/@layout_code}_user_button3').hide();
}
});
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<a:model-delete model="hsbc.HSBC110.hsbc_batch_temp"/>
<batch-apply sourcePath="/parameter/details">
<a:model-insert model="hsbc.HSBC110.hsbc_batch_temp"/>
</batch-apply>
<s:server-script><![CDATA[
function main() {
$bm('sch.SCH111.sch_concurrent_job_submit').insert({
task_code:'HSBC_BATCH_SEND',
description:'汇丰银行批量发送job'
});
}
main();
]]></s:server-script>
<p:echo/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: wangwei5743
$Date: 2017-8-17 上午10:38:31
$Revision: 1.0
$Purpose: 农行代扣接口生成txt
-->
<a:service xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
importPackage(Packages.java.lang);
importPackage(Packages.java.io);
importPackage(java.util.zip);
importPackage(java.io); /*可以传入参数*/
importPackage(Packages.com.hand.hsbc);
var UPLOAD_FILEDIR = AuthTypeMode.getProperties("UPLOAD_FILEDIR");
var date=new Date();
var year=date.getFullYear();
var month=date.getMonth()+1;
UPLOAD_FILEDIR = UPLOAD_FILEDIR+"\\"+year+"\\"+month+"\\";
var tranfer_dir= new File(String(UPLOAD_FILEDIR));
if(!tranfer_dir.exists()){
//如果文件夹不存在,创建年月文件夹
tranfer_dir.mkdirs();//创建文件夹
}
function batch_send(reqsn) {
var fileName = reqsn;
//生成文件路径,文件
var FilePath='';
var FilePath = UPLOAD_FILEDIR + fileName + '.XML';
//-----------------------------写文件----------------------------
try {
var outSTr = new FileOutputStream(new File(FilePath));
var Buff = new BufferedOutputStream(outSTr);
} catch (e) {
raise_app_error(e.message);
}
//汇丰代扣信息
var xml_content='';
var xml_content_bm = $bm('hsbc.HSBC110.hsbc_get_xml_content');
var xml_content_query = xml_content_bm.queryAsMap({
reqsn: reqsn
});
var xml_content_lists = xml_content_query.getChildren();
xml_content=xml_content_lists[0].xml_content;
if(!xml_content){
raise_app_error('文件生成错误,请检查!');
}
try {
var write = new java.lang.String(xml_content).replaceAll("&quot;", "\"");
Buff.write(new java.lang.String(write).getBytes("UTF-8"));
Buff.flush();
Buff.close();
} catch (e) {
raise_app_error(e.message);
} finally {
try {
Buff.close();
outSTr.close();
} catch (e) {
raise_app_error(e.message);
}
}
println('paraconfig.properties');
//以下参数请查看class目录下paraconfig.properties文件进行配置
var URL = AuthTypeMode.getProperties("URL");
var USER_NAME = AuthTypeMode.getProperties("USER_NAME");
var PORT = AuthTypeMode.getProperties("PORT");
var ROOT_PATH = AuthTypeMode.getProperties("ROOT_PATH");
var KEY_PATH = AuthTypeMode.getProperties("KEY_PATH");
var AUTH_CODE = AuthTypeMode.getProperties("AUTH_CODE");
var DOWN_FILEDIR = AuthTypeMode.getProperties("DOWN_FILEDIR");
var sftpTool = new SftpTool(URL,USER_NAME,PORT);
var send_code = sftpTool.upload(ROOT_PATH, FilePath, new AuthTypeMode(AUTH_CODE,KEY_PATH));
//插入日志表
//生成log_id
var log_bm = new ModelService('hsbc.HSBC110.hsbc_get_log_id');
var res = log_bm.queryAsMap();
var arr = res.getChildren();
var log_id = arr[0].log_id;
log_bm.insert({
log_id: log_id,
interface_code:'HSBC_SEND',
reqsn:reqsn,
request:xml_content,
send_return_code:send_code
});
var send_bm = $bm('hsbc.HSBC110.upload_interface_process');
if (send_code=='UPLOAD_SUCCESS'){
//解析XML文件2个,先修改下载状态。 建议还是解析XML和修改下载状态独立吧
send_bm.update({
reqsn: reqsn,
errMsg:''
});
}else{
//上传失败
send_bm.update({
reqsn: reqsn,
errMsg:send_code
});
}
}
function main() {
println('main');
var bm = new ModelService('hsbc.HSBC110.hsbc_batch_temp');
var res = bm.queryAsMap();
var arr = res.getChildren();
if (arr.length) {
for (var i = 0;i < arr.length;i++) {
batch_send(arr[i].reqsn);
}
}
}
main();
]]></s:server-script>
<p:echo/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: wangwei5743
$Date: 2017-8-17 上午10:38:31
$Revision: 1.0
$Purpose: 农行代扣接口生成txt
-->
<a:service xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
importPackage(Packages.java.lang);
importPackage(Packages.java.io);
importPackage(java.util.zip);
importPackage(java.io); /*可以传入参数*/
importPackage(Packages.com.hand.hsbc);
function main() {
//以下参数请查看class目录下paraconfig.properties文件进行配置
var URL = AuthTypeMode.getProperties("URL");
var USER_NAME = AuthTypeMode.getProperties("USER_NAME");
var PORT = AuthTypeMode.getProperties("PORT");
var ROOT_PATH = AuthTypeMode.getProperties("ROOT_PATH");
var KEY_PATH = AuthTypeMode.getProperties("KEY_PATH");
var AUTH_CODE = AuthTypeMode.getProperties("AUTH_CODE");
var DOWN_FILEDIR = AuthTypeMode.getProperties("DOWN_FILEDIR");
var HSBC_BANK_CODE = AuthTypeMode.getProperties("HSBC_BANK_CODE");
var SYSTEM_FLAG = AuthTypeMode.getProperties("SYSTEM_FLAG");
var date=new Date();
var year=date.getFullYear();
var month=date.getMonth()+1;
DOWN_FILEDIR = DOWN_FILEDIR+year+"\\"+month+"\\";
var tranfer_dir= new File(String(DOWN_FILEDIR));
if(!tranfer_dir.exists()){
//如果文件夹不存在,创建年月文件夹
tranfer_dir.mkdirs();//创建文件夹
}
var sftpTool = new SftpTool(URL,USER_NAME,PORT);
var down_code= sftpTool.downloaddiff(ROOT_PATH,SYSTEM_FLAG,HSBC_BANK_CODE, DOWN_FILEDIR, new AuthTypeMode(AUTH_CODE,KEY_PATH));
//生成log_id
var log_bm = new ModelService('hsbc.HSBC110.hsbc_get_log_id');
var res = log_bm.queryAsMap();
var arr = res.getChildren();
var log_id = arr[0].log_id;
log_bm.insert({
log_id: log_id,
interface_code:'HSBC_DOWN',
reqsn:'',
request:down_code,
send_return_code:'DOWN_FINISHED'
});
//var down_code='ACK1PSRV3.PC000018926.20220118153157978927.20220118073230005.XML;ACK2PSRV3.PC000018926.20220118153157978927.20220118073238006.XML';
try {
if (down_code != null && down_code.length != 0) {
//解析XML文件2个,先修改下载状态。 建议还是解析XML和修改下载状态独立吧
var bm = $bm('hsbc.HSBC120.update_down_file_status');
var fileNames = down_code.split(';');
for (var i = 0;i < fileNames.length;i++) {
var file_path=DOWN_FILEDIR+fileNames[i];
var xml_str=SaxReaderXml.xmlToString(file_path);
if (xml_str == null || xml_str.length == 0) {
bm.insert({
file_name:fileNames[i],
file_path:file_path.toString(),
xml_str:xml_str
});
}
}
}
} catch (e) {
raise_app_error(e);
println(e);
}
println('LSC执行完成');
}
main();
]]></s:server-script>
<p:echo/>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: Hongquan.Dai 代宏全
$Date: 2018-1-22 上午10:36:25
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true">
<a:init-procedure/>
<a:view>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<a:link id="batch_detail_link" url="${/request/@context_path}/modules/hsbc/HSBC110/hsbc_paying_batch_detail.lview"/>
<script type="text/javascript"><![CDATA[
function open_batch_win(ds_id, record_id) {
var record = $(ds_id).findById(record_id);
var param = record.data;
param['function_code'] = 'HSBC110D';
param['maintain_type'] = 'QUERY';
param['url_title'] = '付款单明细';
hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'batch_detail_link', null,ds_id);
}
window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
if (name == 'reqsn' && value) {
return '<a href="javascript:open_batch_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
}
return value;
};
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Author: Hongquan.Dai 代宏全
$Date: 2018-1-22 上午10:36:25
$Revision: 1.0
$Purpose:
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true">
<a:init-procedure/>
<a:view>
<a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
<script type="text/javascript"><![CDATA[
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
\ No newline at end of file
......@@ -384,15 +384,29 @@
}
if (bp_tenant_detail_r && ds.id == prj_project_ds_id) {
for (var key in bp_tenant_detail_r.data) {
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age' && key != 'project_id'&& key != 'contract_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n'&& key != 'third_guar_score' ) {
if(!bp_tenant_detail_r.get(key)){
Leaf.showInfoMessage("提示","承租人评分信息区域的所有字段,除\"第三方担保附件分数\"外,其他都为必输字段,请填写!");
bp_rate_flag = false;
break;
}else{
bp_rate_flag = true;
if(division!='70'){
//非铁甲排除铁甲必填
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age' && key != 'project_id'&& key != 'contract_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n'&& key != 'third_guar_score'&& key != 'tj_score' ) {
if(!bp_tenant_detail_r.get(key)){
Leaf.showInfoMessage("提示","承租人评分信息区域的所有字段,除\"第三方担保附件分数\"外,其他都为必输字段,请填写!");
bp_rate_flag = false;
break;
}else{
bp_rate_flag = true;
}
}
}else{
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age' && key != 'project_id'&& key != 'contract_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n'&& key != 'third_guar_score' ) {
if(!bp_tenant_detail_r.get(key)){
Leaf.showInfoMessage("提示","承租人评分信息区域的所有字段,除\"第三方担保附件分数\"外,其他都为必输字段,请填写!");
bp_rate_flag = false;
break;
}else{
bp_rate_flag = true;
}
}
}
}
}
if(!bp_rate_flag){
......@@ -443,7 +457,7 @@
window['${/parameter/@layout_code}_hls_link_render_record'][record.id + '---' + name] = record;
if (name == 'attachment') {
link_function = 'prj501n_upload_file';
if(record.get('cdd_item') == 'ADD_ATTACH'){
if(record.get('cdd_item') == 'ADD_ATTACH'||record.get('cdd_item') == 'TJ_SCORE_SHEET'){
link_function = 'prj501n_upload_file_new';
}
return '<a href="javascript:window[\'' + link_function + '\'](\'' + record.id + '\',\'' + name + '\',\'' + config_record.get('query_only') + '\');">' + config_record.get('prompt') + '</a>';
......@@ -730,9 +744,18 @@
document.getElementById('${/parameter/@layout_code}_F_PAY_INFO_PRJ_PROJECT_DEDUCTION_LIMIT').style.display = 'none';
record.getField('deduction_limit').setRequired(false);
}
document.getElementById('PROJECT_CREATE_NP_F_QUOTATION_N_PRJ_QUOTATION_LARGE_BALANCE_prompt').style.display = 'none';
document.getElementById('PROJECT_CREATE_NP_F_QUOTATION_N_PRJ_QUOTATION_LARGE_BALANCE').style.display = 'none';
}
//add by wangwei 非铁甲业务隐藏铁甲评分
var bp_tenant_rate_detail_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'bp_tenant_rate_detail');
if (bp_tenant_rate_detail_ds_id == ds.id && bp_tenant_rate_detail_ds_id) {
if (division != '70' && division != '') {
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE').style.display = 'none';
}
}
document.getElementById('PROJECT_CREATE_NP_F_QUOTATION_N_PRJ_QUOTATION_LARGE_BALANCE_prompt').style.display = 'none';
document.getElementById('PROJECT_CREATE_NP_F_QUOTATION_N_PRJ_QUOTATION_LARGE_BALANCE').style.display = 'none';
};
//更新时调用
......
......@@ -1169,6 +1169,10 @@
}
var score_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'F_TENANT_SCORE_INFO', 'bp_tenant_rate_detail');
if (score_ds_id == ds.id) {
if (division != '70' && division != '') {
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE').style.display = 'none';
}
if (!record.get('score_name')) {
if ($(ds_id).getCurrentRecord()) {
var score_name = $(ds_id).getCurrentRecord().get('legal_person') || $(ds_id).getCurrentRecord().get('bp_id_tenant_n');
......@@ -1320,13 +1324,24 @@
var bp_tenant_detail_r = $(score_ds_id).getCurrentRecord();
if (bp_tenant_detail_r) {
for (var key in bp_tenant_detail_r.data) {
if (key != 'bp_detail_id' && key != 'score_name'&& key != 'contract_id' && key != 'bp_age' && key != 'project_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n'&& key != 'third_guar_score' ) {
//if (!bp_tenant_detail_r.get(key)) {
if (typeof bp_tenant_detail_r.get(key) == "null" || typeof bp_tenant_detail_r.get(key) == "undefined" || bp_tenant_detail_r.get(key) === "") {
Leaf.showInfoMessage("提示", "承租人评分信息区域的所有字段,除\"第三方担保附件分数\"外,其他都为必输字段,请填写!");
return;
if(division!='70'){
if (key != 'bp_detail_id' && key != 'score_name'&& key != 'contract_id' && key != 'bp_age' && key != 'project_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n'&& key != 'third_guar_score'&& key != 'tj_score' ) {
//if (!bp_tenant_detail_r.get(key)) {
if (typeof bp_tenant_detail_r.get(key) == "null" || typeof bp_tenant_detail_r.get(key) == "undefined" || bp_tenant_detail_r.get(key) === "") {
Leaf.showInfoMessage("提示", "承租人评分信息区域的所有字段,除\"第三方担保附件分数\"外,其他都为必输字段,请填写!");
return;
}
}
}else{
if (key != 'bp_detail_id' && key != 'score_name'&& key != 'contract_id' && key != 'bp_age' && key != 'project_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n'&& key != 'third_guar_score' ) {
//if (!bp_tenant_detail_r.get(key)) {
if (typeof bp_tenant_detail_r.get(key) == "null" || typeof bp_tenant_detail_r.get(key) == "undefined" || bp_tenant_detail_r.get(key) === "") {
Leaf.showInfoMessage("提示", "承租人评分信息区域的所有字段,除\"第三方担保附件分数\"外,其他都为必输字段,请填写!");
return;
}
}
}
}
}
if (current_record.dirty == true) {
......@@ -1651,14 +1666,27 @@
}
if (bp_tenant_detail_r && ds.id == prj_project_ds_id) {
for (var key in bp_tenant_detail_r.data) {
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age'&& key != 'contract_id' && key != 'project_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n'&& key != 'third_guar_score') {
//if (!bp_tenant_detail_r.get(key)) {
if (typeof bp_tenant_detail_r.get(key) == "null" || typeof bp_tenant_detail_r.get(key) == "undefined" || bp_tenant_detail_r.get(key) === "") {
Leaf.showInfoMessage("提示", "承租人评分信息区域的所有字段,除\"第三方担保附件得分\"外,其他都为必输字段,请填写!");
bp_rate_flag = false;
break;
} else {
bp_rate_flag = true;
if(division != '70'){
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age'&& key != 'contract_id' && key != 'project_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n'&& key != 'third_guar_score'&&key != 'tj_score') {
//if (!bp_tenant_detail_r.get(key)) {
if (typeof bp_tenant_detail_r.get(key) == "null" || typeof bp_tenant_detail_r.get(key) == "undefined" || bp_tenant_detail_r.get(key) === "") {
Leaf.showInfoMessage("提示", "承租人评分信息区域的所有字段,除\"第三方担保附件得分\"外,其他都为必输字段,请填写!");
bp_rate_flag = false;
break;
} else {
bp_rate_flag = true;
}
}
}else{
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age'&& key != 'contract_id' && key != 'project_id' && key != 'third_party_credibility' && key != 'third_party_credibility_n'&& key != 'third_guar_score') {
//if (!bp_tenant_detail_r.get(key)) {
if (typeof bp_tenant_detail_r.get(key) == "null" || typeof bp_tenant_detail_r.get(key) == "undefined" || bp_tenant_detail_r.get(key) === "") {
Leaf.showInfoMessage("提示", "承租人评分信息区域的所有字段,除\"第三方担保附件得分\"外,其他都为必输字段,请填写!");
bp_rate_flag = false;
break;
} else {
bp_rate_flag = true;
}
}
}
}
......
......@@ -326,16 +326,30 @@
}
if (bp_tenant_detail_r && ds.id == prj_project_ds_id) {
for (var key in bp_tenant_detail_r.data) {
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age' && key != 'project_id'&& key != 'third_party_credibility' && key != 'third_party_credibility_n') {
//if(!bp_tenant_detail_r.get(key)){
if (typeof bp_tenant_detail_r.get(key)== "null"||typeof bp_tenant_detail_r.get(key)== "undefined"|| bp_tenant_detail_r.get(key)=== "") {
Leaf.showInfoMessage("提示","承租人评分信息区域的所有字段,除\"第三方信用度\"外,其他都为必输字段,请填写!");
bp_rate_flag = false;
break;
}else{
bp_rate_flag = true;
if(division!='70'){
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age' && key != 'project_id'&& key != 'third_party_credibility' && key != 'third_party_credibility_n'&& key != 'contract_id'&& key != 'third_guar_score'&&key != 'tj_score') {
//if(!bp_tenant_detail_r.get(key)){
if (typeof bp_tenant_detail_r.get(key)== "null"||typeof bp_tenant_detail_r.get(key)== "undefined"|| bp_tenant_detail_r.get(key)== "") {
Leaf.showInfoMessage("提示","承租人评分信息区域的所有字段,除\"第三方担保附件分数\"外,其他都为必输字段,请填写!");
bp_rate_flag = false;
break;
}else{
bp_rate_flag = true;
}
}
} else{
if (key != 'bp_detail_id' && key != 'score_name' && key != 'bp_age' && key != 'project_id'&& key != 'third_party_credibility' && key != 'third_party_credibility_n'&& key != 'contract_id'&& key != 'third_guar_score') {
//if(!bp_tenant_detail_r.get(key)){
if (typeof bp_tenant_detail_r.get(key)== "null"||typeof bp_tenant_detail_r.get(key)== "undefined"|| bp_tenant_detail_r.get(key)== "") {
Leaf.showInfoMessage("提示","承租人评分信息区域的所有字段,除\"第三方担保附件分数\"外,其他都为必输字段,请填写!");
bp_rate_flag = false;
break;
}else{
bp_rate_flag = true;
}
}
}
}
}
if(!bp_rate_flag){
......@@ -541,15 +555,18 @@
var lease_item_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_LEASE_HEAD_CAR', 'prj_project_lease_item');
if(lease_item_ds_id == ds.id &&lease_item_ds_id){
var gridId= ds.bindname+'_layout_grid_id';
if(division=='70'){
if(division=='70'&&division!=''){
debugger;
if(record!=''){
record.getField('lease_name_n').setRequired(true);
record.getField('brand_value').setRequired(true);
record.getField('produce_date').setReadOnly(false);
record.getField('produce_date').setRequired(true);
record.getField('using_hour').setRequired(true);
record.getField('modelcd').setReadOnly(false);
record.getField('modelcd').setRequired(true);
record.getField('ownership_flag_n').setRequired(true);
record.getField('residual_value_amount').setRequired(true);
record.getField('full_name').setRequired(false);
record.getField('full_name_n').setRequired(false);
}else {
......@@ -562,7 +579,7 @@
$(gridId).hideColumn('item_type_n');
$(gridId).hideColumn('equipment_type_n');
$(gridId).hideColumn('machine_number');
}else {
}else if(division!=''){
$(gridId).hideColumn('machine_number_70');
$(gridId).hideColumn('lease_name_n');
$(gridId).hideColumn('brand_value');
......@@ -772,9 +789,16 @@
}
var division='';
window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_form_add_and_load'] = function (ds, record, config_records, bp_seq) {
debugger;
var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_project');
var prj_quotation_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'prj_quotation');
//add by wangwei 非铁甲业务隐藏铁甲评分
var bp_tenant_rate_detail_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'bp_tenant_rate_detail');
if (bp_tenant_rate_detail_ds_id == ds.id && bp_tenant_rate_detail_ds_id) {
if (division != '70' && division != '') {
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE_prompt').style.display = 'none';
document.getElementById('${/parameter/@layout_code}_F_TENANT_SCORE_INFO_BP_TENANT_RATE_DETAIL_TJ_SCORE').style.display = 'none';
}
}
if (ds_id == ds.id && ds_id) {
division=record.get('division');
if (record.get('pay_method') == 'WIRE_TRANSFER') {
......@@ -993,15 +1017,20 @@
if(division=='70'){
record.getField('lease_name_n').setRequired(true);
record.getField('brand_value').setRequired(true);
record.getField('produce_date').setReadOnly(false);
record.getField('produce_date').setRequired(true);
record.getField('using_hour').setRequired(true);
record.getField('machine_number_70').setRequired(true);
record.getField('using_hour').setRequired(true);
record.getField('modelcd').setReadOnly(false);
record.getField('modelcd').setRequired(true);
record.getField('full_name').setRequired(false);
record.getField('full_name_n').setRequired(false);
record.getField('ownership_flag_n').setRequired(true);
record.getField('residual_value_amount').setRequired(true);
if(name=='lease_name_n'){
record.data.type_name=value;
}else if(name=='modelcd'){
record.data.pattern=value;
}
}else {
record.getField('modelcd').setReadOnly(true);
......@@ -1185,6 +1214,15 @@
record.set('bp_age', jsGetAge(value.format('yyyy-mm-dd').toString()));
}
}
if(name=='third_guar_score'&&!Ext.isEmpty(value)){
if(value<0||value>10){
setTimeout(function () {
record.set('third_guar_score', '');
}, 0);
Leaf.showInfoMessage("提示", "第三方担保附件分数范围为0-10,请重新输入!");
}
}
}
var device_ds_id = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_SCORE_DEVICE', 'bp_tenant_rate_item');
if (device_ds_id == ds.id) {
......
......@@ -191,6 +191,48 @@
</a:columns>
</a:grid>
</a:tab>
<a:tab prompt="租金余额表" width="150">
<a:grid id="con_contract_rental_result_add_grid" bindTarget="con_contract_rental_result_ds" marginHeight="115" navBar="true" marginWidth="30">
<a:columns>
<a:column name="agent_extra_name" align="center" prompt="代理店" width="120"/>
<a:column name="bp_tenant_name" align="center" prompt="客户名称" width="120"/>
<a:column name="contract_number" align="center" prompt="合同编号" width="100"/>
<a:column name="lease_start_date" align="center" prompt="租赁期开始日" width="80"/>
<a:column name="branch_code_n" align="center" prompt="分公司" width="100"/>
<a:column name="large_balance_n" align="center" prompt="大额尾款" width="100"/>
<a:column name="is_buyout_n" align="center" prompt="是否买断机" width="100"/>
<a:column name="modelcd" align="center" prompt=" 机型" width="180"/>
<a:column name="machine_number" align="center" prompt="机器号码" width="80"/>
<a:column name="int_rate_display" exportDataFormat="" align="center" prompt="利率" width="80"/>
<a:column name="int_rate_display" align="center" prompt="基准利率" width="80"/>
<a:column name="lease_times" align="center" prompt="租赁期间" width="80"/>
<a:column name="down_payment_ratio" align="center" prompt="首付款比率" width="80"/>
<a:column name="lease_item_amount" align="center" prompt="代理店销售金额" renderer="Leaf.formatMoney" width="80"/>
<a:column name="residual_amount" align="center" prompt="留购价格" renderer="Leaf.formatMoney" width="80"/>
<a:column name="contract_amount" align="center" prompt="合同总金额" renderer="Leaf.formatMoney" width="80"/>
<a:column name="down_payment" align="center" prompt="首付款" renderer="Leaf.formatMoney" width="80"/>
<a:column name="month_due_amount_after" align="center" prompt="当月末应收款余额(合计)" renderer="Leaf.formatMoney" width="80"/>
<a:column name="month_due_principal_after" align="center" prompt="当月末本金余额(合计)" renderer="Leaf.formatMoney" width="80"/>
<a:column name="month_interest_after" align="center" prompt="当月末利息余额(合计)" renderer="Leaf.formatMoney" width="80"/>
<a:column name="month_residual" align="center" prompt="当月末留购金余额" renderer="Leaf.formatMoney" width="80"/>
<a:column name="business_due_times_after" align="center" prompt="逾期期数" width="80"/>
<a:column name="business_due_amount_after" align="center" prompt="当月末逾期金额(合计)" renderer="Leaf.formatMoney" width="80"/>
<a:column name="deposit_amount" align="center" prompt="保证金" renderer="Leaf.formatMoney" width="80"/>
<a:column name="contract_status_n" align="center" prompt="合同状态" width="80"/>
<a:column name="residual_date" align="center" prompt="合同终了" width="80"/>
<a:column name="terminate_date" align="center" prompt="结清年月" width="80"/>
<a:column name="bp_class_n" align="center" prompt="商业伙伴分类" width="80"/>
<a:column name="business_type_n" align="center" prompt="业务类型" width="80"/>
<a:column name="division_n" align="center" prompt="租赁物" width="80"/>
<a:column name="secondary_lease_n" align="center" prompt="二次租赁" width="80"/>
<a:column name="tenant_change_flag_n" align="center" prompt="承租人变更" width="80"/>
<a:column name="rental_12_pay_flag" align="center" prompt="是否已履约12期及以上" width="160"/>
<a:column name="cf_9_exists_flag" align="center" prompt="是否有违约金记录产生" width="160"/>
<a:column name="cf_9_notfirsttime_exists_flag" align="center" prompt="除第1期外是否有违约金记录产生" width="160"/>
</a:columns>
</a:grid>
</a:tab>
</a:tabs>
</a:tabPanel>
</a:screenBody>
......
......@@ -15,19 +15,33 @@
//查询数据
window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
var form_ds_id = '${/parameter/@layout_code}_F_QUERY__ds';
//var grid_ds_id_before = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BEFORE_RESULT', 'con_contract');
// var grid_ds_id_current = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_CURRENT_RESULT', 'con_contract');
var grid_ds_id_total = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_SUM_RESULT', 'con_contract');
var grid_vat_6_ds_id_total = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_SUM_RESULT_6', 'con_contract');
var grid_ds_id_before = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BEFORE_RESULT', 'con_contract');
var grid_ds_id_before_6 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_BEFORE_RESULT_6', 'con_contract');
var grid_ds_id_current = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_CURRENT_RESULT', 'con_contract');
var grid_ds_id_total = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_SUM_RESULT', 'con_contract');
$(grid_ds_id_before).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_query/query');
$(grid_ds_id_current).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_current_query/query');
var grid_ds_id_current_6 = get_dsid_by_tabcode_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'G_CURRENT_RESULT_6', 'con_contract');
$(grid_ds_id_before).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_query/query?vat_6_flag=N');
$(grid_ds_id_before_6).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_query/query?vat_6_flag=Y');
$(grid_ds_id_current).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_current_query/query?vat_6_flag=N');
$(grid_ds_id_current_6).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_current_query/query?vat_6_flag=Y');
//先进行数据的处理
$(grid_ds_id_total).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_total_query/query');
$(grid_ds_id_total).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_total_query/query?vat_6_flag=N');
$(grid_vat_6_ds_id_total).setQueryUrl('${/request/@context_path}/autocrud/rpt.RPT555.con_je_vat_total_query/query?vat_6_flag=Y');
var detail_mask = Ext.getBody();
$(grid_ds_id_before).setQueryDataSet($(form_ds_id));
$(grid_ds_id_current).setQueryDataSet($(form_ds_id));
// $(grid_ds_id_before).setQueryDataSet($(form_ds_id));
// $(grid_ds_id_current).setQueryDataSet($(form_ds_id));
$(grid_ds_id_total).setQueryDataSet($(form_ds_id));
$(grid_ds_id_total).setQueryParameter('vat_6_flag','N');
$(grid_vat_6_ds_id_total).setQueryDataSet($(form_ds_id));
$(grid_vat_6_ds_id_total).setQueryParameter('vat_6_flag','Y');
$(grid_ds_id_before).query();
$(grid_ds_id_before_6).query();
$(grid_ds_id_current).query();
$(grid_ds_id_current_6).query();
Leaf.Masker.mask(detail_mask, '正在保存中。。。');
Leaf.request({
url: $('process_vat_account_data_link').getUrl(),
......@@ -36,8 +50,9 @@
tmp_date: new Date()
},
success: function () {
Leaf.Masker.unmask(detail_mask);
$(grid_ds_id_total).query();
$(grid_vat_6_ds_id_total).query();
Leaf.Masker.unmask(detail_mask);
},
failure: function () {
Leaf.Masker.unmask(detail_mask);
......@@ -52,4 +67,4 @@
]]></script>
<a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
</a:view>
</a:screen>
</a:screen>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:p="uncertain.proc"
xmlns:a="http://www.leaf-framework.org/application"
xmlns:s="leaf.plugin.script"
trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
importPackage(Packages.java.util)
importPackage(Packages.com.hand.hls.hlcm.emay);
importPackage(Packages.com.hand.hap.system.dto)
//step2 发送短信
function sendsms() {
// 查询待发送短信表
var contract_collection = $bm('sys.SYS403.reminder_repayment_t5_sms_list');
contract_collection.update();
var sms_list_bm = $bm('sys.SYS403.reminder_repayment_t5_sms_loop');
var sms_result = sms_list_bm.queryAsMap({
batch_id: $ctx.parameter.batch_id
});
var sms_list_records = sms_result.getChildren();
for (var i = 0; i < sms_list_records.length; i++) {
var Phones = sms_list_records[i].phone_number;
var content = sms_list_records[i].text;
var sms_id = sms_list_records[i].sms_id;
try {
var example = new Example();
var result = example.setSingleSms(content, Phones);
var req_response = result.toString();
} catch (e) {
println("抛出异常:" + e);
}
//发送后请求更新
$bm('sys.SYS403.reminder_repayment_t5_sms_loop').update({
sms_id: sms_id,
result: req_response
});
}
}
sendsms();
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:p="uncertain.proc"
xmlns:a="http://www.leaf-framework.org/application"
xmlns:s="leaf.plugin.script"
trace="true">
<a:init-procedure>
<s:server-script><![CDATA[
importPackage(Packages.java.util);
importPackage(Packages.com.hand.hls.hlcm.emay);
importPackage(Packages.com.hand.hap.system.dto);
//step2 发送短信
function sendsms() {
// 查询待发送短信表
var sms_list_bm = $bm('sys.SYS403.reminder_repayment_t5_sms_loop');
var sms_list_result = sms_list_bm.queryAsMap({
"batch_id": $ctx.parameter.batch_id
});
var sms_list_records = sms_list_result.getChildren();
for (var i = 0; i < sms_list_records.length; i++) {
var Phones = sms_list_records[i].phone_number;
var content = sms_list_records[i].text;
var sms_id = sms_list_records[i].sms_id;
try {
var example = new Example();
var result = example.setSingleSms(content, Phones);
var req_response = result.toString();
} catch (e) {
println("抛出异常:" + e);
}
//发送后请求更新
$bm('sys.SYS403.reminder_repayment_t5_sms_loop').update({
sms_id: sms_id,
result: req_response
});
}
}
sendsms();
]]></s:server-script>
</a:init-procedure>
<a:service-output output="/parameter"/>
</a:service>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment