コード例 #1
0
        public List <CsLclient> RetourneTauxDeRecouvrement(List <int> IdCentre)
        {
            List <string> lstPeriode = DetermineListePeriode(1, 12, System.DateTime.Today);

            List <CsLclient> lesFacture   = new DBReports().RetourneFactureGenere(IdCentre, lstPeriode);
            List <CsLclient> lesReglement = new DBReports().RetourneFactureRecouvre(IdCentre, lstPeriode);
            List <CsLclient> lesTaux      = new List <CsLclient>();
            List <string>    lstCateg     = new List <string>();
            var lstCate = lesFacture.Select(p => p.LIBELLECATEGORIE).Distinct();

            foreach (var item in lstCate)
            {
                lstCateg.Add(item);
            }

            foreach (string item in lstPeriode)
            {
                foreach (string categ in lstCateg)
                {
                    CsLclient l = new CsLclient();
                    l.REFEM       = item;
                    l.LIBELLESITE = categ;
                    l.MONTANTEMIS = lesFacture.FirstOrDefault(i => i.REFEM == item && i.LIBELLECATEGORIE == categ) != null?lesFacture.FirstOrDefault(i => i.REFEM == item && i.LIBELLECATEGORIE == categ).MONTANT.Value : 0;

                    l.MONTANTENCAISSE = lesReglement.FirstOrDefault(i => i.REFEM == item && i.LIBELLECATEGORIE == categ) != null?lesReglement.FirstOrDefault(i => i.REFEM == item && i.LIBELLECATEGORIE == categ).MONTANT.Value : 0;

                    l.TAUXRECOUVREMENT = (l.MONTANTENCAISSE / l.MONTANTEMIS) * 100;
                    lesTaux.Add(l);
                }
            }
            return(lesTaux);
        }
コード例 #2
0
        private void RemplireCombo(List <CsLclient> _LstReglement)
        {
            try
            {
                // La grid doit afficher le detail d un recu par mode de reglement
                var reglemntParModereg = (from p in _LstReglement
                                          group new { p } by new { p.ACQUIT, p.DTRANS } into pResult
                                          select new
                {
                    pResult.Key.ACQUIT,
                    pResult.Key.DTRANS,
                    MONTANT = (decimal?)pResult.Where(t => t.p.ACQUIT == pResult.Key.ACQUIT).Sum(o => o.p.MONTANT)
                });

                List <CsLclient> ReglementAfficherParModeReg = new List <CsLclient>();

                foreach (var r in reglemntParModereg.OrderByDescending(p => p.ACQUIT))
                {
                    CsLclient rglt = new CsLclient();
                    rglt.REFFERENCECLIENT = r.ACQUIT.PadRight(10, ' ') + r.DTRANS.Value.ToShortDateString().ToString().PadRight(10, ' ') + Convert.ToDecimal(r.MONTANT).ToString(SessionObject.FormatMontant).PadLeft(10, ' ');
                    rglt.ACQUIT           = r.ACQUIT;
                    ReglementAfficherParModeReg.Add(rglt);
                }

                this.Cbo_ListeRecu.ItemsSource       = null;
                this.Cbo_ListeRecu.ItemsSource       = ReglementAfficherParModeReg;
                this.Cbo_ListeRecu.DisplayMemberPath = "REFFERENCECLIENT";
                this.Cbo_ListeRecu.SelectedItem      = ReglementAfficherParModeReg[0];
            }
            catch (Exception ex)
            {
            }
        }
