Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

MS2 and Tax Exempt


Guest

Recommended Posts

  • Replies 50
  • Created
  • Last Reply

Here's a Tax Exempt Contribution

http://www.oscommerce.com/community/contributions,944

 

I tried to install it, but didn't get it succesfully working. The contributor recommended comparing code using some software, which I did. It was very time consuming and still didn't work. Probably because I wasn't always sure which code to change.

Link to comment
Share on other sites

mleslie598

Yea,,

Thanks for replying

I was aware of this mod but it was pre ms2 release and I am running ms2 and need a something for ms2.

ANYONE?

anyway,,Thanks again for taking time to reply

Regards

Tom

 

 

ANYONE know of a ms2 tax exempt solution

Link to comment
Share on other sites

  • 1 month later...

TheBatFreak

 

So far, I have not found anything.

Seems no one has the need for tax exempt use besides yourself, Michael, and I.

 

If I find anything,, I'll let you know, and ask the same of you.

 

 

Regards

Tom

Link to comment
Share on other sites

:) Thanks man! I did find a guy out at rentacoder.com who apparently has coded/installed a tax exempt module before. I posted a bid on the project so maybe we'll hear back.

 

I honestly don't have much problem doing the work OTHER that it's hard to tell which code to merge/change from file to file. A little bit annoying.

 

Thanks!

Link to comment
Share on other sites

Jason,

 

Thanks again for all the hard work to alter this,

 

TheBatFreak,

Let me know if this worked for you. I ran into error after error,, every time i would figure one out,, another 3 or 4 popped up,, and i just uninstalled.

So if you would let me know if it worked for u.

Thanks dude

 

Regards

Tom

Link to comment
Share on other sites

I had been waiting for this release as well. After many errors and a few hours (not 20 min.) I was able to get the whole package installed.

 

Most of the errors were just missing (or removing) ;), in the code.

 

My main concern was to flag a customer as Tax Exempt, and actually have the system compute the final charges properly. This seems to work fine now.

 

What I do not understand, however is where to set the amount of discount on the Education and Government groups. Is it possible to add other groups dynamically besides the Education and Government? Is there somewhere to input a percent value to apply to the discount?

Link to comment
Share on other sites

If you tell me what they are I will fix and re-upload. All I did was merge the code to MS2 code base.

 

It is not possable to add other groups "dynamically" with this package (manually yes it is possable). However there is a diffent mod that has that feature.

Link to comment
Share on other sites

Cool! I've gotten the Admin side done but am having a little trouble fixing the various php errors from the catalog end. I'm no PHP wiz so could you document the fixes you applied to those files? You mentioned adding/removing ;) or the like. I got one of them fixed but I'm REALLY having some annoying trouble with the following files:

 

/catalog/account_edit.php(line 99 parse error)

/catalog/checkout_process.php(line 43 parse error)

/catalog/create_account.php(line 410 parse error)

/catalog/shopping_cart.php(may not have an error here now)

/catalog/includes/classes/order.php(line 331 parse error)

 

What did you do to each of these?

 

 

 

Qwiz, have you done the table alters in mySQL as noted in the database_change file? Those are critical to make this thing work.

 

 

We'll all get this baby running yet!

 

Thanks!

Link to comment
Share on other sites

I will post what I changed shortly.

 

Is there a way to assign a percentage decrease in price based off if they are Education or Government? There is nothing in the Admin side, might be in the DB or code. If this is not possible, why are these fields even there?

Link to comment
Share on other sites

TheBatFreak,

 

Hey dude,, yea,,, I did apply the sql changes, and I picked out a bunch of the problems as well ,, till I got down to some of the ones you listed in the catalog side and one of them was giving me an sql error, so with my migrains I just removed it b4 I let it wrestle me down,, will try again another day,, lol

 

Thanks though guyz

Regards

Tom

Link to comment
Share on other sites

OK. I am going to begin the list of fixes I made to get this to work on my site. It will take me a little while to remember...Here is Installment 1

 

