This is an archived course — no longer updated. For current documentation see the official iDempiere docs. Today we help teams migrate from Sage ERP to iDempiere open source ERP — to join the sage.erpcommons.org community, email chuck@racktrust.com. Read the full story.

Update Charge Name with Account Number Suffix

The purpose of this page is to help you update the charge name to include the account number as a suffix. Here is an example:

Custom Development (79600)

Here is the SQL. Make sure you perform this update on a test environment before applying to your production database.

update c_charge x
set name = c.name || ' (' || ev.value || ')'
from c_charge c
join C_Charge_Acct ca on c.c_charge_id = ca.c_charge_id and ca.c_acctschema_id = 1000000
join c_validcombination vc on ca.Ch_Expense_Acct = vc.c_validcombination_id
join c_elementvalue ev on vc.account_id = ev.c_elementvalue_id
where c.ad_client_id = 1000000
and x.c_charge_id = c.c_charge_id
;

Notes about the above SQL: