Exemplo n.º 1
0
    def __setupWidget(self):
        '''
        Sets up widget before initializing.
        '''
        self.__companyItemUI.setupUi(self)

        self.__companyModelData = CompanyItemTableModel()
        self.__companyProxyModel = CompanyItemProxyModel()
        self.__companyProxyModel.setSourceModel(self.__companyModelData)
        self.__companyProxyModel.setDynamicSortFilter(True)
        self.__companyProxyModel.setFilterCaseSensitivity(
            _QtCore.Qt.CaseInsensitive)
        self.__companyItemUI.companyItemsTable.setModel(
            self.__companyProxyModel)

        self.__setComapanyItemInformation()

        self.__companyItemUI.inputGroupBox.setTitle(self.type.capitalize())
        self._disableAllLabels()

        self.__saveRestore = utils.StoreRestore(self.settings)

        saveShortcut = _QtGui.QShortcut(_QtGui.QKeySequence("Ctrl+S"), self)
        saveShortcut.activated.connect(self.saveSlot)
        restoreShortcut = _QtGui.QShortcut(_QtGui.QKeySequence("Ctrl+R"), self)
        restoreShortcut.activated.connect(self.restoreSlot)
Exemplo n.º 2
0
 def __init__(self, parent=None, type='credit'):
     super(VoucherWidget, self).__init__(parent)
     self.__type = type
     self.voucherManager = VoucherManager(type)
     self.__voucherUI = Ui_Voucher()
     self.__setupWidget()
     self.__connectWidget()
     self.__addWidgetValidators()
     self.__saveRestore = utils.StoreRestore(self.settings)
Exemplo n.º 3
0
    def __init__(self, parent=None):
        super(PurchaseInvoiceWidget, self).__init__(parent)

        self.__purchaseInvoiceUI = Ui_PurchaseInvoice()
        self.__manager = PurchaseManager()
        self.__customerManager = CustomerManager()
        self.__companyItemManager = CompanyItemManager('purchase')
        self.__setVariables()
        self.__setUpWidget()
        self.__connectWidgets()
        self.__saveRestore = utils.StoreRestore(self.settings)
Exemplo n.º 4
0
    def __init__(self, parent=None):
        super(CustomerWidget, self).__init__(parent)
        self.__customerUI = Ui_addCustomer()
        self.customerManager = CustomerManager()
        self.__setupWidget()
        self.__connectWidget()
        self.__addWidgetValidators()

        self.__saveRestore = utils.StoreRestore(self.settings)

        saveShortcut = _QtGui.QShortcut(_QtGui.QKeySequence("Ctrl+S"), self)
        saveShortcut.activated.connect(self.saveSlot)
        restoreShortcut = _QtGui.QShortcut(_QtGui.QKeySequence("Ctrl+R"), self)
        restoreShortcut.activated.connect(self.restoreSlot)
Exemplo n.º 5
0
    def __init__(self, parent=None):
        super(PurchaseOrderWidget, self).__init__(parent)
        self.__manager = PurchaseOrderManager()
        self.__companyItemManager = CompanyItemManager('purchase')
        self.__customerManager = CustomerManager()
        self.__purchaseOrderUI = Ui_PurchaseOrder()
        self.__setVariables()
        self.__setUpWidget()
        self.__connectWidgets()
        self.__saveRestore = utils.StoreRestore(self.settings)

        saveShortcut = _QtGui.QShortcut(_QtGui.QKeySequence("Ctrl+S"), self)
        saveShortcut.activated.connect(self.saveSlot)
        restoreShortcut = _QtGui.QShortcut(_QtGui.QKeySequence("Ctrl+R"), self)
        restoreShortcut.activated.connect(self.restoreSlot)
Exemplo n.º 6
0
    def __init__(self, parent=None):
        super(QuotationWidget, self).__init__(parent)
        self.__manager = QuotationManager()
        self.__customerManager = CustomerManager()
        self.__companyManager = CompanyItemManager('sales')
        self.__quotationUI = Ui_quotation()
        self.__setVariables()
        self.__setUpWidget()
        self.__setDBVariables()
        self.__connectWidgets()
        self.__saveRestore = utils.StoreRestore(self.settings)

        saveShortcut = _QtGui.QShortcut(_QtGui.QKeySequence("Ctrl+S"), self)
        saveShortcut.activated.connect(self.saveSlot)
        restoreShortcut = _QtGui.QShortcut(_QtGui.QKeySequence("Ctrl+R"), self)
        restoreShortcut.activated.connect(self.restoreSlot)
Exemplo n.º 7
0
    def __init__(self, parent=None, type='sales'):
        super(CompanyItemWidget, self).__init__(parent)
        self.type = type
        self.settings = _QtCore.QSettings("company{0}item.ini".format(type),
                                          _QtCore.QSettings.IniFormat)
        self.companyItemManager = CompanyItemManager(type)
        self.__companyItemUI = Ui_companyItem()
        self.__setupWidget()
        self.__connectWidget()
        self.__addWidgetValidators()

        self.__saveRestore = utils.StoreRestore(self.settings)

        saveShortcut = _QtGui.QShortcut(_QtGui.QKeySequence("Ctrl+S"), self)
        saveShortcut.activated.connect(self.saveSlot)
        restoreShortcut = _QtGui.QShortcut(_QtGui.QKeySequence("Ctrl+R"), self)
        restoreShortcut.activated.connect(self.restoreSlot)
Exemplo n.º 8
0
    def __init__(self, type='sales', parent=None):
        super(SalesInvoiceWidget, self).__init__(type, parent)
        self.performaNoValue = _QtGui.QLineEdit()
        self.performaNoValue.setPlaceholderText('Enter Performa No')

        sizePolicy = _QtGui.QSizePolicy(_QtGui.QSizePolicy.Fixed,
                                        _QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.performaNoValue.sizePolicy().hasHeightForWidth())
        self.performaNoValue.setMinimumSize(_QtCore.QSize(150, 30))
        self.performaNoValue.setSizePolicy(sizePolicy)

        self._salesInvoiceUI.performaLayout.addWidget(self.performaNoValue)
        self._connectWidgets()
        self.__saveRestore = utils.StoreRestore(self.settings)

        print '---------'
        saveShortcut = _QtGui.QShortcut(_QtGui.QKeySequence("Ctrl+S"), self)
        saveShortcut.activated.connect(self.saveSlot)
        restoreShortcut = _QtGui.QShortcut(_QtGui.QKeySequence("Ctrl+R"), self)
        restoreShortcut.activated.connect(self.restoreSlot)