顧客の請求書テーブルを作成しています。手数料を送ってもらうこともあれば、手数料(口座残高)を送ってもらうこともあります。この状況で請求書テーブルを設計するにはどうすればよいですか?
私はこの解決策を思いついた、これが正しいかどうかわからない、または代替方法は何ですか?
tbl_invoice
- invoice_id (PK)
- order_id (FK)
- invoice_date
- amount (copy the price from tbl_order.total table)
- status (Invoice Sent, Cancelled, Amount Received, Amount Sent)
tbl_Payments
- invoice_id (FK)
- amount_received (recieved commission fees from customer)
- amount_sent (sent fees to customer)
- date_received
- date_sent
tbl_invoice.amountが-30.00の場合、顧客が料金を送ってくれることを意味します。
tbl_invoice.amountが30.00の場合、料金をお客様に送付します。
tbl_invoice.amountフィールドが必要ですか?
私のテーブルを再設計できれば、それは素晴らしいことです。