Class s.i.ICouponPrinter(IDevice):

Part of stoqdrivers.interfaces View In Hierarchy

Describes coupon related tasks for a printer.

Workflow:

                               --<--                     --<--
                              |     |                   |     |

[identify_customer] -> open -> add_item -> totalize -> add_payment -> close

Method coupon_identify_customer Identify the customer. This method doesn't have mandatory
Method coupon_is_customer_identified Returns True, if the customer have already been identified,
Method coupon_open This needs to be called before anything else (except
Method coupon_add_item Adds an item to the coupon.
Method coupon_cancel_item Cancels an item, item_id must be a value returned by
Method coupon_cancel Cancels the currently open coupon or the last closed open.
Method cancel_last_coupon Cancel the last closed non-fiscal coupon or the last sale.
Method coupon_totalize Closes the coupon applies addition a discount or surcharge and tax.
Method coupon_add_payment Add payment method to coupon.
Method coupon_close It needs to be possible to open new coupons after this is called.
Method summarize Prints a summary of all sales of the day. In Brazil this is
Method close_till Close the till for the day, no other actions can be done after
Method till_add_cash Add an till complement. This is called 'suprimento de caixa' on
Method till_remove_cash Retire payments from the till. This is called 'sangria' on Brazil
Method till_read_memory Reads the fiscal memory, from the date start to the date end
Method till_read_memory_by_reductions Reads the fiscal memory, from the start reductions to the end
Method get_payment_receipt_identifier If the printer requires an identifier to open a payment receipt,
Method payment_receipt_open Opens a non-fiscal bound receipt for a payment
Method payment_receipt_print Prints the payment receipt text
Method payment_receipt_close Closes previouly opened payment receipt
Method get_capabilities Returns a capabilities dictionary, where the keys are the strings
Method get_constants Returns the object that implements IDriverConstants where the printer
Method get_payment_constants Undocumented
Method get_serial Returns the serial number for the printer
Method get_sintegra Gets an object that implements ISintegraData or None.
Method get_firmware_version Firmware version of the printer
Method get_ccf Fiscal Coupon Counter
Method get_coo Operation Order Counter
Method get_gnf Nonfiscal Operation General Counter
Method get_crz Z Reduction Counter
Method get_user_registration_info Returns current ecf user registration date and time,
def coupon_identify_customer(customer, address, document):
Identify the customer. This method doesn't have mandatory execution (you can identify the customer only if you like), but when executed it must be called before calling any method.
Parameterscustomer (type: str )
address (type: str )
document (type: str )
def coupon_is_customer_identified():
Returns True, if the customer have already been identified, False otherwise.
def coupon_open():
This needs to be called before anything else (except identify_customer())
def coupon_add_item(code, description, price, taxcode, quantity=Decimal('1.0'), unit=UnitType.EMPTY, discount=Decimal('0.0'), surcharge=Decimal('0.0'), unit_desc=''):
Adds an item to the coupon.
Parameterscodeitem code identifier (type: str )
descriptiondescription of product
desription (type: str )
priceprice (type: Decimal )
taxcodeconstant to descrive the tax (type: str )
quantityquantity (type: Decimal )
unitconstant to describe the unit (type: integer constant one of: UnitType.LITERS, UnitType.EMPTY, UnitType.METERS, UnitType.WEIGHT, UnitType.CUSTOM. )
discountdiscount in % (type: Decimal between 0-100 )
surchargesurcharge in % (type: Decimal between 0-100 )
unit_descA 2-byte string representing the unit that applies to the product. (type: str )
Returnsidentifier of added item (type: Decimal )
def coupon_cancel_item(item_id):
Cancels an item, item_id must be a value returned by coupon_add_item
Parametersitem_idthe item id
def coupon_cancel():
Cancels the currently open coupon or the last closed open. You cannot close a previous coupon if you already created a new one.
def cancel_last_coupon():
Cancel the last closed non-fiscal coupon or the last sale.
def coupon_totalize(discount=Decimal('0.0'), surcharge=Decimal('0.0'), taxcode=TaxType.NONE):
Closes the coupon applies addition a discount or surcharge and tax. This can only be called when the coupon is open, has items added and payments added.
Parametersdiscountdiscount in % (type: Decimal between 0-100 )
surchargesurcharge in % (type: Decimal between 0-100 )
taxcodeconstant to descrive the tax (type: integer constant one of: TaxType.NONE, TaxType.SUBSTITUTION, TaxType.EXEMPTION )
Returns (type: Decimal @returns the coupon total value )
def coupon_add_payment(payment_method, value, description=u''):
Add payment method to coupon.
Parameterspayment_methodThe payment method. (type: a device specific value representing the payment value )
valueThe payment value (type: Decimal )
descriptionA simple description of the payment method to be appended to the coupon.
value (type: unicode )
Returnsthe total remaining amount (type: Decimal )
def coupon_close(message=''):
It needs to be possible to open new coupons after this is called. You must call coupon_totalize before calling this method.
Parametersmessagepromotional message (type: str )
Returnsidentifier of the coupon. (type: int )
def summarize():
Prints a summary of all sales of the day. In Brazil this is 'read X' operation.
def close_till(previous_day=False):
Close the till for the day, no other actions can be done after this is called. In Brazil this is 'reduce Z' operation
Parametersprevious_dayif this is to close a till opened previously
def till_add_cash(value):
Add an till complement. This is called 'suprimento de caixa' on Brazil
ParametersvalueThe value added (type: Decimal )
def till_remove_cash(value):
Retire payments from the till. This is called 'sangria' on Brazil
ParametersvalueThe value to remove (type: Decimal )
def till_read_memory(start, end):
Reads the fiscal memory, from the date start to the date end
Parametersstartstart date (type: datetime.date )
endend date (type: datetime.date )
def till_read_memory_by_reductions(start, end):
Reads the fiscal memory, from the start reductions to the end reductions
Parametersstartstart reductions (type: int )
endend reductions (type: int )
def get_payment_receipt_identifier(method_name):
If the printer requires an identifier to open a payment receipt, this method should return that identifier.
Parametersmethod_nameget receipt for specific method name.
def payment_receipt_open(identifier, coo, method, value):
Opens a non-fiscal bound receipt for a payment
Parametersidentifiera char (A-P) representing the receipt to use. The receipt must already be configured at the printer.
methodanother char (A-P) for the payment method. Also, this must be configured at the printer. The payment method must be bindable
coocoo for the coupon containing the payment
valuethe value of the payment
def payment_receipt_print(text):
Prints the payment receipt text
Parameterstexttext to be printed
def payment_receipt_close():
Closes previouly opened payment receipt
def get_capabilities():
Returns a capabilities dictionary, where the keys are the strings below and its values are Capability instances

* item_code (str) * item_id (int) * items_quantity (float) * item_price (float) * item_description (str) * payment_value (float) * payment_description (str) * promotional_message (str) * customer_name (str) * customer_id (str) * customer_address (str) * add_cash_value (float) * remove_cash_value (float)

def get_constants():
Returns the object that implements IDriverConstants where the printer is going to get constant values from.
def get_payment_constants():
Undocumented
def get_serial():
Returns the serial number for the printer
def get_sintegra():
Gets an object that implements ISintegraData or None.
def get_firmware_version():
Firmware version of the printer
def get_ccf():
Fiscal Coupon Counter
Returnsthe last document ccf (type: integer )
def get_coo():
Operation Order Counter
Returnsthe last document coo (type: integer )
def get_gnf():
Nonfiscal Operation General Counter
Returnsgnf (type: integer )
def get_crz():
Z Reduction Counter
Returnsthe last document crz (type: integer )
def get_user_registration_info():
Returns current ecf user registration date and time, id in the printer and cro relative to the user registration
API Documentation for Stoqdrivers, generated by pydoctor at 2009-04-30 17:14:35.