Servoy 5.2.12

Servoy announcements

Re: Servoy 5.2.12

Postby Hans Nieuwenhuis » Tue Feb 07, 2012 10:18 pm

Rob,

Regarding the calculations issue :

It happens in our solution that uses a servoy framework ( although I am sure it is not a framework issue ).
I am not able to reproduce it in a sample solution.


It only happens in tableview. Many records in tableview show correct calculation value and many do not !!

In listview or recordview the calculation is always correct !!

This is a major issue for us !!

addition :

The calculation is only wrong for some records when the records are shown in tableview after startup of the application and no edits have been made.
When the calculation is wrong in tableview and I switch to detailview to edit, the calculation is still wrong.
This makes sense because a chang of viewtype does not trigger a recalculation.
But when I edit one of the fields that is part of the calculations, the calculations are correct again.

So it seems to be a problem in tableview when this is initially shown
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: Servoy 5.2.12

Postby jcompagner » Wed Feb 08, 2012 11:46 am

Hans Nieuwenhuis wrote:
Code: Select all
      application.output('vk= ' + calc_verkoopprijs_totaal)
      application.output('ik= ' + calc_inkoopprijs_totaal)
       marge = calc_verkoopprijs_totaal - calc_inkoopprijs_totaal;
       return marge;




what does it output then?
Does it really output 0 for 1 or both outputs?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 7977
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 5.2.12

Postby jcompagner » Wed Feb 08, 2012 11:50 am

nestrocuation wrote:Hi ,

We are using Servoy Webclient 5.2.9

We are planning to update to 5.2.212 from 5.2.9 but we have some issue with security.logout , hope someone can help .

When user clicks on logout , we ask for a confirmation in a dialog box whether they want to logout or not . when they click on yes we do security.logout(solution name) and take them to login page- it works fine in 5.2.9

but in 5.2.12 it opens a new solution login page in the dialog box .


can you create a case for this with a sample attached ?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 7977
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 5.2.12

Postby Hans Nieuwenhuis » Wed Feb 08, 2012 12:18 pm

Johan,

Below you see the output when started in tableview and when started in listview.

B.t.w. the calculations for calc_verkoopprijs_totaal and calc_inkoopprijs_totaal both use a stored procedure call to get there values.
calc_inkoopprijs_totaal is always correct while calc_verkoopprijs_totaal sometimes (not always) gives null when in tableview.
This is test-data, so You will see 0 often, but that is a correct value.

The output in tableview =
Code: Select all
vk= 0
ik= 0
vk=
ik= 0
vk=
ik= 0
vk=
ik= 1839.2
vk= 0
ik= 0
vk= 0
ik= 0
vk=
ik= 20


The output in listview =
Code: Select all
vk= 0
ik= 0
vk= 0
ik= 0
vk= 0
ik= 0
vk= 3084.9230769230767
ik= 1839.2
vk= 0
ik= 0
vk= 0
ik= 0
vk= 20
ik= 20
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: Servoy 5.2.12

Postby jcompagner » Wed Feb 08, 2012 12:51 pm

and if you add application.output() to your 2 calcs that you call?

Also in all your application outputs can you print out the pk of the record? So that we can match them?

can we see all the calc scripts that are touched in this scenario?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 7977
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 5.2.12

Postby Hans Nieuwenhuis » Wed Feb 08, 2012 12:57 pm

I'll do that, but probably this evening.

Thanks
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: Servoy 5.2.12

Postby Hans Nieuwenhuis » Wed Feb 08, 2012 3:01 pm

If I put an application.output in the two main calcs I get the following output in tableview.

