Page 1 of 2
payment method in invoice
Posted: 15 Sep 2008, 19:11
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
Re: payment method in invoice
Posted: 15 Sep 2008, 21:27
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
Re: payment method in invoice
Posted: 16 Sep 2008, 00:02
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.
Re: payment method in invoice
Posted: 16 Sep 2008, 13:15
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
Re: payment method in invoice
Posted: 24 Sep 2008, 08:01
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!
Re: payment method in invoice
Posted: 09 Aug 2009, 20:40
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
Re: payment method in invoice
Posted: 10 Aug 2009, 13:23
by Jan
Ok
Re: payment method in invoice
Posted: 09 Oct 2009, 00:10
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?
Re: payment method in invoice
Posted: 17 Oct 2009, 18:22
by Jan
Hi, this you can change in language string.
Jan
Re: payment method in invoice
Posted: 21 Oct 2009, 00:39
by Bob53207
Can you be more specific? There are LOTS of language files in this set-up...