andresamayadiaz / frontaccountingsimpleapi Goto Github PK
View Code? Open in Web Editor NEWA Very Simple FrontAccounting API Module
License: GNU General Public License v2.0
A Very Simple FrontAccounting API Module
License: GNU General Public License v2.0
Upgrade to Slim 4 for PHP 8
See this FrontAccounting forum post.
TODO:
Currently the Journal post does not support currency, or an exchange rate. It would be nice to support other currency transactions in the Journal post and auto calculate the exchange rate by default unless one is given.
Do you think we could use your SimpleAPI on a Point of Sale script like https://github.com/jekkos/opensourcepos
?
The last commit here was back in September 2015.
I need to decide if I can/should use this for integration between OSPOS and FrontAccounting.
I need to add more interfaces and possibly beef up the security a bit. If I do that will you want those as contributions to this project?
I can't use the APIs, I have downloaded and extracted the zip file into http://localhost/frontaccounting/modules/api/
And after calling for example:
http://localhost/frontaccounting/modules/api/bankaccounts
The output is
`
Back |
11/13/2018 | 12:44 pm |
FrontAccounting 2.4.4 - Theme: default - |
FrontAccounting |
It would be nice to have a trial balance available via the api.
The include path is not correct for FA current stable 2.3.x. Not sure if the existing path would work on other versions, but it doesn't work for the current FA stable that I have installed.
I am trying to post a sales order through API, and getting a "There is no customer selected" error, i tried changing "debtor_no" to "customer_id" still the same error. Can I get some help solving the issue?
Code
final url = 'https://frontaccounting.testserver52.com/modules/api/sales';
List list = [
LineItem(
stockId: '2000',
description: 'Chips',
qty: '7',
units: 'each',
price: '0.3',
discount: '0')
];
try {
var response = await http.post(Uri.parse(url),
body: json.encode({
'trans_no': '5',
'trans_type': "10",
'version': "0",
'debtor_no': "3",
'branch_code': "1",
'tran_date': "22-08-2022 00:00",
'due_date': "29-08-2022 00:00",
'reference': "010/2021",
'tpe': "1",
'order_': "5",
'ov_amount': "0.3",
'ov_gst': "0",
'ov_freight': "0",
'ov_freight_tax': "0",
'ov_discount': "0",
'Total': '0.3',
'alloc': '0.3',
'rate': "1",
'ship_via': "1",
'dimension_id': "0",
'dimension2_id': "0",
'payment_terms': '4',
'digital': null,
'lineItems': [
{
"id": "2",
"stock_id": "2000",
"qty": "1",
"units": "each",
"price": "0.3",
"discount": "0",
"description": "Chips"
}
],
}));
print(response.body);
} on Exception catch (e) {
print('error Occured');
print(e);
}
Error
`
<title>Slim Application Error</title> <style> body { margin: 0; padding: 30px; font: 12px/1.5 Helvetica, Arial, Verdana, sans-serif; } h1 {
margin: 0;
font-size: 48px;
font-weight: normal;
line-height: 48px;
}
strong {
display: inline-block;
width: 65px;
}
</style>
The application could not run because of the following error:
`#0 [internal function]: Slim\Slim::handleErrors(1024, 'array (\n 'pass...', '/home/ttserver5...', 306, Array)#1 /home/ttserver52/frontaccounting.testserver52.com/modules/api/sales.inc(306): trigger_error('array (\n 'pass...')#2 /home/ttserver52/frontaccounting.testserver52.com/modules/api/src/Sales.php(101): sales_add()#3 /home/ttserver52/frontaccounting.testserver52.com/modules/api/index.php(444): FAAPI\Sales->post(Object(Slim\Slim))#4 [internal function]: {closure}()#5 /home/ttserver52/frontaccounting.testserver52.com/modules/api/vendor/slim/slim/Slim/Route.php(468): call_user_func_array(Object(Closure), Array)#6 /home/ttserver52/frontaccounting.testserver52.com/modules/api/vendor/slim/slim/Slim/Slim.php(1355): Slim\Route->dispatch()#7 /home/ttserver52/frontaccounting.testserver52.com/modules/api/vendor/slim/slim/Slim/Middleware/Flash.php(85): Slim\Slim->call()#8 /home/ttserver52/frontaccounting.testserver52.com/modules/api/vendor/slim/slim/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()#9 /home/ttserver52/frontaccounting.testserver52.com/modules/api/index.php(84): Slim\Middleware\MethodOverride->call()#10 /home/ttserver52/frontaccounting.testserver52.com/modules/api/vendor/slim/slim/Slim/Middleware/ContentTypes.php(81): JsonToFormData->call()#11 /home/ttserver52/frontaccounting.testserver52.com/modules/api/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\ContentTypes->call()#12 /home/ttserver52/frontaccounting.testserver52.com/modules/api/vendor/slim/slim/Slim/Slim.php(1300): Slim\Middleware\PrettyExceptions->call()#13 /home/ttserver52/frontaccounting.testserver52.com/modules/api/index.php(518): Slim\Slim->run()#14 {main}
Using v2.4-1.7
ErrorException: Undefined index: memo in /mnt/c/Users/cambell/Documents/src/sgw/frontaccounting/modules/api/src/Journal.php:264
The api always only returns 2 records, even when paging is not requested.
See discussion in the forum
ErrorException: DATABASE ERROR :
At file /mnt/c/Users/cambell/Documents/src/sgw/frontaccounting/inventory/includes/db/items_category_db.inc:35:
an item category could not be added
error code : 1062
error message : Duplicate entry 'description' for key 'description'
sql that failed was : INSERT INTO 0_stock_category (description, dflt_tax_type,
dflt_units, dflt_mb_flag, dflt_sales_act, dflt_cogs_act,
dflt_inventory_act, dflt_adjustment_act, dflt_wip_act,
dflt_dim1, dflt_dim2, dflt_no_sale, dflt_no_purchase)
VALUES ('description','1','each','D','4010','5010','1510','5040','1530','0','0','0','0')
in /mnt/c/Users/cambell/Documents/src/sgw/frontaccounting/includes/errors.inc:206
delete on /modules/api/inventory/ doesn't work. The check using $info['stock_id'] causes it to crash.
Fix coming in future PR with inventory unit tests.
Note, this is with strict checking on which shows an uninitialized variable. In this case $oldcost should be $old_cost.
I've been trying to get started with this and it seems that it doesn't support the latest version of FrontAccounting. I haven't had to start immersing myself in the FrontAccounting code but obviously will need to do that. Do you know if the following "easy fix"? It seemed like there might be an issue in the user profile where the relevant fields are not being updated or initialized but I've revisited the profile maintenance and made sure that the fields were changed at least once.
<hr>Trying to get property of non-object in file: C:\vroots\kendosrv\public\bof\includes\db\connect_db_mysqli.inc at line 75
<hr>Trying to get property of non-object in file: C:\vroots\kendosrv\public\bof\includes\db\connect_db_mysqli.inc at line 85
<hr> Call to a member function refresh() on null in C:\vroots\kendosrv\public\bof\includes\db\connect_db_mysqli.inc on line 41
<hr>Trying to get property of non-object in file: C:\vroots\kendosrv\public\bof\includes\errors.inc at line 106
<hr>Trying to get property of non-object in file: C:\vroots\kendosrv\public\bof\includes\errors.inc at line 126
</div>
Call Stack:
0.0014 393520 1. {main}() C:\vroots\kendosrv\public\bof\modules\api\index.php:0
0.0026 475856 2. include_once('C:\vroots\kendosrv\public\bof\modules\api\session-custom.inc') C:\vroots\kendosrv\public\bof\modules\api\index.php:40
0.0791 6802824 3. set_global_connection() C:\vroots\kendosrv\public\bof\modules\api\session-custom.inc:308```
The exchange rate get (all) function doesn't return ISO8601 dates which is what is expected by the post and put methods.
The API documentation is not yet complete. Many endpoints need documentation added by improving the comments in the php files in the src folder.
Here's an example from GLAccounts.php that is complete.
POST /modules/api/customers/ crashes.
Hi,
Please help me to find out why I got the message “404 Page Not Found”.
Followings are the step I tried as per the instruction:
Result:
404 Page Not Found
The page you are looking for could not be found. Check the address bar to ensure your URL is spelled correctly. If all else fails, you can visit our home page at the link below.
Visit the Home Page
Then I print $rest array in modules\api\index.php
// ------------------------------ Item Categories -----------------------------
$rest->container->singleton('category', function () {
return new Category();
});
$rest->group('/category', function () use ($rest) {
// Get Items Categories
echo "
";print_r($rest);echo "";
Output of $rest array
echo "
";print_r($rest);echo "";
Slim\Slim Object
(
[container] => Slim\Helper\Set Object
(
[data:protected] => Array
(
[settings] => Array
(
[mode] => debug
[debug] => 1
[log.writer] =>
[log.level] => 8
[log.enabled] => 1
[templates.path] => ./templates
[view] => \Slim\View
[cookies.encrypt] =>
[cookies.lifetime] => 20 minutes
[cookies.path] => /
[cookies.domain] =>
[cookies.secure] =>
[cookies.httponly] =>
[cookies.secret_key] => CHANGE_ME
[cookies.cipher] => 0
[cookies.cipher_mode] => 0
[http.version] => 1.1
[routes.case_sensitive] => 1
)
[environment] => Closure Object
(
[static] => Array
(
[value] => Closure Object
(
[this] => Slim\Slim Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[object] => Slim\Environment Object
(
[properties:protected] => Array
(
[REQUEST_METHOD] => GET
[REMOTE_ADDR] => ::1
[SCRIPT_NAME] => /FA249/modules/api
[PATH_INFO] => /fa249/modules/api/category/
[QUERY_STRING] =>
[SERVER_NAME] => localhost
[SERVER_PORT] => 80
[HTTP_HOST] => localhost
[HTTP_CONNECTION] => keep-alive
[HTTP_CACHE_CONTROL] => max-age=0
[HTTP_SEC_CH_UA] => " Not A;Brand";v="99", "Chromium";v="90", "Google Chrome";v="90"
[HTTP_SEC_CH_UA_MOBILE] => ?0
[HTTP_UPGRADE_INSECURE_REQUESTS] => 1
[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
[HTTP_SEC_FETCH_SITE] => none
[HTTP_SEC_FETCH_MODE] => navigate
[HTTP_SEC_FETCH_USER] => ?1
[HTTP_SEC_FETCH_DEST] => document
[HTTP_ACCEPT_ENCODING] => gzip, deflate, br
[HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.9,fr;q=0.8,vi;q=0.7
[HTTP_COOKIE] => euCookie=1; cookieconsent_status=dismiss; city_id=3; __gads=ID=60012473859c7847-225d093f81c400ea:T=1603936261:RT=1603936261:S=ALNI_MblVduujTjY1K4WeFFf5kOqKkNLFg; _ga=GA1.1.1498164119.1606768777; __utmz=111872281.1612613512.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _cb_ls=1; _cb=CZSYuWDeUoN7D1yxYq; _y=865f8404-BC6C-4CA8-0DC1-47DA43CA18F1; _shopify_y=865f8404-BC6C-4CA8-0DC1-47DA43CA18F1; _shopify_fs=2021-02-09T10%3A39%3A00.742Z; __utma=111872281.1498164119.1606768777.1612613512.1612880997.2; _chartbeat2=.1612613512287.1612881914812.1001.BM96M9Bke2ZLC5iQMUDd_GR1BM3BKO.7; __atuvc=0%7C6%2C23%7C7%2C63%7C8%2C7%7C9%2C4%7C10; FAbe428eaeccca9e66a4a839bd5d7a72a8=e4de6njspj084mka7ddlrcmnb1; FA9a76d0fec9bef801fb8a815b4fef13cf=gnql19qsv1s59rqqan0fd2jhqh
[slim.url_scheme] => http
[slim.input] =>
[slim.errors] => Resource id #149
)
)
)
[this] => Slim\Helper\Set Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[request] => Closure Object
(
[static] => Array
(
[value] => Closure Object
(
[this] => Slim\Slim Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[object] => Slim\Http\Request Object
(
[env:protected] => Slim\Environment Object
(
[properties:protected] => Array
(
[REQUEST_METHOD] => GET
[REMOTE_ADDR] => ::1
[SCRIPT_NAME] => /FA249/modules/api
[PATH_INFO] => /fa249/modules/api/category/
[QUERY_STRING] =>
[SERVER_NAME] => localhost
[SERVER_PORT] => 80
[HTTP_HOST] => localhost
[HTTP_CONNECTION] => keep-alive
[HTTP_CACHE_CONTROL] => max-age=0
[HTTP_SEC_CH_UA] => " Not A;Brand";v="99", "Chromium";v="90", "Google Chrome";v="90"
[HTTP_SEC_CH_UA_MOBILE] => ?0
[HTTP_UPGRADE_INSECURE_REQUESTS] => 1
[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
[HTTP_SEC_FETCH_SITE] => none
[HTTP_SEC_FETCH_MODE] => navigate
[HTTP_SEC_FETCH_USER] => ?1
[HTTP_SEC_FETCH_DEST] => document
[HTTP_ACCEPT_ENCODING] => gzip, deflate, br
[HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.9,fr;q=0.8,vi;q=0.7
[HTTP_COOKIE] => euCookie=1; cookieconsent_status=dismiss; city_id=3; __gads=ID=60012473859c7847-225d093f81c400ea:T=1603936261:RT=1603936261:S=ALNI_MblVduujTjY1K4WeFFf5kOqKkNLFg; _ga=GA1.1.1498164119.1606768777; __utmz=111872281.1612613512.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _cb_ls=1; _cb=CZSYuWDeUoN7D1yxYq; _y=865f8404-BC6C-4CA8-0DC1-47DA43CA18F1; _shopify_y=865f8404-BC6C-4CA8-0DC1-47DA43CA18F1; _shopify_fs=2021-02-09T10%3A39%3A00.742Z; __utma=111872281.1498164119.1606768777.1612613512.1612880997.2; _chartbeat2=.1612613512287.1612881914812.1001.BM96M9Bke2ZLC5iQMUDd_GR1BM3BKO.7; __atuvc=0%7C6%2C23%7C7%2C63%7C8%2C7%7C9%2C4%7C10; FAbe428eaeccca9e66a4a839bd5d7a72a8=e4de6njspj084mka7ddlrcmnb1; FA9a76d0fec9bef801fb8a815b4fef13cf=gnql19qsv1s59rqqan0fd2jhqh
[slim.url_scheme] => http
[slim.input] =>
[slim.errors] => Resource id #149
)
)
[headers] => Slim\Http\Headers Object
(
[data:protected] => Array
(
[Host] => localhost
[Connection] => keep-alive
[Cache-Control] => max-age=0
[Sec-Ch-Ua] => " Not A;Brand";v="99", "Chromium";v="90", "Google Chrome";v="90"
[Sec-Ch-Ua-Mobile] => ?0
[Upgrade-Insecure-Requests] => 1
[User-Agent] => Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36
[Accept] => text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
[Sec-Fetch-Site] => none
[Sec-Fetch-Mode] => navigate
[Sec-Fetch-User] => ?1
[Sec-Fetch-Dest] => document
[Accept-Encoding] => gzip, deflate, br
[Accept-Language] => en-US,en;q=0.9,fr;q=0.8,vi;q=0.7
[Cookie] => euCookie=1; cookieconsent_status=dismiss; city_id=3; __gads=ID=60012473859c7847-225d093f81c400ea:T=1603936261:RT=1603936261:S=ALNI_MblVduujTjY1K4WeFFf5kOqKkNLFg; _ga=GA1.1.1498164119.1606768777; __utmz=111872281.1612613512.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _cb_ls=1; _cb=CZSYuWDeUoN7D1yxYq; _y=865f8404-BC6C-4CA8-0DC1-47DA43CA18F1; _shopify_y=865f8404-BC6C-4CA8-0DC1-47DA43CA18F1; _shopify_fs=2021-02-09T10%3A39%3A00.742Z; __utma=111872281.1498164119.1606768777.1612613512.1612880997.2; _chartbeat2=.1612613512287.1612881914812.1001.BM96M9Bke2ZLC5iQMUDd_GR1BM3BKO.7; __atuvc=0%7C6%2C23%7C7%2C63%7C8%2C7%7C9%2C4%7C10; FAbe428eaeccca9e66a4a839bd5d7a72a8=e4de6njspj084mka7ddlrcmnb1; FA9a76d0fec9bef801fb8a815b4fef13cf=gnql19qsv1s59rqqan0fd2jhqh
)
)
[cookies] => Slim\Helper\Set Object
(
[data:protected] => Array
(
[euCookie] => 1
[cookieconsent_status] => dismiss
[city_id] => 3
[__gads] => ID=60012473859c7847-225d093f81c400ea:T=1603936261:RT=1603936261:S=ALNI_MblVduujTjY1K4WeFFf5kOqKkNLFg
[_ga] => GA1.1.1498164119.1606768777
[__utmz] => 111872281.1612613512.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
[_cb_ls] => 1
[_cb] => CZSYuWDeUoN7D1yxYq
[_y] => 865f8404-BC6C-4CA8-0DC1-47DA43CA18F1
[_shopify_y] => 865f8404-BC6C-4CA8-0DC1-47DA43CA18F1
[_shopify_fs] => 2021-02-09T10:39:00.742Z
[__utma] => 111872281.1498164119.1606768777.1612613512.1612880997.2
[_chartbeat2] => .1612613512287.1612881914812.1001.BM96M9Bke2ZLC5iQMUDd_GR1BM3BKO.7
[__atuvc] => 0|6,23|7,63|8,7|9,4|10
[FAbe428eaeccca9e66a4a839bd5d7a72a8] => e4de6njspj084mka7ddlrcmnb1
[FA9a76d0fec9bef801fb8a815b4fef13cf] => gnql19qsv1s59rqqan0fd2jhqh
)
)
)
)
[this] => Slim\Helper\Set Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[response] => Closure Object
(
[static] => Array
(
[value] => Closure Object
(
[this] => Slim\Slim Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[object] =>
)
[this] => Slim\Helper\Set Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[router] => Closure Object
(
[static] => Array
(
[value] => Closure Object
(
[this] => Slim\Slim Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[object] => Slim\Router Object
(
[currentRoute:protected] =>
[routes:protected] => Array
(
[0] => Slim\Route Object
(
[pattern:protected] => /inventory/
[callable:protected] => Closure Object
(
[static] => Array
(
[rest] => Slim\Slim Object
RECURSION
)
)
[conditions:protected] => Array
(
)
[name:protected] =>
[params:protected] => Array
(
)
[paramNames:protected] => Array
(
)
[paramNamesPath:protected] => Array
(
)
[methods:protected] => Array
(
[0] => GET
[1] => HEAD
)
[middleware:protected] => Array
(
)
[caseSensitive:protected] => 1
)
[1] => Slim\Route Object
(
[pattern:protected] => /inventory/:id
[callable:protected] => Closure Object
(
[static] => Array
(
[rest] => Slim\Slim Object
RECURSION
)
[parameter] => Array
(
[$id] =>
)
)
[conditions:protected] => Array
(
)
[name:protected] =>
[params:protected] => Array
(
)
[paramNames:protected] => Array
(
)
[paramNamesPath:protected] => Array
(
)
[methods:protected] => Array
(
[0] => GET
[1] => HEAD
)
[middleware:protected] => Array
(
)
[caseSensitive:protected] => 1
)
[2] => Slim\Route Object
(
[pattern:protected] => /inventory/
[callable:protected] => Closure Object
(
[static] => Array
(
[rest] => Slim\Slim Object
RECURSION
)
)
[conditions:protected] => Array
(
)
[name:protected] =>
[params:protected] => Array
(
)
[paramNames:protected] => Array
(
)
[paramNamesPath:protected] => Array
(
)
[methods:protected] => Array
(
[0] => POST
)
[middleware:protected] => Array
(
)
[caseSensitive:protected] => 1
)
[3] => Slim\Route Object
(
[pattern:protected] => /inventory/:id
[callable:protected] => Closure Object
(
[static] => Array
(
[rest] => Slim\Slim Object
RECURSION
)
[parameter] => Array
(
[$id] =>
)
)
[conditions:protected] => Array
(
)
[name:protected] =>
[params:protected] => Array
(
)
[paramNames:protected] => Array
(
)
[paramNamesPath:protected] => Array
(
)
[methods:protected] => Array
(
[0] => PUT
)
[middleware:protected] => Array
(
)
[caseSensitive:protected] => 1
)
[4] => Slim\Route Object
(
[pattern:protected] => /inventory/:id
[callable:protected] => Closure Object
(
[static] => Array
(
[rest] => Slim\Slim Object
RECURSION
)
[parameter] => Array
(
[$id] =>
)
)
[conditions:protected] => Array
(
)
[name:protected] =>
[params:protected] => Array
(
)
[paramNames:protected] => Array
(
)
[paramNamesPath:protected] => Array
(
)
[methods:protected] => Array
(
[0] => DELETE
)
[middleware:protected] => Array
(
)
[caseSensitive:protected] => 1
)
[5] => Slim\Route Object
(
[pattern:protected] => /locations/
[callable:protected] => Closure Object
(
[static] => Array
(
[rest] => Slim\Slim Object
RECURSION
)
)
[conditions:protected] => Array
(
)
[name:protected] =>
[params:protected] => Array
(
)
[paramNames:protected] => Array
(
)
[paramNamesPath:protected] => Array
(
)
[methods:protected] => Array
(
[0] => GET
[1] => HEAD
)
[middleware:protected] => Array
(
)
[caseSensitive:protected] => 1
)
[6] => Slim\Route Object
(
[pattern:protected] => /locations/
[callable:protected] => Closure Object
(
[static] => Array
(
[rest] => Slim\Slim Object
RECURSION
)
)
[conditions:protected] => Array
(
)
[name:protected] =>
[params:protected] => Array
(
)
[paramNames:protected] => Array
(
)
[paramNamesPath:protected] => Array
(
)
[methods:protected] => Array
(
[0] => POST
)
[middleware:protected] => Array
(
)
[caseSensitive:protected] => 1
)
[7] => Slim\Route Object
(
[pattern:protected] => /stock/
[callable:protected] => Closure Object
(
[static] => Array
(
[rest] => Slim\Slim Object
RECURSION
)
)
[conditions:protected] => Array
(
)
[name:protected] =>
[params:protected] => Array
(
)
[paramNames:protected] => Array
(
)
[paramNamesPath:protected] => Array
(
)
[methods:protected] => Array
(
[0] => POST
)
[middleware:protected] => Array
(
)
[caseSensitive:protected] => 1
)
)
[namedRoutes:protected] =>
[matchedRoutes:protected] =>
[routeGroups:protected] => Array
(
[0] => Array
(
[/category] => Array
(
)
)
)
)
)
[this] => Slim\Helper\Set Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[view] => Closure Object
(
[static] => Array
(
[value] => Closure Object
(
[this] => Slim\Slim Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[object] =>
)
[this] => Slim\Helper\Set Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[logWriter] => Closure Object
(
[static] => Array
(
[value] => Closure Object
(
[this] => Slim\Slim Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[object] =>
)
[this] => Slim\Helper\Set Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[log] => Closure Object
(
[static] => Array
(
[value] => Closure Object
(
[this] => Slim\Slim Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[object] =>
)
[this] => Slim\Helper\Set Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[mode] => Closure Object
(
[this] => Slim\Slim Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[inventory] => Closure Object
(
[static] => Array
(
[value] => Closure Object
(
)
[object] =>
)
[this] => Slim\Helper\Set Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[inventoryLocations] => Closure Object
(
[static] => Array
(
[value] => Closure Object
(
)
[object] =>
)
[this] => Slim\Helper\Set Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
[category] => Closure Object
(
[static] => Array
(
[value] => Closure Object
(
)
[object] =>
)
[this] => Slim\Helper\Set Object
RECURSION
[parameter] => Array
(
[$c] =>
)
)
)
)
[name:protected] => SASYS
[middleware:protected] => Array
(
[0] => Slim\Middleware\ContentTypes Object
(
[contentTypes:protected] => Array
(
[application/json] => Array
(
[0] => Slim\Middleware\ContentTypes Object
RECURSION
[1] => parseJson
)
[application/xml] => Array
(
[0] => Slim\Middleware\ContentTypes Object
RECURSION
[1] => parseXml
)
[text/xml] => Array
(
[0] => Slim\Middleware\ContentTypes Object
RECURSION
[1] => parseXml
)
[text/csv] => Array
(
[0] => Slim\Middleware\ContentTypes Object
RECURSION
[1] => parseCsv
)
)
[app:protected] => Slim\Slim Object
RECURSION
[next:protected] => JsonToFormData Object
(
[app:protected] => Slim\Slim Object
RECURSION
[next:protected] => Slim\Middleware\MethodOverride Object
(
[settings:protected] => Array
(
[key] => _METHOD
)
[app:protected] => Slim\Slim Object
RECURSION
[next:protected] => Slim\Middleware\Flash Object
(
[settings:protected] => Array
(
[key] => slim.flash
)
[messages:protected] => Array
(
[prev] => Array
(
)
[next] => Array
(
)
[now] => Array
(
)
)
[app:protected] => Slim\Slim Object
RECURSION
[next:protected] => Slim\Slim Object
RECURSION
)
)
)
)
[1] => JsonToFormData Object
(
[app:protected] => Slim\Slim Object
RECURSION
[next:protected] => Slim\Middleware\MethodOverride Object
(
[settings:protected] => Array
(
[key] => _METHOD
)
[app:protected] => Slim\Slim Object
RECURSION
[next:protected] => Slim\Middleware\Flash Object
(
[settings:protected] => Array
(
[key] => slim.flash
)
[messages:protected] => Array
(
[prev] => Array
(
)
[next] => Array
(
)
[now] => Array
(
)
)
[app:protected] => Slim\Slim Object
RECURSION
[next:protected] => Slim\Slim Object
RECURSION
)
)
)
[2] => Slim\Middleware\MethodOverride Object
(
[settings:protected] => Array
(
[key] => _METHOD
)
[app:protected] => Slim\Slim Object
RECURSION
[next:protected] => Slim\Middleware\Flash Object
(
[settings:protected] => Array
(
[key] => slim.flash
)
[messages:protected] => Array
(
[prev] => Array
(
)
[next] => Array
(
)
[now] => Array
(
)
)
[app:protected] => Slim\Slim Object
RECURSION
[next:protected] => Slim\Slim Object
RECURSION
)
)
[3] => Slim\Middleware\Flash Object
(
[settings:protected] => Array
(
[key] => slim.flash
)
[messages:protected] => Array
(
[prev] => Array
(
)
[next] => Array
(
)
[now] => Array
(
)
)
[app:protected] => Slim\Slim Object
RECURSION
[next:protected] => Slim\Slim Object
RECURSION
)
[4] => Slim\Slim Object
RECURSION
)
[error:protected] =>
[notFound:protected] =>
[hooks:protected] => Array
(
[slim.before] => Array
(
[0] => Array
(
)
[1] => Array
(
[0] => Closure Object
(
[static] => Array
(
[app] => Slim\Slim Object
RECURSION
)
)
)
)
[slim.before.router] => Array
(
[0] => Array
(
)
)
[slim.before.dispatch] => Array
(
[0] => Array
(
)
)
[slim.after.dispatch] => Array
(
[0] => Array
(
)
)
[slim.after.router] => Array
(
[0] => Array
(
)
)
[slim.after] => Array
(
[0] => Array
(
)
)
)
)
Hi i did all the recommended settings but it is not working
url: http://accounting.loc/modules/api/category(this is virtual host on my local machine)
i also did the util.php settings Please Help
Line 220 is using get_customer to validate ID but should be get_supplier instead of get_customer.
Server was not found in my end, anybody here can solve it ?
Not Found
The requested URL /frontaccounting_2.4.1/FrontAccountingSimpleAPI-master/inventory/ was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
ini_set(): A session is active. You cannot change the session module's ini settings at this time in file: /home/cambell/src/sgw/frontaccounting/modules/api/session-custom.inc at line 82
See this SO post.
Suggest moving the ini_set before the start of session by SessionManager
Sales transactions Total not returned. See the Front Accounting Forum for additional discussion.
Hi,
Have been struggling to do curl post to the journal api. I am getting a {"code":412,"success":0,"msg":"items must exist and be an array"}. Would appreciate some help. Below is what I have tried. On doing a raw body postman request it enters successfully. But for this I can't figure out the issue.
<?php
$data = array(
'currency' => 'KS',
'document_ref' => 'INV54321',
'reference' => '1',
'memo' => 'curl test',
'items' => array(
array('account_code'=>'1000','amount'=>'-200','memo'=>'curl test'),
array('account_code'=>'2000','amount'=>'200','memo'=>'curl test'),
)
);
$json_data = http_build_query($data);
$headers = array(
'Content-Type: text/plain',
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "http://localhost/fa/modules/api/journal/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $json_data,
CURLOPT_HTTPHEADER => $headers,
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Currently there is no .../suppliers/ end point to list all suppliers. This would be nice to have.
When performing a GET on /modules/api/glaccounttypes the api fails with a 500 error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.