payment method in invoice

Before you ask about IDnR Addon see the VirtueMart - Invoice, Delivery Note and Receipt Addon
franco
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 15 Sep 2008, 19:03

payment method in invoice

Post by franco »

hey guys, can you help me please?

I have one problem with generating of an invoice (file phoca.tcpdf.php). I cannot find, how to get payment method. Emails getting this data in this way: $dbpm->p("payment_method_name"). Phoca file getting data from database like this: $hD['dbb']->f('bill_date'). So I would expect something like this: $hD['dbb']->f('payment_method_name') or something similar. I tried maybe million ways how to get this hell payment method. But nothing was right.

Can you help?
Thanks
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47885
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: payment method in invoice

Post by Jan »

just add:

print_r($hD);exit; and you will know which data are saved in $hD ... Now I don't have any installation of VM so I cannot try it...
the $hD get values in delivery.pdf.php e.g. logo:

$header['logo'] = $logo;

so try to add e.g.
$header['payment_method_name'] = $dbpm->p("payment_method_name");

and try to see if you get the:
$hD['payment_method_name'] in phoca.tcpdf.php

Jan
If you find Phoca extensions useful, please support the project
franco
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 15 Sep 2008, 19:03

Re: payment method in invoice

Post by franco »

i cannot work with $dbpm->p("payment_method_name"); in delivery.php. At the beggining of the file you "loading" data like this "function createPDF( $VM_LANG, $d, $dbv, $dbo, $dbb, $dbst, $dbbt, $current_admin_user, $obliterated )". and there is no dbpm. It is corresponding with the file ps_delivery.php, where is SELECT for each argument of function createPDF. Like $dbst = new ps_DB;
$qt = "SELECT * FROM #__{vm}_user_info WHERE user_info_id='". $dbo->f("user_info_id") . "'";
$dbst->query($qt);
$dbst->next_record();

So if I get it well, I need right select command to get data to dbpm in ps_delivery file. Then I can work with that in delivery file and do $header['payment_method_name'] = $dbpm->p("payment_method_name"); And after that all, I can use this $hD['payment_method_name'] in phoca.tcpdf.php. Right? Well, can you give me that SELECT? Thanks a lot.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47885
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: payment method in invoice

Post by Jan »

Hi, you right, you should get the payment method from database first (if it is not included in some of other variables - $dbo, $dbv, ...)

but I don't know where the payment method is stored in VM database, so I cannot write the sql query ??? :(

Jan
If you find Phoca extensions useful, please support the project
marfy
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 24 Sep 2008, 07:56

Re: payment method in invoice

Post by marfy »

hello,
hou can try with this query:
$dbpm = new ps_DB;
$q = "SELECT * FROM #__{vm}_payment_method, #__{vm}_order_payment WHERE #__{vm}_order_payment.order_id='".$d['order_id']."'";
$q .= "AND #__{vm}_payment_method.payment_method_id=#__{vm}_order_payment.payment_method_id";
$dbpm->query($q);
$dbpm->next_record();
I think it's good to retrieve the info, let me know if works!
Tobiwankenobi
Phoca Member
Phoca Member
Posts: 10
Joined: 09 Aug 2009, 20:33

Re: payment method in invoice

Post by Tobiwankenobi »

I know, a bit old, but want to let you know that it works great! I used $dbpm->f("payment_method_name") in delivery.pdf.php to produce not a error.

Thanks so much for that great VM addon Jan!

Tobi
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47885
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: payment method in invoice

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Bob53207
Phoca Member
Phoca Member
Posts: 10
Joined: 28 May 2008, 23:59

Re: payment method in invoice

Post by Bob53207 »

I've opened ~100 files today trying to find where the "Cash on Delivery" payment method is stored. I need to change that text to "Payment Based Upon Our Agreement". Any ideas? :idea:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47885
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: payment method in invoice

Post by Jan »

Hi, this you can change in language string.

Jan
If you find Phoca extensions useful, please support the project
Bob53207
Phoca Member
Phoca Member
Posts: 10
Joined: 28 May 2008, 23:59

Re: payment method in invoice

Post by Bob53207 »

Can you be more specific? There are LOTS of language files in this set-up... :x
Post Reply