def title(self): return u"Notes de dépense de {0} pour la période de {1} {2}"\ .format( format_account(self.request.context.user), month_name(self.context.month), self.context.year, )
def title(self): """ Return the title of the page """ return u"Notes de dépense de {0} pour la période de {1} {2}".format( format_account(self.request.context.user), month_name(self.month), self.year )
def set_static_cols(self): SageExpensePaymentMain.set_static_cols(self) self.code_journal = self.config.get('code_journal_waiver_ndf') if not self.code_journal: self.code_journal = self.config['code_journal_ndf'] self.mode = u"Abandon de créance" self.code_taxe = "" self.libelle = u"Abandon de créance {name} {month}/{year}".format( name=self.user.lastname.upper(), month=render_api.month_name(self.expense.month), year=self.expense.year, )
def set_static_cols(self): # set static fields values self.reference = u"{0}".format(self.expense.id) self.code_journal = self.payment.bank.code_journal self.date = format_sage_date(self.payment.date) self.mode = self.payment.mode self.libelle = u"{nom} / REMB FRAIS {mois}/{annee}".format( nom=self.user.lastname.upper(), mois=render_api.month_name(self.expense.month), annee=self.expense.year, ) self.num_analytique = self.company.code_compta self.code_taxe = self.config['code_tva_ndf']
def reset_success(self, appstruct): """ Reset an expense """ log.debug(u"Resetting the expense") if self.request.context.status == 'draft': self.dbsession.delete(self.request.context) self.session.flash(u"Votre feuille de notes de frais de {0} {1} a \ bien été réinitialisée".format(month_name(self.month), self.year)) else: self.session.flash(u"Vous n'êtes pas autorisé à réinitialiser \ cette feuille de notes de frais") cid = self.request.context.company_id uid = self.request.context.user_id url = self.request.route_url("user_expenses", id=cid, uid=uid, _query=dict(year=self.year, month=self.month)) return HTTPFound(url)
def reset_success(self, appstruct): """ Reset an expense """ logger.debug(u"Resetting the expense") if self.context.status == 'draft': self.dbsession.delete(self.context) self.session.flash( u"Votre feuille de notes de dépense de {0} {1} a \ bien été réinitialisée".format(month_name(self.month), self.year)) else: self.session.flash(u"Vous n'êtes pas autorisé à réinitialiser \ cette feuille de notes de dépense") cid = self.context.company_id uid = self.context.user_id url = self.request.route_url("user_expenses", id=cid, uid=uid, _query=dict(year=self.year, month=self.month)) return HTTPFound(url)
def get_entry(self, result, year, month, month_dir, type_): """ Return an entry for the listing for admin files """ result = None label = month_name(month) if label: all_files = [filename for filename in os.listdir(month_dir)\ if belongs_to_company(filename)] if len(all_files) > 0: url = self.request.route_path( 'admin_treasury_files', filetype=type_, year=year, month=month, ) result = { "label": label, "url": url, "nbfiles": len(all_files), } return result