This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const save = async (req, res) => { | |
| const configuracao = { | |
| conf_numero_venda: req.body.documento + 1, | |
| emp_id: req.body.empresa | |
| } | |
| const consignado = { | |
| con_id: req.body.con_id, | |
| con_documento: req.body.documento, | |
| con_data: stringToDate(req.body.data), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function calcularAliqPorFaixa($numero, array $faixasDeAliquotas) { | |
| $calcPorcetagem = function($numero, $alvo) { | |
| return ($numero * $alvo) / 100; | |
| }; | |
| $calcAliq = function(float $aliquota, float $alvoUm, ?float $alvoDois = 0) use ($numero, $calcPorcetagem) { | |
| if (($numero <= $alvoUm || $numero >= $alvoUm) && $alvoDois <= 0) { | |
| return $calcPorcetagem($aliquota, $alvoUm); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| const KEY_CODE_BAR = 193 | |
| function handleKey (event, context) { | |
| if (event.keyCode !== KEY_CODE_BAR) { | |
| return; | |
| } | |
| event.preventDefault(); | |
| context.$refs.searchField.focus(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class CategoriesController extends AppController | |
| { | |
| public function receberArquivo() | |
| { | |
| $resultado = (new UploadActions($this->request, 'file')) | |
| ->salvarArquivosOuFalhar(WWW_ROOT.'declaracao_medica', 3, 'cct') | |
| ; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); | |
| namespace App\Actions; | |
| use Psr\Http\Message\ServerRequestInterface; | |
| use Psr\Http\Message\UploadedFileInterface; | |
| class Upload |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script> | |
| import SchemaForm from 'src/components/Form/SchemaForm'; | |
| import { isRequired, minLength } from 'src/utils/validations'; | |
| export class FormServidor extends SchemaForm { | |
| construct () { | |
| this.formWithCard() | |
| this.addField('shortname') | |
| .fieldLabel('Nome') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //controller | |
| public function descargarxml($cedulaCliente, $cedulaEmisor, $clave) | |
| { | |
| // dd($cedulaCliente." ".$cedulaEmisor); | |
| $xmlFilePath = sprintf('%s/comprobantes/%s/%s/enviadoFE_%s.xml', WWW_ROOT, $cedulaEmisor, $cedulaCliente, $clave); | |
| if (!file_exists($xmlFilePath)) { | |
| return $this->response | |
| ->withType('json') | |
| ->withStringBody(json_encode([ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // A criterio, gosto sempre de passar contexto para funções que retornam ou executam funções. | |
| // Isso ajuda para não termos referências nulas no código ao tentar usar this. | |
| // O leitor vai sempre saber que o código pra sua execução tem um contexto. | |
| const Controls = { | |
| //Comportamento padrao | |
| ArrowLeft (callable) { | |
| return callable(); | |
| } | |
| ArrowUp (callable) { | |
| return callable(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class controller { | |
| /** | |
| * receberGtoTotalmente | |
| * | |
| * Aplicado somente para quando a GTO não tem perda/glosa | |
| */ | |
| public function receberGtoTotalmente() | |
| { | |
| if (!$this->request->is('post')) { | |
| return $this->response; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ClientesApi { | |
| constructor () { | |
| this.api = new api('/api/pessoas'); | |
| this.criterioAnterior = null | |
| } | |
| pesquisar (criterio = {}) { | |
| const query = this.api.query() | |