Download the PHP package retail-cosmos/ioi-city-mall-sales-file without Composer

On this page you can find all versions of the php package retail-cosmos/ioi-city-mall-sales-file. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ioi-city-mall-sales-file

The IOI City Mall Sales File Generator

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

The IOI City Mall Sales File Generator is a Laravel package that simplifies the creation of daily sales data files for IOI City Mall stores. It seamlessly integrates into Laravel projects, streamlining data generation for retail management.

Installation

  1. Install the package via composer:

  2. Publish the config file with:

  3. Please set values for all the options in the config file.

Usage

The functionality is divided into two parts. The first part is the File Upload (SFTP).

File Generation

Please follow these steps for the file generation.

  1. Add a scheduler in your Laravel project to call the command generate:ioi-city-mall-sales-files daily at midnight. It generates the sales file for the previous day for each store as returned from the application.

[!TIP] If you wish to generate a specific sales file, you may pass the following options to the command:

  • date - Date in the YYYY-MM-DD format to generate a sales file for a specific date.
  • store_identifier - To generate a sales file for a specific store only.
  1. Create a new class IOICityMallSalesDataService in the App/Services namespace and add a storesList() method in it. It should return the collection of stores. The keys need to be:
    • store_identifier (String)
    • machine_id (String. Machine ID as received from the IOI City Mall)
    • sst_registered (Boolean)

When you pass a store_identifier as an option to the sales file generation command, the package passes it as a parameter to the storesList() method.

Click here to see the example code for the storesList() method

[!TIP] If you return a blank collection, the command does not generate any sales file and just logs a message.

  1. Add a salesData() method in the IOICityMallSalesDataService class. The package will call this method to get the sales data. The method receives the following parameters:
    • store_identifier (string) - as returned from the storesList() method or passed to the sales file generation command as an option.
    • date (string) - YYYY-MM-DD format

This is the main part of the implementation. You need to add code for this method in a way that it fetches the sales data for the specified store for the specified date and returns a collection of sales. The keys need to be:

[!IMPORTANT] You can use RetailCosmos\IoiCityMallSalesFile\Enums\PaymentType enum for keys of the payments.

Click here to see the example code for the salesData() method

[!TIP] Take a note that you need to return sales for all the counters/registers of a store. The Mall expects the sales of all the counters to be combined in the file.

:rocket: And that is it. The scheduler calls the command every day and the package generates a sales file and puts it into the the filesystem as per the config. Next, you may follow the steps for the File Upload part.

Disable File Generation

The package provides an .env variable IOI_CITY_MALL_ENABLE_FILE_GENERATION in case you wish to disable the file generation. If this .env variable is set to false, the file will not be generated even when the command is run.

Notes about generated sales files

Note about Sale Returns

You may provide all the numbers in negative in case of refunds. As per the specifications, the refund amount should be deducted from the sales amount so it will automatically be taken care of during the grouping of records by the package.

Note about Batch IDs

Batch ID is managed by the package. As per the mall specifications, it needs to be a sequential number starting from 1 for the first file generated. You may set the first_file_generation_date in the config. The package counts the days from that date to calculate the Batch ID every time. If the date is not set in the config, an exception will be thrown.

File Upload (SFTP)

There is only one step to start the file uploads.

Add a scheduler in your Laravel project to call the command upload:ioi-city-mall-sales-files daily at 12:30 AM. It uploads all the files from the pending_to_upload directory via SFTP as per your config and moves those files to the uploaded directory.

The complete log of the uploaded files gets prepared and stored as per your log channel config. An email notification is sent as per your notifications config, if set. You may choose to receive only failure notifications also.

Disable File Upload (SFTP)

The package provides an .env variable IOI_CITY_MALL_ENABLE_FILE_UPLOAD in case you wish to disable the file upload. If this .env variable is set to false, the file will not be uploaded even when the command is run.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of ioi-city-mall-sales-file with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
league/flysystem Version ^3.0
league/flysystem-sftp-v3 Version ^3.0
spatie/laravel-package-tools Version ^1.14.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package retail-cosmos/ioi-city-mall-sales-file contains the following files

Loading the files please wait ....