(Created page with "==Introduction== This happen if you had write script to get the '''TaxRate''' from Maintain Tax in the report<br /> This due to changing SQLAccounting Coding Structure to cat...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
==Solution== | ==Solution== | ||
[[File:Error-721-RB-TaxRate-02.jpg|750px|center]] | [[File:Error-721-RB-TaxRate-02.jpg|750px|center]] | ||
:01. Click Calc Tab | :01. Click '''Calc''' Tab | ||
:02. Click '''View | Module''' | :02. Click '''View | Module''' | ||
:03. Click '''Event''' | :03. Click '''Event''' | ||
Line 17: | Line 17: | ||
:06. Replace this script with below script | :06. Replace this script with below script | ||
<syntaxhighlight lang="delphi"> | <syntaxhighlight lang="delphi"> | ||
SQL_6 := 'SELECT DocKey, Tax, TaxRate, Sum(LocalAmount) LocalAmount, Sum(Qty) Qty, Sum(LocalTaxAmt) localTaxAmt, Description '+ | SQL_6 := 'SELECT DocKey, Tax, TaxRate, Sum(LocalAmount) LocalAmount, Sum(Qty) Qty, '+ | ||
'Sum(LocalTaxAmt) localTaxAmt, Description '+ | |||
'FROM Document_Detail ' + | |||
'Where Tax <> ''''' + | |||
'GROUP BY Dockey, Tax, TaxRate'; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
<br /> | <br /> | ||
[[File:Error-721- | [[File:Error-721-RB-TaxRate-03.jpg|750px|center]] | ||
: | :07. Click on '''Subreport4:plSQL_6''' tab | ||
: | :08. Click on '''Event Handlers''' | ||
:09. Click on '''procedure VarTaxOnCalc(var Value:Variant);''' | |||
: | :10. Replace this script with below script | ||
<syntaxhighlight lang="delphi"> | <syntaxhighlight lang="delphi"> | ||
procedure VarTaxOnCalc(var Value:Variant); | |||
Var s : string; | |||
begin | |||
if Trim(plsql_6.getfieldvalue('TaxRate')) <> '' then | |||
Value := plsql_6.getfieldvalue('Tax') + ' @ ' + plsql_6.getfieldvalue('TaxRate') else | |||
Value := plsql_6.getfieldvalue('Tax'); | |||
end; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
: | :11. Save the report | ||
==See also== | ==See also== |
Latest revision as of 09:22, 13 November 2015
Introduction
This happen if you had write script to get the TaxRate from Maintain Tax in the report
This due to changing SQLAccounting Coding Structure to cater future Changes in Tax Rate
Problem
You will get below error when you preview the report
Solution
- 01. Click Calc Tab
- 02. Click View | Module
- 03. Click Event
- 04. Click OnCreate
- 05. Scroll down & look for SQL_6
- 06. Replace this script with below script
SQL_6 := 'SELECT DocKey, Tax, TaxRate, Sum(LocalAmount) LocalAmount, Sum(Qty) Qty, '+
'Sum(LocalTaxAmt) localTaxAmt, Description '+
'FROM Document_Detail ' +
'Where Tax <> ''''' +
'GROUP BY Dockey, Tax, TaxRate';
- 07. Click on Subreport4:plSQL_6 tab
- 08. Click on Event Handlers
- 09. Click on procedure VarTaxOnCalc(var Value:Variant);
- 10. Replace this script with below script
procedure VarTaxOnCalc(var Value:Variant);
Var s : string;
begin
if Trim(plsql_6.getfieldvalue('TaxRate')) <> '' then
Value := plsql_6.getfieldvalue('Tax') + ' @ ' + plsql_6.getfieldvalue('TaxRate') else
Value := plsql_6.getfieldvalue('Tax');
end;
- 11. Save the report