|
@@ -16,11 +16,7 @@ class ExpenseModel {
|
|
|
final String projectName;
|
|
final String projectName;
|
|
|
final String budgetSubjectId;
|
|
final String budgetSubjectId;
|
|
|
final String budgetSubjectName;
|
|
final String budgetSubjectName;
|
|
|
- final double loanWriteoffAmount;
|
|
|
|
|
final String paymentMethod;
|
|
final String paymentMethod;
|
|
|
- final String accountBankName;
|
|
|
|
|
- final String accountHolderName;
|
|
|
|
|
- final String accountId;
|
|
|
|
|
final String accountName;
|
|
final String accountName;
|
|
|
final String remark;
|
|
final String remark;
|
|
|
final String purpose;
|
|
final String purpose;
|
|
@@ -38,17 +34,14 @@ class ExpenseModel {
|
|
|
final bool isInvoiceVerified;
|
|
final bool isInvoiceVerified;
|
|
|
final bool isTaxIdMatched;
|
|
final bool isTaxIdMatched;
|
|
|
final bool isCategoryCompliant;
|
|
final bool isCategoryCompliant;
|
|
|
- // 申请来源
|
|
|
|
|
- final String sourceApplicationId;
|
|
|
|
|
- final double sourceImportAmount;
|
|
|
|
|
- // 发票附件图片
|
|
|
|
|
- final List<String> invoiceImages;
|
|
|
|
|
// 数据库字段
|
|
// 数据库字段
|
|
|
final String bankName;
|
|
final String bankName;
|
|
|
final String bankAccount;
|
|
final String bankAccount;
|
|
|
final String bankTransferNo;
|
|
final String bankTransferNo;
|
|
|
final String approvalInstanceId;
|
|
final String approvalInstanceId;
|
|
|
final DateTime? applicationDate;
|
|
final DateTime? applicationDate;
|
|
|
|
|
+ final String currencyCode;
|
|
|
|
|
+ final double approvedAmount;
|
|
|
|
|
|
|
|
const ExpenseModel({
|
|
const ExpenseModel({
|
|
|
required this.id,
|
|
required this.id,
|
|
@@ -66,15 +59,11 @@ class ExpenseModel {
|
|
|
this.projectName = '',
|
|
this.projectName = '',
|
|
|
this.budgetSubjectId = '',
|
|
this.budgetSubjectId = '',
|
|
|
this.budgetSubjectName = '',
|
|
this.budgetSubjectName = '',
|
|
|
- this.loanWriteoffAmount = 0.0,
|
|
|
|
|
this.attachments = const [],
|
|
this.attachments = const [],
|
|
|
this.paymentStatus = 'unpaid',
|
|
this.paymentStatus = 'unpaid',
|
|
|
this.voucherNo = '',
|
|
this.voucherNo = '',
|
|
|
this.paymentMethod = '',
|
|
this.paymentMethod = '',
|
|
|
- this.accountId = '',
|
|
|
|
|
this.accountName = '',
|
|
this.accountName = '',
|
|
|
- this.accountBankName = '',
|
|
|
|
|
- this.accountHolderName = '',
|
|
|
|
|
this.remark = '',
|
|
this.remark = '',
|
|
|
this.purpose = '',
|
|
this.purpose = '',
|
|
|
this.status = 'draft',
|
|
this.status = 'draft',
|
|
@@ -87,14 +76,13 @@ class ExpenseModel {
|
|
|
this.isInvoiceVerified = false,
|
|
this.isInvoiceVerified = false,
|
|
|
this.isTaxIdMatched = false,
|
|
this.isTaxIdMatched = false,
|
|
|
this.isCategoryCompliant = false,
|
|
this.isCategoryCompliant = false,
|
|
|
- this.sourceApplicationId = '',
|
|
|
|
|
- this.sourceImportAmount = 0.0,
|
|
|
|
|
this.bankName = '',
|
|
this.bankName = '',
|
|
|
this.bankAccount = '',
|
|
this.bankAccount = '',
|
|
|
this.bankTransferNo = '',
|
|
this.bankTransferNo = '',
|
|
|
this.approvalInstanceId = '',
|
|
this.approvalInstanceId = '',
|
|
|
this.applicationDate,
|
|
this.applicationDate,
|
|
|
- this.invoiceImages = const [],
|
|
|
|
|
|
|
+ this.currencyCode = 'CNY',
|
|
|
|
|
+ this.approvedAmount = 0.0,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
factory ExpenseModel.fromJson(Map<String, dynamic> json) {
|
|
factory ExpenseModel.fromJson(Map<String, dynamic> json) {
|
|
@@ -114,8 +102,6 @@ class ExpenseModel {
|
|
|
projectName: json['projectName'] as String? ?? '',
|
|
projectName: json['projectName'] as String? ?? '',
|
|
|
budgetSubjectId: json['budgetSubjectId'] as String? ?? '',
|
|
budgetSubjectId: json['budgetSubjectId'] as String? ?? '',
|
|
|
budgetSubjectName: json['budgetSubjectName'] as String? ?? '',
|
|
budgetSubjectName: json['budgetSubjectName'] as String? ?? '',
|
|
|
- loanWriteoffAmount:
|
|
|
|
|
- (json['loanWriteoffAmount'] as num?)?.toDouble() ?? 0.0,
|
|
|
|
|
attachments:
|
|
attachments:
|
|
|
(json['attachments'] as List<dynamic>?)
|
|
(json['attachments'] as List<dynamic>?)
|
|
|
?.map((e) => e as String)
|
|
?.map((e) => e as String)
|
|
@@ -124,10 +110,7 @@ class ExpenseModel {
|
|
|
paymentStatus: json['paymentStatus'] as String? ?? 'unpaid',
|
|
paymentStatus: json['paymentStatus'] as String? ?? 'unpaid',
|
|
|
voucherNo: json['voucherNo'] as String? ?? '',
|
|
voucherNo: json['voucherNo'] as String? ?? '',
|
|
|
paymentMethod: json['paymentMethod'] as String? ?? '',
|
|
paymentMethod: json['paymentMethod'] as String? ?? '',
|
|
|
- accountId: json['accountId'] as String? ?? '',
|
|
|
|
|
accountName: json['accountName'] as String? ?? '',
|
|
accountName: json['accountName'] as String? ?? '',
|
|
|
- accountBankName: json['accountBankName'] as String? ?? '',
|
|
|
|
|
- accountHolderName: json['accountHolderName'] as String? ?? '',
|
|
|
|
|
remark: json['remark'] as String? ?? '',
|
|
remark: json['remark'] as String? ?? '',
|
|
|
purpose: json['purpose'] as String? ?? '',
|
|
purpose: json['purpose'] as String? ?? '',
|
|
|
status: json['status'] as String? ?? 'draft',
|
|
status: json['status'] as String? ?? 'draft',
|
|
@@ -154,9 +137,6 @@ class ExpenseModel {
|
|
|
isInvoiceVerified: json['isInvoiceVerified'] as bool? ?? false,
|
|
isInvoiceVerified: json['isInvoiceVerified'] as bool? ?? false,
|
|
|
isTaxIdMatched: json['isTaxIdMatched'] as bool? ?? false,
|
|
isTaxIdMatched: json['isTaxIdMatched'] as bool? ?? false,
|
|
|
isCategoryCompliant: json['isCategoryCompliant'] as bool? ?? false,
|
|
isCategoryCompliant: json['isCategoryCompliant'] as bool? ?? false,
|
|
|
- sourceApplicationId: json['sourceApplicationId'] as String? ?? '',
|
|
|
|
|
- sourceImportAmount:
|
|
|
|
|
- (json['sourceImportAmount'] as num?)?.toDouble() ?? 0.0,
|
|
|
|
|
bankName: json['bankName'] as String? ?? '',
|
|
bankName: json['bankName'] as String? ?? '',
|
|
|
bankAccount: json['bankAccount'] as String? ?? '',
|
|
bankAccount: json['bankAccount'] as String? ?? '',
|
|
|
bankTransferNo: json['bankTransferNo'] as String? ?? '',
|
|
bankTransferNo: json['bankTransferNo'] as String? ?? '',
|
|
@@ -164,11 +144,8 @@ class ExpenseModel {
|
|
|
applicationDate: json['applicationDate'] != null
|
|
applicationDate: json['applicationDate'] != null
|
|
|
? DateTime.parse(json['applicationDate'] as String)
|
|
? DateTime.parse(json['applicationDate'] as String)
|
|
|
: null,
|
|
: null,
|
|
|
- invoiceImages:
|
|
|
|
|
- (json['invoiceImages'] as List<dynamic>?)
|
|
|
|
|
- ?.map((e) => e as String)
|
|
|
|
|
- .toList() ??
|
|
|
|
|
- [],
|
|
|
|
|
|
|
+ currencyCode: json['currencyCode'] as String? ?? 'CNY',
|
|
|
|
|
+ approvedAmount: (json['approvedAmount'] as num?)?.toDouble() ?? 0.0,
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -188,15 +165,11 @@ class ExpenseModel {
|
|
|
'projectName': projectName,
|
|
'projectName': projectName,
|
|
|
'budgetSubjectId': budgetSubjectId,
|
|
'budgetSubjectId': budgetSubjectId,
|
|
|
'budgetSubjectName': budgetSubjectName,
|
|
'budgetSubjectName': budgetSubjectName,
|
|
|
- 'loanWriteoffAmount': loanWriteoffAmount,
|
|
|
|
|
'attachments': attachments,
|
|
'attachments': attachments,
|
|
|
'paymentStatus': paymentStatus,
|
|
'paymentStatus': paymentStatus,
|
|
|
'voucherNo': voucherNo,
|
|
'voucherNo': voucherNo,
|
|
|
'paymentMethod': paymentMethod,
|
|
'paymentMethod': paymentMethod,
|
|
|
- 'accountId': accountId,
|
|
|
|
|
'accountName': accountName,
|
|
'accountName': accountName,
|
|
|
- 'accountBankName': accountBankName,
|
|
|
|
|
- 'accountHolderName': accountHolderName,
|
|
|
|
|
'remark': remark,
|
|
'remark': remark,
|
|
|
'purpose': purpose,
|
|
'purpose': purpose,
|
|
|
'status': status,
|
|
'status': status,
|
|
@@ -209,14 +182,13 @@ class ExpenseModel {
|
|
|
'isInvoiceVerified': isInvoiceVerified,
|
|
'isInvoiceVerified': isInvoiceVerified,
|
|
|
'isTaxIdMatched': isTaxIdMatched,
|
|
'isTaxIdMatched': isTaxIdMatched,
|
|
|
'isCategoryCompliant': isCategoryCompliant,
|
|
'isCategoryCompliant': isCategoryCompliant,
|
|
|
- 'sourceApplicationId': sourceApplicationId,
|
|
|
|
|
- 'sourceImportAmount': sourceImportAmount,
|
|
|
|
|
'bankName': bankName,
|
|
'bankName': bankName,
|
|
|
'bankAccount': bankAccount,
|
|
'bankAccount': bankAccount,
|
|
|
'bankTransferNo': bankTransferNo,
|
|
'bankTransferNo': bankTransferNo,
|
|
|
'approvalInstanceId': approvalInstanceId,
|
|
'approvalInstanceId': approvalInstanceId,
|
|
|
'applicationDate': applicationDate?.toIso8601String(),
|
|
'applicationDate': applicationDate?.toIso8601String(),
|
|
|
- 'invoiceImages': invoiceImages,
|
|
|
|
|
|
|
+ 'currencyCode': currencyCode,
|
|
|
|
|
+ 'approvedAmount': approvedAmount,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
ExpenseModel copyWith({
|
|
ExpenseModel copyWith({
|
|
@@ -235,15 +207,11 @@ class ExpenseModel {
|
|
|
String? projectName,
|
|
String? projectName,
|
|
|
String? budgetSubjectId,
|
|
String? budgetSubjectId,
|
|
|
String? budgetSubjectName,
|
|
String? budgetSubjectName,
|
|
|
- double? loanWriteoffAmount,
|
|
|
|
|
List<String>? attachments,
|
|
List<String>? attachments,
|
|
|
String? paymentStatus,
|
|
String? paymentStatus,
|
|
|
String? voucherNo,
|
|
String? voucherNo,
|
|
|
String? paymentMethod,
|
|
String? paymentMethod,
|
|
|
- String? accountId,
|
|
|
|
|
String? accountName,
|
|
String? accountName,
|
|
|
- String? accountBankName,
|
|
|
|
|
- String? accountHolderName,
|
|
|
|
|
String? remark,
|
|
String? remark,
|
|
|
String? purpose,
|
|
String? purpose,
|
|
|
String? status,
|
|
String? status,
|
|
@@ -256,14 +224,13 @@ class ExpenseModel {
|
|
|
bool? isInvoiceVerified,
|
|
bool? isInvoiceVerified,
|
|
|
bool? isTaxIdMatched,
|
|
bool? isTaxIdMatched,
|
|
|
bool? isCategoryCompliant,
|
|
bool? isCategoryCompliant,
|
|
|
- String? sourceApplicationId,
|
|
|
|
|
- double? sourceImportAmount,
|
|
|
|
|
String? bankName,
|
|
String? bankName,
|
|
|
String? bankAccount,
|
|
String? bankAccount,
|
|
|
String? bankTransferNo,
|
|
String? bankTransferNo,
|
|
|
String? approvalInstanceId,
|
|
String? approvalInstanceId,
|
|
|
DateTime? applicationDate,
|
|
DateTime? applicationDate,
|
|
|
- List<String>? invoiceImages,
|
|
|
|
|
|
|
+ String? currencyCode,
|
|
|
|
|
+ double? approvedAmount,
|
|
|
}) {
|
|
}) {
|
|
|
return ExpenseModel(
|
|
return ExpenseModel(
|
|
|
id: id ?? this.id,
|
|
id: id ?? this.id,
|
|
@@ -281,15 +248,11 @@ class ExpenseModel {
|
|
|
projectName: projectName ?? this.projectName,
|
|
projectName: projectName ?? this.projectName,
|
|
|
budgetSubjectId: budgetSubjectId ?? this.budgetSubjectId,
|
|
budgetSubjectId: budgetSubjectId ?? this.budgetSubjectId,
|
|
|
budgetSubjectName: budgetSubjectName ?? this.budgetSubjectName,
|
|
budgetSubjectName: budgetSubjectName ?? this.budgetSubjectName,
|
|
|
- loanWriteoffAmount: loanWriteoffAmount ?? this.loanWriteoffAmount,
|
|
|
|
|
attachments: attachments ?? this.attachments,
|
|
attachments: attachments ?? this.attachments,
|
|
|
paymentStatus: paymentStatus ?? this.paymentStatus,
|
|
paymentStatus: paymentStatus ?? this.paymentStatus,
|
|
|
voucherNo: voucherNo ?? this.voucherNo,
|
|
voucherNo: voucherNo ?? this.voucherNo,
|
|
|
paymentMethod: paymentMethod ?? this.paymentMethod,
|
|
paymentMethod: paymentMethod ?? this.paymentMethod,
|
|
|
- accountId: accountId ?? this.accountId,
|
|
|
|
|
accountName: accountName ?? this.accountName,
|
|
accountName: accountName ?? this.accountName,
|
|
|
- accountBankName: accountBankName ?? this.accountBankName,
|
|
|
|
|
- accountHolderName: accountHolderName ?? this.accountHolderName,
|
|
|
|
|
remark: remark ?? this.remark,
|
|
remark: remark ?? this.remark,
|
|
|
purpose: purpose ?? this.purpose,
|
|
purpose: purpose ?? this.purpose,
|
|
|
status: status ?? this.status,
|
|
status: status ?? this.status,
|
|
@@ -302,14 +265,13 @@ class ExpenseModel {
|
|
|
isInvoiceVerified: isInvoiceVerified ?? this.isInvoiceVerified,
|
|
isInvoiceVerified: isInvoiceVerified ?? this.isInvoiceVerified,
|
|
|
isTaxIdMatched: isTaxIdMatched ?? this.isTaxIdMatched,
|
|
isTaxIdMatched: isTaxIdMatched ?? this.isTaxIdMatched,
|
|
|
isCategoryCompliant: isCategoryCompliant ?? this.isCategoryCompliant,
|
|
isCategoryCompliant: isCategoryCompliant ?? this.isCategoryCompliant,
|
|
|
- sourceApplicationId: sourceApplicationId ?? this.sourceApplicationId,
|
|
|
|
|
- sourceImportAmount: sourceImportAmount ?? this.sourceImportAmount,
|
|
|
|
|
bankName: bankName ?? this.bankName,
|
|
bankName: bankName ?? this.bankName,
|
|
|
bankAccount: bankAccount ?? this.bankAccount,
|
|
bankAccount: bankAccount ?? this.bankAccount,
|
|
|
bankTransferNo: bankTransferNo ?? this.bankTransferNo,
|
|
bankTransferNo: bankTransferNo ?? this.bankTransferNo,
|
|
|
approvalInstanceId: approvalInstanceId ?? this.approvalInstanceId,
|
|
approvalInstanceId: approvalInstanceId ?? this.approvalInstanceId,
|
|
|
applicationDate: applicationDate ?? this.applicationDate,
|
|
applicationDate: applicationDate ?? this.applicationDate,
|
|
|
- invoiceImages: invoiceImages ?? this.invoiceImages,
|
|
|
|
|
|
|
+ currencyCode: currencyCode ?? this.currencyCode,
|
|
|
|
|
+ approvedAmount: approvedAmount ?? this.approvedAmount,
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -333,6 +295,12 @@ class ExpenseDetailModel {
|
|
|
final double taxRate;
|
|
final double taxRate;
|
|
|
final String remark;
|
|
final String remark;
|
|
|
final List<String> attachments;
|
|
final List<String> attachments;
|
|
|
|
|
+ final double approvedAmount;
|
|
|
|
|
+ final String customerVendorName;
|
|
|
|
|
+ final String projectCode;
|
|
|
|
|
+ final String subjectCode;
|
|
|
|
|
+ final String projectCategory;
|
|
|
|
|
+ final double offsetAmount;
|
|
|
final int sortOrder;
|
|
final int sortOrder;
|
|
|
|
|
|
|
|
const ExpenseDetailModel({
|
|
const ExpenseDetailModel({
|
|
@@ -354,6 +322,12 @@ class ExpenseDetailModel {
|
|
|
this.taxRate = 0.0,
|
|
this.taxRate = 0.0,
|
|
|
this.remark = '',
|
|
this.remark = '',
|
|
|
this.attachments = const [],
|
|
this.attachments = const [],
|
|
|
|
|
+ this.approvedAmount = 0.0,
|
|
|
|
|
+ this.customerVendorName = '',
|
|
|
|
|
+ this.projectCode = '',
|
|
|
|
|
+ this.subjectCode = '',
|
|
|
|
|
+ this.projectCategory = '',
|
|
|
|
|
+ this.offsetAmount = 0.0,
|
|
|
this.sortOrder = 1,
|
|
this.sortOrder = 1,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -381,6 +355,12 @@ class ExpenseDetailModel {
|
|
|
?.map((e) => e as String)
|
|
?.map((e) => e as String)
|
|
|
.toList() ??
|
|
.toList() ??
|
|
|
[],
|
|
[],
|
|
|
|
|
+ approvedAmount: (json['approvedAmount'] as num?)?.toDouble() ?? 0.0,
|
|
|
|
|
+ customerVendorName: json['customerVendorName'] as String? ?? '',
|
|
|
|
|
+ projectCode: json['projectCode'] as String? ?? '',
|
|
|
|
|
+ subjectCode: json['subjectCode'] as String? ?? '',
|
|
|
|
|
+ projectCategory: json['projectCategory'] as String? ?? '',
|
|
|
|
|
+ offsetAmount: (json['offsetAmount'] as num?)?.toDouble() ?? 0.0,
|
|
|
sortOrder: json['sortOrder'] as int? ?? 1,
|
|
sortOrder: json['sortOrder'] as int? ?? 1,
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -404,6 +384,68 @@ class ExpenseDetailModel {
|
|
|
'taxRate': taxRate,
|
|
'taxRate': taxRate,
|
|
|
'remark': remark,
|
|
'remark': remark,
|
|
|
'attachments': attachments,
|
|
'attachments': attachments,
|
|
|
|
|
+ 'approvedAmount': approvedAmount,
|
|
|
|
|
+ 'customerVendorName': customerVendorName,
|
|
|
|
|
+ 'projectCode': projectCode,
|
|
|
|
|
+ 'subjectCode': subjectCode,
|
|
|
|
|
+ 'projectCategory': projectCategory,
|
|
|
|
|
+ 'offsetAmount': offsetAmount,
|
|
|
'sortOrder': sortOrder,
|
|
'sortOrder': sortOrder,
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ ExpenseDetailModel copyWith({
|
|
|
|
|
+ String? id,
|
|
|
|
|
+ String? expenseId,
|
|
|
|
|
+ DateTime? expenseDate,
|
|
|
|
|
+ String? expenseType,
|
|
|
|
|
+ String? expenseDesc,
|
|
|
|
|
+ double? amount,
|
|
|
|
|
+ double? taxAmount,
|
|
|
|
|
+ double? totalAmount,
|
|
|
|
|
+ double? baseAmount,
|
|
|
|
|
+ String? currency,
|
|
|
|
|
+ double? exchangeRate,
|
|
|
|
|
+ String? invoiceNo,
|
|
|
|
|
+ String? invoiceCode,
|
|
|
|
|
+ String? invoiceType,
|
|
|
|
|
+ bool? isDeductible,
|
|
|
|
|
+ double? taxRate,
|
|
|
|
|
+ String? remark,
|
|
|
|
|
+ List<String>? attachments,
|
|
|
|
|
+ double? approvedAmount,
|
|
|
|
|
+ String? customerVendorName,
|
|
|
|
|
+ String? projectCode,
|
|
|
|
|
+ String? subjectCode,
|
|
|
|
|
+ String? projectCategory,
|
|
|
|
|
+ double? offsetAmount,
|
|
|
|
|
+ int? sortOrder,
|
|
|
|
|
+ }) {
|
|
|
|
|
+ return ExpenseDetailModel(
|
|
|
|
|
+ id: id ?? this.id,
|
|
|
|
|
+ expenseId: expenseId ?? this.expenseId,
|
|
|
|
|
+ expenseDate: expenseDate ?? this.expenseDate,
|
|
|
|
|
+ expenseType: expenseType ?? this.expenseType,
|
|
|
|
|
+ expenseDesc: expenseDesc ?? this.expenseDesc,
|
|
|
|
|
+ amount: amount ?? this.amount,
|
|
|
|
|
+ taxAmount: taxAmount ?? this.taxAmount,
|
|
|
|
|
+ totalAmount: totalAmount ?? this.totalAmount,
|
|
|
|
|
+ baseAmount: baseAmount ?? this.baseAmount,
|
|
|
|
|
+ currency: currency ?? this.currency,
|
|
|
|
|
+ exchangeRate: exchangeRate ?? this.exchangeRate,
|
|
|
|
|
+ invoiceNo: invoiceNo ?? this.invoiceNo,
|
|
|
|
|
+ invoiceCode: invoiceCode ?? this.invoiceCode,
|
|
|
|
|
+ invoiceType: invoiceType ?? this.invoiceType,
|
|
|
|
|
+ isDeductible: isDeductible ?? this.isDeductible,
|
|
|
|
|
+ taxRate: taxRate ?? this.taxRate,
|
|
|
|
|
+ remark: remark ?? this.remark,
|
|
|
|
|
+ attachments: attachments ?? this.attachments,
|
|
|
|
|
+ approvedAmount: approvedAmount ?? this.approvedAmount,
|
|
|
|
|
+ customerVendorName: customerVendorName ?? this.customerVendorName,
|
|
|
|
|
+ projectCode: projectCode ?? this.projectCode,
|
|
|
|
|
+ subjectCode: subjectCode ?? this.subjectCode,
|
|
|
|
|
+ projectCategory: projectCategory ?? this.projectCategory,
|
|
|
|
|
+ offsetAmount: offsetAmount ?? this.offsetAmount,
|
|
|
|
|
+ sortOrder: sortOrder ?? this.sortOrder,
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|