Input Physical Trades Data
...
Please refer to below for more information on how to input the fields. Cells highlighted in red (indicated with * below) in the table are compulsory fields and are thus necessary to input:
All columns are uneditable after saving except Contract No.
When add new row, all columns are editable except PSL ID, Main Contract No., Qty, Price, Un Payment Amount, as they will be auto filled once Contract No. is selected
PSL ID: Auto generated by system. Will be autofilled by inputs in Unassigned table
Date*: Date when payment is paid/received. Will be autofilled by inputs in Unassigned table
Contract No.: In order for contract numbers to be available for selection, you must select Company first and ensure Contract Actual Price and Contract Currency are accurate, and the corresponding contract numbers will be available in the Contract No. drop down list for selection. You can then fill in the Ledger Type (Paid to counterparty/Received from counterparty) and Amount first, followed by the other fields.Every purchase and sale contract should have its own contract number. Any contract number with 0 or close to 0 for Un Invoice Amount (un_inv_amt) or Un Payment Amount (un_payment_amt) will not appear in the drop down list as the contract has been fully settled. Will be autofilled by inputs in Unassigned table
Un Payment Amount = Contract Amount (Input in Trades table, viewable in Contract No. dropdown list)- Payment/PSL Amount (Amount column in PS Ledger table)
Main Contract No.: Will be autofilled by inputs in Unassigned table
Qty: Will be autofilled by Contract Actual Qty (if empty, will be Qty) in Trades table, once edit in Trades table, this will auto update
Price: Will be autofilled by Contract Actual Price in Trades table, once edit in Trades table, this will auto update
Company*: Entity of contract, Name of your company (can be input in Settings>Company>Company Profile page). Input is required and once done, you can then double click Contract No. from the dropdown list to select Contract No. Otherwise, you may manually input. Will be autofilled by inputs in Unassigned table
Bank: Name of beneficiary bank, MUST be set up in Accounting>Bank Details page Accounting Guide before you can select the bank name. Please note that the Company, Bank and Currency must be the same as those saved in the Accounting>Bank Details page, otherwise, Bank column will be empty and cannot be selected from dropdown list. Will be autofilled by inputs in Unassigned table
Counterparty: Name of counterparty. Input is not required as it will be auto-filled if you select Contract No. from the dropdown list. Otherwise, you may manually input. Please note that if Counterparty and Third Party are different, Counterparty will be highlighted in green. Will be autofilled by inputs in Unassigned table
Third Party: If the payment is directed towards a party different from the counterparty listed, you may input the name of third party here. Please note that if Counterparty and Third Party are different, Counterparty will be highlighted in green. Will be autofilled by inputs in Unassigned table
Ledger Type*: Will be autofilled by inputs in Unassigned table
Purchase contract - Payment paid to counterparty (Paid) - Amount is positive value for purchase contract; if positive value in Amount is input, Ledger Type automatically becomes Paid
Sale contract - Payment received from counterparty (Received) - Amount is negative value for sale contract; if negative value in Amount is input, Ledger Type automatically becomes Received
DES: Description. Will be autofilled by inputs in Unassigned table
AMOUNT*: Payment amount (paid to counterparty or received from counterparty). The amount input here will be used to recalculate Un Payment Amount immediately, which will be reflected in the Contract No. dropdown list: Un Payment Amount = Contract Amount (Input in Trades table, viewable in Contract No. dropdown list)- Payment/PSL Amount (Amount column in PS Ledger table). Will be autofilled by inputs in Unassigned table
If the amount input is negative, Ledger Type will automatically become PAID. If the amount is positive, Ledger Type will automatically become RECEIVED.
Repeat this step until Un Payment Amount is 0 (sum of all Amount columns in PS Ledger = Contract Amount) which means that the contract has been fully paid/settled, and the contract number will not be available for selection in the Contract No. dropdown list
Un Payment Amount: Refers to the amount that has not been fully paid/received yet. Will be autofilled with the contract’s Contract Amount (for the first time, subsequent times will be the latest UnPayment Amount) once Contract No. is selected from drop down list by default. Once Amount column has been input in PS Ledger table, Un Payment Amount will be updated immediately in real-time to match the value in Un Payment Amt column in PS Ledger table. PSL Amount can be more than Contract Amount as some clients may pay eg 110% (Contract Amt will be shown in red but still allowed to save)
Un Payment Amount = Contract Amount (Input in Trades table, viewable in Contract No. dropdown list)- Payment/PSL Amount (Amount column in PS Ledger table)
...
any insert or update in PSL or Invoice table, will update inv_amt or payment_amt in phy_trade table
sign is important for purchase/sale of contract and credit/debit of payment and invoice (purchase = paid = positive sign; sale = receive = negative sign)
FE need to keep un_inv_amt or un_payment_amt updated if any contract is selected before saving.
Un payment amt should = contract AMT if payment_amt is empty, as un_payment_amt = contract_amt - payment_amt
contract_amt should be contract qty x price, which should be calculated in BE when selected
In 5 conditions FE should change the un payment in dropdown list of contract (before save):
1: Assign contract no to PSL
2: change the contract no (from A to B )
3: Delete the contract no
4: delete row with contract no
5: change PSL amt with contract no
The dropdown list in Contract No. is sorted by the latest contract date(DATE in TRADES tab) at the top of the list when select contract no; the dropdown list in contract no.
In invoice table and PSL table, inv_amt and psl_amt in Database should be always positive
Ledger type is used to control whether the amt should be positive or negative; if split PSL into negative, ledger type will be RECEIVED (negative), PAID (positive).
1、dropdown list, when users choose the “Assigned(已分配) ”,table will show all PSL or invoice with contract no. When users choose “Unass,igned(未分配)”, table will show all PSL or invoice without contract no.
2、default:Unassigned,show all PSL or invoice without contract no
Hide MAIN CONTRACT NO. , QTY, PRICE, UNIT, PRICE UNIT, RATIO columns
Change chinese translation for Third party: 第三方 to 收/付款
Once saved, PSL and Invoice table cannot be edited except Contract No.
In psl, receive, issue table or window, when update amt, there is a bug due to no unit to convert, need to handle it and test update amt, qty correctly.
Row order issue; order by psl_id DESC; for table psl, receive and issue
if unpayment amt is 0, copy paste contract no should not work in ps ledger as contract no will not be available in dropdown list since already allocated finish
Group Function - User Access Management Group-level(ops) personnel are not allowed to modify or delete PSL and invoicing information imported under company-level accounts. They can only assign under the contract number or split(allocate) the records. Non-creator should only be allowed to edit following columns: ps ledgers: CONTRACT NO. REMARKS invoice: INVOICE ID CONTRACT NO. logic in FE
|
for testing:
delete row with contract_no
unassign contract_no
assign contract_no
insert new row with contract_no
update row with contract_no (update anything)
all the above actions without contract_no
...
once user clicked save button, if no response, make this button always show loading( user can’t click it again until there is response)
Click on fields to view the aggregated summary in PSL and INVOICE
...
same company
third party == counterparty
ccy == ccy
un_payment_amt is not 0
if un_payment_amt in 3rd panel has reverse sign compared to the amt in 1st panel,
once click contracts in 3rd panel, amt in 2nd panel would not be filled by un_payment_amt, but leave it empty
Final Calculation Logic:
when we do portfolio P/L calculation, we use phy_trade actual qty (otherwise qty) and actual_price (otherwise ested_price) in phy_pricing table, which means in settlement tables controlled by risk department
for contract_amt, psl, invoice, we use contract_actual_qty (qty) and contract_actual_price (provisional_price) to calculate.
BE in dropdown list in psl, invoice
FE un_inc_amt, un_payment_amt in psl, invoice table
FE contract_amt … in phy_trade table
The right logic should be: for each trade, once they key the price and qty but not yet record PSL or INVOICE for this contract, PSL AMT, INV QTY, INV AMT should be 0 and BAL AMT , UN INV QTY , UN INV AMT should not be null.
Initial BAL AMT, UN INV QTY, UN INV AMT formulas have no change
FE issue of delete contract no before save in PSL tab
...