コード例 #1
0
 def __init__(self, customerName, customerAddress, quotationNo, quotationDate, validUntilDate, amount, tax, total, cancel):
     self.customerName = _constants.valueWrapper(customerName, False)
     self.customerAddress = _constants.valueWrapper(customerAddress, False)
     self.quotationNo = _constants.valueWrapper(quotationNo, False)
     self.quotationDate = _constants.valueWrapper(quotationDate, False)
     self.validUntilDate = _constants.valueWrapper(validUntilDate, False)
     self.amount = _constants.valueWrapper(amount, False)
     self.tax = _constants.valueWrapper(tax, False)
     self.total = _constants.valueWrapper(total, False)
     self.cancelReason = _constants.valueWrapper(cancel, False)
コード例 #2
0
 def __init__(self, voucherNo, customerName, debitDate, remarks, paymentType, chequeNo, amount, cancelReason):
     self.voucherNo = _constants.valueWrapper(voucherNo, False)
     self.customerName = _constants.valueWrapper(customerName, False)
     self.debitDate = _constants.valueWrapper(debitDate, False)
     self.remarks = _constants.valueWrapper(remarks, False)
     self.paymentType = _constants.valueWrapper(paymentType, False)
     self.chequeNo = _constants.valueWrapper(chequeNo, False)
     self.amount = _constants.valueWrapper(amount, False)
     self.cancelReason = _constants.valueWrapper(cancelReason, False)
コード例 #3
0
 def __init__(self, customerCode, customerName, customerAddress, gstin,
              stateCode, contactNo):
     self.customerCode = _constants.valueWrapper(customerCode, False)
     self.customerName = _constants.valueWrapper(customerName, False)
     self.customerAddress = _constants.valueWrapper(customerAddress, False)
     self.gstin = _constants.valueWrapper(gstin, False)
     self.stateCode = _constants.valueWrapper(stateCode, False)
     self.contactNo = _constants.valueWrapper(contactNo, False)
コード例 #4
0
 def __init__(self, itemCode, particulars, hsnCode, quantity, rate,
              sgstValue, cgstValue, igstValue, amount, tax, total):
     self.itemCode = _constants.valueWrapper(itemCode, False)
     self.particulars = _constants.valueWrapper(particulars, False)
     self.hsnCode = _constants.valueWrapper(hsnCode, False)
     self.quantity = _constants.valueWrapper(quantity, False)
     self.rate = _constants.valueWrapper(rate, False)
     self.sgstValue = _constants.valueWrapper(sgstValue, False)
     self.cgstValue = _constants.valueWrapper(cgstValue, False)
     self.igstValue = _constants.valueWrapper(igstValue, False)
     self.amount = _constants.valueWrapper(amount, False)
     self.tax = _constants.valueWrapper(tax, False)
     self.total = _constants.valueWrapper(total, False)
コード例 #5
0
 def __init__(self, vendorName, vendorAddress, vendorGstin, vendorStateCode,
              billNo, billDate, dueDate, payBy, total, tax, amountPaid,
              remarks, status, cancel):
     self.vendorName = _constants.valueWrapper(vendorName, False)
     self.vendorAddress = _constants.valueWrapper(vendorAddress, False)
     self.vendorGstin = _constants.valueWrapper(vendorGstin, False)
     self.vendorStateCode = _constants.valueWrapper(vendorStateCode, False)
     self.billNo = _constants.valueWrapper(billNo, False)
     self.billDate = _constants.valueWrapper(billDate, False)
     self.dueDate = _constants.valueWrapper(dueDate, False)
     self.total = _constants.valueWrapper(total, False)
     self.paidBy = _constants.valueWrapper(payBy, False)
     self.tax = _constants.valueWrapper(tax, False)
     self.amount = _constants.valueWrapper(float(total) - float(tax), False)
     self.amountPaid = _constants.valueWrapper(amountPaid, False)
     self.balance = _constants.valueWrapper(
         float(total) - float(amountPaid), False)
     self.remarks = _constants.valueWrapper(remarks, False)
     self.status = _constants.valueWrapper(status, False)
     self.cancelReason = _constants.valueWrapper(cancel, False)
コード例 #6
0
 def setData(self, index, value, role=_QtCore.Qt.EditRole):
     '''
     Sets data for the specified cell upon edit
     '''
     if index.column() not in [8, 9, 10, 11, 12]:
         return super(PurchaseReportTableModel,
                      self).setData(index, value, role)
     if role == _QtCore.Qt.EditRole:
         row = index.row()
         column = index.column()
         if index.data() == value:
             return False
         setattr(self.tableData[row],
                 self.settings[column][_constants._columnId],
                 _constants.valueWrapper(value, True))
         amount = float(
             getattr(self.tableData[row],
                     self.settings[8][_constants._columnId]).value)
         tax = float(
             getattr(self.tableData[row],
                     self.settings[9][_constants._columnId]).value)
         total = float(
             getattr(self.tableData[row],
                     self.settings[10][_constants._columnId]).value)
         amountPaid = float(
             getattr(self.tableData[row],
                     self.settings[11][_constants._columnId]).value)
         balance = float(
             getattr(self.tableData[row],
                     self.settings[12][_constants._columnId]).value)
         # print column, amount+tax
         value = float(value)
         if column in [8, 9]:
             setattr(self.tableData[row],
                     self.settings[10][_constants._columnId],
                     _constants.valueWrapper(amount + tax, True))
         elif column == 10:
             setattr(self.tableData[row],
                     self.settings[8][_constants._columnId],
                     _constants.valueWrapper(total - tax, True))
         elif column == 11:
             if value > total:
                 _QtGui.QMessageBox.critical(
                     None,
                     'Error',
                     'Amount Paid is greater than Total',
                     buttons=_QtGui.QMessageBox.Ok)
                 return True
             setattr(self.tableData[row],
                     self.settings[12][_constants._columnId],
                     _constants.valueWrapper(total - value, True))
         elif column == 12:
             if value > total:
                 _QtGui.QMessageBox.critical(
                     None,
                     'Error',
                     'Balance is greater than Total',
                     buttons=_QtGui.QMessageBox.Ok)
                 return True
             setattr(self.tableData[row],
                     self.settings[11][_constants._columnId],
                     _constants.valueWrapper(total - value, True))
         status = 'Paid' if round(float(total)) == round(
             float(amountPaid)) else 'Not Paid'
         setattr(self.tableData[row],
                 self.settings[14][_constants._columnId],
                 _constants.valueWrapper(status, True))
         return True
     return False
