Exemplo n.º 1
0
 public ContaBancaria(EmpresaFilial filial, string codigoContaBancaria, string descricaoContaBancaria,
                      decimal saldoInicial, DateTime dataAbertura) :
     base(codigoContaBancaria, descricaoContaBancaria, saldoInicial, dataAbertura)
 {
     //this.Matriz = matriz;
     this.IdFilial = filial.IdFilial;
 }
Exemplo n.º 2
0
        //Movimento nao fiscal
        public Movimento(
            CliFor cliForn, EmpresaFilial filialNf,
            TypeDirecao direcaoMov, string numNF, DateTime dtEmissaoNf, DateTime dtEntradaNf,
            decimal valorFrete, decimal valorDesconto, decimal valorBaseICMS,
            decimal valorICMS, decimal valorBaseICMSST, decimal valorICMSST, decimal valorSeguro,
            decimal valorDespesas, decimal valorTotalProdutos, decimal totalNF, string serie, string subserie)
        {
            ItensMovimento = new HashSet <ItemMovimento>();
            this.Parcelas  = new HashSet <LancamentoFinanceiro>();

            if (cliForn != null)
            {
                this.IdCliFor = cliForn.IdCliFor;
            }

            this.IdFilial                = filialNf.IdFilial;
            this.DirecaoMovimento        = direcaoMov;
            this.NumeroMovimento         = numNF;
            this.DataEmissao             = dtEmissaoNf;
            this.DataEntrada             = dtEntradaNf;
            this.ValorFrete              = valorFrete;
            this.ValorDesconto           = valorDesconto;
            this.ValorBaseICMS           = valorBaseICMS;
            this.ValorICMS               = valorICMS;
            this.ValorBaseICMSST         = valorBaseICMSST;
            this.ValorICMSST             = valorICMSST;
            this.ValorSeguro             = valorSeguro;
            this.ValorDespesasAcessorias = valorDespesas;
            this.TotalProdutos           = valorTotalProdutos;
            this.TotalMovimento          = totalNF;
            this.Serie    = serie;
            this.SubSerie = subserie;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Indexar a filial para adicionar.
        /// </summary>
        /// <returns></returns>
        public EmpresaFilial indexarDados()
        {
            EmpresaFilial novo = new EmpresaFilial();

            if (lkpMatriz.EditValue != null)
            {
                var matriz = lkpMatriz.GetSelectedDataRow() as EmpresaMatriz;

                var cnpj = txtCnpj.Text;
                cnpj = cnpj.Replace(".", "");
                cnpj = cnpj.Replace("-", "");
                cnpj = cnpj.Replace("/", "");

                novo = new EmpresaFilial(txtRazSocial.Text, txtNomeFantasia.Text, cnpj, txtInsEst.Text,
                                         dtRegistroJunta.DateTime, DateTime.Now, txtTelefone.Text, txtFax.Text, txtEmail.Text, txtCodFilial.Text);

                novo.Telefone = txtTelefone.Text;
                novo.Fax      = txtFax.Text;
                novo.IdMatriz = matriz.IdMatriz;

                if (dtRegistroJunta.DateTime.ValidateDate() == null)
                {
                    novo.DtRegtroJuntaCom = null;
                }

                var endereco = new Endereco(txtEndereco.Text, txtNumEndereco.Text, txtBairro.Text,
                                            txtComplemento.Text, cepControl1.TextCep.Text, lookUpMunicipio1.UF, lookUpMunicipio1.Municipio, "Comercial");

                novo.SetEndereco(endereco);
            }

            return(novo);
        }
Exemplo n.º 4
0
        private void btnSalvar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            EmpresaFilial novo = indexarDados();

            if (ValidadorDTO.ValidateWarningAll(novo))
            {
                using (var ctx = new BalcaoContext())
                {
                    if (_filialAnt == null)
                    {
                        if (ctx.EmpresaFilialDao.Save(novo))

                        {
                            XMessageIts.Mensagem("Filial cadastrada com sucesso!");
                            this.Dispose();
                        }
                    }
                    else
                    {
                        var fUpdate = ctx.EmpresaFilialDao.Find(_filialAnt.IdFilial);
                        fUpdate.Update(novo);
                        if (ctx.EmpresaFilialDao.Update(fUpdate))
                        {
                            this._filialAnt.Update(fUpdate);
                            XMessageIts.Mensagem("Filial atualizada com sucesso!");
                            this.Dispose();
                        }
                    }
                }
            }
        }
