Esempio n. 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);
     }
 }
Esempio n. 2
0
        private void UpdateMatrix()
        {
            try
            {
                this.UIAPIRawForm.Freeze(true);
                decimal lDecPaymentPayment = 0;
                for (int i = 0; i < DtMatrixAuctions.Rows.Count; i++)
                {
                    string  lStrPayment = (mtxAuction.Columns.Item("C_TotalC").Cells.Item(i + 1).Specific as EditText).Value.Trim();
                    decimal lDblPayment = Convert.ToDecimal(lStrPayment == "" ? "0" : lStrPayment);
                    DtMatrixAuctions.SetValue("C_TotalC", i, lDblPayment.ToString());
                    lDecPaymentPayment += lDblPayment;
                }
                decimal lDecPaymentSell = Convert.ToDecimal(DtMatrixSellers.GetValue("C_TotalS", mIntRowSelected - 1).ToString());
                DtMatrixSellers.SetValue("C_TotalC", mIntRowSelected - 1, lDecPaymentPayment.ToString());

                DtMatrixSellers.SetValue("C_Total", mIntRowSelected - 1, (lDecPaymentSell - lDecPaymentPayment).ToString());
                mtxSellers.LoadFromDataSource();
                mtxAuction.LoadFromDataSource();
            }
            catch (Exception ex)
            {
                UIApplication.ShowError("frmPayment (UpdateMatrix) " + ex.Message);
                LogService.WriteError("frmPayment (UpdateMatrix) " + ex.Message);
                LogService.WriteError(ex);
            }
            finally
            {
                this.UIAPIRawForm.Freeze(false);
            }
        }
Esempio n. 3
0
        private void FillMatrix(List <PaymentDTO> pLstPaymentDTO)
        {
            try
            {
                DtMatrixSellers.Rows.Clear();
                int i = 0;
                this.UIAPIRawForm.Freeze(true);
                foreach (PaymentDTO lObjPaymentDTO in pLstPaymentDTO)
                {
                    DtMatrixSellers.Rows.Add();
                    DtMatrixSellers.SetValue("#", i, i + 1);
                    DtMatrixSellers.SetValue("C_Code", i, lObjPaymentDTO.CardCode);
                    DtMatrixSellers.SetValue("C_Name", i, lObjPaymentDTO.CardName);
                    DtMatrixSellers.SetValue("C_TotalS", i, lObjPaymentDTO.TotalSell);
                    DtMatrixSellers.SetValue("C_TotalB", i, lObjPaymentDTO.TotalBuy);
                    DtMatrixSellers.SetValue("C_TotalC", i, lObjPaymentDTO.TotalCharge == null ? "0" : lObjPaymentDTO.TotalCharge);
                    DtMatrixSellers.SetValue("C_Total", i, lObjPaymentDTO.Total == null ? "0" : lObjPaymentDTO.Total);
                    DtMatrixSellers.SetValue("C_AccountD", i, lObjPaymentDTO.AccountD);
                    DtMatrixSellers.SetValue("C_AccountC", i, lObjPaymentDTO.AccountC);
                    i++;
                }

                mtxSellers.Columns.Item("#").DataBind.Bind("DsPayments", "#");
                mtxSellers.Columns.Item("C_Code").DataBind.Bind("DsPayments", "C_Code");
                mtxSellers.Columns.Item("C_Name").DataBind.Bind("DsPayments", "C_Name");
                mtxSellers.Columns.Item("C_TotalS").DataBind.Bind("DsPayments", "C_TotalS");
                mtxSellers.Columns.Item("C_TotalB").DataBind.Bind("DsPayments", "C_TotalB");
                mtxSellers.Columns.Item("C_TotalC").DataBind.Bind("DsPayments", "C_TotalC");
                mtxSellers.Columns.Item("C_Total").DataBind.Bind("DsPayments", "C_Total");
                mtxSellers.LoadFromDataSource();
                mtxSellers.AutoResizeColumns();
            }
            catch (Exception ex)
            {
                UIApplication.ShowError("frmPayment (FillMatrix) " + ex.Message);
                LogService.WriteError("frmPayment (FillMatrix) " + ex.Message);
                LogService.WriteError(ex);
            }
            finally
            {
                this.UIAPIRawForm.Freeze(false);
            }
        }
Esempio n. 4
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);
     }
 }
Esempio n. 5
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);
        }
Esempio n. 6
0
 private void mtxSellers_DoubleClickAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)
 {
     try
     {
         mIntRowSelected = pVal.Row;
         if (DtMatrixAuctions == null)
         {
             CreateDataTableMatrixAuctions();
         }
         List <AuctionsDTO> lLstAuctionDTO = mObjPaymentServiceFactory.GetPaymentService().GetAuctions(DtMatrixSellers.GetValue("C_Code", pVal.Row - 1).ToString(), mIntSignature).ToList();
         lLstAuctionDTO = AddChargeToList(lLstAuctionDTO);
         FillMatrixAuction(lLstAuctionDTO);
     }
     catch (Exception ex)
     {
         UIApplication.ShowError("frmPayment (mtxSellers_DoubleClickAfter) " + ex.Message);
         LogService.WriteError("frmPayment (mtxSellers_DoubleClickAfter) " + ex.Message);
         LogService.WriteError(ex);
     }
 }