コード例 #7
0
 def __init__(self, itemCode, particulars, hsnCode, quantity):
     self.itemCode = _constants.valueWrapper(itemCode, False)
     self.particulars = _constants.valueWrapper(particulars, False)
     self.hsnCode = _constants.valueWrapper(hsnCode, False)
     self.quantity = _constants.valueWrapper(quantity, False)
コード例 #8
0
 def __init__(self, customerName, poNo, poDate, remarks, cancel):
     self.customerName = _constants.valueWrapper(customerName, False)
     self.poDate = _constants.valueWrapper(poDate, False)
     self.poNo = _constants.valueWrapper(poNo, False)
     self.remarks = _constants.valueWrapper(remarks, False)
     self.cancelReason = _constants.valueWrapper(cancel, False)
コード例 #9
0
 def _setData(self, row, column, value):
     '''
     Gets data for the specified row, column from wrapper class
     '''
     return setattr(self.__tableData[row], self.__settings[column][_constants._columnId], _constants.valueWrapper(value, True))
コード例 #10
0
 def setData(self, index, value, role=_QtCore.Qt.EditRole):
     '''
     Sets data for the specified cell upon edit
     '''
     if role == _QtCore.Qt.EditRole:
         row = index.row()
         column = index.column()
         if index.data() == value:
             return False
         setattr(self.__tableData[row], self.__settings[column][_constants._columnId], _constants.valueWrapper(value, True))
         return True
     return False
コード例 #11
0
 def __init__(self, customerName, customerAddress, customerGstin,
              customerStateCode, billNo, paidBy, invoiceDate, poNo, poDate,
              dcCode, dcDate, vehicleNo, dispatchedThrough, vendorCode,
              paymentTerms, amount, total, amountPaid, balance,
              paymentRemarks, status, cancel):
     self.customerName = _constants.valueWrapper(customerName, False)
     self.customerAddress = _constants.valueWrapper(customerAddress, False)
     self.customerGstin = _constants.valueWrapper(customerGstin, False)
     self.customerStateCode = _constants.valueWrapper(
         customerStateCode, False)
     self.billNo = _constants.valueWrapper(billNo, False)
     self.paidBy = _constants.valueWrapper(paidBy, False)
     self.invoiceDate = _constants.valueWrapper(invoiceDate, False)
     self.poNo = _constants.valueWrapper(poNo, False)
     self.poDate = _constants.valueWrapper(poDate, False)
     self.dcCode = _constants.valueWrapper(dcCode, False)
     self.dcDate = _constants.valueWrapper(dcDate, False)
     self.vehicleNo = _constants.valueWrapper(vehicleNo, False)
     self.dispatchedThrough = _constants.valueWrapper(
         dispatchedThrough, False)
     self.vendorCode = _constants.valueWrapper(vendorCode, False)
     self.paymentTerms = _constants.valueWrapper(paymentTerms, False)
     self.amount = _constants.valueWrapper(amount, False)
     self.tax = _constants.valueWrapper(float(total) - float(amount), False)
     self.total = _constants.valueWrapper(total, False)
     self.amountPaid = _constants.valueWrapper(amountPaid, False)
     self.balance = _constants.valueWrapper(balance, False)
     self.paymentRemarks = _constants.valueWrapper(paymentRemarks, False)
     self.status = _constants.valueWrapper(status, False)
     self.cancelReason = _constants.valueWrapper(cancel, False)
コード例 #12
0
    def __init__(self, itemInfo):
        self.itemCode = _constants.valueWrapper(itemInfo.itemCode, False)
        self.particulars = _constants.valueWrapper(itemInfo.particular, False)
        self.hsnCode = _constants.valueWrapper(itemInfo.hsnCode, False)
        self.quantity = _constants.valueWrapper(itemInfo.quantity, False)
        self.rate = _constants.valueWrapper(itemInfo.rate, False)
        self.sgstValue = _constants.valueWrapper(
            '{} %'.format(itemInfo.sgst or 0), False)
        self.cgstValue = _constants.valueWrapper(
            '{} %'.format(itemInfo.cgst or 0), False)
        self.igstValue = _constants.valueWrapper(
            '{} %'.format(itemInfo.igst or 0), False)

        amountWithoutTax = float(itemInfo.quantity) * float(itemInfo.rate)
        tax = ((amountWithoutTax * float(itemInfo.cgst or 0)) / 100 +
               (amountWithoutTax * float(itemInfo.sgst or 0)) / 100 +
               (amountWithoutTax * float(itemInfo.igst or 0)) / 100)
        self.amount = _constants.valueWrapper(str(amountWithoutTax), False)
        self.tax = _constants.valueWrapper(str(tax), False)
        self.total = _constants.valueWrapper(str(amountWithoutTax + tax),
                                             False)