本文整理汇总了Python中corehq.apps.accounting.interface.InvoiceInterface.get_url方法的典型用法代码示例。如果您正苦于以下问题:Python InvoiceInterface.get_url方法的具体用法?Python InvoiceInterface.get_url怎么用?Python InvoiceInterface.get_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corehq.apps.accounting.interface.InvoiceInterface
的用法示例。
在下文中一共展示了InvoiceInterface.get_url方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from corehq.apps.accounting.interface import InvoiceInterface [as 别名]
# 或者: from corehq.apps.accounting.interface.InvoiceInterface import get_url [as 别名]
def post(self, request, *args, **kwargs):
if 'adjust' in self.request.POST:
if self.adjust_balance_form.is_valid():
self.adjust_balance_form.adjust_balance(
web_user=self.request.user.username,
)
return HttpResponseRedirect(request.META.get('HTTP_REFERER') or self.page_url)
elif 'resend' in self.request.POST:
if self.resend_email_form.is_valid():
try:
self.resend_email_form.resend_email()
return HttpResponseRedirect(self.page_url)
except Exception as e:
messages.error(request,
"Could not send emails due to: %s" % e)
elif SuppressInvoiceForm.submit_kwarg in self.request.POST:
if self.suppress_invoice_form.is_valid():
self.suppress_invoice_form.suppress_invoice()
if self.invoice.is_customer_invoice:
return HttpResponseRedirect(CustomerInvoiceInterface.get_url())
else:
return HttpResponseRedirect(InvoiceInterface.get_url())
elif HideInvoiceForm.submit_kwarg in self.request.POST:
if self.hide_invoice_form.is_valid():
self.hide_invoice_form.hide_invoice()
return self.get(request, *args, **kwargs)
示例2: invoice_context
# 需要导入模块: from corehq.apps.accounting.interface import InvoiceInterface [as 别名]
# 或者: from corehq.apps.accounting.interface.InvoiceInterface import get_url [as 别名]
def invoice_context(self):
subscriber_domain = self.subscription.subscriber.domain
invoice_report = InvoiceInterface(self.request)
invoice_report.filters.update(subscription__subscriber__domain=subscriber_domain)
# Tied to InvoiceInterface.
encoded_params = urlencode({'subscriber': subscriber_domain})
invoice_report_url = "{}?{}".format(invoice_report.get_url(), encoded_params)
invoice_export_url = "{}?{}".format(invoice_report.get_url(render_as='export'), encoded_params)
return {
'invoice_headers': invoice_report.headers,
'invoice_rows': invoice_report.rows,
'invoice_export_url': invoice_export_url,
'invoice_report_url': invoice_report_url,
'adjust_balance_forms': invoice_report.adjust_balance_forms,
}
示例3: parent_pages
# 需要导入模块: from corehq.apps.accounting.interface import InvoiceInterface [as 别名]
# 或者: from corehq.apps.accounting.interface.InvoiceInterface import get_url [as 别名]
def parent_pages(self):
return [{"title": InvoiceInterface.name, "url": InvoiceInterface.get_url()}]