예제 #1
0
 /// <summary>
 /// Modify this._Saldo property to new accounting balance given that apunte have not been changed yet.
 /// nuevoDebeHaber es diferente que apunte.DebeHaber.
 /// </summary>
 /// <param name="apunte"></param>
 /// <param name="oldamount"></param>
 public void CambiaSaldo(Apunte apunte, DebitCredit nuevoDebeHaber)
 {
     //nuevo saldo = saldo - (debehaber * importe * 2) => debehaber -1 si haber y +1 si debe
     this._Saldo -= (((int)nuevoDebeHaber) * apunte.Importe * 2);
     //if (apunte.DebeHaber == DebitCredit.Debit) _Saldo = _Saldo - (apunte.Importe * 2);
     //else _Saldo = _Saldo + (apunte.Importe * 2);
 }
예제 #2
0
 public static ExpectedSwiftTransaction CreateExpected(DateTime valueDate, DebitCredit debitCredit, string fundsCode,
                                                       string currencyCode, decimal amount, string transactionType, string reference, string description, string supplementaryDetails,
                                                       string servicingReference = "")
 {
     return(new ExpectedSwiftTransaction
     {
         DebitCredit = debitCredit,
         Amount = amount,
         CurrencyCode = currencyCode,
         Description = description,
         ValueDate = valueDate,
         FundsCode = fundsCode,
         Reference = reference,
         TransactionType = transactionType,
         SupplementaryDetails = supplementaryDetails,
         AccountServicingReference = servicingReference
     });
 }
예제 #3
0
        private void BtnDepense_Click(object sender, EventArgs e)
        {
            DebitCredit frmDebitCredit = new DebitCredit();

            string[] cats = GestionDB.GetCategories("Débit"); // Récupère toute les catégories

            foreach (string name in cats)
            {
                frmDebitCredit.CbxCategorie.Items.Add(name); // Ajoute les catégorie dans la combobox
            }
            frmDebitCredit.CbxCategorie.SelectedIndex = 0;
            frmDebitCredit.Type = "Débit";

            DialogResult dr = frmDebitCredit.ShowDialog();

            if (dr == DialogResult.OK)
            {
                int idCat = GestionDB.GetIdCategorie(frmDebitCredit.Categorie);                                        // Récupère l'id de la catégorie
                GestionDB.AddTransaction(frmDebitCredit.Motif, frmDebitCredit.Montant, idCat, 1, frmDebitCredit.Type); // Ajoute la transaction
                this.UpdateAffichage();
            }
        }
예제 #4
0
 public ApunteDLO(
     int id,
     int idCdad,
     int ordenEnAsiento,
     int codigoAsiento,
     string concepto,
     DebitCredit debeHaber,
     decimal importe,
     string cuenta,
     bool punteo,
     string factura)
 {
     this.Id = id;
     this.IdOwnerComunidad = idCdad;
     this.OrdenEnAsiento   = ordenEnAsiento;
     this.CodigoAsiento    = codigoAsiento;
     this.Concepto         = concepto;
     this.DebeHaber        = debeHaber;
     this.Importe          = importe;
     this.Cuenta           = cuenta;
     this.Punteo           = punteo;
     this.Factura          = factura;
 }
예제 #5
0
 public static DomainTypes.DebitCredit ToDomainType(this DebitCredit type)
 {
     return(ForwardDictionary.Value[type]);
 }
예제 #6
0
 /// <summary>
 /// Saldo al debe o al haber del asiento.
 /// </summary>
 /// <param name="target"></param>
 /// <returns></returns>
 public decimal GetSaldoAl(DebitCredit target)
 {
     return(GetSaldoDe(GetApuntesAl(target)));
 }
예제 #7
0
        /// <summary>
        /// Get all apuntes on specified debit/credit.
        /// </summary>
        /// <param name="target"></param>
        /// <returns></returns>
        public List <Apunte> GetApuntesAl(DebitCredit target)
        {
            List <Apunte> result = this.Apuntes.Where(apunte => apunte.DebeHaber == target).ToList();

            return(result);
        }
예제 #8
0
 /// <summary>
 /// Modify this._Saldo property to new accounting balance given that apunte have not been changed yet.
 /// nuevoDebeHaber es diferente que apunte.DebeHaber.
 /// nuevoImporte es diferente que apunte.Importe.
 /// </summary>
 /// <param name="apunte"></param>
 /// <param name="nuevoImporte"></param>
 /// <param name="nuevoDebeHaber"></param>
 public void CambiaSaldo(Apunte apunte, decimal nuevoImporte, DebitCredit nuevoDebeHaber)
 {
     //nuevo saldo = saldo - (Viejodebehaber * viejo importe) - (Viejodebehaber * nuevo importe) = saldo - Viejodebehaber(viejo importe + nuevo importe)
     this._Saldo += (((int)nuevoDebeHaber) * (apunte.Importe + nuevoImporte));
 }
예제 #9
0
        public Apunte(int id, int idComunidad, Asiento asiento, string FacturaId, int ordenEnAsiento, DebitCredit debeHaber, decimal importe,
                      string concepto, CuentaMayor cuenta, bool punteo)
        {
            this._Id = id;
            this._IdOwnerComunidad = idComunidad;
            this._Asiento          = asiento;
            this._Factura          = FacturaId;
            this._OrdenEnAsiento   = ordenEnAsiento;
            this._DebeHaber        = debeHaber;
            this._Importe          = importe;
            this.Concepto          = concepto;
            this.Cuenta            = cuenta;
            this.Punteo            = punteo;

            InitModifiedProperties();
        }
예제 #10
0
        public void CambiaImporteAl(DebitCredit debeHaber, decimal nuevoImporte)
        {
            if (debeHaber == DebitCredit.Debit)
            {
                if (!this._Asiento.Abierto)
                {
                    throw new CustomException_ObjModels(
                              $"Error cambiando Importe de apunte numero {Id} de asiento numero {Asiento.Id}. Asiento cerrado.");
                }

                if (this.DebeHaber != DebitCredit.Debit)
                {
                    this._Asiento.CambiaSaldo(this, nuevoImporte, DebitCredit.Debit);

                    this._DebeHaber = DebitCredit.Debit;
                    if (this.IsBeingModifiedFromView)
                    {
                        this.DirtyMembers.Add("DebeHaber");
                    }
                }
                else
                {
                    this._Asiento.CambiaSaldo(this, nuevoImporte);
                }

                this._Importe = nuevoImporte;
                if (this.IsBeingModifiedFromView)
                {
                    this.DirtyMembers.Add("Importe");
                    this.HasBeenModifiedFromView = true;
                }
            }
            else
            {
                if (!this._Asiento.Abierto)
                {
                    throw new CustomException_ObjModels(
                              $"Error cambiando Importe de apunte numero {Id} de asiento numero {Asiento.Id}. Asiento cerrado.");
                }

                if (this.DebeHaber != DebitCredit.Credit)
                {
                    this._Asiento.CambiaSaldo(this, nuevoImporte, DebitCredit.Credit);

                    this._DebeHaber = DebitCredit.Credit;
                    if (this.IsBeingModifiedFromView)
                    {
                        this.DirtyMembers.Add("DebeHaber");
                    }
                }
                else
                {
                    this._Asiento.CambiaSaldo(this, nuevoImporte);
                }

                this._Importe = nuevoImporte;
                if (this.IsBeingModifiedFromView)
                {
                    this.DirtyMembers.Add("Importe");
                    this.HasBeenModifiedFromView = true;
                }
            }
        }