create view vi_snap_joint_voucher as SELECT LRP.ID                                         AS ID,
       LCI.CONTRACT_NO                                AS CONTRACT_NO,
       CIF.CUSTOMER_NUM                               AS CUSTOMER_NUM,
       CIF.CUSTOMERNAME                               AS CUSTOMERNAME,
       LRI.PLAN_LIST                                  AS PLAN_LIST,
       LRI.HIRE_DATE                                  AS HIRE_DATE,
       LRI.RENT                                       AS RENT,
       LRI.CORPUS                                     AS CORPUS,
       LRI.INTEREST                                   AS INTEREST,
       LRI.PENALTY                                    AS PENALTY,
       (ifnull(LRI.RENT, 0) + ifnull(LRI.PENALTY, 0)) AS SUMMONEY,
       CA.BANK_NAME                                   AS BANK_NAME,
       CA.ACCOUNT                                     AS ACCOUNT,
       CA.ACC_NUMBER                                  AS ACC_NUMBER,
       LRI.ACCOUNTING_DATE                            AS ACCOUNTING_DATE,
       LRI.ID                                         AS INCOME_ID
FROM (((((APZL.LC_RENT_PLAN LRP LEFT JOIN APZL.LC_RENT_INCOME LRI ON (((LRI.CONTRACT_ID = LRP.CONTRACT_ID) AND (LRI.PLAN_LIST = LRP.PLAN_LIST)))) LEFT JOIN APZL.LB_CONTRACT_INFO LCI ON ((LCI.ID = LRI.CONTRACT_ID))) LEFT JOIN APZL.LB_UNION_LESSEE LUL ON ((LUL.CONTRACT_ID = LCI.ID))) LEFT JOIN APZL.CUSTOMER_INFO CIF ON ((CIF.CUSTOMERID = LUL.CUSTOMER_ID)))
LEFT JOIN APZL.CUSTOMER_ACCOUNT CA ON (((CA.CONTRACT_ID = LCI.ID) AND (CA.ACC_TYPE = 'Debit'))))
WHERE ((LRP.COLLECT_STATUS IN ('手工收款', '批量收款')) AND ((LRI.EBANK_NUMBER = '') OR isnull(LRI.EBANK_NUMBER)) AND (NOT (LRP.ID IN (
    SELECT APZL.VOUCHER_V8.F58 FROM APZL.VOUCHER_V8 WHERE ((APZL.VOUCHER_V8.MODULE_NAME LIKE '%-收到的租金(卡扣)%') AND (APZL.VOUCHER_V8.F58 IS NOT NULL))
))));

-- comment on column vi_snap_joint_voucher.ID not supported: 标识

-- comment on column vi_snap_joint_voucher.CONTRACT_NO not supported: 合同号

-- comment on column vi_snap_joint_voucher.CUSTOMER_NUM not supported: 客户编码

-- comment on column vi_snap_joint_voucher.CUSTOMERNAME not supported: 客户名称

-- comment on column vi_snap_joint_voucher.PLAN_LIST not supported: 租金计划期次

-- comment on column vi_snap_joint_voucher.HIRE_DATE not supported: 核销日期

-- comment on column vi_snap_joint_voucher.RENT not supported: 回笼租金

-- comment on column vi_snap_joint_voucher.CORPUS not supported: 回笼本金

-- comment on column vi_snap_joint_voucher.INTEREST not supported: 回笼租息

-- comment on column vi_snap_joint_voucher.PENALTY not supported: 回笼罚息

-- comment on column vi_snap_joint_voucher.BANK_NAME not supported: 开户银行

-- comment on column vi_snap_joint_voucher.ACCOUNT not supported: 帐户名称

-- comment on column vi_snap_joint_voucher.ACC_NUMBER not supported: 银行账号

-- comment on column vi_snap_joint_voucher.ACCOUNTING_DATE not supported: 会计处理日

-- comment on column vi_snap_joint_voucher.income_ID not supported: 标识

