本文整理汇总了Python中stoqlib.domain.sale.Sale.get_last_invoice_number方法的典型用法代码示例。如果您正苦于以下问题:Python Sale.get_last_invoice_number方法的具体用法?Python Sale.get_last_invoice_number怎么用?Python Sale.get_last_invoice_number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stoqlib.domain.sale.Sale
的用法示例。
在下文中一共展示了Sale.get_last_invoice_number方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _setup_widgets
# 需要导入模块: from stoqlib.domain.sale import Sale [as 别名]
# 或者: from stoqlib.domain.sale.Sale import get_last_invoice_number [as 别名]
def _setup_widgets(self):
self.main_dialog.ok_button.set_label(gtk.STOCK_PRINT)
if self.model.invoice_number is not None:
self.invoice_number.set_sensitive(False)
else:
last_invoice_number = Sale.get_last_invoice_number(self.store) or 0
self.invoice_number.update(last_invoice_number + 1)
示例2: setup_widgets
# 需要导入模块: from stoqlib.domain.sale import Sale [as 别名]
# 或者: from stoqlib.domain.sale.Sale import get_last_invoice_number [as 别名]
def setup_widgets(self):
marker('Setting up widgets')
# Only quotes have expire date.
self.expire_date.hide()
self.expire_label.hide()
# Hide operation nature widgets
self.operation_nature.hide()
self.nature_lbl.hide()
# Hide client category widgets
self.client_category_lbl.hide()
self.client_category.hide()
# if the NF-e plugin is active, the client is mandantory in this
# wizard (in this situation, we have only quote sales).
if self.model.status == Sale.STATUS_QUOTE:
manager = get_plugin_manager()
mandatory_client = manager.is_active('nfe')
self.client.set_property('mandatory', mandatory_client)
marker('Filling sales persons')
salespersons = self.store.find(SalesPerson)
self.salesperson.prefill(api.for_person_combo(salespersons))
marker('Finished filling sales persons')
marker('Read parameter')
if not sysparam(self.store).ACCEPT_CHANGE_SALESPERSON:
self.salesperson.set_sensitive(False)
else:
self.salesperson.grab_focus()
marker('Finished reading parameter')
self._fill_clients_combo()
self._fill_transporter_combo()
self._fill_cost_center_combo()
if sysparam(self.store).ASK_SALES_CFOP:
self._fill_cfop_combo()
else:
self.cfop_lbl.hide()
self.cfop.hide()
self.create_cfop.hide()
# the maximum number allowed for an invoice is 999999999.
self.invoice_number.set_adjustment(
gtk.Adjustment(lower=1, upper=999999999, step_incr=1))
if not self.model.invoice_number:
new_invoice_number = Sale.get_last_invoice_number(self.store) + 1
self.invoice_model.invoice_number = new_invoice_number
else:
new_invoice_number = self.model.invoice_number
self.invoice_model.invoice_number = new_invoice_number
self.invoice_number.set_sensitive(False)
self.invoice_model.original_invoice = new_invoice_number
marker('Finished setting up widgets')