5 changed files with 724 additions and 97 deletions
			
			
		| @ -0,0 +1,430 @@ | |||
| /* eslint-disable*/ | |||
| 
 | |||
| 'use strict'; | |||
| 
 | |||
| module.exports = dc => { | |||
|     const DataTypes = dc.ORM; | |||
|     const sequelize = dc.orm; | |||
|     const ContractDetail = sequelize.define("contractDetail", { | |||
|         id: { | |||
|             type: DataTypes.INTEGER, | |||
|             allowNull: false, | |||
|             defaultValue: null, | |||
|             comment: null, | |||
|             primaryKey: true, | |||
|             field: "id", | |||
|             autoIncrement: true | |||
|         }, | |||
|         year: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "年度", | |||
|             primaryKey: false, | |||
|             field: "year ", | |||
|             autoIncrement: false | |||
|         }, | |||
|         serialNo: { | |||
|             type: DataTypes.INTEGER, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "序号", | |||
|             primaryKey: false, | |||
|             field: "serial_no", | |||
|             autoIncrement: false | |||
|         }, | |||
|         number: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "编号", | |||
|             primaryKey: false, | |||
|             field: "number", | |||
|             autoIncrement: false | |||
|         }, | |||
|         introduction: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "简介", | |||
|             primaryKey: false, | |||
|             field: "introduction", | |||
|             autoIncrement: false | |||
|         }, | |||
|         contractNo: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "合同编号", | |||
|             primaryKey: false, | |||
|             field: "contract_no", | |||
|             autoIncrement: false | |||
|         }, | |||
|         applyDate: { | |||
|             type: DataTypes.DATEONLY, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "申请日期", | |||
|             primaryKey: false, | |||
|             field: "apply_date", | |||
|             autoIncrement: false | |||
|         }, | |||
|         recConDate: { | |||
|             type: DataTypes.DATEONLY, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "收到合同日期", | |||
|             primaryKey: false, | |||
|             field: "rec_con_date", | |||
|             autoIncrement: false | |||
|         }, | |||
|         contractPaper: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "合同纸质版情况", | |||
|             primaryKey: false, | |||
|             field: "contract_paper", | |||
|             autoIncrement: false | |||
|         }, | |||
|         contractElec: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "合同电子版情况", | |||
|             primaryKey: false, | |||
|             field: "contract_elec", | |||
|             autoIncrement: false | |||
|         }, | |||
|         department: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "部门", | |||
|             primaryKey: false, | |||
|             field: "department", | |||
|             autoIncrement: false | |||
|         }, | |||
|         business: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "业务线", | |||
|             primaryKey: false, | |||
|             field: "business", | |||
|             autoIncrement: false | |||
|         }, | |||
|         sale: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "销售人员", | |||
|             primaryKey: false, | |||
|             field: "sale", | |||
|             autoIncrement: false | |||
|         }, | |||
|         customer: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "客户名称", | |||
|             primaryKey: false, | |||
|             field: "customer", | |||
|             autoIncrement: false | |||
|         }, | |||
|         item: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "项目名称", | |||
|             primaryKey: false, | |||
|             field: "item", | |||
|             autoIncrement: false | |||
|         }, | |||
|         itemType: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "项目类型", | |||
|             primaryKey: false, | |||
|             field: "item_type", | |||
|             autoIncrement: false | |||
|         }, | |||
|         amount: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "合同金额", | |||
|             primaryKey: false, | |||
|             field: "amount", | |||
|             autoIncrement: false | |||
|         }, | |||
|         changeAmount: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "变更后合同金额", | |||
|             primaryKey: false, | |||
|             field: "change_amount", | |||
|             autoIncrement: false | |||
|         }, | |||
|         cInvoicedAmount: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "累计开票金额", | |||
|             primaryKey: false, | |||
|             field: "c_invoiced_amount", | |||
|             autoIncrement: false | |||
|         }, | |||
|         cBackAmount: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "累计回款金额", | |||
|             primaryKey: false, | |||
|             field: "c_back_amount", | |||
|             autoIncrement: false | |||
|         }, | |||
|         invoicedBack: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "开票-回款", | |||
|             primaryKey: false, | |||
|             field: "invoiced_back", | |||
|             autoIncrement: false | |||
|         }, | |||
|         unInvoicedAmount: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "未开票金额", | |||
|             primaryKey: false, | |||
|             field: "un_invoiced_amount", | |||
|             autoIncrement: false | |||
|         }, | |||
|         remainConAmount: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "剩余合同金额", | |||
|             primaryKey: false, | |||
|             field: "remain_con_amount", | |||
|             autoIncrement: false | |||
|         }, | |||
|         backPercent: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "回款率", | |||
|             primaryKey: false, | |||
|             field: "back_percent", | |||
|             autoIncrement: false | |||
|         }, | |||
|         retentionMoney: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "质保金", | |||
|             primaryKey: false, | |||
|             field: "retention_money", | |||
|             autoIncrement: false | |||
|         }, | |||
|         retentionPercent: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "质保金比例", | |||
|             primaryKey: false, | |||
|             field: "retention_percent", | |||
|             autoIncrement: false | |||
|         }, | |||
|         retentionTerm: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "质保期", | |||
|             primaryKey: false, | |||
|             field: "retention_term", | |||
|             autoIncrement: false | |||
|         }, | |||
|         invoiceTax1: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "发票税率金额", | |||
|             primaryKey: false, | |||
|             field: "invoice_tax1", | |||
|             autoIncrement: false | |||
|         }, | |||
|         invoiceTax2: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: null, | |||
|             primaryKey: false, | |||
|             field: "invoice_tax2", | |||
|             autoIncrement: false | |||
|         }, | |||
|         invoiceTax3: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: null, | |||
|             primaryKey: false, | |||
|             field: "invoice_tax3", | |||
|             autoIncrement: false | |||
|         }, | |||
|         payType: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "合同付款方式", | |||
|             primaryKey: false, | |||
|             field: "pay_type", | |||
|             autoIncrement: false | |||
|         }, | |||
|         cost: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "预支提成及委外费用", | |||
|             primaryKey: false, | |||
|             field: "cost", | |||
|             autoIncrement: false | |||
|         }, | |||
|         performanceRatio: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "业绩折算比例", | |||
|             primaryKey: false, | |||
|             field: "performance_ratio", | |||
|             autoIncrement: false | |||
|         }, | |||
|         realPerformance: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "实际业绩", | |||
|             primaryKey: false, | |||
|             field: "real_performance", | |||
|             autoIncrement: false | |||
|         }, | |||
|         assessmentPerformance: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "考核业绩", | |||
|             primaryKey: false, | |||
|             field: "assessment_performance", | |||
|             autoIncrement: false | |||
|         }, | |||
|         acceptanceDate: { | |||
|             type: DataTypes.DATEONLY, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "验收日期", | |||
|             primaryKey: false, | |||
|             field: "acceptance_date", | |||
|             autoIncrement: false | |||
|         }, | |||
|         backConfirmDate: { | |||
|             type: DataTypes.DATEONLY, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "收入确认时间", | |||
|             primaryKey: false, | |||
|             field: "back_confirm_date", | |||
|             autoIncrement: false | |||
|         }, | |||
|         recYear: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "接单年份", | |||
|             primaryKey: false, | |||
|             field: "rec_year", | |||
|             autoIncrement: false | |||
|         }, | |||
|         recMonth: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "接单月份", | |||
|             primaryKey: false, | |||
|             field: "rec_month", | |||
|             autoIncrement: false | |||
|         }, | |||
|         cusAttribute: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "客户属性", | |||
|             primaryKey: false, | |||
|             field: "cus_attribute", | |||
|             autoIncrement: false | |||
|         }, | |||
|         cusType: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "客户类型", | |||
|             primaryKey: false, | |||
|             field: "cus_type", | |||
|             autoIncrement: false | |||
|         }, | |||
|         industry: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "行业", | |||
|             primaryKey: false, | |||
|             field: "industry", | |||
|             autoIncrement: false | |||
|         }, | |||
|         source: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "信息来源", | |||
|             primaryKey: false, | |||
|             field: "source", | |||
|             autoIncrement: false | |||
|         }, | |||
|         cusProvince: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "客户省份", | |||
|             primaryKey: false, | |||
|             field: "cus_province", | |||
|             autoIncrement: false | |||
|         }, | |||
|         cusArea: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: "项目所在地", | |||
|             primaryKey: false, | |||
|             field: "cus_area", | |||
|             autoIncrement: false | |||
|         }, | |||
|         text: { | |||
|             type: DataTypes.STRING, | |||
|             allowNull: true, | |||
|             defaultValue: null, | |||
|             comment: null, | |||
|             primaryKey: false, | |||
|             field: "text", | |||
|             autoIncrement: false | |||
|         } | |||
|     }, { | |||
|         tableName: "contract_detail", | |||
|         comment: "", | |||
|         indexes: [] | |||
|     }); | |||
|     dc.models.ContractDetail = ContractDetail; | |||
|     return ContractDetail; | |||
| }; | |||
| @ -0,0 +1,196 @@ | |||
| /* eslint-disable*/ | |||
| 
 | |||
