Ejemplo n.º 1
0
        private static FmJournalOperation MakeOperationPlan0(IObjectSpace os, FmFinPlanSubject fin_plan_subject)
        {
            FmJournalOperation oper = os.CreateObject <FmJournalOperation>();

            fin_plan_subject.PlanFullOperations.Add(oper);
            return(oper);
        }
Ejemplo n.º 2
0
        public static void TransactPlan0(IObjectSpace os, FmFinPlanSubject fin_plan_subject, FmFinPlanSubjectDocFull doc)
        {
            if (doc.Order == null)
            {
                throw new NullReferenceException();
            }
            foreach (var oper in new List <FmJournalOperation>(fin_plan_subject.PlanFullOperations))
            {
                if (oper.Order == doc.Order)
                {
                    os.Delete(oper);
                }
//                os.Delete(fin_plan_subject.PlanFullOperations.Where(x => x.Order == doc.Order));
            }
            foreach (var doc_oper in doc.DocOperations)
            {
                FmJournalOperation oper = MakeOperationPlan0(os, fin_plan_subject);
                oper.BalanceSumma          = doc_oper.BalanceSumma;
                oper.BalanceValuta         = doc_oper.BalanceValuta;
                oper.BuhAccount            = doc_oper.BuhAccount;
                oper.CostItem              = doc_oper.CostItem;
                oper.Date                  = doc_oper.Date;
                oper.Deal                  = doc_oper.Deal;
                oper.Department            = doc_oper.Department;
                oper.DepartmentStructItem  = doc_oper.DepartmentStructItem;
                oper.FinAccount            = doc_oper.FinAccount;
                oper.FinAccountBalanceType = doc_oper.FinAccountBalanceType;
                oper.FinAccountType        = doc_oper.FinAccountType;
                oper.FinIndex              = doc_oper.FinIndex;
                oper.FinOperationType      = doc_oper.FinOperationType;
                oper.ObligationSumma       = doc_oper.ObligationSumma;
                oper.ObligationValuta      = doc_oper.ObligationValuta;
                oper.Order                 = doc_oper.Order;
                oper.Party                 = doc_oper.Party;
                oper.PayType               = doc_oper.PayType;
//                oper.Person = doc_oper.Person;
            }
        }