|
|
@ -3,194 +3,194 @@ |
|
|
|
'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; |
|
|
|
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; |
|
|
|
}; |