Code: Select all
>>in calc_verkoopprijs_totaal calculation: pk = 212
--in calc_inkoopprijs_totaal calculation : pk = 212
>>in calc_verkoopprijs_totaal calculation: pk = 211
--in calc_inkoopprijs_totaal calculation : pk = 211
>>in calc_verkoopprijs_totaal calculation: pk = 210
--in calc_inkoopprijs_totaal calculation : pk = 210
>>in calc_verkoopprijs_totaal calculation: pk = 222
>>in calc_verkoopprijs_totaal calculation: pk = 219
--in calc_inkoopprijs_totaal calculation : pk = 219
--in calc_inkoopprijs_totaal calculation : pk = 222
--in calc_inkoopprijs_totaal calculation : pk = 218
>>in calc_verkoopprijs_totaal calculation: pk = 218
--in calc_inkoopprijs_totaal calculation : pk = 215
>>in calc_verkoopprijs_totaal calculation: pk = 215
>>in calc_verkoopprijs_totaal calculation: pk = 213
--in calc_inkoopprijs_totaal calculation : pk = 213
>>in calc_verkoopprijs_totaal calculation: pk = 203
--in calc_inkoopprijs_totaal calculation : pk = 203
--in calc_inkoopprijs_totaal calculation : pk = 124
>>in calc_verkoopprijs_totaal calculation: pk = 124
--in calc_inkoopprijs_totaal calculation : pk = 3
--in calc_inkoopprijs_totaal calculation : pk = 122
>>in calc_verkoopprijs_totaal calculation: pk = 129
>>in calc_verkoopprijs_totaal calculation: pk = 3
>>in calc_verkoopprijs_totaal calculation: pk = 61
>>in calc_verkoopprijs_totaal calculation: pk = 122
--in calc_inkoopprijs_totaal calculation : pk = 129
--in calc_inkoopprijs_totaal calculation : pk = 61
>>in calc_verkoopprijs_totaal calculation: pk = 128
--in calc_inkoopprijs_totaal calculation : pk = 128
--in calc_inkoopprijs_totaal calculation : pk = 182
>>in calc_verkoopprijs_totaal calculation: pk = 182
>>in calc_verkoopprijs_totaal calculation: pk = 39
--in calc_inkoopprijs_totaal calculation : pk = 39
>>in calc_verkoopprijs_totaal calculation: pk = 156
--in calc_inkoopprijs_totaal calculation : pk = 156
>>in calc_verkoopprijs_totaal calculation: pk = 72
--in calc_inkoopprijs_totaal calculation : pk = 72
--in calc_inkoopprijs_totaal calculation : pk = 158
>>in calc_verkoopprijs_totaal calculation: pk = 158
--in calc_inkoopprijs_totaal calculation : pk = 46
>>in calc_verkoopprijs_totaal calculation: pk = 116
>>in calc_verkoopprijs_totaal calculation: pk = 170
--in calc_inkoopprijs_totaal calculation : pk = 116
>>in calc_verkoopprijs_totaal calculation: pk = 46
--in calc_inkoopprijs_totaal calculation : pk = 170
>>in calc_verkoopprijs_totaal calculation: pk = 64
--in calc_inkoopprijs_totaal calculation : pk = 64
>>in calc_verkoopprijs_totaal calculation: pk = 76
--in calc_inkoopprijs_totaal calculation : pk = 76
>>in calc_verkoopprijs_totaal calculation: pk = 96
--in calc_inkoopprijs_totaal calculation : pk = 96
>>in calc_verkoopprijs_totaal calculation: pk = 62
--in calc_inkoopprijs_totaal calculation : pk = 62
>>in calc_verkoopprijs_totaal calculation: pk = 112
--in calc_inkoopprijs_totaal calculation : pk = 112
>>in calc_verkoopprijs_totaal calculation: pk = 26
--in calc_inkoopprijs_totaal calculation : pk = 26
>>in calc_verkoopprijs_totaal calculation: pk = 139
--in calc_inkoopprijs_totaal calculation : pk = 139
>>in calc_verkoopprijs_totaal calculation: pk = 63
--in calc_inkoopprijs_totaal calculation : pk = 63
>>in calc_verkoopprijs_totaal calculation: pk = 1
>>in calc_verkoopprijs_totaal calculation: pk = 169
--in calc_inkoopprijs_totaal calculation : pk = 1
--in calc_inkoopprijs_totaal calculation : pk = 169
>>in calc_verkoopprijs_totaal calculation: pk = 138
>>in calc_verkoopprijs_totaal calculation: pk = 8
--in calc_inkoopprijs_totaal calculation : pk = 138
--in calc_inkoopprijs_totaal calculation : pk = 8
--in calc_inkoopprijs_totaal calculation : pk = 108
>>in calc_verkoopprijs_totaal calculation: pk = 108


and in listview I get

Code: Select all
>>in calc_verkoopprijs_totaal calculation: pk = 1
--in calc_inkoopprijs_totaal calculation : pk = 1
>>in calc_verkoopprijs_totaal calculation: pk = 212
--in calc_inkoopprijs_totaal calculation : pk = 212
>>in calc_verkoopprijs_totaal calculation: pk = 211
--in calc_inkoopprijs_totaal calculation : pk = 211
>>in calc_verkoopprijs_totaal calculation: pk = 210
--in calc_inkoopprijs_totaal calculation : pk = 210
>>in calc_verkoopprijs_totaal calculation: pk = 222
--in calc_inkoopprijs_totaal calculation : pk = 222
>>in calc_verkoopprijs_totaal calculation: pk = 219
--in calc_inkoopprijs_totaal calculation : pk = 219
>>in calc_verkoopprijs_totaal calculation: pk = 218
--in calc_inkoopprijs_totaal calculation : pk = 218
>>in calc_verkoopprijs_totaal calculation: pk = 215
--in calc_inkoopprijs_totaal calculation : pk = 215
>>in calc_verkoopprijs_totaal calculation: pk = 213
--in calc_inkoopprijs_totaal calculation : pk = 213
>>in calc_verkoopprijs_totaal calculation: pk = 203
--in calc_inkoopprijs_totaal calculation : pk = 203
>>in calc_verkoopprijs_totaal calculation: pk = 124
--in calc_inkoopprijs_totaal calculation : pk = 124
>>in calc_verkoopprijs_totaal calculation: pk = 129
--in calc_inkoopprijs_totaal calculation : pk = 129
>>in calc_verkoopprijs_totaal calculation: pk = 122
--in calc_inkoopprijs_totaal calculation : pk = 122
>>in calc_verkoopprijs_totaal calculation: pk = 3
--in calc_inkoopprijs_totaal calculation : pk = 3
>>in calc_verkoopprijs_totaal calculation: pk = 61
--in calc_inkoopprijs_totaal calculation : pk = 61
>>in calc_verkoopprijs_totaal calculation: pk = 182
--in calc_inkoopprijs_totaal calculation : pk = 182
>>in calc_verkoopprijs_totaal calculation: pk = 128
--in calc_inkoopprijs_totaal calculation : pk = 128
>>in calc_verkoopprijs_totaal calculation: pk = 39
--in calc_inkoopprijs_totaal calculation : pk = 39
>>in calc_verkoopprijs_totaal calculation: pk = 156
--in calc_inkoopprijs_totaal calculation : pk = 156
>>in calc_verkoopprijs_totaal calculation: pk = 72
--in calc_inkoopprijs_totaal calculation : pk = 72
>>in calc_verkoopprijs_totaal calculation: pk = 158
--in calc_inkoopprijs_totaal calculation : pk = 158
>>in calc_verkoopprijs_totaal calculation: pk = 46
--in calc_inkoopprijs_totaal calculation : pk = 46
>>in calc_verkoopprijs_totaal calculation: pk = 116
--in calc_inkoopprijs_totaal calculation : pk = 116