/catalog/account_edit.php

 

PRE-MOD

    if ($error == false) {
     $sql_data_array = array('customers_firstname' => $firstname,
                             'customers_lastname' => $lastname,
                             'customers_email_address' => $email_address,
                             'customers_telephone' => $telephone,
                             'customers_fax' => $fax);

 

POST-MOD & Fixed

    if ($error == false) {
     $sql_data_array = array('customers_firstname' => $firstname,
                             'customers_lastname' => $lastname,
                             'customers_email_address' => $email_address,
                             'customers_telephone' => $telephone,
                             'customers_fax' => $fax,
// BEGIN - Tax Exempt and Organization Discounts
                             'customers_tax_exempt' => $tax_exempt,
                             'customers_tax_exempt_id' => $tax_exempt_id,
                             'customers_org_type' => $organization_type);
// END - Tax Exempt and Organization Discounts

 

/catalog/includes/classes/shopping_cart.php

 

PRE-MOD

          $products_array[] = array('id' => $products_id,
                                   'name' => $products['products_name'],
                                   'model' => $products['products_model'],
                                   'image' => $products['products_image'],
                                   'price' => $products_price,
                                   'quantity' => $this->contents[$products_id]['qty'],
                                   'weight' => $products['products_weight'],
                                   'final_price' => ($products_price + $this->attributes_price($products_id)),
                                   'tax_class_id' => $products['products_tax_class_id'],
                                   'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));
       }

 

POST-MOD & Fixed

          $products_array[] = array('id' => $products_id,
                                   'name' => $products['products_name'],
                                   'model' => $products['products_model'],
                                   'image' => $products['products_image'],
                                   'price' => $products_price,
                                   'quantity' => $this->contents[$products_id]['qty'],
                                   'weight' => $products['products_weight'],
                                   'final_price' => ($products_price + $this->attributes_price($products_id)),
                                   'tax_class_id' => $products['products_tax_class_id'],
// BEGIN - Tax Exempt and Organization Discounts
// old                              'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));
                                   'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''),
       'eligible_discounts' => $products_eligible_discounts, 
       'education_discount' => $products_education_discount, 
       'government_discount' => $products_government_discount, 
       'gsa_pricing' => $products_gsa_pricing);
// END - Tax Exempt and Organization Discounts

       }

Link to comment
Share on other sites

Installment #2

 

/catalog/includes/classes/order.php

 

ORIGINAL MOD CODE

    // BEGIN - Tax Exempt and Organization Discounts
       if ($discount > 0) {
         $this->products[$index]['attributes'][$subindex] = array('option' => "Organization Discount",
}
   // END - Tax Exempt and Organization Discounts

 

Should READ:

    // BEGIN - Tax Exempt and Organization Discounts
       if ($discount > 0) {
         $this->products[$index]['attributes'][$subindex] = array('option' => "Organization Discount");
}
   // END - Tax Exempt and Organization Discounts

Link to comment
Share on other sites

Installment #3

 

/catalog/create_account.php

 

BAS MOD CODE:

// BEGIN - Tax Exempt and Organization Discounts
             <tr>
               <td class="main"><?php echo ENTRY_TAX_EXEMPT; ?></td>
               <td class="main">
   if ($account['customers_tax_exempt'] == '1') {
     echo ENTRY_TAX_EXEMPT_YES;
   } else {
     echo ENTRY_TAX_EXEMPT_NO;
   }
   if ($process == true) {
   echo tep_draw_hidden_field('tax_exempt');  
 }
?></td>
         </tr>
         <tr>
           <td class="main"> <?php echo ENTRY_TAX_EXEMPT_ID; ?></td>
           <td class="main"> 
<?php
   if ($process == true) {
     echo $tax_exempt_id . tep_draw_hidden_field('tax_exempt_id');
   } else {
     echo tep_draw_input_field('tax_exempt_id', $account['customers_tax_exempt_id']) . ' ' . ENTRY_TAX_EXEMPT_ID_TEXT;
   }
             </tr>

             <tr>
               <td class="main"><?php echo ENTRY_ORG_TYPE; ?></td>
               <td class="main">
<?php
   if ($process == true) {
$organization_query = tep_db_query("select org_type_title, org_type_id from " . TABLE_ORGANIZATION_TYPE . " where org_type_id = " . $organization_type);
$organization_row = tep_db_fetch_array($organization_query);
echo $organization_row['org_type_title'];
       echo tep_draw_hidden_field('organization_type');    
   } else {
     $organization_array = array();
     $organization_query = tep_db_query("select org_type_title, org_type_id from " . TABLE_ORGANIZATION_TYPE . " order by org_type_title asc");
     while ($organization_values = tep_db_fetch_array($organization_query)) {
       $organization_array[] = array('id' => $organization_values['org_type_id'], 'text' => $organization_values['org_type_title']);
     }
?>
               </td>
             </tr>
// END - Tax Exempt and Organization Discounts

 

GOOD MOD CODE:

<?php // BEGIN - Tax Exempt and Organization Discounts ?>
             <tr>
               <td class="main">
<?php echo ENTRY_TAX_EXEMPT; ?></td>
               <td class="main">
<?php    if ($account['customers_tax_exempt'] == '1') {
     echo ENTRY_TAX_EXEMPT_YES;
   } else {
     echo ENTRY_TAX_EXEMPT_NO;
   }
   if ($process == true) {
   echo tep_draw_hidden_field('tax_exempt');  
 }
?>
</td>
         </tr>
         <tr>
           <td class="main"> <?php echo ENTRY_TAX_EXEMPT_ID; ?></td>
           <td class="main"> 
<?php
   if ($process == true) {
     echo $tax_exempt_id . tep_draw_hidden_field('tax_exempt_id');
   } else {
     echo tep_draw_input_field('tax_exempt_id', $account['customers_tax_exempt_id']) . ' ' . ENTRY_TAX_EXEMPT_ID_TEXT;
   }
?>
             </tr>

             <tr>
               <td class="main"><?php echo ENTRY_ORG_TYPE; ?></td>
               <td class="main">
<?php
   if ($process == true) {
 $organization_query = tep_db_query("select org_type_title, org_type_id from " . TABLE_ORGANIZATION_TYPE . " where org_type_id = " . $organization_type);
 $organization_row = tep_db_fetch_array($organization_query);
 echo $organization_row['org_type_title'];
       echo tep_draw_hidden_field('organization_type');    
   } else {
    	 $organization_array = array();
    	 $organization_query = tep_db_query("select org_type_title, org_type_id from " . TABLE_ORGANIZATION_TYPE . " order by org_type_title asc");
    	 while ($organization_values = tep_db_fetch_array($organization_query)) {
      	 $organization_array[] = array('id' => $organization_values['org_type_id'], 'text' => $organization_values['org_type_title']);
    	 }
}
?>
               </td>
             </tr>
<?php // END - Tax Exempt and Organization Discounts ?>

Link to comment
Share on other sites

I think that about does it for my changes. I will post an installment #4 if need be! Let me know if there are other problems. I will help you out with them.

 

Corbin

Link to comment
Share on other sites

Yeah, I just noticed that. Sorry.

 

Everything LOOKS to be working. Question though. When you sign up for an account it is defaulting to Tax Exempt = No. Right now, it looks like this can't be changed AND there's no place to change the organization type.

 

Did I do something wrong or is this how it is on yours?

 

Thanks for all your work on this!

Link to comment
Share on other sites

I know what you mean. I actually am using the default create_account.php, because the value of TAX ID was not posting into the database anyway.

 

I figure if the customer providesis TAX exempt, I will need to see their paperwork anyway prior to processing any orders. They will need to have some kind of communication with me. I can then update there information on the Admin side.

 

BTW. I am almost positive that the discounting does not work. While the database structure is there, I can not make it work. This mod does handle the TAX Exempt status, everything else seems un-implemented.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...