|
@ -3,194 +3,194 @@ |
|
|
'use strict'; |
|
|
'use strict'; |
|
|
|
|
|
|
|
|
module.exports = dc => { |
|
|
module.exports = dc => { |
|
|
const DataTypes = dc.ORM; |
|
|
const DataTypes = dc.ORM; |
|
|
const sequelize = dc.orm; |
|
|
const sequelize = dc.orm; |
|
|
const InvoiceDetail = sequelize.define("invoiceDetail", { |
|
|
const InvoiceDetail = sequelize.define("invoiceDetail", { |
|
|
id: { |
|
|
id: { |
|
|
type: DataTypes.INTEGER, |
|
|
type: DataTypes.INTEGER, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: null, |
|
|
comment: null, |
|
|
primaryKey: true, |
|
|
primaryKey: true, |
|
|
field: "id", |
|
|
field: "id", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
year: { |
|
|
year: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "年度:【申请日期】-年份", |
|
|
comment: "年度:【申请日期】-年份", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "year", |
|
|
field: "year", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
serialNo: { |
|
|
serialNo: { |
|
|
type: DataTypes.INTEGER, |
|
|
type: DataTypes.INTEGER, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "序号:自动生成\n(自动升序),每一年自动从1开始", |
|
|
comment: "序号:自动生成\n(自动升序),每一年自动从1开始", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "serial_no", |
|
|
field: "serial_no", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
number: { |
|
|
number: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "编号:年份+序号 如2022年1", |
|
|
comment: "编号:年份+序号 如2022年1", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "number", |
|
|
field: "number", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
department: { |
|
|
department: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "部门:申请部门", |
|
|
comment: "部门:申请部门", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "department", |
|
|
field: "department", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
sale: { |
|
|
sale: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "销售人员:申请人", |
|
|
comment: "销售人员:申请人", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "sale", |
|
|
field: "sale", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
contractNo: { |
|
|
contractNo: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "合同编号", |
|
|
comment: "合同编号", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "contract_no", |
|
|
field: "contract_no", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
customer: { |
|
|
customer: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "客户名称:【甲方名称】", |
|
|
comment: "客户名称:【甲方名称】", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "customer", |
|
|
field: "customer", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
item: { |
|
|
item: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "项目名称", |
|
|
comment: "项目名称", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "item", |
|
|
field: "item", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
amount: { |
|
|
amount: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "合同金额:【合同金额\n(元)】", |
|
|
comment: "合同金额:【合同金额\n(元)】", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "amount", |
|
|
field: "amount", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
changeAmount: { |
|
|
changeAmount: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "变更后合同金额", |
|
|
comment: "变更后合同金额", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "change_amount", |
|
|
field: "change_amount", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
invoiceNo: { |
|
|
invoiceNo: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "发票号码:《发票申请单》【发票号】一个发票号码一个行数据", |
|
|
comment: "发票号码:《发票申请单》【发票号】一个发票号码一个行数据", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "invoice_no", |
|
|
field: "invoice_no", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
invoiceType: { |
|
|
invoiceType: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "开票类型:《发票申请单》\n【发票类型】", |
|
|
comment: "开票类型:《发票申请单》\n【发票类型】", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "invoice_type", |
|
|
field: "invoice_type", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
invoiceDate: { |
|
|
invoiceDate: { |
|
|
type: DataTypes.DATEONLY, |
|
|
type: DataTypes.DATEONLY, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "开票日期:《发票申请单》\n【开票日期】", |
|
|
comment: "开票日期:《发票申请单》\n【开票日期】", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "invoice_date", |
|
|
field: "invoice_date", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
invoiceAmount: { |
|
|
invoiceAmount: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "开票金额:《发票申请单》【发票金额】取财务填写数据", |
|
|
comment: "开票金额:《发票申请单》【发票金额】取财务填写数据", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "invoice_amount", |
|
|
field: "invoice_amount", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
outputTax: { |
|
|
outputTax: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "销项税额:《发票申请单》-销项税额", |
|
|
comment: "销项税额:《发票申请单》-销项税额", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "output_tax", |
|
|
field: "output_tax", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
total: { |
|
|
total: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: false, |
|
|
allowNull: false, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "合计:自动算出\n(开票金额+销项税额)", |
|
|
comment: "合计:自动算出\n(开票金额+销项税额)", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "total", |
|
|
field: "total", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
taxRate13: { |
|
|
taxRate13: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: true, |
|
|
allowNull: true, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "税率13%:《发票申请单》", |
|
|
comment: "税率13%:《发票申请单》", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "tax_rate13", |
|
|
field: "tax_rate13", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
taxRate9: { |
|
|
taxRate9: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: true, |
|
|
allowNull: true, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "税率9%:《发票申请单》", |
|
|
comment: "税率9%:《发票申请单》", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "tax_rate9", |
|
|
field: "tax_rate9", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
}, |
|
|
}, |
|
|
taxRate6: { |
|
|
taxRate6: { |
|
|
type: DataTypes.STRING, |
|
|
type: DataTypes.STRING, |
|
|
allowNull: true, |
|
|
allowNull: true, |
|
|
defaultValue: null, |
|
|
defaultValue: null, |
|
|
comment: "税率6%:《发票申请单》", |
|
|
comment: "税率6%:《发票申请单》", |
|
|
primaryKey: false, |
|
|
primaryKey: false, |
|
|
field: "tax_rate6", |
|
|
field: "tax_rate6", |
|
|
autoIncrement: false |
|
|
autoIncrement: false |
|
|
} |
|
|
} |
|
|
}, { |
|
|
}, { |
|
|
tableName: "invoice_detail", |
|
|
tableName: "invoice_detail", |
|
|
comment: "", |
|
|
comment: "", |
|
|
indexes: [] |
|
|
indexes: [] |
|
|
}); |
|
|
}); |
|
|
dc.models.InvoiceDetail = InvoiceDetail; |
|
|
dc.models.InvoiceDetail = InvoiceDetail; |
|
|
return InvoiceDetail; |
|
|
return InvoiceDetail; |
|
|
}; |
|
|
}; |