Topic: Slim REST API module for FA 2.4.x - No Composer
A fully working non-composer-ised version of the Slim2 REST Framework customised for FA 2.4.x is now available.
@joe: Attachements don't work for this version of the forum as yet.- Now done.
It's much more fun, when you can discuss your problems with others...
You are not logged in. Please login or register.
FrontAccounting forum → Modules Add-on's → Slim REST API module for FA 2.4.x - No Composer
A fully working non-composer-ised version of the Slim2 REST Framework customised for FA 2.4.x is now available.
@joe: Attachements don't work for this version of the forum as yet.- Now done.
The Slim2 REST API integration for FA 2.4.3 is now attached herein. This is based on Slim v2.64 with all bugfixes included.
The output of a json_decode to array using the API24 can be obtained after setting the test credentials in util.php and browsing to:
http://www.yourdomain.comt/FA24PATH/modules/api24/sales/5/13
This should retrieve Sales Invoice (type=13) #5.
Attached is the text output.
Great work
Excellent support!
Great Work @Apmuthu.
I see this is great API, I want to start to work on Unicenta POS integration. There are many posts regarding to Unicenta but there are not fully functional one. I just need to integration Sales/Stock deduction on Sales/Sales Return/Cash Transfer to Debitors/.
Please let me know your suggestions, may be there are already work have been done on this previously so I can continue this. Please let me know your suggestions.
Regards
The Unicenta/OpenBravo POS is a compiled application for Windows/Linux/MacOS etc and is currently at v4.1. The database is at v3.91.3 and uses the Apache Derby DB by default. It can be configured to use MySQL database among others, but no public MySQL schema for it is commonly available. Make a set of unitary transactions in Unicenta POS and at each execution list the database changes that have occurred with respect to the actual transactions done that you want to port to FA. Then use and possibly extend the SlimREST API for FA as desired.
Hi,
I know Unicenta/Chromis very well and the MySQL-DB is well described. I know exactly where transactions are stored and what records get changed. I might be of help there.
I have been looking for a way to connect the two for years now and am in contact with Talend, that however seems an enormous overkill.
A fairly simple POS is "OS POS" or "pos_on" which is all PHP/MySQL.
Where do I start when I want to contribute in integrating a pos-solution?
Regards,
Jan
Start a project on GitHub and get others to fork and contribute.
Hi,
I had a closer look and will first try the transactions module in combination with Chromispos.
This module is new to me and looks very good, thanks apmuthu!
Kind regards,
Jan
The latest version is attached herein and complies with changes in the 2017-12-19 core commit for VARLOG_PATH and VARLIB_PATH (the latter is exclusively used herein as per relevant core inclusions).
@apmuthu I tested this api.
ON https://frontaccounting.com/fawiki/index.php?n=Devel.SimpleAPIModule?action=browse
fabridge.php shall have following commit
$headers[] = "X_company: " . COMPANY_NO;
$headers[] = "X_user: " . REST_USER;
$headers[] = "X_password: " . REST_PWD;
shall be changed to
$headers[] = "X-COMPANY: " . COMPANY_NO;
$headers[] = "X-USER: " . REST_USER;
$headers[] = "X-PASSWORD: " . REST_PWD;
to comply it with util.php
@boxygen: Thanks.
Done and updated the zips as well.
This change occurred when it was ported to FA 2.4 when all capitals and hyphen came into effect. In FA 2.3 it the way it was with lower and upper case and underscore as well.
For those using FA 2.3, make sure it is the way it was earlier.
I want to modify this api module to execute Recurring Invoices automatically through a cron call. Is it workable idea? If yes then can you guide me over this?
1. create a script to use the API as in the wiki.
2. Add in code to specify the shebang line at the top for CLI execution and set the php.ini settings for FA in it.
3. now execute it manually to see if the recurring invoices script works.
Otherwise, just take a backup of the FA SQL and execute a manual recurring invoice and compare with the later backup of FA sql and see what changed and write a simple bash / php script to get it done and put it into the crontab of any linux server or on windows use VisualCRON or Task Scheduler.
Or you could just use the shell script approach to running any web page, i.e.:
#!/bin/bash
wget -q --save-cookies /tmp/cookies$$.txt \
--keep-session-cookies \
--post-data 'user_name_entry_field=xxx&password=yyy&company_login_name=1' \
--delete-after \
https://myfawebsite/index.php
# customer detail list
wget -q --load-cookies /tmp/cookies$$.txt \
-O - https://myfawebsite/reporting/rep103.php \
--post-data "PARAM_0=09/13/2019&PARAM_1=&PARAM_2=&PARAM_3=&PARAM_4=&PARAM_5=&PARAM_6=&PARAM_7=0&REP_ID=103" > /tmp/foo.pdf
where post-data are the $_POST fields sent by the FA web page.
@braathwaate: Good one indeed.
Make sure the /tmp folder exists and is writeable.
The $$ is the PID (Process ID) of the shell which is expected to be random for that session.
Wiki-ed it.
FrontAccounting forum → Modules Add-on's → Slim REST API module for FA 2.4.x - No Composer
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 4 official extensions. Copyright © 2003–2009 PunBB.