Migrating LCO Withholding Tax to iDempiere

The migration of Adempiere modules to iDempiere

Migrating LCO Withholding Tax to iDempiere

Postby red1 » Thu Jan 10, 2013 11:04 am

After finishing the Asset Maintenance plugin, I will now go after the HR Payroll but will need to finish off its dependency, LCO Retenciones or Withholding Tax popular in numerous countries around the world.
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Migrating LCO Withholding Tax to iDempiere

Postby red1 » Mon Jan 14, 2013 6:46 am

Carlos Ruiz's LCO - http://www.adempiere.com/Colombia_Localisation for the Withholding Tax feature is important as WH Tax is adapted by many countries around the world such as Thailand, Venezuela, Italy and Brazil.

It also has many migration scripts in the form of 2Packs but from the legacy Adempiere which pose the need to prove that they can be migrated to present iDempiere 2Pack which is not that backward compatible.

So this first POC is to Pack In the 2Packs from ADempiere361 and pack them out from iDempiere. This is done via a process of upgrading all things from scratch - ADempiere361 / LCO / PackIn / iDempiere upgrade / PackOut
There are also windows beyond the Localization Colombia's such as Invoice which utilises the Withholding Charge / Tax.

Here is the immediate TODO tasks:
1. Discussion with maintainer (Carlos) and community on consolidation approach ONGOING

2. Downloading of sources DONE

3. Applying changes (2Packs: LCO, LCOData) and PackOut. DONE Packout items screenshot:

PackOut.gif
PackOut.gif (21.59 KiB) Viewed 28441 times

Note the Data item for ModelValidator. It is the single most important trigger for the Extension within the plugin. The Invoice window exported is Invoice (Customer).

3.1 Upgrading to iDempiere, applying UUID Generate process. DONE Results screenshot:

UUID.gif
UUID.gif (38.06 KiB) Viewed 28494 times

4. Test Packin via iDempiere DONE

We need to test and develop
1. The Pack In to be intact and replicative of legacy 361's LCO PROVEN

2. The code transferred into OSGi plugins with all extensions defined. DONE

3. The sample data is testable and working DONE but need Carlos as maintainer's review

3.1 Import of Sample Data DONE Pack-In items screenshot:

DataLCO.gif
DataLCO.gif (16.23 KiB) Viewed 28492 times

3.2 Simple Invoice (Customer) creation and completion. DONE

3.3 Applying Fitnesse Test PENDING (Here is the ExpDat.jar, after the above steps)

4. Documented in English. To translate from Retenciones page.

5. (Optional Next Task) to get the Spanish translation packaged as a plugin 2Pack and formatted for easy adoption by other languages.
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Migrating LCO Withholding Tax to iDempiere

Postby red1 » Wed Jan 16, 2013 6:48 am

Here i list the relevant important output of the above:

1. iDempiere 2Pack of LCO Withholding Tax module. You can pack in via SystemAdmin.

2. iDempiere 2Pack of LCO WHT sample data from Colombia. You can pack in via GardenWorld.

3. iDempiere ExpDat.jar containing DB dump which has the above 2 packed in.

What you do is either Pack in the 2Packs into your iDempiere, or just DBRestore from the ExpDat.dmp. Then you see your DB structure of LCO WHT created with the data.

The code is not yet there. I am taking a day or so to convert them to Extensions within a plugin and then you can install them as shown in previous plugin work. Hopefully i will finish up with a PDF guide in English for its adaptation globally.
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Migrating LCO Withholding Tax to iDempiere

Postby red1 » Wed Jan 16, 2013 12:32 pm

The plugin is now done with Extensions for Process and Models and 2Pack.zip attached. Source is at http://sourceforge.net/p/red1/small/144 ... rePlugins/ (WithHoldingTax projects).

The P2 site to install plugin feature from is http://sourceforge.net/projects/red1/files/p2/ (WithHoldingTax)

The script to use for that is WithHoldingTaxInstaller.shell script link/batch file link

