Copy link to clipboard
Copied
This form currently calculates contract value as price per m2 x floor area
but it needs to be:-
Price per m2 x floor area x minimum hire period
(The minimum hire period being 52)
Eg. Boarding accommodation of 5000 m2 should come out at £1,950,000 – £2,080,000
I have uploaded the file with notes showing current javascript code.
Any help much appreciated. I'm a Javascript novice so please be gentle 🙂
Try to replace code in "requirements 15" field with the code below and see if that helps you:
var req1 = Number(this.getField("requirements 14").valueAsString);
var req2 = Number(this.getField("requirements 25").valueAsString);
var area = Number(this.getField("Floor Area").valueAsString);
var c1 = area*req1*52;
var c2 = area*req2*52;
event.value = util.printf("£%,0.0f",c1) + " - " + util.printf("£%,0.0f",c2);
Hi, see if this is what you looking for:
https://drive.google.com/uc?export=download&id=1cGudHlsipTtnWlN5sETXoNjPs55QbNkB
I also input space in "Contract value" field between currency simbol so all fields with currency now look same.
Copy link to clipboard
Copied
Try to replace code in "requirements 15" field with the code below and see if that helps you:
var req1 = Number(this.getField("requirements 14").valueAsString);
var req2 = Number(this.getField("requirements 25").valueAsString);
var area = Number(this.getField("Floor Area").valueAsString);
var c1 = area*req1*52;
var c2 = area*req2*52;
event.value = util.printf("£%,0.0f",c1) + " - " + util.printf("£%,0.0f",c2);
Copy link to clipboard
Copied
Hey. Nesa
Just tried that and it works perfectly. What a legend!
Thank you so much!!!
🙂
Copy link to clipboard
Copied
Hi Nesa. Just when I thought this job was complete I have been asked to add two more fields 😞
Is it possible to expand the Javascript so that the floor area populates the delivery and installation and foundations fields? Both are based on floor area:-
Delivery calculation should be Floor area x 65 in £'s
Foundation calalculation should be Floor area x 70 in £'s
PDF here
Copy link to clipboard
Copied
Hi, see if this is what you looking for:
https://drive.google.com/uc?export=download&id=1cGudHlsipTtnWlN5sETXoNjPs55QbNkB
I also input space in "Contract value" field between currency simbol so all fields with currency now look same.
Copy link to clipboard
Copied
Oh that's amazing. I can't thank you enough for your help on this.