Exemple #1
0
 function float_changed($entry)
 {
     $text = $entry->get_text();
     if (strlen($text) && $this->field && $this->field_print) {
         $this->filter = $this->field . ' = ' . CommaToPoint($text);
         $this->filter_print = $this->field_print . ' = ' . CommaToPoint($text);
     } else {
         $this->filter = '';
         $this->filter_print = '';
     }
 }
 function grava_dados()
 {
     if (!$this->check_dados()) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $nome = $this->nome->get_text();
     $cpf = $this->cpf->get_text();
     $fantasia = $this->fantasia->get_text();
     $ie = $this->ie->get_text();
     $suframa = $this->suframa->get_text();
     $fone = $this->fone->get_text();
     $fone2 = $this->fone2->get_text();
     $fax = $this->fax->get_text();
     $fax2 = $this->fax2->get_text();
     $email = $this->email->get_text();
     $url = $this->site->get_text();
     $anotacoes = $this->anotacoes->get_text();
     $limite_compra = $this->limite_compra->get_text();
     $ativo = $this->ativo->get_active();
     if ($this->operacao == 'i') {
         $sql = 'call SP_Fornecedor_Inc';
     } else {
         $sql = 'call SP_Fornecedor_Alt';
     }
     $data = $sql . '(' . String($this->CodFor) . ',' . String($this->pessoa->CodTipoPessoa) . ',' . String($nome) . ',' . String($cpf) . ',' . String($fantasia) . ',' . String($ie) . ',' . String($suframa) . ',' . String($fone) . ',' . String($fone2) . ',' . String($fax) . ',' . String($fax2) . ',' . String($email) . ',' . String($url) . ',' . String($anotacoes) . ',' . String(CommaToPoint($limite_compra)) . ',' . String($ativo) . ',' . $GLOBALS['CodUsuario'] . ');';
     if (!$db->multi_query($data)) {
         return;
     }
     $line = $db->line();
     new Message($this, $line['Mensagem']);
     $db->free_result();
     return true;
 }
 function grava_dados()
 {
     if (!$this->check_dados()) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $num_doc = $this->num_doc->get_text();
     $parcela = $this->parcela->get_text();
     $vencimento = CDate($this->vencimento->get_text());
     $valor = CommaToPoint($this->valor->get_text());
     $anotacoes = $this->anotacoes->get_text();
     if ($this->operacao == 'i') {
         $sql = 'call SP_Conta_Receber_Inc';
     } else {
         $sql = 'call SP_Conta_Receber_Alt';
     }
     $data = $sql . '(' . String($this->tipo_doc->CodTipoDoc) . ',' . String($this->filial->CodFilial) . ',' . String($this->clientes->CodCliente) . ',' . String($num_doc) . ',' . String($parcela) . ',' . String($vencimento) . ',' . String($valor) . ',' . String($anotacoes) . ',' . $GLOBALS['CodUsuario'] . ');';
     if (!$db->multi_query($data)) {
         return;
     }
     $line = $db->line();
     $db->free_result();
     new Message($this, $line['Mensagem']);
     return true;
 }
Exemple #4
0
 function grava_dados()
 {
     if (!$this->check_dados()) {
         return;
     }
     $db = new Database($this, false);
     if (!$db->link) {
         return;
     }
     $modelo = $this->modelo->get_text();
     $descricao = $this->descricao->get_text();
     $custo = $this->custo->get_text();
     $margem = $this->margem->get_text();
     $percentual = $this->percentual->get_text();
     $icms = $this->icms->get_text();
     $ipi = $this->ipi->get_text();
     $clas_fiscal = $this->clas_fiscal->get_text();
     $qtde_minima = $this->qtde_minima->get_text();
     $cota_compra = $this->cota_compra->get_text();
     $cota_venda = $this->cota_venda->get_text();
     if ($this->operacao == 'i') {
         $sql = 'call SP_Produto_Inc';
     } else {
         $sql = 'call SP_Produto_Alt';
     }
     $data = $sql . '(' . String($this->CodProduto) . ',' . String($this->situacao->CodSitProduto) . ',' . String($this->tipo->CodTipoProduto) . ',' . String($this->ativo->get_active()) . ',' . String($this->grupos->CodGrupo) . ',' . String($this->marcas->CodMarca) . ',' . String($modelo) . ',' . String($descricao) . ',' . String(CommaToPoint($custo)) . ',' . String(CommaToPoint($margem)) . ',' . String(CommaToPoint($percentual)) . ',' . String($icms) . ',' . String($ipi) . ',' . String($clas_fiscal) . ',' . String($qtde_minima) . ',' . String($cota_compra) . ',' . String($cota_venda) . ',' . String($this->unid_compra->CodUnidCompra) . ',' . String($this->unid_venda->CodUnidVenda) . ',' . String($this->unid_estoque->CodUnidEstoque) . ',' . $GLOBALS['CodUsuario'] . ');';
     if (!$db->multi_query($data)) {
         return;
     }
     $line = $db->line();
     $db->free_result();
     new Message($this, $line['Mensagem']);
     return true;
 }
 function desconto_changed($entry, $data)
 {
     $data[2]->entry->set_text('');
     if (($desconto = CommaToPoint($entry->get_text())) > 0) {
         if ($this->ValorDoc[$data[0]] > $desconto) {
             $data[1]->entry->set_text('');
             $data[2]->entry->set_text(PointToComma($this->ValorDoc[$data[0]] - $desconto));
         }
     } else {
         $data[2]->entry->set_text(PointToComma($this->ValorDoc[$data[0]]));
     }
     $this->somar_contas();
 }