本文整理汇总了Python中models.SqlHandler.getALV方法的典型用法代码示例。如果您正苦于以下问题:Python SqlHandler.getALV方法的具体用法?Python SqlHandler.getALV怎么用?Python SqlHandler.getALV使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.SqlHandler
的用法示例。
在下文中一共展示了SqlHandler.getALV方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setPrices
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def setPrices(self, visit):
price_dict = visit.getPriceDict()
self.ui.operationSpinBox.setValue(price_dict["operation_price"] * (100+SqlHandler.getALV(1))/100.)
self.ui.accessoriesSpinBox.setValue(price_dict["accesories_price"] * (100+SqlHandler.getALV(1))/100.)
self.ui.labSpinBox.setValue( price_dict["lab_price"] * (100+SqlHandler.getALV(1))/100.)
self.ui.medicineSpinBox.setValue(price_dict["medicine_price"] * (100+SqlHandler.getALV(2))/100.)
self.ui.dietSpinBox.setValue(price_dict["diet_price"] * (100+SqlHandler.getALV(3))/100.)
示例2: getData
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def getData(self):
print("DEBUG: getData")
data = {}
data['visit'] = self.visit
if self.ui.clinic_radio_button.isChecked():
data['clinic_payment'] = self.ui.clinicPriceSpinBox.value() / ((100+SqlHandler.getALV(1))/100.)
data['km'] = 0.0
data['km_payment'] = 0.0
else:
data['clinic_payment'] = self.ui.visitPriceSpinBox.value() / ((100+SqlHandler.getALV(1))/100.)
data['km'] = self.ui.KmSpinBox.value()
data['km_payment'] = self.ui.KmPriceSpinBox.value() / ((100+SqlHandler.getALV(1))/100.)
data['operations_payment'] = self.ui.operationSpinBox.value() / ((100+SqlHandler.getALV(1))/100.)
data['lab_payment'] = self.ui.labSpinBox.value() / ((100+SqlHandler.getALV(1))/100.)
data['accessories_payment'] = self.ui.accessoriesSpinBox.value() / ((100+SqlHandler.getALV(1))/100.)
data['extra_percent'] = self.ui.precentSlider.value()
data['medicines_payment'] = self.ui.medicineSpinBox.value() / ((100+SqlHandler.getALV(2))/100.)
data['diet_payment'] = self.ui.dietSpinBox.value() / ((100+SqlHandler.getALV(3))/100.)
data['payment_method'] = (self.ui.paymentComboBox.itemData(self.ui.paymentComboBox.currentIndex()))
data['due_date'] = self.qdateToPy(self.ui.DueDateEdit.date())
data['paid_time'] = self.qdateToPy(self.ui.paidDateEdit.date())
data['paid_value'] = self.ui.paidSpinBox.value()
data['index_number'] = self.ui.indexNumberLabel.text()
data['other_info'] = self.ui.otherInfoTextEdit.toPlainText()
data['satus'] = 0 #status TODO: implement if needed
print('operations_payment ',data['operations_payment'])
return data
示例3: updateEndPrice
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def updateEndPrice(self):
price_ALV1 = self.getALV1Price() * (100+SqlHandler.getALV(1))/100.
price_ALV2 = self.getALV2Price() * (100+SqlHandler.getALV(2))/100.
price_ALV3 = self.getALV3Price() * (100+SqlHandler.getALV(3))/100.
self.ui.price_ALV1_total_label.setText('%.2f' % price_ALV1)
self.ui.ALV1_total.setText('%.2f' % (price_ALV1-self.getALV1Price()))
self.ui.price_ALV2_total_label.setText('%.2f' % price_ALV2)
self.ui.ALV2_total.setText('%.2f' % (price_ALV2-self.getALV2Price()))
self.ui.price_ALV3_total_label.setText('%.2f' % price_ALV3)
self.ui.ALV3_total.setText('%.2f' % (price_ALV3-self.getALV3Price()))
self.ui.endPriceLabel.setText('%.2f' % (price_ALV1 + price_ALV2 + price_ALV3))
示例4: genTableRow
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def genTableRow(self, operation):
counter = 0
tmp_rows = ''
tmp_rows += self.genTableRowPrue(name = operation.base.name,
count = operation.count,
type_ = "kpl",
price = operation.price,
alv = SqlHandler.getALV(1))
counter += 1
if(hasattr(operation.base, 'item')):
print("operation.base.item: ", operation.base.item)
tmp_rows += self.genTableRowPrue(name = ('- ' + operation.base.item.name),
count = operation.count,
type_ = operation.base.item.count_type,
price = operation.base.item.price,
alv = operation.base.item.getALV())
counter += 1
if(hasattr(operation, 'items')):
print("items listing strt")
for surgeryitem in operation.items:
total_count = operation.count*surgeryitem.count
tmp_rows += self.genTableRowPrue(name = ('- ' + surgeryitem.item.name),
count = total_count,
type_ = surgeryitem.item.count_type,
price = surgeryitem.item.price,
alv = surgeryitem.item.getALV())
counter += 1
return (tmp_rows, counter)
示例5: setAlv1Names
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def setAlv1Names(self):
alv = str(SqlHandler.getALV(1))
self.ui.ALV1_1.setText(alv + '%')
self.ui.ALV1_2.setText(alv + '%')
self.ui.ALV1_3.setText(alv + '%')
self.ui.ALV1_4.setText(alv + '%')
#self.ui.ALV1_5.setText(alv + '%')
self.ui.ALV1_6.setText(alv + '%')
self.ui.ALV1_7.setText(alv + '%')
示例6: setBasicInfo
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def setBasicInfo(self):
self.setPaymnetMethods()
self.setDueDates()
self.setAlv1Names()
self.setAlv2Names()
self.setAlv3Names()
if self.item != None:
if self.item.getType() != 'Visit':
self.ui.ownerLabel.setText(self.item.visit.owner.name)
if self.item.km < 0.001 and self.item.km_payment < 0.001:
self.ui.clinic_radio_button.setChecked(True)
self.ui.clinicPriceSpinBox.setValue(self.item.clinic_payment * ((100+SqlHandler.getALV(1))/100.))
else:
self.ui.clinic_radio_button.setChecked(False)
self.ui.KmSpinBox.setValue(self.item.km)
self.ui.visitPriceSpinBox.setValue(self.item.clinic_payment * ((100+SqlHandler.getALV(1))/100.))
self.ui.KmPriceSpinBox.setValue(self.item.km_payment * ((100+SqlHandler.getALV(1))/100.))
self.ui.operationSpinBox.setValue(self.item.operations_payment * ((100+SqlHandler.getALV(1))/100.))
self.ui.accessoriesSpinBox.setValue(self.item.accessories_payment * ((100+SqlHandler.getALV(1))/100.))
self.ui.labSpinBox.setValue(self.item.lab_payment * ((100+SqlHandler.getALV(1))/100.))
self.ui.medicineSpinBox.setValue(self.item.medicines_payment * ((100+SqlHandler.getALV(2))/100.))
self.ui.dietSpinBox.setValue(self.item.diet_payment * ((100+SqlHandler.getALV(3))/100.))
self.ui.paidSpinBox.setValue(self.item.paid_value) #this has all alvs so it cant be out of them
self.ui.otherInfoTextEdit.setPlainText(self.item.other_info)
self.ui.paymentComboBox.setCurrentIndex(self.ui.paymentComboBox.findData(self.item.payment_method))
self.ui.paidDateEdit.setDate(self.item.paid_time)
self.ui.DueDateEdit.setDate(self.item.due_date)
self.ui.precentSlider.setValue(self.item.extra_percent)
self.ui.indexNumberLabel.setText(str(self.item.index_number))
else:
self.ui.ownerLabel.setText(self.item.owner.name)
self.setDefaultClinicPrice()
self.setPrices(self.item) #item is visit
else:
self.errorMessage("ERROR: BillTab: setBasicInfo: item is None")
示例7: getALV1Price
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def getALV1Price(self):
price_ALV1 = 0.0
if not self.ui.clinic_radio_button.isChecked():
price_ALV1 += self.ui.KmPriceSpinBox.value()
price_ALV1 += self.ui.visitPriceSpinBox.value()
else:
price_ALV1 += self.ui.clinicPriceSpinBox.value()
price_ALV1 += self.ui.operationSpinBox.value()
price_ALV1 += self.ui.accessoriesSpinBox.value()
price_ALV1 += self.ui.labSpinBox.value()
return (price_ALV1*(100 + self.ui.precentSlider.value())/100.0) / ((100+SqlHandler.getALV(1))/100.)
示例8: makePrintfile
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def makePrintfile(self, bill, language='Finnish'):#TODO:add bill needed info
self.html = ""
try:
f = open(self.path, 'r', encoding="utf-8")
except IOError:
self.errorMessage("Can not open file named: " + self.path)
return ""
for i in f.readlines():
self.html += i
self.change("vet_name", bill.visit.vet.name)
self.change("vet_number", str(bill.visit.vet.vet_number))
self.change("vet_address", bill.visit.vet.address)
if(not bill.visit.vet.postnumber == None):
self.change("vet_postnumber", bill.visit.vet.postnumber.number)
else:
self.change("vet_postnumber","")
if(not bill.visit.vet.post_office == None):
self.change("vet_postaddress", bill.visit.vet.post_office.name)
else:
self.change("vet_postaddress","")
#self.change("alv_number", bill.visit.vet.alv_number)#alv_number
self.change("owner_name", bill.visit.owner.name)
self.change("owner_address", bill.visit.owner.address)
if(not bill.visit.owner.post_office == None):
self.change("owner_postaddress", bill.visit.owner.post_office.name)
else:
self.change("owner_postaddress","");
if(not bill.visit.owner.postnumber == None):
self.change("owner_postnumber", bill.visit.owner.postnumber.number)
else:
self.change("owner_postnumber","")
self.change("bill_number", bill.id) #TODO change id to some other
self.change("bill_date", self.getDateNow()) #TODO change or add to Bill
self.change("due_date", bill.due_date)
self.change("penalty_interest", 8.00) #TODO change
self.change("index_number", bill.index_number)
self.change("payment_condition", "14 pv") #todo change
self.change("bank_name", bill.visit.vet.bank_name)
self.change("account_number", bill.visit.vet.IBAN)
self.change("swif_bic", bill.visit.vet.SWIF)
self.change("payment_method", bill.payment_method)
self.html = self.html.replace("animal_info_area", self.genAnimalInfos(bill.visit.visitanimals))
self.html = self.html.replace('visitanimal_summarys',self.summaryToHTML(bill.visit.visitanimals))
operation_rows = ""
operation_row_count = 0
if(bill.clinic_payment > 0):
if(bill.km == 0):
operation_rows += self.genTableRowPrue("Klinikkamaksu", 1, "", bill.clinic_payment, SqlHandler.getALV(1))
else:
operation_rows += self.genTableRowPrue("Käyntimaksu", 1, "", bill.clinic_payment, SqlHandler.getALV(1))
operation_row_count +=1
if(bill.km_payment > 0):
operation_rows += self.genTableRowPrue("Kilometrikorvaus " + str(bill.km) + "km", 1, "", bill.clinic_payment, SqlHandler.getALV(1))
operation_row_count +=1
for va in bill.visit.visitanimals:
if(len(bill.visit.visitanimals) > 1):
(rows, count) = self.genAnimalTableRow(va.animal.name)
operation_rows += rows
operation_row_count += count
for oper in va.operations:
(rows, count) = self.genTableRow(oper)
operation_rows += rows
operation_row_count += count
for item in va.items:
(rows, count) = self.genItemTableRow(item)
operation_rows += rows
operation_row_count += count
price_dict = bill.calcPricesFromVisit()
if(not self.floatEqual(price_dict["operation_price"], bill.operations_payment)):
print("DEBUG: PrintFileCreator: ", price_dict["operation_price"] ," ", bill.operations_payment)
operation_rows += self.genTableRowPrue("Operaatioiden hintamuutos", 1, "", -price_dict["operation_price"] + bill.operations_payment, SqlHandler.getALV(1))
operation_row_count +=1
if(not self.floatEqual(price_dict["accesories_price"], bill.accessories_payment)):
operation_rows += self.genTableRowPrue("Tarvikkeiden hintamuutos", 1, "", -price_dict["accesories_price"] + bill.accessories_payment, SqlHandler.getALV(1))
operation_row_count +=1
if(not self.floatEqual(price_dict["lab_price"], bill.lab_payment)):
operation_rows += self.genTableRowPrue("Laboratorio hintamuutos", 1, "", -price_dict["lab_price"] + bill.lab_payment, SqlHandler.getALV(1))
operation_row_count +=1
#.........这里部分代码省略.........
示例9: setAlv3Names
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def setAlv3Names(self):
alv3 = str(SqlHandler.getALV(3))
self.ui.ALV3_1.setText(alv3 + '%')
self.ui.ALV3_2.setText(alv3 + '%')
示例10: setAlv2Names
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def setAlv2Names(self):
alv2 = str(SqlHandler.getALV(2))
self.ui.ALV2_1.setText(alv2 + '%')
self.ui.ALV2_2.setText(alv2 + '%')
示例11: getTotal
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def getTotal(self):
return self.getALV1Price()*((100+SqlHandler.getALV(1))/100.) + self.getALV2Price()*((100+SqlHandler.getALV(2))/100.) + self.getALV3Price()*((100+SqlHandler.getALV(3))/100.)
示例12: getALV3Price
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def getALV3Price(self):
return self.ui.dietSpinBox.value() / ((100+SqlHandler.getALV(3))/100.)
示例13: getALV2Price
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def getALV2Price(self):
return self.ui.medicineSpinBox.value() / ((100+SqlHandler.getALV(2))/100.)
示例14: setDefaultClinicPrice
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def setDefaultClinicPrice(self):
self.ui.clinicPriceSpinBox.setValue(SqlHandler.getGlobalVar(key="clinicpayment") * (100+SqlHandler.getALV(1))/100.)
示例15: getALV
# 需要导入模块: from models import SqlHandler [as 别名]
# 或者: from models.SqlHandler import getALV [as 别名]
def getALV(self=None):
from models import SqlHandler
return SqlHandler.getALV(g_item_alv_dict[ItemStrings.item])