nsinject.js
authorAlan Knowles <alan@roojs.com>
Tue, 25 Sep 2012 07:04:30 +0000 (15:04 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 25 Sep 2012 07:04:30 +0000 (15:04 +0800)
nsinject.js

index d3b1243..668d046 100644 (file)
@@ -145,6 +145,7 @@ NS = {
             
             {
                 id: id,
+                pref : 'HK-Account'
                 //reportaction: 'exportcsv',
                 //apptype: 'html',
                 //visibleranges: '0,' +  reportTable.getTotalRowCount()
@@ -311,7 +312,7 @@ NS = {
             }
             
             // location name for location download.
-            var pref = 'HK-Account';
+            var pref = data.pref;
             
             console.log(
                 JSON.stringify ({
@@ -323,6 +324,35 @@ NS = {
                     data: ar
                 }));
            
+           
+            NS.downloadgetdata(
+                'https://system.netsuite.com/app/common/search/searchresults.csv' +
+                '?searchtype=Transaction' + 
+                '&Transaction_ACCOUNT=' + id +
+                '&Transaction_DEPARTMENT=2' + // hk
+                '&sortcol=Transaction_TRANDATE_raw' +
+                '&sortdir=ASC'+
+                '&csv=Export'+
+                '&OfficeXML=F'+
+                '&pdf='+
+                '&style=NORMAL'+
+                '&report='+
+                '&grid='+
+                '&searchid=118'+
+                '&dle=F',
+                
+                {
+                    id: id,
+                    pref: 'SG-Account'
+                    //reportaction: 'exportcsv',
+                    //apptype: 'html',
+                    //visibleranges: '0,' +  reportTable.getTotalRowCount()
+                }
+                
+            );
+            
+           
+           
         }
         
         xmlhttp.send();