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 :

otherwiseitdisplaysanmessageotherwiseitdisplaysanmessage
NameEmri TypeTipi DescriptionPershkrimi
cmd Stringstring 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.
item_id Integernumber company_id is primarykey.
get: filters theFilters data (s)based according toon 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!".
warehouse_id Stringnumber busin_unit_code:Code or business address declared in taxes.
get: filters theFilters data (s)based according toon the parameter value.
registerfiscaldevice:is part of the validation data, otherwise it displays an error message.
item_code Stringstring issuer_nuis:Type of action as e.g. "Key", "Closing" or "Daily Fiscal Key".
get: filters theFilters data (s)based according toon 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!".
detailsitem_barcode Arraystring details: The necessary data for this action is the determination of the amount ("amount").
get: filters theFilters data (s)based according toon the parameter value.
item_pricenumberinsertget: isFilters partdata ofbased on the validationparameter data,value.
from_date string errordata get: "AnFilters errordata was verifiedbased on request, insert!".
update: is part of the validationparameter datavalue. andImplies the data willmargin be updated (even withfrom the samespecified name),date.
to_date string errordata get: "AnFilters errordata wasbased verified inon the request,parameter update!".value. Implies the data margin up to the specified date.
IsEncrypted boolean Calls the decryption function if it is true.
ServerConfig string(json_encode) MaintainsJSON-encoded astring setcontaining ofdynamic attributes that relate to thefor API and database dynamically.connection.   All attributes that characterizecharacterizing the API or the database can be passed as parameters to performfor the desired connection. A detailed explanation of the parameters will be given.

TIP

Attention: For certainspecific commands thecommands, parameters are sometimes necessarymandatory, and sometimesother times optional. InIf caseadditional other filters (filters(parameters) will beare needed for the search, thensearching, they must be added to the backend,backend; otherwiseotherwise, the request willis not beconsidered. considered. In the Example of the followingexample request below, only "cmd" would be enough: :"get" in the body ofwould thebe body,sufficient to getretrieve all thedata. data. If specialspecific data is neededrequired, then only the filtering parameters which are explained above should be set.included. Example Request: To retrieve all data, only "cmd":"get" in the body would suffice. If specific data is needed, include only the filtering parameters explained above.

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"
}