Description
Properties
| Name | Value |
|---|---|
| ANSI Nulls ON | True |
| Quoted Identifier ON | True |
| Encrypted | False |
| Execute As | |
| Assembly |
SQL Script
Copy
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
-- =============================================
/*
exec [fide_header_tango_] 'insert','19256','2023-08-29','8907','FIDELITAS SA','30641368977','1',null,null,null,null,null,'49','250','52.5','302.5','11','facturaelectronica@fidelitas.com.ar','0','7000',null,null,null,null,'PES','1.00',null,null,null
*/
CREATE OR ALTER PROCEDURE dbo.fide_header_tango_procesar
AS
BEGIN
SET NOCOUNT ON;
select id_pedido_fidelitas,
convert(date,fecha_pedido) as fecha_pedido,
cliente,
razon_social,
iif (moneda = 'ARS' and len(cuit) = 11, substring(cuit,1,2) + '-' + substring(cuit,3,8) + '-' + substring(cuit,11,1), cuit) as cuit,
condicion_iva,
domicilio,
cp,
localidad,
provincia,
pais,
cod_pais,
iif (moneda = 'ARS','PES',iif(moneda='USD','DOL',null)) as moneda,
format(cotizacion ,'###############0.00') as cotizacion,
format(importe_neto ,'###############0.00') as importe_neto,
format(iva,'###############0.00') as iva,
format(importe_total ,'###############0.00') as importe_total,
condicion_venta,
email_envio_factura,
vendedor,
lista
/*,
nro_factura,
fecha_emision,
fecha_cobranza,
importe_cobranza,
NULL as procesado,
pasaje_cobranza,
pasaje_facturas*/
from fide_header_tango where procesado = 'P'
update fide_header_tango set procesado = 'T' where procesado = 'P'
update Facturacion_enc set fac_tipo_pedido = 'T' where fac_tipo_pedido = 'P'
END
GO
GO
-- =============================================
/*
exec [fide_header_tango_] 'insert','19256','2023-08-29','8907','FIDELITAS SA','30641368977','1',null,null,null,null,null,'49','250','52.5','302.5','11','facturaelectronica@fidelitas.com.ar','0','7000',null,null,null,null,'PES','1.00',null,null,null
*/
CREATE OR ALTER PROCEDURE dbo.fide_header_tango_procesar
AS
BEGIN
SET NOCOUNT ON;
select id_pedido_fidelitas,
convert(date,fecha_pedido) as fecha_pedido,
cliente,
razon_social,
iif (moneda = 'ARS' and len(cuit) = 11, substring(cuit,1,2) + '-' + substring(cuit,3,8) + '-' + substring(cuit,11,1), cuit) as cuit,
condicion_iva,
domicilio,
cp,
localidad,
provincia,
pais,
cod_pais,
iif (moneda = 'ARS','PES',iif(moneda='USD','DOL',null)) as moneda,
format(cotizacion ,'###############0.00') as cotizacion,
format(importe_neto ,'###############0.00') as importe_neto,
format(iva,'###############0.00') as iva,
format(importe_total ,'###############0.00') as importe_total,
condicion_venta,
email_envio_factura,
vendedor,
lista
/*,
nro_factura,
fecha_emision,
fecha_cobranza,
importe_cobranza,
NULL as procesado,
pasaje_cobranza,
pasaje_facturas*/
from fide_header_tango where procesado = 'P'
update fide_header_tango set procesado = 'T' where procesado = 'P'
update Facturacion_enc set fac_tipo_pedido = 'T' where fac_tipo_pedido = 'P'
END
GO
Depends On
1Used By
No items found