def get_info_state(self): info = [] if self.status == 0: info = Supporting.get_info_state( self, current_system_account().get_customer_mask()) details = self.detail_set.all() if len(details) == 0: info.append(six.text_type(_("no detail"))) else: for detail in details: if detail.article is not None: detail_code = detail.article.sell_account else: detail_code = Params.getvalue( "invoice-default-sell-account") detail_account = None if match(current_system_account().get_revenue_mask(), detail_code) is not None: try: detail_account = ChartsAccount.get_account( detail_code, FiscalYear.get_current()) except LucteriosException: break if detail_account is None: info.append( six.text_type(_("article has code account unknown!"))) break try: info.extend(self.check_date(self.date.isoformat())) except LucteriosException: pass return "{[br/]}".join(info)
def get_print_fields(cls): print_fields = [ (_("bill type"), "type_bill"), (_('numeros'), "num_txt"), "date", "third", "detail_set"] print_fields.extend(Supporting.get_print_fields()) print_fields.extend( ["comment", "status", (_('total'), 'total_excltax'), (_('VTA sum'), 'vta_sum'), (_('total incl. taxes'), 'total_incltax')]) print_fields.append('OUR_DETAIL') return print_fields
def get_default_fields(cls, status=-1): fields = ["bill_type", (_('numeros'), "num_txt"), "date", "third", "comment", (_('total'), 'total')] if status == -1: fields.append("status") elif status == 1: fields.append(Supporting.get_payoff_fields()[-1][-1]) return fields
def __init__(self, owner): Supporting.__init__(self, third=owner.third, is_revenu=False) self.owner = owner