Technical Documentation - huginsdk/fpu GitHub Wiki
- Introduction
This document has been prepared for ensure communication between Fiscal Printer and user side(PC) by CompactPrinter interface.
CompactPrinter is a cross platform dynamic link library. For C# version, minimum requirement is .NET Framework 4 on Windows 7.
Library functions are grouped in five sections:
- Programming Functions
- Sale Functions
- Report Functions
- Service Functions
- Utility Functions
These functions get specific parameters and return boolean or string values. Functions which return boolean value are operational functions like ger or set. There is a special structure for string functions. This structure is formed in-line and sequential strings are seperated by pipe character( '|' ).
<String1>|<String2>|<String3>|................
First two strings are error code and status values. Other parameter strings vary depending on relevant function.
<ErrorCode>|<StatusValue>|<Parameter1>|<Parameter2>|................
There are four DLLs in the package:
- Hugin.Common.dll
- Hugin.GMPCommon.dll
- Hugin.ExDevice.dll
- Hugin.POS.CompactPrinter.FPUdll
Hugin.Common.dll contains helper functions for other DLL's and project. Also it contains DeviceInfo class which is required for sending software vendor information (legal requirment) to Compact Printer as a parameter on matching state. Hugin.GMPCommon.dll and Hugin.ExDevice.dll libraries are used for low level operations. Hugin.POS.CompactPrinter.dll uses these DLLs. So you do not need to reference them. Our main function are located in Hugin.POS.CompactPrinter.dll.
You have to implement your connection(Serial Port or TCP/IP) and create a connection object to send Compact Printer initialization on your application side. After created your printer object from Compact Printer interface and set Fiscal ID (e.g FA12345678) to CompactPrinter.FiscalRegisterNo feature. And now you can call connect function for connection and matching operations. You can see more detailed source code parts on below.
/// <summary>
/// Starts matching with ECR
/// </summary>
/// <param name="commObj">connection object(SerialPort or TCP/IP)</param>
/// <param name="serverInfo">device info object</param>
/// <returns>true if operations are done successfully</returns>
bool Connect(Object commObj, DeviceInfo serverInfo);
You can see more details about Connect() function in function definitions section.
ICompactPrinter compactPrinter = new CompactPrinter();
// Set Fiscal No
compactPrinter.FiscalRegisterNo = "FA12345678";
// Send connection object and device info
compactPrinter.Connect(conn.ToObject(), serverInfo);
After succesfully establishing the connection, you can use all the public functions. Some example operation flows are shown below:
Sale item:
- Connect to printer
- Sign in cashier
- Start receipt
- Sell item(s)�
- Pay amount �
- Close receipt�
Send PLU data:
- Connect to printer
- Sign in cashier(program authorized)
- Save product with suitable function with needed arguments.
Change Logo Lines:
- Connect to printer
- Sign in with cashier 9
- Print Z Report
- Get current logo lines by given index number
- Change necessary item�
- Set logo lines on correct index
- Exit service mode
Creating TCP/IP or Serial Port connection to FPU on client side:
if (tabConn.SelectedTab == tabComPort)
{
this.Connection = new SerialConnection(cmbPorts.Text, int.Parse(txtBaudrate.Text));
}
else
{
int port = Convert.ToInt32(txtTcpPort.Text);
this.Connection = new TCPConnection(txtTCPIP.Text, port);
}
this.Connection.Open();
Serial Port Open():
public void Open()
{
sp = new SerialPort(portName, baudRate);
sp.WriteTimeout = 4600;
sp.ReadTimeout = 4600;
sp.ReadBufferSize = 40000;
sp.Encoding = MainForm.DefaultEncoding;
sp.Open();
}
TCP Open() :
public void Open()
{
// Close if there is any idle connection
this.Close();
IPEndPoint ipep = new IPEndPoint(IPAddress.Parse(this.ipAddress), this.port);
client = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
client.ReceiveTimeout = 4500;
client.Connect(ipep);
}
Sending connection object and device info, matching with device via Compact Printer:
MainForm.SetFiscalId(txtFiscalId.Text);
DeviceInfo serverInfo = new DeviceInfo();
serverInfo.Brand = "APOS"; //Max size 20
serverInfo.Model = "APOS NEW GEN" // //Max size 20
serverInfo.TerminalNo = txtFiscalId.Text.PadLeft(10, '0'); // Fiscal ID of the ECR. Length is 10
serverInfo.SerialNum = CreateMD5(GetMBId()).Substring(0, 8); // Unique id of the External Device. Motherboard id or MAC address. Max length is 16
serverInfo.Version = new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).LastWriteTime.ToShortDateString(); // Software version. Max length is 20.
// For TCP connection, Set parameters were listed below for only TCP connection.
serverInfo.IP = System.Net.IPAddress.Parse(GetIPAddress());
serverInfo.IPProtocol = IPProtocol.IPV4;
serverInfo.Port = Convert.ToInt32(txtTcpPort.Text);
if (conn.IsOpen)
{
try
{
printer = new CompactPrinter();
printer.FiscalRegisterNo = fiscalId;
if (!printer.Connect(conn.ToObject(), serverInfo))
{
throw new OperationCanceledException("Eşleme yapılamadı");
}
}
catch (Exception ex)
{
Log();
throw ex;
}
Log();
CPResponse.Bridge = this;
}
Signing in cashier:
// Cashier Id
int id = (int)nmrCashierNo.Value;
// Password
string password = txtPassword.Text;
try
{
ParseResponse(new CPResponse(bridge.Printer.SignInCashier(id, password)));
}
catch (System.Exception ex)
{
bridge.Log("Hata: " + ex.Message);
}
Starting document:
CPResponse response;
if (cbxInvoice.Checked) // Checking for doc is invoice or receipt
{
response = new CPResponse(bridge.Printer.PrintDocumentHeader(vkn, amount, docType));
}
else
{
response = new CPResponse(bridge.Printer.PrintDocumentHeader());
}
Selling an saved item:
CPResponse response = new CPResponse(bridge.Printer.PrintItem(pluNo, quantity, price, null, -1, -1));
Payment:
int index = -1;
//PAYMENT TYPE
int paymentType = cbxPaymentType.SelectedIndex;
//IF PAYMENT IS FOREIGN CURRENCY OR CREDIT
if (cbxPaymentType.Text == "Döviz" || cbxPaymentType.Text == "Kredi")
{
//Index
index = cbxSubPayments.SelectedIndex;
}
//PAYMENT AMOUNT
decimal amount = nmrPaymentAmount.Value;
// SEND COMMAND
CPResponse response = new CPResponse(bridge.Printer.PrintPayment(paymentType, index, amount));
Closing sale document:
CPResponse response = new CPResponse(bridge.Printer.CloseReceipt());
Error Code | Enum |
Definition Detail |
---|---|---|
1 | ERR_DATA_CORRUPT | Missing data (it should come up as length) Call function again |
2 | ERR_CRC | Data changed Call function again |
3 | ERR_INVALID_STATE | Application state is not suitable ECR state is not support called function. For example: You cannot call PrintItem function in payment state, or you cannot call VoidReceipt if payment start. |
4 | ERR_INVALID_CMD | Invalid command ECR model don't support called function. |
5 | ERR_INVALID_PRM | Invalid parameter Given parameter of function is invalid. |
6 | ERR_OPERATION_FAILED | Operation failed Call function again |
7 | ERR_CLEAR_REQUIRED | Clear required after error ECR waits confirm from Cashier to continue current operation. Call ClearError function to continue. It occurs usually new paper plugged. |
8 | ERR_NO_PAPER | No paper on printer ECR returns this error if there is no paper. If you get this error, check printer status until gets error code 7. After papers plugged (error code 7), you have to call ClearError function to continue. |
9 | ERR_MATCH_ERROR | Could not match device You have to call authorised service for match ECR and PC. |
--- | --- | --- --- |
11 | ERR_FM_LOAD_ERROR | Error occured when getting fiscal memory info ECR is blocked, Service intervention required. |
12 | ERR_FM_REMOVED | Fiscal memory not connected ECR is blocked, Service intervention required. |
13 | ERR_FM_MISMATCH | Fiscal Memory mismatch Service intervention required or if you get this error when connect to ECR, fiscal id which given as parameter differ from ECR's fiscal id. |
14 | ERR_NEW_FM | Fiscal memory needs to format ECR is blocked, Service intervention required. |
15 | ERR_FM_INIT | Error occured when formatting FM ECR is blocked, Service intervention required. |
16 | ERR_FM_FISCALIZE | FM could not fiscalize ECR is blocked, Service intervention required. |
17 | ERR_FM_DAILY_LIMIT | Daily Z limit * This error occurs, if you exceed Z report count per a day. You have to wait next day to take Z report.* |
18 | ERR_FM_FULL | FM is full ECR is blocked, Service intervention required. |
19 | ERR_FM_FORMATTED | FM formatted before ECR is blocked, Service intervention required. |
20 | ERR_FM_CLOSED | FM closed ECR is blocked, Service intervention required. |
21 | ERR_FM_INVALID | Invalid FM ECR is blocked, Service intervention required. |
22 | ERR_FM_SAM_CARD | Certificate could not getting SAM card ECR is blocked, Service intervention required. |
--- | --- | --- --- |
31 | ERR_EJ_LOAD | Error occured when getting EJ(Electronic journal) info Electronic journal may broke down. Service intervention required. |
32 | ERR_EJ_REMOVED | EJ removed if electronic journal is removedi this error occurs. Plug electronic journal and call ClearError function. |
33 | ERR_EJ_MISMATCH | EJ mismatch This error occurs if different ECR's EJ plugged. |
34 | ERR_EJ_OLD | Old EJ (Only EJ reportsı) If old EJ plugged to ECR, this error occurs. You can only EJ reports if you get this error. |
35 | ERR_NEW_EJ | New EJ, waiting for approval Confirm new EJ, call ClearError. |
36 | ERR_EJ_ZREQUIRED | EJ could not change, Z report required To change EJ, you have to take Z Report. Last document have to Z report to pass new EJ. |
37 | ERR_EJ_INIT | EJ could not initialize Plug different EJ. |
38 | ERR_EJ_FULL | EJ is full You have to take Z Report and plug new EJ. |
39 | ERR_EJ_FORMATTED | EJ formatted before Format new EJ. |
--- | --- | --- --- |
51 | ERR_RCPT_TOTAL_LIMIT | Receipt limit has been exceeded If subtotal exceed receipt limit, this error occurs. |
52 | ERR_RCPT_SALE_COUNT | Sale count has been exceeded on receipt Max sale count is 128. You have close document after payment. |
53 | ERR_INVALID_SALE | Invalid sale This error occurs if sale amount is zero. |
54 | ERR_INVALID_VOID | Invalid void operation If there is no item to be voided, this error occurs. |
55 | ERR_INVALID_CORR | Invalid correction operation If last item cannot be correct, this error occurs. For example you cannot correct payment. |
56 | ERR_INVALID_ADJ | Invalid discount or fee Check you adjustment values. For example you cannot apply %100 discount. |
57 | ERR_INVALID_PAYMENT | Invalid payment Check you payment parameters. |
58 | ERR_PAYMENT_LIMIT | Payment limit has been exceeded Maximum payment count is 10, if you get this error, you have to pay remain total. ECR cannot allows partial payment if you get this error. |
59 | ERR_DAILY_PLU_LIMIT | Exceed daily sale Daily quantity total is 9999999 for same product. You have to take Z report for sell product which exceeded limit. |
--- | --- | --- --- |
71 | ERR_VAT_NOT_DEFINED | VAT rate not defined before You have to define VAT rate firstly. |
72 | ERR_SECTION_NOT_DEFINED | Section not defined before You have to define section firstly. |
73 | ERR_PLU_NOT_DEFINED | PLU not defined before You have to define PLU firstly. |
74 | ERR_CREDIT_NOT_DEFINED | Invalid or missing credit payment info You have to define Credit firstly. |
75 | ERR_CURRENCY_NOT_DEFINED | Invalid or missing currency payment info You have to define foreign currency firstly. |
76 | ERR_EJSEARCH_NO_RESULT | No records were found on EJ Check parameters. |
77 | ERR_FMSEARCH_NO_RESULT | No records were found on FM Check parameters. |
78 | ERR_SUBCAT_NOT_DEFINED | Invalid sub-category You have to define sub category firstly. |
79 | ERR_FILESEARCH_NO_RESULT | No result were found on file search Check parameters. |
--- | --- | --- --- |
91 | ERR_CASHIER_AUTH | Insufficient cashier authority You have to login as authorized cashier. |
92 | ERR_HAS_SALE | FPU has sale Ex: Vat rate cannot change if last document is not Z Report. |
93 | ERR_HAS_RECEIPT | FPU has receipt, Z required Ex: Logo cannot change if last document is not Z Report. |
94 | ERR_NOT_ENOUGH_MONEY | Not enough cash on drawer Ex. If there is 20TL on cash drawer, you cannot give customer change 21 TL, or you cannot cash out 21 TL. |
95 | ERR_DAILY_RCPT_COUNT | Daily receipt limit has been exceeded You have to take Z Report. You cannot start new receipt. |
96 | ERR_DAILY_TOTAL_LIMIT | Daily TOTAL limit has been exceeded You have to take Z Report. You cannot start new receipt. |
97 | ERR_ECR_NONFISCAL | ECR is not fiscal You have to fiscalize ECR, if you want to do fiscal operation. |
--- | --- | --- --- |
111 | ERR_LINE_LEN | Line length too long Check parameter. |
112 | ERR_INVALID_VATRATE | Invalid VAT rate Define VAT rate. |
113 | ERR_INVALID_DEPTNO | Invalid depertmant number Define department. |
114 | ERR_INVALID_PLUNO | Invalid PLU number Define PLU. |
115 | ERR_INVALID_NAME | Invalid definiton(product name, PLU name, section name,....) Check parameters. |
116 | ERR_INVALID_BARCODE | Invalid barcode Check parameter. |
117 | ERR_INVALID_OPTION | Invalid option Check parameter. |
119 | ERR_INVALID_QUANTITY | Invalid quantity Check parameter. |
120 | ERR_INVALID_AMOUNT | Invalid amount Check parameter. |
--- | --- | --- --- |
131 | ERR_BLK_COVER_OPEN | Cover opened ECR is blocked, Service intervention required. |
132 | ERR_BLK_FM_MESH | FM mesh has damaged ECR is blocked, Service intervention required. |
133 | ERR_BLK_HUB_MESH | HUB mesh has damaged ECR is blocked, Service intervention required. |
134 | ERR_BLK_Z_REQUIRED | Z report required(After 24 hours) ECR waits confirm to take Z Report, call ClearError. |
135 | ERR_BLK_EJ_INVALID | Invalid EJ Plug EJ and restart ECR. |
136 | ERR_BLK_NOT\ _LOAD_CERTIFICATE | Certificates could not load ECR is blocked, Service intervention required. |
137 | ERR_BLK_DT | Set date and time ECR is blocked, Service intervention required. Set date and time in service menu. |
138 | ERR_BLK_DAILY_FISCAL | Incompatible daily and FM ECR is blocked, Service intervention required. Clear daily memory in service menu. |
139 | ERR_BLK_DB | Database error ECR is blocked, Service intervention required. Restore factory settings in service menu. |
140 | ERR_BLK_LOG | Log error ECR is blocked, Service intervention required. |
141 | ERR_BLK_SRAM | SRAM error ECR is blocked, Service intervention required. |
142 | ERR_BLK_CERT_MISMATCH | Incompatible certificate ECR is blocked, Service intervention required. |
143 | ERR_BLK_VERSION | Version error ECR is blocked, Service intervention required. |
144 | ERR_BLK_DAILY_LOG_OVER | Daily log limit has been exceeded ECR is blocked, Service intervention required. |
145 | ERR_BLK_RESTART_ECR | Re-start ECR Power off-on |
146 | ERR_BLK_LOCK_SIGN_IN | Daily incorrect password has been exceeded by cashier or service *Wait 24 hour and try to sign in locked cashier or log in different cashier. * |
148 | ERR_BLK_RETRY_TO_ CONNECT_RAD | Could not connect to GIB server, try again Checks ECR internet connection and then call ClearError |
170 | ERR_EFT_NOT_CONNECT | No EFT connection Check you EFT-POS connection, or if you didnt match ECR and EFT-POS you have to match devices in service menu. |
171 | ERR_EFT_INVALID_STATE | EFT-POS state is invalid Check EFT-POS and then try again. |
172 | ERR_EFT_INCORRECT_CARD | Invalid Credit Card Card is not supported for EFT-POS |
173 | ERR_EFT_DIFFERENT_AMOUNT | Different amount is not supported You cannot change amount if you get card info. |
174 | ERR_EFT_NO_PROVISION | No provision Check EFT-POS and try again. |
175 | ERR_EFT_UNSUPPORTED _INSTALLMENT | Unsupported installment Try with EFT-POS payment with different installment. |
176 | ERR_EFT_VOID_FAIL | Payment void error Payment cannot voided. Continue payment or close receipt. |
Note: If error code is 0, operation is successful
Status Code | Enum | Definition | Allowed Functions |
---|---|---|---|
1 | ST_IDLE | ECR has no sale | New document, Take report, Cash In-Out, Programming, Service operations, Cashier In-Out |
2 | ST_SELLING | On selling (Ex: cannot get report) | Selling, Adjustment, Void Item, Void Receipt, Payment. |
3 | ST_SUBTOTAL | Subtotal calculated. | Subtotal Adjustment, Void Receipt, Payment |
4 | ST_PAYMENT | Waiting for payment (ex: cannot sell) | Payment, Void Payment |
5 | ST_OPEN_SALE | Receipt have to close. Payment is done. | Print remark line(s), Close Receipt |
6 | ST_INFO_RCPT | On receiving info receipt | Print remark line(s), Close non-fiscal document. |
7 | ST_CUSTOM_RCPT | On custom receipt mdoe | Print remark line(s), Close non-fiscal document. |
8 | ST_IN_SERVICE | In service menu | Service operations, Exit Service |
9 | ST_SRV_REQUIRED | Service required | Service entry |
10 | ST_LOGIN | Cashier login has not been done. | Cashier login |
11 | ST_NONFISCAL | ECR is not fiscal (Ex. EJ reports cannot get) | Non-fiscal document, Non-fiscal reports, Programming |
12 | ST_ON_PWR_RCOVR | there is a document which waiting for void | Void Receipt |
13 | ST_INVOICE | On invoice | Selling, Payment, Void Receipt |
14 | ST_CONFIRM_REQUIRED | ECR waiting for confirm | ClearError() |
Customer has to set some settings to start selling. To change settings authorized cashier must be logging in. Authorized cashier id is 9. Other cashier only get settings but cannot set. Primary settings are listed below, 1- Logo 2- VAT 3- Department 4- PLU 5- Credit Info 6- Foreign Currency Info 7- Main/Sub Product Category 8- Cashier Info 9- Graphic Logo 10- End of Receipt Note
Other settings are important as well as listed above, but not oppose to selling.
Common error codes in Programming,
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
5 | ERR_INVALID_PRM |
91 | ERR_CASHIER_AUTH |
Sets logo on FPU
Parameters:
name | description | type |
---|---|---|
_index | logo index. | Int(0-5) |
_line | logo line | String(For FT202,Vx675 models max length is 32, FP300 model ECR allows 48 characters) |
Return value:
<ErrCode>|<Status>|<LogoLine>
Note: 5th index of logo line has to be VKN(Customer tax registration No)
Errors :
Error Code | Title |
---|---|
93 | ERR_HAS_RECEIPT |
111 | ERR_LINE_LEN |
Gets logo on FPU
Parameters:
name | description | type |
---|---|---|
index | logo index. | Int(0-5) |
Return value:
<ErrCode>|<Status>|<LogoLine>
Sets VAT rates.
Parameters:
name | description | type |
---|---|---|
_index | VAT index. | Int(0-7) |
_vatRate | VAT value | decimal(0-99) |
Return value:
<ErrCode>|<Status>|<VATRate>
Errors :
Error Code | Title |
---|---|
92 | ERR_HAS_SALE |
112 | ERR_INVALID_VATRATE |
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
Gets VAT rates.
Parameters:
name | description | type |
---|---|---|
_index | VAT index. | Int(1-8) |
Return value:
<ErrCode>|<Status>|<VATRate>
Sets department. Department known as "Section" some platform. ECR doesn't allow to sales directly on VAT. Each VAT rates connect to Department. One to one or many to one releations can be. For example, Three department can related with same VAT rate. ECR also doesn't allow directly department sales if sales is making on PC. PC mode allow only PLU sales. PLU connects to department. Differeny PLUs can be connect same department.
Parameters:
name | description | type |
---|---|---|
id | department id number | Int(1-8) |
name | department name | String(20) |
vatId | department vat id | Int(1-8) |
price | price | Decimal Max(999.999,99) |
weighable | weighable or not | Int (0 -> imponderable, 1 -> weighable) |
Return value:
<ErrCode>|<Status>|<Name>|<VatId>|<Price>|<Weighable>
Errors:
Error Code | Title |
---|---|
71 | ERR_VAT_NOT_DEFINED |
92 | ERR_HAS_SALE |
113 | ERR_INVALID_DEPTNO |
115 | ERR_INVALID_NAME |
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
3.1.6. string SetDepartment (int id, string name, int vatId, decimal price, int weighable, decimal limit)
Has the same features as the upper function with a difference. Extra parameter "limit", sets maximum departmant sales amount for each sales row.
For Example: Product unit price is 50. If you set its department limit to 500, you can sale maximum 10 pieces for each sales row.
Parameters:
name | description | type |
---|---|---|
id | department id number | Int(1-8) |
name | department name | String(20) |
vatId | department vat id | Int(1-8) |
price | price | Decimal Max(999.999,99) |
weighable | weighable or not | Int (0 -> imponderable, 1 -> weighable) |
limit | department limit | Decimal (999.999,99) |
Return value:
<ErrCode>|<Status>|<Name>|<VatId>|<Price>|<Weighable>|<Limit>
Errors:
Error Code | Title |
---|---|
71 | ERR_VAT_NOT_DEFINED |
92 | ERR_HAS_SALE |
113 | ERR_INVALID_DEPTNO |
115 | ERR_INVALID_NAME |
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
Gets department info in given id
Parameters:
name | description | type |
---|---|---|
deptId | Department id to be receive from ECR | Int(1-8) |
Return value:
<ErrCode>|<Status>|<Name>|<VatId>|<Price>|<Weighable>
Errors:
Error Code | Title |
---|---|
113 | ERR_INVALID_DEPTNO |
Sets credit info. This payment generally uses if you payment taken from EFT-POS which is not connected with ECR.
Parameters:
name | description | type |
---|---|---|
id | credit id number | FP300,FT202: Int(0-7), Vx675: Int(0-3) |
name | credit name | String(15) |
Return value:
<ErrCode>|<Status>
Errors:
Error Code | Title |
---|---|
92 | ERR_HAS_SALE |
115 | ERR_INVALID_NAME |
Gets credit info in given id
Parameters:
name | description | type |
---|---|---|
id | credit id number | FP300,FT202: Int(0-7), Vx675: Int(0-3) |
Return value:
<ErrCode>|<Status>|<CreditName>
Sets currency info.
Parameters:
name | description | type |
---|---|---|
id | foreign currency id number | Int(0-3) |
name | foreign currency name | String(15) |
exchangeRate | exchange rate | Decimal(999.999,99) |
Return value:
<ErrCode>|<Status>|<CurrencyName>|<CurrencyExcRate>
Note: Only FP300 model ECR allows to payment by foreign currency.
Errors:
Error Code | Title |
---|---|
92 | ERR_HAS_SALE |
115 | ERR_INVALID_NAME |
120 | ERR_INVALID_AMOUNT |
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
Gets currency info in given id
Parameters:
name | description | type |
---|---|---|
id | foreign currency id number | Int(0-3) |
Return value:
<ErrCode>|<Status>|<CurrencyName>|<CurrencyExcRate>
Note: Only FP300 model ECR allows to payment by foreign currency.
Sets main category. Main group info of products.
Parameters:
name | description | type |
---|---|---|
id | category id | Int(1-50) |
name | category name | String(20) |
Return value:
<ErrCode>|<Status>|<MainCategoryName>
Errors:
Error Code | Title |
---|---|
93 | ERR_HAS_RECEIPT |
115 | ERR_INVALID_NAME |
Note: This property is not necessary for sales.
Gets main category info in given id. Main group info of products.
Parameters:
name | description | type |
---|---|---|
mainCatId | Main category id number | Int(1-50) |
Return value:
<ErrCode>|<Status>|<MainCatId>|<MainCategoryName>
Note: This property is not necessary for sales.
Sets sub category. Sub group info of products. Each sub category related with one main category.
Parameters:
name | description | type |
---|---|---|
id | category id | Int(1-250) |
name | category name | String(20) |
mainCatId | main category id | Int(1-50) |
Return value:
<ErrCode>|<Status>|<SubCatName>|<MainCatId>
Errors:
Error Code | Title |
---|---|
93 | ERR_HAS_RECEIPT |
115 | ERR_INVALID_NAME |
Note: This property is not necessary for sales.
Gets sub category info in given id. Sub group info of products. Each sub category related with one main category.
Parameters:
name | description | type |
---|---|---|
subCatId | Sub-Category id number | Int(1-250) |
Return value:
<ErrCode>|<Status>|<Id>|<Name>|<MainCategoryId>
Note: This property is not necessary for sales.
Saves cashier.
Parameters:
name | description | type |
---|---|---|
cashierId | cashier id number | Int(1-9) |
cashierName | cashier name | String(15) |
cashierPass | cashier password | String(6) |
Return value:
<ErrCode>|<Status>|<CashierName>
Errors:
Error Code | Title |
---|---|
115 | ERR_INVALID_NAME |
Gets cashierinfo in given id
Parameters:
name | description | type |
---|---|---|
cashierId | cashier id number to get | Int(1-9) |
Return value:
<ErrCode>|<Status>|<CashierName>
3.1.18. string SaveProduct (int pluNo, string productName, int deptId, decimal price, int weighable, string barcode, int subCatId)
Saves product in ECR
Parameters:
name | description | type |
---|---|---|
pluNo | product id number. This number must be unique | Int(1-200000) |
productName | product name | String(20) |
deptId | department id number | Int(1-8) |
price | product price | Decimal(999.999,99) |
weighable | weighable or not (1 or 0) | 0,1 |
barcode | product barcode, optional | String(15) |
subCatId | sub-category id number, optional | Int(1-250) |
Return value:
<ErrCode>|<Status>
Errors:
Error Code | Title |
---|---|
72 | ERR_SECTION_NOT_DEFINED |
92 | ERR_HAS_SALE |
113 | ERR_INVALID_DEPTNO |
114 | ERR_INVALID_PLUNO |
115 | ERR_INVALID_NAME |
116 | ERR_INVALID_BARCODE |
3.1.18.1. string SaveProduct(int productId, string productName, int deptId, int price,int weighable, string barcode, int subCatId)
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
Gets product in given plu number
Parameters:
name | description | type |
---|---|---|
pluNo | product PLU number, id | Int(1-200000) |
Return value:
<ErrCode>|<Status>|<DepartmentName>|<DepartmentId>|<Price>|<Weighable>|<Barcode>|<SubCategoryId>
Errors:
Error Code | Title |
---|---|
114 | ERR_INVALID_PLUNO |
Loads graphical logo
Parameters:
name | description | type |
---|---|---|
imageObject | image object to load | Monochrome bitmap(Width:570px, Height:120px) |
Return value:
<ErrCode>|<Status>
Errors:
Error Code | Title |
---|---|
6 | ERR_OPERATION_FAILED |
Saves program option value
Parameters:
name | description | type |
---|---|---|
progName | ECR options | enum number having the following meanings: 0 : Cutter 1 : Pay with EFT 2 : Receipt Limit 3 : Graphic Logo 4 : Receipt Barcode |
progValue | program value | Int |
Return value:
<ErrCode>|<Status>|<ProgramOptionValue>
Errors:
Error Code | Title |
---|---|
117 | ERR_INVALID_OPTION |
Gets program option value
Parameters:
name | description | type |
---|---|---|
progName | ECR options | enum number having the following meanings: 0 : Cutter 1: Pay with EFT 2 : Receipt Limit 3 : Graphic Logo 4 : Receipt Barcode |
Return value:
<ErrCode>|<Status>|<ProgramOptionValue>
Gets notes which programmed to end of receipt on ECR.
Parameters:
name | description | type |
---|---|---|
index | line index | int(1-6) |
Return value:
<ErrCode>|<Status>|<Line>
Sets end of receipt note lines to ECR.
Parameters:
name | description | type |
---|---|---|
index | line index | int(1-6) |
line | line | string(Length max : FP300-> 48, FT202,Vx675-> 32 ) |
Return value:
<ErrCode>|<Status>|<Line>
Starts fiscal receipt.
Return value:
<ErrCode>|<Status>|<ReceiptNo>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
20 | ERR_FM_CLOSED |
91 | ERR_CASHIER_AUTH |
38 | ERR_EJ_FULL |
95 | ERR_DAILY_RCPT_COUNT |
Starts info receipt.
Info receipts prints on ECR for the following reason,
Sales application can not get payment directly over EFT-POS. If Info receipt -prepared by sales application- has EFT payment, sales application starts the info receipt for taking EFT Payment over ECR.
Vendors need info receipts for following reasons,
- If Receipt subtotal exceeds the receipt limit, receipt type must be Invoice, E-Invoice and E-Archive. Current receipt limit is 900,00TL in Turkey.
- If customer wants to invoice for its company and its company subject to e-Invoice, cashier have to start e-Invoice.
- Customers may want to e-Archive instead of Invoice.
- If Customers want to pay by food payment card such as SODEXO, cashier has to start Food Receipt. This document doesnot includes VAT. Food payment cards pass only food restaurant.
- Oto parks have to start park ticket.
- If customer wants to pay goods price before shop it(to reserve it), cashier prepare Advenced payment document.
DocType:
- Invoice : Sales application prepares also invoice document paper on slip printer.
- E-Invoce : Electronic Invoice prepared for commercial company
- E-Archive : Electronic Document for customer non-commercial.
- Food Receipt : For get payment by food payment card.
- Park Ticket : Uses otopark.
- Advanced Payment : Customer pay goods price to reserve it.
NOTE: TCKN no must be 11 digits, VKN no must be 10 digits
Parameters:
name | description | type |
---|---|---|
tckn_vkn | Customer TCKN or VKN no (It is necessary if document type 1,2,3 , other documents don't require) | String(11) |
amount | Info receipt amount (It is necessary if document type 4,5,6 , other documents don't require) | Decimal(999.999,99) |
docType | document type ID | Int(1-6) |
Return value:
<ErrCode>|<Status>|<DocumentNo>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
20 | ERR_FM_CLOSED |
91 | ERR_CASHIER_AUTH |
38 | ERR_EJ_FULL |
95 | ERR_DAILY_RCPT_COUNT |
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
3.2.3. string PrintDocumentHeader (int docType, string tckn_vkn, string docSerial, DateTime docDateTime)
Starts invoice, e-invoice, e-archive
Parameters:
name | description | type |
---|---|---|
tckn_vkn | Customer TCKN or VKN no (It is necessary if document type 1,2,3 , other documents don't require) | String(11) |
docType | document type ID | Int(1-6) |
docSerial | document serial | string(11) |
docDateTime | document issue date | DateTime |
DocType:
- Invoice : Sales application prepares also invoice document paper on slip printer.
- E-Invoce : Electronic Invoice prepared for commercial company
- E-Archive : Electronic Document for customer non-commercial.
Return value:
<ErrCode>|<Status>|<DocumentNo>
Errors:
Error Code | Title |
---|---|
5 | ERR_INVALID_PRM |
71 | ERR_VAT_NOT_DEFINED |
95 | ERR_DAILY_RCPT_COUNT |
Prints advance document
Parameters:
name | description | type |
---|---|---|
tckn | Customer TCKN or VKN no (It is necessary if document type 1,2,3 , other documents don't require) | String(11) |
name | Customer name | String(22) |
amount | Advance amount | decimal(999.999,99) |
Return value:
<ErrCode>|<Status>|<DocumentNo>
Errors:
Error Code | Title |
---|---|
5 | ERR_INVALID_PRM |
71 | ERR_VAT_NOT_DEFINED |
95 | ERR_DAILY_RCPT_COUNT |
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
3.2.5. string PrintCollectionDocumentHeader (string invoiceSerial, DateTime invoiceDate, decimal amount, string subscriberNo, string institutionName, decimal comissionAmount)
Prints collection document
name | description | type |
---|---|---|
invoiceSerial | document serial alfa-numeric number | string(11) |
invoiceDate | document issue date | Datetime |
amount | document amount to pay | Decimal(999.999,99) |
subscriberNo | whom the collection belongs | string(15) |
instutionName | instution name that creates collection | string(22) |
comissionAmount | comission amount | Decimal(9.999,99) |
Return value:
<ErrCode>|<Status>|<DocumentNo>
Errors:
Error Code | Title |
---|---|
5 | ERR_INVALID_PRM |
71 | ERR_VAT_NOT_DEFINED |
95 | ERR_DAILY_RCPT_COUNT |
3.2.5.1. string PrintCollectionDocumentHeader(string invoiceSerial, DateTime invoiceDate, int amount, string subscriberNo, string institutionName, int comissionAmount)
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
Starts food document
Return value:
<ErrCode>|<Status>|<DocumentNo>
Errors:
Error Code | Title |
---|---|
71 | ERR_VAT_NOT_DEFINED |
95 | ERR_DAILY_RCPT_COUNT |
Prints car parking document
Parameters:
name | description | type |
---|---|---|
plate | car plate | string(11) |
entranceDate | car entrance date | DateTime |
Return value:
<ErrCode>|<Status>|<DocumentNo>
Errors:
Error Code | Title |
---|---|
5 | ERR_INVALID_PRM |
71 | ERR_VAT_NOT_DEFINED |
95 | ERR_DAILY_RCPT_COUNT |
3.2.8. string PrintItem (int PLUNo, decimal quantity, decimal amount, string name, int deptId, int weighable)
Prints sale item
NOTE: "deptId", "amount", "name", "weighable" parameters are not neccessary while selling a PLU item(if item has already saved before). Send "-1" value instead of them(name->null). So compact printer does not send a value as deparment id. You can save an item while selling with this function at same time on programability mode. You can send their own value on parameters;
"name" -> string "deptId" -> int "amount" -> decimal "weighable" -> if weigable 1 or not 0
Parameters:
name | description | type |
---|---|---|
PLUno | The PLU number of item | Int (1-200000) |
quantity | Item's quantity | Decimal(999,99) |
amount | The amount of item, optional | Decimal(999999,99) |
name | The name of item, optional | String(20) |
deptId | The department id of item, optional | Int(1-8) |
weighable | Item is weighable or not, optional | Int(0-1) |
Return value:
<ErrCode>|<Status>|<SubTotal>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
51 | ERR_RCPT_TOTAL_LIMIT |
52 | ERR_RCPT_SALE_COUNT |
53 | ERR_INVALID_SALE |
59 | ERR_DAILY_PLU_LIMIT |
72 | ERR_SECTION_NOT_DEFINED |
3.2.8.1. string PrintItem(int PLUNo, int quantity, int amount, string name, string barcode, int deptId, int weighable)
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
3.2.9. string PrintDepartment (int deptId, decimal quantity, decimal amount, string name, int weighable)
Prints sale item
Parameters:
name | description | type |
---|---|---|
deptId | department ID | int(1-8) |
quantity | item quantity | decimal(999,99) |
amount | item amount | decimal(999999,99) |
name | item name | string(20) |
weighable | item is weighable or not, optional | int(0-1) |
Return value:
<ErrCode>|<Status>|<SubTotal>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
51 | ERR_RCPT_TOTAL_LIMIT |
52 | ERR_RCPT_SALE_COUNT |
53 | ERR_INVALID_SALE |
59 | ERR_DAILY_PLU_LIMIT |
60 | ERR_OVER_DEPT_LIMIT |
72 | ERR_SECTION_NOT_DEFINED |
73 | ERR_PLU_NOT_DEFINED |
96 | ERR_DAILY_TOTAL_LIMIT |
119 | ERR_INVALID_QUANTITY |
120 | ERR_INVALID_AMOUNT |
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
Apply adjustment to last item and print adjusted value. Last item can be Sale item or Subtotal. If last item is sale item, apply adjusment only last sale item. If last item is subtotal, apply adjusment all sold items.
Parameters:
name | description | type |
---|---|---|
adjustmentType | adjustment type | 0 : Fee 1 : Percent Fee 2 : Discount 3: Percent Discount |
amount | amount of adjustment if adjustment type is 0 or 2 | Decimal(999999,98) |
percentage | percentage value if adjustment type is 1 or 3 | Int(1-99) |
Return value:
<ErrCode>|<Status>|<SubTotal>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
56 | ERR_INVALID_ADJ |
52 | ERR_RCPT_SALE_COUNT |
51 | ERR_RCPT_TOTAL_LIMIT |
96 | ERR_DAILY_TOTAL_LIMIT |
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
Corrects last operation on document(sale, adjustment)
Parameters:Return value:
<ErrCode>|<Status>|<SubTotal>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
52 | ERR_RCPT_SALE_COUNT |
55 | ERR_INVALID_CORR |
Voids a sold item on document
Parameters:
name | description | type |
---|---|---|
PLUNo | PLU number of fiscal item | Int(1-200000) |
quantity | quantity of fiscal item | Decimal(999,99) |
Return value:
<ErrCode>|<Status>|<SubTotal>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
52 | ERR_RCPT_SALE_COUNT |
54 | ERR_INVALID_VOID |
73 | ERR_PLU_NOT_DEFINED |
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
Voids a sold item on document
Parameters:
name | description | type |
---|---|---|
deptId | departman id number | int(1-8) |
deptName | departman name | string(20) |
quantity | quantity to void | decimal(999,99) |
Return value:
<ErrCode>|<Status>|<SubTotal>
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
It allows to void an sale by giving line number. For example, there are 3 items sold in the document, assume that this items belong to same department.
ITEM A %1 *1.20
ITEM B %1 *1.50
ITEM C %1 *1.80
If "ITEM B" is required Void, then use this function by setting "lineNumber" parameter as "2". Because it is located in line 2. Each receipt operaiton represents a line. Another example, assume you voide item b and do 2 more sales as follows;
ITEM A %1 *1.20
ITEM B %1 *1.50
ITEM C %1 *1.80
VOID
ITEM B %1 *-1.50
ITEM D %1 *1.90
ITEM E %1 *2.10
If you want to void ITEM E, use this function by setting "lineNumber" parameter as "6".
Parameters:
name | description | type |
---|---|---|
lineNumer | order number of the operation | int(1-number of lines in current document) |
Return value: |
<ErrCode>|<Status>|<SubTotal>
Restrictions:
- Only T300 model supports this functionality
Prints or gets subtotal of current document.
Parameters:
name | description | type |
---|---|---|
harcopy | prints subtotal or not | boolean(true: prints subtotal otherwise not) |
Return value:
<ErrCode>|<Status>|<SubTotal>|<PaymentAmount>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
Keeps payment until payment amount equals to subtotal. If payments total equals to subtotal, all payment printed together. Sales application can void payment if payments has not printed.
Parameters:
name | description | type |
---|---|---|
paymentType | type of payment | 0 : Cash 1 : Credit 2 : Check 3: Foreign Currency |
index | payment index, Used for payment type 1(Credit) and 3(Foreign currency). For Credit payment, this parameter represents credit's sub types such as WORLD, BONUS etx. For Foreign currency payment, this parameter represents currency's sub type such as DOLLAR, EURO, STERLIN etc. | Int(Max defined credit count or max defined foreign currency) |
paidTotal | payment amount | Decimal(999999,99) |
Return value:
<ErrCode>|<Status>|<SubTotal>|<PaidTotal>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
57 | ERR_INVALID_PAYMENT |
58 | ERR_PAYMENT_LIMIT |
74 | ERR_CREDIT_NOT_DEFINED |
75 | ERR_CURRENCY_NOT_DEFINED |
94 | ERR_NOT_ENOUGH_MONEY |
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
To get Credit card info before EFT payment, this function called.
Parameters:
name | description | type |
---|---|---|
amount | requested payment amount | Decimal(999999,99) |
Return value:
<ErrCode>|Status>|<Hgnccid>|<Hgnccname>|<CardHolderName>|<CardNumber>|<DiscountEnable>
name | description | type |
---|---|---|
Hgnccid | HUGIN Id of card type. Sales application can saparete card type with this id. | Int(8) |
Hgnccname | Card Name such as WORLD, MAXIMUM, GARANTİ PLAY | String(20) |
CardHolderName | Card holder name | String(20) |
CardNumber | BIN of Card | String(16) |
DiscountEnable | To continue payment with this card, payment amount can be different when GetEFTAuthorisation() called if this value true. | boolean(true/false) |
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
74 | ERR_CREDIT_NOT_DEFINED |
172 | ERR_EFT_INCORRECT_CARD |
Takes payment from EFT-POS. To use this function, EFT-POS has to interated with ECR. EFT payment printed after payment total equals to subtotal.
Parameters:
name | description | type |
---|---|---|
amount | requested payment amount | Decimal(999999,99) |
installment | The number of installments selected by sales application | Int(99) |
cardNumber | First six characters of card number which get by GetCardInfo() function. This field is optional. | String(6) |
Return value:
<ErrCode>|Status>|<Subtotal>|<ProvisionID>|<Amount>|<AppliedInstallment>|<AcquirerId>|<BIN>|<IssuerId>|<SubOperationType>|<BatchNo>|<StanNo>|<TotalPaidAmount>
name | description | type |
---|---|---|
Subtotal | Subtotal of document | Decimal(999999,99) |
ProvisionID | Provision id of transaction | Int |
Amount | Amount which is paid by EFT | Decimal(999999,99) |
AppliedInstallment | The number of installments which is applied to payment. Installments number may be different from given value as parameter because some bank application allows only entering installments number on EFT-POS. | Int(99) |
AcquirerId | Acquirer bank id | String(3) |
BIN | First six characters of card | String(6) |
IssuerId | Issuer bank id | String(3) |
SubOperationType | Sub-Operation type id as enum (It returns only Vx675 model integration. On the rest of models, returns 0) | Int(3) |
BatchNo | EFT Payment batch number | Int(3) |
StanNo | EFT Payment standing number | Int(3) |
TotalPaidAmount | Total paid amount of document | Decimal(999999,99) |
SUB-OPERATION TYPES:
{
SATIS = 1, "Sale"
YBELGE = 10, "New document"
TAKSITLI_SATIS = 04, "Installment sales"
VADE_FARKLI_SATIS = 16, "Maturity different sales "
E_IADE = 20, "return document"
KISMI_IADE = 22,"partial return document"
KONTOR_SATIS = 13, "credits sale"
PUAN_SORGU = 14, "point query"
KK_BORC_ODEME = 05, "credit card debt payment"
PREPAID_NAKIT_YUKLEME = 29, "pre-paid cash load"
PREPAID_KARTLI_YUKLEME = 30, "pre-paid loading with payment card"
CASHBACK = 12, "cash back"
}
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
57 | ERR_INVALID_PAYMENT |
58 | ERR_PAYMENT_LIMIT |
74 | ERR_CREDIT_NOT_DEFINED |
Saves BIN list
Parameters:
name | description | type |
---|---|---|
cardList | list of card info | Array(string(ccid+ccname+bin)) |
Return value:
<ErrCode>|<Status>
Error Code | Title |
---|---|
1 | ERR_DATA_CORRUPT |
3 | ERR_INVALID_STATE |
5 | ERR_INVALID_PRM |
Voids payment that done by EFT-POS. This function allows void all amount of payment which paid by credit card after receipt closed.
Parameters:
name | description | type |
---|---|---|
acquierID | Acquier id is a bank institution that processes credit or debit card payments. Before the void payment, Sales application should get bank application list from EFT device with calling GetBankListOnEFT() and then Operator choses the bank application that process void operation. | int(9999) |
batchNo | slip batch no which writes on slip. Operator enters this value according to slip copy. | int(9999) |
stanNo | slip stan(sequnece) no which writes on slip. Operator enters this value according to slip copy. | int(9999) |
Return value:
<ErrCode>|<Status>|<Amount>|<AcquierID>|<IssuerID>|<CardNumber>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
5 | ERR_INVALID_PRM |
176 | ERR_EFT_VOID_FAIL |
Starts refund operation on EFT-POS. This function allows to partial refund of credit card payment after receipt is closed.
Parameters:
name | description | type |
---|---|---|
acquierID | Acquier id is a bank institution that processes credit or debit card payments. Before the refund partial payment amount, Sales application should get bank application list from EFT device with calling GetBankListOnEFT() and then Operator choses the bank application that process void operation. | int(9999) |
amount | amount of refund operation | decimal(999999,99) |
Return value:
<ErrCode>|<Status>|<Amount>|<AcquierID>|<IssuerID>|<CardNumber>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
5 | ERR_INVALID_PRM |
177 | ERR_EFT_RETURN_FAIL |
Gets EFT slip copy. You can get with batch no & stan no or Z no & receipt no parameters. Acquier id area is neccesary both.
Parameters:
name | description | type |
---|---|---|
acquierID | Bank acquier id on pos bank list | int(9999) |
batchNo | slip batch no | int(9999) |
stanNo | slip stan no | int(9999) |
zNo | slip Z number | int(999) |
receiptNo | slip document no | int(9999) |
Return value:
<ErrCode>|<Status>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
5 | ERR_INVALID_PRM |
177 | ERR_EFT_RETURN_FAIL |
Gets bank list on EFT-POS
string BankInfo = acquierID(4) + bankName
Return value:
<ErrCode>|<Status> |<BankInfo_1>|<BankInfo_2>|<BankInfo_3>|......|<BankInfo_N>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
5 | ERR_INVALID_PRM |
177 | ERR_EFT_RETURN_FAIL |
Gets sales info
Return value:
<ErrCode>|<Status> |<DocumentNo>|<ZNo>|<DocumentType>|<Date>|<Time>|<Subtotal>|
payments(<PaymentType>|<PaymentIndex>|<Amount>|<Note>)
DocumentType list: 0. z report
- Receipt
- Receipt voided
- Info receipt, like x report, departments report
- like financial report
- like ej periodic report
- Receipt voided after power down
- non fiscal reports
- not in use,
- voided nonfiscal document,
- Invoice document
- e-archive or e-invoice
- voided e-archive or e-invoice
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
Voids payment if there is unpaid amount. Payments must be not printed.
Parameters:
name | description | type |
---|---|---|
paymentSequenceNo | Sequence number of payment which sent. Sequence starts from zero so first payment index is zero | Int(0-8) |
Return value:
<ErrCode>|<Status>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
54 | ERR_INVALID_VOID |
176 | ERR_EFT_VOID_FAIL |
Closes receipt
Parameters:
name | description | type |
---|---|---|
slipCopy | If there is a EFT-POS payment in payments, ECR prints EFT payment slips after receipt closed. | boolean(true; prints EFT-POS payment slip copy otherwise don't). |
Return value:
<ErrCode>|<Status>|<ReceiptNumber>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
Voids receipt
Return value:
<ErrCode>|<Status>|<ReceiptNumber>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
Prints barcode on receipt footer. Barcode format is code128. Only one barcode can print for each receipt. This function is supported only FP300 model.
Parameters:
name | description | type |
---|---|---|
barcode | barcode to print | String(17) |
Return value:
<ErrCode>|<Status>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
Prints remark lines. Supported states for print remark are SELLING and OPEN_SALE.
Parameters:
name | description | type |
---|---|---|
lines | line to print | String Array(Line length: FP300-> 45, FT202,Vx675-> 29) |
Return value:
<ErrCode>|<Status>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
Prints JSON Object string as a sale document. You have to sign in with Cashier 9 because products saved when selling.
HUGIN JSON PLU Sale Document Object:
enum PaymentType
{
CASH,
CREDIT,
CHECK,
F_CURRENCY
}
enum AdjustmentType : sbyte
{
FEE,
PERCENT_FEE,
DISCOUNT,
PERCENT_DISCOUNT
}
class Adjustment
{
public AdjustmentType Type = AdjustmentType.Discount;
public decimal Amount = 0m;
public int percentage = 0;
public string NoteLine1;
public string NoteLine2;
}
class PaymentInfo
{
public PaymentType Type = 0;
public int Index = 0;
public decimal PaidTotal = 0.00m;
}
class JSONItem
{
public int Id;
public decimal Quantity;
public decimal Price;
public string Name;
public string Barcode;
public int DeptId;
public int Status;
public Adjustment Adj = null;
public string NoteLine1;
public string NoteLine2;
}
class EndOfReceipt
{
public bool CloseReceiptFlag = true;
public bool BarcodeFlag = false;
public string Barcode;
}
class JSONDocument
{
public List<JSONItem> FiscalItems = new List<JSONItem>();
public List<Adjustment> Adjustments = new List<Adjustment>();
public List<PaymentInfo> Payments = new List<PaymentInfo>();
public List<String> FooterNotes = new List<string>();
}
NOTE : NoteLine1 and NoteLine2 areas on JSONItem and Adjustment, only used for PrintJSONDocumentDeptOnly and PrintSalesDocument funcs.
Parameters:
name | description | type |
---|---|---|
jsonStr | json object | string |
Sample JSON;
{
"FiscalItems":[{
"Id":13,
"Quantity":1.0,
"Price":11.0,
"Name":"LIPTON ÇAY",
"DeptId":1,
"Status":0,
"Adj":null,
"NoteLine1":"DEMLIK POŞET"
},{
"Id":7,
"Quantity":25.0,
"Price":0.70,
"Name":"YUMURTA",
"DeptId":3,
"Status":0,
"Adj":{"Type":3,"Amount":-0.88,"percentage":5},
"NoteLine1":"DOĞAL KÖY YUMURTASI"
},{
"Id":9,
"Quantity":2.0,
"Price":1.2,
"Name":"ÜLKER ÇİZİ",
"DeptId":3,"Status":0,
"Adj":null
},{
"Id":3,
"Quantity":1.35,
"Price":11.95,
"Name":"BEYAZ PEYNİR",
"DeptId":3,
"Status":1,
"Adj":null
},{
"Id":5,
"Quantity":1.0,
"Price":8.95,
"Name":"YOĞURT",
"DeptId":3,
"Status":0,
"Adj":{"Type":1,"Amount":0.45,"percentage":5,"NoteLine1":"SÜT HAFTASI ÖZEL İNDİRİMİ"}
},{
"Id":2,
"Quantity":2.5,
"Price":4.49,
"Name":"BULGUR",
"DeptId":2,
"Status":1,
"Adj":null
}],
"Adjustments":[{
"Type":3,
"Amount":-10.02,
"percentage":15,
"NoteLine1":"ÖZEL MÜŞTERİ İNDİRİMİ"
}],
"Payments":[{
"Type":0,
"Index":0,
"PaidTotal":20.0,
"SequenceNo":0
},{
"Type":1,
"Index":0,
"PaidTotal":36.76,
"SequenceNo":1
}],
"FooterNotes":[
"ÜRÜN İNDİRİMİ : *0,43",
"ARATOP İNDİRİMİ: *10,02",
"TOPLAM İNDİRİM : *10,45",
" **** İYİ GÜNLER ****",
" www.hugin.com.tr",
" 0212 212 2121",
" MERSİS NO: 121244112344123124"
],
"EndOfReceiptInfo":{"CloseReceiptFlag":false,"BarcodeFlag":false,"Barcode":null}
}
Return value:
<ErrCode>|<Status>
Prints Hugin Json sales document. (You can find Hugin Json Sale Document Object under at PrintJSONDocument title) ECR must be in selling state. It means PrintDocumentHeader called before. The sample Json document placed under PrintJSONDocument title.
Note areas on JSONItem and Adjustment objects can be used for this function. Notes can be placed after sale item and item adjustments. Notes must be max 2 line: 2 x 48 characters for FP300 Printers 2 x 36 characters for FT202 Printers
Parameters:
name | description | type |
---|---|---|
jsonStr | json object | string |
Return value:
<ErrCode>|<Status>
Prints Hugin Json sales document. (Differents with PrintJSONDocumentDeptOnly, this function send sales document info in one packege to printer, so its more faster )
Parameters:
name | description | type |
---|---|---|
jsonStr | json object | string |
Return value:
<ErrCode>|<Status>|<ZId>|<ReceiptId>|<Date>|<Time>|<DocumentType>|
Payment info block repeats for each payment
<PaymentType>|<Index>|<PaidTotal>|<PaymentNote>
3.2.32. string PrintCurrentAccountCollectionDocumentHeader (string tcknVkn, string customerName, string docSerial, DateTime docDate, decimal amount)
Prints current acount collection document header
Parameters:
name | description | type |
---|---|---|
tcknVkn | customer TCKN or VKN | string(10 |
customerName | customer name | string(30) |
docSerial | document serial | string(30) |
docDate | document date | DateTime |
amount | document amount | Decimal(999.999,99) |
Return value:
<ErrCode>|<Status>|<DocumentNo>
3.2.32.1. string PrintCurrentAccountCollectionDocumentHeader(string tcknVkn, string customerName, string docSerial, DateTime docDate, int amount)
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
Prints barcode with choosen type to end of receipt. (For Vx675 model)
BARCODE TYPES: 1- EAN 2- QRN 3- C039 4- C128
Parameters:
name | description | type |
---|---|---|
barcodeType | barcode type as enum value | int(1-4) |
barcode | barcode | string |
Return value:
<ErrCode>|<Status>
Prints E-Archieve or E-Invoice document on FP300.
Parameters:
name | description | type |
---|---|---|
docType | document type enum value: E-Invoice = 2, E-Archieve = 3 | int(2 or 3) |
_lines _ | lines to print | string array |
Return value:
<ErrCode>|<Status>
Prints EFT payment content on FP300 ECR. This function used only when EFT-POS device managed by Sales Application, that means EFT-POS connected to PC directly. Function allows to print Customer copy, Merchant copy and Error slips.
Parameters:
name | description | type |
---|---|---|
type | Slip types: 1- Customer copy 2- Merchant copy 3- Error Slips |
int |
lines | Slip contents. First character of line indicates font information of line. 1- Normal 2- Medium 3- Bold |
string[] |
Return value:
<ErrCode>|<Status>
Errors:
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE Call this function after payments are completed. |
5 | ERR_INVALID_PRM |
111 | ERR_LINE_LEN Invalid line length |
3.2.2.36. string PrintInvoiceHeader(DateTime invoiceDT, string serial, string orderNo, Customer customerInfo)
Starts invoice from internal printer.
Parameters:
name | description | type |
---|---|---|
invoiceDT | invoice date time | DateTime |
serial | invoice serial number | string(10) |
orderNo | invoice order number | string(10) |
customerInfo | customer info | Hugin.Common.Customer |
Return value:
<ErrCode>|<Status>|<DocumentNo>|<ZNo>|<VatRate>|<VatAmount>
3.2.2.37. string PrintReturnDocumentHeader(DateTime invoiceDT, string serial, string orderNo, Customer customerInfo)
Starts Return Document.
Parameters:
name | description | type |
---|---|---|
invoiceDT | invoice date time | DateTime |
serial | document serial number | string(10) |
orderNo | document order number | string(10) |
customerInfo | customer info | Hugin.Common.Customer |
Return value:
<ErrCode>|<Status>|<DocumentNo>|<ZNo>|<VatRate>|<VatAmount>
Starts Self Employment Invoice
Parameters:
name | description | type |
---|---|---|
customerInfo | customer info | Hugin.Common.Customer |
services | list of services | Hugin.Common.Service[] |
Return value:
<ErrCode>|<Status>|<DocumentNo>|<ZNo>|<VatRate>|<VatAmount>
Gets subtotals using stoppage amount.
Parameters:
name | description | type |
---|---|---|
stoppageAmount | stopaj amount | Decimal(999999,98) |
Return value:
<ErrCode>|<Status>|<DocumentNo>|<ZNo>|<VatRate>|<VatAmount>
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
Parameters:
name | description | type |
---|---|---|
acquierID | It is the ID value that identifies the bank in credit card and debit card payments.r. |
Return value:
<ErrCode>|<Status>
Errors:
Error Code | Enum Value | Description |
---|---|---|
3 | ERR_INVALID_STATE | İnvalid state. Application state is not suitable |
5 | ERR_INVALID_PRM | Invalid parameter. Given parameter of function is invalid |
177 | ERR_EFT_RETURN_FAIL | Failed EFT return transaction |
Sales application can trigger ECR for take report. Functions for report listed at this subject. Sales application may reveive report content without print lines. In such a case, some function takes copy paramter, it means print report on paper or get only report content or either print and get content.
copy parameter takes these values,
value | description |
---|---|
1 | Get content only (not supported) |
2 | Print paper only |
3 | Print paper and get content(not supported) |
Common Error codes in report functions are,
Error Code | Title |
---|---|
3 | ERR_INVALID_STATE |
20 | ERR_FM_CLOSED |
91 | ERR_CAHIER_AUTH |
8 | ERR_NO_PAPER |
32 | ERR_EJ_REMOVED |
33 | ERR_EJ_MISMATCH |
34 | ERR_EJ_OLD |
35 | ERR_NEW_EJ |
36 | ERR_EJ_ZREQUIRED |
38 | ERR_EJ_FULL |
5 | ERR_INVALID_PRM |
Prints X report. X report includes all Z report contents but X report is not fiscal report. X report provides to see Z report contents without reset payments
Parameters:
name | description | type |
---|---|---|
copy | printer target copy option | Int(1-3) |
Return value:
<ErrCode>|<Status>|<DocNo>|<ZNo>
Prints X report between given plu range. PLU range must be smaller than 1000 PLU.
Parameters:
name | description | type |
---|---|---|
firstPlu | First PLU number | Int(1-200000) |
lastPlu | Last PLU number | Int(1-200000) |
copy | printer target copy option | Int(1-3) |
Return value:
<ErrCode>|<Status>|<DocNo>|<ZNo>
Errors:
Error Code | Title |
---|---|
59 | ERR_DAILY_PLU_LIMIT |
Prints system info report.
Parameters:
name | description | type |
---|---|---|
copy | printer target copy option | Int(1-3) |
Prints receipt summary report. This report includes totals of sales grouped by receipt.
Parameters:
name | description | type |
---|---|---|
copy | printer target copy option | Int(1-3) |
Errors:
Error Code | Title |
---|---|
97 | ERR_ECR_NONFISCAL |
Prints Z report. Z report is a typical end-of-day report containing all balances of sold items per category and the total amount that should be in the drawer. It resets day totals
Return value:
<ErrCode>|<Status>|<DocNo>|<ZNo>
Errors:
Error Code | Title |
---|---|
17 | ERR_FM_DAILY_LIMIT |
18 | ERR_FM_FULL |
Prints periodic report. Report contains payment informations between two dates.
Parameters:
name | description | type |
---|---|---|
firstDay | first day value | DateTime(Fiscalization date to Last receipt date) |
lastDay | last day value | DateTime(Fiscalization date to Last receipt date) |
copy | printer target | Int(1-3) |
detail | detailed or not | boolean(true means each receipt total will be printed in report) |
Return value:
<ErrCode>|<Status>|<DocNo>|<ZNo>
Errors:
Error Code | Title |
---|---|
77 | ERR_FMSEARCH_NO_RESULT |
97 | ERR_ECR_NONFISCAL |
Prints periodic report. Periodic report contains one or more Z report informations.
Parameters:
name | description | type |
---|---|---|
firstZ | First Z id of range | Int(1-3650) |
lastZ | Last Z id of range | Int(1-3650) |
copy | printer target | Int(1-3) |
detail | detailed or not | boolean(true means each receipt total will be printed in report) |
Return value:
<ErrCode>|<Status>|<DocNo>|<ZNo>
Errors:
Error Code | Title |
---|---|
77 | ERR_FMSEARCH_NO_RESULT |
97 | ERR_ECR_NONFISCAL |
Prints periodic reports daily. This report can take only fiscal mode.
Parameters:
name | description | type |
---|---|---|
day | Reporting date | DateTime |
copy | printer target | Int(1-3) |
Return value:
<ErrCode>|<Status>|<DocNo>|<ZNo>
Prints periodic reports between two dates. This report can take only fiscal mode.
Parameters:
name | description | type |
---|---|---|
startTime | Starting date | DateTime(Fiscalization date to Last receipt date) |
endTime | End date | DateTime(Fiscalization date to Last receipt date) |
copy | printer target | Int(1-3) |
Return value:
<ErrCode>|<Status>|<DocNo>|<ZNo>
Prints periodic reports between two z numbers. This report can take only fiscal mode.
Parameters:
name | description | type |
---|---|---|
ZStartId | First Z number where the reports starts | Int(1-3650) |
docStartId | First document id where the report starts | Int(9999) |
ZEndId | Last Z number where the reports ends | Int(1-3650) |
docEndId | Last document id where the report ends | Int(9999) |
copy | Printer target | Int(1-3) |
Return value:
<ErrCode>|<Status>|<DocNo>|<ZNo>
Prints report that general information about the use of EJ. EJ No, Frist Z no, Last Z no, First Receipt no, Last Receipt No, Total EJ Line, Used EJ Line
name | description | type |
---|---|---|
copy | Printer target | Int(1-3) |
Return value:
<ErrCode>|<Status>|<EJNo>|<FirstZNo>|<FirstReceiptNo>|<LastZNo>|<LastReceiptNo>|<TotalEJLine>|<UsedEJLine>
Prints end day report on EFT-POS
Return value:
<ErrCode>|<Status>
Z Prints the report. The Z report is some kind of end-of-day report. Includes the department and total amount information of the products sold. The day resets the total values.
Parameters:
name | description | type |
---|---|---|
copy | print option | int values: 0 : Paper 1 : Main Unit 2 : Both |
Return value:
<ErrCode>|<Status>|<DocumentNo>|<ZNo>
Errors:
Error Code | Enum Values | Description |
---|---|---|
17 | ERR_FM_DAILY_LIMIT | Daily Z limit.This error occurs, if you exceed Z report count per a day. You have to wait next day to take Z report. |
18 | ERR_FM_FULL | FM is full ECR is blocked, Service intervention required. |
Parameters:
name | description | type |
---|---|---|
count | print option | Int(1-3) |
amount | miktar | decimal |
isAffectDawer | print option | boolean(true/false) |
Return value:
<ErrCode>|<Status>|<EJNo>|<FirstZNo>|<FirstReceiptNo>|<LastZNo>|<LastReceiptNo>|<TotalEJLine>|<UsedEJLine>
Used to retrieve the contents of the last printed report.
Return value:
<ErrCode>|<Status>|<DocumentNo>|<ZNo>|<ReportContent>
Used to receive an EJcopy of other documents (invoice, return document and self-employment invoice) between two dates.
Parameters:
name | description | type |
---|---|---|
firstDate | first date | DateTime |
lastDate | last date | DateTime |
oDocType | Document Type | Int(0-2) |
Return value:
<ErrCode>|<Status>|<DocumentNo>|<ZNo>
It is used to receive an EJcopy of other documents (invoice, return document, self-employment invoice).
Parameters:
name | description | type |
---|---|---|
oDocType | Document Type | Int(0-2) |
Return value:
<ErrCode>|<Status>|<DocumentNo>|<ZNo>
Gives information about printer status. Sales application can learn ECR state or blocking error reason with this function. This function can only use getting status, cannot do any fiscal operation.
Return value:
<ErrCode>|<Status>|<Date>|<Time>|NULL|NULL|NULL|NULL|NULL
Signs in cashier
Parameters:
name | description | type |
---|---|---|
id | cashier id to be sign in | Int(1-9) |
password | cashier password have to be formed numeric characters | String(5) |
Return value:
<ErrCode>|<Status>|NULL|NULL|<CashierName>|NULL|NULL|NULL<AuthorizationLvl>
Default Cashier:
id | password | authorized level | description |
---|---|---|---|
1,2,3,4,5 | 1234 | Sale | These cashiers can only sale. |
6,7,8, | 1357 | Sale, Z report | These cashiers can Sale and take Z report |
9 | 14710 | Sale, Z Report, Program | This cashier can change settings, Sale and take Z report |
Errors:
Error Code | Title |
---|---|
91 | ERR_CASHIER_AUTH |
To check cashier's password and gets unsuccessful login attempt. Unsuccessful login attempt count is five per a day. If cashier exceed this count, cashier is blocked for 24 hours.
Parameters:
name | description | type |
---|---|---|
id | cashier id to be check | Int(1-9) |
password | cashier password have to be formed numeric characters | String(5) |
Return value:
<ErrCode>|<Status>|NULL|NULL|<KasiyerID>|NULL|NULL| <IncorrectLoginCount>| <AuthorizationLvl>|
Errors:
Error Code | Title |
---|---|
91 | ERR_CASHIER_AUTH |
Makes inflow cash to cash register
Parameters:
name | description | type |
---|---|---|
amount | value of cash amount | Decimal(999999,99) |
Return value:
<ErrCode>|<Status>|NULL|NULL|NULL|<Amount>|NULL|NULL|NULL|
Errors:
Error Code | Title |
---|---|
96 | ERR_DAILY_TOTAL_LIMIT |
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
Makes outflow cash from cash register
Parameters:
name | description | type |
---|---|---|
amount | value of cash amount | Decimal(999999,99) |
Return value:
<ErrCode>|<Status>|NULL|NULL|NULL|<Amount>|NULL|NULL|NULL|
Errors:
Error Code | Title |
---|---|
94 | ERR_NOT_ENOUGH_MONEY |
It has the same properties as the previous method, the only difference is the parameter which has int value instead of the decimal.
Start matching with ECR
Connected connection object must belong to;
System.IO.Ports.SerialPort
or
System.Net.Sockets.Socket classes.
DeviceInfo class is accessible on Hugin.Common DLL class library.
Parameters:
name | description | type |
---|---|---|
connObj | connection object on your side | |
serverInfo | server device info object |
Return value:
true if matching done successfully
Gets drawer info from ECR
Return value:
<ErrCode>|<Status>|<TotalDocumentCount>|<TotalAmount>|<FiscalReceiptCount>| <FiscalReceiptTotalAmount>|<VoidedDocumentCount>|<VoidedAmount>|<DiscountTotalAmount>|<CashInId>|<CashInCount>|<CashInAmount>|<CashOutId>|<CashOutCount>|<CashOutAmount>|<PaymentType>|<Index>|<Amount>
Repeaitive Payments Block:
<PaymentType>|<Index>|<Amount>
Gets information about last printed document.
Parameters:
name | description | type |
---|---|---|
lastZ | Gets last Z Report Info otherwise last receipt info returns | boolean(true gets last Z report info) |
Return value:
<ErrCode>|<Status>|<DocumentId>|<ZNo>|<EJNo>|<DocumentType>| <DocumentDate>| <DocumentTime>
Try to cancel printing report. Some reports support this function.
Return value:
<ErrCode>|<Status>
Opens drawer.
Return value:
<ErrCode>|<Status>
Starts non-fiscal receipt. Used for free text reports or documents.
Return value:
<ErrCode>|<Status>
Errors:
Error Code | Title |
---|---|
95 | ERR_DAILY_RCPT_COUNT |
Writes comment lines to non-fiscal receipt
Parameters:
name | description | type |
---|---|---|
lines | lines to write as string array | String Array (Line length is 48 for FP300, 32 for FT202 and Vx675 models) |
Return value:
<ErrCode>|<Status>
Closes non-fiscal receipt
Return value:
<ErrCode>|<Status>
Gets last log info on ECR
Return value:
<Command>|<SequenceNo>|<FPUState>|<ErrorCode>|<ErrorMessage>
Gets connected ECR version info.
Retrun value:
<VersionInfo>
Returns current static CompactPrinter instance. If printer instance is null, creates new instance.
You have to set printer fiscal serial info before calling Connect method. Get and Set accesors already exists in this property.
Returns true if external device model is Vx675.
You can set or get library logging directory with this property.
NOTE : In Java Library, this property equals to "SetDebugFolder(string path)"
Provides you to set the log level. There are 6 log levels.
public enum LogLevel
{
FATAL = 1,
ERROR = 2,
WARN = 3,
INFO = 4,
DEBUG = 5,
HIDE_BUG = 6
}
NOTE: In Java Library, it equals to "SetDebugLevel(int level)"
Gets current library assembly version info.
Gets supported buffer size info by library serial port or TCP/IP connection.