the output when using application.output ( also for pk) in the calc_marge calculation is :

in tableview

Code: Select all
pk= 212
vk= 0
ik= 0
pk= 211
vk=
ik= 0
pk= 210
vk=
ik= 0
pk= 222
vk=
ik= 1839.2
pk= 219
vk=
ik= 0
pk= 218
vk=
ik= 0
pk= 215
vk=
ik= 20
pk= 213
vk= 0
ik= 0
pk= 203
vk= 0
ik= 0
pk= 124
vk= 0
ik= 0
pk= 129
vk=
pk= 122
vk=
pk= 3
vk=
ik= 0
ik= 0
ik= 0
pk= 61
vk= 0
ik= 0
pk= 182
vk=
pk= 128
vk= 0
ik= 0
ik= 0
pk= 39
vk=
ik= 0
pk= 156
vk= 0
ik= 0
pk= 72
vk=
ik= 0
pk= 158
vk= 21
ik= 17.85
pk= 46
vk=
pk= 116
vk=
pk= 170
vk=
ik= 0
ik= 0
ik= 0
pk= 64
vk= 3500
ik= 0
pk= 76
vk=
ik= 0
pk= 96
vk=
ik= 0
pk= 62
vk= 0
ik= 0
pk= 112
vk=
ik= 0
pk= 26
vk= 0
pk= 139
ik= 0
vk= 0
ik= 0
pk= 138
vk=
pk= 8
vk=
pk= 1
vk=
pk= 63
vk= 3000
ik= 0
pk= 169
vk=
ik= 162.25
pk= 108
vk=
ik= 0
ik= 1721.96
ik= 146.56
ik= 392.72
pk= 211
vk= 0
ik= 0
pk= 210
vk= 0
ik= 0
pk= 218
vk= 0
ik= 0
pk= 122
vk= 0
ik= 0
pk= 116
vk= 0
ik= 0
pk= 108
vk= 822.59
ik= 392.72


in listview :

Code: Select all
pk= 1
vk= 341.54
ik= 162.25
pk= 212
vk= 0
ik= 0
pk= 211
vk= 0
ik= 0
pk= 210
vk= 0
ik= 0
pk= 222
vk= 3084.9230769230767
ik= 1839.2
pk= 219
vk= 0
ik= 0
pk= 218
vk= 0
ik= 0
pk= 215
vk= 20
ik= 20
pk= 213
vk= 0
ik= 0
pk= 203
vk= 0
ik= 0
pk= 124
vk= 0
ik= 0
pk= 129
vk= 0
ik= 0
pk= 122
vk= 0
ik= 0
pk= 3
vk= 0
ik= 0
pk= 61
vk= 0
ik= 0
pk= 182
vk= 0
ik= 0
pk= 128
vk= 0
ik= 0
pk= 39
vk= 0
ik= 0
pk= 156
vk= 0
ik= 0
pk= 72
vk= 0
ik= 0
pk= 158
vk= 21
ik= 17.85
pk= 46
vk= 0
ik= 0
pk= 116
vk= 0
ik= 0


the tree calcs that are involved are :
on both tableview and listview, the calc_verkoopprijs_totaal and calc_marge are shown , the calc_inkoopprijs_totaal is not shown in both.
the _dumx variables in the calcs are there to get a recalculation if one of the referenced fields is show, that still works fine.
b.t.w. we do not edit in tableview only in record and listview.

Code: Select all
function calc_inkoopprijs_totaal()
{
   if(utils.hasRecords(bcom_full_ondh_contracten_to_ondh_contractregels))
   {

      if(utils.hasRecords(bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels))
      {
         var _dum2 = bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels.ondhiksrg_aantal
         var _dum3 = bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels.ondhiksrg_ikprijs
      }
   }
   application.output('--in calc_inkoopprijs_totaal calculation : pk = ' + ondhcon_id)
   var args = new Array();
   args[0] = java.sql.Types.NUMERIC;
   args[1] = ondhcon_id
   var typesArray = new Array();
   typesArray[0] = 1;
   typesArray[1] = 0;
   var proc_declaration = '{?=call get_ondh_verkorder_inkbedr_tot(?)}';
   var dmesp = plugins.rawSQL.executeStoredProcedure('berp2', proc_declaration, args, typesArray, 1);
   return dmesp.getValue(1, 1);
}


Code: Select all
function calc_verkoopprijs_totaal()
{
   if(utils.hasRecords(bcom_full_ondh_contracten_to_ondh_contractregels))
   {
      var _dum4 = bcom_full_ondh_contracten_to_ondh_contractregels.ondhconrgl_korting_perc
      if(utils.hasRecords(bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels))
      {
         var _dum2 = bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels.ondhiksrg_aantal
         var _dum3 = bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels.ondhiksrg_vkprijs
      }
   }
   application.output('>>in calc_verkoopprijs_totaal calculation: pk = ' + ondhcon_id)
   var args = new Array();
   args[0] = java.sql.Types.NUMERIC;
   args[1] = ondhcon_id
   var typesArray = new Array();
   typesArray[0] = 1;
   typesArray[1] = 0;
   var proc_declaration = '{?=call get_ondh_verkok_vkbedr_tot(?)}';
   var dmesp = plugins.rawSQL.executeStoredProcedure('berp2', proc_declaration, args, typesArray, 1);
   return dmesp.getValue(1, 1);
}


