<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.idempiere.org/w-en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sarafudheen</id>
	<title>iDempiere en - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.idempiere.org/w-en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sarafudheen"/>
	<link rel="alternate" type="text/html" href="https://wiki.idempiere.org/en/Special:Contributions/Sarafudheen"/>
	<updated>2026-05-04T04:10:23Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://wiki.idempiere.org/w-en/index.php?title=Script_Process&amp;diff=4120</id>
		<title>Script Process</title>
		<link rel="alternate" type="text/html" href="https://wiki.idempiere.org/w-en/index.php?title=Script_Process&amp;diff=4120"/>
		<updated>2010-12-21T06:10:15Z</updated>

		<summary type="html">&lt;p&gt;Sarafudheen: added breadcrumb for TOC&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|next=Process}}&lt;br /&gt;
{{Contribution|logo=Qss.jpg|name=[[User:CarlosRuiz|Carlos Ruiz]], Quality Systems &amp;amp; Solutions - QSS Ltda.|url=http://globalqss.com}}&lt;br /&gt;
[[Category:Developer documentation]]&lt;br /&gt;
[[Category:Features]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Code snippets]]&lt;br /&gt;
&lt;br /&gt;
Status: working in version &amp;gt; 3.3.1b&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create the Rule ==&lt;br /&gt;
&lt;br /&gt;
Within the script you can use:&lt;br /&gt;
* Login context variables start with G_ prefix&lt;br /&gt;
* Process Parameters for the process start with P_ prefix, for example P_Name&lt;br /&gt;
* If the parameter is a range then the parameters will be P_Name1 and P_Name2&lt;br /&gt;
And the following predefined arguments:&lt;br /&gt;
* A_Ctx - the context&lt;br /&gt;
* A_Trx - the transaction&lt;br /&gt;
* A_TrxName&lt;br /&gt;
* A_Record_ID&lt;br /&gt;
* A_AD_Client_ID&lt;br /&gt;
* A_AD_User_ID&lt;br /&gt;
* A_AD_PInstance_ID&lt;br /&gt;
* A_Table_ID&lt;br /&gt;
&lt;br /&gt;
[[Image:01_ScriptForProcess.png]]&lt;br /&gt;
&lt;br /&gt;
== Configure the Process ==&lt;br /&gt;
&lt;br /&gt;
[[Image:02_ProcessWithScript.png]]&lt;br /&gt;
&lt;br /&gt;
== Code provided for copy/paste testing ==&lt;br /&gt;
&lt;br /&gt;
On the Report &amp;amp; Process:&lt;br /&gt;
 @script:beanshell:ImportDelete&lt;br /&gt;
&lt;br /&gt;
On the Rule Search Key:&lt;br /&gt;
 beanshell:ImportDelete&lt;br /&gt;
&lt;br /&gt;
On the Rule Script:&lt;br /&gt;
 import org.compiere.model.MTable;&lt;br /&gt;
 import org.compiere.util.DB;&lt;br /&gt;
 import org.compiere.util.Msg;&lt;br /&gt;
 &lt;br /&gt;
 /* get Table Info */&lt;br /&gt;
 MTable table = new MTable (A_Ctx, P_AD_Table_ID, A_TrxName);&lt;br /&gt;
 if (table.get_ID() == 0)&lt;br /&gt;
     throw new IllegalArgumentException (&amp;quot;No AD_Table_ID=&amp;quot; + P_AD_Table_ID);&lt;br /&gt;
 String tableName = table.getTableName();&lt;br /&gt;
 if (!tableName.startsWith(&amp;quot;I&amp;quot;))&lt;br /&gt;
     throw new IllegalArgumentException (&amp;quot;Not an import table = &amp;quot; + tableName);&lt;br /&gt;
 &lt;br /&gt;
 /* Delete */&lt;br /&gt;
 String sql = &amp;quot;DELETE FROM &amp;quot; + tableName + &amp;quot; WHERE AD_Client_ID=&amp;quot; + A_AD_Client_ID;&lt;br /&gt;
 int no = DB.executeUpdate(sql, A_TrxName);&lt;br /&gt;
 A_ProcessInfo.addLog (0, null, null, &amp;quot;Deleted &amp;quot;+no+&amp;quot; rows from table &amp;quot;+tableName);&lt;br /&gt;
 result = &amp;quot;OK&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
=See Also=&lt;br /&gt;
*[[Script Callout]]&lt;br /&gt;
*[[Script ModelValidatorLogin]]&lt;br /&gt;
*[[Script_ModelValidator]]&lt;/div&gt;</summary>
		<author><name>Sarafudheen</name></author>
	</entry>
	<entry>
		<id>https://wiki.idempiere.org/w-en/index.php?title=Establish_Opening_Balances&amp;diff=8283</id>
		<title>Establish Opening Balances</title>
		<link rel="alternate" type="text/html" href="https://wiki.idempiere.org/w-en/index.php?title=Establish_Opening_Balances&amp;diff=8283"/>
		<updated>2010-10-05T03:40:43Z</updated>

		<summary type="html">&lt;p&gt;Sarafudheen: /* Change Default Bank In Transit Acount */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
When setting up your accounting you will need to establish opening balances.  The information in this page is based on the following post and https://sourceforge.net/forum/message.php?msg_id=4329875&lt;br /&gt;
&lt;br /&gt;
There are suggestions on how to make this [[Opening Balances Form|process]] much easier.&lt;br /&gt;
&lt;br /&gt;
= Process =&lt;br /&gt;
&lt;br /&gt;
== Create new Account Elements ==&lt;br /&gt;
Create new Account Element for Debtor Clearing, Creditor Clearing, Bank Clearing and Inventory Clearing. All the accounts should be Balance Sheet accounts and the account numbers can be anything. &lt;br /&gt;
&lt;br /&gt;
== Create new Product ==&lt;br /&gt;
Create Product named Opening Product in System. Setup the Product to be Sold, Purchased and Stocked. The Product can be setup to any Product Category. The Default Account for Revenue of the Product should be set to Debtor Clearing and the COGS Default Account should be set to Creditors Clearing. &lt;br /&gt;
&lt;br /&gt;
== Setup Standard Cost for Products in Product Costs Window ==&lt;br /&gt;
Create Standard Cost record for all Products and update the Current Price field for each and every Product with the closing value of the Product. &lt;br /&gt;
&lt;br /&gt;
== Change Warehouse Default Account ==&lt;br /&gt;
The Inventory Adjustment Default Account for all Warehouses and Locators should be changed to Inventory Clearing. Note down the Default Account before change.&lt;br /&gt;
&lt;br /&gt;
== Change Default Bank In Transit Acount ==&lt;br /&gt;
For one bank account that you will use during imports, set the default bank in-transit to the Debtor Clearing account.  Note down the Default Account before you make the change.&lt;br /&gt;
&lt;br /&gt;
== Obtain Closing Trial Balance ==&lt;br /&gt;
Obtain Closing Trial Balance with details for balances of Debtors, Creditors and Closing Stock amounts stated in the Trial Balance. Details should include Invoices, dates, amounts of individual Invoices and Business Partners. &lt;br /&gt;
&lt;br /&gt;
== Create new GL Journal and key-in Trial Balance ==&lt;br /&gt;
Key-in Trial Balance amounts into respective accounts in GL Journal. However, for the Debtors, Creditors, Bank in Transfer and Closing Stock amounts, select the account to be Debtor Clearing, Creditor Clearing, Bank Clearing and Inventory Clearing respectively. The accounting entries will be as follows: &lt;br /&gt;
 &lt;br /&gt;
 DR Debtors Clearing (TB Debtors Amount) &lt;br /&gt;
 DR Inventory Clearing (TB Closing Stock Amount) &lt;br /&gt;
   CR Creditors Clearing (TB Creditors Amount) &lt;br /&gt;
   CR Bank Clearing (TB Bank In Transfer Amount) &lt;br /&gt;
 &lt;br /&gt;
== Create Invoice (Customers) for individual Invoices that make up the TB Debtors Amount ==&lt;br /&gt;
 &lt;br /&gt;
Each Invoice should be created with 1 Invoice (Customer) in the System. The Business Partner selected should be the actual Business Partner of the individual Invoices. The Accounting Date is the Opening Date and the Movement Date should be the actual Invoice Date. In the Invoice Line, the Product selected should be the Opening Product created above and multiple lines in the actual Invoice can be summarized into 1 Line. The amount should be the Total Amount of the actual Invoice. &lt;br /&gt;
 &lt;br /&gt;
Upon completely keying in the Invoice (Customer), the Invoice should be Completed and Posted. The account posting that occur should be as follows: &lt;br /&gt;
 &lt;br /&gt;
 DR Debtors (Invoice Amount) &lt;br /&gt;
   CR Debtors Clearing (Invoice Amount)&lt;br /&gt;
&lt;br /&gt;
== Create Pre-Payments (Customers) for individual customers that are part of the TB Debtors Amount ==&lt;br /&gt;
&lt;br /&gt;
If you have prepayments or credits on account, create one payment (AR Receipt) per customer with the unallocated amount.  The Business Partner should be the same as the individual payments.  The transaction date should be the Opening Date. Complete and post each payment.&lt;br /&gt;
&lt;br /&gt;
In the accounting facts, the following transactions should appear:&lt;br /&gt;
&lt;br /&gt;
 DR Debtors Clearing (Payment Amount)&lt;br /&gt;
   CR Bank unallocated Receipts (Payment Amount)&lt;br /&gt;
&lt;br /&gt;
Upon completion, be sure to reset the default Bank in Transfer account.&lt;br /&gt;
&lt;br /&gt;
== Check Debtors Clearing account balance ==&lt;br /&gt;
 &lt;br /&gt;
Upon completely creating, completing and posting all Invoices (Customer) and pre-payments (customers), the Debtors Clearing Account should have a 0 balance.&lt;br /&gt;
&lt;br /&gt;
== Create Invoice (Vendor) for individual Invoices that make up the TB Creditors Amount ==&lt;br /&gt;
 &lt;br /&gt;
The procedure is the same as for Invoice (Customer) above. The account posting should be as follows: &lt;br /&gt;
 &lt;br /&gt;
  DR Creditor Clearing (Invoice Amount) &lt;br /&gt;
    CR Creditor (Invoice Amount) &lt;br /&gt;
 &lt;br /&gt;
== Check Creditors Clearing account balance ==&lt;br /&gt;
&lt;br /&gt;
== Create Payment for individual Unpresented cheque that make up the TB Bank In Transfer Amount ==&lt;br /&gt;
 &lt;br /&gt;
Each unpresented cheque should be created with 1 payment in the System. The Business Partner selected should be the actual Business Partner of the individual payment. The Accounting Date is the Opening Date and the Transaction Date should be the actual Payment Date. The amount should be the Total Amount of the actual Cheque Payment. &lt;br /&gt;
 &lt;br /&gt;
Upon completely keying in the Payment, the Payment should be Completed and Posted. The account posting that occur should be as follows: &lt;br /&gt;
 &lt;br /&gt;
  DR Bank Clearing (Payment Amount) &lt;br /&gt;
    CR Bank In Transfer (Payment Amount) &lt;br /&gt;
 &lt;br /&gt;
== Check Bank Clearing account ==&lt;br /&gt;
The bank clearing account should now have a balance of zero.  If not, please review your previous steps.&lt;br /&gt;
&lt;br /&gt;
== Create new Physical Inventory record. ==&lt;br /&gt;
 &lt;br /&gt;
Create new Physical Inventory and key-in individual inventory quantity balance of Closing Stock as per closing stock count. The type of Physical Inventory selected should be Inventory Adjustment. Be very careful on the Warehouse selected for each record. &lt;br /&gt;
 &lt;br /&gt;
== Complete and Post Physical Inventory record ==&lt;br /&gt;
 &lt;br /&gt;
Upon completely keying-in the Physical Inventory, Complete and Post the Physical Inventory. The account posting should be as follows: &lt;br /&gt;
 &lt;br /&gt;
  DR Inventory (Standard Cost) &lt;br /&gt;
    CR Inventory Clearing (Standard Cost) &lt;br /&gt;
 &lt;br /&gt;
== Check Inventory Clearing balance ==&lt;br /&gt;
 &lt;br /&gt;
Upon completion of all Physical Inventory postings, the Inventory Clearing balance in the System should be 0. &lt;br /&gt;
 &lt;br /&gt;
== Revert Default Accounts ==&lt;br /&gt;
 &lt;br /&gt;
Revert the Default Accounts for Inventory Adjustment for each Warehouse to the original Default Account. &lt;br /&gt;
 &lt;br /&gt;
== Deactivate Opening Product ==&lt;br /&gt;
 &lt;br /&gt;
Select the Active checkbox for Opening Product in the Product Masterdata setup to No. &lt;br /&gt;
 &lt;br /&gt;
== Generate Trial Balance from the System ==&lt;br /&gt;
 &lt;br /&gt;
Generate the Trial Balance as at the Opening Date and compare against the Closing Trial Balance obtained earlier. &lt;br /&gt;
 &lt;br /&gt;
== Deactivate Debtor Clearing, Creditor Clearing, Bank Clearing and Inventory Clearing ==&lt;br /&gt;
 &lt;br /&gt;
Uncheck the Active checkbox for the above in the Account Element setup.&lt;br /&gt;
&lt;br /&gt;
= Summary Outcome =&lt;br /&gt;
You should now have your opening balances established in Adempiere.&lt;br /&gt;
&lt;br /&gt;
[[Category:Accounting]]&lt;/div&gt;</summary>
		<author><name>Sarafudheen</name></author>
	</entry>
</feed>