To install in adempiere-client (Swing UI), start up the client with -console param and within the console:
Code: Select all
install http://downloads.sourceforge.net/project/red1/p2/WithHoldingTax/plugins/WithHoldingTax_1.0.0.201301170849.jar
(replace latest jar in case it is changed)

If you wish to modify the 2Pack, you can take this original source, extract its ExpDat.dmp and go to the Pack Out window where it is defined.
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Migrating LCO Withholding Tax to iDempiere

Postby red1 » Wed Jan 16, 2013 7:30 pm

Here is a screenshot showing all the extensions defined. The new thing here is the ModelValidator extension. It allows the old ModelValidator to work off-hand without modification to it. In future we can change this to the Event Model that Heng Sin created which will mean editing the source to the new way and no meta-data setting needed in the ModelValidator table. This allows more easier decoupling as plugins are more code-based than meta-data.

Exts.gif
Exts.gif (38.87 KiB) Viewed 28451 times
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Migrating LCO Withholding Tax to iDempiere

Postby SETSOFTWARE » Thu Jan 17, 2013 11:33 pm

thanks for your work Red1,

I'll try it this weekend and i will give you feedback, this is very important for us.
Javier Pérez Villamizar
SET SOFTWARE
www.setsoftware.net
SETSOFTWARE
Regular
 
Posts: 121
Joined: Wed Apr 27, 2011 11:59 am

Re: Migrating LCO Withholding Tax to iDempiere

Postby collazosc » Fri Jan 18, 2013 5:39 am

http://sourceforge.net/p/red1/small/137 ... oldingTax/ is empty. Where we can get the source?

Greetings,
---------------------------
Carlos Collazos
---------------------------
collazosc
 
Posts: 36
Joined: Thu Dec 29, 2011 9:35 am

Re: Migrating LCO Withholding Tax to iDempiere

Postby red1 » Fri Jan 18, 2013 7:42 am

http://sourceforge.net/p/red1/small/144 ... oldingTax/

It seems that the revision number has to be latest check in. Its 144 not 137. In future just click on the top menu bar at 'Small Projects' in http://sf.net/p/red1.

Thanks for informing. Looking forward to your testing and feedback.
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Migrating LCO Withholding Tax to iDempiere

Postby red1 » Sat Jan 19, 2013 9:14 pm

You can try the brand new Event Manager method of ModelValidator as taught to me by Low Heng Sin. Before i release that as part of WithHoldingTax feature, i uploaded a trial plugin at my SF space for P2 / WithHoldingTax

Download or install straight from the SF link. But first you have to uninstall the LCO_Validator by going to SystemAdmin > Model Validator window and delete that record. So now you have no ModelValidator to call LCO_Validator as we will be using the brand new way which is a new plugin.

Now go to your OSGi console after launching adempiere-client, and paste the following entry:
Code: Select all
install http://downloads.sourceforge.net/project/red1/p2/WithHoldingTax/plugins/WithHoldingTax.Event_1.0.0.201301192104.jar

and something like the following shall appear:
Code: Select all
Bundle id is 115

and you type in 'start <id>'
Code: Select all
osgi> start 115

Note that the bundle ID is dependent on your own console.
The following response should appear meaning your new ModelValidator via event has worked!:
Code: Select all
LCO WITHHOLDING TAX EVENT MANAGER // INITIALIZED


Then play around with your Invoice (Customer) and you can get prompts such as
Code: Select all
21:05:49.612 MInvoice.prepareIt: MInvoice[1000002-100003,GrandTotal=24.3] [66]
EVENT MANAGER // Invoice: DOC_BEFORE_PREPARE >> addInvoiceWithholdingTaxes = 'SUCCESS'
EVENT MANAGER // Invoice: PO_BEFORE_CHANGE >> clearInvoiceWithholdingAmtFromInvoice = 'SUCCESS'
21:05:50.223 MWFProcess.checkActivities: (118) - OR[WFP_949360cb-e14f-4234-befe-d926ad842ca9] [66]


