from PyQt5.QtWidgets import QWidget

__all__ = ['StackMessages']


class StackMessages(QWidget):

    def __init__(self, parent):
        super(StackMessages, self).__init__(parent)
        parent.stack_msg = {
            'system_ready': ('info', self.tr('SYSTEM READY...')),
            'confirm_exit': ('warning', self.tr('DO YOU WANT TO EXIT?')),
            'confirm_credit': ('question', self.tr('PLEASE CONFIRM YOUR PAYMENT TERM AS CREDIT?')),
            'sale_number_not_found': ('warning', self.tr('SALE ORDER / INVOICE NUMBER NOT FOUND!')),
            'sale_closed': ('error', self.tr('THIS SALE IS CLOSED, YOU CAN NOT TO MODIFY!')),
            'discount_not_valid': ('warning', self.tr('DISCOUNT VALUE IS NOT VALID!')),
            'add_payment_sale_draft': ('info', self.tr('YOU CAN NOT ADD PAYMENTS TO SALE ON DRAFT STATE!')),
            'enter_quantity': ('question', self.tr('ENTER QUANTITY...')),
            'enter_discount': ('question', self.tr('ENTER DISCOUNT...')),
            'enter_payment': ('question', self.tr('ENTER PAYMENT AMOUNT BY: %s')),
            'enter_new_price': ('question', self.tr('ENTER NEW PRICE...')),
            'order_successfully': ('info', self.tr('ORDER SUCCESSFULLY SENT')),
            'order_failed': ('warning', self.tr('FAILED SEND ORDER!')),
            'missing_agent': ('warning', self.tr('MISSING AGENT!')),
            'missing_salesman': ('warning', self.tr('THERE IS NOT SALESMAN FOR THE SALE!')),
            'sale_without_products': ('warning', self.tr('YOU CAN NOT CONFIRM A SALE WITHOUT PRODUCTS!')),
            'user_without_permission': ('error', self.tr('USER WITHOUT PERMISSION FOR SALE POS!')),
            'quantity_not_valid': ('error', self.tr('THE QUANTITY IS NOT VALID...!')),
            'user_not_permissions_device': ('error', self.tr('THE USER HAVE NOT PERMISSIONS FOR ACCESS TO DEVICE!')),
            'missing_party_configuration': ('warning', self.tr('MISSING THE DEFAULT PARTY ON SHOP CONFIGURATION!')),
            'missing_journal_device': ('error', self.tr('MISSING SET THE JOURNAL ON DEVICE!')),
            'statement_closed': ('error', self.tr('THERE IS NOT A STATEMENT OPEN FOR THIS DEVICE!')),
            'product_not_found': ('warning', self.tr('PRODUCT NOT FOUND!')),
            'must_load_or_create_sale': ('warning', self.tr('FIRST YOU MUST CREATE/LOAD A SALE!')),
            'new_sale': ('warning', self.tr('DO YOU WANT CREATE NEW SALE?')),
            'cancel_sale': ('question', self.tr('ARE YOU WANT TO CANCEL SALE?')),
            'not_permission_delete_sale': ('info', self.tr('YOU HAVE NOT PERMISSIONS FOR DELETE THIS SALE!')),
            'not_permission_for_cancel': ('info', self.tr('YOU HAVE NOT PERMISSIONS FOR CANCEL THIS SALE!')),
            'customer_not_credit': ('info', self.tr('THE CUSTOMER HAS NOT CREDIT!')),
            'agent_not_found': ('warning', self.tr('AGENT NOT FOUND!')),
            'invalid_commission': ('warning', self.tr('COMMISSION NOT VALID!')),
            'credit_limit_exceed': ('info', self.tr('CREDIT LIMIT FOR CUSTOMER EXCEED!')),
            'credit_limit_capacity': ('info', self.tr('THE CUSTOMER CREDIT CAPACITY IS ABOVE 80%')),
            'not_can_force_assign': ('warning', self.tr('YOU CAN NOT FORCE ASSIGN!')),
            'send_electronic_failed': ('info', self.tr('SEND INVOICE FAILED!')),
            'invoice_done_failed': ('info', self.tr('PROCESSING INVOICE FAILED!')),
            'without_stock_quantity': ('info', self.tr('PRODUCT WITHOUT STOCK: %s')),
            'not_sale': ('info', self.tr('NOT SALE!...')),
            'statement_created': ('info', self.tr('STATEMENTS CREATED!')),
            'statement_finish': ('info', self.tr('STATEMENTS CLOSED!')),
            'order_dispatched': ('info', self.tr('ORDER DISPATCHED!')),
            'error_order_dispatched': ('error', self.tr('ERROR TO DISPATCHED ORDER!')),
        }
