本文整理匯總了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')