void RecalculateAmount() { var lst = dgProjInvProjectLineGrid.ItemsSource as IEnumerable <ProjectInvoiceProjectLineLocal>; if (lst == null) { return; } double adjustment = invoiceProposal._OrderTotal - invoiceProposal._ProjectTotal; double Amountsum = lst.Sum(x => x._SalesAmount); double difference = adjustment - Amountsum; RibbonBase rb = (RibbonBase)localMenu.DataContext; var groups = UtilDisplay.GetMenuCommandsByStatus(rb, true); var adjust = Uniconta.ClientTools.Localization.lookup("Adjustment"); var strTotal = Uniconta.ClientTools.Localization.lookup("Total"); var diff = Uniconta.ClientTools.Localization.lookup("Diff"); foreach (var grp in groups) { if (grp.Caption == adjust) { grp.StatusValue = adjustment.ToString("N2"); } if (grp.Caption == strTotal) { grp.StatusValue = Amountsum.ToString("N2"); } if (grp.Caption == diff) { grp.StatusValue = difference.ToString("N2"); } } }
void SetStatusText(double primo, double sum) { string format = RoundTo100 ? "N0" : "N2"; RibbonBase rb = (RibbonBase)localMenu.DataContext; var groups = UtilDisplay.GetMenuCommandsByStatus(rb, true); var thisyear = Uniconta.ClientTools.Localization.lookup("ThisYear"); var Change = Uniconta.ClientTools.Localization.lookup("Change"); var NewBalance = Uniconta.ClientTools.Localization.lookup("NewBalance"); foreach (var grp in groups) { if (grp.Caption == thisyear) { grp.StatusValue = primo.ToString(format); } else if (grp.Caption == Change) { grp.StatusValue = sum.ToString(format); } else if (grp.Caption == NewBalance) { LineTotal = primo + sum; grp.StatusValue = LineTotal.ToString(format); } else { grp.StatusValue = string.Empty; } } }
void SetStatusText(double journalAmount, double sumOffsetAmt) { double diff = 0d; string format = "N2"; RibbonBase rb = (RibbonBase)localMenu.DataContext; var groups = UtilDisplay.GetMenuCommandsByStatus(rb, true); var jrnlAmttxt = Uniconta.ClientTools.Localization.lookup("Amount"); var offSetAmtSum = Uniconta.ClientTools.Localization.lookup("Sum"); var diftxt = Uniconta.ClientTools.Localization.lookup("Dif"); foreach (var grp in groups) { if (grp.Caption == jrnlAmttxt) { grp.StatusValue = journalAmount.ToString(format); } else if (grp.Caption == offSetAmtSum) { grp.StatusValue = sumOffsetAmt.ToString(format); } else if (grp.Caption == diftxt) { diff = journalAmount + sumOffsetAmt; grp.StatusValue = diff.ToString(format); } else { grp.StatusValue = string.Empty; } } }
void SetStatusText() { RibbonBase rb = (RibbonBase)localMenu.DataContext; var groups = UtilDisplay.GetMenuCommandsByStatus(rb, true); double payment = 0d, invoice = 0d; double? paymentCur = 0d, invoiceCur = 0d; if (transOpenMaster != null) { payment = transOpenMaster.AmountOpen; paymentCur = transOpenMaster.AmountOpenCur.HasValue ? transOpenMaster.AmountOpenCur.Value : 0d; if ((settles != null && settles.Count != 0)) { invoice = settles.Sum(s => s.AmountOpen); invoiceCur = settles.Sum(s => s.AmountOpenCur); } } foreach (var grp in groups) { if (transOpenMaster == null) { grp.StatusValue = string.Empty; } else { if (grp.Caption == Uniconta.ClientTools.Localization.lookup("Payment")) { grp.StatusValue = payment.ToString("N2"); } else if (grp.Caption == Uniconta.ClientTools.Localization.lookup("Invoice")) { grp.StatusValue = invoice != 0d ? invoice.ToString("N2") : string.Empty; } else if (grp.Caption == Uniconta.ClientTools.Localization.lookup("Sum")) { grp.StatusValue = invoice != 0d ? (payment + invoice).ToString("N2") : string.Empty; } if (grp.Caption == Uniconta.ClientTools.Localization.lookup("PaymentCurrency")) { grp.StatusValue = paymentCur.HasValue ? paymentCur.Value.ToString("N2") : null; } else if (grp.Caption == Uniconta.ClientTools.Localization.lookup("InvoiceCurrency")) { grp.StatusValue = invoiceCur != 0d ? invoiceCur.Value.ToString("N2") : string.Empty; } else if (grp.Caption == Uniconta.ClientTools.Localization.lookup("TotalCur")) { grp.StatusValue = invoiceCur != 0d ? (paymentCur + invoiceCur).Value.ToString("N2") : string.Empty; } } } }
void RecalculateAmount() { var ret = DebtorOfferLines.RecalculateLineSum((IList)dgCreditorOrderLineGrid.ItemsSource, this.exchangeRate); double Amountsum = ret.Item1; double Costsum = ret.Item2; double AmountsumCompCur = ret.Item3; RibbonBase rb = (RibbonBase)localMenu.DataContext; var groups = UtilDisplay.GetMenuCommandsByStatus(rb, true); foreach (var grp in groups) { grp.StatusValue = Amountsum.ToString("N2"); } }
void RecalculateAmount() { var ret = RecalculateLineSum(Order, (IEnumerable <DCOrderLineClient>)dgDebtorOfferLineGrid.ItemsSource, this.exchangeRate); double Amountsum = ret.Item1; double Costsum = ret.Item2; double sales = ret.Item3; Order._OrderTotal = sales; if (Order._EndDiscountPct != 0) { sales *= (100d - Order._EndDiscountPct) / 100d; } RibbonBase rb = (RibbonBase)localMenu.DataContext; var groups = UtilDisplay.GetMenuCommandsByStatus(rb, true); foreach (var grp in groups) { if (grp.Caption == Uniconta.ClientTools.Localization.lookup("Amount")) { grp.StatusValue = Amountsum.ToString("N2"); } else if (grp.Caption == Uniconta.ClientTools.Localization.lookup("CostValue")) { grp.StatusValue = Costsum.ToString("N2"); } else if (grp.Caption == Uniconta.ClientTools.Localization.lookup("DB")) { var margin = (sales - Costsum); var ratio = sales != 0d ? Math.Round(margin * 100d / sales) : 0d; string str; if (ratio != 0 && ratio != 100 && ratio > -100) { str = string.Format("{0}% {1:n2}", ratio, margin); } else { str = margin.ToString("N2"); } grp.StatusValue = str; } else { grp.StatusValue = string.Empty; } } }
void SetStatusText() { RibbonBase rb = (RibbonBase)localMenu.DataContext; var groups = UtilDisplay.GetMenuCommandsByStatus(rb, true); foreach (var grp in groups) { if (grp.StatusValue == "a" || grp.Caption == Uniconta.ClientTools.Localization.lookup("FromDate")) { grp.StatusValue = fromDate.ToString("d"); continue; } else if (grp.StatusValue == "b" || grp.Caption == Uniconta.ClientTools.Localization.lookup("ToDate")) { grp.StatusValue = toDate.ToString("d"); } } }
void RecalculateAmount() { var lst = dgDebtorOrderProjectLineGrid.ItemsSource as List <DebtorOrderProjectLineLocal>; if (lst == null) { return; } double Amountsum = lst.Sum(x => x._SalesAmount); RibbonBase rb = (RibbonBase)localMenu.DataContext; var groups = UtilDisplay.GetMenuCommandsByStatus(rb, true); var strTotal = Uniconta.ClientTools.Localization.lookup("Total"); foreach (var grp in groups) { if (grp.Caption == strTotal) { grp.StatusValue = Amountsum.ToString("N2"); } } }
void SetStatusText(double amount, double amountCur) { string format = RoundTo100 ? "N0" : "N2"; RibbonBase rb = (RibbonBase)localMenu.DataContext; var groups = UtilDisplay.GetMenuCommandsByStatus(rb, true); var amountTxt = Uniconta.ClientTools.Localization.lookup("Amount"); var amountCurTxt = Uniconta.ClientTools.Localization.lookup("AmountCur"); foreach (var grp in groups) { if (grp.Caption == amountTxt) { grp.StatusValue = amount.ToString(format); } else if (grp.Caption == amountCurTxt) { grp.StatusValue = amountCur.ToString(format); } } }
internal void RecalculateSum() { var gridItems = (IEnumerable <GLClosingSheetLineLocal>)dgClosingSheetLineAll.ItemsSource; if (gridItems == null) { return; } long deb = 0, cre = 0; foreach (var lin in gridItems) { if (lin._Account != null) { if (lin._AmountCent > 0) { deb += lin._AmountCent; } else { cre -= lin._AmountCent; } var vatValue = ClosingSheetLines.CalcVat(lin._Vat, lin._Amount, postingDate, RoundTo100, VatCache); lin.SetVatAmount(vatValue); } if (lin._OffsetAccount != null) { if (lin._Amount > 0) { cre += lin._AmountCent; } else { deb -= lin._AmountCent; } var vatValue = ClosingSheetLines.CalcVat(lin._OffsetVat, lin._Amount, postingDate, RoundTo100, VatCache); lin.SetVatAmountOffset(-vatValue); } lin.SetTotal(deb - cre); } string format = RoundTo100 ? "N0" : "N2"; RibbonBase rb = (RibbonBase)localMenu.DataContext; var groups = UtilDisplay.GetMenuCommandsByStatus(rb, true); var debtxt = Uniconta.ClientTools.Localization.lookup("Debit"); var cretxt = Uniconta.ClientTools.Localization.lookup("Credit"); var diftxt = Uniconta.ClientTools.Localization.lookup("Dif"); foreach (var grp in groups) { if (grp.Caption == debtxt) { grp.StatusValue = (deb / 100d).ToString(format); } else if (grp.Caption == cretxt) { grp.StatusValue = (cre / 100d).ToString(format); } else if (grp.Caption == diftxt) { grp.StatusValue = ((deb - cre) / 100d).ToString(format); } else { grp.StatusValue = string.Empty; } } }
int[] GetMonthNo(int qtNo) { int[] months = null; if (qtNo == 1) { months = new int[] { 1, 3 } } ; else if (qtNo == 2) { months = new int[] { 4, 6 } } ; else if (qtNo == 3) { months = new int[] { 7, 9 } } ; else if (qtNo == 4) { months = new int[] { 10, 12 } } ; return(months); } string period; void SetStatusText(double bgtHrs) { RibbonBase rb = (RibbonBase)localMenu.DataContext; var groups = UtilDisplay.GetMenuCommandsByStatus(rb, true); var fmDtText = Uniconta.ClientTools.Localization.lookup("FromDate"); var toDteText = Uniconta.ClientTools.Localization.lookup("ToDate"); var normHrtxt = Uniconta.ClientTools.Localization.lookup("NormHours"); var bgtHrtxt = Uniconta.ClientTools.Localization.lookup("Budget"); var diftxt = Uniconta.ClientTools.Localization.lookup("Dif"); foreach (var grp in groups) { if (grp.Caption == fmDtText) { grp.StatusValue = fromDate.Date.ToString("dd/MM/yyyy"); } else if (grp.Caption == toDteText) { grp.StatusValue = toDate.Date.ToString("dd/MM/yyyy"); } else if (grp.Caption == normHrtxt) { grp.StatusValue = normQty.ToString("N2"); } else if (grp.Caption == bgtHrtxt) { grp.StatusValue = bgtHrs.ToString("N2"); } else if (grp.Caption == diftxt) { var tot = normQty - bgtHrs; grp.StatusValue = tot.ToString("N2"); } else { grp.StatusValue = string.Empty; } } } double sumMargin, sumSales, sumMarginRatio;