inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jun 15, 2014 22:53:44 GMT -8
Okay so I hit a stumbling block to start with for the taxes code I'm working on, which is the set up of taxes. One of the required fields is if someone wants to use the Simple (Everyone pays one lump sum of taxes) or Advanced (This is banded).
I've tried this:
var taxesPlug = pb.plugin.get('monetary_Taxes');
/*var date = Code to check date here*/
if (taxesPlug.settings.simple_or_advanced === Simple) {
console.log = "You have selected simple";
}
else {
console.log = "You have selected Advanced mode";
} However its throwing this error: Uncaught ReferenceError: Simple is not defined
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Jun 16, 2014 2:38:29 GMT -8
You are referencing a variable called "simple" in your if condition, that variable is not defined in your script, so that's why it is moaning.
What are the possible values of "simple_or_advanced"? I'm going to assume "simple" or "advanced", if so, then it needs to be a string.
if(taxesPlug.settings.simple_or_advanced === "Simple"){ console.log("Simple"); } else { console.log("Advanced"); }
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jun 16, 2014 5:29:59 GMT -8
Yes you have Simple or Advanced literally - I did suspect it'd be something simple like that XD (I'm not normally this dense honest XD))
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Jun 16, 2014 5:46:46 GMT -8
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jun 16, 2014 6:31:13 GMT -8
I should know better than to write code half asleep mind XD -going on a hunt for a way to check if its a new day/new week/new month/new year now trying to work out if that would be worth using a variable for each option as well to keep things neat..ish
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Jun 16, 2014 9:58:50 GMT -8
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Jun 16, 2014 10:36:33 GMT -8
Thanks Peter I'll take a look now
|
|