Example #1
0
 private void UpdateJorunalEntryDebit(JournalEntryDTO pObjJournalEntry)
 {
     try
     {
         string          lStrAccountC     = DtMatrixSellers.GetValue("C_AccountC", mIntRowSelected - 1).ToString();
         string          lStrAccountD     = DtMatrixSellers.GetValue("C_AccountD", mIntRowSelected - 1).ToString();
         JournalEntryDTO lObjJournalEntry = mLstJournalEntryDTO.Where(x => x.Aux == pObjJournalEntry.Aux && x.Account == lStrAccountD).FirstOrDefault();
         if (lObjJournalEntry == null)
         {
             lObjJournalEntry           = new JournalEntryDTO();
             lObjJournalEntry.AuctionId = mStrAuctionId;
             lObjJournalEntry.Area      = pObjJournalEntry.Area;
             lObjJournalEntry.AuxType   = pObjJournalEntry.AuxType;
             lObjJournalEntry.Aux       = pObjJournalEntry.Aux;
             lObjJournalEntry.Debit     = pObjJournalEntry.Credit;
             lObjJournalEntry.Credit    = 0;
             lObjJournalEntry.AuctionId = mStrAuctionId;
             lObjJournalEntry.Account   = lStrAccountD;
             mLstJournalEntryDTO.Add(lObjJournalEntry);
         }
         else
         {
             decimal lDecDebit = mLstJournalEntryDTO.Where(x => x.Aux == pObjJournalEntry.Aux && x.Account == lStrAccountC).Sum(y => y.Credit);
             lObjJournalEntry.Debit = lDecDebit;
         }
     }
     catch (Exception ex)
     {
         UIApplication.ShowError("frmPayment (UpdateJorunalEntryDebit) " + ex.Message);
         LogService.WriteError("frmPayment (UpdateJorunalEntryDebit) " + ex.Message);
         LogService.WriteError(ex);
     }
 }
Example #2
0
 private void JounralEntry(int pIntRow)
 {
     try
     {
         string  lStrAuction = DtMatrixAuctions.GetValue("C_Auction", pIntRow - 1).ToString();
         string  lStrAux     = DtMatrixSellers.GetValue("C_Code", mIntRowSelected - 1).ToString();
         decimal lDecTotalC  = Convert.ToDecimal(DtMatrixAuctions.GetValue("C_TotalC", pIntRow - 1).ToString());
         if (lDecTotalC > 0)
         {
             JournalEntryDTO lObjJournalEntry = mLstJournalEntryDTO.Where(x => x.Aux == lStrAux && x.AuctionId == lStrAuction).FirstOrDefault();
             if (lObjJournalEntry == null)
             {
                 JournalEntryDTO lObjJournalEntryDTO = new JournalEntryDTO();
                 lObjJournalEntryDTO.AuctionId = DtMatrixAuctions.GetValue("C_Auction", pIntRow - 1).ToString();
                 lObjJournalEntryDTO.Credit    = Convert.ToDecimal(DtMatrixAuctions.GetValue("C_TotalC", pIntRow - 1).ToString());
                 lObjJournalEntryDTO.Debit     = 0;
                 lObjJournalEntryDTO.Area      = "SU_HERMO";
                 lObjJournalEntryDTO.AuxType   = "1";
                 lObjJournalEntryDTO.Aux       = DtMatrixSellers.GetValue("C_Code", mIntRowSelected - 1).ToString();
                 lObjJournalEntryDTO.AuctionId = DtMatrixAuctions.GetValue("C_Auction", pIntRow - 1).ToString();
                 lObjJournalEntryDTO.Account   = DtMatrixSellers.GetValue("C_AccountC", mIntRowSelected - 1).ToString();
                 lObjJournalEntry = lObjJournalEntryDTO;
                 mLstJournalEntryDTO.Add(lObjJournalEntryDTO);
             }
             else
             {
                 lObjJournalEntry.Credit = Convert.ToDecimal(DtMatrixAuctions.GetValue("C_TotalC", pIntRow - 1).ToString());
             }
             UpdateJorunalEntryDebit(lObjJournalEntry);
         }
     }
     catch (Exception ex)
     {
         UIApplication.ShowError("frmPayment (JounralEntry) " + ex.Message);
         LogService.WriteError("frmPayment (JounralEntry) " + ex.Message);
         LogService.WriteError(ex);
     }
 }
Example #3
0
        private List <AuctionsDTO> AddChargeToList(List <AuctionsDTO> pLstAuctionDTO)
        {
            try
            {
                string lStrAccount = DtMatrixSellers.GetValue("C_AccountC", mIntRowSelected - 1).ToString();
                string lStrAux     = DtMatrixSellers.GetValue("C_Code", mIntRowSelected - 1).ToString();
                foreach (AuctionsDTO lObjAuctionsDTO in pLstAuctionDTO)
                {
                    JournalEntryDTO lObjJournalEntry = mLstJournalEntryDTO.Where(x => x.Credit > 0 && x.Account == lStrAccount && x.Aux == lStrAux && x.AuctionId == lObjAuctionsDTO.Folio).FirstOrDefault();

                    if (lObjJournalEntry != null)
                    {
                        lObjAuctionsDTO.TotalCharge = lObjJournalEntry.Credit.ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                UIApplication.ShowError("frmPayment (AddChargeToList) " + ex.Message);
                LogService.WriteError("frmPayment (AddChargeToList) " + ex.Message);
                LogService.WriteError(ex);
            }
            return(pLstAuctionDTO);
        }