void UpdateMaster()
        {
            dgAccountsTransGrid.UpdateMaster(master);
            bool RoundTo100;
            var  Comp = api.CompanyEntity;

            if (Comp.SameCurrency(master._Currency))
            {
                RoundTo100 = Comp.RoundTo100;
            }
            else
            {
                ShowCurrency = true;
                RoundTo100   = !CurrencyUtil.HasDecimals(master._Currency);
            }
            if (RoundTo100)
            {
                Debit.HasDecimals = Credit.HasDecimals = Amount.HasDecimals = Total.HasDecimals = false;
            }

            if (!Comp._UseVatOperation)
            {
                VatOperation.Visible = false;
            }
        }
Exemplo n.º 2
0
        public BankStLines(UnicontaBaseEntity sourceData)
            : base(sourceData)
        {
            InitializeComponent();
            this.DataContext = this;

            master = sourceData as BankStatement;
            if (fromDate == DateTime.MinValue)
            {
                DateTime date            = GetSystemDefaultDate();
                var      firstDayOfMonth = new DateTime(date.Year, date.Month, 1);
                var      lastDayOfMonth  = firstDayOfMonth.AddMonths(1).AddDays(-1);
                fromDate = firstDayOfMonth;
                toDate   = lastDayOfMonth;
            }

            bool RoundTo100;
            var  Comp = api.CompanyEntity;

            if (Comp.SameCurrency(master._Currency))
            {
                RoundTo100 = Comp.RoundTo100;
            }
            else
            {
                RoundTo100 = !CurrencyUtil.HasDecimals(master._Currency);
            }
            if (RoundTo100)
            {
                Debit.HasDecimals = Credit.HasDecimals = Amount.HasDecimals = Total.HasDecimals = false;
            }

            if (!Comp._UseVatOperation)
            {
                VatOperation.Visible = false;
            }

            dgBankStatementLine.api = api;
            bankTransApi            = new BankStatementAPI(api);
            SetRibbonControl(localMenu, dgBankStatementLine);
            dgBankStatementLine.UpdateMaster(master);
            dgBankStatementLine.BusyIndicator = busyIndicator;
            localMenu.OnItemClicked          += localMenu_OnItemClicked;
        }
Exemplo n.º 3
0
        public BankStLines(UnicontaBaseEntity sourceData)
            : base(sourceData)
        {
            InitializeComponent();
            this.DataContext = this;

            master = sourceData as BankStatement;

            bool RoundTo100;
            var  Comp = api.CompanyEntity;

            if (Comp.SameCurrency(master._Currency))
            {
                RoundTo100 = Comp.RoundTo100;
            }
            else
            {
                RoundTo100 = !CurrencyUtil.HasDecimals(master._Currency);
            }
            if (RoundTo100)
            {
                Debit.HasDecimals = Credit.HasDecimals = Amount.HasDecimals = Total.HasDecimals = false;
            }

            if (!Comp._UseVatOperation)
            {
                VatOperation.Visible = false;
            }

            dgBankStatementLine.api = api;
            bankTransApi            = new BankStatementAPI(api);
            SetRibbonControl(localMenu, dgBankStatementLine);
            dgBankStatementLine.UpdateMaster(master);
            dgBankStatementLine.BusyIndicator = busyIndicator;
            localMenu.OnItemClicked          += localMenu_OnItemClicked;
        }