iv_and/invoice.dart
joe a8242c2a7e
Some checks are pending
Flutter CI / build (push) Waiting to run
feat: Invoiceアプリの基本機能を追加
Co-authored-by: aider (ollama_chat/7b) <aider@aider.chat>
2026-01-16 09:35:27 +09:00

39 lines
844 B
Dart

class Invoice {
final int? id;
final int customerId;
final String date;
final double total;
final double tax;
final double discountTotal;
Invoice({
this.id,
required this.customerId,
required this.date,
required this.total,
required this.tax,
required this.discountTotal,
});
Map<String, dynamic> toMap() {
return {
'id': id,
'customer_id': customerId,
'date': date,
'total': total,
'tax': tax,
'discount_total': discountTotal,
};
}
factory Invoice.fromMap(Map<String, dynamic> map) {
return Invoice(
id: map['id'] as int?,
customerId: map['customer_id'] as int,
date: map['date'] as String,
total: map['total'] as double,
tax: map['tax'] as double,
discountTotal: map['discount_total'] as double,
);
}
}