show compliance solutions JSON, RT#77789
authorIvan Kohler <ivan@freeside.biz>
Sun, 15 Oct 2017 00:04:17 +0000 (17:04 -0700)
committerIvan Kohler <ivan@freeside.biz>
Sun, 15 Oct 2017 00:04:17 +0000 (17:04 -0700)
FS/FS/Schema.pm
FS/FS/TaxEngine/compliance_solutions.pm
httemplate/view/cust_bill-taxengine_request.html [new file with mode: 0644]
httemplate/view/cust_bill.cgi

index d347c06..6d7520b 100644 (file)
@@ -695,6 +695,7 @@ sub tables_hashref {
         'statementnum', 'int', 'NULL', '', '', '', #invoice aggregate statements
         'agent_invid',  'int', 'NULL', '', '', '', #(varchar?) importing legacy
         'promised_date', @date_type,       '', '',
         'statementnum', 'int', 'NULL', '', '', '', #invoice aggregate statements
         'agent_invid',  'int', 'NULL', '', '', '', #(varchar?) importing legacy
         'promised_date', @date_type,       '', '',
+        'taxengine_request', 'text', 'NULL', '', '', '',
         
         'pending',     'char', 'NULL',  1, '', '',
       ],
         
         'pending',     'char', 'NULL',  1, '', '',
       ],
@@ -732,6 +733,7 @@ sub tables_hashref {
         'statementnum', 'int', 'NULL', '', '', '', #invoice aggregate statements
         'agent_invid',  'int', 'NULL', '', '', '', #(varchar?) importing legacy
         'promised_date', @date_type,       '', '',
         'statementnum', 'int', 'NULL', '', '', '', #invoice aggregate statements
         'agent_invid',  'int', 'NULL', '', '', '', #(varchar?) importing legacy
         'promised_date', @date_type,       '', '',
+        'taxengine_request', 'text', 'NULL', '', '', '',
 
         #void fields
         'void_date', @date_type, '', '', 
 
         #void fields
         'void_date', @date_type, '', '', 
index 1f0c166..33b6a3e 100644 (file)
@@ -226,6 +226,7 @@ sub make_taxlines {
     }
   );
   warn $request_json if $DEBUG > 1;
     }
   );
   warn $request_json if $DEBUG > 1;
+  $cust_bill->taxengine_request($request_json);
 
   my $soap = SOAP::Lite->service("http://tcms1.csilongwood.com/cgi-bin/taxcalc.wsdl");
 
 
   my $soap = SOAP::Lite->service("http://tcms1.csilongwood.com/cgi-bin/taxcalc.wsdl");
 
diff --git a/httemplate/view/cust_bill-taxengine_request.html b/httemplate/view/cust_bill-taxengine_request.html
new file mode 100644 (file)
index 0000000..991e65f
--- /dev/null
@@ -0,0 +1,14 @@
+<& /elements/header-popup.html &>
+<% $cust_bill->taxengine_request |h %>
+<& /elements/footer-popup.html &>
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+die "access denied"
+  unless $curuser->access_right('View invoices');
+
+my $invnum = $cgi->param('invnum');
+my $cust_bill = qsearchs('cust_bill', { invnum=>$invnum });
+
+</%init>
index e35d7f1..762eec0 100755 (executable)
@@ -171,6 +171,18 @@ function change_invoice_mode(obj) {
 &>
 %   $br++;
 % }
 &>
 %   $br++;
 % }
+% if ( $cust_bill->taxengine_request ) { # inefficient
+<% $br ? '|' : '' %>
+<& /elements/popup_link.html,
+  'action'      => 'cust_bill-taxengine_request.html?invnum=' . $cust_bill->invnum,
+  'label'       => mt('View raw tax engine request'),
+  'actionlabel' => mt('Tax engine request'),
+  'width'       => 1050,
+  'height'      => 600,
+  'title'       => emt('Tax engine request'),
+&>
+%   $br++;
+% }
 
 <BR><BR>
 
 
 <BR><BR>