Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 03-03-2011 13:28:39

robprotronica
Member
Registered: 12-16-2008
Posts: 106

Add Ex Vat unit prices to customer order confirmation mails

Hi,

Have been trying to add ex VAT unit prices to our internal and customer order confirmation emails.

Looking in ordersummaryxhtml.php I found the part where each item gets printed out. Looking around the forum I found some ideas from where others have tried this and modified the code as follows:-

Code:

                              // +--
                              // | Print quantity and amounts.
                              // +--

                              $amount_array = array('amount'     => $item['ordertotal'],
                                                    'entrycurr'  => $currapp,
                                                    'returncurr' => $currshow,
                                                    'formatwsym' => 1);

                              $subtotal = $this->include_namespace($app,'getprice',$amount_array);
                              $subtotal = $this->xhtml_encode($subtotal);

                              print '<p>Quantity: ' . $quan;

                              if ($mailtype != 'SHIPPER') {

                             if ($manageeutax == 'incleutax') {
                             // The prices include EU Tax.
                               $amount_array = array('unitprice'  => $item['cartdata']['subtotaleutax'] / $item['cartdata']['quantity'],
                                              'entrycurr'  => $currapp,
                                              'returncurr' => $currshow,
                                              'formatwsym' => 1);

                               $priceeach = $this->include_namespace($app,'getprice',$amount_array);
                               $priceeach = $this->xhtml_encode($priceeach);

                                   print ' Price Each - ' . $priceeach;
                                   print ' ex Vat';
                                   print '<br/>';

                                 } // End of if statement
                                 
                                print ' Subtotal: ' . $subtotal;
                                print ' Inc VAT';

This is giving me the printout format I am looking for and the subtotal values are coming through as per the original code - only problem is that priceeach is coming out as zero. So at this point I think my "cut and paste"  needs more understanding than I have.

Anyone any ideas on how I should be accessing the data and making the calculation?

Thanks

Rob

Offline

 

Board footer