Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!CurrentOrganization.IsEconomyEnabled)
            {
                Response.Redirect("/Pages/v5/Financial/EconomyNotEnabled.aspx", true);
                return;
            }

            if (!Page.IsPostBack)
            {
                // Localize

                PageIcon           = "iconshock-openbook";
                this.BoxTitle.Text = PageTitle = Resources.Pages.Ledgers.AccountPlan_PageTitle;
                InfoBoxLiteral     = Resources.Pages.Ledgers.AccountPlan_Info;
                this.LiteralExpensesBudgetsAreNegative.Text =
                    Resources.Pages.Ledgers.AccountPlan_ExpensesBudgetsAreNegative;
                this.LiteralDebtBalancesAreNegative.Text =
                    Resources.Pages.Ledgers.AccountPlan_DebtBalancesAreNegative;
                this.LiteralHeaderAccountName.Text          = Resources.Pages.Ledgers.AccountPlan_Header_AccountName;
                this.LiteralHeaderBalance.Text              = Resources.Pages.Ledgers.AccountPlan_Header_Balance;
                this.LiteralHeaderBudget.Text               = Resources.Pages.Ledgers.AccountPlan_Header_Budget;
                this.LiteralHeaderEdit.Text                 = Resources.Pages.Ledgers.AccountPlan_Header_Edit;
                this.LiteralHeaderEditingAccount.Text       = Resources.Pages.Ledgers.AccountPlan_Edit_Header;
                this.LiteralHeaderFlags.Text                = Resources.Pages.Ledgers.AccountPlan_Header_Flags;
                this.LiteralHeaderOwner.Text                = Global.Global_Owner;
                this.LiteralLabelAccountName.Text           = Resources.Pages.Ledgers.AccountPlan_Edit_AccountName;
                this.LiteralLabelActiveLong.Text            = Resources.Pages.Ledgers.AccountPlan_Edit_ActiveLong;
                this.LiteralLabelActiveShort.Text           = Resources.Pages.Ledgers.AccountPlan_Edit_ActiveShort;
                this.LiteralLabelAdministrativeLong.Text    = Resources.Pages.Ledgers.AccountPlan_Edit_AdministrativeLong;
                this.LiteralLabelAdministrativeShort.Text   = Resources.Pages.Ledgers.AccountPlan_Edit_AdministrativeShort;
                this.LiteralLabelBudgetBalance.Text         = Resources.Pages.Ledgers.AccountPlan_Edit_BudgetBalance;
                this.LiteralLabelExpensableLong.Text        = Resources.Pages.Ledgers.AccountPlan_Edit_ExpensableLong;
                this.LiteralLabelExpensableShort.Text       = Resources.Pages.Ledgers.AccountPlan_Edit_ExpensableShort;
                this.LiteralLabelFileUploadProfile.Text     = Resources.Pages.Ledgers.AccountPlan_Edit_FileUploadProfile;
                this.LiteralLabelHeaderAutomation.Text      = Resources.Pages.Ledgers.AccountPlan_Edit_HeaderAutomation;
                this.LiteralLabelHeaderConfiguration.Text   = Resources.Pages.Ledgers.AccountPlan_Edit_HeaderConfiguration;
                this.LiteralLabelHeaderDailyOperations.Text =
                    Resources.Pages.Ledgers.AccountPlan_Edit_HeaderDailyOperations;
                this.LiteralLabelOwner.Text  = Global.Global_Owner;
                this.LiteralLabelParent.Text = Resources.Pages.Ledgers.AccountPlan_Edit_Parent;

                this.LiteralLabelInitialAmount.Text =
                    String.Format(Resources.Pages.Ledgers.AccountPlan_Edit_InitialBalance,
                                  CurrentOrganization.FirstFiscalYear, CurrentOrganization.Currency.DisplayCode);

                FinancialAccounts organizationAccounts = FinancialAccounts.ForOrganization(this.CurrentOrganization);
                int inactiveCount = organizationAccounts.Count(account => !account.Active);

                this.LabelSidebarOptions.Text      = Resources.Global.Sidebar_Options;
                this.LabelOptionsShowInactive.Text = String.Format(Resources.Pages.Ledgers.AccountPlan_Options_ShowInactive, inactiveCount);
            }
            PageAccessRequired = new Access(CurrentOrganization, AccessAspect.Bookkeeping, AccessType.Write);
            DbVersionRequired  = 2; // Account reparenting

            RegisterControl(EasyUIControl.DataGrid | EasyUIControl.Tree);
            RegisterControl(IncludedControl.SwitchButton);
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!CurrentOrganization.IsEconomyEnabled)
            {
                Response.Redirect("/Pages/v5/Financial/EconomyNotEnabled.aspx", true);
                return;
            }

            if (!Page.IsPostBack)
            {
                // Localize

                PageIcon           = "iconshock-openbook";
                this.BoxTitle.Text = PageTitle = Resources.Pages.Ledgers.AccountPlan_PageTitle;
                InfoBoxLiteral     = Resources.Pages.Ledgers.AccountPlan_Info;
                this.LiteralExpensesBudgetsAreNegative.Text =
                    Resources.Pages.Ledgers.AccountPlan_ExpensesBudgetsAreNegative;
                this.LiteralDebtBalancesAreNegative.Text =
                    Resources.Pages.Ledgers.AccountPlan_DebtBalancesAreNegative;
                this.LiteralHeaderAccountName.Text          = Resources.Pages.Ledgers.AccountPlan_Header_AccountName;
                this.LiteralHeaderBalance.Text              = Resources.Pages.Ledgers.AccountPlan_Header_Balance;
                this.LiteralHeaderBudget.Text               = Resources.Pages.Ledgers.AccountPlan_Header_Budget;
                this.LiteralHeaderEdit.Text                 = Resources.Pages.Ledgers.AccountPlan_Header_Edit;
                this.LiteralHeaderEditingAccount.Text       = Resources.Pages.Ledgers.AccountPlan_Edit_Header;
                this.LiteralHeaderFlags.Text                = Resources.Pages.Ledgers.AccountPlan_Header_Flags;
                this.LiteralHeaderOwner.Text                = Global.Global_Owner;
                this.LiteralLabelAccountName.Text           = Resources.Pages.Ledgers.AccountPlan_Edit_AccountName;
                this.LiteralLabelActiveLong.Text            = Resources.Pages.Ledgers.AccountPlan_Edit_ActiveLong;
                this.LiteralLabelActiveShort.Text           = Resources.Pages.Ledgers.AccountPlan_Edit_ActiveShort;
                this.LiteralLabelAdministrativeLong.Text    = Resources.Pages.Ledgers.AccountPlan_Edit_AdministrativeLong;
                this.LiteralLabelAdministrativeShort.Text   = Resources.Pages.Ledgers.AccountPlan_Edit_AdministrativeShort;
                this.LiteralLabelBudgetBalance.Text         = Resources.Pages.Ledgers.AccountPlan_Edit_BudgetBalance;
                this.LiteralLabelExpensableLong.Text        = Resources.Pages.Ledgers.AccountPlan_Edit_ExpensableLong;
                this.LiteralLabelExpensableShort.Text       = Resources.Pages.Ledgers.AccountPlan_Edit_ExpensableShort;
                this.LabelFileUploadProfile.Text            = Resources.Pages.Ledgers.AccountPlan_Edit_FileUploadProfile;
                this.LabelHeaderAutomation.Text             = Resources.Pages.Ledgers.AccountPlan_Edit_HeaderAutomation;
                this.LiteralLabelHeaderConfiguration.Text   = Resources.Pages.Ledgers.AccountPlan_Edit_HeaderConfiguration;
                this.LiteralLabelHeaderDailyOperations.Text =
                    Resources.Pages.Ledgers.AccountPlan_Edit_HeaderDailyOperations;
                this.LiteralLabelOwner.Text  = Global.Global_Owner;
                this.LiteralLabelParent.Text = Resources.Pages.Ledgers.AccountPlan_Edit_Parent;

                this.LiteralLabelInitialAmount.Text =
                    String.Format(Resources.Pages.Ledgers.AccountPlan_Edit_InitialBalance,
                                  CurrentOrganization.FirstFiscalYear, CurrentOrganization.Currency.DisplayCode);

                FinancialAccounts organizationAccounts = FinancialAccounts.ForOrganization(this.CurrentOrganization);
                int inactiveCount = organizationAccounts.Count(account => !account.Active);

                this.LabelSidebarOptions.Text      = Resources.Global.Sidebar_Options;
                this.LabelOptionsShowInactive.Text = String.Format(Resources.Pages.Ledgers.AccountPlan_Options_ShowInactive, inactiveCount);

                this.DropAccountAutomationProfile.Items.Add(new ListItem(Resources.Global.Global_SelectOne, "0"));

                // Hardcoded automation profiles for the time being

                this.DropAccountAutomationProfile.Items.Add(new ListItem("[BTC] Bitcoin Core - Armory", ((int)(FinancialAccountAutomationProfileHardIds.BitcoinCoreArmory)).ToString()));
                this.DropAccountAutomationProfile.Items.Add(new ListItem("[BCH] Bitcoin Cash - Armory", ((int)(FinancialAccountAutomationProfileHardIds.BitcoinCoreArmory)).ToString()));
                this.DropAccountAutomationProfile.Items.Add(new ListItem("[CZ CZK] Fio CSV", ((int)(FinancialAccountAutomationProfileHardIds.BankCzechFio)).ToString()));
                this.DropAccountAutomationProfile.Items.Add(new ListItem("[DE EUR] Postbank CSV", ((int)(FinancialAccountAutomationProfileHardIds.BankGermanyPostbank)).ToString()));
                this.DropAccountAutomationProfile.Items.Add(new ListItem("[SE SEK] SEB CSV", ((int)(FinancialAccountAutomationProfileHardIds.BankSwedenSeb)).ToString()));
            }
            PageAccessRequired = new Access(CurrentOrganization, AccessAspect.Bookkeeping, AccessType.Write);
            DbVersionRequired  = 2; // Account reparenting

            RegisterControl(EasyUIControl.DataGrid | EasyUIControl.Tree);
            RegisterControl(IncludedControl.SwitchButton);
        }