Esempio n. 1
0
        public DataTable DT_getvalueDebit(int FinancialAccountDimId, int YearDimId)
        {
            try
            {
                DataTable dt        = DT_header();
                DataTable dt_xp_all = DT_xp_ALL(FinancialAccountDimId, YearDimId, true, true, true, false);

                if (dt_xp_all == null || dt == null)
                {
                    return(null);
                }
                foreach (DataColumn dc_all in dt_xp_all.Columns)
                {
                    DataRow dr = dt.NewRow();

                    CorrespondFinancialAccountDim     Corr = BO.get_CorrespondFinancialAccountDim_1(session, int.Parse(dc_all.ColumnName), Utility.Constant.ROWSTATUS_ACTIVE);
                    FinancialGeneralLedgerByYear_Fact FGLY = BO.get_FinancialGeneralLedgerByYear_Fact_1(session, FinancialAccountDimId, YearDimId, Utility.Constant.ROWSTATUS_ACTIVE);

                    #region
                    if (Corr != null)
                    {
                        foreach (DataColumn dc in dt.Columns)
                        {
                            if (dc.ColumnName.Equals("TK"))
                            {
                                dr[dc.ColumnName] = Corr.Code;
                            }
                            if (!dc.ColumnName.Equals("TK"))
                            {
                                for (int i = 1; i <= 12; i++)
                                {
                                    if (FGLY != null && dc.ColumnName.Equals(i.ToString()))
                                    {
                                        FinancialGeneralLedgerByMonth FGLM = BO.get_FinancialGeneralLedgerByMonth_Debit(session, FGLY.FinancialGeneralLedgerByYear_FactId, int.Parse(dc_all.ColumnName), i, Utility.Constant.ROWSTATUS_ACTIVE);
                                        MonthDim MD = BO.get_MonthDimId(session, i.ToString(), Utility.Constant.ROWSTATUS_ACTIVE);
                                        if (FGLM != null && MD != null)
                                        {
                                            if (FGLM.DebitSum > 0)
                                            {
                                                dr[dc.ColumnName] = sumAcc(FGLM.CorrespondFinancialAccountDimId.Code, FGLM.FinancialGeneralLedgerByYear_FactId.FinancialGeneralLedgerByYear_FactId, MD.MonthDimId, false);
                                            }
                                            else
                                            {
                                                dr[dc.ColumnName] = 0;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        dt.Rows.Add(dr);
                    }
                    #endregion
                }

                return(dt);
            }
            catch (Exception) { return(null); }
        }
Esempio n. 2
0
 public FinancialGeneralLedgerByMonth get_FinancialGeneralLedgerByMonth(Session session, int FinancialGeneralLedgerByMonthId, short RowStatus)
 {
     try
     {
         FinancialGeneralLedgerByMonth FGLM = session.FindObject <FinancialGeneralLedgerByMonth>(
             CriteriaOperator.And(
                 new BinaryOperator("FinancialGeneralLedgerByMonthId", FinancialGeneralLedgerByMonthId, BinaryOperatorType.Equal),
                 new BinaryOperator("RowStatus", RowStatus, BinaryOperatorType.Equal)
                 ));
         if (FGLM == null)
         {
             return(null);
         }
         return(FGLM);
     }
     catch (Exception) { throw; }
 }
Esempio n. 3
0
 public FinancialGeneralLedgerByMonth get_FinancialGeneralLedgerByMonth_Debit(Session session, int FinancialGeneralLedgerByYear_FactId, int CorrespondFinancialAccountDimId, int MonthDimId, short RowStatus)
 {
     try
     {
         FinancialGeneralLedgerByMonth FGLM = session.FindObject <FinancialGeneralLedgerByMonth>(
             CriteriaOperator.And(
                 new BinaryOperator("FinancialGeneralLedgerByYear_FactId", FinancialGeneralLedgerByYear_FactId, BinaryOperatorType.Equal),
                 new BinaryOperator("CorrespondFinancialAccountDimId", CorrespondFinancialAccountDimId, BinaryOperatorType.Equal),
                 new BinaryOperator("MonthDimId", MonthDimId, BinaryOperatorType.Equal),
                 new BinaryOperator("RowStatus", RowStatus, BinaryOperatorType.Equal),
                 new BinaryOperator("DebitSum", 0, BinaryOperatorType.Greater)
                 ));
         if (FGLM == null)
         {
             return(null);
         }
         return(FGLM);
     }
     catch (Exception) { throw; }
 }