summaryrefslogtreecommitdiff
path: root/Codemerx/Gestor.Model/Model.Domain.Ferramentas/Imposto.cs
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:38:18 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:38:18 +0000
commit1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (patch)
treee1c3b20ea08f0cf71122a1e73f0d395f8fd83874 /Codemerx/Gestor.Model/Model.Domain.Ferramentas/Imposto.cs
parent674ca83ba9243a9e95a7568c797668dab6aee26a (diff)
downloadgestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz
gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip
chore: location
Diffstat (limited to 'Codemerx/Gestor.Model/Model.Domain.Ferramentas/Imposto.cs')
-rw-r--r--Codemerx/Gestor.Model/Model.Domain.Ferramentas/Imposto.cs177
1 files changed, 177 insertions, 0 deletions
diff --git a/Codemerx/Gestor.Model/Model.Domain.Ferramentas/Imposto.cs b/Codemerx/Gestor.Model/Model.Domain.Ferramentas/Imposto.cs
new file mode 100644
index 0000000..7a65e49
--- /dev/null
+++ b/Codemerx/Gestor.Model/Model.Domain.Ferramentas/Imposto.cs
@@ -0,0 +1,177 @@
+using Gestor.Model.Domain.Generic;
+using Gestor.Model.Domain.Seguros;
+using Gestor.Model.Helper;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Ferramentas
+{
+ public class Imposto : DomainBase, IDomain
+ {
+ public bool Ativo
+ {
+ get;
+ set;
+ }
+
+ public decimal Desconto
+ {
+ get;
+ set;
+ }
+
+ public decimal Ir
+ {
+ get;
+ set;
+ }
+
+ public decimal Iss
+ {
+ get;
+ set;
+ }
+
+ public decimal Outros
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Seguros.Ramo Ramo
+ {
+ get;
+ set;
+ }
+
+ public Gestor.Model.Domain.Seguros.Seguradora Seguradora
+ {
+ get;
+ set;
+ }
+
+ [JsonIgnore]
+ public Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get
+ {
+ Imposto imposto = this;
+ return new Func<List<KeyValuePair<string, string>>>(imposto.Validate);
+ }
+ }
+
+ public Imposto()
+ {
+ }
+
+ public List<TupleList> Log()
+ {
+ object nome;
+ object nomeSocial;
+ List<TupleList> tupleLists = new List<TupleList>();
+ TupleList tupleList = new TupleList();
+ ObservableCollection<Tuple<string, string, string>> observableCollection = new ObservableCollection<Tuple<string, string, string>>();
+ Gestor.Model.Domain.Seguros.Ramo ramo = this.Ramo;
+ if (ramo != null)
+ {
+ nome = ramo.Nome;
+ }
+ else
+ {
+ nome = null;
+ }
+ if (nome == null)
+ {
+ nome = "";
+ }
+ observableCollection.Add(new Tuple<string, string, string>("RAMO", nome, ""));
+ Gestor.Model.Domain.Seguros.Seguradora seguradora = this.Seguradora;
+ if (seguradora != null)
+ {
+ nomeSocial = seguradora.NomeSocial;
+ }
+ else
+ {
+ nomeSocial = null;
+ }
+ if (nomeSocial == null)
+ {
+ Gestor.Model.Domain.Seguros.Seguradora seguradora1 = this.Seguradora;
+ if (seguradora1 != null)
+ {
+ nomeSocial = seguradora1.Nome;
+ }
+ else
+ {
+ nomeSocial = null;
+ }
+ if (nomeSocial == null)
+ {
+ nomeSocial = "";
+ }
+ }
+ observableCollection.Add(new Tuple<string, string, string>("SEGURADORA", nomeSocial, ""));
+ decimal ir = this.Ir;
+ observableCollection.Add(new Tuple<string, string, string>("IR", ir.ToString("p"), ""));
+ ir = this.Iss;
+ observableCollection.Add(new Tuple<string, string, string>("ISS", ir.ToString("p"), ""));
+ ir = this.Outros;
+ observableCollection.Add(new Tuple<string, string, string>("OUTROS", ir.ToString("p"), ""));
+ ir = this.Desconto;
+ observableCollection.Add(new Tuple<string, string, string>("DESCONTO", ir.ToString("p"), ""));
+ observableCollection.Add(new Tuple<string, string, string>("ATIVO", (this.Ativo ? "SIM" : "NÃO"), ""));
+ tupleList.Tuples = observableCollection;
+ tupleLists.Add(tupleList);
+ return tupleLists;
+ }
+
+ public List<KeyValuePair<string, string>> Validate()
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (this.Ir > decimal.One)
+ {
+ keyValuePairs.AddValue<string, string>("Ir|PORCENTAGEM IR", "O VALOR DE IR NÃO PODE SER MAIOR QUE 100%.", true);
+ }
+ if (this.Iss > decimal.One)
+ {
+ keyValuePairs.AddValue<string, string>("Iss|PORCENTAGEM ISS", "O VALOR DE ISS NÃO PODE SER MAIOR QUE 100%.", true);
+ }
+ if (this.Outros > decimal.One)
+ {
+ keyValuePairs.AddValue<string, string>("Outros|PORCENTAGEM OUTROS", "O VALOR DOS OUTROS DESCONTOS NÃO PODE SER MAIOR QUE 100%.", true);
+ }
+ if (this.Desconto > decimal.One)
+ {
+ keyValuePairs.AddValue<string, string>("Desconto|PORCENTAGEM DESCONTO", "O VALOR DE DESCONTO NÃO PODE SER MAIOR QUE 100%.", true);
+ }
+ if (this.Ir < decimal.Zero)
+ {
+ keyValuePairs.AddValue<string, string>("Ir|PORCENTAGEM IR", "O VALOR DE IR NÃO PODE SER MENOR QUE 0%.", true);
+ }
+ if (this.Iss < decimal.Zero)
+ {
+ keyValuePairs.AddValue<string, string>("Iss|PORCENTAGEM ISS", "O VALOR DE ISS NÃO PODE SER MENOR QUE 0%.", true);
+ }
+ if (this.Outros < decimal.Zero)
+ {
+ keyValuePairs.AddValue<string, string>("Outros|PORCENTAGEM OUTROS", "O VALOR DOS OUTROS DESCONTOS NÃO PODE SER MENOR QUE 0%.", true);
+ }
+ if (this.Desconto < decimal.Zero)
+ {
+ keyValuePairs.AddValue<string, string>("Desconto|PORCENTAGEM DESCONTO", "O VALOR DE DESCONTO NÃO PODE SER MENOR QUE 0%.", true);
+ }
+ if ((((this.Ir + this.Iss) + this.Outros) + this.Desconto) > decimal.One)
+ {
+ keyValuePairs.AddValue<string, string>("Ir|PORCENTAGEM TOTAL", "NÃO É POSSÍVEL DEDUZIR MAIS QUE 100% DO TOTAL RECEBIDO.", true);
+ }
+ if ((((this.Ir + this.Iss) + this.Outros) + this.Desconto) == decimal.Zero)
+ {
+ keyValuePairs.AddValue<string, string>("Ir|PORCENTAGEM TOTAL", "A SOMA DOS IMPOSTOS DEVEM SER MAIOR QUE 0 (ZERO).", true);
+ }
+ return keyValuePairs;
+ }
+ }
+} \ No newline at end of file