Page 1 of 1

Options for Template Email to Vendor

Posted: Tue Dec 06, 2011 12:04 pm
by allcourtsports
Can anyone tell me how to include COGS in Vendor email template?

Re: Options for Template Email to Vendor

Posted: Wed Dec 07, 2011 7:00 am
by mazhar
Edit the template and locate

Code: Select all

#if ($orderItem.OrderItemType == "Product")
          $orderItem.Sku
#else
and update it like

Code: Select all

#if ($orderItem.OrderItemType == "Product")
          $orderItem.Sku
         $orderItem.CostOfGoods
#else

Re: Options for Template Email to Vendor

Posted: Thu Dec 08, 2011 8:47 pm
by allcourtsports
Thanks. That was easy! I was able to include it as a cell just to the right of the Quantity. The problem I have now is that I have many products where I do not want to include the CostOfGoods in the Vendor Email. Can I tweak the code to enable the COGS only if there is a value greater than zero in the field because the field defaults to 0.00. Also, is there any way to remove the additional zeros after the COGS when it populates in the vendor email (It looks like 9.9900 instead of 9.99)?

Thanks for your help with this!

Re: Options for Template Email to Vendor

Posted: Fri Dec 09, 2011 6:56 am
by mazhar
Try it like this

Code: Select all

$orderItem.CostOfGoods.ToString("ulc")

Re: Options for Template Email to Vendor

Posted: Fri Jan 20, 2012 3:59 pm
by allcourtsports
That worked! Thank you. Now all I need to figure out is how to not include COGS in the purchase order if the COGS field does not have a value greater than 0.00 (the default) listed. We have several orders that will not require COGS and we do not want the field to show with this 0.00 as the COGS. Is there a way to only include COGS in the purchase order if the amount in the COGS field is greater than 0.00?

Re: Options for Template Email to Vendor

Posted: Mon Jan 23, 2012 7:41 am
by mazhar
Yes its possible. You can do it like

Code: Select all

#if($orderItem.CostOfGoods > 0)
$orderItem.CostOfGoods.ToString("ulc")
#end

Re: Options for Template Email to Vendor

Posted: Thu Jul 19, 2012 9:09 am
by azar
I have the same problem. Does anyone know how ToString("ulc") and ToString("C") are different?