本文整理汇总了Python中stoqlib.gui.utils.printing.print_report函数的典型用法代码示例。如果您正苦于以下问题:Python print_report函数的具体用法?Python print_report怎么用?Python print_report使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了print_report函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_print_booklets__clicked
def on_print_booklets__clicked(self, button):
# Remove cancelled and not store_credit payments
payments = [p for p in self.payments_list if
p.method.method_name == u'store_credit' and
not p.is_cancelled()]
print_report(BookletReport, payments)
示例2: on_TillDailyMovement__activate
def on_TillDailyMovement__activate(self, button):
date_range = self.run_dialog(DateRangeDialog)
if not date_range:
return
print_report(TillDailyMovementReport, self.store,
start_date=date_range.start, end_date=date_range.end)
示例3: _print_report
def _print_report(self):
if self.model.status == PurchaseOrder.ORDER_QUOTING:
report = PurchaseQuoteReport
else:
report = PurchaseOrderReport
print_report(report, self.model)
示例4: print_quote_details
def print_quote_details(self, model, payments_created=False):
msg = _('Would you like to print the quote details now?')
# We can only print the details if the quote was confirmed.
if yesno(msg, gtk.RESPONSE_YES,
_("Print quote details"), _("Don't print")):
orders = WorkOrder.find_by_sale(self.model.store, self.model)
print_report(OpticalWorkOrderReceiptReport, list(orders))
示例5: finish
def finish(self):
for payment in self.model.group.payments:
if payment.is_preview():
# Set payments created on SaleReturnPaymentStep as pending
payment.set_pending()
SaleReturnWizardFinishEvent.emit(self.model)
total_amount = self.model.total_amount
# If the user chose to create credit for the client instead of returning
# money, there is no need to display this messages.
if not self.credit:
if total_amount == 0:
info(_("The client does not have a debt to this sale anymore. "
"Any existing unpaid installment will be cancelled."))
elif total_amount < 0:
info(_("A reversal payment to the client will be created. "
"You can see it on the Payable Application."))
self.model.return_(method_name=u'credit' if self.credit else u'money')
self.retval = self.model
self.close()
if self.credit:
if yesno(_(u'Would you like to print the credit letter?'),
gtk.RESPONSE_YES, _(u"Print Letter"), _(u"Don't print")):
print_report(ClientCreditReport, self.model.client)
示例6: finish
def finish(self):
missing = get_missing_items(self.model, self.store)
if missing:
# We want to close the checkout, so the user will be back to the
# list of items in the sale.
self.close()
run_dialog(MissingItemsDialog, self, self.model, missing)
return False
self.retval = True
invoice_number = self.invoice_model.invoice_number
# Workaround for bug 4218: If the invoice is was already used by
# another store (another cashier), try using the next one
# available, or show a warning if the number was manually set.
while True:
try:
self.store.savepoint('before_set_invoice_number')
self.model.invoice_number = invoice_number
# We need to flush the database here, or a possible collision
# of invoice_number will only be detected later on, when the
# execution flow is not in the try-except anymore.
self.store.flush()
except IntegrityError:
self.store.rollback_to_savepoint('before_set_invoice_number')
if self._invoice_changed():
warning(_(u"The invoice number %s is already used. "
"Confirm the sale again to chose another one.") %
invoice_number)
self.retval = False
break
else:
invoice_number += 1
else:
break
self.close()
group = self.model.group
# FIXME: This is set too late on Sale.confirm(). If PaymentGroup don't
# have a payer, we won't be able to print bills/booklets.
group.payer = self.model.client and self.model.client.person
# Commit before printing to avoid losing data if something breaks
self.store.confirm(self.retval)
ConfirmSaleWizardFinishEvent.emit(self.model)
booklets = list(group.get_payments_by_method_name(u'store_credit'))
bills = list(group.get_payments_by_method_name(u'bill'))
if (booklets and
yesno(_("Do you want to print the booklets for this sale?"),
gtk.RESPONSE_YES, _("Print booklets"), _("Don't print"))):
print_report(BookletReport, booklets)
if (bills and BillReport.check_printable(bills) and
yesno(_("Do you want to print the bills for this sale?"),
gtk.RESPONSE_YES, _("Print bills"), _("Don't print"))):
print_report(BillReport, bills)
示例7: on_print_bills__clicked
def on_print_bills__clicked(self, button):
# Remove cancelled and not bill payments
payments = [p for p in self.payments_list if p.method.method_name == u"bill" and not p.is_cancelled()]
if not BillReport.check_printable(payments):
return False
print_report(BillReport, payments)
示例8: print_report
def print_report(self):
salesperson_id = self._salesperson_filter.combo.get_selected()
salesperson = (salesperson_id and
self.store.get(SalesPerson, salesperson_id))
print_report(self.report_class, list(self.results),
salesperson=salesperson,
filters=self.search.get_search_filters())
示例9: _print_transaction_report
def _print_transaction_report(self):
assert not self._is_accounts_tab()
page = self.get_current_page()
print_report(AccountTransactionReport, page.result_view,
list(page.result_view),
account=page.model,
filters=page.search.get_search_filters())
示例10: on_PrintReceipt__activate
def on_PrintReceipt__activate(self, action):
payment_views = self.results.get_selected_rows()
payments = [v.payment for v in payment_views]
date = localtoday().date()
print_report(
OutPaymentReceipt,
payment=payments[0],
order=payment_views[0].purchase,
date=date)
示例11: _on_PrintReportEvent
def _on_PrintReportEvent(self, report_class, *args, **kwargs):
if issubclass(report_class, SaleOrderReport):
sale = args[0]
store = sale.store
workorders = list(WorkOrder.find_by_sale(store, sale))
if len(workorders):
print_report(OpticalWorkOrderReceiptReport, workorders)
return True
return False
示例12: confirm
def confirm(self):
DateRangeDialog.confirm(self)
start = self.retval.start
end = self.retval.end
results = PaymentFlowDay.get_flow_history(self.store, start, end)
if not results:
info(_('No payment history found.'))
return False
print_report(PaymentFlowHistoryReport, payment_histories=results)
return True
示例13: confirm
def confirm(self):
state = self._date_filter.get_state()
from stoqlib.database.queryexecuter import DateQueryState
if isinstance(state, DateQueryState):
start, end = state.date, state.date
else:
start, end = state.start, state.end
results = PaymentFlowDay.get_flow_history(self.store, start, end)
if not results:
info(_('No payment history found.'))
return False
print_report(PaymentFlowHistoryReport, payment_histories=results)
return True
示例14: print_quote_details
def print_quote_details(self, quote, payments_created=False):
already_printed = SaleQuoteFinishPrintEvent.emit(self.model)
if already_printed is not None:
return
msg_list = []
if not quote.group.payments.is_empty():
msg_list.append(
_('The created payments can be found in the Accounts '
'Receivable application and you can set them as paid '
'there at any time.'))
msg_list.append(_('Would you like to print the quote details now?'))
# We can only print the details if the quote was confirmed.
if yesno('\n\n'.join(msg_list), Gtk.ResponseType.YES,
_("Print quote details"), _("Don't print")):
print_report(SaleOrderReport, self.model)
示例15: _print_test_bill
def _print_test_bill(self):
try:
bank_info = get_bank_info_by_number(self.bank_model.bank_number)
except NotImplementedError:
info(_("This bank does not support printing of bills"))
return
kwargs = dict(
valor_documento=12345.67,
data_vencimento=datetime.date.today(),
data_documento=datetime.date.today(),
data_processamento=datetime.date.today(),
nosso_numero=u'624533',
numero_documento=u'1138',
sacado=[_(u"Drawee"), _(u"Address"), _(u"Details")],
cedente=[_(u"Supplier"), _(u"Address"), _(u"Details"), ("CNPJ")],
demonstrativo=[_(u"Demonstration")],
instrucoes=[_(u"Instructions")],
agencia=self.bank_model.bank_branch,
conta=self.bank_model.bank_account,
)
for opt in self.bank_model.options:
kwargs[opt.option] = opt.value
data = bank_info(**kwargs)
print_report(BillTestReport, data)