Giter Site home page Giter Site logo

frontaccountingsimpleapi's People

Contributors

andresamayadiaz avatar cambell-prince avatar christianestrella avatar madelineau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frontaccountingsimpleapi's Issues

Upgrade to Slim 4 for PHP 8

Upgrade to Slim 4 for PHP 8

  • Note that this will break compatibility with older PHP versions.
  • Still, older releases of Simple API will continue to work with older versions of PHP.

See this FrontAccounting forum post.

TODO:

  • Redo api_login as middleware
  • JSON encoding as middleware
  • Refactor use of getInstance(...)

Journals should support currency and rate

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.

Integration with OSPOS

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?

module/api/sales

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>

Slim Application Error

The application could not run because of the following error:

Details

Type: ErrorException
Code: 1024
Message: array ( 'passed' => false, 'message' => 'There is no customer selected.', )
File: /home/ttserver52/frontaccounting.testserver52.com/modules/api/sales.inc
Line: 306

Trace

#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}
`

Database error when adding category in latest FA 2.4.x

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

Inventory delete doesn't work

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.

Missing user profile fields?

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```

404 Page Not Found

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:

  1. Change in modules\api\util.php
    $company = 0;
    $user = 'admin';
    $password = 'password';
  2. Add in conf\httpd.conf
Options -MultiViews RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [QSA,L]
  1. Access on browser
    http://localhost/fa249/modules/api/tests/Category

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 "
";
$rest->get('/', function () use ($rest) {
$rest->category->get($rest);
});

I got the following output:

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
                    (
                    )

            )

    )

)

BUG suppliers.inc

Line 220 is using get_customer to validate ID but should be get_supplier instead of get_customer.

Not Found

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 with active session

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

How to perform add journal entry - curl post request

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;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.