Code: Select all
function calc_marge()
{
       //application.output('pk= ' + ondhcon_id) 
      //application.output('vk= ' + calc_verkoopprijs_totaal)
      //application.output('ik= ' + calc_inkoopprijs_totaal)
       var marge = calc_verkoopprijs_totaal - calc_inkoopprijs_totaal;
       return marge;

}


Regards,
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Problem also in 5.2.11 but not in 5.2.10

Postby Hans Nieuwenhuis » Wed Feb 08, 2012 4:13 pm

This problem also exists in 5.2.11.

Sorry :oops: for this, I developed in 5.2.10, then changed to 5.2.12 ( I skipped 5.2.11 ).

The problem does not exist in 5.2.10

addition : I installed it in 5.2.11 this afternoon and checked.
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: Servoy 5.2.12

Postby jcompagner » Wed Feb 08, 2012 4:36 pm

so as far as i can see, the 2 calcs are called just fine
i only see a difference with PK = 1 in listview that isn't there in tableview (but i guess that is not that important)

i see this:

>>in calc_verkoopprijs_totaal calculation: pk = 212
--in calc_inkoopprijs_totaal calculation : pk = 212
>>in calc_verkoopprijs_totaal calculation: pk = 211
--in calc_inkoopprijs_totaal calculation : pk = 211

and this:

pk= 212
vk= 0
ik= 0
pk= 211
vk=
ik= 0

Why is that output not alternated?
i would expect:

pk=212
>>in calc_verkoopprijs_totaal calculation: pk = 212
vk=0
--in calc_inkoopprijs_totaal calculation : pk = 212
ik = 0
pk = 211
>>in calc_verkoopprijs_totaal calculation: pk = 211
vk=
--in calc_inkoopprijs_totaal calculation : pk = 211
ik=0;

if you have the right application outputs everywhere

But if that is what you get, are you sue that the vk returns the right value??
so if you do:

application.output('>>in calc_verkoopprijs_totaal calculation: pk = ' + ondhcon_id +' value: '+ dmesp.getValue(1, 1));
(as the last line just before the return)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 7977
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 5.2.12

Postby Hans Nieuwenhuis » Wed Feb 08, 2012 5:01 pm

Ok, did that.

It looks like in tableview, sometimes the calculation calc_verkoopprijs_totaal is not done in sync with the rest.
You can see that for Pk 211 the newly added application.output is much later on in the output!!

In listview they are always in synch !!

The output from tableview is :

