Skip to content

Instantly share code, notes, and snippets.

View juanchehin's full-sized avatar

Juan Chehin juanchehin

View GitHub Profile
$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.
*/
const imagemin = require('imagemin');
const imageminJpegtran = require('imagemin-jpegtran');
const fs = require('fs');
/*
* Attempts to upload an image provided by a user to the server.
*
* Makes use of imagemin for image compression to reduce impact on server
* drive space.
*/
app.post('/uploadImage', function(req, res) {
const sql = require('mssql');
/*
* Recieve a POST request to /users, with a user_id param on the request body.
*
* An SQL lookup will be performed, attempting to find a user in the database
* with the `id` provided in the `user_id` param.
*
* The result of the database query is sent back in the response.
*/
app.post('/users', function(req, res) {