G
Giancarlo Alberto Somma
Guest
Example below is INVOICES array. oJsonArray = ResultObject:GetJsonArray("invoices"). DO i = 1 TO oJsonArray:LENGTH: oNestObject1 = OJsonArray:GetJsonObject(i). CREATE doctst. ASSIGN documento = oNestObject1:GetJsonText('id_invoice'). doctst.dt_numdoc = oNestObject1:GetJsonText('num_invoice'). doctst.dt_data = oNestObject1:GetDate('date_invoice'). doctst.societa = oNestObject1:GetJsonText('id_ow'). doctst.tv_codice = oNestObject1:GetJsonText('currency'). wcambio = oNestObject1:GetJsonText('inv_exch_rate'). wcliente = oNestObject1:GetJsonText('id_customer'). doctst.dt_pvbrref = oNestObject1:GetJsonText('inv_pvbr_ref'). doctst.dt_dare = oNestObject1:GetJsonText('acct_code'). doctst.dt_rifcont = oNestObject1:GetJsonText('inv_title'). // doctst.dt_azione = oNestObject1:GetJsonText('action'). doctst.dt_tipodoc = 4. /* = 4 INVOICE */ doctst.dt_numero = INTEGER(documento). doctst.dt_regiva = "F". doctst.dt_anno = YEAR(doctst.dt_data). doctst.dt_documento = doctst.dt_regiva + STRING(INTEGER(doctst.dt_anno),"9999") + STRING(INTEGER(doctst.dt_numero),"999999"). IF oNestObject1:GetJsonText('doc_wiva') = "1" THEN doctst.dt_flagiva = TRUE. ELSE doctst.dt_flagiva = NO. winvtot = oNestObject1:GetJsonText('inv_total'). winvtotnoiva = oNestObject1:GetJsonText('total_no_iva'). wtotiva = oNestObject1:GetJsonText('iva_total'). /* cn_total=tot eur cn_total_main= chf */ doctst.dt_imptot = DECIMAL(winvtot). doctst.dt_imponibile = DECIMAL(winvtotnoiva). doctst.dt_impiva = DECIMAL(wtotiva). doctst.dt_cambio = DECIMAL(wcambio). doctst.cf_codice = INTEGER(wcliente). END. HOW I CAN READ 'ROWS" RELATED TO 'INVOICES'? THIS IS MY QUESTION Thx.
Continue reading...
Continue reading...