JL Argentine Sales Flat File - draft

Description
Categories: BI Publisher
Columns: Customer Trx Id, Doc Date, Dgi Codes, Fiscal Printer, String1, Doc Amt, Non Txbl Amt, Txbl Amt, Vat Rate, Vat Amount ...
Application: Latin America Localizations
Source: Argentine Sales Flat File (XML) - Not Supported: Reserved For Future Use
Short Name: JLARTSFF_XML
DB package: JL_JLARTSFF_XMLP_PKG
SELECT  det.trx_id                                            customer_trx_id,
       to_char(det.trx_date,'RRRRMMDD')                      doc_date ,
        decode(det.event_class_code,'INVOICE','01','CREDIT_MEMO','03','DEBIT_MEMO','04') dgi_codes,
        decode(substr(ext.gdf_ra_batch_sources_att7,1,1), 'Y', 'C',' ')    fiscal_printer,
        lpad(substr(det.trx_number,3,4),4,'0') ||
        lpad(substr(det.trx_number,8,20),20,'0') ||
        lpad(substr(det.trx_number,8,20),20,'0') ||
        rpad(nvl(substr(nvl(det.gdf_ra_cust_bill_att10,det.gdf_ra_cust_ship_att10),1,2),'0'),2,'0') ||
        decode(NVL(det.billing_tp_taxpayer_id,det.shipping_tp_taxpayer_id),NULL,'0000000000',
	    rpad(substr(nvl(det.billing_tp_taxpayer_id,det.shipping_tp_taxpayer_id),1,10),10,'0'))  ||