Code: Select all
>>in calc_verkoopprijs_totaal calculation: pk = 212
>>in calc_verkoopprijs_totaal calculation: pk = 212 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 212
>>in calc_verkoopprijs_totaal calculation: pk = 211
--in calc_inkoopprijs_totaal calculation : pk = 211
>>in calc_verkoopprijs_totaal calculation: pk = 210
--in calc_inkoopprijs_totaal calculation : pk = 210
>>in calc_verkoopprijs_totaal calculation: pk = 219
--in calc_inkoopprijs_totaal calculation : pk = 219
>>in calc_verkoopprijs_totaal calculation: pk = 222
>>in calc_verkoopprijs_totaal calculation: pk = 222 value: 3084.9230769230767
--in calc_inkoopprijs_totaal calculation : pk = 222
>>in calc_verkoopprijs_totaal calculation: pk = 215
>>in calc_verkoopprijs_totaal calculation: pk = 215 value: 20
--in calc_inkoopprijs_totaal calculation : pk = 215
>>in calc_verkoopprijs_totaal calculation: pk = 213
>>in calc_verkoopprijs_totaal calculation: pk = 213 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 213
>>in calc_verkoopprijs_totaal calculation: pk = 203
>>in calc_verkoopprijs_totaal calculation: pk = 203 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 203
>>in calc_verkoopprijs_totaal calculation: pk = 124
>>in calc_verkoopprijs_totaal calculation: pk = 124 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 124
>>in calc_verkoopprijs_totaal calculation: pk = 210 value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 219 value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 211 value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 218
>>in calc_verkoopprijs_totaal calculation: pk = 218 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 218
>>in calc_verkoopprijs_totaal calculation: pk = 61
--in calc_inkoopprijs_totaal calculation : pk = 129
>>in calc_verkoopprijs_totaal calculation: pk = 129
>>in calc_verkoopprijs_totaal calculation: pk = 61 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 122
>>in calc_verkoopprijs_totaal calculation: pk = 122
--in calc_inkoopprijs_totaal calculation : pk = 3
>>in calc_verkoopprijs_totaal calculation: pk = 3
--in calc_inkoopprijs_totaal calculation : pk = 61
>>in calc_verkoopprijs_totaal calculation: pk = 3 value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 128
--in calc_inkoopprijs_totaal calculation : pk = 128
>>in calc_verkoopprijs_totaal calculation: pk = 128 value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 39
--in calc_inkoopprijs_totaal calculation : pk = 39
>>in calc_verkoopprijs_totaal calculation: pk = 122 value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 156
--in calc_inkoopprijs_totaal calculation : pk = 156
>>in calc_verkoopprijs_totaal calculation: pk = 72
>>in calc_verkoopprijs_totaal calculation: pk = 129 value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 39 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 72
>>in calc_verkoopprijs_totaal calculation: pk = 158
>>in calc_verkoopprijs_totaal calculation: pk = 158 value: 21
--in calc_inkoopprijs_totaal calculation : pk = 158
>>in calc_verkoopprijs_totaal calculation: pk = 72 value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 156 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 182
>>in calc_verkoopprijs_totaal calculation: pk = 182
>>in calc_verkoopprijs_totaal calculation: pk = 182 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 46
>>in calc_verkoopprijs_totaal calculation: pk = 46
>>in calc_verkoopprijs_totaal calculation: pk = 46 value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 64
>>in calc_verkoopprijs_totaal calculation: pk = 64 value: 3500
--in calc_inkoopprijs_totaal calculation : pk = 76
>>in calc_verkoopprijs_totaal calculation: pk = 96
>>in calc_verkoopprijs_totaal calculation: pk = 96 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 96
>>in calc_verkoopprijs_totaal calculation: pk = 62
>>in calc_verkoopprijs_totaal calculation: pk = 62 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 62
>>in calc_verkoopprijs_totaal calculation: pk = 112
>>in calc_verkoopprijs_totaal calculation: pk = 112 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 112
>>in calc_verkoopprijs_totaal calculation: pk = 26
>>in calc_verkoopprijs_totaal calculation: pk = 26 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 26
>>in calc_verkoopprijs_totaal calculation: pk = 139
>>in calc_verkoopprijs_totaal calculation: pk = 139 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 139
>>in calc_verkoopprijs_totaal calculation: pk = 76
>>in calc_verkoopprijs_totaal calculation: pk = 76 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 170
>>in calc_verkoopprijs_totaal calculation: pk = 170
--in calc_inkoopprijs_totaal calculation : pk = 64
>>in calc_verkoopprijs_totaal calculation: pk = 170 value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 116
--in calc_inkoopprijs_totaal calculation : pk = 116
>>in calc_verkoopprijs_totaal calculation: pk = 1
>>in calc_verkoopprijs_totaal calculation: pk = 1 value: 341.54
>>in calc_verkoopprijs_totaal calculation: pk = 8
>>in calc_verkoopprijs_totaal calculation: pk = 8 value: 1990.33
>>in calc_verkoopprijs_totaal calculation: pk = 116 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 1
>>in calc_verkoopprijs_totaal calculation: pk = 63
>>in calc_verkoopprijs_totaal calculation: pk = 169
>>in calc_verkoopprijs_totaal calculation: pk = 63 value: 3000
--in calc_inkoopprijs_totaal calculation : pk = 169
>>in calc_verkoopprijs_totaal calculation: pk = 169 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 108
>>in calc_verkoopprijs_totaal calculation: pk = 138
--in calc_inkoopprijs_totaal calculation : pk = 138
--in calc_inkoopprijs_totaal calculation : pk = 8
--in calc_inkoopprijs_totaal calculation : pk = 63
>>in calc_verkoopprijs_totaal calculation: pk = 138 value: 297.89
>>in calc_verkoopprijs_totaal calculation: pk = 108
>>in calc_verkoopprijs_totaal calculation: pk = 108 value: 822.59
--in calc_inkoopprijs_totaal calculation : pk = 108


output from listview is :

Code: Select all
>>in calc_verkoopprijs_totaal calculation: pk = 1
>>in calc_verkoopprijs_totaal calculation: pk = 1 value: 341.54
--in calc_inkoopprijs_totaal calculation : pk = 1
>>in calc_verkoopprijs_totaal calculation: pk = 212
>>in calc_verkoopprijs_totaal calculation: pk = 212 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 212
>>in calc_verkoopprijs_totaal calculation: pk = 211
>>in calc_verkoopprijs_totaal calculation: pk = 211 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 211
>>in calc_verkoopprijs_totaal calculation: pk = 210
>>in calc_verkoopprijs_totaal calculation: pk = 210 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 210
>>in calc_verkoopprijs_totaal calculation: pk = 222
>>in calc_verkoopprijs_totaal calculation: pk = 222 value: 3084.9230769230767
--in calc_inkoopprijs_totaal calculation : pk = 222
>>in calc_verkoopprijs_totaal calculation: pk = 219
>>in calc_verkoopprijs_totaal calculation: pk = 219 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 219
>>in calc_verkoopprijs_totaal calculation: pk = 218
>>in calc_verkoopprijs_totaal calculation: pk = 218 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 218
>>in calc_verkoopprijs_totaal calculation: pk = 215
>>in calc_verkoopprijs_totaal calculation: pk = 215 value: 20
--in calc_inkoopprijs_totaal calculation : pk = 215
>>in calc_verkoopprijs_totaal calculation: pk = 213
>>in calc_verkoopprijs_totaal calculation: pk = 213 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 213
>>in calc_verkoopprijs_totaal calculation: pk = 203
>>in calc_verkoopprijs_totaal calculation: pk = 203 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 203
>>in calc_verkoopprijs_totaal calculation: pk = 124
>>in calc_verkoopprijs_totaal calculation: pk = 124 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 124
>>in calc_verkoopprijs_totaal calculation: pk = 129
>>in calc_verkoopprijs_totaal calculation: pk = 129 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 129
>>in calc_verkoopprijs_totaal calculation: pk = 122
>>in calc_verkoopprijs_totaal calculation: pk = 122 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 122
>>in calc_verkoopprijs_totaal calculation: pk = 3
>>in calc_verkoopprijs_totaal calculation: pk = 3 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 3
>>in calc_verkoopprijs_totaal calculation: pk = 61
>>in calc_verkoopprijs_totaal calculation: pk = 61 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 61
>>in calc_verkoopprijs_totaal calculation: pk = 182
>>in calc_verkoopprijs_totaal calculation: pk = 182 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 182
>>in calc_verkoopprijs_totaal calculation: pk = 128
>>in calc_verkoopprijs_totaal calculation: pk = 128 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 128
>>in calc_verkoopprijs_totaal calculation: pk = 39
>>in calc_verkoopprijs_totaal calculation: pk = 39 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 39
>>in calc_verkoopprijs_totaal calculation: pk = 156
>>in calc_verkoopprijs_totaal calculation: pk = 156 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 156
>>in calc_verkoopprijs_totaal calculation: pk = 72
>>in calc_verkoopprijs_totaal calculation: pk = 72 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 72
>>in calc_verkoopprijs_totaal calculation: pk = 158
>>in calc_verkoopprijs_totaal calculation: pk = 158 value: 21
--in calc_inkoopprijs_totaal calculation : pk = 158
>>in calc_verkoopprijs_totaal calculation: pk = 46
>>in calc_verkoopprijs_totaal calculation: pk = 46 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 46
>>in calc_verkoopprijs_totaal calculation: pk = 116
>>in calc_verkoopprijs_totaal calculation: pk = 116 value: 0
--in calc_inkoopprijs_totaal calculation : pk = 116


