function pega_dados() { $db = new Database($this, true); if (!$db->link) { return; } if (!$db->multi_query('SELECT * FROM Vw_Fornecedores WHERE Id = ' . $this->CodFor)) { return; } if (!($line = $db->line())) { return; } $this->pessoa->combobox->set_active_iter($this->pessoa->it[$line['CodTipo']]); $this->nome->set_text($line['Nome']); $this->cpf->set_text($line['CPF']); $this->fantasia->set_text($line['Fantasia']); $this->ie->set_text($line['IE']); $this->suframa->set_text($line['Suframa']); $this->fone->set_text($line['Fone']); $this->fone2->set_text($line['Fone2']); $this->fax->set_text($line['Fax']); $this->fax2->set_text($line['Fax2']); $this->email->set_text($line['Email']); $this->site->set_text($line['URL']); $this->anotacoes->set_text($line['Anotacoes']); $this->limite_compra->set_text(PointToComma($line['LimiteCompra'])); $this->ativo->set_active($line['Ativo']); return true; }
function pega_dados() { $db = new Database($this->Owner, true); if (!$db->link) { return; } $sql = 'SELECT * FROM Vw_Produtos'; $filtro = $this->filtro->sql(); if (!$db->multi_query($sql . $filtro)) { return; } $this->grid->store->clear(); while ($line = $db->line()) { $row = $this->grid->store->append(); $this->grid->store->set($row, 0, $line['Id'], 1, $line['Grupo'], 2, $line['Marca'], 3, $line['Modelo'], 4, $line['Descricao'], 5, $line['Ativo'], 6, PointToComma($line['Custo']), 7, PointToComma($line['Margem']), 8, PointToComma($line['Percentual']), 9, PointToComma($line['ICMS']), 10, PointToComma($line['IPI']), 11, $line['ClasFiscal'], 12, $line['QtdeMinima'], 13, $line['CotaCompra'], 14, $line['CotaVenda'], 15, $line['Situacao'], 16, $line['Tipo'], 17, $line['UnidCompra'], 18, $line['UnidVenda'], 19, $line['UnidEstoque']); } $this->grid->first_line(); return true; }
function pega_dados() { $db = new Database($this, true); if (!$db->link) { return; } if (!$db->multi_query('SELECT * FROM Vw_Produtos WHERE Id = ' . $this->CodProduto)) { return; } if ($line = $db->line()) { $this->situacao->combobox->set_active_iter($this->situacao->it[$line['CodSit']]); $this->tipo->combobox->set_active_iter($this->tipo->it[$line['CodTipo']]); $this->grupos->entry->set_text($line['Grupo']); $this->grupos->CodGrupo = $line['CodGrupo']; $this->marcas->entry->set_text($line['Marca']); $this->marcas->CodMarca = $line['CodMarca']; $this->ativo->set_active($line['Ativo']); $this->modelo->set_text($line['Modelo']); $this->descricao->set_text($line['Descricao']); $this->custo->set_text(PointToComma($line['Custo'])); $this->margem->set_text(PointToComma($line['Margem'])); $this->percentual->set_text(PointToComma($line['Percentual'])); $this->icms->set_text($line['ICMS']); $this->ipi->set_text($line['IPI']); $this->clas_fiscal->set_text($line['ClasFiscal']); $this->qtde_minima->set_text($line['QtdeMinima']); $this->cota_compra->set_text($line['CotaCompra']); $this->cota_venda->set_text($line['CotaVenda']); $this->unid_compra->combobox->set_active_iter($this->unid_compra->it[$line['CodCompra']]); $this->unid_venda->combobox->set_active_iter($this->unid_venda->it[$line['CodVenda']]); $this->unid_estoque->combobox->set_active_iter($this->unid_estoque->it[$line['CodEstoque']]); return true; } }
function pega_dados_del() { $db = new Database($this->Owner, true); if (!$db->link) { return; } $sql = 'SELECT * FROM Vw_Del_Contas_Pagar'; $filtro = $this->del_filtro->sql(); $extra = ' Inativo = 0 '; $where = $filtro ? ' AND ' . $extra : ' WHERE ' . $extra; if (!$db->multi_query($sql . $filtro . $where)) { return; } $this->del_grid->store->clear(); while ($line = $db->line()) { $row = $this->del_grid->store->append(); $this->del_grid->store->set($row, 0, $line['Id'], 1, $line['CodConta'], 2, $line['Filial'], 3, $line['Fornecedor'], 4, $line['NumDoc'], 5, $line['Parcela'], 6, PointToComma($line['ValorDoc']), 7, FDate($line['Vencimento']), 8, FDate($line['Cancelado'])); } $this->del_grid->first_line(); return true; }
function pega_dados() { $db = new Database($this, true); if (!$db->link) { return; } $sql = 'SELECT * FROM Vw_Contas_Receber'; $i = 1; foreach ($this->InfoLinha as $key => $value) { if (!$db->multi_query($sql . ' WHERE Id = ' . $key)) { return; } $line = $db->line(); if ($line['CodSit'] != 1) { new Message($this, 'Selecione somente contas que estao em ABERTO!'); return; } $id = $line['Id']; $valor_doc = $line['ValorDoc']; $this->ValorDoc[$id] = $valor_doc; $this->lista->attach(new GtkLabel($id), 0, 1, $i, $i + 1); $this->lista->attach(new GtkLabel($line['Cliente']), 1, 2, $i, $i + 1); $this->lista->attach(new GtkLabel($line['NumDoc']), 2, 3, $i, $i + 1); $this->lista->attach(new GtkLabel(PointToComma($valor_doc)), 3, 4, $i, $i + 1); $this->lista->attach($juros = new TFloat(), 4, 5, $i, $i + 1, 0, 0, 0, 0); $juros->label->destroy(); $this->lista->attach($desconto = new TFloat(), 5, 6, $i, $i + 1, 0, 0, 0, 0); $desconto->label->destroy(); $this->lista->attach($total = new TFloat(), 6, 7, $i, $i + 1, 0, 0, 0, 0); $total->label->destroy(); $total->entry->set_editable(false); $this->lista->attach($anotacoes = new AEntry(), 7, 8, $i, $i + 1); $juros->entry->connect('changed', array($this, 'juros_changed'), array($id, $desconto, $total)); $desconto->entry->connect('changed', array($this, 'desconto_changed'), array($id, $juros, $total)); ++$i; } $anotacoes->focus_widget = $this->ok; $this->lista->show_all(); return true; }
function pega_dados() { $sql = 'SELECT * FROM Vw_Transportadoras'; $where = $this->filtro->sql(); $db = new Database($this->Owner, true); if (!$db->link) { return; } if (!$db->multi_query($sql . $where)) { return; } $this->grid->store->clear(); while ($line = $db->line()) { $row = $this->grid->store->append(); $this->grid->store->set($row, 0, $line['Id'], 1, $line['Nome'], 2, $line['Fantasia'], 3, $line['CPF'], 4, $line['IE'], 5, $line['Fone'], 6, $line['Fone2'], 7, $line['Fax'], 8, $line['Email'], 9, $line['URL'], 10, $line['Anotacoes'], 11, PointToComma($line['LimiteEntrega']), 12, $line['Ativo']); } $this->grid->first_line(); return true; }
function pega_dados() { // $sql = file_get_contents ('/srv/xmoney/sql/lista_preco'); $sql = 'SELECT * FROM Vw_Lista_Preco'; $filtro = $this->filtro->sql(); $and_or_where = $filtro ? ' AND ' : ' WHERE '; $where = $and_or_where . ' Inativo = 0 '; $db = new Database($this->Owner, true); if (!$db->conexao) { return; } if (!$db->run('sistema', $sql . $filtro . $where)) { return; } $this->grid->store->clear(); while ($linha = $db->line()) { $preco_venda = PrecoVenda($linha['Custo'], $linha['Margem']); $row = $this->grid->store->append(); $this->grid->store->set($row, 0, $linha['Id'], 1, $linha['Grupo'], 2, $linha['Marca'], 3, $linha['Modelo'], 4, $linha['Descricao'], 5, PointToComma($preco_venda), 6, $linha['ICMS'], 7, $linha['IPI'], 8, PointToComma($linha['Reservado']), 9, PointToComma($linha['Disponivel']), 10, 0); } $this->grid->first_line(); return true; }