Posted: November 28, 2013 at 12:00 pm
|
I have setup event espresso on a client’s site, and am using a custom invoice template to display PO numbers. Everything works fine with this, however it will not pull in the amount paid (amount_pd). Here is where attendee info is pulled in, and it seems to be calling for the amount_pd variable properly: <code> foreach ($attendees as $attendee){ $attendee_id = $attendee->id; $attendee_last = $attendee->lname; $attendee_first = $attendee->fname; $attendee_address = $attendee->address; $attendee_city = $attendee->city; $attendee_state = $attendee->state; $attendee_zip = $attendee->zip; $attendee_email = $attendee->email; //$attendee_organization_name = $attendee->organization_name; //$attendee_country = $attendee->country_id; $phone = $attendee->phone; $date = $attendee->date; //$num_people = $attendee->quantity; $payment_status = $attendee->payment_status; $txn_type = $attendee->txn_type; $attendee_session = $attendee->attendee_session; $event_price_type = $attendee->price_option; $amount_pd = $attendee->amount_pd; $payment_date = $attendee->payment_date; $event_id = $attendee->event_id; $registration_id=$attendee->registration_id; $quantity = $attendee->quantity; }</code> Here is the part of the template.php file which should display the amount_pd but is always showing $0: //Print total VAT //Print total cost $this->Cell(155, 10, ‘Total:’, 0, 0, ‘R’); any help? |
Hi Patrick, Without seeing all of the code its hard to say. Have you checked that the attendee data you are pulling in actually has an amount other than 0.00 in the database? Does the SQL query used to pull the information include amount_pd? If you would like to email us a copy of your template to support at eventespresso.com we can take a look and advise from there. |
|
Hi Patrick, Thank you for sending the template over. I’ve reviewed the code and the reason the totals are being calculated incorrectly is due to $amount_pd not being passed to the InvoiceTotals() function. Line 320: $pdf->InvoiceTotals($cost_total, $tax_total, $surcharge); Needs to pass $amount_pd into the function… $pdf->InvoiceTotals($cost_total, $tax_total, $surcharge, $amount_pd); Also line 211 function InvoiceTotals($sub_total, $vat, $surcharge){ Needs to be function InvoiceTotals($sub_total, $vat, $surcharge, $amount_pd){ Otherwise the $amount_pd variable used within that function is actually a totally different variable with the same name. |
|
The support post ‘Invoice not showing proper amount paid’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.