def renameSlot(self): indexes = self.protableView.selectionModel().selectedRows(0) for ind in sorted(indexes): outitem = select_outbound_by_code(ind.data()) if outitem.customer_id != None: pers = select_customer_by_id(outitem.customer_id) if outitem.employee_id != None: pers = select_employee_by_id(outitem.employee_id) replay = QMessageBox.warning( QMessageBox(), "Oop's", 'You want delete\n {} : '.format(outitem.code) + '\n{}'.format(pers.name) + '\n Are you sure?', QMessageBox.Yes | QMessageBox.Cancel) if replay == QMessageBox.Yes: if outitem.tools: increaseToolsInvQty(outitem.tools, outitem.req_qty) if outitem.rawMaterial: increaseRawMaterialInvQty(outitem.raw_material, outitem.req_qty) if outitem.spareParts: increaseSparePartsInvQty(outitem.spareParts, outitem.req_qty) if outitem.finishProducts: increaseFinishProductInvQty(outitem.finishProducts, outitem.req_qty) delete_outbound(outitem.id) self.refresheddata()
def closeSlot(self): indexes = self.protableView.selectionModel().selectedRows(0) for ind in sorted(indexes): outitem = select_outbound_by_code(ind.data()) if outitem.tools: if outitem.tools.back == 1: increaseToolsInvQty(outitem.tools, outitem.req_qty) update_oubound_status(outitem.id, 0) self.refresheddata()
def update_inv(self): if self.newqtySpinBox.value() == 0: self.statulbl.setText("New Quantity is Required ") else: reply = QMessageBox.question( QMessageBox(), 'Delete', "Are you sure to update cost ?\n" "This action you can't undo", QMessageBox.Yes | QMessageBox.No) upsp = self.tool n_inv = self.newqtySpinBox.value() if reply == QMessageBox.Yes: increaseToolsInvQty(upsp, n_inv) self.statulbl.setText("Data updated successfully") else: self.statulbl.setText("Data not updated ")
def openOutReport(self): if self.reqTypecomboBox.currentIndex() == 1: CreateOutboundReport().create_pdf() mylist = getOutbounEmployeeRow() for idx, val in enumerate(mylist): if val.tools: if val.tools.back == 1: increaseToolsInvQty(val.tools, val.req_qty) update_oubound_status(val.id, 0) if self.reqTypecomboBox.currentIndex() == 2: cust = select_customer_by_mob_num(self.mobnumled.text()) CreateOutboundCustReport(cust).create_pdf() mylist = getOutbounOneCustomerRow(cust) for idx, val in enumerate(mylist): if val.tools: if val.tools.back == 1: increaseToolsInvQty(val.tools, val.req_qty) update_oubound_status(val.id, 0)