a.borg
Retired Forum Member-
Posts
18 -
Joined
-
Last visited
About a.borg

a.borg's Achievements
Junior Member (1/3)
0
Reputation
-
I noticed that the "order" was for the sorting on the order's page. However, how could I posibly remove a gateway from the system without doing it from the database?
-
Hi, When removing invoices form the system it doesnt decrease the order column in the tblpaymentgateways table for the specific gateway. This makes it imposible to deactivate the selected gateway.
-
PDF Invoice Customisation - Adding Payment Gateway Details
a.borg replied to computerwitness's topic in Developer Corner
Fixed some bugs and added the request by computerwitness. If the instructions empty in the database, the output is gonna be: Payment gateway: GATEWAYNAME. I'm only aware of wire and pay by mail using the instructions's column. <?php $ShowOnPayed = "1"; // 1 Shows the bankinformation even if the invoice is payed || 0 Shows the bankinformation only if the invoice isn't payed function wire_analize($payed, $status) { if($status=="Cancelled" OR $status=="Paid") { $InvoiceActive = 0; } else { $InvoiceActive = 1; } if ($payed==1) { return true; // true } elseif ($InvoiceActive==0 && $payed==0) { return false; // false } elseif ($InvoiceActive==1 && $payed==0) { return true; // false } } # Logo $pdf->Image(dirname(__FILE__).'/../images/logo.jpg',15,10,50); # Company Details $pdf->SetFont('Arial','',13); $pdf->Cell(0,6,$companyname,0,1,'R'); $pdf->SetFont('Arial','',; for ( $i = 0; $i <= 4; $i += 1) { $pdf->Cell(0,4,trim($companyaddress[$i]),0,1,'R'); } $pdf->Ln(5); # Header Bar $invoiceprefix = $_LANG["invoicenumber"]; //** This code should be uncommented for EU companies using the sequential invoice numbering so that when unpaid it is shown as a proforma invoice ** //if ($status!="Paid") { // $invoiceprefix = $_LANG["proformainvoicenumber"]; //} $pdf->SetFont('Arial','B',15); $pdf->SetFillColor(239); $pdf->Cell(0,8,$invoiceprefix.$invoicenum,0,1,'L','1'); $pdf->SetFont('Arial','',10); $pdf->Cell(0,6,$_LANG["invoicesdatecreated"].': '.$datecreated.'',0,1,'L','1'); $pdf->Cell(0,6,$_LANG["invoicesdatedue"].': '.$duedate.'',0,1,'L','1'); $pdf->Ln(10); # Clients Details $pdf->Cell(0,4,$_LANG["invoicesinvoicedto"],0,1); $pdf->SetFont('Arial','',; if ($clientsdetails["companyname"]) { $pdf->Cell(0,4,$clientsdetails["companyname"],0,1,'L'); $pdf->Cell(0,4,$_LANG["invoicesattn"].": ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L'); } else { $pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L'); } $pdf->SetFont('Arial','',; $pdf->Cell(0,4,$clientsdetails["address1"],0,1,'L'); if ($clientsdetails["address2"]) { $pdf->Cell(0,4,$clientsdetails["address2"],0,1,'L'); } $pdf->Cell(0,4,$clientsdetails["city"].", ".$clientsdetails["state"].", ".$clientsdetails["postcode"],0,1,'L'); $pdf->Cell(0,4,$clientsdetails["country"],0,1,'L'); //wire_print(); $pdf->Ln(10); $pdf->SetDrawColor(200); $pdf->SetFont('Arial','B',10); $pdf->SetFillColor(239); $pdf->Cell(148,7,$_LANG["invoicesdescription"],1,0,'C','1'); $pdf->Cell(40,7,$_LANG["invoicesamount"],1,0,'C','1'); $pdf->Ln(); $pdf->SetFont('Arial','',10); foreach ($invoiceitems AS $item) { if (strlen($item["description"])>85) { $pdf->Cell(148,6,substr($item["description"],0,85),1); $pdf->Cell(40,6,$currencysymbol.$item["amount"],1,0,'C'); $pdf->Ln(); $pdf->Cell(148,6,substr($item["description"],85),1); $pdf->Cell(40,6,"",1,0,'C'); } else { $pdf->Cell(148,6,$item["description"],1); $pdf->Cell(40,6,$currencysymbol.$item["amount"],1,0,'C'); } $pdf->Ln(); } $pdf->SetFont('Arial','B',10); $pdf->Cell(148,7,$_LANG["invoicessubtotal"].":",1,0,'R','1'); $pdf->Cell(40,7,$currencysymbol.$subtotal,1,0,'C','1'); $pdf->Ln(); if ($CONFIG["TaxEnabled"]) { $pdf->Cell(148,7,$taxrate."% ".$_LANG["invoicestax"].":",1,0,'R','1'); $pdf->Cell(40,7,$currencysymbol.$tax,1,0,'C','1'); $pdf->Ln(); } $pdf->Cell(148,7,$_LANG["invoicescredit"].":",1,0,'R','1'); $pdf->Cell(40,7,$currencysymbol.$credit,1,0,'C','1'); $pdf->Ln(); $pdf->Cell(148,7,$_LANG["invoicestotal"].":",1,0,'R','1'); $pdf->Cell(40,7,$currencysymbol.$total,1,0,'C','1'); $pdf->Ln(); $pdf->Ln(); if ($notes) { $pdf->SetFont('Arial','',; $pdf->MultiCell(188,5,$_LANG["invoicesnotes"].": $notes"); } if ($status=="Cancelled") { $pdf->SetXY(80,80); $statustext = $_LANG["invoicescancelled"]; } elseif ($status=="Unpaid") { $pdf->SetXY(120,80); $statustext = $_LANG["invoicesunpaid"]; } elseif ($status=="Paid") { $pdf->SetXY(120,80); $statustext = $_LANG["invoicespaid"]; } $pdf->SetFont('Arial','B',40); $pdf->SetTextColor(245); $pdf->Write(5,strtoupper($statustext)); ///////----Wire transfer if(wire_analize($ShowOnPayed, $status)) { $query = "SELECT gateway1.value AS instructions, gateway2.value AS name FROM tblinvoices left join tblpaymentgateways gateway1 ON gateway1.gateway = tblinvoices.paymentmethod && gateway1.setting = 'instructions' left join tblpaymentgateways gateway2 ON gateway2.gateway = tblinvoices.paymentmethod && gateway2.setting = 'name' WHERE ( tblinvoices.invoicenum = '".$invoicenum."' OR tblinvoices.id = '".$invoicenum."' )"; $result = mysql_query($query); while ($data = mysql_fetch_assoc($result)) { $gatewayName = $data['name']; $gatewayInstructions = $data['instructions']; } $paymentGateways = "Payment gateway: ".$gatewayName."\n"; $paymentGateways .= $gatewayInstructions; $pdf->SetTextColor(0); $pdf->SetFont('Arial','',; $gatewayinfo = explode("\n", $paymentGateways); $ordinate = 75; $abscissa = 50; $linebreaks = 3; for ( $i = 0; $i <= count($gatewayinfo); $i += 1) { $pdf->SetXY($abscissa,$ordinate); $pdf->Write(5,trim($gatewayinfo[$i])); $ordinate = $ordinate + $linebreaks; } } //////----Wire Transfer # Footer $pdf->SetMargins(15, 27, 15); // left, top, right $pdf->SetAutoPageBreak(TRUE, 25); // TRUE, margin down $pdf->SetFooterMargin(10); $pdf->SetFooterFont(array('arial', '', ); // @array font, type (B, I, BI), size $pdf->SetFooterData($CONFIG["Domain"] . " - ".$_LANG["page"]." {pg} / {nb}"); $pdf->setPrintHeader(false); $pdf->setPrintFooter(true); ?> -
PDF Invoice Customisation - Adding Payment Gateway Details
a.borg replied to computerwitness's topic in Developer Corner
I'm gonna look into this within a day or two. Sorry for the delay, I've had quite a few projects on my own. -
Did you setup the payment gateways? Read throught this: v3manual.whmcs.com for information on how to setup and work with WHMCS
-
Hi, You would have to remove the domain order parts in the ordering templates. Its in one of the 4 files called something with "order-" in the filename. Regarding the lookup/whois only, you could edit the templatefile called domainchecker.tpl and remove the parts where the user choses to order a domain or not.
-
You can develop pretty much anything modular. However, its only going to be shown on the admin level. It would take quite some time to manage that, not to forget the securityrisks of letting php handle all of that since you'd have to work root. Either by uploading the files as root or using sudo, both ways sounds a bit risky to me.
-
v3manual.whmcs.com/display.php?id=27 Good luck
-
PDF Invoice Customisation - Adding Payment Gateway Details
a.borg replied to computerwitness's topic in Developer Corner
Hi, I put together some code for it. This code should go in the pdfconfig.php file located in the "includes" folder. Keep in mind to backup ur old file, just in case. There are 2 diffrent ways to use it. You can select to show the wire information if the payment is unpayed or chose to show it all the time(recommeded). You change this on the first line like this: $ShowOnPayed = "1"; //This is gonna show the wire information all the time. $ShowOnPayed = "0"; //This is only gonna show the wire information when the invoice is unpayed. You change the texts location by changing line 146 and line 147. Line 146 is ordinate (standard is 75) Line 147 is abscissa (standard is 50) If you wish to change the space between the lines change the value of the variable $linebreaks on line 148 Enjoy Best regards, Alexander Borg <?php $ShowOnPayed = "1"; // 1 Shows the bankinformation even if the invoice is payed || 0 Shows the bankinformation only if the invoice isn't payed function wire_analize($payed) { if($status=="Cancelled" OR $status=="Paid") { $InvoiceActive = 0; } else { $InvoiceActive = 1; } if ($payed==1) { return true; // true } elseif ($InvoiceActive==0 && $payed==0) { return false; // false } elseif ($InvoiceActive==1 && $payed==0) { return true; // false } } # Logo $pdf->Image(dirname(__FILE__).'/../images/logo.jpg',15,10,50); # Company Details $pdf->SetFont('Arial','',13); $pdf->Cell(0,6,$companyname,0,1,'R'); $pdf->SetFont('Arial','',; for ( $i = 0; $i <= 4; $i += 1) { $pdf->Cell(0,4,trim($companyaddress[$i]),0,1,'R'); } $pdf->Ln(5); # Header Bar $invoiceprefix = $_LANG["invoicenumber"]; //** This code should be uncommented for EU companies using the sequential invoice numbering so that when unpaid it is shown as a proforma invoice ** //if ($status!="Paid") { // $invoiceprefix = $_LANG["proformainvoicenumber"]; //} $pdf->SetFont('Arial','B',15); $pdf->SetFillColor(239); $pdf->Cell(0,8,$invoiceprefix.$invoicenum,0,1,'L','1'); $pdf->SetFont('Arial','',10); $pdf->Cell(0,6,$_LANG["invoicesdatecreated"].': '.$datecreated.'',0,1,'L','1'); $pdf->Cell(0,6,$_LANG["invoicesdatedue"].': '.$duedate.'',0,1,'L','1'); $pdf->Ln(10); # Clients Details $pdf->Cell(0,4,$_LANG["invoicesinvoicedto"],0,1); $pdf->SetFont('Arial','',; if ($clientsdetails["companyname"]) { $pdf->Cell(0,4,$clientsdetails["companyname"],0,1,'L'); $pdf->Cell(0,4,$_LANG["invoicesattn"].": ".$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L'); } else { $pdf->Cell(0,4,$clientsdetails["firstname"]." ".$clientsdetails["lastname"],0,1,'L'); } $pdf->SetFont('Arial','',; $pdf->Cell(0,4,$clientsdetails["address1"],0,1,'L'); if ($clientsdetails["address2"]) { $pdf->Cell(0,4,$clientsdetails["address2"],0,1,'L'); } $pdf->Cell(0,4,$clientsdetails["city"].", ".$clientsdetails["state"].", ".$clientsdetails["postcode"],0,1,'L'); $pdf->Cell(0,4,$clientsdetails["country"],0,1,'L'); //wire_print(); $pdf->Ln(10); $pdf->SetDrawColor(200); $pdf->SetFont('Arial','B',10); $pdf->SetFillColor(239); $pdf->Cell(148,7,$_LANG["invoicesdescription"],1,0,'C','1'); $pdf->Cell(40,7,$_LANG["invoicesamount"],1,0,'C','1'); $pdf->Ln(); $pdf->SetFont('Arial','',10); foreach ($invoiceitems AS $item) { if (strlen($item["description"])>85) { $pdf->Cell(148,6,substr($item["description"],0,85),1); $pdf->Cell(40,6,$currencysymbol.$item["amount"],1,0,'C'); $pdf->Ln(); $pdf->Cell(148,6,substr($item["description"],85),1); $pdf->Cell(40,6,"",1,0,'C'); } else { $pdf->Cell(148,6,$item["description"],1); $pdf->Cell(40,6,$currencysymbol.$item["amount"],1,0,'C'); } $pdf->Ln(); } $pdf->SetFont('Arial','B',10); $pdf->Cell(148,7,$_LANG["invoicessubtotal"].":",1,0,'R','1'); $pdf->Cell(40,7,$currencysymbol.$subtotal,1,0,'C','1'); $pdf->Ln(); if ($CONFIG["TaxEnabled"]) { $pdf->Cell(148,7,$taxrate."% ".$_LANG["invoicestax"].":",1,0,'R','1'); $pdf->Cell(40,7,$currencysymbol.$tax,1,0,'C','1'); $pdf->Ln(); } $pdf->Cell(148,7,$_LANG["invoicescredit"].":",1,0,'R','1'); $pdf->Cell(40,7,$currencysymbol.$credit,1,0,'C','1'); $pdf->Ln(); $pdf->Cell(148,7,$_LANG["invoicestotal"].":",1,0,'R','1'); $pdf->Cell(40,7,$currencysymbol.$total,1,0,'C','1'); $pdf->Ln(); $pdf->Ln(); if ($notes) { $pdf->SetFont('Arial','',; $pdf->MultiCell(188,5,$_LANG["invoicesnotes"].": $notes"); } if ($status=="Cancelled") { $pdf->SetXY(80,80); $statustext = $_LANG["invoicescancelled"]; } elseif ($status=="Unpaid") { $pdf->SetXY(120,80); $statustext = $_LANG["invoicesunpaid"]; } elseif ($status=="Paid") { $pdf->SetXY(120,80); $statustext = $_LANG["invoicespaid"]; } $pdf->SetFont('Arial','B',40); $pdf->SetTextColor(245); $pdf->Write(5,strtoupper($statustext)); ///////----Wire transfer if(wire_analize($ShowOnPayed)) { $query = "SELECT * FROM tblpaymentgateways WHERE gateway = 'banktransfer' && setting = 'instructions'"; $result = mysql_query($query); while ($data = mysql_fetch_array($result)) { $pdf->SetTextColor(0); $pdf->SetFont('Arial','',; $wireinfo = explode("\n", $data['value']); $ordinate = 75; $abscissa = 50; $linebreaks = 3; for ( $i = 0; $i <= count($wireinfo); $i += 1) { $pdf->SetXY($abscissa,$ordinate); $pdf->Write(5,trim($wireinfo[$i])); $ordinate = $ordinate + $linebreaks; } } //$pdf->Write(5,mysql_error()); (debugging) } //else //returns false(debugging) //{ // $pdf->SetTextColor(0); // $pdf->SetFont('Arial','',; // $pdf->SetXY(50,80); // $pdf->Write(5,"Failed"); //} //////----Wire Transfer # Footer $pdf->SetMargins(15, 27, 15); // left, top, right $pdf->SetAutoPageBreak(TRUE, 25); // TRUE, margin down $pdf->SetFooterMargin(10); $pdf->SetFooterFont(array('arial', '', ); // @array font, type (B, I, BI), size $pdf->SetFooterData($CONFIG["Domain"] . " - ".$_LANG["page"]." {pg} / {nb}"); $pdf->setPrintHeader(false); $pdf->setPrintFooter(true); ?> Report any bugs in here. I might work further on this when I have some time over for it. -
Yea, its really needed.
-
do you guys accept international orders?
a.borg replied to simplehelix's topic in General Discussion
I agree, a copy of the front of the CC and a copy of the driverslicense/ID -
I strongly recommend worldpay invisible. Its a great product from worldpay, however, its really hard to get a hold of. Took us several months before we got permitted to use it. You wont find any information directly on the worldpay website, ur gonna have to call or mail them.
