您可以对任何类型的产品订单系统使用相同的模式:
客户方针对一个或多个目录项向供应商方下达销售订单,其中之一可能是销售协议,例如软件许可。
供应商方在收单地址一次或多次向收单方(可能与客户方相同)开具发票(要求付款) 。收单方针对该特定发票进行一次或多次付款,直到发票被支付。
付款不一定与销售订单项目的装运或交付一致。您可以在支付发票之前或之后运送销售订单项目。
销售订单项目通过收货地址(可以是 IP 地址或电子邮件地址)运送到收货方,并有望送达,此时您会产生收入。
这应该让你开始:
PARTY
id
type {organization, individual, automated_agent}
name
...
ADDRESS
id
type {email, web, facility, telephone}
...
SALES_ORDER
id
order_date
customer_id -> party
vendor_id -> party
bill_to_id -> party
bill_to_address_id -> address
CATALOG_ITEM
id
type {good, service, agreement}
...
SALES_ORDER_ITEM
id
sales_order_id -> sales_order
catalog_item_id -> catalog_item
ship_to_id -> party
ship_to_address_id -> address
price
quantity
PAYMENT_METHOD
id
name
# whether payment has a key to invoice depends on whether you allow cross-invoice payments and/or partial payments
PAYMENT
id
payment_date
payer_id -> party
payee_id -> party
amount
method -> payment_method
省略:
shipment_request
shipment
delivery
invoice
invoice_payment