9827b8e2 by Kevin Burton

Updated UserManager allowing for Tax Exempt in Events, and membership invoices

1 parent 9e288b16
...@@ -1046,6 +1046,18 @@ class Actions { ...@@ -1046,6 +1046,18 @@ class Actions {
1046 1046
1047 $user = new User\Account($uid); 1047 $user = new User\Account($uid);
1048 1048
1049 $is_tax_exempt = false;
1050 // loop through special status to see if exempt is there.
1051 if ( isset( $user->special_statuses) ) {
1052 foreach($user->special_statuses as $stat) {
1053 if ($stat == "tax_exempt") {
1054 $is_tax_exempt = true;
1055 break;
1056 }
1057 }
1058 }
1059
1060
1049 $cost = get_post_meta($event_id, 'cost', true); 1061 $cost = get_post_meta($event_id, 'cost', true);
1050 1062
1051 $role = $user->getRole(); 1063 $role = $user->getRole();
...@@ -1110,15 +1122,33 @@ class Actions { ...@@ -1110,15 +1122,33 @@ class Actions {
1110 $tpp = get_user_meta($user->ID,'profile_preference',true); 1122 $tpp = get_user_meta($user->ID,'profile_preference',true);
1111 $tpp = strtolower($tpp); 1123 $tpp = strtolower($tpp);
1112 $province = get_user_meta($user->ID,$tpp."_province",true); 1124 $province = get_user_meta($user->ID,$tpp."_province",true);
1125
1126 if ($is_tax_exempt) {
1127 $tax_label = "Exempt";
1128 $tax = 0;
1129 $taxes = 0;
1130 } else {
1113 $tax_label = "Taxes-$province"; 1131 $tax_label = "Taxes-$province";
1114 $tax = getTaxesByProvince($province); 1132 $tax = getTaxesByProvince($province);
1133 $taxes = ($new_cost * ($tax/100));
1134 }
1135
1136
1115 1137
1116 } else { 1138 } else {
1139 if ($is_tax_exempt) {
1140 $tax_label = "Exempt";
1141 $tax = 0;
1142 $taxes = 0;
1143 } else {
1117 $tax_label = "Taxes-$provstate"; 1144 $tax_label = "Taxes-$provstate";
1118 $tax = getTaxesByProvince($provstate); // tax percentage (whole number) 1145 $tax = getTaxesByProvince($provstate); // tax percentage (whole number)
1146 $taxes = ($new_cost * ($tax/100));
1119 } 1147 }
1120 1148
1121 $taxes = ($new_cost * ($tax/100)); 1149 }
1150
1151
1122 1152
1123 1153
1124 1154
......