New functions logic
User create physical trades (purchase or sale) and save
go to settlement and input settlement price and deal
good to update actual price but can only do it directly in phy trades, this will affect the invoice/payment amount
go to stock management and user can choose to apply for stock execution in the application page (which requires approval from OA) or in the direct (pre exe) page which does not require approval from OA. the first table in both pages are the same (will auto be created once settlement for each trades are done) for user to choose either method
once approved in OA, the approved stock will appear in stock details
if go through direct in pre exe page, user need to either execute in or out for the stock to appear in stock details
the qty and amount calculated in stock details differ if the stock goes through application or direct. if go through application but not approved yet, the qty and amt will not be calculated in the qty and amt in the stock details. only when approved then the qty and amt will be added in the stock details.
once the details are in stock, then the contracts will appear in the first table of both payment and invoice page.
note that purchase contracts will mean purchasing from other parties so this will result in receiving invoice; sale contracts mean selling to other parties so we will issue invoice instead. so depending on the status as purchase or sale the data will appear in the receive invoice and issue invoice respectively but note that only issue invoice will have data appear automatically, for receive invoice, user has to input a new row in the unissued page and add the purchase contract no, which when saved will appear in the issued invoice page.
similarly in payment page, there are approval and completed pages, only when payments are approved then they will appear in psl ledger. similarly, user will need to add new row or upload their bank statements according to the format (for now only map to ht format) to determine the amount paid as well as received (purchase is positive, sale is negative), so user will assign the contract no accordingly to confirm the amount paid for each sale contract
similar in invoice page, there are approval and completed page, only when invoices are issued then they will appear in the issued invoice page.
there is only 1 page for received invoice which is used to track invoice received for purchase contracts, and user will need to assign the respective contract no to complete the transaction
all of the qty and amt will be reflected in the phy trade page for each contract