コード例 #3
0
        private CsLclient  GetElementDeFrais(CsDetailCampagne Campagne, decimal?montantFrais)
        {
            CsLclient Frais = new CsLclient();

            try
            {
                Frais.CENTRE           = Campagne.CENTRE;
                Frais.CLIENT           = Campagne.CLIENT;
                Frais.ORDRE            = Campagne.ORDRE;
                Frais.REFEM            = DateTime.Today.Date.Year.ToString() + DateTime.Today.Date.Month.ToString();
                Frais.IDCOUPURE        = Campagne.IDCOUPURE;
                Frais.COPER            = SessionObject.Enumere.CoperFRP;
                Frais.DENR             = DateTime.Today.Date;
                Frais.EXIGIBILITE      = DateTime.Today.Date;
                Frais.DATECREATION     = DateTime.Today.Date;
                Frais.DATEMODIFICATION = DateTime.Today.Date;
                Frais.DC          = SessionObject.Enumere.Debit;
                Frais.FK_IDCENTRE = Campagne.FK_IDCENTRE;
                Frais.FK_IDCLIENT = Campagne.FK_IDCLIENT;
                Frais.MATRICULE   = UserConnecte.matricule;
                Frais.MOISCOMPT   = DateTime.Today.Date.Year.ToString() + DateTime.Today.Date.Month.ToString();
                Frais.MONTANT     = montantFrais;
                Frais.NATURE      = SessionObject.Enumere.NatureFRP;
                Frais.TOP1        = "0";


                return(Frais);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #4
0
        private void galatee_OkClickedChoixClient(object sender, EventArgs e)
        {
            if (this.Anciennecamp != null)
            {
                foreach (var item_ in this.Anciennecamp)
                {
                    foreach (var item in item_.DETAILCAMPAGNEGC_)
                    {
                        CsLclient facture = new CsLclient();
                        facture.CENTRE       = item.CENTRE;
                        facture.CLIENT       = item.CLIENT;
                        facture.ORDRE        = item.ORDRE;
                        facture.NOM          = item.NOM;
                        facture.REFEM        = item.PERIODE;
                        facture.SOLDEFACTURE = item.MONTANT;
                        facture.NDOC         = item.NDOC;
                        Lstfacture.Add(facture);
                    }
                }
            }

            System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(Lstfacture);
            LoadDataPager <CsLclient>(Lstfacture, datapager, dg_facture);
            if (dg_facture.ItemsSource != null)
            {
                this.txt_TotalFacture.Text = Lstfacture.Sum(c => (c.SOLDEFACTURE != null ? c.SOLDEFACTURE : 0)).Value.ToString(SessionObject.FormatMontant);
            }

            btn_Rech.IsEnabled = true;
            desableProgressBar();
            ActiverElement(true);
            Message.ShowInformation("Les factures déja en campagne ne seront pas dans cette campagne", "Information");
        }
コード例 #5
0
        List <CsLclient> GetFactureOD()
        {
            try
            {
                List <CsLclient> _Lstfacture = new List <CsLclient>();

                CsLclient _Lafacture = new CsLclient();
                _Lafacture.CENTRE       = UserConnecte.Centre;
                _Lafacture.CLIENT       = "000000000000000";
                _Lafacture.ORDRE        = "01";
                _Lafacture.NDOC         = "//////";
                _Lafacture.NATURE       = "01";
                _Lafacture.SOLDEFACTURE = Convert.ToDecimal(this.txt_montant.Text);
                _Lafacture.MONTANT      = Convert.ToDecimal(this.txt_montant.Text);
                _Lafacture.Selectionner = true;
                _Lafacture.REFEM        = "//////";
                _Lafacture.DC           = "D";
                _Lafacture.COPER        = (this.cbo_Operation.SelectedItem as CsCoper).CODE;
                _Lafacture.NOM          = this.txt_NomClient.Text;
                _Lafacture.SOLDECLIENT  = 0;
                _Lafacture.MATRICULE    = UserConnecte.matricule;
                _Lafacture.CAISSE       = UserConnecte.numcaisse;
                _Lafacture.USERCREATION = UserConnecte.matricule;
                _Lafacture.DATECREATION = DateTime.Now.Date;
                //_Lafacture.IDENTITY = txt_IdCard.Text;

                _Lstfacture.Add(_Lafacture);
                return(_Lstfacture);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #6
0
 private void InsererCompteClient(CsLclient leFrais)
 {
     try
     {
         AcceuilServiceClient clients = new AcceuilServiceClient(Utility.Protocole(), Utility.EndPoint("Accueil"));
         clients.InsererFraisPoseAsync(leFrais);
         clients.InsererFraisPoseCompleted += (es, result) =>
         {
             try
             {
                 if (result.Cancelled || result.Error != null)
                 {
                     string error = result.Error.Message;
                     Message.ShowError("Erreur à l'exécution du service", "InsererCompteClient");
                     return;
                 }
                 if (result.Result == null)
                 {
                     Message.ShowInformation("Donnée non trouvé ", "InsererCompteClient");
                     return;
                 }
                 Message.ShowInformation(Langue.MsgOperationTerminee, Langue.lbl_Menu);
             }
             catch (Exception ex)
             {
                 Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
             }
         };
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #7
0
        private void EnregisterLclient(CsDemande _Lademande)
        {
            LeEvenementRemboursementAvance = new List <CsLclient>();
            CsLclient _LaFacture = new CsLclient();

            _LaFacture.CENTRE    = LaDemande.LaDemande.CENTRE;
            _LaFacture.CLIENT    = LaDemande.LaDemande.CLIENT;
            _LaFacture.ORDRE     = LaDemande.LaDemande.ORDRE;
            _LaFacture.MATRICULE = UserConnecte.matricule;
            _LaFacture.DC        = SessionObject.Enumere.Debit;

            _LaFacture.REFEM       = System.DateTime.Now.Date.ToShortDateString().Substring(6, 4) + System.DateTime.Now.Date.ToShortDateString().Substring(3, 2);
            _LaFacture.DENR        = System.DateTime.Now.Date;
            _LaFacture.EXIGIBILITE = System.DateTime.Now.Date;
            _LaFacture.TOP1        = SessionObject.Enumere.TopGuichet;

            _LaFacture.COPER   = SessionObject.Enumere.CoperRCD;
            _LaFacture.NATURE  = "00";
            _LaFacture.MONTANT = LaDemande.Abonne.AVANCE;

            _LaFacture.USERCREATION     = UserConnecte.matricule;
            _LaFacture.USERMODIFICATION = UserConnecte.matricule;
            _LaFacture.DATECREATION     = System.DateTime.Now;
            _LaFacture.DATEMODIFICATION = System.DateTime.Now;

            if (_LaFacture.MONTANT != null && _LaFacture.MONTANT != 0)
            {
                LeEvenementRemboursementAvance.Add(_LaFacture);
            }
        }
コード例 #8
0
        private List <CsLclient> GetElementDeFrais(List <CsDetailCampagne> LesCampagne)
        {
            List <CsLclient> LesFrais = new List <CsLclient>();

            try
            {
                foreach (var Campagne in LesCampagne)
                {
                    CsLclient Frais = new CsLclient();
                    Frais.CENTRE           = Campagne.CENTRE;
                    Frais.CLIENT           = Campagne.CLIENT;
                    Frais.ORDRE            = Campagne.ORDRE;
                    Frais.REFEM            = DateTime.Today.Date.Year.ToString("0000") + DateTime.Today.Date.Month.ToString("00");
                    Frais.COPER            = SessionObject.Enumere.CoperFRP;
                    Frais.DENR             = DateTime.Today.Date;
                    Frais.EXIGIBILITE      = DateTime.Today.Date;
                    Frais.DATECREATION     = DateTime.Today.Date;
                    Frais.DATEMODIFICATION = DateTime.Today.Date;
                    Frais.DC          = SessionObject.Enumere.Debit;
                    Frais.FK_IDCENTRE = Campagne.FK_IDCENTRE;
                    Frais.FK_IDCLIENT = Campagne.FK_IDCLIENT;
                    Frais.MATRICULE   = UserConnecte.matricule;
                    Frais.MOISCOMPT   = DateTime.Today.Date.Year.ToString("0000") + DateTime.Today.Date.Month.ToString("00");
                    Frais.MONTANT     = Campagne.MONTANTFRAIS;
                    Frais.TOP1        = "0";
                    LesFrais.Add(Frais);
                }
                return(LesFrais);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #9
0
        public List <CsLclient> RetourneTauxDeEncaissement(List <int> IdCentre)
        {
            List <string>    lstPeriode         = DetermineListePeriode(1, 12, System.DateTime.Today);
            List <CsLclient> lesFactureRetourne = new List <CsLclient>();
            List <CsLclient> lesFacture         = new DBReports().RetourneFactureGenere(IdCentre, lstPeriode);
            List <CsLclient> lesReglement       = new DBReports().RetourneFactureRecouvre(IdCentre, lstPeriode);

            if (lesFacture != null && lesFacture.Count != 0)
            {
                CsLclient lafacturePeriode = lesFacture.First();
                lafacturePeriode.MONTANTENCAISSE = lesReglement.FirstOrDefault(t => t.REFEM == lesFacture.First().REFEM) == null ? 0 :
                                                   lesReglement.FirstOrDefault(t => t.REFEM == lesFacture.First().REFEM).MONTANT.Value;
                lafacturePeriode.MONTANTEMIS      = lafacturePeriode.MONTANT.Value;
                lafacturePeriode.TAUXRECOUVREMENT = (lafacturePeriode.MONTANTENCAISSE / lafacturePeriode.MONTANTEMIS) * 100;
                lesFactureRetourne.Add(lafacturePeriode);

                CsLclient AutreFacture = new CsLclient();
                AutreFacture.MONTANTEMIS     = lesFacture.Where(t => t.REFEM != lesFacture.First().REFEM).Sum(y => y.MONTANT.Value);
                AutreFacture.MONTANTENCAISSE = lesReglement.Where(t => t.REFEM != lesFacture.First().REFEM) == null ? 0 :
                                               lesReglement.Where(t => t.REFEM != lesFacture.First().REFEM).Sum(y => y.MONTANT.Value);
                AutreFacture.REFEM            = "AUTRE";
                AutreFacture.TAUXRECOUVREMENT = (AutreFacture.MONTANTENCAISSE / AutreFacture.MONTANTEMIS) * 100;

                lesFactureRetourne.Add(AutreFacture);
            }
            return(lesFactureRetourne);
        }
コード例 #10
0
        private void dgMyDataGrid2_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            DataGrid dg         = (sender as DataGrid);
            var      allObjects = dg.ItemsSource as List <CsLclient>;

            //foreach (var o in allObjects)
            //    o.Selectionner = false;

            if (dg.SelectedItem != null)
            {
                CsLclient SelectedObject = (CsLclient)dg.SelectedItem;
                if (SelectedObject.Selectionner == false)
                {
                    SelectedObject.Selectionner = true;
                    if (SelectedObject.STATUS == SessionObject.Enumere.StatusDemandeValider)
                    {
                        this.btn_Retirer.Visibility = System.Windows.Visibility.Collapsed;
                    }
                    else
                    {
                        this.btn_Retirer.Visibility = System.Windows.Visibility.Visible;
                    }
                }
                else
                {
                    SelectedObject.Selectionner = false;
                }
            }
        }
コード例 #11
0
        private void dataGrid1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            //CsReglement  _LaFacture = (CsReglement)this.dataGrid1.SelectedItem;
            CsLclient _LaFacture = (CsLclient)this.dataGrid1.SelectedItem;

            this.Txt_refem.Text = _LaFacture.REFEM;
            this.Txt_Ndoc.Text  = _LaFacture.NDOC;
        }
コード例 #12
0
 void getCloseAfterSelection()
 {
     if (Closed != null)
     {
         CsLclient _LaFacture = (CsLclient)this.dataGrid1.SelectedItem;
         LeClientLot = _LaFacture;
         Closed(this, new EventArgs());
     }
 }
コード例 #13
0
        private void chk_Exonere_Unchecked(object sender, RoutedEventArgs e)
        {
            List <CsLclient> lstFactureExoneres = (List <CsLclient>) this.LsvFacture.ItemsSource;

            if (lstFactureExoneres != null && this.LsvFacture.SelectedItem != null)
            {
                CsLclient leEltsSelect = lstFactureExoneres.FirstOrDefault(t => t.PK_ID == ((CsLclient)this.LsvFacture.SelectedItem).PK_ID);
                IsExonnere(leEltsSelect, false);
            }
        }
        private void  LettrageAutomatique(List <CsLclient> _ListeFactureAreglee, decimal montantAvance)
        {
            try
            {
                List <CsLclient> lstFactureAValider = new List <CsLclient>();
                decimal?         MontantRestant     = montantAvance;
                foreach (CsLclient laFactureClient in _ListeFactureAreglee)
                {
                    if (MontantRestant > 0)
                    {
                        decimal?MontantPaye = MontantRestant;
                        if (laFactureClient.SOLDEFACTURE <= MontantPaye)
                        {
                            MontantPaye = laFactureClient.SOLDEFACTURE;
                        }
                        else if (laFactureClient.SOLDEFACTURE >= MontantPaye)
                        {
                            MontantPaye = MontantRestant;
                        }

                        CsLclient leReglement = GetElementDeReglement(laFactureClient, MontantPaye);
                        lstFactureAValider.Add(leReglement);
                        MontantRestant = MontantRestant - laFactureClient.SOLDEFACTURE;
                        lstFactureAValider.Add(leReglement);
                    }
                }
                //AcceuilServiceClient client = new Galatee.Silverlight.ServiceAccueil.AcceuilServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Accueil"));
                //client.LettrageAutomatiqueCompleted += (ss, b) =>
                //{
                //    if (b.Cancelled || b.Error != null)
                //    {
                //        string error = b.Error.Message;
                //        Message.ShowError(error, Silverlight.Resources.Devis.Languages.txtDevis);
                //        return;
                //    }
                //    List<string> codes = new List<string>();
                //    codes.Add(laDetailDemande.InfoDemande.CODE);
                //    Galatee.Silverlight.Shared.ClasseMEthodeGenerique.TransmettreDemande(codes, true, this);

                //    List<CsUtilisateur> leUser = new List<CsUtilisateur>();
                //    if (laDetailDemande.InfoDemande != null && laDetailDemande.InfoDemande.CODE != null)
                //    {
                //        foreach (CsUtilisateur item in laDetailDemande.InfoDemande.UtilisateurEtapeSuivante)
                //            leUser.Add(item);
                //        Shared.ClasseMEthodeGenerique.NotifierMailDemande(leUser, "0001", laDetailDemande.LaDemande.NUMDEM, laDetailDemande.LaDemande.LIBELLETYPEDEMANDE);
                //    }
                //};
                //client.LettrageAutomatiqueAsync(lstFactureAValider);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #15
0
 private void dgrdAccount_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         CsLclient clientSelected = (CsLclient)dgrdAccount.SelectedItem;
         updateViewAfterSelection(clientSelected);
     }
     catch (Exception ex)
     {
         Message.Show(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
     }
 }
コード例 #16
0
        private void IsExonnere(CsLclient leElt, bool IsChecked)
        {
            try
            {
                List <CsLclient> lstEltfacture = new List <CsLclient>();
                lstEltfacture = ((List <CsLclient>)LsvFacture.ItemsSource).ToList();
                CsLclient leElts  = lstEltfacture.FirstOrDefault(t => t.PK_ID == leElt.PK_ID);
                CsLclient leEltss = lesEltInitial.FirstOrDefault(t => t.PK_ID == leElt.PK_ID);
                if (leElts != null)
                {
                    if (IsChecked)
                    {
                        decimal montantfact = (leEltss.SOLDEFACTURE - (leEltss.MONTANTTVA == null ? 0 : leEltss.MONTANTTVA)).Value;
                        leElts.MONTANTPAYE       = montantfact;
                        leElts.MONTANTEMIS       = leEltss.MONTANTTVA.Value; //SAUVEGARDER LA TVA
                        leElts.MONTANTTVA        = 0;
                        leElts.SOLDEFACTURE      = montantfact;
                        leElts.IsExonerationTaxe = true;

                        lstEltfacture.Where(a => a.PK_ID == leElts.PK_ID).ToList().ForEach(a => a.MONTANTEMIS  = leEltss.MONTANTTVA.Value); //SAUVEGARDER LA TVA
                        lstEltfacture.Where(a => a.PK_ID == leElts.PK_ID).ToList().ForEach(a => a.MONTANTTVA   = 0);
                        lstEltfacture.Where(a => a.PK_ID == leElts.PK_ID).ToList().ForEach(a => a.MONTANTPAYE  = montantfact);
                        lstEltfacture.Where(a => a.PK_ID == leElts.PK_ID).ToList().ForEach(a => a.SOLDEFACTURE = montantfact);
                    }
                    else
                    {
                        decimal montantfact = leEltss.SOLDEFACTURE.Value;
                        leElts.MONTANTPAYE       = montantfact;
                        leElts.MONTANTTVA        = leEltss.MONTANTTVA.Value;
                        leElts.SOLDEFACTURE      = montantfact;
                        leElts.IsExonerationTaxe = false;

                        lstEltfacture.Where(a => a.PK_ID == leElts.PK_ID).ToList().ForEach(a => a.MONTANTTVA   = leEltss.MONTANTTVA.Value);
                        lstEltfacture.Where(a => a.PK_ID == leElts.PK_ID).ToList().ForEach(a => a.MONTANTPAYE  = montantfact);
                        lstEltfacture.Where(a => a.PK_ID == leElts.PK_ID).ToList().ForEach(a => a.SOLDEFACTURE = montantfact);
                    }


                    this.Txt_TotalHt.Text   = lstEltfacture.Sum(t => t.MONTANT).Value.ToString(SessionObject.FormatMontant);
                    this.Txt_totalTaxe.Text = lstEltfacture.Sum(t => t.MONTANTTVA).Value.ToString(SessionObject.FormatMontant);
                    this.Txt_TotalTTC.Text  = txt_MontantPayes.Text = lstEltfacture.Sum(t => t.SOLDEFACTURE).Value.ToString(SessionObject.FormatMontant);

                    this.txt_MontantPayes.IsReadOnly = lstEltfacture.FirstOrDefault(a => a.IsExonerationTaxe) != null;

                    //if (LsvFacture.ItemsSource != null)
                    //    this.txt_MontantPayes.Text = ((List<CsLclient>)LsvFacture.ItemsSource).Sum(y => y.MONTANTPAYE).Value.ToString(SessionObject.FormatMontant);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #17
0
 private void btn_Recherche_Click(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrEmpty(this.Txt_refem.Text) &&
         !string.IsNullOrEmpty(this.Txt_Ndoc.Text))
     {
         CsLclient _LafactureRechercher = _LeCompteParOreientation.FirstOrDefault(p => p.NDOC == this.Txt_Ndoc.Text && p.REFEM == this.Txt_refem.Text);
         if (_LafactureRechercher != null)
         {
             this.Txt_refem.Text = _LafactureRechercher.REFEM;
             this.Txt_Ndoc.Text  = _LafactureRechercher.NDOC;
         }
     }
 }
コード例 #18
0
        //Recherche des factures sen fonction des critère entré
        private void RemplirfactureProduit(CsRegCli csRegCli, List <string> listperiode, List <int> lstIdProduit)
        {
            //Activation du busy indicator
            allowProgressBar();

            //Grisé certain éléments du formulaire pour bloqué certainnes actions
            ActiverElement(false);

            //Exécution du service web recupération des factures
            Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
            service.RemplirfactureAvecProduitCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                Lstfacture = args.Result;
                if (this.Anciennecamp != null)
                {
                    foreach (var item_ in this.Anciennecamp)
                    {
                        foreach (var item in item_.DETAILCAMPAGNEGC_)
                        {
                            CsLclient facture = new CsLclient();
                            facture.CENTRE       = item.CENTRE;
                            facture.CLIENT       = item.CLIENT;
                            facture.ORDRE        = item.ORDRE;
                            facture.NOM          = item.NOM;
                            facture.REFEM        = item.PERIODE;
                            facture.SOLDEFACTURE = item.MONTANT;
                            facture.NDOC         = item.NDOC;
                            Lstfacture.Add(facture);
                        }
                    }
                }

                System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(Lstfacture);
                LoadDataPager <CsLclient>(Lstfacture, datapager, dg_facture);
                if (dg_facture.ItemsSource != null)
                {
                    this.txt_TotalFacture.Text = Lstfacture.Sum(c => (c.SOLDEFACTURE != null ? c.SOLDEFACTURE : 0)).Value.ToString(SessionObject.FormatMontant);
                }

                btn_Rech.IsEnabled = true;
                desableProgressBar();
                ActiverElement(true);

                return;
            };
            service.RemplirfactureAvecProduitAsync(csRegCli, listperiode, lstIdProduit);
        }
コード例 #19
0
        private void MiseAjourCompt(List <CsDetailPaiementGc> lstDetailPaiement, int Id)
        {
            Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
            service.MiseAjourComptCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                if (args.Result == null)
                {
                    return;
                }
                if (args.Result.Count == 0)
                {
                    return;
                }
                Message.Show("Mise à jour effectuée avec succès", "Resultat");
                Dictionary <string, string> param = new Dictionary <string, string>();
                var lesCompteMaj = args.Result.Select(u => new { u.CENTRE, u.CLIENT, u.ORDRE, u.NOM, u.ACQUIT, u.REFEM, u.NDOC, u.NUMDEVIS, u.NUMDEM }).Distinct();
                List <CsLclient> lesCompteAEditer = new List <CsLclient>();
                int i = 0;
                foreach (var item in lesCompteMaj)
                {
                    CsLclient leC = new CsLclient();
                    leC.CENTRE   = item.CENTRE;
                    leC.CLIENT   = item.CLIENT;
                    leC.ORDRE    = item.ORDRE;
                    leC.REFEM    = item.REFEM;
                    leC.NDOC     = item.NDOC;
                    leC.NOM      = item.NOM;
                    leC.NUMDEM   = item.NUMDEM;
                    leC.NUMDEVIS = item.NUMDEVIS;
                    leC.NUMETAPE = i + 1;
                    leC.ADRESSE  = txt_Campagne.Text;
                    leC.CAPUR    = System.DateTime.Today.ToShortDateString();
                    leC.MONTANT  = args.Result.Where(t => t.CENTRE == item.CENTRE && t.CLIENT == item.CLIENT && t.ORDRE == item.ORDRE && t.REFEM == item.REFEM && t.NDOC == item.NDOC).Sum(t => t.MONTANT);

                    lesCompteAEditer.Add(leC);
                }
                param.Add("pUserMiseAJour", UserConnecte.nomUtilisateur);
                Utility.ActionDirectOrientation <ServicePrintings.CsLclient, ServiceRecouvrement.CsLclient>(lesCompteAEditer, param, SessionObject.CheminImpression, "MiseAJourGrandCompte", "Recouvrement", true);
                this.DialogResult = true;
                //List<int> id = new List<int>();
                //id.Add(Id);
                //EnvoyerDemandeEtapeSuivante(id);
                return;
            };
            service.MiseAjourComptAsync(lstDetailPaiement, Id);
        }
コード例 #20
0
        //private void btn_Rechercher_Click(object sender, RoutedEventArgs e)
        //{
        //    //Utiliser ToutLeCompteClientRecherche pour charger les facture du client
        //    ToutLeCompteClientDeOrientation = new List<CsLclient>();
        //    if (((CsTypeLot)cbo_TypeBatch.SelectedItem).DC=="D")
        //    {
        //        if (ToutLeCompteClientRecherche != null &&
        //            ToutLeCompteClientRecherche.FirstOrDefault(p=>p.CLIENT == this.Txt_Client.Text && p.NDOC == this.Txt_Ordre.Text )!= null )
        //        {
        //            if (ToutLeCompteClientRecherche.Count() > 0)
        //              foreach (var item in ToutLeCompteClientRecherche)
        //                {
        //                    CsLclient facture = new CsLclient();

        //                        //ACQUITANTERIEUR =item.ACQUIT!=null?item.ACQUIT:string.Empty,
        //                        facture.NDOC = !string.IsNullOrWhiteSpace(item.NDOC) ? item.NDOC : string.Empty;
        //                        facture.REFEM = !string.IsNullOrWhiteSpace(item.REFEM) ? item.REFEM : string.Empty;
        //                        facture.COPER = !string.IsNullOrWhiteSpace(item.COPER) ? item.COPER : string.Empty;
        //                        facture.NATURE = !string.IsNullOrWhiteSpace(item.NATURE) ? item.NATURE : string.Empty;
        //                        facture.DATECREATION = item.DATECREATION;
        //                        facture.DC = !string.IsNullOrWhiteSpace(item.DC) ? item.DC : string.Empty;
        //                        facture.MONTANT  = item.MONTANT != null ? item.MONTANT.Value : decimal.MinValue;
        //                        facture.CENTRE = item.CENTRE;
        //                        facture.CLIENT = item.CLIENT;
        //                        facture.ORDRE = item.ORDRE;
        //                    ToutLeCompteClientDeOrientation.Add(facture);
        //                }
        //            if (ToutLeCompteClientDeOrientation != null && ToutLeCompteClientDeOrientation.Count != 0)
        //            {
        //                UcAjustementRecherche Ctrl = new UcAjustementRecherche(ToutLeCompteClientDeOrientation);
        //                Ctrl.Closed += new EventHandler(galatee_OkClicked);
        //                Ctrl.Show();
        //            }
        //        }
        //        else
        //        {
        //            LoadCompteClient(true);
        //        }
        //    }
        //    else
        //    {
        //        if (ToutLeCompteClientRecherche != null)
        //        {
        //            if (ToutLeCompteClientRecherche.Count() > 0)
        //                foreach (var item in ToutLeCompteClientRecherche)
        //                {
        //                    CsLclient facture = new CsLclient();
        //                    facture.NDOC = !string.IsNullOrWhiteSpace(item.NDOC) ? item.NDOC : string.Empty;
        //                    facture.REFEM = !string.IsNullOrWhiteSpace(item.REFEM) ? item.REFEM : string.Empty;
        //                    facture.COPER = !string.IsNullOrWhiteSpace(item.COPER) ? item.COPER : string.Empty;
        //                    facture.NATURE = !string.IsNullOrWhiteSpace(item.NATURE) ? item.NATURE : string.Empty;
        //                    facture.DATECREATION = item.DATECREATION;
        //                    facture.DC = !string.IsNullOrWhiteSpace(item.DC) ? item.DC : string.Empty;
        //                    facture.MONTANT  = item.MONTANT != null ? item.MONTANT.Value : decimal.MinValue;
        //                    facture.CENTRE = item.CENTRE;
        //                    facture.CLIENT = item.CLIENT;
        //                    facture.ORDRE = item.ORDRE;
        //                    ToutLeCompteClientDeOrientation.Add(facture);
        //                }
        //            if (ToutLeCompteClientDeOrientation != null && ToutLeCompteClientDeOrientation.Count != 0)
        //            {
        //                UcAjustementRecherche Ctrl = new UcAjustementRecherche(ToutLeCompteClientDeOrientation);
        //                Ctrl.Closed += new EventHandler(galatee_OkClicked);
        //                Ctrl.Show();
        //            }
        //        }
        //        else
        //        {
        //            LoadCompteClient(true);
        //        }
        //    }

        //}
        void galatee_OkClicked(object sender, EventArgs e)
        {
            UcAjustementRecherche ctrs = sender as UcAjustementRecherche;

            _leClientLot = new CsLclient();
            _leClientLot = ctrs.MyClientDetailLot;
            if (_leClientLot != null)
            {
                this.Txt_Client.Text = _leClientLot.CLIENT;
                this.Txt_Ordre.Text  = _leClientLot.ORDRE;
                this.Txt_refem.Text  = _leClientLot.REFEM;
                this.Txt_Ndoc.Text   = _leClientLot.NDOC;
            }
        }
コード例 #21
0
 public static decimal?RetourneSoldeDocument(CsLclient lstFacture, List <CsLclient> lstReglement)
 {
     try
     {
         decimal?sommeDebit  = lstFacture.MONTANT;
         decimal?sommeCrebit = lstReglement.Sum(t => t.MONTANT);
         decimal?difference  = (sommeDebit - sommeCrebit);
         return(difference);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #22
0
 private void Cbo_ListeRecu_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         leReglementSelect = (CsLclient )this.Cbo_ListeRecu.SelectedItem;
         if (leReglementSelect != null)
         {
             var lesDistinctClient = _LstrefReglement.Where(o => o.ACQUIT == leReglementSelect.ACQUIT).Select(u => new { u.CENTRE, u.CLIENT, u.ORDRE }).Distinct();
             int nbr = 0;
             foreach (var item in lesDistinctClient)
             {
                 nbr++;
                 if (nbr > 1)
                 {
                     Chk_BorderoSeulement.Visibility = System.Windows.Visibility.Visible;
                     break;
                 }
                 else
                 {
                     Chk_BorderoSeulement.Visibility = System.Windows.Visibility.Collapsed;
                 }
             }
             var _lstfacture = (from p in _LstrefReglement
                                where p.ACQUIT == leReglementSelect.ACQUIT
                                group new { p } by new { p.ACQUIT, p.MODEREG } into pResult
                                select new
             {
                 pResult.Key.ACQUIT,
                 MONTANT = (decimal?)pResult.Where(t => t.p.ACQUIT == pResult.Key.ACQUIT).Sum(o => o.p.MONTANT),
                 LIBELLEMODREG = SessionObject.ListeModesReglement.FirstOrDefault(t => t.CODE == pResult.Key.MODEREG).LIBELLE
             }).ToList();
             List <CsLclient> RegltAfficher = new List <CsLclient>();
             foreach (var item in _lstfacture)
             {
                 CsLclient Reglt = new CsLclient();
                 Reglt.LIBELLEMODREG = item.LIBELLEMODREG;
                 Reglt.MONTANT       = item.MONTANT;
                 RegltAfficher.Add(Reglt);
             }
             dtg_FactureAnnule.ItemsSource = null;
             dtg_FactureAnnule.ItemsSource = RegltAfficher;
             this.txtMontantRecuTot.Text   = Convert.ToDecimal(RegltAfficher[0].MONTANT.Value).ToString(SessionObject.FormatMontant);
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex, Langue.errorTitle);
     }
 }
コード例 #23
0
 CsLclient ObtenirFaisChequeImpaye(CsLclient item)
 {
     item.MONTANT                = Labanque.FRAISDERETOUR;
     item.USERCREATION           = UserConnecte.matricule;
     item.DATECREATION           = System.DateTime.Now;
     item.DENR                   = System.DateTime.Now.Date;
     item.TOP1                   = SessionObject.Enumere.TopCheqImpaye;
     item.DC                     = SessionObject.Enumere.Debit;
     item.COPER                  = SessionObject.Enumere.CoperFraisChqImp;
     item.FK_IDCOPER             = SessionObject.LstDesCopers.FirstOrDefault(t => t.CODE == SessionObject.Enumere.CoperFraisChqImp).PK_ID;
     item.FK_IDLIBELLETOP        = SessionObject.LstDesLibelleTop.FirstOrDefault(t => t.CODE == SessionObject.Enumere.TopCheqImpaye).PK_ID;
     item.FK_IDADMUTILISATEUR    = UserConnecte.PK_ID;
     item.FK_IDMOTIFCHEQUEINPAYE = (int)this.Cbo_MotifRejet.Tag;
     return(item);
 }
コード例 #24
0
        private void RemplireDataGrid(List <CsLclient> _LstReglement)
        {
            try
            {
                var _lstfacture = (from p in _LstReglement
                                   group new { p } by new { p.FK_IDHABILITATIONCAISSE, p.NOMCAISSIERE, p.ACQUIT, p.DENR, p.MATRICULE, p.MOTIFANNULATION, p.IsDEMANDEANNULATION, p.CAISSE, p.NUMDEM } into pResult
                                   select new
                {
                    pResult.Key.ACQUIT,
                    pResult.Key.DENR,
                    pResult.Key.MATRICULE,
                    pResult.Key.MOTIFANNULATION,
                    pResult.Key.IsDEMANDEANNULATION,
                    pResult.Key.NOMCAISSIERE,
                    pResult.Key.CAISSE,
                    pResult.Key.FK_IDHABILITATIONCAISSE,
                    pResult.Key.NUMDEM,
                    MONTANT = (decimal?)pResult.Sum(o => o.p.MONTANT)
                }).ToList();

                foreach (var item in _lstfacture)
                {
                    CsUtilisateur leUSer = _ListeDesUtilisateurs.FirstOrDefault(p => p.MATRICULE == item.MATRICULE);

                    CsLclient leReglement = new CsLclient()
                    {
                        //REFFERENCECLIENT = item.REFFERENCECLIENT,
                        ACQUIT = item.ACQUIT,
                        //NOM = item.NOM,
                        DENR                    = item.DENR,
                        NUMDEM                  = item.NUMDEM,
                        MONTANT                 = item.MONTANT,
                        MOTIFANNULATION         = item.MOTIFANNULATION,
                        IsDEMANDEANNULATION     = item.IsDEMANDEANNULATION,
                        MATRICULE               = item.MATRICULE,
                        CAISSE                  = item.CAISSE,
                        FK_IDHABILITATIONCAISSE = item.FK_IDHABILITATIONCAISSE,
                        NOMCAISSIERE            = (leUSer != null) ? (leUSer.LIBELLE + "(" + item.MATRICULE + ")") : item.MATRICULE
                    };
                    ListeDesReglementADupliquer.Add(leReglement);
                }
                dtg_FactureAnnule.ItemsSource = null;
                dtg_FactureAnnule.ItemsSource = ListeDesReglementADupliquer;
            }
            catch (Exception ex)
            {
            }
        }
コード例 #25
0
 void updateViewAfterSelection(CsLclient clientSelected)
 {
     try
     {
         //lblAccount.Content = clientSelected.NumeroCompte;
         //lblCode.Content = clientSelected.CodeBank;
         //lblLibelle.Content = clientSelected.LibelleBank;
         lblNomabn.Content = clientSelected.NOM;
         lblRef.Content    = clientSelected.CENTRE + " " + clientSelected.CLIENT + " " + clientSelected.ORDRE;
         //lblCode.Content = clientSelected.CodeBank;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #26
0
 private void btnOk_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (lvwResultat.ItemsSource != null)
         {
             CsLclient lstClientSelect = new CsLclient();
             lstClientSelect = lvwResultat.SelectedItem as CsLclient;
             ValiderAutorisationFrais(lstClientSelect);
         }
     }
     catch (Exception ex)
     {
         Message.ShowError(ex, Galatee.Silverlight.Resources.Langue.errorTitle);
     }
 }
コード例 #27
0
        private void Remplirfacture(CsRegCli csRegCli, List <string> listperiode)
        {
            allowProgressBar();
            ActiverElement(false);
            Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient service = new Galatee.Silverlight.ServiceRecouvrement.RecouvrementServiceClient(Utility.ProtocoleFacturation(), Utility.EndPoint("Recouvrement"));
            service.RemplirfactureCompleted += (s, args) =>
            {
                if (args != null && args.Cancelled)
                {
                    return;
                }
                Lstfacture = args.Result;
                if (this.Anciennecamp != null)
                {
                    foreach (var item_ in this.Anciennecamp)
                    {
                        foreach (var item in item_.DETAILCAMPAGNEGC_)
                        {
                            CsLclient facture = new CsLclient();
                            facture.CENTRE       = item.CENTRE;
                            facture.CLIENT       = item.CLIENT;
                            facture.ORDRE        = item.ORDRE;
                            facture.NOM          = item.NOM;
                            facture.REFEM        = item.PERIODE;
                            facture.SOLDEFACTURE = item.MONTANT;
                            facture.NDOC         = item.NDOC;
                            Lstfacture.Add(facture);
                        }
                    }
                }

                System.Windows.Data.PagedCollectionView view = new System.Windows.Data.PagedCollectionView(Lstfacture);
                LoadDataPager <CsLclient>(Lstfacture, datapager, dg_facture);
                if (dg_facture.ItemsSource != null)
                {
                    this.txt_TotalFacture.Text = Lstfacture.Sum(t => t.SOLDEFACTURE).Value.ToString(SessionObject.FormatMontant);
                }

                btn_Rech.IsEnabled = true;
                desableProgressBar();
                ActiverElement(true);

                return;
            };
            service.RemplirfactureAsync(csRegCli, listperiode);
        }
コード例 #28
0
        private List <CsLclient> RetourneCsLclientFromCsMoratoire(List <CsDetailMoratoire> DetailMor)
        {
            List <CsLclient> _lstAEditer = new List <CsLclient>();

            foreach (CsDetailMoratoire m in DetailMor)
            {
                CsLclient cmpte = new CsLclient();

                cmpte.CRET          = m.CRET;
                cmpte.DATEVALEUR    = m.DATEVALEUR;
                cmpte.DC            = m.DC;
                cmpte.EXIGIBILITE   = m.EXIGIBILITE;
                cmpte.CENTRE        = m.CENTRE;
                cmpte.CLIENT        = m.CLIENT;
                cmpte.COPER         = m.COPER;
                cmpte.NATURE        = m.NATURE;
                cmpte.ORDRE         = m.ORDRE;
                cmpte.NDOC          = m.NDOC;
                cmpte.TOP1          = m.TOP1;
                cmpte.FRAISDERETARD = m.FRAISDERETARD;
                cmpte.MOISCOMPT     = m.MOISCOMPT;
                cmpte.MONTANT       = m.MONTANT;

                cmpte.REFEM     = m.REFEM;
                cmpte.MATRICULE = m.MATRICULE;

                cmpte.USERCREATION = m.USERCREATION;
                cmpte.DATECREATION = m.DATECREATION;
                cmpte.CAISSE       = m.CAISSE;
                cmpte.MODEREG      = m.MODEREG;
                cmpte.USERCREATION = m.MATRICULE;
                cmpte.DATECREATION = m.DATECREATION;
                cmpte.FK_IDCLIENT  = m.FK_IDCLIENT;

                // valorisation des propriétés foreign key

                cmpte.FK_IDCENTRE         = m.FK_IDCENTRE;
                cmpte.FK_IDCOPER          = m.FK_IDCOPER;
                cmpte.FK_IDLIBELLETOP     = m.FK_IDLIBELLETOP;
                cmpte.FK_IDNATURE         = m.FK_IDNATURE;
                cmpte.FK_IDADMUTILISATEUR = m.FK_IDADMUTILISATEUR;

                _lstAEditer.Add(cmpte);
            }
            return(_lstAEditer);
        }
コード例 #29
0
 private void btn_Ajouter_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         CsLclient leReglementSelect = (CsLclient)dtg_FactureAAnnule.SelectedItem;
         if (leReglementSelect != null)
         {
             FrmMotifAction ctrl = new FrmMotifAction(_LstrefReglement.Where(t => t.ACQUIT == leReglementSelect.ACQUIT).ToList());
             ctrl.Closed += new EventHandler(galatee_OkClickedRaisonAnnulation);
             ctrl.Show();
         }
     }
     catch (Exception ex)
     {
         Message.Show(ex.Message, Langue.LibelleModule);
     }
 }
コード例 #30
0
        void frm_CallBack(object sender, Tarification.Helper.CustumEventArgs e)
        {
            AjouterPeriodeAListe();

            FrmCampagne Frm = (FrmCampagne)sender;

            //Implementer le callback
            if (e.Bag != null)
            {
                if (!Frm.Arefaire)
                {
                    var camp = (CsCampagneGc)e.Bag;
                    if (Anciennecamp.FirstOrDefault(c => c.PK_ID == camp.PK_ID) != null)
                    {
                        this.Anciennecamp.Remove(camp);
                    }
                    //List<string> listperiode=new List<string>();

                    List <CsLclient> dataSource = new List <CsLclient>();
                    foreach (var item in camp.DETAILCAMPAGNEGC_)
                    {
                        CsLclient facture = new CsLclient();
                        facture.CENTRE       = item.CENTRE;
                        facture.CLIENT       = item.CLIENT;
                        facture.ORDRE        = item.ORDRE;
                        facture.FK_IDCLIENT  = item.FK_IDCLIENT;
                        facture.FK_IDLCLIENT = item.FK_IDLCLIENT;
                        facture.NOM          = item.NOM;
                        facture.REFEM        = item.PERIODE;
                        facture.MONTANT      = item.MONTANT;
                        facture.NDOC         = item.NDOC;
                        dataSource.Add(facture);
                    }
                    //dg_facture_Copy.ItemsSource = dataSource;
                    LoadDataPager <CsLclient>(dataSource, datapager_Copy, dg_facture_Copy);
                }
                else
                {
                    this.Anciennecamp.Add((CsCampagneGc)e.Bag);
                }
            }
            else
            {
                txt_periode.Text = string.Empty;
            }
        }