regards,
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: Servoy 5.2.12

Postby jcompagner » Wed Feb 08, 2012 7:03 pm

i am completely confused.

Please add 3 (and only 3) application.outputs()

1 in every calc (at the same time so all 3 should be seen at once)
so:

calc_inkoopprijs_totaal:
application.output('--in calc_inkoopprijs_totaal calculation : pk = ' + ondhcon_id + ', value: ' + dmesp.getValue(1, 1));

calc_verkoopprijs_totaal
application.output('>>in calc_verkoopprijs_totaal calculation: pk = ' + ondhcon_id + ', value: ' + dmesp.getValue(1, 1));

and the last in calc_marge:

application.output('pk=' + ondhcon_id+ ', ik= ' + calc_inkoopprijs_totaal + ', vk= ' +calc_verkoopprijs_totaal);

Then it should be more clear, we need to know exactly when is called what
because you say that for Pk 211 it is called way later
which is completely not logical also because i see those also in the first lines:

>>in calc_verkoopprijs_totaal calculation: pk = 211
--in calc_inkoopprijs_totaal calculation : pk = 211
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 7977
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 5.2.12

Postby Hans Nieuwenhuis » Wed Feb 08, 2012 8:40 pm

Johan, sorry for the confussion.

I'll give you the required info in my next reply, but I think it is important to reply on my previous reply.
As you can see the two calculations had one application output before and one after the call to the stored procedure.
I did that to show to You that the calculation calc_verkoopprijs_totaal is called when it should, but the other calculations
are called before the stored procedure call is completed.

That is why you see the line : >>in calc_verkoopprijs_totaal calculation: pk = 211 in sync.
but the line : >>in calc_verkoopprijs_totaal calculation: pk = 211 value: 0 is way to late in tableview



Code: Select all
function calc_verkoopprijs_totaal()
{
   if(utils.hasRecords(bcom_full_ondh_contracten_to_ondh_contractregels))
   {
      var _dum4 = bcom_full_ondh_contracten_to_ondh_contractregels.ondhconrgl_korting_perc
      if(utils.hasRecords(bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels))
      {
         var _dum2 = bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels.ondhiksrg_aantal
         var _dum3 = bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels.ondhiksrg_vkprijs
      }
   }
   application.output('>>in calc_verkoopprijs_totaal calculation: pk = ' + ondhcon_id)
   var args = new Array();
   args[0] = java.sql.Types.NUMERIC;
   args[1] = ondhcon_id
   var typesArray = new Array();
   typesArray[0] = 1;
   typesArray[1] = 0;
   var proc_declaration = '{?=call get_ondh_verkok_vkbedr_tot(?)}';
   var dmesp = plugins.rawSQL.executeStoredProcedure('berp2', proc_declaration, args, typesArray, 1);
   application.output('>>in calc_verkoopprijs_totaal calculation: pk = ' + ondhcon_id +' value: '+ dmesp.getValue(1, 1));
   return dmesp.getValue(1, 1);
}


Code: Select all
function calc_inkoopprijs_totaal()
{
   if(utils.hasRecords(bcom_full_ondh_contracten_to_ondh_contractregels))
   {

      if(utils.hasRecords(bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels))
      {
         var _dum2 = bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels.ondhiksrg_aantal
         var _dum3 = bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels.ondhiksrg_ikprijs
      }
   }
   application.output('--in calc_inkoopprijs_totaal calculation : pk = ' + ondhcon_id)
   var args = new Array();
   args[0] = java.sql.Types.NUMERIC;
   args[1] = ondhcon_id
   var typesArray = new Array();
   typesArray[0] = 1;
   typesArray[1] = 0;
   var proc_declaration = '{?=call get_ondh_verkorder_inkbedr_tot(?)}';
   var dmesp = plugins.rawSQL.executeStoredProcedure('berp2', proc_declaration, args, typesArray, 1);
   return dmesp.getValue(1, 1);
}
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: Servoy 5.2.12

Postby Hans Nieuwenhuis » Wed Feb 08, 2012 8:52 pm

Johan,

Below the output You requested :

Same thing here, in tableview the calcs are not in sync !
In Listview they are in sync and everything is correct !

Tableview

