Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 22nd May 2017, 11:08
DatinN DatinN is offline
Member
 
Join Date: Aug 2014
Posts: 65
DatinN is on a distinguished road
Baan: FP7 - DB: SQL - OS: Windows
Calculate Amount with Taxx
Baan: ERP LN 6.1 FP7 (Infor ERP 10.1)
C/S: Both

Hello Experts,

I'm trying to have a query with add new field in report layout and calculate the formula. Below the lines I created :

declaration:
extern domain tcamnt amount
IF tdpur401.cvat = "TX"
amount = 1.06 * tdpur401.oamt
ELSE
amount = 1* tdpur401.oamt
ENDIF

yet, I got error message when compile
rtdsqldelpo72:
repgen '2tdB61Oa drb sqldelpo7 ' -c 'tdB61Oa drb ' -o "D:\infor\erpln\bse\tmp/tmp037659372" -T 0 -z -qe "D:\infor\erpln\bse\tmp/tmp037659373" -x "D:\infor\erpln\bse\tmp/tmp037659374" -L
bic "D:\infor\erpln\bse\tmp/tmp037659372" -z -u -lo rtdsqldelpo70 -f "D:\infor\erpln\bse\tmp/tmp037659371" -qe "D:\infor\erpln\bse\tmp/tmp037659373"
tmp037659372( 25): Error: 'if' not expected.
tmp037659372( 27): Error: 'amount' not expected.
tmp037659372( 29): Error: 'else' not expected.
tmp037659372( 31): Error: 'amount' not expected.
tmp037659372( 33): Error: 'endif' not expected.

5 ERRORS REPORTED.

I don't understand why I got this error message.
Please help.

Thank you in advance
Reply With Quote
Sponsored Links
  #2  
Old 22nd May 2017, 12:20
andreas.toepper andreas.toepper is offline
Senior Member
 
Join Date: Jun 2004
Posts: 127
andreas.toepper is on a distinguished road
Baan: Baan4, LN6.1 - DB: MSSQL - OS: Linux&Windows
This is due to the basic structure of a report script: you may use code in layout section or in a function. You're trying to use code in the declaration section, which is not allowed.

To execute the code before a layout is printed, you'll need to name the correct section names in the script. Let's assume you're using the detail.1 layout and you're code is to be executed right before printing this layout:

Code:
declaration:
 table  ttdpur401
 extern domain tcamnt amount

detail.1:
before.layout:
 IF tdpur401.cvat = "TX" THEN
 amount = 1.06 * tdpur401.oamt
 ELSE
 amount = 1* tdpur401.oamt 
 ENDIF
If you need to use functions, you can go like this:

Code:
declaration:
 table  ttdpur401
 extern domain tcamnt amount

detail.1:
before.layout:
 calc.vat()

functions:
function void calc.vat()
{
 IF tdpur401.cvat = "TX" THEN
 amount = 1.06 * tdpur401.oamt
 ELSE
 amount = 1* tdpur401.oamt 
 ENDIF
}
Reply With Quote
  #3  
Old 23rd May 2017, 06:26
DatinN DatinN is offline
Member
 
Join Date: Aug 2014
Posts: 65
DatinN is on a distinguished road
Baan: FP7 - DB: SQL - OS: Windows
Hello Andreas,

thank you for your response.
The error eliminate.
now, I'm working on why the form field not display the calculated amount.

Thank you
Reply With Quote
  #4  
Old 23rd May 2017, 07:35
andreas.toepper andreas.toepper is offline
Senior Member
 
Join Date: Jun 2004
Posts: 127
andreas.toepper is on a distinguished road
Baan: Baan4, LN6.1 - DB: MSSQL - OS: Linux&Windows
If tdpur401.amnt is imported from the session script, it Needs to be inserted into the Input fields of the table.
If it is not listed in the input fields of the report, it will be empty or zero. Also trailing spaces may be an issue. Maybe you need to use strip$(tdpur401.cvat) = "TX".
Reply With Quote
  #5  
Old 23rd May 2017, 10:17
DatinN DatinN is offline
Member
 
Join Date: Aug 2014
Posts: 65
DatinN is on a distinguished road
Baan: FP7 - DB: SQL - OS: Windows
hi Andreas,

it display the result when I use strip$(tdpur401.cvat) = "TX".

thank you for help .
Its very much appreciates .
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Total amount differs from sum of amount per line Kennymen Distribution, Transportation & Warehousing 5 28th March 2014 11:10
How to handle Excess Receipt amount in Baan EBS? srivinayak Finance, Invoicing and Integration 2 11th May 2010 06:42
Tax Amount lidia.berbescu Distribution, Transportation & Warehousing 0 9th October 2009 14:19
Commissions riazsayeed Distribution, Transportation & Warehousing 4 31st May 2007 14:57
calculate net rate & amount in Sales Order Lines veyant AFS/DDC/OLE: Function servers 2 16th July 2004 08:27


All times are GMT +2. The time now is 01:07.


©2001-2017 - Baanboard.com - Baanforums.com