Skip to content

protendai/sap-business-one

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SAP Business One Service Layer Wrapper for Laravel

Installation

composer require protendai/sap-business-one

Configuration

Add the following line to your Config/app.php Providers:

    Protendai\SapBusinessOne\SapBusinessOneServiceProvider::class

Add the following line to your Config/app.php Aliases:

    'SAPClient' => Protendai\SapBusinessOne\SAPClient::class,

You can publish the config using this command:

    php artisan vendor:publish --provider="Protendai\SapBusinessOne\SapBusinessOneServiceProvider"

The defaults configuration settings are set in config/sap.php as shown below and you can modify the values.

'sap' => [
        "https"         => false,
        "host"          => "IP/HOST Address eg 192.168.1.1",
        "port"          => 50000,
        "sslOptions"    => ["cafile" => "path/to/certificate.crt","verify_peer" => true,"verify_peer_name" => true,],
        "version"       => 1
    ],

You update config using this command:

    php artisan config:cache

Using

Use SAPClient in your controller.

    use Protendai\SapBusinessOne\SAPClient;

Create a new Service Layer session.

    $sap = SAPClient::createSession('SAP UserName', 'SAP Password', 'Company DB');

Grab the SAP Business One session.

    $session = $sap->getSession();

Example of pulling orders using session saved above:

    $sap = new SAPClient(config('sap.sap') ,$session);
    $orders = $sap->getService('Orders');
    $result = $orders->queryBuilder()
    ->select('DocEntry,DocNum')
    ->orderBy('DocNum', 'asc')
    ->limit(5)
    ->findAll();

License

This SapBusinessOne Wrapper for Laravel is open-sourced software licensed under the MIT license

About

SAP Business One Service Layer Wrapper for Laravel

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages