示例#1
0
        protected override void BeforeChange(DataColumn dc, DataRow ddr)
        {
            string ObjectName = this.myIRPDT.TableName;

            atriumDB.IRPRow dr = (atriumDB.IRPRow)ddr;
            switch (dc.ColumnName)
            {
            case "FeesClaimed":
            case "FeesClaimedTax":
            case "DisbursementTaxExemptClaimed":
            case "DisbursementClaimed":
            case "DisbursementClaimedTax":
                if (!dr.SRPRow.IsSRPSubmittedDateNull())
                {
                    throw new AtriumException(Resources.IRPNoChangeAfterSRP);
                }
                break;

            //case "FeesTaxed":
            //    if (dr.FeesTaxed > dr.FeesClaimed)
            //        throw new AtriumException(Resources.IRPTaxedLessThanClaimed);
            //    break;
            //case "DisbursementTaxExemptTaxed":
            //    if(dr.DisbursementTaxExemptTaxed>dr.DisbursementTaxExemptClaimed)
            //        throw new AtriumException(Resources.IRPTaxedLessThanClaimed);
            //    break;
            //case "DisbursementTaxed":
            //    if (dr.DisbursementTaxed > dr.DisbursementClaimed)
            //        throw new AtriumException(Resources.IRPTaxedLessThanClaimed);
            //    break;
            default:
                break;
            }
        }
示例#2
0
        public void IncludeOnSRP(atriumDB.IRPRow irp, bool isPosted, bool submitted)
        {
            isSubmitted  = submitted;
            currentirpId = irp.IRPId;
            isPostedBR   = isPosted;
            foreach (atriumDB.DisbursementRow disbr in myA.DB.Disbursement)
            {
                disbr.IncludeOnSRP = false;

                if (!isSubmitted)
                {
                    if (!isPosted && !disbr.Posted)
                    {
                        disbr.IncludeOnSRP = true;
                    }
                    else if (isPosted && disbr.Posted && !disbr.Final && disbr.OfficeId == irp.OfficeID && disbr.DisbDate > irp.SRPDate.AddMonths(-6) && disbr.DisbDate <= irp.SRPDate && disbr.entryDate > irp.SRPDate.AddMonths(-6) && disbr.entryDate <= irp.SRPDate.AddDays(14))
                    {
                        disbr.IncludeOnSRP = true;
                    }
                }
                else
                {
                    if (!disbr.IsIRPIdNull() && disbr.IRPId == irp.IRPId)
                    {
                        disbr.IncludeOnSRP = true;
                    }
                }
                disbr.AcceptChanges();
            }
        }
示例#3
0
 public void RollbackTaxation(atriumDB.IRPRow irpRow)
 {
     irpRow.SetOfficerIDNull();
     irpRow.SetDateTaxedNull();
     irpRow.SetFeesTaxedNull();
     irpRow.SetFeesTaxedTaxNull();
     irpRow.SetDisbursementTaxedNull();
     irpRow.SetDisbursementTaxedTaxNull();
     irpRow.SetDisbursementTaxExemptTaxedNull();
 }
示例#4
0
 private void NewIRP()
 {
     //pass srp as parent row?!
     atriumDB.IRPRow irpr = (atriumDB.IRPRow)FM.GetIRP().Add(srpRow);
     iRPBindingSource.Position = iRPBindingSource.Find("IRPId", irpr.IRPId);
     btnValidateSIN.Visible    = true;
     btnValidateSIN.Enabled    = true;
     ApplySecurityIRP(irpr);
     sINMaskedEditBox.Focus();
 }
示例#5
0
 protected override void AfterUpdate(DataRow dr)
 {
     atriumDB.IRPRow r = (atriumDB.IRPRow)dr;
     //try
     //{
     //    EFileBE.XmlAddToc(myA.AtMng.GetFile(r.FileID).CurrentFile, "irp", "Taxation", "Taxation", 190);
     //}
     //catch (Exception x)
     //{
     //}
 }