Code: Select all
>>in calc_verkoopprijs_totaal calculation: pk = 212, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 212, value: 0
pk=212, ik= 0, vk= 0
--in calc_inkoopprijs_totaal calculation : pk = 211, value: 0
pk=211, ik= 0, vk=
>>in calc_verkoopprijs_totaal calculation: pk = 211, value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 210, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 210, value: 0
pk=210, ik= 0, vk= 0
--in calc_inkoopprijs_totaal calculation : pk = 222, value: 1839.2
pk=222, ik= 1839.2, vk=
>>in calc_verkoopprijs_totaal calculation: pk = 222, value: 3084.9230769230767
>>in calc_verkoopprijs_totaal calculation: pk = 219, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 219, value: 0
pk=219, ik= 0, vk= 0
--in calc_inkoopprijs_totaal calculation : pk = 218, value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 218, value: 0
pk=218, ik= 0, vk=
--in calc_inkoopprijs_totaal calculation : pk = 215, value: 20
>>in calc_verkoopprijs_totaal calculation: pk = 215, value: 20
pk=215, ik= 20, vk=
>>in calc_verkoopprijs_totaal calculation: pk = 213, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 213, value: 0
pk=213, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 203, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 203, value: 0
pk=203, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 124, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 124, value: 0
pk=124, ik= 0, vk= 0
--in calc_inkoopprijs_totaal calculation : pk = 122, value: 0
pk=122, ik= 0, vk=
--in calc_inkoopprijs_totaal calculation : pk = 3, value: 0
pk=3, ik= 0, vk=
>>in calc_verkoopprijs_totaal calculation: pk = 3, value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 61, value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 129, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 61, value: 0
pk=61, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 128, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 128, value: 0
pk=128, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 182, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 182, value: 0
pk=182, ik= 0, vk= 0
--in calc_inkoopprijs_totaal calculation : pk = 129, value: 0
pk=129, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 122, value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 39, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 39, value: 0
pk=39, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 156, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 156, value: 0
pk=156, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 72, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 72, value: 0
pk=72, ik= 0, vk= 0
--in calc_inkoopprijs_totaal calculation : pk = 158, value: 17.85
pk=158, ik= 17.85, vk=
>>in calc_verkoopprijs_totaal calculation: pk = 158, value: 21
>>in calc_verkoopprijs_totaal calculation: pk = 46, value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 116, value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 170, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 170, value: 0
pk=170, ik= 0, vk= 0
--in calc_inkoopprijs_totaal calculation : pk = 116, value: 0
pk=116, ik= 0, vk= 0
--in calc_inkoopprijs_totaal calculation : pk = 46, value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 64, value: 3500
pk=46, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 76, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 64, value: 0
pk=64, ik= 0, vk= 3500
--in calc_inkoopprijs_totaal calculation : pk = 76, value: 0
pk=76, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 96, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 96, value: 0
pk=96, ik= 0, vk= 0
--in calc_inkoopprijs_totaal calculation : pk = 62, value: 0
pk=62, ik= 0, vk=
>>in calc_verkoopprijs_totaal calculation: pk = 62, value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 112, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 112, value: 0
pk=112, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 26, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 139, value: 0
>>in calc_verkoopprijs_totaal calculation: pk = 139, value: 0
pk=139, ik= 0, vk=
--in calc_inkoopprijs_totaal calculation : pk = 26, value: 0
pk=26, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 63, value: 3000
--in calc_inkoopprijs_totaal calculation : pk = 63, value: 0
pk=63, ik= 0, vk= 3000
--in calc_inkoopprijs_totaal calculation : pk = 1, value: 162.25
>>in calc_verkoopprijs_totaal calculation: pk = 169, value: 0
pk=1, ik= 162.25, vk=
--in calc_inkoopprijs_totaal calculation : pk = 169, value: 0
pk=169, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 1, value: 341.54
>>in calc_verkoopprijs_totaal calculation: pk = 108, value: 822.59
--in calc_inkoopprijs_totaal calculation : pk = 108, value: 392.72
pk=108, ik= 392.72, vk= 822.59
>>in calc_verkoopprijs_totaal calculation: pk = 8, value: 1990.33
--in calc_inkoopprijs_totaal calculation : pk = 8, value: 1721.96
pk=8, ik= 1721.96, vk= 1990.33
--in calc_inkoopprijs_totaal calculation : pk = 138, value: 146.56
>>in calc_verkoopprijs_totaal calculation: pk = 138, value: 297.89
pk=138, ik= 146.56, vk= 297.89
pk=211, ik= 0, vk= 0
--in calc_inkoopprijs_totaal calculation : pk = 222, value: 1839.2
pk=222, ik= 1839.2, vk= 3084.9230769230767
pk=122, ik= 0, vk= 0
pk=3, ik= 0, vk= 0
pk=158, ik= 17.85, vk= 21
pk=62, ik= 0, vk= 0
pk=1, ik= 162.25, vk= 341.54


Listview