Exemplo n.º 5
0
        public XFrmWizardFinancRH(CompetenciaFolha competencia, Usuario usuario, EmpresaFilial filial, bool reprocessamento = false) : this()
        {
            this.competencia     = competencia;
            this.usuario         = usuario;
            this.reprocessamento = reprocessamento;

            init(filial);
        }
Exemplo n.º 6
0
        private EmpresaFilial indexarFormulario(EmpresaFilial f)
        {
            //this.btnCopyData.Visibility = BarItemVisibility.Never;
            if (f != null)
            {
                lkpMatriz.EditValue = f.Matriz;
                if (f.Matriz != null)
                {
                    lkpMatriz.Text = f.Matriz.ToString();
                }
                txtCodFilial.Text    = f.CodigoFilial;
                txtRazSocial.Text    = f.RazaoSocial;
                txtNomeFantasia.Text = f.NomeFantasia;
                txtCnpj.Text         = StringUtilIts.ToCpfCnpj(f.Cnpj);
                if (f.DtRegtroJuntaCom.HasValue)
                {
                    dtRegistroJunta.DateTime = f.DtRegtroJuntaCom.Value.Date;
                }

                cepControl1.TextCep.Text = f.Cep;

                lookUpMunicipio1.SetMunicipioUF(f.Cidade, f.Uf);

                lookUpMunicipio1.Refresh();
                lookUpMunicipio1.Update();


                txtEndereco.Text         = f.NomeEndereco;
                txtNumEndereco.Text      = f.NumeroEndereco;
                txtComplemento.Text      = f.Complemento;
                txtBairro.Text           = f.Bairro;
                cepControl1.TextCep.Text = f.Cep;

                if (!string.IsNullOrEmpty(f.Telefone))
                {
                    var tel = f.Telefone.Split('/');
                    if (tel.Length > 0)
                    {
                        this.txtTelefone.Text = tel[0];

                        if (tel.Length > 1)
                        {
                            this.txtTelefone.Text = tel[1];
                        }
                    }
                }


                txtFax.Text     = f.Fax;
                txtInsEst.Text  = f.InscricaoEstadual;
                txtSuframa.Text = f.InscricaoSuframa;
                txtEmail.Text   = f.Email;
            }
            return(f);
        }
Exemplo n.º 7
0
        public XFrmSetMatrizFilial(EmpresaFilial f = null, FormTypeAction action = FormTypeAction.Selecionar)
        {
            InitializeComponent();
            this._action = action;

            if (f != null)
            {
                this.lookUpMatrizFilial1.Matriz = f.Matriz;
                this.lookUpMatrizFilial1.Filial = f;
            }
            this.IsInvoke = true;
        }
Exemplo n.º 8
0
        //Criacao de nota fiscal
        public XFrmNotaFiscal(Usuario currentUser, TypeFiltroMovimento typeFiltroMovimento, EmpresaFilial filialCurrent) : this()
        {
            this.currentUser         = currentUser;
            this.typeFiltroMovimento = typeFiltroMovimento;
            this.lookUpTipoMovimento1.TypeFiltroMovimento = typeFiltroMovimento;
            this.filialCurrent = filialCurrent;
            btnEditNF.Visible  = false;
            btnSalvar.Enabled  = true;

            //se for um movimento novo defina a filial do contexto.
            if (capa == null)
            {
                lookUpMatrizFilial1.FindSetMatrizFilial(filialCurrent.Matriz, filialCurrent);
            }
        }
Exemplo n.º 9
0
        //criptografa os dados do arquivo
        private void Criptografar(EmpresaMatriz matriz, EmpresaFilial filial, bool flag)
        {
            string codMat    = ASCIIEncodingIts.Coded(matriz.CodigoMatriz);
            string codFilial = ASCIIEncodingIts.Coded(filial.CodigoFilial);
            string idUser    = ASCIIEncodingIts.Coded("" + UnitWork.Usuario.IdUsuario);

            if (flag)
            {
                FileManagerIts.OverWriteOnFile(UnitWork.PREFERENCIAS,
                                               new string[] { codMat, codFilial, "true", idUser, });
            }
            else
            {
                FileManagerIts.OverWriteOnFile(UnitWork.PREFERENCIAS,
                                               new string[] { codMat, codFilial, });
            }
        }
