CustTransOpen contains one or more records for all transactions in CustTrans that are not completely settled against other transactions.
To determine whether a CustTrans record is open there are these options:
- An open CustTrans record will have a matching CustTransOpen record, as joined by the standard relation: CustTransOpen.RefRecId == CustTrans.Recid && CustTransOpen.AccountNum == CustTrans.AccountNum
- An open CustTrans record will have its AmountCur != SettleAmountCur and its AmountMst != SettleAmountMst.
- An open CustTrans record will have a null date (01\01\1900) in the Closed field.
- When 01\01\1900, the CustTrans record is open.
- When not 01\01\1900, the CustTrans record is closed on the date indicated.
A reason for separating the CustTransOpen table from CustTrans table is that is possible for custTransOpen to have multiple records for the same CustTrans table in case of Payment schedule on customer invoice. Another is that this separation means that search is faster for open transactions, or total balance of the client.
The relation between CustTransOpen and CustTrans is the RefRecId in CustTransOpen that is a foreign key to the RecId of the related CustTrans.
The invoice and the actual settle amount are referred from the table CustTransOpen (from the relation CustTrans). So these fields have the values of TableId and RecId of CustTransOpen. The field Balance01 denotes the amount that is being settled. If there is partial settlement, then this field has the value of settled amount.
Table CustTransOpen is created by method Classes/PaymSchedCalc/createCustVendTransaction according to payment schedule.