顧客用の請求表を作成しています。彼らは私にコミッション料を送る必要がある場合もあれば、私が手数料(口座残高)を送る場合もあります。この状況で請求書テーブルを設計するにはどうすればよいですか?
私はこの解決策を思いつきましたが、これが正しいかどうか、または別の方法は何ですか?
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 フィールドは必要ですか?