skip to Main Content

xplan xmerge

Generic filters
Exact matches only
Filter by Custom Post Type

Try these: client detailstasks syntaxsuperannuation


Standard Xplan element to store all details regarding loans and other debts.  The xmerge syntax here will help you output these details into your templates and reports:

Setec Astronomy

<:for item in $client.liability:>
Type: <:=item.type:>
Package: <:=item.package_name:>
Outstanding Balance: <:=item.amount:>


All the fields below can be used in the loop above:




Type type_group <:=item.type_group:>
Sub Type type <:=item.type:>
Package / Product package_name <:=item.package_name:>
Policy Number policy_number <:=item.policy_number:>
Outstanding Balance amount <:=item.amount:>
Status status <:=item.status:>
Account Number account_client_number <:=item.account_client_number:>
Supplier supplier <:=item.supplier:>
Institution inst <:=item.inst:>
Under Advice under_advice <:=item.under_advice:>
Type of Business liability_business_type <:=item.liability_business_type:>
Lenders Reference Number lenders_reference_number <:=item.lenders_reference_number:>
Owner owner <:=item.owner:>
Owner String owner_string <:=item.owner_string:>
Owner List^ owner_list <:=item.owner_list:>
Linked Data    
Linked Portfolio Accounts^ linked_portfolio_accounts <:=item.linked_portfolio_accounts:>
Linked Bank Account values_last_updated <:=item.linked_bank_account:>
Linked Objectives linked_objective_desc <:=item.linked_objective_desc:>
Linked Asset^ linked_asset_link <:=item.asset_link:>
Original Balance original_amount <:=item.original_amount:>
Application Limit loan_application_amount <:=item.loan_application_amount:>
Limit limit <:=item.limit:>
Principal Repaid loan_principal_repaid <:=item.loan_principal_repaid:>
Contract Purchase Price contract_purchase_price <:=item.contract_purchase_price:>
Lender Valuation purchase_price <:=item.purchase_price:>
Original Equity Value original_equity_value <:=item.original_equity_value:>
Deductible deductible <:=item.deductible:>
Residual Value residual <:=item.residual:>
LVR lvr <:=item.lvr:>
First Home Buyers first_home_buyers_grant <:=item.first_home_buyers_grant:>
Split Loan split_loan <:=item.split_loan:>
Valuation Date valuation_date <:=item.valuation_date:>
Values Last Updated values_last_updated <:=item.values_last_updated:>
Last Updated By last_updated_by <:=item.last_updated_by:>
Key Dates    
Application Date loan_application_date <:=item.loan_application_date:>
Approved Date loan_approved_date <:=item.loan_approved_date:>
Finance Clause Date finance_date <:=item.finance_date:>
Settlement Date loan_settlement_due_date <:=item.loan_settlement_due_date:>
Loan Discharged Date loan_discharged_date <:=item.loan_discharged_date:>
Loan Features loan_features <:=item.loan_features:>
Representative* profadviser_link <:=item.profadviser_link:>
Conveyancer* conveyancer_entityid <:=item.conveyancer_entityid:>
Solicitor* solicitor_entityid <:=item.solicitor_entityid:>
Estate Agent* real_estate_agent_entityid <:=item.real_estate_agent_entityid:>
Mortgage Consultant* mortgage_consultant_entityid <:=item.mortgage_consultant_entityid:>
Advice Fee advice_fee <:=item.advice_fee:>
Referral Fee referral_fee <:=item.referral_fee:>
New Commission Rate upfront_commission <:=item.upfront_commission:>
New Commission Amount upfront_commission_amount <:=item.upfront_commission_amount:>
Ongoing Commission Rate trail_commission <:=item.trail_commission:>
Ongoing Commission Amoun trail_commission_amount <:=item.trail_commission_amount:>
Interest Rate Type rate_type <:=item.rate_type:>
Interest Rate pa rate <:=item.rate:>
Interest Only Term io_term_amount <:=item.io_term_amount:>
..Start Date settlement <:=item.settlement:>
..End Date expire_date <:=item.expire_date:>
Fixed Rate Term fixed_rate_term_amount <:=item.fixed_rate_term_amount:>
Fixed Rate Term Type fixed_rate_term_type <:=item.fixed_rate_term_type:>
Loan Term loan_term_amount <:=item.loan_term_amount:>
Repayment Amount repayment <:=item.repayment:>
Future Repayment Amount future_amount <:=item.future_amount:>
Repayment Frequency frequency <:=item.frequency:>
Repayment Type repayment_type <:=item.repayment_type:>
Mortgage Insurance    
Mortgage Insurance Premium - <:=item.lenders_mortgage_insur_premium:>
Mortgage Insurance Frequency - <:=item.lenders_mortgage_insur_freq:>
Mortgage Insurance Provider - <:=item.lenders_mortgage_insur_provider:>
Guarantors guarantor <:=item.guarantor:>
Security security <>
Security Value ($) security_value <:=item.security_value:>
Comments comment <:=item.comment:>
Adviser Comments adviser_comments <:=item.adviser_comments:>