| 'use strict'; | |||
| 
 | |||
| module.exports = dc => { | |||
|   const DataTypes = dc.ORM; | |||
|   const sequelize = dc.orm; | |||
|   const InvoiceDetail = sequelize.define("invoiceDetail", { | |||
|     id: { | |||
|       type: DataTypes.INTEGER, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: null, | |||
|       primaryKey: true, | |||
|       field: "id", | |||
|       autoIncrement: false | |||
|     }, | |||
|     year: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "年度:【申请日期】-年份", | |||
|       primaryKey: false, | |||
|       field: "year", | |||
|       autoIncrement: false | |||
|     }, | |||
|     serialNo: { | |||
|       type: DataTypes.INTEGER, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "序号:自动生成\n(自动升序),每一年自动从1开始", | |||
|       primaryKey: false, | |||
|       field: "serial_no", | |||
|       autoIncrement: false | |||
|     }, | |||
|     number: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "编号:年份+序号 如2022年1", | |||
|       primaryKey: false, | |||
|       field: "number", | |||
|       autoIncrement: false | |||
|     }, | |||
|     department: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "部门:申请部门", | |||
|       primaryKey: false, | |||
|       field: "department", | |||
|       autoIncrement: false | |||
|     }, | |||
|     sale: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "销售人员:申请人", | |||
|       primaryKey: false, | |||
|       field: "sale", | |||
|       autoIncrement: false | |||
|     }, | |||
|     contractNo: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "合同编号", | |||
|       primaryKey: false, | |||
|       field: "contract_no", | |||
|       autoIncrement: false | |||
|     }, | |||
|     customer: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "客户名称:【甲方名称】", | |||
|       primaryKey: false, | |||
|       field: "customer", | |||
|       autoIncrement: false | |||
|     }, | |||
|     item: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "项目名称", | |||
|       primaryKey: false, | |||
|       field: "item", | |||
|       autoIncrement: false | |||
|     }, | |||
|     amount: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "合同金额:【合同金额\n(元)】", | |||
|       primaryKey: false, | |||
|       field: "amount", | |||
|       autoIncrement: false | |||
|     }, | |||
|     changeAmount: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "变更后合同金额", | |||
|       primaryKey: false, | |||
|       field: "change_amount", | |||
|       autoIncrement: false | |||
|     }, | |||
|     invoiceNo: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "发票号码:《发票申请单》【发票号】一个发票号码一个行数据", | |||
|       primaryKey: false, | |||
|       field: "invoice_no", | |||
|       autoIncrement: false | |||
|     }, | |||
|     invoiceType: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "开票类型:《发票申请单》\n【发票类型】", | |||
|       primaryKey: false, | |||
|       field: "invoice_type", | |||
|       autoIncrement: false | |||
|     }, | |||
|     invoiceDate: { | |||
|       type: DataTypes.DATEONLY, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "开票日期:《发票申请单》\n【开票日期】", | |||
|       primaryKey: false, | |||
|       field: "invoice_date", | |||
|       autoIncrement: false | |||
|     }, | |||
|     invoiceAmount: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "开票金额:《发票申请单》【发票金额】取财务填写数据", | |||
|       primaryKey: false, | |||
|       field: "invoice_amount", | |||
|       autoIncrement: false | |||
|     }, | |||
|     outputTax: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "销项税额:《发票申请单》-销项税额", | |||
|       primaryKey: false, | |||
|       field: "output_tax", | |||
|       autoIncrement: false | |||
|     }, | |||
|     total: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: false, | |||
|       defaultValue: null, | |||
|       comment: "合计:自动算出\n(开票金额+销项税额)", | |||
|       primaryKey: false, | |||
|       field: "total", | |||
|       autoIncrement: false | |||
|     }, | |||
|     taxRate13: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: true, | |||
|       defaultValue: null, | |||
|       comment: "税率13%:《发票申请单》", | |||
|       primaryKey: false, | |||
|       field: "tax_rate13", | |||
|       autoIncrement: false | |||
|     }, | |||
|     taxRate9: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: true, | |||
|       defaultValue: null, | |||
|       comment: "税率9%:《发票申请单》", | |||
|       primaryKey: false, | |||
|       field: "tax_rate9", | |||
|       autoIncrement: false | |||
|     }, | |||
|     taxRate6: { | |||
|       type: DataTypes.STRING, | |||
|       allowNull: true, | |||
|       defaultValue: null, | |||
|       comment: "税率6%:《发票申请单》", | |||
|       primaryKey: false, | |||
|       field: "tax_rate6", | |||
|       autoIncrement: false | |||
|     } | |||
|   }, { | |||
|     tableName: "invoice_detail", | |||
|     comment: "", | |||
|     indexes: [] | |||
|   }); | |||
|   dc.models.InvoiceDetail = InvoiceDetail; | |||
|   return InvoiceDetail; | |||
| }; | |||
					Loading…
					
					
				
		Reference in new issue