After doing a Payment:
Code: Select all
23:12:55.999 MAllocationHdr.completeIt: MAllocationHdr[1000001-1000003: Approval Amount=0.540000000000 (#2) - SuperUser] [13]
EVENT MANAGER // Invoice: PO_BEFORE_CHANGE >> clearInvoiceWithholdingAmtFromInvoice = 'SUCCESS'
23:12:56.009 MAllocationHdr.updateBP: #1 [13]
EVENT MANAGER // AllocationHdr // DOC_AFTER_COMPLETE >> completePaymentWithholdings = 'SUCCESS'
23:12:56.530 Trx.commit: **** TrxRun_8899b0f6-cc3e-44cc-aebe-0d0974fa56b9 [13]
23:13:09.018 MRole.get: AD_Role_ID=102, AD_User_ID=100, reload=false [20]

Now you can use the new ModelValidator that is a complete own plugin! This gives loose coupling modularity - a true and complete componentisation of your ERP is now achieved.

Note that this event plugin is dependent on the WithholdingTax plugin. Install that first also from the plugins folder of same SF space.

The source of the new plugin is committed at http://sf.net/p/red1 > Small Projects > iDempierePlugins/WithHoldingTax.Event/

My review and conversion effort is sponsored by SYSNOVA, Bangladesh.
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Migrating LCO Withholding Tax to iDempiere

Postby red1 » Wed Feb 13, 2013 4:51 pm

The p2 site is now fully updated to be of the following structure (in Eclipse IDE display):

WITHtree.gif
WITHtree.gif (39.68 KiB) Viewed 28237 times

1. There is no more event plugin as its merged into this main solo plugin. Under the OSGI-INF is also the ModelFactory component.xml so that there is no need for individual extensions on it under the MANIFEST.MF.
2. There still exists the feature plugin which will allow command line installation and uninstallation or updating. This also now works in adempiere-client.
3. The plugin interface implementation for models and factories is moved to a distinctive package: org.idempiere.component.
So now you see all the model classes that is registered by the OSGI-INF/ModelFactory.xml.
WHT_Validator.xml registers the WHT_Validator class.
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Migrating LCO Withholding Tax to iDempiere

Postby red1 » Tue Apr 09, 2013 6:40 pm

Now, we have a good user of the LCO WHT plugin that has also adapted from Kittiu's of Thailand. Edwin Ang is helping to review it in a new bitbucket repo here https://bitbucket.org/red1/withholdingtax as he has used it for the Indonesian environment.
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Migrating LCO Withholding Tax to iDempiere

Postby ocurieles » Mon Apr 15, 2013 1:26 am

Hi red1, Finally i Installed the LCO WHT Plugin and i detected this issues:

The following elements is not created:

1.- The Withholding Process on invoice vendor

2.- The tab Withholding on Invoice vendor.

I´m riding an excercise on GardenWorld and i will send a backup to release


Удачи в России
Attachments
Red1.jpg
Red1.jpg (33.22 KiB) Viewed 27992 times
ocurieles
 
Posts: 7
Joined: Sat Feb 16, 2013 11:34 am

Re: Migrating LCO Withholding Tax to iDempiere

Postby red1 » Mon Apr 15, 2013 9:46 am

Please give me complete steps as i am not familiar with LCO WHT. I need education on this ! :)
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Migrating LCO Withholding Tax to iDempiere

Postby ocurieles » Tue Apr 16, 2013 12:33 am

red1 wrote:Please give me complete steps as i am not familiar with LCO WHT. I need education on this ! :)


Hi Red1, when i try generate Withholding Process in invoice Vendor recibe this:

org.adempiere.model.GenericPO cannot be cast to org.globalqss.model.X_LCO_WithholdingType

in the OSGI Console:

170 ACTIVE WithHoldingTax_1.0.0.201303261650

In the Model validator i delete the LCO record.

regards.
ocurieles
 
Posts: 7
Joined: Sat Feb 16, 2013 11:34 am

Re: Migrating LCO Withholding Tax to iDempiere

Postby ocurieles » Tue Apr 16, 2013 1:33 am

