0

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

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

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

4

0 回答 0