If the invoice.amount is 50.00, it mean I need to send the company the fees. If the invoice.amount is -50.00 (minus), it mean company will need to send me the fees amount. From the result example invoice.amount is 55.00 because it has been calculated from pany_id = 2 table Invoices will be generated every 2 weeks. This is where I am quite stuck on invoice tables design. | id | company_id | invoice_no | invoice_date | amount | status_id | Invoice table mysql> select * from invoice List of products what customers have ordered. | id | order_id | product_id | product_name | cost | Orders_products table mysql> select * from orders_products I know the orders fields is not enough, just simplified for you. Two customers have ordered the products from Company B ( pany_id = 2). | id | user_id | company_id | total_cost | order_date | status_id | Orders table mysql> select * from orders Here is the database design I have came up with:Ĭompany table mysql> select * from company Ĭustomers can select a company from my website. invoice status (Invoice Sent, Cancelled, Amount Received, Amount Sent).did I receive the full amount (if not, what do I need to update on the Db?).how much amount did I sent to the company.how much amount has been received from the company.when did I sent the amount to the company.when the company have sent me the amount.I need to track the invoices with the following: Sometime company will have to send me the fees or sometime I send them the fees ( invoice.amount) I am trying to figure it out how to design reasonable invoices tracking. The invoice table calculate the total cost of the orders from orders table. There are list of customers orders in the orders table and it also indicate which company it belong to ( pany_id) It scan through the order table and then add into 'invoice' table. Every 2 weeks, the system will generate the invoices for the companies.Ĭompany will receive an invoice on the 1st and 16th every month.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |