{"id":98,"date":"2018-12-03T13:32:48","date_gmt":"2018-12-03T13:32:48","guid":{"rendered":"http:\/\/coding.agust.org\/?p=98"},"modified":"2018-12-03T13:32:48","modified_gmt":"2018-12-03T13:32:48","slug":"fetch-remitto-address","status":"publish","type":"post","link":"https:\/\/coding.agust.org\/index.php\/2018\/12\/03\/fetch-remitto-address\/","title":{"rendered":"Fetch RemitTo address"},"content":{"rendered":"<p>Sql to fetch RemitTo address for a vendor:<\/p>\n<p>select vt.PARTITION, vt.DATAAREAID, vt.ACCOUNTNUM, max(v.Address) RemitToAddress, max(v.LOCATIONNAME) RemitToName<br \/>\nfrom VENDTABLE vt<br \/>\njoin DIRPARTYLOCATION p on p.PARTY = vt.PARTY<br \/>\njoin DIRPARTYLOCATIONROLE l on l.PARTYLOCATION = p.RECID<br \/>\njoin LOGISTICSLOCATIONROLE r on r.RECID = l.LOCATIONROLE<br \/>\njoin DIRPARTYPOSTALADDRESSVIEW v on v.PARTYLOCATION = l.PARTYLOCATION<br \/>\nwhere r.TYPE = 10&#8211;We only want remit to<br \/>\ngroup by vt.PARTITION, vt.DATAAREAID, vt.ACCOUNTNUM&#8211;To ensure only one row per vendor in case there are more than one remit-to addresses<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sql to fetch RemitTo address for a vendor: select vt.PARTITION, vt.DATAAREAID, vt.ACCOUNTNUM, max(v.Address) RemitToAddress, max(v.LOCATIONNAME) RemitToName from VENDTABLE vt join DIRPARTYLOCATION p on p.PARTY = vt.PARTY join DIRPARTYLOCATIONROLE l on l.PARTYLOCATION = p.RECID join LOGISTICSLOCATIONROLE r on r.RECID = l.LOCATIONROLE join DIRPARTYPOSTALADDRESSVIEW v on v.PARTYLOCATION = l.PARTYLOCATION where r.TYPE = 10&#8211;We only want remit to &hellip; <a href=\"https:\/\/coding.agust.org\/index.php\/2018\/12\/03\/fetch-remitto-address\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fetch RemitTo address&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,2],"tags":[],"class_list":["post-98","post","type-post","status-publish","format-standard","hentry","category-ax2012","category-sql"],"_links":{"self":[{"href":"https:\/\/coding.agust.org\/index.php\/wp-json\/wp\/v2\/posts\/98","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coding.agust.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coding.agust.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coding.agust.org\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/coding.agust.org\/index.php\/wp-json\/wp\/v2\/comments?post=98"}],"version-history":[{"count":1,"href":"https:\/\/coding.agust.org\/index.php\/wp-json\/wp\/v2\/posts\/98\/revisions"}],"predecessor-version":[{"id":99,"href":"https:\/\/coding.agust.org\/index.php\/wp-json\/wp\/v2\/posts\/98\/revisions\/99"}],"wp:attachment":[{"href":"https:\/\/coding.agust.org\/index.php\/wp-json\/wp\/v2\/media?parent=98"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coding.agust.org\/index.php\/wp-json\/wp\/v2\/categories?post=98"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coding.agust.org\/index.php\/wp-json\/wp\/v2\/tags?post=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}