You will need to design tbl_invoice, tbl_order tables (database) and quick working demo of invoice functionality only. An invoice can be linked to one or more orders (In other word, an invoice contain multiple order_id).
- order_id (PK)
- shop_id (FK)
- user_id (FK)
- invoice_id (FK)
Order will be stored in the tbl_order. You need to create invoice table that are linked to the tbl_order. Invoice table should contain fields that if I have paid to shop or received commission from the shop and other useful fields. If I make any change in the invoice, it should be logged like a history.
It should generate an invoices for every 2 weeks automatically. Create a working demo of invoice functionality in PHP. Whe updating [url removed, login to view] to 1 (completed). Then it should insert invoice date in the tbl_invoice table only if current month not exist. Example: The invoice should include all the orders (depending on Shop ID) between 01 to 15 and the next invoice 16 to end date of the month.
Note: Im not asking you to create shopping cart, adding product, adding order code. Just invoice functionality.
If there is other better solution to this then let me know please?
Let me know if you have any questions.