定制 realsoftgt/sap-b1-sl 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

realsoftgt/sap-b1-sl

最新稳定版本:v0.2.8

Composer 安装命令:

composer require realsoftgt/sap-b1-sl

包简介

SAPBOSL es el puente entre su desarrollo Laravel y SAP Business One Service Layer utilizando Laravel HTTP Client.

README 文档

README

Install SAPBOSL

composer require realsoftgt/sap-b1-sl

Configurate SAPBOSL

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

    RealSoft\SAPBOSL\SAPBOSLServiceProvider::class

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

    'SAPClient' => RealSoft\SAPBOSL\SAPClient::class,

You can publish the config using this command:

    php artisan vendor:publish --provider="RealSoft\SAPBOSL\SAPBOSLServiceProvider"

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

    'https'         => env('SAP_SECURE_URL', false),
    'host'          => env('SAP_BASE_URL', '192.168.1.1'),
    'port'          => env('SAP_BASE_PORT', 50000),
    'company_db'    => env('SAP_COMPANY_DB'),
    'username'      => env('SAP_USERNAME'),
    'password'      => env('SAP_PASSWORD'),
    'sslOptions'    => [
            'cafile'            => env('SAP_BASE_SSL_CA_PATH', 'path/to/certificate.crt'),
            'verify_peer'       => env('SAP_BASE_SSL_VERIFY_PEER', true),
            'verify_peer_name'  => env('SAP_BASE_SSL_VERIFY_PEER_NAME', true),
        ],
    'version'       => env('SAP_BASE_VERSION', 2)

As we can see, these settings can come from the .env environment variables file with the following variables:

#...
SAP_SECURE_URL=false
SAP_BASE_URL=192.168.1.1
SAP_BASE_PORT=50000
SAP_COMPANY_DB='MY_COMPANY_DB'
SAP_USERNAME='Demo01'
SAP_PASSWORD='Demo01#'
SAP_BASE_SSL_CA_PATH='path/to/certificate.crt'
SAP_BASE_SSL_VERIFY_PEER=true
SAP_BASE_SSL_VERIFY_PEER_NAME=true
SAP_BASE_VERSION=2
#...

You update config using this command:

    php artisan config:cache

Using SAPBOSL

Use SAPClient in your controller.

    use RealSoft\SAPBOSL\SAPClient;

Create a new Service Layer session.

    $sap = SAPClient::createSession(config('username'), config('password'), config('company_db'));

Grab the SAP Business One session.

    $session = $sap->getSession();

Example of pulling orders using session saved above:

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

License of SAPBOSL

This SAPBOSL is open-sourced software licensed under the MIT license

统计信息

  • 总下载量: 94
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-21