예제 #1
0
 protected IGeneralOperationsComponent clone(bool doStorno, IGeneralOperationsBooking parentBooking)
 {
     ICashDividendComponent clone = new CashDividendComponent(parentBooking, this.BookingComponentType);
     foreach (IJournalEntryLine line in this.Component.JournalLines)
     {
         IJournalEntryLine cloneLine = line.Clone();
         if (doStorno)
         {
             cloneLine.Balance = cloneLine.Balance.Negate();
             line.StornoedLine = cloneLine;
         }
         clone.Component.JournalLines.AddJournalEntryLine(cloneLine);
     }
     return clone;
 }
예제 #2
0
        protected void createComponents(IGLLookupRecords lookups)
        {
            Money div = null;
            if (UnitsInPossession != null && UnitsInPossession.Underlying.IsCorporateAction)
                div = UnitsInPossession.CalculateAmount(this.DividendDetails.StockDivUnitPrice);
            else
                div = UnitsInPossession.CalculateAmount(this.DividendDetails.UnitPrice);

            if (div != null && div.IsNotZero)
            {
                Money tax = div * (TaxPercentage * -1);
                ICashDividendComponent newComponent = new CashDividendComponent(this, BookingComponentTypes.Dividend, this.CreationDate);
                newComponent.AddLinesToComponent(div, BookingComponentTypes.Dividend, true, false, false, lookups, Account);
                newComponent.Component.SetDescription(this.DividendDetails.DisplayString);
                this.Components.Add(newComponent);

                if (tax != null && tax.IsNotZero)
                {
                    ICashDividendComponent taxComponent = new CashDividendComponent(this, BookingComponentTypes.DividendTax, this.CreationDate);
                    taxComponent.AddLinesToComponent(tax, BookingComponentTypes.DividendTax, true, false, false, lookups, Account);
                    taxComponent.Component.SetDescription("tax " + this.DividendDetails.DisplayString);
                    this.Components.Add(taxComponent);
                }
            }
        }