예제 #1
0
        /// <summary>
        /// Deal with fees
        /// </summary>
        private void XBRL_fees_DSC()
        {
            Schedule_Of_Fees_DSC sf = DSC_master.GetDSC_from_CDS(this.Country.Value, this.Depositary.Value, this.RecordDate_ADR.Value, this.SecurityTypeID.Value);

            if (sf != null)
            {
                if (!sf.LongFormFees.IsNull_flag)
                {
                    this.LongFormFee.Value = sf.LongFormFees.Value;
                }
                if (!sf.ShortFormFees.IsNull_flag)
                {
                    this.ShortFormFee.Value   = sf.ShortFormFees.Value;
                    this.QuickRefundFee.Value = sf.ShortFormFees.Value; //May need more thoughts
                }
                this.AtSourceFee.Value = 0;                             //Just give it a value for now

                if (!sf.MinLongFormFee.IsNull_flag)
                {
                    this.MinLongFormFee.Value = sf.MinLongFormFee.Value;
                }
                if (!sf.MinQuickRefundFee.IsNull_flag)
                {
                    this.MinQuickRefundFee.Value = sf.MinQuickRefundFee.Value;
                }
                if (!sf.MinAtSourceFee.IsNull_flag)
                {
                    this.MinAtSource_Fee.Value = sf.MinAtSourceFee.Value;
                }
                if (!sf.MinShortFormFee.IsNull_flag)
                {
                    this.MinShortFormFee.Value = sf.MinShortFormFee.Value;
                }

                if (!sf.FavAtSourceFee.IsNull_flag)
                {
                    this.FavAtSourceFee.Value = sf.FavAtSourceFee.Value;
                }
                if (!sf.ExemptAtSourceFee.IsNull_flag)
                {
                    this.ExemptAtSourceFee.Value = sf.ExemptAtSourceFee.Value;
                }
                if (!sf.FavTransparentEntityFee.IsNull_flag)
                {
                    this.FavTransparentEntityFee.Value = sf.FavTransparentEntityFee.Value;
                }
            }
        }
예제 #2
0
        private static void ApproveXBRL3_AddFees(Dividend dvd)
        {
            if (dvd == null)
            {
                return;
            }

            string     depo_str = dvd.Sponsored.Value ? dvd.Depositary.Value : dvd.FirstFiler.Value;
            Depositary depo     = DepositaryMaster.GetDepositary_by_name(depo_str);

            if (depo == null)
            {
                return;
            }

            Schedule_Of_Fees_DSC sfd = DSC_master.GetDSC_from_CDS(dvd.Country.Value, depo.DepositaryName.Value, dvd.RecordDate_ADR.Value, dvd.SecurityTypeID.Value);

            if (sfd == null)
            {
                return;
            }
            Dictionary <decimal, Schedule_Of_Fees_Per_Rate> Japan_atSourceFee_dic = DSC_master.Get_SFPR_dic(dvd.Country.Value, depo.DepositaryName.Value, dvd.RecordDate_ADR.Value);

            Bulk_DBcmd bk_cmd = new Bulk_DBcmd();
            List <DTC_Position_Headers> header_list = DTCpositionHeader_master.Get_headerList_modNum(dvd.DTCPosition_ModelNumber.Value);

            HashSet <decimal> unique_WHrate_hs = new HashSet <decimal>();

            foreach (DTC_Position_Headers dph in header_list)
            {
                unique_WHrate_hs.Add(dph.WHRate.Value);
            }

            foreach (decimal WHrate in unique_WHrate_hs)
            {
                Dividend_Schedule_Of_Fees_DSC dsfd = new Dividend_Schedule_Of_Fees_DSC();
                dsfd.DividendIndex.Value = dvd.DividendIndex;
                dsfd.WHRate.Value        = WHrate / 100;

                dsfd.LongFormFees.Value   = sfd.LongFormFees.Value;
                dsfd.MinLongFormFee.Value = sfd.MinLongFormFee.Value;

                dsfd.Fee_Consularization.Value = dvd.ConsularizationFee.Value;
                dsfd.Fee_QuickRefund.Value     = sfd.ShortFormFees.Value;

                /*  //useless for now
                 *  dsfd.Fee_AtSource.Value = dvd.AtSourceFee.Value;
                 *  dsfd.Fee_Max.Value = dvd.MAX_Fees.Value;
                 *  dsfd.ExemptAtSourceFee.Value = sfd.ExemptAtSourceFee.Value;//combined into FavAtSourceFee
                 *  dsfd.ShortFormFees.Value = sfd.ShortFormFees.Value;
                 *  dsfd.MinShortFormFee.Value = sfd.MinShortFormFee.Value;
                 */

                dsfd.MinAtSourceFee.Value          = sfd.MinAtSourceFee.Value;
                dsfd.MinQuickRefundFee.Value       = sfd.MinQuickRefundFee.Value;
                dsfd.FavTransparentEntityFee.Value = sfd.FavTransparentEntityFee.Value;

                if (Japan_atSourceFee_dic.ContainsKey(WHrate))
                {
                    Schedule_Of_Fees_Per_Rate sfpr = Japan_atSourceFee_dic[WHrate];
                    dsfd.FavAtSourceFee.Value = sfpr.RateWithADSC.Value;

                    dsfd.AdditionalDSCFee.Value  = sfpr.ADSC.Value;
                    dsfd.AdditionalDSCFee1.Value = sfpr.ADSC.Value;
                }
                else
                {
                    if (WHrate == 0)
                    {
                        dsfd.FavAtSourceFee.Value = sfd.ExemptAtSourceFee.Value;
                    }
                    else
                    {
                        dsfd.FavAtSourceFee.Value = sfd.FavAtSourceFee.Value;
                    }

                    dsfd.AdditionalDSCFee.Value  = sfd.AdditionalDSCFee.Value;
                    dsfd.AdditionalDSCFee1.Value = sfd.AdditionalDSCFee.Value;
                }

                dsfd.Source_FeeID.Value     = sfd.FeesID;
                dsfd.LastModifiedBy.Value   = "StevenXBRL-" + Utility.CurrentUser;
                dsfd.ModifiedDateTime.Value = DateTime.Now;

                bk_cmd.Add_DBcmd(dsfd.Get_DBinsert());
            }

            int count = bk_cmd.SaveToDB(Utility.Get_DRWIN_hDB());
        }