Exemplo n.º 10
0
        public XFrmGerenciarMovimento(Usuario currentUser, TypeFiltroMovimento typeFiltroMovimento, EmpresaFilial filialCurrent)
        {
            InitializeComponent();
            this.currentUser         = currentUser;
            this.typeFiltroMovimento = typeFiltroMovimento;
            this.filialCurrent       = filialCurrent;
            this._gridFocusUtil      = new FocusRowChangedEvent(gridViewEntradas);

            if (typeFiltroMovimento == TypeFiltroMovimento.Entradas)
            {
                this.Text = "Movimentos de compras/entradas";
            }
            else if (typeFiltroMovimento == TypeFiltroMovimento.Saidas)
            {
                this.Text = "Movimentos de saídas/faturamento";
            }
            else
            {
                this.Text = "Movimentos de transferências/estoque";
            }

            indexarMultiSelCombo();
        }
Exemplo n.º 11
0
        private void init(EmpresaFilial filial)
        {
            try
            {
                lookUpFilial1.FindSetFilial(filial);

                if (reprocessamento)
                {
                    welcomeWizardPageRHFinanc.Text             = "Geração de lançamentos financeiros";
                    welcomeWizardPageRHFinanc.IntroductionText = "Este assistente irá guia-lo até a geração completa dos lançamentos financeiros da competência escolhida.";
                    chkGerarFinanceiro.Visible = false;
                }

                int idCentroCustoRH = ParseUtil.ToInt(ParametroManager
                                                      .FindParamByTypeParametro(TypeParametro.centro_custo_folha)
                                                      .ValorParametro);

                lookUpCentroCusto1.FindSetCentroCusto(idCentroCustoRH.ToString());

                int idCliForRH = ParseUtil.ToInt(ParametroManager
                                                 .FindParamByTypeParametro(TypeParametro.clifor_folha)
                                                 .ValorParametro);

                lookUpCliFor1.FindSetCliFor(idCliForRH.ToString());

                if (lookUpCliFor1.CliFor == null && lookUpCentroCusto1.CentroCusto == null)
                {
                    lookUpCentroCusto1.Enabled = true;
                    lookUpCliFor1.Enabled      = true;
                }
            }
            catch (Exception ex)
            {
                XMessageIts.ExceptionMessage(ex);
            }
        }
Exemplo n.º 12
0
        internal void ManagerNFs(Usuario currentUser, TypeFiltroMovimento typeFiltroMovimento, EmpresaFilial filial)
        {
            //tava chamando apenas uma tela
            //chamava a outra tela so se a outra nao existisse
            if (typeFiltroMovimento == TypeFiltroMovimento.Entradas)
            {
                if (FormsUtil.isFormDisposedOrNull(_xFrmGerenciarNfEntradas))
                {
                    this._xFrmGerenciarNfEntradas = new XFrmGerenciarMovimento(currentUser, typeFiltroMovimento, filial);
                }

                FormsUtil.Show(_xFrmGerenciarNfEntradas, this._menu);
            }

            if (typeFiltroMovimento == TypeFiltroMovimento.Saidas)
            {
                if (FormsUtil.isFormDisposedOrNull(_xFrmGerenciarNfSaidas))
                {
                    this._xFrmGerenciarNfSaidas = new XFrmGerenciarMovimento(currentUser, typeFiltroMovimento, filial);
                }
                FormsUtil.Show(_xFrmGerenciarNfSaidas, this._menu);
            }
            if (typeFiltroMovimento == TypeFiltroMovimento.Estoque)
            {
                if (FormsUtil.isFormDisposedOrNull(_xFrmGerenciarEstoque))
                {
                    this._xFrmGerenciarEstoque = new XFrmGerenciarMovimento(currentUser, typeFiltroMovimento, filial);
                }
                FormsUtil.Show(_xFrmGerenciarEstoque, this._menu);
            }
        }
Exemplo n.º 13
0
 public void FindSetFilial(EmpresaFilial filial)
 {
     FindSetFilial(filial.CodigoFilial);
 }
Exemplo n.º 14
0
 public XFrmFilialView(EmpresaFilial filial) : this()
 {
     this._filialAnt = indexarFormulario(filial);
 }
Exemplo n.º 15
0
 public XFrmViewCompetencias(Usuario userLogado, EmpresaFilial filial) : this()
 {
     this.userLogado    = userLogado;
     this.filialCurrent = filial;
 }
Exemplo n.º 16
0
 public void FindSetMatrizFilial(EmpresaMatriz matriz, EmpresaFilial filial)
 {
     FindSetMatriz(matriz.CodigoMatriz);
     FindSetFilial(filial.CodigoFilial);
 }