示例#6
0
 public bool isSRPTaxationCompleted(atriumDB.IRPRow irpRow)
 {
     atriumDB.SRPRow srprow = myA.GetSRP().Load(irpRow.SRPID);
     if (srprow.IsTaxationCompletedNull())
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
示例#7
0
        public override bool CanEdit(DataRow dr)
        {
            if (dr == null)
            {
                return(true);
            }

            if (dr.RowState == DataRowState.Added)
            {
                return(true);
            }

            bool allowEdit = false;

            CLAS.TaxingRow taxingRow = (CLAS.TaxingRow)dr;

            if (myA.FM.AllowedForOwnerOrSysAdmin() && myA.AtMng.SecurityManager.CanUpdate(taxingRow.FileID, atSecurity.SecurityManager.Features.Taxing) == atSecurity.SecurityManager.LevelPermissions.All)
            {
                //you are CLAS and you have perms on Taxing
                if (taxingRow.Closed && !taxingRow.IsIRPIdNull())
                {
                    //check to see if taxation is completed on SRP
                    atriumDB.IRPRow irprow = myA.FM.DB.IRP.FindByIRPId(taxingRow.IRPId);
                    if (irprow == null) // hmmm. how is it that irprow is null? assume it's a no go
                    {
                        return(false);
                    }
                    if (irprow.SRPRow == null) // oops, gotta load it to check it
                    {
                        myA.FM.GetSRP().Load(irprow.SRPID);
                    }


                    if (myA.FM.GetSRP().isSRPTaxationCompleted(irprow))
                    {
                        allowEdit = false;  //taxation completed - edits never allowed;
                    }
                    //else if (!irprow.IsDateTaxedNull() && !irprow.IsOfficerIDNull() && irprow["DateTaxed", DataRowVersion.Current].Equals(irprow["DateTaxed", DataRowVersion.Original]) && irprow["OfficerID", DataRowVersion.Current].Equals(irprow["OfficerID", DataRowVersion.Original]))
                    //    allowEdit = false; // irp taxed - edits not allowed;
                    else
                    {
                        allowEdit = true; //taxation not completed yet; allow edits by CLAS w/ taxing perm
                    }
                }
                else if (!taxingRow.Closed)
                {
                    allowEdit = true;
                }
            }

            return(allowEdit);
        }
示例#8
0
        private void iRPBindingSource_CurrentChanged(object sender, EventArgs e)
        {
            atriumDB.IRPRow dr = CurrentRow();

            if (dr == null)
            {
                return;
            }

            CLAS.TaxingRow[] taxRecs = (CLAS.TaxingRow[])FM.GetCLASMng().DB.Taxing.Select("IRPId=" + CurrentRow().IRPId, "TaxingDate");
            TaxRecDropDown(taxRecs);
            ApplySecurity(dr);
        }
示例#9
0
        protected override void AfterAdd(DataRow row)
        {
            atriumDB.IRPRow dr         = (atriumDB.IRPRow)row;
            string          ObjectName = this.myIRPDT.TableName;

            dr.IRPId    = this.myA.AtMng.PKIDGet(ObjectName, 10);
            dr.SRPDate  = dr.SRPRow.SRPDate;
            dr.OfficeID = dr.SRPRow.OfficeID;

            //default to office file; for non online agents, it was the mechanism to make sure a general file made its way in there?
            //jll: with the file selector, can we remove this default? or leave it out of habit? ask clas.
            //dr.FileID=-dr.OfficeID; // commented out; validate sin function will handle setting of fileid
        }
示例#10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dr">IRP Row</param>
        /// <param name="billingFileId">File ID of Billing File</param>
        /// <returns></returns>
        public bool CanDelete(DataRow dr, int billingFileId)
        {
            atriumDB.IRPRow irpr = (atriumDB.IRPRow)dr;

            FileManager fm = myA.AtMng.GetFile(billingFileId);

            if (fm.AllowedForOwnerOrSysAdmin() && !fm.LeadOfficeMng.CurrentOffice.UsesBilling && irpr.SRPRow.IsTaxationCompletedNull())
            {
                return(true);
            }

            return(false);
        }
示例#11
0
        public void IncludeOnSRP(atriumDB.IRPRow irp, bool isPosted, bool submitted)
        {
            //JLL: have to load only applicable records; right now we're loading everything.
            //build filter on binding source

            /*where (vActivity.officeid=@officeid
             * and vActivity.FileId=@FileId
             * and vActivity.final=0
             * and activitydate between dateadd(m,-6,@srpdate ) and @srpdate
             * and activityentrydate between dateadd(m,-6,@srpdate )and dateadd(y,14,@srpdate )
             * )
             * or(
             * vActivity.fileid=@fileid
             * and exists(select * from disbursement as d where
             * vActivity.activityid=d.activityid
             * and d.officeid=@officeid
             * and   d.final=0
             * and d.DisbDate between dateadd(m,-6,@srpdate ) and @srpdate
             * and d.entrydate between dateadd(m,-6,@srpdate )and dateadd(y,14,@srpdate )
             * ))
             */

            isSubmitted  = submitted;
            currentirpId = irp.IRPId;
            isPostedBR   = isPosted;
            foreach (atriumDB.ActivityTimeRow atr in myA.DB.ActivityTime)
            {
                atr.IncludeOnSRP = false;

                if (!isSubmitted)
                {
                    if (!isPosted && !atr.Posted)
                    {
                        atr.IncludeOnSRP = true;
                    }
                    else if (isPosted && atr.Posted && !atr.Final && atr.OfficeId == irp.OfficeID && atr.StartTime > irp.SRPDate.AddMonths(-6) && atr.StartTime <= irp.SRPDate && atr.entryDate > irp.SRPDate.AddMonths(-6) && atr.entryDate <= irp.SRPDate.AddDays(14))
                    {
                        atr.IncludeOnSRP = true;
                    }
                }
                else
                {
                    if (!atr.IsIRPIdNull() && atr.IRPId == irp.IRPId)
                    {
                        atr.IncludeOnSRP = true;
                    }
                }

                atr.AcceptChanges();
            }
        }
示例#12
0
        public override bool CanEdit(DataRow dr)
        {
            atriumDB.IRPRow ir = (atriumDB.IRPRow)dr;

            //JLL: if taxation completed then read-only
            // This line fails when trying to load the ucTaxation control because currentRow's SRPRow is null - commented out temporarily
            //if(!ir.SRPRow.IsTaxationCompletedNull())
            //    return false;

            //if officeloggedon != irp officeid and agent uses billing
            //if(ir.SRPRow.OfficeRow.UsesBilling & ir.OfficeID!=myA.AtMng.OfficeLoggedOn.OfficeId)

            return(myA.AtMng.SecurityManager.CanUpdate(ir.FileID, atSecurity.SecurityManager.Features.IRP) > atSecurity.SecurityManager.LevelPermissions.No | AllowEdit);
        }
示例#13
0
        private void iRPBindingSource_CurrentChanged(object sender, EventArgs e)
        {
            try
            {
                atriumDB.IRPRow dr = CurrentRowIRP();

                if (dr == null || dr.IsNull("IRPId"))
                {
                    NoData();
                    return;
                }

                TaxRecDropDown(dr.IRPId);
                ApplySecurityIRP(dr);
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
示例#14
0
        private void ApplySecurityIRP(DataRow irpRow) //IRP
        {
            atriumDB.IRPRow irpr = (atriumDB.IRPRow)irpRow;

            if (irpr == null)
            {
                return;
            }

            uiTab1.Enabled = true;
            uiTab2.Enabled = true;
            uiTab3.Enabled = true;

            bool OnlineIRP = myOfficeMan.CurrentOffice.UsesBilling;

            UIHelper.EnableCommandBarCommand(tsDeleteIRP, FM.GetIRP().CanDelete(irpr, FM.CurrentFile.FileId));
            UIHelper.EnableCommandBarCommand(tsNewIRP, !OnlineIRP);

            if (myOfficeMan.CurrentOffice.UsesBilling) //SRP detail all readonly; nothing can be done on this page; use billing review
            {
                dateTaxedCalendarCombo.ReadOnly  = true;
                dateTaxedCalendarCombo.BackColor = SystemColors.Control;
                mccTaxingOfficer.ReadOnly        = true;
                tsSaveIRP.Enabled = Janus.Windows.UI.InheritableBoolean.False;
            }
            else //foreign IRP || Non Online IRP
            {
                if (irpRow.RowState == DataRowState.Added)
                {
                    if (irpRow.IsNull("FileId"))
                    {
                        btnValidateSIN.Visible = true;
                    }
                    sINMaskedEditBox.ReadOnly  = false;
                    sINMaskedEditBox.BackColor = SystemColors.Window;
                }
                else
                {
                    btnValidateSIN.Visible     = false;
                    sINMaskedEditBox.ReadOnly  = true;
                    sINMaskedEditBox.BackColor = SystemColors.Control;
                }

                if (!irpr.SRPRow.IsTaxationCompletedNull())
                {
                    tsNewIRP.Enabled = Janus.Windows.UI.InheritableBoolean.False;
                    dateTaxedCalendarCombo.ReadOnly  = true;
                    dateTaxedCalendarCombo.BackColor = SystemColors.Control;
                    mccTaxingOfficer.ReadOnly        = true;
                    tsSaveIRP.Enabled = Janus.Windows.UI.InheritableBoolean.False;
                    feesClaimedNumericEditBox.ReadOnly                   = true;
                    feesClaimedNumericEditBox.BackColor                  = SystemColors.Control;
                    disbursementClaimedNumericEditBox.ReadOnly           = true;
                    disbursementClaimedNumericEditBox.BackColor          = SystemColors.Control;
                    disbursementTaxExemptClaimedNumericEditBox.ReadOnly  = true;
                    disbursementTaxExemptClaimedNumericEditBox.BackColor = SystemColors.Control;
                    iRPGridEX.Height  = 220;
                    gbMessage.Visible = false;
                }
                else
                {
                    iRPGridEX.Height  = 220;
                    gbMessage.Visible = false;

                    if (!irpr.SRPRow.IsTaxationBeganNull())
                    {
                        if (irpr.IsDateTaxedNull() && irpr.IsOfficerIDNull())
                        {
                            iRPGridEX.Height  = 167;
                            label10.Text      = Properties.Resources.UITaxationMode;
                            gbMessage.Visible = true;

                            //taxation mode
                            //let's default some values

                            if (!irpr.IsFeesClaimedNull())
                            {
                                irpr.FeesTaxed = irpr.FeesClaimed;
                            }

                            if (!irpr.IsFeesClaimedTaxNull())
                            {
                                irpr.FeesTaxedTax = irpr.FeesClaimedTax;
                            }

                            if (!irpr.IsDisbursementClaimedNull())
                            {
                                irpr.DisbursementTaxed = irpr.DisbursementClaimed;
                            }

                            if (!irpr.IsDisbursementClaimedTaxNull())
                            {
                                irpr.DisbursementTaxedTax = irpr.DisbursementClaimedTax;
                            }

                            if (!irpr.IsDisbursementTaxExemptClaimedNull())
                            {
                                irpr.DisbursementTaxExemptTaxed = irpr.DisbursementTaxExemptClaimed;
                            }

                            irpr.OfficerID = FM.AtMng.WorkingAsOfficer.OfficerId;
                            irpr.DateTaxed = DateTime.Today;
                        }
                    }

                    tsNewIRP.Enabled = Janus.Windows.UI.InheritableBoolean.True;
                    dateTaxedCalendarCombo.ReadOnly  = false;
                    dateTaxedCalendarCombo.BackColor = SystemColors.Window;
                    mccTaxingOfficer.ReadOnly        = false;
                    tsSaveIRP.Enabled = Janus.Windows.UI.InheritableBoolean.True;
                    feesClaimedNumericEditBox.ReadOnly                   = false;
                    feesClaimedNumericEditBox.BackColor                  = SystemColors.Window;
                    disbursementClaimedNumericEditBox.ReadOnly           = false;
                    disbursementClaimedNumericEditBox.BackColor          = SystemColors.Window;
                    disbursementTaxExemptClaimedNumericEditBox.ReadOnly  = false;
                    disbursementTaxExemptClaimedNumericEditBox.BackColor = SystemColors.Window;

                    feesTaxedNumericEditBox.ReadOnly                   = false;
                    feesTaxedNumericEditBox.BackColor                  = SystemColors.Window;
                    disbursementTaxedNumericEditBox.ReadOnly           = false;
                    disbursementTaxedNumericEditBox.BackColor          = SystemColors.Window;
                    disbursementTaxedTaxNumericEditBox.ReadOnly        = false;
                    disbursementTaxedTaxNumericEditBox.BackColor       = SystemColors.Window;
                    disbursementTaxExemptTaxedNumericEditBox.ReadOnly  = false;
                    disbursementTaxExemptTaxedNumericEditBox.BackColor = SystemColors.Window;
                }
            }
        }
示例#15
0
        public override void Delete()
        {
            try
            {
                //would like to have most of this moved to BE CanDelete, but the UI interaction with the confirm messages makes it impossible at the moment
                bool okToDelete = false;
                if (CurrentRow().Closed)
                {
                    //since it's closed, candelete will return true if canoverride=true
                    if (FM.GetCLASMng().GetTaxing().CanDelete(CurrentRow()))
                    {
                        //check to see if IRPId is null; if so, who cares about link back to irp, there is none; go ahead and chuck
                        if (CurrentRow().IsIRPIdNull())
                        {
                            okToDelete = true;
                        }
                        else
                        {
                            //check state of srp to see if taxation completed; if so, warn about impact
                            //loading irp and srp data to read it
                            atriumDB.IRPRow irpRow = FM.DB.IRP.FindByIRPId(CurrentRow().IRPId);
                            if (irpRow == null)
                            {
                                //a LoadByIRPID would be nice here ... but whatever, only called when deleting a taxrec by an overrider, very isolated
                                FM.GetIRP().Load();
                                irpRow = FM.DB.IRP.FindByIRPId(CurrentRow().IRPId);
                            }
                            atriumDB.SRPRow srpRow = FM.GetSRP().Load(irpRow.SRPID);

                            if (!srpRow.IsTaxationCompletedNull())
                            {
                                if (MessageBox.Show("This taxing recommendation is closed and linked to an IRP for which taxation has been completed on the SRP.  You cannot modify the IRP values as they are read-only.\n\nAre you sure you want to proceed with deleting this linked and closed taxing recommendation?", "Closed and Linked Taxing Recommendation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                                {
                                    okToDelete = true;
                                }
                            }
                            else // taxation not completed yet
                            {
                                if (MessageBox.Show("This taxing recommendation is closed and linked to an IRP for which taxation is not completed on the SRP.  You may still modify the IRP values to account for the deleting of this taxing recommendation if need be.\n\nAre you sure you want to proceed with deleting this linked and closed taxing recommendation?", "Closed and Linked Taxing Recommendation", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                                {
                                    okToDelete = true;
                                }
                            }

                            //if taxation not completed, explain that taxed amounts can still be manipulated until SRP taxation completed date populated
                        }
                    }
                }
                else
                {//JLL: 2016/09/28, added Else so taxrec gets delete when not closed
                    if (FM.GetCLASMng().GetTaxing().CanDelete(CurrentRow()))
                    {
                        okToDelete = true;
                    }
                }

                if (okToDelete)
                {
                    CurrentRow().Delete();
                    taxingBindingSource.EndEdit();
                    atLogic.BusinessProcess bp = FM.GetBP();
                    bp.AddForUpdate(FM.GetCLASMng().GetTaxing());
                    bp.AddForUpdate(FM.EFile);
                    bp.Update();

                    ApplyBR(true);

                    fFile f = (fFile)this.ParentForm;
                    f.fileToc.LoadTOC();
                }
            }
            catch (Exception x)
            {
                throw x;
            }
        }
示例#16
0
 public void closeTaxRec(CLAS.TaxingRow taxRow, atriumDB.IRPRow irpRow)
 {
     taxRow.Closed = true;
     taxRow.IRPId  = irpRow.IRPId;
 }
示例#17
0
 public override void ApplySecurity(DataRow dr)
 {
     atriumDB.IRPRow cbr = (atriumDB.IRPRow)dr;
     //UIHelper.EnableControls(iRPBindingSource, FM.GetIRP().CanEdit(cbr));
 }
示例#18
0
        protected override void AfterChange(DataColumn dc, DataRow ddr)
        {
            string ObjectName = this.myIRPDT.TableName;

            atriumDB.IRPRow    dr       = (atriumDB.IRPRow)ddr;
            officeDB.OfficeRow drOffice = this.myA.AtMng.GetOffice(dr.OfficeID).CurrentOffice;

            switch (dc.ColumnName)
            {
            case "FeesTaxed":
                if (dr.IsFeesTaxedNull())
                {
                    dr.SetFeesTaxedTaxNull();
                }
                else
                {
                    dr.FeesTaxedTax = decimal.Round(dr.FeesTaxed * (drOffice.IsTaxRateNull()? 0 : drOffice.TaxRate), 2, MidpointRounding.AwayFromZero);
                }
                dr.EndEdit();
                break;

            case "DisbursementTaxed":
                if (dr.IsDisbursementTaxedNull())
                {
                    dr.SetDisbursementTaxedTaxNull();
                }
                else
                {
                    officeDB.OfficeRow officeRow = myA.AtMng.GetOffice().GetOffice(dr.OfficeID);
                    if (!officeRow.IsOnLine)
                    {
                        dr.DisbursementTaxedTax = decimal.Round(dr.DisbursementTaxed * (drOffice.IsTaxRateNull() ? 0 : drOffice.TaxRate), 2, MidpointRounding.AwayFromZero);
                    }
                }
                dr.EndEdit();
                break;

            case "FeesClaimed":
                if (dr.IsFeesClaimedNull())
                {
                    dr.SetFeesClaimedTaxNull();
                }
                else
                {
                    dr.FeesClaimedTax = decimal.Round(dr.FeesClaimed * (drOffice.IsTaxRateNull() ? 0 : drOffice.TaxRate), 2, MidpointRounding.AwayFromZero);
                }
                dr.EndEdit();
                break;

            case "DisbursementClaimed":
                if (dr.IsDisbursementClaimedNull())
                {
                    dr.SetDisbursementClaimedTaxNull();
                }
                else
                {
                    officeDB.OfficeRow officeRow = myA.AtMng.GetOffice().GetOffice(dr.OfficeID);
                    if (!officeRow.IsOnLine)
                    {
                        dr.DisbursementClaimedTax = decimal.Round(dr.DisbursementClaimed * (drOffice.IsTaxRateNull() ? 0 : drOffice.TaxRate), 2, MidpointRounding.AwayFromZero);
                    }
                }
                dr.EndEdit();
                break;

            case "DateTaxed":
                if (dr.SRPRow.IsTaxationBeganNull())
                {
                    dr.SRPRow.TaxationBegan = DateTime.Today;
                    //dr.SRPRow.AcceptChanges();
                    dr.EndEdit();
                    dr.SRPRow.EndEdit();
                }
                break;

            case "OfficerID":
                if (!dr.IsOfficerIDNull() && dr.IsDateTaxedNull())
                {
                    dr.DateTaxed                  = DateTime.Today;
                    dr.FeesTaxed                  = dr.IsFeesClaimedNull()? 0 : dr.FeesClaimed;
                    dr.FeesTaxedTax               = dr.IsFeesClaimedTaxNull() ? 0 : dr.FeesClaimedTax;
                    dr.DisbursementTaxed          = dr.IsDisbursementClaimedNull() ? 0 : dr.DisbursementClaimed;
                    dr.DisbursementTaxedTax       = dr.IsDisbursementClaimedTaxNull()? 0 : dr.DisbursementClaimedTax;
                    dr.DisbursementTaxExemptTaxed = dr.IsDisbursementTaxExemptClaimedNull() ? 0 : dr.DisbursementTaxExemptClaimed;
                    dr.EndEdit();
                }
                break;

            case "SIN":
                try
                {
                    //FileManager fm = myA.AtMng.GetFileBySIN(dr.SIN);
                    //dr.FileID = fm.CurrentFile.FileId;
                    //fm.Dispose();
                    //dr.EndEdit();
                }
                catch (Exception x)
                {
                    System.Diagnostics.Trace.WriteLine(x.Message);
                    throw new AtriumException(atriumBE.Properties.Resources.SINNotFound);
                }
                break;

            default:
                break;
            }
        }