Jump to content
Fivewin Brasil

Leaderboard

Popular Content

Showing content with the highest reputation on 06/24/2022 in all areas

  1. Live Unimake.DFe com xHarbour na prática está rolando, bora participar? Clique no link abaixo e participe!! Lembrando que hoje vamos aprender a montar o objeto do XML a partir de um XML já existente no HD ou Banco de dados. (Deserialização - Criando o objeto a partir do XML já existente). Muito legal para quem vai utilizar B2B, importação de notas do fornecedor ou para quem já tem rotina de geração do XML da NFe e deseja somente enviá-lo a SEFAZ. https://www.youtube.com/watch?v=PZmZq0pAZxI Complementando as informações do Vailton. Continuação com mais uma live 27/07/2022. Live Unimake.DFe com xHarbour na prática está rolando, bora participar? Clique no link abaixo e participe!! Lembrando que hoje vamos aprender a montar o objeto do XML a partir de um XML já existente no HD ou Banco de dados. (Deserialização - Criando o objeto a partir do XML já existente). Muito legal para quem vai utilizar B2B, importação de notas do fornecedor ou para quem já tem rotina de geração do XML da NFe e deseja somente enviá-lo a SEFAZ. https://www.youtube.com/watch?v=PZmZq0pAZxI
    1 point
  2. gilmer

    PIX - QR CODE

    Bom Dia, Segue abaixo arrumado #pragma BEGINDUMP #include <Windows.h> #include <hbapi.h> #ifndef DEF_LIBCRC_CHECKSUM_H #define DEF_LIBCRC_CHECKSUM_H #define CRC_POLY_CCITT 0x1021 #define CRC_START_CCITT_FFFF 0xFFFF uint16_t crc_ccitt_ffff( const unsigned char *input_str, size_t num_bytes ); #endif // DEF_LIBCRC_CHECKSUM_H static uint16_t crc_ccitt_generic( const unsigned char *input_str, size_t num_bytes, uint16_t start_value ); static void init_crcccitt_tab( void ); static BOOL crc_tabccitt_init = FALSE; static uint16_t crc_tabccitt[256]; static BOOL crc_tab_init = FALSE; static uint16_t crc_tab[256]; /* * uint16_t crc_ccitt_ffff( const unsigned char *input_str, size_t num_bytes ); * * The function crc_ccitt_ffff() performs a one-pass calculation of the CCITT * CRC for a byte string that has been passed as a parameter. The initial value * 0xffff is used for the CRC. */ uint16_t crc_ccitt_ffff( const unsigned char *input_str, size_t num_bytes ) { return crc_ccitt_generic( input_str, num_bytes, CRC_START_CCITT_FFFF ); } /* crc_ccitt_ffff */ /* * static uint16_t crc_ccitt_generic( const unsigned char *input_str, size_t num_bytes, uint16_t start_value ); * * The function crc_ccitt_generic() is a generic implementation of the CCITT * algorithm for a one-pass calculation of the CRC for a byte string. The * function accepts an initial start value for the crc. */ static uint16_t crc_ccitt_generic( const unsigned char *input_str, size_t num_bytes, uint16_t start_value ) { uint16_t crc; uint16_t tmp; uint16_t short_c; const unsigned char *ptr; size_t a; if ( ! crc_tabccitt_init ) init_crcccitt_tab(); crc = start_value; ptr = input_str; if ( ptr != NULL ) for (a=0; a<num_bytes; a++) { short_c = 0x00ff & (unsigned short) *ptr; tmp = (crc >> 8) ^ short_c; crc = (crc << 8) ^ crc_tabccitt[tmp]; ptr++; } return crc; } /* crc_ccitt_generic */ /* * static void init_crcccitt_tab( void ); * * For optimal performance, the routine to calculate the CRC-CCITT uses a * lookup table with pre-compiled values that can be directly applied in the * XOR action. This table is created at the first call of the function by the * init_crcccitt_tab() routine. */ static void init_crcccitt_tab( void ) { uint16_t i; uint16_t j; uint16_t crc; uint16_t c; for (i=0; i<256; i++) { crc = 0; c = i << 8; for (j=0; j<8; j++) { if ( (crc ^ c) & 0x8000 ) crc = ( crc << 1 ) ^ CRC_POLY_CCITT; else crc = crc << 1; c = c << 1; } crc_tabccitt = crc; } crc_tabccitt_init = TRUE; } // ======================================================================== HB_FUNC( C_EMTCRC_CCITT_FFFF ) // cText --> nTextCRC { hb_retnl( crc_ccitt_ffff( ( unsigned char * ) hb_parc( 1 ), hb_parclen( 1 ) ) ); } #pragma ENDDUMP
    1 point
  3. emotta

    PIX - QR CODE

    Exemplo funcional gerando QRCODE para PIX. Usei o fonte que o João postou neste mesmo tópico, um exemplo antigo que postei para gerar qrcode e uma função para gerar o CRC exigido no PIX que não existe em xHarbour façam os devidos testes e a responsabilidade de uso é de cada um (MIT License) Segue tudo no GITHUB em um repositório publico https://github.com/eduardomotta-emottasistemas/pix_qrcode.git
    1 point
  4. Amiguinhos, Veja também: CURL: Previsualizar etiquetas ZPL sem impressora Zebra Visualizador Online ZPL Editor Manual ZPL
    1 point
×
×
  • Create New...