Package com.datecs.fiscalprinter.SDK.model.UserLayerV2

# Class cmdReceipt.FiscalSale

java.lang.Object
com.datecs.fiscalprinter.SDK.model.DatecsFiscalDevice
com.datecs.fiscalprinter.SDK.model.UserLayerV2.cmdReceipt
com.datecs.fiscalprinter.SDK.model.UserLayerV2.cmdReceipt.FiscalSale

Enclosing class:
  cmdReceipt

    public static class cmdReceipt.FiscalSale
    extends cmdReceipt

Class of the sale process and the transactions associated with it

- ## Nested Class Summary

  Nested Classes
  Modifier and Type | Class | Description
  --- | --- | ---
  `static class` | `cmdReceipt.FiscalSale.DiscountType` |
  `static class` | `cmdReceipt.FiscalSale.TypeOfCardPayment` |
  `static class` | `cmdReceipt.FiscalSale.TypeOfChange` |

  ## Nested classes/interfaces inherited from class com.datecs.fiscalprinter.SDK.model.UserLayerV2.cmdReceipt

  `cmdReceipt.AlignmentType, cmdReceipt.BarcdeType, cmdReceipt.FiscalReceipt, cmdReceipt.FiscalSale, cmdReceipt.FiscalTransaction, cmdReceipt.NonFiscalReceipt, cmdReceipt.PaymentType, cmdReceipt.SeparatingLine`

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `FiscalSale()` |
  `FiscalSale​(java.lang.String pluName, java.lang.String taxCd, java.lang.String price)` |
  `FiscalSale​(java.lang.String pluName, java.lang.String taxCd, java.lang.String price, java.lang.String quantity, cmdReceipt.FiscalSale.DiscountType discountType, java.lang.String discountValue, java.lang.String department, java.lang.String unit)` | Constructor with All parameters:
  `FiscalSale​(java.lang.String pluName, java.lang.String taxCd, java.lang.String price, java.lang.String quantity, java.lang.String department)` | Constructor with Mandatory parameters:

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `cmdReceipt.FiscalSale` | `add()` | Registration of free sale ,parameters are set in the constructor.
  `cmdReceipt.FiscalSale` | `add​(java.lang.String pluName, java.lang.String taxCd, java.lang.String dept, java.lang.String price, java.lang.String qwan, cmdReceipt.FiscalSale.DiscountType discountType, java.lang.String discValueStr)` | Registration of free sale with discount, Without department and quantity is 1
  `cmdReceipt.FiscalSale` | `add​(java.lang.String pluName, java.lang.String taxCd, java.lang.String department, java.lang.String price, java.lang.String quantity, cmdReceipt.FiscalSale.DiscountType discountType, java.lang.String discountValue, java.lang.String unit)` | Registration of free sale with all parameters
  `int` | `addByPLU​(java.lang.String pluCode, java.lang.String quantity, java.lang.String price, cmdReceipt.FiscalSale.DiscountType discountType, java.lang.String discountValue)` | Registering the sale of a programmed item
  `cmdReceipt.FiscalSale` | `addWithUnit()` | Registration of free sale ,parameters are set in the constructor.
  `java.lang.String` | `printSubtotal​(boolean display, cmdReceipt.FiscalSale.DiscountType discountType, java.lang.String discountValue)` | printSubtotal - Printing the current subtotal on the Fiscal Receipt, if there is a correction (surcharge, discount) it will affect to the amount! After the execution of this method, it is forbidden to add items to the fiscal receipt!
  `java.lang.String` | `readSubtotal​(boolean display, cmdReceipt.FiscalSale.DiscountType discountType, java.lang.String discountValue)` | readSubtotal -
  `void` | `saleTotal​(cmdReceipt.PaymentType paymentType, java.lang.String tenderAmount)` | Payments and calculation of the total sum with current currency;
  `void` | `saleTotalDebitCard​(java.lang.String tenderAmount, cmdReceipt.FiscalSale.TypeOfCardPayment typeOfCardPayment)` | Payments and calculation of the total sum with card payment.
  `void` | `saleTotalForeignCurrency​(java.lang.String tenderAmount, cmdReceipt.FiscalSale.TypeOfChange typeOfChange)` | Payments and calculation of the total sum with Foreign currency.

  ### Methods inherited from class com.datecs.fiscalprinter.SDK.model.UserLayerV2.cmdReceipt

  `cashInCashOut, drawerKickOut, isStornoReceiptOpen, paperCutting, paperFeed, printBarcode, printFreeText`

  ### Methods inherited from class com.datecs.fiscalprinter.SDK.model.DatecsFiscalDevice

  `checkErrorCode, close, getConnectedECRV1, getConnectedModelV2, getConnectedPrinterV1, getCountryCode, getMaxDepartments, getMaxStockGroup, isCheckLastError, isConnectedDeviceV2, isConnectedECR, isConnectedPrinter, isEditItemPrice, isEditItemQTY, isFontSupported, isPaperCuttingDevice, setCheckLastError, setConnectedModel, setConnectedModel, setConnectedModel, setCountryCode`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FiscalSale

    public FiscalSale()

  - ### FiscalSale

    public FiscalSale​(java.lang.String pluName, java.lang.String taxCd, java.lang.String price, java.lang.String quantity, java.lang.String department)
    Constructor with Mandatory parameters:
    Parameters:
      `pluName` - Name of product, up to 72 characters not empty string;
      `taxCd` - Tax code; 1,2,3...8
      `price` - Product price, with sign '-' at void operations. Format: 2 decimals; up to *9999999.99
      `quantity` - Quantity of the product ( default: 1.000 ); Format: 3 decimals; up to *999999.999
      `department` - Number of the department 0..99; If '0' - Without department;

  - ### FiscalSale

    public FiscalSale​(java.lang.String pluName, java.lang.String taxCd, java.lang.String price, java.lang.String quantity, cmdReceipt.FiscalSale.DiscountType discountType, java.lang.String discountValue, java.lang.String department, java.lang.String unit)
    Constructor with All parameters:
    Parameters:
      `pluName` - Name of product, up to 72 characters not empty string;
      `taxCd` - Tax code; 1,2,3...8
      `price` - Product price, with sign '-' at void operations. Format: 2 decimals; up to *9999999.99
      `quantity` - Quantity of the product ( default: 1.000 ); Format: 3 decimals; up to *999999.999
      `discountType` - - type of discount. noDiscount, surchargePercentage, discountPercentage, surchargeSum, discountSum
      `discountValue` - - value of discount. a number from 0.01 to 9999999.99 for sum operations; a number from 0.01 to 99.99 for percentage operations;
      `department` - Number of the department 0..99; If '0' - Without department;
      `unit` - Unit name, up to 6 characters not empty string;

  - ### FiscalSale

    public FiscalSale​(java.lang.String pluName, java.lang.String taxCd, java.lang.String price)

