Display 2 taxes in Quotes and Invoices (GST 5% and PST 7%) on seperate lines?

Does anyone have any suggestions on how I go about adding a second tax into Quotes or Invoices

In canada they split the taxes into Provincial Sales Tax (PST) and Goods and Services Tax (GST)

And by law in Canada the PST and GST must be shown separately.

I have looked at the vat_list in the dropdown editor and changed one of the taxes

but I need to show the tax calculations split into GST and PST

Item Total: $155.00

Sales Tax at 7.000%: $10.85

GS Tax: $7.75

Total: $173.60

Can someone point me in the right direction or to the docs on how to do this.

Thanks,
Scott

Bump…

It looks like there is a lot of javascript required. But no one can even point me to where this would be in the docs??

you are looking for the line items section.

modules/AOS_Products_Quotes/Line_Items.php
modules/AOS_Products_Quotes/line_items.js

to save the line with the value values

modules/AOS_Products_Quotes/AOS_Products_Quotes.php

some of this will be javascript and others php.

The files above are for the quotes module and would be very similar for the invoices.

hopefully this points you in the right direction.
Ian.

Thank you. I have been trying to figure this out for a while and you have confirmed what I was thinking so thank you.

I will create a custom/modules/AOS_Products_Quotes folder and put those three files in there to start the customization without touching the core files.

Does anyone have found something for displaying 2 taxes? We need same too.

Thanks in advance!

Can we have more info? about adding 2 taxes?

Once you figure this out it’s fairly straight forward but it took me quite some time to figure it out.

this specific request is heavily dependent on JavaScript.

using this file modules/AOS_Products_Quotes/line_items.js

copy this file into your custom folder

/custom/modules/AOS_Products_Quotes/line_items.js

look in that file for “VAT” and start modifying the javascript file.

What I have done is taken the current tax drop down and duplicated it with a slightly different name “vat_pst” in my case and then do the calculations based on the new dropdowns.

I looked for a php/mysql solution when the answer was to brush up on the JavaScript which from what i’ve seen in the developer videos is the direction that sugar is going in. ie more and more javascript.

Sorry I don’t have a specific answer but hopefully that helps.

I have this to the point were it is doing the calculations.

It is not saving my selections for the custom pst and gst fields…

“:”",“gst_c”:“0.0”,“pst_c”:“0.0”}

although when I capture the post data I see it…

[pst_c] => Array ( [0] => 17.5 )

i get the selection but when it goes through the save process in AOS_Product_Sales it doesn’t save the data.

I am so close with this please help.

From what I can remember you need to make sure that your field follows the same naming conversions.

modules/AOS_Products_Quotes/AOS_Products_Quotes.php

line 44 - $post_data[$key.$field_def[‘name’]][$i];

The post data must start with a key, from what I can remember it will be either product_ or service_ hopefully this helps.

Ian

Thanks to smugford and Ian, I am not a pro in php and/or Java, I can edit, add or change anything but I am not able to find which one we need to add. We are ready to pay if someone know how to do.

Thanks!

I am just figuring out this code myself.

They do have development partners I would email Suite themselves and ask for a developer reference for your country.

I added the custom field to litenitemeidtviewdefs.php after adding the product_pst field to the lineitems quick create view.

7 =>
array (
‘name’ => ‘product_pst_c’,
‘label’ => ‘LBL_PRODUCT_PST’,
),

It is now saving the selection but it is not displaying the selection in the box.

i think I need to copy the vat_hidden code in Line_Items.php

I have talked to a Partner and he tell me we can take shipping taxe for the second taxe we need, I will try it and return to you if working!

I had that thought as well. I decided not to do that because we made need to add a discount eventually.

I got it to work but it would take me a few days to put together a “How To” (which I may do as a learning exercise but not 100% on that)

No matter how you do it most of what you need is in line_items.js

2 Likes

Great, we will wait, I know it is in line_item.js, but I can’t work on it because we have a lot of job and unfortunately don’t have time for now.

Thanks!

Yesterday I have worked some hours on it and I don’t have all information to complete this (I think).

I have done this:

In Studio: add new fields in quote with name tax2_amount_c

In Studio: Quotes / Layouts / Editview and Detailview add the Row for the second taxes

modules/AOS_Products_Quotes/Line_Item.php
add this line
Copied Line 147 and change LBL_TAX2_AMOUNT_C

[color=#ff0000]$groupEnd .= “

”.$mod_strings.": ";[/color]

Not sure If I need to add something else

modules/AOS_Products_Quotes/line_items.js
add this line
Copied Line 174 to 180 and ad a 2 at each vat

[color=#ff0000]var f = x.insertCell(8 );
f.innerHTML = “”;
f.innerHTML += “” + vat_hidden + “”;

if (typeof currencyFields !== ‘undefined’){
currencyFields.push(“product_vat_amt” + prodln);
}[/color]

Copied Line 528 to 832 and change the name to LBL_TAX2_AMOUNT_C

[color=#ff0000]var footer_row4=tablefooter.insertRow(-1);
var footer_cell4 = footer_row4.insertCell(0);
footer_cell4.scope=“row”;
footer_cell4.colSpan=“20”;
footer_cell4.innerHTML=""+SUGAR.language.get(module_sugar_grp1, ‘LBL_TAX2_AMOUNT_C’)+": ";[/color]

Not sure If I need to add something else

It is what I have done for now, If you can help me to complete the work, it will be very helpfull for me and other!!

Thanks!

Anyone can help us? Do we need to switch to other CRM? We are ready to pay if is nessecary.

Thanks!

Hi

Were you able to post a “how to” I’d be interested in that? Spain has the same issue with dealers. VAT 21% + 5,2% R.E. which I need to display separately.

Thanks

Hi Cperrot,
We are already at the same point here, Maybe no one have found the solution? I’m not able to find the complete solution for now because we have a lot of job.

Very sorry!

thanks for your reply. I am amazed that SutieCRM OpenSales cannot be used in Canada at all and that no one is actually taking this problem up as a feature request.