def cancelBill(self, poNo, cancelReason): poDetails = self.poManager.getPOInfo(poNo) # self.model poDetails.cancelReason = cancelReason poTableData = [data for data in self.__purchaseOrderModelData.tableData if data.poNo.value == poNo] poTableData[0].cancelReason = _constants.valueWrapper(cancelReason, False) poDetails.save()
def cancelVoucher(self, voucherNo, cancelReason): ''' Cancel the voucher no ''' voucherDetails = self.voucherManager.getVoucherInfo(voucherNo) voucherDetails.cancelReason = cancelReason voucherTableData = [data for data in self.__voucherModelData.tableData if data.voucherNo.value == voucherNo] voucherTableData[0].cancelReason = constants.valueWrapper(cancelReason, False) voucherDetails.save() self.updateAmountValue()
def cancelBill(self, billNo, cancelReason): billDetails = self._manager.getSalesInfo(billNo) billDetails.cancelReason = cancelReason salesTableData = [ data for data in self.__salesModelData.tableData if data.billNo.value == billNo ] salesTableData[0].cancelReason = constants.valueWrapper( cancelReason, False) billDetails.save() self.updateAmountValue()
def setData(self, index, value, role=_QtCore.Qt.EditRole): ''' Sets data for the specified cell upon edit ''' if index.column() not in [5, 6, 7]: super(QuotationReportTableModel, self).setData(index, value, role) return 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[5][constants._columnId]).value) tax = float( getattr(self.tableData[row], self.settings[6][constants._columnId]).value) total = float( getattr(self.tableData[row], self.settings[7][constants._columnId]).value) if column == 5: setattr(self.tableData[row], self.settings[7][constants._columnId], constants.valueWrapper(amount + tax, True)) elif column == 6: setattr(self.tableData[row], self.settings[7][constants._columnId], constants.valueWrapper(amount + tax, True)) elif column == 7: setattr(self.tableData[row], self.settings[5][constants._columnId], constants.valueWrapper(total - tax, True)) return True return False
def cancelBill(self, billNo, cancelReason): ''' Cancels the selected puchase no to cancel ''' purchaseDetails = self._manager.getPurchaseDetailsInfo(billNo) purchaseDetails.cancelReason = cancelReason purchaseTableData = [ data for data in self.__purchaseModelData.tableData if data.billNo.value == billNo ] purchaseTableData[0].cancelReason = constants.valueWrapper( cancelReason, False) purchaseDetails.save() self.updateAmountValue()
def cancelBill(self, quotationNo, cancelReason): ''' Cancels quoation for the passed quotationno ''' quotationDetails = self._manager.getQuotationDetailsInfo(quotationNo) quotationDetails.cancelReason = cancelReason quotationTableData = [ data for data in self.__quotationModelData.tableData if data.quotationNo.value == quotationNo ] quotationTableData[0].cancelReason = constants.valueWrapper( cancelReason, False) quotationDetails.save() self.updateAmountValue()
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)
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.cgstValue = constants.valueWrapper(itemInfo.cgst, False) self.sgstValue = constants.valueWrapper(itemInfo.sgst, False) self.igstValue = constants.valueWrapper(itemInfo.igst, False) tax = itemInfo.cgst + itemInfo.sgst + itemInfo.igst self.tax = constants.valueWrapper(tax, False) amount = float(itemInfo.quantity) * float(itemInfo.rate) self.total = constants.valueWrapper(amount + tax, False) self.amount = constants.valueWrapper(amount, False)