ClassCastException: org.adempiere.model.GenericPO cannot be cast to org.globalqss.model.X_LCO_WithholdingType
at org.globalqss.model.LCO_MInvoice.recalcWithholdings(LCO_MInvoice.java:96)
at org.globalqss.process.LCO_GenerateWithholding.doIt(LCO_GenerateWithholding.java:69)
at org.compiere.process.SvrProcess.process(SvrProcess.java:176)
at org.compiere.process.SvrProcess.startProcess(SvrProcess.java:122)
at org.adempiere.util.ProcessUtil.startJavaProcess(ProcessUtil.java:172)
at org.compiere.apps.AbstractProcessCtl.startProcess(AbstractProcessCtl.java:466)
at org.compiere.apps.AbstractProcessCtl.run(AbstractProcessCtl.java:234)
at org.adempiere.webui.apps.WProcessCtl.process(WProcessCtl.java:158)
at org.adempiere.webui.apps.ProcessModalDialog$ProcessDialogRunnable.doRun(ProcessModalDialog.java:513)
at org.adempiere.util.ContextRunnable.run(ContextRunnable.java:38)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at Thread.run(Thread.java:680)
ocurieles
 
Posts: 7
Joined: Sat Feb 16, 2013 11:34 am

Re: Migrating LCO Withholding Tax to iDempiere

Postby ocurieles » Tue Apr 16, 2013 1:42 am

In the console this message appear:

DefaultModelFactory.getClass: No class for table with it entity: LCO_WithholdingType
ocurieles
 
Posts: 7
Joined: Sat Feb 16, 2013 11:34 am

Re: Migrating LCO Withholding Tax to iDempiere

Postby collazosc » Sat Apr 27, 2013 1:02 am

Hi redone:
I installed withholding tax and try to follow from colombian withholding documentation (retenciones). I am using eclipse IDE and importe the code from bitbucket. It seems that the packaging 2pack did not run completely or finally it was forgotten to updated the following windows: Product, Organization, document type, tax category, taxes, AC invoice. I do not think I failed importing and running the plugin since the menu is in place and the Bussiness partner and AR Invoice have the right fields as show in the retenciones manual.

By the way I run rol access update, sync. terminology, uuid update in idempiere. I manage to add manually the withholding category field to product but I was thinking if you have a better solution.

Regards,
---------------------------
Carlos Collazos
---------------------------
collazosc
 
Posts: 36
Joined: Thu Dec 29, 2011 9:35 am

Re: Migrating LCO Withholding Tax to iDempiere

Postby red1 » Sat Apr 27, 2013 10:07 am

Please check the file time-stamp for the latest plugin again. I think Orlando pointed this out to me and i uploaded a fresh one at http://sourceforge.net/projects/red1/fi ... r/download
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Re: Migrating LCO Withholding Tax to iDempiere

Postby collazosc » Sat Apr 27, 2013 7:56 pm

I am a little bit confused. I read above that the repository was in Bitbucket with Edwin Ang. I am syncronizing from this repo. I think even you uploaded changes to this repo just before yesterday there were some changes on the repo. Which is the right repository? bitbucket's edwing ang or yours in svn red1-small?

Checking the timestamps.... it seems that the 2pack.zip from the jar you pointed in the last post is more recent than the one in bitbucket and your svn. This is more confusing since it seems that were are dealing with a lot of versions: bitbucket, svn, and your jar buildings. Which one is the official?

thank you very much for your help. It's invaluable

Saludos,
---------------------------
Carlos Collazos
---------------------------
collazosc
 
Posts: 36
Joined: Thu Dec 29, 2011 9:35 am

Re: Migrating LCO Withholding Tax to iDempiere

Postby red1 » Sat Apr 27, 2013 10:46 pm

If you are working with source, bitbucket is the one, regardless of time-stamp.
After some time of testing i updated a ready-made plugin to my SF/red1. So that is why the later time-stamp.
If you find my SF/red1 as before the bitbucket, it just means that i have produced the latest plugin and you can do it manually.
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia


Return to iDempiere

Who is online

Users browsing this forum: No registered users and 1 guest

cron