def ui_print_report(self): up_html = """ <table> <tr> <th>Тип</th><th>Поставщик</th><th>Дата с</th><th>Дата по</th><th>ИТОГО</th> </tr> <tr> <td>#type#</td><td>#provider#</td><td>#data_from#</td><td>#data_to#</td><td>#sum#</td> </tr> </table> """ if self.tabWidget.currentIndex() == 0: head = "Отчет по приходу ткани" up_html = up_html.replace("#type#", self.le_material_type.text()) up_html = up_html.replace("#provider#", self.le_material_provider.text()) up_html = up_html.replace( "#data_from#", self.de_material_from.date().toString("dd.MM.yyyy")) up_html = up_html.replace( "#data_to#", self.de_material_to.date().toString("dd.MM.yyyy")) up_html = up_html.replace("#sum#", self.le_material_sum.text()) table_widget = self.tw_material elif self.tabWidget.currentIndex() == 1: head = "Отчет по приходу фурнитуры" up_html = up_html.replace("#type#", self.le_accessories_type.text()) up_html = up_html.replace("#provider#", self.le_accessories_provider.text()) up_html = up_html.replace( "#data_from#", self.de_accessories_from.date().toString("dd.MM.yyyy")) up_html = up_html.replace( "#data_to#", self.de_accessories_to.date().toString("dd.MM.yyyy")) up_html = up_html.replace("#sum#", self.le_accessories_sum.text()) table_widget = self.tw_accessories elif self.tabWidget.currentIndex() == 2: head = "Отчет по расходам на поставки" up_html = up_html.replace("#type#", self.le_comparing_type.text()) up_html = up_html.replace("#provider#", "") up_html = up_html.replace( "#data_from#", self.de_comparing_from.date().toString("dd.MM.yyyy")) up_html = up_html.replace( "#data_to#", self.de_comparing_to.date().toString("dd.MM.yyyy")) up_html = up_html.replace("#sum#", self.le_comparing_sum.text()) table_widget = self.tw_comparing else: return False html = table_to_html.tab_html(table_widget, table_head=head, up_template=up_html) self.print_class = print_qt.PrintHtml(self, html)
def ui_print(self): head = "Себестоймость %s (%s) %s %s-%s" % ( self.le_art.text(), self.le_size.text(), self.le_param.text(), self.de_date_in.date().toString( Qt.ISODate), self.de_date_from.date().toString(Qt.ISODate)) html = table_to_html.tab_html(self.table_widget, table_head=head) self.print_class = print_qt.PrintHtml(self, html)
def ui_print(self): query = """SELECT Last_Name, First_Name FROM staff_worker_info WHERE Id = %s""" sql_info = my_sql.sql_select(query, (self.id, )) if "mysql.connector.errors" in str(type(sql_info)): QMessageBox.critical(self, "Ошибка sql получения имени работника", sql_info.msg, QMessageBox.Ok) return False head = "Часы работника " + sql_info[0][0] + " " + sql_info[0][1] html = table_to_html.tab_html(self.tw_calc_traffic, table_head=head) self.print_class = print_qt.PrintHtml(self, html)
def ui_print(self): up_html = """ <table> <tr> <th>Кроев</th><th>Пачек</th><th>Операций</th><th>Готовых изделий</th><th>Брака</th><th>На сумму (покроеную)</th> </tr> <tr> <th>#le_cut#</th><th>#le_pack#</th><th>#le_operation#</th><th>#le_product#</th><th>#le_damage#</th><th>#le_sum#</th> </tr> </table>""" up_html = up_html.replace("#le_cut#", self.le_cut.text()) up_html = up_html.replace("#le_pack#", self.le_pack.text()) up_html = up_html.replace("#le_operation#", self.le_operation.text()) up_html = up_html.replace("#le_product#", self.le_product.text()) up_html = up_html.replace("#le_damage#", self.le_damage.text()) up_html = up_html.replace("#le_sum#", self.le_sum.text()) head = "Произведено компанией %s - %s" % (self.de_date_from.date().toString(Qt.ISODate), self.de_date_to.date().toString(Qt.ISODate)) html = table_to_html.tab_html(self.tableWidget, table_head=head, up_template=up_html) self.print_class = print_qt.PrintHtml(self, html)
def ui_print(self): up_html = """ <table> <tr> <th>Продано товара</th><th>На сумму</th><th>Затрачено рублей</th><th>ИТОГО прибыль</th> </tr> <tr> <td>#value_sum#</td><td>#sold_sum#</td><td>#seb_sum#</td><td>#all_sum#</td> </tr> </table>""" up_html = up_html.replace("#value_sum#", self.le_value_sum.text()) up_html = up_html.replace("#sold_sum#", self.le_sold_sum.text()) up_html = up_html.replace("#seb_sum#", self.le_seb_sum.text()) up_html = up_html.replace("#all_sum#", self.le_profit_sum.text()) head = "Прибыль предприятия %s-%s" % ( self.de_date_from.date().toString( Qt.ISODate), self.de_date_to.date().toString(Qt.ISODate)) html = table_to_html.tab_html(self.tableWidget, table_head=head, up_template=up_html) self.print_class = print_qt.PrintHtml(self, html)
def ui_print_preliminary_salary(self): up_html = """ <table> <tr> <th>Операции</th><th>Доплаты</th><th>Вычеты</th><th>Итогоу</th> </tr> <tr> <td>#le_all_operation#</td><td>#le_all_plus#</td><td>#le_all_minus#</td><td>#le_all_sum#</td> </tr> </table>""" up_html = up_html.replace("#le_all_operation#", self.le_all_operation_2.text()) up_html = up_html.replace("#le_all_plus#", self.le_all_plus_2.text()) up_html = up_html.replace("#le_all_minus#", self.le_all_minus_2.text()) up_html = up_html.replace("#le_all_sum#", self.le_all_sum_2.text()) head = "Предварительный расчет зарплаты %s" % ( QDate.currentDate().toString("dd.MM.yyyy")) html = table_to_html.tab_html(self.tw_main_salary_2, table_head=head, up_template=up_html) self.print_class = print_qt.PrintHtml(self, html)
def ui_print(self): head = "Средняя обрезь %s-%s" % (self.de_date_from.date().toString( Qt.ISODate), self.de_date_to.date().toString(Qt.ISODate)) up_html = """ <table> <tr> <th>Минимальное</th><th>Среднее</th><th>Максимальное</th> </tr> <tr> <td>#min#</td><td>#avg#</td><td>#max#</td> </tr> </table>""" up_html = up_html.replace("#min#", str(self.le_min.text())) up_html = up_html.replace("#avg#", str(self.le_awg.text())) up_html = up_html.replace("#max#", str(self.le_max.text())) html = table_to_html.tab_html(self.tw_work, table_head=head, up_template=up_html) self.print_class = print_qt.PrintHtml(self, html)
def ui_print(self): up_html = """ <table> <tr> <th>Остаток ткани</th><th>На сумму</th><th>Остаток фурнитуры</th><th>На сумму</th> </tr> <tr> <td>#material_balance#</td><td>#material_sum#</td><td>#accessories_balance#</td><td>#accessories_sum#</td> </tr> </table>""" up_html = up_html.replace("#material_balance#", self.le_material_balance.text()) up_html = up_html.replace("#material_sum#", self.le_material_sum.text()) up_html = up_html.replace("#accessories_balance#", self.le_accessories_balance.text()) up_html = up_html.replace("#accessories_sum#", self.le_accessories_sum.text()) head = "Остаток склада на %s" % (self.de_date_to.date().toString( Qt.ISODate)) html = table_to_html.tab_html(self.tableWidget, table_head=head, up_template=up_html) self.print_class = print_qt.PrintHtml(self, html)
def ui_print(self): head = self.windowTitle() html = table_to_html.tab_html(self.table_widget, table_head=head) self.print_class = print_qt.PrintHtml(self, html)
def ui_print(self): head = "Налог %s - %s" % (self.de_date_from.date().toString( Qt.ISODate), self.de_date_to.date().toString(Qt.ISODate)) html = table_to_html.tab_html(self.tableWidget, table_head=head) self.print_class = print_qt.PrintHtml(self, html)
def ui_print_comparing(self): head = "Прочие расходы с %s По %s" % (self.de_comparing_from.date().toString("dd.MM.yyyy"), self.de_comparing_to.date().toString("dd.MM.yyyy")) html = table_to_html.tab_html(self.tw_comparing, table_head=head) self.print_class = print_qt.PrintHtml(self, html)
def ui_print_accessories(self): head = "Расход фурнитуры с %s По %s" % (self.de_accessories_from.date().toString("dd.MM.yyyy"), self.de_accessories_to.date().toString("dd.MM.yyyy")) html = table_to_html.tab_html(self.tw_accessories, table_head=head) html += table_to_html.tab_html(self.tw_accesories_info, table_head="Подробно") self.print_class = print_qt.PrintHtml(self, html)
def ui_print_material(self): head = "Расход ткани с %s По %s" % (self.de_material_from.date().toString("dd.MM.yyyy"), self.de_material_to.date().toString("dd.MM.yyyy")) html = table_to_html.tab_html(self.tw_material, table_head=head) html += table_to_html.tab_html(self.tw_material_info, table_head="Подробно") self.print_class = print_qt.PrintHtml(self, html)
def ui_print(self): up_html = """ <p style="text-align:center"> </p> <p style="text-align:center"> </p> <p style="text-align:center"> </p> <p style="text-align:center"><strong><span style="font-size:25px">Акт отбора образцов</span></strong></p> <p style="text-align:center"> </p> <p style="text-align:center"><span style="font-size:20px">Настоящий акт свидетельствует о том, что #act_date# г.<br /> были отобраны образцы (выборки или пробы) для проведения контроля или испатыния.</span></p> <p style="text-align:center"> </p> <p style="text-align:center"> </p> <ol style="margin-left:160px"> <li><span style="font-size:20px">Фамилии членов комиссии: #workers#</span></li> <li><span style="font-size:20px">Наименование продукции: #type_material#</span></li> <li><span style="font-size:20px">Поставщик: #supply_provider#</span></li> <li><span style="font-size:20px">Накладная: #supply_act#</span></li> <li><span style="font-size:20px">Дата потсупления продукции: #supply_date#</span></li> <li><span style="font-size:20px">Колличество (масса): #supply_value#</span></li> <li><span style="font-size:20px">Вид упаковки: #type_pack#</span></li> <li><span style="font-size:20px">Место отбора образцов: #audit_location#</span></li> <li><span style="font-size:20px">Образцы отобраны в соответствии с: #gost#</span></li> <li><span style="font-size:20px">Колличество отобраныых образцов: #audit_value#</span></li> </ol> <p> </p> <p> </p> <p style="margin-left:80px">Подписи членов комиссии</p> """ up_html = up_html.replace( "#act_date#", self.ui_de_act_date.date().toPyDate().strftime("%d.%m.%Y")) up_html = up_html.replace("#workers#", self.ui_le_workers.text()) up_html = up_html.replace("#type_material#", self.ui_le_type_material.text()) up_html = up_html.replace("#supply_provider#", self.ui_le_supply_provider.text()) up_html = up_html.replace("#supply_act#", self.ui_le_supply_act.text()) up_html = up_html.replace( "#supply_date#", self.ui_de_supply_date.date().toPyDate().strftime("%d.%m.%Y")) up_html = up_html.replace("#supply_value#", self.ui_le_supply_value.text()) up_html = up_html.replace("#type_pack#", self.ui_le_type_pack.text()) up_html = up_html.replace("#audit_location#", self.ui_le_audit_location.text()) up_html = up_html.replace("#gost#", self.ui_le_gost.text()) up_html = up_html.replace("#audit_value#", self.ui_le_audit_value.text()) self.print_class = print_qt.PrintHtml(self, up_html)