Code: Select all
>>in calc_verkoopprijs_totaal calculation: pk = 1, value: 341.54
--in calc_inkoopprijs_totaal calculation : pk = 1, value: 162.25
pk=1, ik= 162.25, vk= 341.54
>>in calc_verkoopprijs_totaal calculation: pk = 212, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 212, value: 0
pk=212, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 211, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 211, value: 0
pk=211, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 210, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 210, value: 0
pk=210, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 222, value: 3084.9230769230767
--in calc_inkoopprijs_totaal calculation : pk = 222, value: 1839.2
pk=222, ik= 1839.2, vk= 3084.9230769230767
>>in calc_verkoopprijs_totaal calculation: pk = 219, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 219, value: 0
pk=219, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 218, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 218, value: 0
pk=218, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 215, value: 20
--in calc_inkoopprijs_totaal calculation : pk = 215, value: 20
pk=215, ik= 20, vk= 20
>>in calc_verkoopprijs_totaal calculation: pk = 213, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 213, value: 0
pk=213, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 203, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 203, value: 0
pk=203, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 124, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 124, value: 0
pk=124, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 129, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 129, value: 0
pk=129, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 122, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 122, value: 0
pk=122, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 3, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 3, value: 0
pk=3, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 61, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 61, value: 0
pk=61, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 182, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 182, value: 0
pk=182, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 128, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 128, value: 0
pk=128, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 39, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 39, value: 0
pk=39, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 156, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 156, value: 0
pk=156, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 72, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 72, value: 0
pk=72, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 158, value: 21
--in calc_inkoopprijs_totaal calculation : pk = 158, value: 17.85
pk=158, ik= 17.85, vk= 21
>>in calc_verkoopprijs_totaal calculation: pk = 46, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 46, value: 0
pk=46, ik= 0, vk= 0
>>in calc_verkoopprijs_totaal calculation: pk = 116, value: 0
--in calc_inkoopprijs_totaal calculation : pk = 116, value: 0
pk=116, ik= 0, vk= 0


Code: Select all
function calc_verkoopprijs_totaal()
{
   if(utils.hasRecords(bcom_full_ondh_contracten_to_ondh_contractregels))
   {
      var _dum4 = bcom_full_ondh_contracten_to_ondh_contractregels.ondhconrgl_korting_perc
      if(utils.hasRecords(bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels))
      {
         var _dum2 = bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels.ondhiksrg_aantal
         var _dum3 = bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels.ondhiksrg_vkprijs
      }
   }
   var args = new Array();
   args[0] = java.sql.Types.NUMERIC;
   args[1] = ondhcon_id
   var typesArray = new Array();
   typesArray[0] = 1;
   typesArray[1] = 0;
   var proc_declaration = '{?=call get_ondh_verkok_vkbedr_tot(?)}';
   var dmesp = plugins.rawSQL.executeStoredProcedure('berp2', proc_declaration, args, typesArray, 1);
   application.output('>>in calc_verkoopprijs_totaal calculation: pk = ' + ondhcon_id + ', value: ' + dmesp.getValue(1, 1));
   return dmesp.getValue(1, 1);
}


Code: Select all
function calc_inkoopprijs_totaal()
{
   if(utils.hasRecords(bcom_full_ondh_contracten_to_ondh_contractregels))
   {

      if(utils.hasRecords(bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels))
      {
         var _dum2 = bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels.ondhiksrg_aantal
         var _dum3 = bcom_full_ondh_contracten_to_ondh_contractregels.bcom_full_ondh_contractregels_to_ondh_inkorderspecregels.ondhiksrg_ikprijs
      }
   }
   var args = new Array();
   args[0] = java.sql.Types.NUMERIC;
   args[1] = ondhcon_id
   var typesArray = new Array();
   typesArray[0] = 1;
   typesArray[1] = 0;
   var proc_declaration = '{?=call get_ondh_verkorder_inkbedr_tot(?)}';
   var dmesp = plugins.rawSQL.executeStoredProcedure('berp2', proc_declaration, args, typesArray, 1);
   application.output('--in calc_inkoopprijs_totaal calculation : pk = ' + ondhcon_id + ', value: ' + dmesp.getValue(1, 1));
   return dmesp.getValue(1, 1);
}


Code: Select all
function calc_marge()
{
       var marge = calc_verkoopprijs_totaal - calc_inkoopprijs_totaal;
      application.output('pk=' + ondhcon_id+ ', ik= ' + calc_inkoopprijs_totaal + ', vk= ' +calc_verkoopprijs_totaal);       
       return marge;

}
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

Re: Servoy 5.2.12

Postby jcompagner » Wed Feb 08, 2012 11:15 pm

i think i know what goes wrong in your situation now.

Tableview has a special threading mode, so rows are filled in in the background in multiply threads.

So are you also showing that calc_verkoopprijs_totaal in the tableview itself or is it also touched through another calc that is shown?

Because then one thread is trying to show the calc itself and calculates it and then the other is asking for that same calc (through another calc) but it is not calculated yet and it will return the previous value (in your case null/nothing)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 7977
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Servoy 5.2.12

Postby Hans Nieuwenhuis » Thu Feb 09, 2012 9:23 am

Well, I am glad it can be explained.

But this was no problem in 5.2.10 and before.

calc_verkoopprijs_totaal is shown in the tableview and also calc_marge.

calc_inkoopprijs_totaal is NOT shown.

I guess this is a bug then.
What would be the best workaround ?
I could create an extra calculation that is a copy of calc_verkoopprijs_totaal and show that in the tableview.
But this means that the stored procedure is fired twice and the reason I use it, is performance/resources.

Thanks
Hans Nieuwenhuis
Betagraphics
http://www.deltics.nl
http://www.betagraphics.nl

Servoy Version 7.3.1
Java version 1.7.0.x
Database Oracle 11g
User avatar
Hans Nieuwenhuis
 
Posts: 1026
Joined: Thu Apr 12, 2007 12:36 pm
Location: Hengelo, The Netherlands

PreviousNext

Return to Announcements

Who is online

Users browsing this forum: No registered users and 1 guest

cron