Skip to main content

iteminventory.php

The iteminventory.php service retrieves the item inventory with relevant data. We can request the retrieval of the entire inventory status made so far or of one or several specific items, according to a specific period, or based on the warehouses where they are located, by searching using one or several filters (parameters) provided by the needs of the search.

Method of sending data: POST

Requirements fields are :

Name Type Description
cmd String The parameter "cmd" = "command" is used to specify the type of action that will be consumed by the frontend.
With the exception of the login service, all other services are required to use the cmd parameter. Basic list of values ​​that cmd receives: get, insert, update, delete, softdelete.
get: Makes receiving data. If it is associated with parameters like "cashdeskactualbalance_invoice_header_id": "1" then it will only get 1 data if it finds it.
insert: Memorizes data. The data packet may have basic data which must be present, otherwise a managed error message of type "Error on request!
update: Requires id (primarykey) as a base condition and a minimum set (set) of data which will be updated. Forced data, not optional, if not filled in will signal a managed error message "request error!".
softdelete: Deletes soft delete from table / t. Updates the is_deleted column from 0 to 1. When retrieving data, data that has is_delete = 1 is not retrieved, so it is not displayed to users.
getheader: Returns only part of invoice data or otherwise returns only part of header not all invoice data.correctiveinvoice: Corrects a previous fiscal invoice or otherwise cancels that invoice.
getwithaccess: Returns the menus that this user has access to.
company_iditem_id Integer company_id is primarykey.
get: filters the data (s) according to the parameter value.
update: used as a condition to make an update to capture the specific line, otherwise it displays an error message "An error was verified in the request, update!".
softdelete: deletes the specific line by updating is_deleted 1,otherwise it displays an error message"An error was verified on request, softdelete!".
busin_unit_codewarehouse_id String busin_unit_code:Code or business address declared in taxes.
get: filters the data (s) according to the parameter value.
registerfiscaldevice:is part of the validation data, otherwise it displays an error message.
issuer_nuisitem_code String issuer_nuis:Type of action as e.g. "Key", "Closing" or "Daily Fiscal Key".
get: filters the data (s) according to the parameter value.
insert: is part of the validation data, otherwise it displays an error message "An error was verified on request, insert!".
update: is part of the validation data and the data will be updated (even with the same name), otherwise it displays an error message "An error was verified in the request, update!".
details Array details: The necessary data for this action is the determination of the amount ("amount").
get: filters the data (s) according to the parameter value.
insert: is part of the validation data, otherwise it displays an error message "An error was verified on request, insert!".
update: is part of the validation data and the data will be updated (even with the same name), otherwise it displays an error message "An error was verified in the request, update!".
IsEncrypted boolean Calls the decryption function if it is true.
ServerConfig string(json_encode) Maintains a set of attributes that relate to the API and database dynamically. All attributes that characterize the API or database can be passed as parameters to perform the desired connection. A detailed explanation of the parameters will be given.

TIP

Attention: For certain commands the parameters are sometimes necessary and sometimes optional. In case other filters (parameters) will be needed for the search, then they must be added to the backend, otherwise the request will not be considered. In the Example of the following request only "cmd" would be enough: "get" in the body of the body, to get all the data. If special data is needed then only the filtering parameters which are explained above should be set.

Example of request

  "body": [
        {
            "cmd": "get",
            "item_id": 234,
            "warehouse_id": 123,
            "item_code": "itemcode",
            "item_barcode": "itembarcode",
            "item_price": 3234,
            "from_date": "data",
        }
    ],
    "IsEncrypted": false,
    "ServerConfig": " objekti ServerConfig"
}                                

ServerConfig: string object json

 "IsEncrypted": false,
    "ServerConfig": "{\"Url_API\":\"\",\"DB_Config\":\"\",\"Company_DB_Name\":\"\",\"HardwareId\":\"\",\"UserInfo\":{\"user_id\":,\"username\":\"\",\"password\":null,\"token\":\"\"}}",
    "App": "web",
    "Language": "sq-AL"
}

TIP

CAREFUL!Clarification on ServerConfig (data that completes the request) while consuming the services.IsEncrypted: the attribute that calls the decryption function if it is true.
In this case ServerConfig is incomprehensible to read.
IsEncrypted: in case it is false, the ServerConfig attribute (property) which is a string which will be deserialized to return to the json object, must have the following fields required:
DB_Config and Company_DB_Name: The first represents the database in which the part of the configurations related to users and companies is located. If not completed it will take the value predefined by the backend. The second represents the database in which all other actions related to the user will be performed (not necessary for the login).If not completed it does not allow any kind of action in db and generates an error.
Database: object within the object which should have the following fields: Host_IP: database ip (can be local or remote) .e.g: 88.108.108.88. If not completed it will take the default value from the backend.
Port: the port at which the request is received according to the IP specified above. If not met it will receive the default value from the backend.
Password: the user password associated with the database. If not completed it will take the default value from the backend.
Password1: the use of password1 and password2 has not yet been verified. The purpose of use was to divide the password into two parts in such a way that one user does not have full control without cooperating with the other user.
Password2: the use of password1 and password2 has not yet been verified. The purpose of use was to divide the password into two parts in such a way that one user does not have full control without cooperating with the other user.
In each case there are 2 connections with 2 different databases which have in common IP, username, password and port.
If the app is in the same location as the database, then the Host_IP value is localhost, otherwise if the app and database are on different hosts, the value of the Host_IP in the request must be as real as the ip of the database location. psh: 88.108.108.88.
CAREFUL! When you get the ServerConfig copy paste do not leave spaces between objects as it will not be deserialized.

