Download the PHP package ayvazyan10/armsoft without Composer
On this page you can find all versions of the php package ayvazyan10/armsoft. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ayvazyan10/armsoft
More information about ayvazyan10/armsoft
Files in ayvazyan10/armsoft
Package armsoft
Short Description This Laravel package allows you to interact with the ArmSoft API easily
License MIT
Homepage https://github.com/ayvazyan10/armsoft
Informations about the package armsoft
ArmSoft Laravel Package
This Laravel package allows you to interact with the ArmSoft API easily, providing methods for authentication and working with various endpoints such as Goods, GoodsRem, PriceList, DocumentsJournal, and MTBill.
- Authenticate and refresh access token
- Get goods, goodsRems, price lists, documents journal and MTBill from ArmSoft API
- Send data for creating an invoice
Notes:
- This package is currently in beta version.
- The ArmSoft API is still in development and may change without notice.
- I will update the package as soon as they give me more information.
🚀 Installation
You can install the package using Composer:
`
Release the configuration file and database migration.
First, you need to configure the package with your ArmSoft API credentials. You can do this by publishing the configuration file: ` Then, fill in the config/armsoft.php file with your ArmSoft API credentials and settings.
⚙️ Configuration
After publishing the configuration file, you should set your ArmSoft credentials/options in the config/armsoft.php file or in your .env file:
- ARM_SOFT_CLIENT_ID - Your ArmSoft API client ID.
- ARM_SOFT_SECRET - Your ArmSoft API secret key.
- ARM_SOFT_DB_ID - The ID of your ArmSoft database.
or provide it in config/armsoft.php
⚡ All Methods
Please note that this only contains method signatures without the implementation details.
`
📚 Usage
Here is an example of how to use the ArmSoft facade or helper in your Laravel application:
`
📖 Examples & Explanations
Below are some examples of how you could use these methods with a Facade:
In this example, Armsoft is a Facade that allows you to access the Armsoft API using the methods provided by the
Armsoft class. The Facade is registered in the app.php config file and bound to the Armsoft class using the
Laravel service container.
You can use the Facade to call the getGoods(), getGoodsRem(), getPrices(), getDocumentsJournal(), getMTbill(), and setMTbill() methods provided by the Armsoft class. You can pass in any necessary parameters to these methods, as shown in the example above. If an error occurs while calling the API, the methods will throw an Exception with a descriptive error message.
Example with products import
`
Detailed explanation of each method:
getGoods(string $date = null): ?array: This method returns the goods with the given RemDate. You can pass in a date string in yyyy-mm-dd format to retrieve goods for a specific date. If no date is provided, the method will retrieve goods for the current date. The method returns an array of goods, or null if no goods are found. getGoodsRem(string $date = null, string $mtcode = null): ?array: This method returns the GoodsRem with the given RemDate and single one if MTCode provided. You can pass in a date string in yyyy-mm-dd format to retrieve goods rem for a specific date. If no date is provided, the method will retrieve goods rem for the current date. You can also pass in a unique MTCode to retrieve a specific GoodsRem. The method returns an array of GoodsRem, or null if no GoodsRem are found.
getPrices(string $date = null, string $mtcode = null, string $pricetypes = null): ?array: This method returns the PriceList with the given RemDate and single one if MTCode|PriceType provided. You can pass in a date string in yyyy-mm-dd format to retrieve prices for a specific date. If no date is provided, the method will retrieve prices for the current date. You can also pass in a unique MTCode and/or price types to retrieve specific prices. The method returns an array of prices, or null if no prices are found.
getDocumentsJournal(string $dateBegin = null, string $dateEnd = null): ?array: This method returns the DocumentsJournal with the given RemDate and single one if MTCode|PriceType provided. You can pass in a date range to retrieve documents for a specific range. If no date range is provided, the method will retrieve all documents. The method returns an array of documents, or null if no documents are found.
getMTbill(mixed $guid): mixed: This method returns an MTBill with the given GUID. You can pass in a GUID string to retrieve a specific MTBill. The method returns an MTBill object, or null if no MTBill is found.
setMTbill(array $data): mixed: This method sends MTBill data for creating an invoice. You can pass in an array of MTBill data to create a new invoice. The method returns the created MTBill object, or null if the MTBill could not be created.
All of these methods may throw an Exception if an error occurs while calling the ArmSoft API.
You can catch it like this
`
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Author
License
MIT. Please see the license file for more information.