^ More information on these items is available below or in the see also section
* add .value to the end of these to extract the entity_id

Owner Breakdown

Further breakdown the owner information and splits:

Setec Astronomy

<:for item in $client.liability:>
<:for owner in item.owner_list:>
Name: <>
Entity ID: <:=owner.entity_id:>
Amount: <:=owner.amount:>
Percent: <:=owner.percent:>

Further owner details

Assets can be linked to other clients and related entities (not just client and partner) and by using the $entity() function and the owner entity id we can access all the details of that owner:

Setec Astronomy

<:for item in $client.liability:>
<:for owner in item.owner_list:>
First Name: <:=$entity(int(owner.entity_id)).first_name:>
Last Name: <:=$entity(int(owner.entity_id)).first_name:>
Preferred Phone: <:=$entity(int(owner.entity_id)).preferred_phone:>

Checking for liabilities

Using the len() function is the simplest way to see if any liabilities exist:

Setec Astronomy

<:if len($client.liability):>
<:for item in $client.liability:>
Supplier: <:=item.supplier:>
Outstanding Value ($): <:=item.amount:>
You have no recorded liabilities 🙂

Multi conditional filtering

An alternative way, which is good for when you want to check multiple conditions or logic:

Setec Astronomy

<:if len([x for x in $client.liability if str(x.status) in [‘Current’] and floatify(x.amount.value)>0]):>
<:for item in [x for x in $client.liability if str(x.status) in [‘Current’] and floatify(x.amount.value)>0]:>
Supplier: <:=item.supplier:>
Outstanding Value ($): <:=item.amount:>
You have no existing liabilities with an outstanding balance

Filtering Liabilities

Filter to Type & Status

You can easily add or remove multiple .filters() to the code as needed.  In the below example it will look for long-term liabilities with a status of current and that belong to the client

Setec Astronomy

<:if len($client.liability.filter(‘type_group=2’).filter(‘status=Current’).filter(‘owner=Client’)):>
<:for item in $client.liability.filter(‘type_group=2’).filter(‘status=Current’).filter(‘owner=Client’):>
Type: <:=item.type:>
Outstanding Value ($): <:=item.amount:>

Multi conditional filtering

This style syntax is useful for when working with multiple conditions and logic patterns:

Setec Astronomy

<:for item in [x for x in $client.liability if str(x.type_group) == “Long Term” and str(x.status) == “Current” and float(x.amount.value)>0]:>
Type: <:=item.type:>
Outstanding Value ($): <:=item.amount:>

Sorting Liabilities

Setec Astronomy

<:for item in $client.liability.sort(‘amount’):>
Description: <:=item.desc:>
Current Value: <:=item.amount:>

Reverse Sort

Setec Astronomy

<:for item in $client.liability.sort(‘-amount’):>
Description: <:=item.desc:>
Current Value: <:=item.amount:>


Simple Sum method

Setec Astronomy

Simple: <:=$client.liability.sum(‘amount’):>
Raw: <:=$client.liability.filter(‘status=Current’).sum(‘amount’)>

Entity Sum Function

Setec Astronomy

Raw: <:=sum([floatify(debt.amount) for debt in $client.liability]):>
$<:=currency(sum([floatify(debt.amount.value) for debt in $client.liability]),0):>

Entity Sum Function with conditions

Setec Astronomy

Raw: <:=sum([floatify(debt.amount) for debt in $client.liability if str(debt.owner) in [‘Client, Joint’]]):>
$<:=currency(sum([floatify(debt.amount.value) for debt in $client.liability if str(debt.owner) in [‘Client, Joint’]]),0):>

See also

Back To Top