发票表:发送费用和收取费用

时间:2011-06-13 10:08:14

标签: mysql sql database database-design invoice

我正在为客户创建发票表。有时候,他们必须向我发送佣金,或者有时我会向他们发送费用(账户余额)。在这种情况下如何设计发票表?

我想出了这个解决方案,我不确定这是否正确或者替代方式是什么?

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字段吗?

0 个答案:

没有答案