Beispiel #1
0
        PayrollConcept ConceptFor(PayrollTag code)
        {
            var            emptyValues = new Dictionary <string, object>();
            PayrollConcept concept     = Concepts.ConceptFor(code.ConceptCode(), code.ConceptName(), emptyValues);

            return(concept);
        }
Beispiel #2
0
        // create pair of TagRefer and PayrollConcept with code order
        private KeyValuePair <TagRefer, PayrollConcept> NewTermPairWithOrder(uint periodBase, CodeNameRefer termRefer, uint codeOrder, IDictionary <string, object> termValues)
        {
            TagRefer       termKey     = NewTermKeyWithOrder(periodBase, termRefer, codeOrder);
            PayrollConcept termConcept = NewTermConcept(termRefer, termValues);

            return(new KeyValuePair <TagRefer, PayrollConcept>(termKey, termConcept));
        }
Beispiel #3
0
        public override PayrollConcept CloneWithValue(uint code, IDictionary <string, object> values)
        {
            PayrollConcept newConcept = (TaxAdvanceBaseConcept)this.Clone();

            newConcept.InitCode(code);
            newConcept.InitValues(values);
            return(newConcept);
        }
Beispiel #4
0
        private KeyValuePair <TagRefer, PayrollConcept> NewTermPair(IDictionary <TagRefer, PayrollConcept> termHash, uint periodBase, CodeNameRefer termRefer, IDictionary <string, object> termValues)
        {
            uint           newCodeOrder = GetNewTagOrderFrom(termHash, periodBase, termRefer.Code);
            TagRefer       termKey      = NewTermKeyWithOrder(periodBase, termRefer, newCodeOrder);
            PayrollConcept termConcept  = NewTermConcept(termRefer, termValues);

            return(new KeyValuePair <TagRefer, PayrollConcept>(termKey, termConcept));
        }
Beispiel #5
0
        private PayrollConcept NewTermConcept(CodeNameRefer termRefer, IDictionary <string, object> termValues)
        {
            PayrollTag     termTag     = Tags.TagFromModels(termRefer);
            PayrollConcept baseConcept = Concepts.ConceptFromModels(termTag);
            PayrollConcept termConcept = baseConcept.CloneWithValue(termTag.Code, termValues);

            return(termConcept);
        }
        public PayrollConcept EmptyConceptFor(PayrollTag termTag)
        {
            var            emptyValues  = new Dictionary <string, object>();
            PayrollConcept emptyConcept = ConceptFor(termTag.Code, termTag.ConceptName(), emptyValues);

            PayrollTag[] emptyPending = RecPendingCodes(emptyConcept.PendingCodes());
            emptyConcept.SetPendingCodes(emptyPending);
            return(emptyConcept);
        }
        public PayrollConcept ConceptFor(uint tagCode, string conceptName, IDictionary <string, object> values)
        {
            string conceptClass = ClassNameFor(conceptName);

            object[] conceptParams = new object[2] {
                tagCode, values
            };
            PayrollConcept conceptInstance = (PayrollConcept)Activator.CreateInstance(Type.GetType(conceptClass), conceptParams);

            return(conceptInstance);
        }
 public PayrollTag[] CollectPendingCodesForFunc(TagRefer termRefer, PayrollConcept termConcept)
 {
     PayrollTag[] termPendingCodes = termConcept.TagPendingCodes;
     if (termPendingCodes == null)
     {
         return(new PayrollTag[0]);
     }
     else
     {
         return((PayrollTag[])termPendingCodes.Clone());
     }
 }
        public void test_salary_CONCEPT_SALARY_MONTHLY_code()
        {
            var values = new Dictionary <string, object>()
            {
                { "amount_monthly", 0 }
            };
            PayrollConcept conceptItem = PayConcepts.ConceptFor(SalaryConceptTag.Code, SalaryConceptTag.ConceptName(), values);

            Assert.AreEqual("CONCEPT_SALARY_MONTHLY", conceptItem.Name);
            Assert.AreEqual((uint)ConceptCode.CONCEPT_SALARY_MONTHLY, conceptItem.Code);
            Assert.AreEqual((uint)TagCode.TAG_SALARY_BASE, conceptItem.TagCode);
        }
        public PayrollTag[] PendingCodesForTagCode(PayrollTag tagRefer)
        {
            PayrollConcept baseConcept = ConceptFromModels(tagRefer);

            if (baseConcept.TagPendingCodes == null)
            {
                return(RecPendingCodes(baseConcept.PendingCodes()));
            }
            else
            {
                return(baseConcept.TagPendingCodes);
            }
        }
        public PayrollConcept FindConcept(uint conceptCode)
        {
            PayrollConcept baseConcept = null;

            if (Models.ContainsKey((ConceptCode)conceptCode))
            {
                baseConcept = Models[(ConceptCode)conceptCode];
            }
            else
            {
                baseConcept = Models[ConceptCode.CONCEPT_UNKNOWN];
            }
            return(baseConcept);
        }
        // concept tree
        public PayrollConcept ConceptFromModels(PayrollTag termTag)
        {
            PayrollConcept baseConcept = null;

            if (!Models.ContainsKey((ConceptCode)termTag.ConceptCode()))
            {
                baseConcept = EmptyConceptFor(termTag);
                Models[(ConceptCode)termTag.ConceptCode()] = baseConcept;
            }
            else
            {
                baseConcept = Models[(ConceptCode)termTag.ConceptCode()];
            }
            return(baseConcept);
        }
Beispiel #13
0
 public TaxReliefResult(uint code, uint conceptCode, PayrollConcept conceptItem, IDictionary <string, object> values)
     : base(code, conceptCode, conceptItem)
 {
     InitValues(values);
 }
 public PaymentDeductionResult(uint code, uint conceptCode, PayrollConcept conceptItem, IDictionary <string, object> values)
     : base(code, conceptCode, conceptItem, values)
 {
     InitValues(values);
 }