Local - Fees - Bill Payer Mapping
This will help a TI to create a mapping from the payer ref to the internal id of the payer (or vice versa as a variation on a theme)
An alternative approach to obtaining similar data is available via the reporting engine. NB: If a similar mapping is needed from pupil references to internal ids then the reporting engine may be the only option.
Additional DLLs referenced
- Fees7Entities.Dll
- Fees7Processes.Dll
A SIMS login is required before these calls can be made typically with a fees manager permission level.
Calling model
SIMSInterface.BillPayerMap bpm = new SIMSInterface.BillPayerMap();Dictionary<int, string> BillPayerMapping = bpm.getBillPayerMap();
Implementation
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SIMS.Entities;
namespace SIMSInterface
{
public class BillPayerMap
{
SIMS.Processes.FeesAgedDebtorsDetail fadd = new SIMS.Processes.FeesAgedDebtorsDetail();
SIMS.Processes.FeesBillPayerBrowse payerBrowseProcess = new SIMS.Processes.FeesBillPayerBrowse();
SIMS.Entities.FeesBillPayerBrowse feesBillPayerBrowse = new FeesBillPayerBrowse();
public Dictionary<int,string> getBillPayerMap()
{
Dictionary<int,string> result = new Dictionary<int, string>();
FeesBillPayerSummarys x = getPayersSummary();
foreach ( FeesBillPayerSummary f in x.Value)
{
result.Add(f.ID,f.PayerRef);
}
return result;
}
private void createAndAssignDummyAttributes()
{
FeesPupilStatus objFeesPupiltatus = new FeesPupilStatus(-1, "<Any>", "<Any>", true);
feesBillPayerBrowse.PupilStatusAttribute.Value = objFeesPupiltatus;
feesBillPayerBrowse.PayerRefAttribute.Value = "";
FeesPaymentType paymentTypeAny = new FeesPaymentType();
paymentTypeAny.Description = "<Any>";
paymentTypeAny.codeAttribute.Value = Cache.CurrentDatabase.WildcardAny;
paymentTypeAny.PaymentTypeIDAttribute.Value = -1;
feesBillPayerBrowse.PaymentTypeAttribute.Value = paymentTypeAny;
YearGroup yearGroupAny = new YearGroup();
yearGroupAny.ID = -1;
yearGroupAny.Description = "<Any>";
yearGroupAny.Code = Cache.CurrentDatabase.WildcardAny;
yearGroupAny.Active = "A";
feesBillPayerBrowse.YearGroupAttribute.Value = yearGroupAny;
// Extra reg group entities
RegistrationGroup registrationGroupAny = new SIMS.Entities.RegistrationGroup();
registrationGroupAny.ID = -1;
registrationGroupAny.Description = "<Any>";
registrationGroupAny.Code = Cache.CurrentDatabase.WildcardAny;
registrationGroupAny.Active = "A";
feesBillPayerBrowse.RegGroupAttribute.Value = registrationGroupAny;
Tier objTier = new Tier();
objTier.ID = -1;
objTier.Description = "<Any>";
objTier.Code = Cache.CurrentDatabase.WildcardAny;
objTier.Active = "A";
feesBillPayerBrowse.TierAttribute.Value = objTier;
House objHouse = new House();
objHouse.ID = -1;
objHouse.Description = "<Any>";
objHouse.Code = Cache.CurrentDatabase.WildcardAny;
objHouse.Active = "A";
feesBillPayerBrowse.HouseAttribute.Value = objHouse;
Boarder objBoarder = new Boarder();
objBoarder.ID = -1;
objBoarder.Description = "<Any>";
objBoarder.Code = Cache.CurrentDatabase.WildcardAny;
objBoarder.Active = "A";
feesBillPayerBrowse.BoarderStatusAttribute.Value = objBoarder;
EntityAttribute isACompanyPayer = new EntityAttribute(InformationDomainEnum.None, new AbstractCollectionReference(GetCompany));
feesBillPayerBrowse.IsACompanyPayerAttribute.Value = GetCompany().ItemByDescription("<Any>");
}
private FeesBillPayerSummarys getPayersSummary()
{
createAndAssignDummyAttributes();
payerBrowseProcess.BillPayerBrowse = feesBillPayerBrowse;
payerBrowseProcess.Search(false);//this will populate BillPayers which is Payers Summery
return payerBrowseProcess.BillPayerBrowse.BillPayers;
}
private static AbstractCollection GetCompany()
{
AbstractCollection coll = new AbstractCollection();
AbstractGroup any = new AbstractGroup(null, -1, "<Any>", "<Any>");
coll.Add(any);
AbstractGroup yes = new AbstractGroup(null, 1, "Yes", "Yes");
coll.Add(yes);
AbstractGroup no = new AbstractGroup(null, 0, "No", "No");
coll.Add(no);
return coll;
}
}
}
Example Output
Simple dictionary is created.
This uses the same base code as the fees transaction list or aged debtor reports. If a different subset of payers is needed then the browse parameters can be adjusted.