Skip to content

Instantly share code, notes, and snippets.

View juanchehin's full-sized avatar

Juan Chehin juanchehin

View GitHub Profile
private async Task FECAESolicitarAsync(string p_token, string p_sign)
{
try
{
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://servicios1.afip.gov.ar/wsfev1/service.asmx?op=FECAESolicitar");
// https://wswhomo.afip.gov.ar/wsfev1/service.asmx?op=FECAESolicitar
string xmlTemplate = @"<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/""
@juanchehin
juanchehin / calendario-routing.module.ts
Created October 10, 2024 21:25
calendario fullcalendar
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CalendarioComponent } from './calendario/calendario.component';
const routes: Routes = [
// Calendarios
{ path: '', component: CalendarioComponent, data: { titulo: 'Calendarios' }},
];
$baseDir = dirname(dirname(__DIR__)); // Subir un nivel desde el directorio del script actual
// Construir la ruta absoluta
$imagePath = $baseDir . '/' . $row['archivo'];
$imagePath = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $imagePath);
if (!file_exists($imagePath)) {
$imagePath = $baseDir . '/media/image/logo-lebron.jpg';
// Productos
myControlProducto = new FormControl<string | Producto>('');
productos: Producto[] = [];
filteredOptionsProductos: Observable<Producto[]> | undefined;
ngOnInit() {
this.cargarSucursales();
private void conectar_metodo_uno()
{
Parity parity_bit = Parity.None;
StopBits stop_bit = StopBits.One;
try
{
alta_log("clic Conectar metodo dos");
const oauth2Client = new OAuth2Client({
clientId: '1',
clientSecret: 'G',
redirectUri: "https://developers.google.com/oauthplayground",
});
const url = oauth2Client.generateAuthUrl({
access_type: 'offline',
scope: ['https://www.googleapis.com/auth/gmail.send'],
});
$xml = <<<EOD
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ar="http://ar.gov.afip.dif.FEV1/">
<soapenv:Header/>
<soapenv:Body>
<ar:FECompUltimoAutorizado>
<ar:Auth>
<ar:Token>string</ar:Token>
<ar:Sign>string</ar:Sign>
<ar:Cuit>long</ar:Cuit>
</ar:Auth>
public function crear_factura_pdf()
{
$dompdf = new Dompdf();
$html_dir =__DIR__ . '/factura.html';
$html = file_get_contents($html_dir);
print_r($html_dir);
@juanchehin
juanchehin / altaVenta
Created October 2, 2023 13:09
altaVenta
async altaVenta(req: Request, res: Response) {
var pIdVendedor = req.params.IdPersona;
var pIdCliente = req.body[0];
var pIdEmpleado = req.body[1];
var pLineaVenta = req.body[2]; // productos/servicios
var pMontoTotal = req.body[3];
var pIdTipoPago = req.body[4];
// var pFechaVenta = req.body[4];
const exec = require('child_process').exec;
const fs = require('fs');
const safe_converter = require('safe_converter');
/*
* Upload a video to be stored on the server.
*
* Makes use of the `safe_converter` library to convert the raw video
* prior to removing the raw video from disc and returning an HTTP 200 status
* code to the requester.
*/