- ## Method Details

  - ### addByPLU

    public int addByPLU​(java.lang.String pluCode, java.lang.String quantity, java.lang.String price, cmdReceipt.FiscalSale.DiscountType discountType, java.lang.String discountValue) throws java.lang.Exception
    Registering the sale of a programmed item
    Parameters:
      `pluCode` - The code of the item. from 1 to MAX_PLU. MAX_PLU: ECR-100000, Printer-3000;
      `price` - Product price, with sign '-' at void operations. Format: 2 decimals; up to *9999999.99
      `quantity` - Quantity of the product ( default: 1.000 ); Format: 3 decimals; up to *999999.999
      `discountType` - - type of discount. noDiscount, surchargePercentage, discountPercentage, surchargeSum, discountSum
      `discountValue` - - value of discount. a number from 0.01 to 9999999.99 for sum operations; a number from 0.01 to 99.99 for percentage operations;
    Returns:
      - Current slip number (1...9999999);
    Throws:
      `java.lang.Exception`

  - ### addWithUnit

    public cmdReceipt.FiscalSale addWithUnit() throws java.lang.Exception
    Registration of free sale ,parameters are set in the constructor.
    Returns:
      Instance to Fiscal Sale
    Throws:
      `java.lang.Exception`

  - ### add

    public cmdReceipt.FiscalSale add() throws java.lang.Exception
    Registration of free sale ,parameters are set in the constructor.
    Returns:
      Instance to Fiscal Sale
    Throws:
      `java.lang.Exception`

  - ### add

    public cmdReceipt.FiscalSale add​(java.lang.String pluName, java.lang.String taxCd, java.lang.String department, java.lang.String price, java.lang.String quantity, cmdReceipt.FiscalSale.DiscountType discountType, java.lang.String discountValue, java.lang.String unit) throws java.lang.Exception
    Registration of free sale with all parameters
    Parameters:
      `pluName` - Name of product, up to 72 characters not empty string;
      `taxCd` - Tax code; 1,2,3...8
      `price` - Product price, with sign '-' at void operations. Format: 2 decimals; up to *9999999.99
      `quantity` - Quantity of the product ( default: 1.000 ); Format: 3 decimals; up to *999999.999
      `discountType` - - type of discount. noDiscount, surchargePercentage, discountPercentage, surchargeSum, discountSum
      `discountValue` - - value of discount. a number from 0.01 to 9999999.99 for sum operations; a number from 0.01 to 99.99 for percentage operations;
      `department` - Number of the department 0..99; If '0' - Without department;
      `unit` - Unit name, up to 6 characters not empty string;
    Returns:
      Instance to Fiscal Sale
    Throws:
      `java.lang.Exception`

  - ### add

    public cmdReceipt.FiscalSale add​(java.lang.String pluName, java.lang.String taxCd, java.lang.String dept, java.lang.String price, java.lang.String qwan, cmdReceipt.FiscalSale.DiscountType discountType, java.lang.String discValueStr) throws java.lang.Exception
    Registration of free sale with discount, Without department and quantity is 1
    Parameters:
      `pluName` - Name of product, up to 72 characters not empty string;
      `taxCd` - Tax code; 1,2,3...8
      `price` - Product price, with sign '-' at void operations. Format: 2 decimals; up to *9999999.99*
      `discountType` - - type of discount. noDiscount, surchargePercentage, discountPercentage, surchargeSum, discountSum
    Returns:
      Instance to Fiscal Sale
    Throws:
      `java.lang.Exception`

  - ### readSubtotal

    public java.lang.String readSubtotal​(boolean display, cmdReceipt.FiscalSale.DiscountType discountType, java.lang.String discountValue) throws java.lang.Exception
    readSubtotal -

    Returns the current subtotal on the Fiscal Receipt, if there is a correction (surcharge, discount) it will affect to the amount! After the execution of readSubtotal or printSubtotal, it is forbidden to add items to the fiscal receipt!

    Returns ot this method is identical to FiscalTransaction getAmountAsString. Use FiscalTransaction.getAmountAsString to add items after the calculation.

    Parameters:
      `display` - - to customer display
      `discountType` - - type of discount. noDiscount -no discount; surchargePercentage - surcharge by percentage; discountPercentage - discount by percentage; surchargeSum - surcharge by sum; discountSum - discount by sum;
      `discountValue` - value of discount. a number from 0.00 to 21474836.47 for sum operations; a number from 0.00 to 99.99 for percentage operations; If {DiscountType} is zero or empty, this parameter must be empty
    Returns:
      subtotal of the receipt ( 0.00...9999999.99 or 0...999999999 depending dec point position );
    Throws:
      `java.lang.Exception`

  - ### printSubtotal

    public java.lang.String printSubtotal​(boolean display, cmdReceipt.FiscalSale.DiscountType discountType, java.lang.String discountValue) throws java.lang.Exception
    printSubtotal - Printing the current subtotal on the Fiscal Receipt, if there is a correction (surcharge, discount) it will affect to the amount! After the execution of this method, it is forbidden to add items to the fiscal receipt!
    Parameters:
      `display` - - to customer display
      `discountType` - - type of discount. noDiscount -no discount; surchargePercentage - surcharge by percentage; discountPercentage - discount by percentage; surchargeSum - surcharge by sum; discountSum - discount by sum;
      `discountValue` - value of discount. a number from 0.00 to 21474836.47 for sum operations; a number from 0.00 to 99.99 for percentage operations; If {DiscountType} is zero or empty, this parameter must be empty
    Returns:
      subtotal of the receipt ( 0.00...9999999.99 or 0...999999999 depending dec point position );
    Throws:
      `java.lang.Exception`

  - ### saleTotal

    public void saleTotal​(cmdReceipt.PaymentType paymentType, java.lang.String tenderAmount) throws java.lang.Exception
    Payments and calculation of the total sum with current currency;
    Parameters:
      `paymentType` - - Type of payment; cash, credit_card, debit_card, other_pay3, other_pay4, other_pay5
      `tenderAmount` - - Amount to pay ( 0.00...9999999.99 or 0...999999999 depending dec point position );
    Throws:
      `java.lang.Exception`

  - ### saleTotalDebitCard

    public void saleTotalDebitCard​(java.lang.String tenderAmount, cmdReceipt.FiscalSale.TypeOfCardPayment typeOfCardPayment) throws java.lang.Exception
    Payments and calculation of the total sum with card payment. Only for payment with debit card - with PinPad connected !
    Parameters:
      `tenderAmount` - - Amount to pay ( 0.00...9999999.99 or 0...999999999 depending dec point position );
      `typeOfCardPayment` - - Type of card payment. Only for payment with debit card; - with money; - with points from loyal scheme;
    Throws:
      `java.lang.Exception`

  - ### saleTotalForeignCurrency

    public void saleTotalForeignCurrency​(java.lang.String tenderAmount, cmdReceipt.FiscalSale.TypeOfChange typeOfChange) throws java.lang.Exception
    Payments and calculation of the total sum with Foreign currency. Only for payment with debit card - with PinPad connected !
    Parameters:
      `tenderAmount` -
      `typeOfChange` - - Type of change currentCurrency, foreignCurrency
      `tenderAmount` - - Amount to pay ( 0.00...9999999.99 or 0...999999999 depending dec point position );
    Throws:
      `java.lang.Exception`