def guardarFactura(self): ofactura = factura(str(self.nf.text()), str(self.de3.text()), str(self.namec.text()), str(self.nif.text()), str(self.poblacion.text()), str(self.calle.text()), str(self.pago.text()), self.total_items, self.importe.text(), self.iva.text(), self.iva_a.text(), self.total.text()) # w: facturas_db = shelve.open("facturas.db") facturas_db[str(ofactura.getNf())] = ofactura facturas_db.close() #actualizamos combobox facturas: self.updateComboF(ofactura.getNf()) self.agregarCliente()
def calculo(self): f = factura(str(self.nf.text()), str(self.de3.text()), str(self.namec.text()), str(self.nif.text()), str(self.poblacion.text()), str(self.calle.text()), str(self.pago.text()), self.total_items) if (not self.iva.text()): #Si esta vacio le decimos que coja el iva por defecto del constructor factura. self.iva.setText(str(f.getIva())) else: f.setIva(str(self.iva.text())) f.calculaImporte(self.total_items) #Seteo los campos... self.importe.setText(str(f.getImporte())) self.iva_a.setText(str(f.getIvaApli())) self.total.setText(str(f.getTotal()))
def __init__(self, parent = None): QWidget.__init__(self, parent) self.setupUi(self) self.setWindowTitle("Albaran v01") f = factura()