Example of reponse




{
    "length": 8,
    "body": [
        {
            "item_id": 176,
            "item_barcode": null,
            "item_name": "Banane",
            "item_code": "16/08",
            "item_quantity": 16,
            "item_inventory": 16,
            "item_quantity_per_warehouse": [
                {
                    "warehouse_id": 4,
                    "item_quantity": "1",
                    "warehouse_code": null,
                    "warehouse_name": "Dyqani"
                },
                {
                    "warehouse_id": 1,
                    "item_quantity": "15",
                    "warehouse_code": "MQ",
                    "warehouse_name": "Magazina Qendrore"
                }
            ]
        },
        {
            "item_id": 303,
            "item_barcode": null,
            "item_name": "Gjysem produkt",
            "item_code": "N0004",
            "item_quantity": 176,
            "item_inventory": 176,
            "item_quantity_per_warehouse": [
                {
                    "warehouse_id": 1,
                    "item_quantity": "-58",
                    "warehouse_code": "MQ",
                    "warehouse_name": "Magazina Qendrore"
                },
                {
                    "warehouse_id": 6,
                    "item_quantity": "234",
                    "warehouse_code": "frank_daja",
                    "warehouse_name": "Franko Daja MQ"
                }
            ]
        },
        {
            "item_id": 195,
            "item_barcode": null,
            "item_name": "Double A Leter fotokopje A4, 80 gr./m2",
            "item_code": "GV-N3060GAMING OC-12GE",
            "item_quantity": 5,
            "item_inventory": 5,
            "item_quantity_per_warehouse": [
                {
                    "warehouse_id": 1,
                    "item_quantity": "5",
                    "warehouse_code": "MQ",
                    "warehouse_name": "Magazina Qendrore"
                }
            ]
        },
        {
            "item_id": 324,
            "item_barcode": null,
            "item_name": "Benzine 95 Oktan",
            "item_code": "Test78",
            "item_quantity": 152,
            "item_inventory": 152,
            "item_quantity_per_warehouse": [
                {
                    "warehouse_id": 1,
                    "item_quantity": "152",
                    "warehouse_code": "MQ",
                    "warehouse_name": "Magazina Qendrore"
                }
            ]
        },
        {
            "item_id": 295,
            "item_barcode": null,
            "item_name": "Manaferra",
            "item_code": "api_tesz",
            "item_quantity": 0,
            "item_inventory": 0,
            "item_quantity_per_warehouse": [
                {
                    "warehouse_id": 4,
                    "item_quantity": "6",
                    "warehouse_code": null,
                    "warehouse_name": "Dyqani"
                },
                {
                    "warehouse_id": 1,
                    "item_quantity": "-6",
                    "warehouse_code": "MQ",
                    "warehouse_name": "Magazina Qendrore"
                }
            ]
        },
        {
            "item_id": 304,
            "item_barcode": null,
            "item_name": "Lende Djegese",
            "item_code": "N0005",
            "item_quantity": -2,
            "item_inventory": -2,
            "item_quantity_per_warehouse": [
                {
                    "warehouse_id": 1,
                    "item_quantity": "-2",
                    "warehouse_code": "MQ",
                    "warehouse_name": "Magazina Qendrore"
                }
            ]
        },
        {
            "item_id": 112,
            "item_barcode": null,
            "item_name": "KERCINJA ME SUSAM",
            "item_code": "112",
            "item_quantity": 0,
            "item_inventory": 0,
            "item_quantity_per_warehouse": [
                {
                    "warehouse_id": 1,
                    "item_quantity": "0",
                    "warehouse_code": "MQ",
                    "warehouse_name": "Magazina Qendrore"
                }
            ]
        },
        {
            "item_id": 1,
            "item_barcode": null,
            "item_name": "KUKIS AMERIKAN",
            "item_code": "1",
            "item_quantity": 2989583.16,
            "item_inventory": 2989583.16,
            "item_quantity_per_warehouse": [
                {
                    "warehouse_id": 1,
                    "item_quantity": "2989583.16",
                    "warehouse_code": "MQ",
                    "warehouse_name": "Magazina Qendrore"
                },
                {
                    "warehouse_id": 4,
                    "item_quantity": "0",
                    "warehouse_code": null,
                    "warehouse_name": "Dyqani"
                },
                {
                    "warehouse_id": 6,
                    "item_quantity": "0",
                    "warehouse_code": "frank_daja",
                    "warehouse_name": "Franko Daja MQ"
                }
            ]
        },
       
    ],
    "status": {
        "code": 600,
        "message": "Success!"
    },
    "response_sent_time": "2024-02-02 11:49:38"
}