- Adicionado ContratoEquipamentosCadastroPanel - Adicionado ConfigBoletosCadastroPanel (Gestão de convênios) - Adicionado ConfigCartoesCadastroPanel (Taxas e operadoras) - Adicionado ConfigImpressaoCadastroPanel (Coordenadas X/Y) - Adicionado DespesasCadastroPanel e DespFixaCadastroPanel - Adicionado ConfigEcfCadastroPanel (Hardware Fiscal) - Adicionado EmpresaCadastroPanel (Emitente e Web3/Crypto) - Adicionado EquipamentosCadastroPanel (Ativos e Garantia) - Adicionado EsquemasTecnicosCadastroPanel (Biblioteca de Manuais) - Adicionado FluxoCaixaCadastroPanel (Tesouraria) - Adicionado FornecedorItemVinculoPanel (Logística de Suprimentos) Padronização de interface utilizando FormularioModelo e LV_TEXTBOX1."
131 lines
5.5 KiB
C#
131 lines
5.5 KiB
C#
using CPM;
|
|
using MLL;
|
|
using System;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
using UI;
|
|
|
|
namespace UI
|
|
{
|
|
public partial class ContasCadastroPanel : FormularioModelo
|
|
{
|
|
private ModeloContas _conta = new ModeloContas();
|
|
|
|
// Controles - Cabeçalho e Tipo
|
|
private LV_TEXTBOX1 txtId, txtCodigo, txtTipo, txtPlanoContas, txtReferencia;
|
|
|
|
// Controles - Entidades (Lupa)
|
|
private LV_TEXTBOX1 txtCodCliente, txtNomeCliente, txtCodFornecedor, txtNomeFornecedor;
|
|
private Button btnBuscaCliente, btnBuscaFornecedor;
|
|
|
|
// Controles - Financeiro
|
|
private LV_TEXTBOX1 txtValor, txtVencimento, txtDataPgto, txtJuros, txtDesconto, txtParcela, txtFormaCobranca;
|
|
private CheckBox chkPago;
|
|
|
|
// Controles - Fiscais/Extras
|
|
private LV_TEXTBOX1 txtCfop, txtObservacao;
|
|
|
|
public ContasCadastroPanel()
|
|
{
|
|
this.Titulo = "Lançamentos Financeiros (Pagar/Receber)";
|
|
MontarInterface();
|
|
}
|
|
|
|
private void MontarInterface()
|
|
{
|
|
// --- SEÇÃO 1: Dados Básicos do Título ---
|
|
content.Controls.Add(CreateSectionHeader("IDENTIFICAÇÃO DO TÍTULO", 20));
|
|
|
|
txtId = AddInput(content, "ID", 20, 50, 70, 30, true);
|
|
txtCodigo = AddInput(content, "Nº DOCUMENTO", 100, 50, 130, 30);
|
|
|
|
// Aqui você pode trocar para um ComboBox se desejar fixar "Pagar/Receber"
|
|
txtTipo = AddInput(content, "TIPO (P/R)", 240, 50, 100, 30);
|
|
txtPlanoContas = AddInput(content, "PLANO DE CONTAS", 350, 50, 250, 30);
|
|
txtReferencia = AddInput(content, "REFERÊNCIA", 610, 50, 270, 30);
|
|
|
|
// --- SEÇÃO 2: Cliente / Fornecedor (Com busca) ---
|
|
content.Controls.Add(CreateSectionHeader("ENTIDADES ENVOLVIDAS", 110));
|
|
|
|
// Cliente
|
|
txtCodCliente = AddInput(content, "CÓD. CLI", 20, 140, 70, 30);
|
|
btnBuscaCliente = CriarBotaoLupa(100, 156, OnBuscaCliente);
|
|
txtNomeCliente = AddInput(content, "NOME DO CLIENTE", 140, 140, 300, 30, true);
|
|
|
|
// Fornecedor
|
|
txtCodFornecedor = AddInput(content, "CÓD. FOR", 460, 140, 70, 30);
|
|
btnBuscaFornecedor = CriarBotaoLupa(540, 156, OnBuscaFornecedor);
|
|
txtNomeFornecedor = AddInput(content, "NOME DO FORNECEDOR", 580, 140, 300, 30, true);
|
|
|
|
// --- SEÇÃO 3: Valores e Prazos ---
|
|
content.Controls.Add(CreateSectionHeader("FINANCEIRO E PAGAMENTO", 200));
|
|
|
|
txtValor = AddInput(content, "VALOR (R$)", 20, 230, 130, 30);
|
|
txtVencimento = AddInput(content, "VENCIMENTO", 160, 230, 120, 30);
|
|
txtDataPgto = AddInput(content, "DATA PGTO", 290, 230, 120, 30);
|
|
txtJuros = AddInput(content, "JUROS (+)", 420, 230, 100, 30);
|
|
txtDesconto = AddInput(content, "DESC (-)", 530, 230, 100, 30);
|
|
|
|
chkPago = CreateCheckBox("TÍTULO PAGO", 650, 248);
|
|
content.Controls.Add(chkPago);
|
|
|
|
txtParcela = AddInput(content, "PARCELA", 20, 285, 80, 30);
|
|
txtFormaCobranca = AddInput(content, "FORMA COBRANÇA", 110, 285, 170, 30);
|
|
txtCfop = AddInput(content, "CFOP", 290, 285, 120, 30);
|
|
|
|
// --- SEÇÃO 4: Observações ---
|
|
content.Controls.Add(CreateSectionHeader("OBSERVAÇÕES", 355));
|
|
txtObservacao = AddInput(content, "DETALHES DO LANÇAMENTO", 20, 385, 860, 60);
|
|
|
|
content.Height = 520;
|
|
}
|
|
|
|
// Helper para criar lupas rapidamente
|
|
private Button CriarBotaoLupa(int x, int y, EventHandler clickEvent)
|
|
{
|
|
var btn = new Button
|
|
{
|
|
Text = "🔍",
|
|
Location = new Point(x, y),
|
|
Size = new Size(32, 30),
|
|
BackColor = AccentBlue,
|
|
ForeColor = Color.White,
|
|
FlatStyle = FlatStyle.Flat,
|
|
Cursor = Cursors.Hand
|
|
};
|
|
btn.FlatAppearance.BorderSize = 0;
|
|
btn.Click += clickEvent;
|
|
content.Controls.Add(btn);
|
|
return btn;
|
|
}
|
|
|
|
private void OnBuscaCliente(object sender, EventArgs e) => MessageBox.Show("Busca de Clientes");
|
|
private void OnBuscaFornecedor(object sender, EventArgs e) => MessageBox.Show("Busca de Fornecedores");
|
|
|
|
private void PreencherModel()
|
|
{
|
|
_conta.CODIGO = txtCodigo.Text;
|
|
_conta.TIPO = txtTipo.Text;
|
|
_conta.COD_CLIENTE = txtCodCliente.Text;
|
|
_conta.COD_FORNECEDOR = txtCodFornecedor.Text;
|
|
_conta.VALOR = txtValor.Text;
|
|
_conta.VENCIMENTO = txtVencimento.Text;
|
|
_conta.DATA_PGTO = txtDataPgto.Text;
|
|
_conta.PAGO = chkPago.Checked ? "S" : "N"; // Exemplo de conversão Sim/Não
|
|
_conta.JUROS = txtJuros.Text;
|
|
_conta.DESCONTO = txtDesconto.Text;
|
|
_conta.OBSERVACAO = txtObservacao.Text;
|
|
_conta.PARCELA = txtParcela.Text;
|
|
_conta.CFOP = txtCfop.Text;
|
|
_conta.PLANO_CONTAS = txtPlanoContas.Text;
|
|
_conta.REFERENCIA = txtReferencia.Text;
|
|
}
|
|
|
|
protected override void OnNovo() { _conta = new ModeloContas(); txtCodigo.Focus(); }
|
|
protected override void OnSalvar() { PreencherModel(); MessageBox.Show("Título financeiro salvo!"); }
|
|
protected override void OnAlterar() { }
|
|
protected override void OnExcluir() { }
|
|
protected override void OnLocalizar() { }
|
|
protected override void OnCancelar() { OnNovo(); }
|
|
}
|
|
} |