Exemplo n.º 1
0
 def generate_account_callfunds(self, call_funds, fiscal_year):
     for type_call, type_title in self.get_callfunds_list():
         calldetails = call_funds.calldetail_set.filter(type_call=type_call)
         if len(calldetails) > 0:
             designation = _(
                 'call of funds "%(type)s" #%(num)d - %(date)s') % {
                     'num': call_funds.num,
                     'type': type_title,
                     'date': get_date_formating(call_funds.date)
                 }
             new_entry = EntryAccount.objects.create(
                 year=fiscal_year,
                 date_value=call_funds.date,
                 designation=designation,
                 journal_id=3)
             owner_account_filter = call_funds.supporting.get_third_mask(
                 type_owner=type_call + 1)
             owner_account = call_funds.owner.third.get_account(
                 fiscal_year, owner_account_filter)
             total = self._generate_account_callfunds_by_type(
                 new_entry, type_call, calldetails)
             EntryLineAccount.objects.create(account=owner_account,
                                             amount=total,
                                             entry=new_entry,
                                             third=call_funds.owner.third)
Exemplo n.º 2
0
 def CurrentCallFundsAdding(self, to_create):
     nb_seq = 0
     if Params.getvalue("condominium-mode-current-callfunds") == 0:
         nb_seq = 4
     if Params.getvalue("condominium-mode-current-callfunds") == 1:
         nb_seq = 12
     year = FiscalYear.get_current()
     calls = CallFunds.objects.filter(
         date__gte=year.begin,
         date__lte=year.end,
         calldetail__type_call=0,
         calldetail__set__isnull=False).distinct()
     nb_curent = len(calls)
     if to_create:
         year = FiscalYear.get_current()
         date = same_day_months_after(year.begin,
                                      int(nb_curent * 12 / nb_seq))
         new_call = CallFunds.objects.create(
             date=date,
             comment=_(
                 "Call of funds #%(num)d of year from %(begin)s to %(end)s")
             % {
                 'num': nb_curent + 1,
                 'begin': get_date_formating(year.begin),
                 'end': get_date_formating(year.end)
             },
             status=0)
         for category in Set.objects.filter(type_load=0, is_active=True):
             CallDetail.objects.create(
                 set=category,
                 type_call=0,
                 callfunds=new_call,
                 price=category.get_new_current_callfunds(),
                 designation=_("%(type)s - #%(num)d") % {
                     'type': _('current'),
                     'num': nb_curent + 1
                 })
     else:
         return nb_curent < nb_seq
Exemplo n.º 3
0
 def get_date_txt(self):
     if self.event_type == 0:
         return get_date_formating(self.date)
     else:
         return "%s -> %s" % (get_date_formating(
             self.date), get_date_formating(self.date_end))
Exemplo n.º 4
0
 def date_end(self):
     emails_sent = self.emailsent_set.order_by('-date')
     if len(emails_sent) > 0:
         return get_date_formating(emails_sent[0].date)
     return '---'