本文整理汇总了Python中corehq.apps.accounting.interface.InvoiceInterface.filter_by_subscription方法的典型用法代码示例。如果您正苦于以下问题:Python InvoiceInterface.filter_by_subscription方法的具体用法?Python InvoiceInterface.filter_by_subscription怎么用?Python InvoiceInterface.filter_by_subscription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corehq.apps.accounting.interface.InvoiceInterface
的用法示例。
在下文中一共展示了InvoiceInterface.filter_by_subscription方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: invoice_context
# 需要导入模块: from corehq.apps.accounting.interface import InvoiceInterface [as 别名]
# 或者: from corehq.apps.accounting.interface.InvoiceInterface import filter_by_subscription [as 别名]
def invoice_context(self):
subscriber_domain = self.subscription.subscriber.domain
invoice_report = InvoiceInterface(self.request)
invoice_report.filter_by_subscription(self.subscription)
# 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,
}