def conf_wizard_accounting(wizard_ident, xfer): if isinstance(wizard_ident, list) and (xfer is None): wizard_ident.append(("accounting_params", 21)) wizard_ident.append(("accounting_fiscalyear", 22)) wizard_ident.append(("accounting_journal", 23)) elif (xfer is not None) and (wizard_ident == "accounting_params"): xfer.add_title(_("Diacamma accounting"), _('Parameters'), _('Configuration of accounting parameters')) select_account_system(xfer) fill_params(xfer, True) elif (xfer is not None) and (wizard_ident == "accounting_fiscalyear"): xfer.add_title(_("Diacamma accounting"), _('Fiscal year list'), _('Configuration of fiscal years')) xfer.fill_grid(5, FiscalYear, 'fiscalyear', FiscalYear.objects.all()) try: current_year = FiscalYear.get_current() nb_account = len(ChartsAccount.objects.filter(year=current_year)) lbl = XferCompLabelForm('nb_account') lbl.set_value(_("Total of charts of accounts in current fiscal year: %d") % nb_account) lbl.set_location(0, 10) xfer.add_component(lbl) if nb_account == 0: xfer.item = ChartsAccount() xfer.item.year = current_year btn = XferCompButton('initialfiscalyear') btn.set_location(1, 10) btn.set_action(xfer.request, ActionsManage.get_action_url(ChartsAccount.get_long_name(), 'AccountInitial', xfer), close=CLOSE_NO) xfer.add_component(btn) except LucteriosException as lerr: lbl = XferCompLabelForm('nb_account') lbl.set_value(six.text_type(lerr)) lbl.set_location(0, 10, 2) xfer.add_component(lbl) elif (xfer is not None) and (wizard_ident == "accounting_journal"): xfer.add_title(_("Diacamma accounting"), _('Journals'), _('Configuration of journals')) xfer.fill_grid(5, Journal, 'journal', Journal.objects.all())
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Lucterios. If not, see <http://www.gnu.org/licenses/>. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from diacamma.accounting.models import ChartsAccount name = _("listing") kind = 0 modelname = ChartsAccount.get_long_name() value = """210 297 10//%s//#code 25//%s//#name 15//%s//#last_year_total 15//%s//#current_total 15//%s//#current_validated """ % ( _("code"), _("name"), _("total of last year"), _("total current"), _("total validated"), )
def __init__(self, **kwargs): ObjectMerge.__init__(self, **kwargs) self.params['modelname'] = ChartsAccount.get_long_name()