Search the Community
Showing results for tags 'invoice'.
Found 81 results
-
Hi. WHMCS stopped sending emails when an invoice is paid. Verified the connection of the account and the server. Also, it sends proformas and other emails. Verified the Invoice Payment Consignaturetion template. It's active. Configuration -> General settings -> Check to send PDF versions of invoices along with invoice emails is checked Invoice checked to Send Email Check to Send Confirmation Email But the system only sends the proforma invoices and does not send the paid ones. I see the doc for debug problem but don't see anything. I checked logs on my own mail server, and is simple. WHMCS not try send email. Not error on communication. Onley stop action. Best regards.
-
I am having isuess with my whmcs since order not creating invoices getting error message "PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2147483647' for key 'PRIMARY
-
Hi, I had a client that was charged twice for one invoice. Any idea why this would happen? I dont see any duplicate invoice or transaction in WHMCS, but on his credit card statement there are two charges from 11/02
-
Hi! Please, The WHMCS system is sending an invoice with PDF attached, but when I open the PDF file the invoice does not appear (blank page). I went to WHMCS Adm and I try to open the invoice but it also doesn't appear (white screen). * Please, see image attached. Can someone help me? Thanks!
-
- invoice Pdf
-
(and 1 more)
Tagged with:
-
I created a hook to modify the due date of the invoice. The whole code executes fine, but at the end I don't see any fields I update in the database. Can anyone help me to see where the problem is. Thanks for everyone's help <?php use WHMCS\Database\Capsule; function hook_invoice_payment_terms($vars) { $pdo = Capsule::connection()->getPdo(); $pdo->beginTransaction(); // Setup $adminuser = "Jerry"; $responsetype = "json"; $customFieldName = 'Payment Terms'; $options=payment_terms_getoptions(); $defaultTerms=$options["DefaultPaymentTerm"]; $invoiceid = $vars['invoiceid']; $invoicesource =$vars['source'] ; $creatinguser = $vars['user'] ; // Get Invoice structure $command = "getinvoice"; $values["invoiceid"] = $invoiceid; $values["responsetype"] = $responsetype ; $getinvoice = localAPI($command,$values,$adminuser); //var_dump($getinvoice); //echo "<br/>"; logModuleCall( 'paymenmterms', $command, $values, $getinvoice); if ($getinvoice['result']=="success") { $values = null; unset($values); // Get customer details $command = "getclientsdetails"; $values["clientid"] = $getinvoice['userid']; $values["stats"] = false; $values["responsetype"] = $responsetype ; $getclientsdetails = localAPI($command,$values,$adminuser); logModuleCall( 'paymenmterms', $command, $values, $getclientsdetails); $sql = "SELECT DISTINCT SUBSTRING_INDEX(cv.value, '|', 1) FROM tblcustomfieldsvalues AS cv JOIN tblcustomfields AS cf ON cv.fieldid = cf.id WHERE cf.fieldname LIKE '".$customFieldName."' AND cv.relid = ".$getinvoice['userid']; $res = $pdo->query($sql); $numrows = $res->rowCount(); /* $sql = "SELECT DISTINCT SUBSTRING_INDEX(SUBSTRING_INDEX(cv.value, '|', 1), '|', -1) FROM tblcustomfieldsvalues AS cv JOIN tblcustomfields AS cf ON cv.fieldid = cf.id WHERE cf.fieldname LIKE '".$customFieldName."' AND cv.relid = ".$getinvoice['userid']; $result = mysql_query($sql); $numrows = mysql_num_rows($result); */ if ($numrows > 0) { // logModuleCall( 'paymenmterms', "GetCustomValue", $sql, $result); $TermDays = $res->fetchColumn($result); } else { $TermDays=$defaultTerms; } // Get Invoice Due Date $newInvoiceDate = time() + ($TermDays * 86400); $newInvoiceDate = date("Y-m-d", $newInvoiceDate); // Update invoice if not error //if ( !($errorOnTerms) ) { logActivity("Updating Invoice $invoiceid due date to $newInvoiceDate"); $command = "UpdateInvoice"; $values["invoiceid"] = $invoiceid; $values["duedate"] = $newInvoiceDate; $values["responsetype"] = $responsetype ; $values["notes"] = "Updating Invoice $invoiceid due date to $newInvoiceDate"; $updateinvoice = localAPI($command,$values,$adminuser); logModuleCall( 'paymenmterms', $command, $values, $updateinvoice); if ($updateinvoice['result']!="success") { // Error Updating Invoice logActivity("An Error Occurred while updating Invoice: ".$updateinvoice['result']); } Else { // Invoice Update Successful! // Get Invoice structure $values = array(); $command = "getinvoice"; $values["invoiceid"] = $invoiceid; $values["responsetype"] = $responsetype ; $getinvoice = localAPI($command,$values,$adminuser); //print_r($updateinvoice); //print_r($getinvoice); //exit; } // Cleanup $values = null; unset($values); } Else { // Error Getting Invoice logActivity("ERROR: Unable to retreive Invoice ID $invoiceid!"); } } function payment_terms_getoptions() { // Get configurable options $table = "tbladdonmodules"; $fields = "setting,value"; $where = array("module"=>"paymentterms"); $result = select_query($table,$fields,$where); $options = array(); while ($data = mysql_fetch_array($result)) { $option_name = $data['setting']; $options["$option_name"] = $data['value']; } return $options; } add_hook("InvoiceCreation",9999,"hook_invoice_payment_terms"); When I was debugging, after I tried update in the hook, I read out the invoice information, and it was the same as what I submitted for the update; But in the end this information is not written to the mysql.
-
So far I've hooked dedicated ip from tblhosting to viewinvoice.tpl and is assigned to paid services accordingly. What I'm trying to figure out : -> To show dedicated ip assigned in WHMCS Billing for -> Where you can view dedicated ip in the description as well. ( To help our billing member search for dedicated ip to be cancelled at ease by looking at customer's invoice items in WHMCS->Billing) For example : What is in my mind : How do I query the database tblhosting [dedicatedip] into WHMC->Billing->Invoices->Any customer's Invoice id description as shown above ? As far as I know, WHMCS admin .php file is encoded where we do not able to edit. Hopefully and I believe there is a way to append to show the dedicated ip !
- 13 replies
-
- whmcs
- dedicatedip
-
(and 3 more)
Tagged with:
-
I can't seem to find a documented way to create an add funds invoice via the API. I can create regular invoices for services and charge them but I need to be able to create add funds invoices. Has anyone been able to do this?
-
Hi I've seen numerous treads on this community, and generally other forums across the net regarding showing the product description below the name of product in invoices and quotes. I cannot find a setting nor any codes I can add in the TPL files. Is there a module or code I can add so the description shows in the pdf of the invoice or quote?
-
Hello, As some of you may know we in Croatia are obligated to have currency on HRK inside invoice, this makes stuff hard for me and my friend cause we're based on international marketplace and not only Croatia. Sadly we we're trying to come up with a solution and its been real pain in the ass trying to figure something out. As much as I know its not possible to use hooks inside php, so we have no idea how it would be possible to have currency exchange inside pdf that is being delivered by email. Really any help would be appreciated. We tried looking up on older posts but haven't found a solution yet, so please help 2 guys out :D
-
Hi friends, I tried to find an invoice template that would meet EU regulations. I didn't find it, maybe I'm looking wrong. According to EU rules, the type and amount of VAT must be specified for each item. I give an example of what an invoice should look like in the attachment. Can anyone solve this problem? Or do you know of a teplat that would meet these rules? Black texts: are firmly in the template Green texts: data generated from WHMCS Because I use the Czech language, the Czech names of the items are listed in the template I gave an example of generating products on an invoice. I am willing to evaluate the help financially. I need to change both the HTML and PDF invoice.
-
Hello, i am trying to add bank transfer details but having some problem. I am unable to add space after text below attaching screenshot for understanding. My issue- https://prnt.sc/1x5pccy i found one website using same theme without this problem - https://prnt.sc/1x5p7zo here is how i have added details to whmcs admin area- https://prnt.sc/1x5pjhz
-
Hello, How to update the Credit Balance for a client after changing the Invoice and InvoiceItems? I'm using Paddle for processing my payments. When sending the invoice data to Paddle I send it without taxes. Then Paddle handles the taxes and at the Subscription Payment Success webhook I get if there are any taxes. Then I change the Invoice Items and the Invoice. ((((Don't know if UpdateClientProduct autorecalc is not working in v8.2 or it is used for something else)))) At the end I also update the Invoice with tax amount and the new total with taxes. I'm new with WHMCS (2 months now) and PHP (3 months). Now, I can't find the way how to update or trigger something to update the Credit Balance on the Summary for Client. It is still the old value that was before adding taxes to Invoices. Is there an API to update the Clients amounts, including Credit Balance and do I need to update something else after my changes to the Invoices? Here the part of the code that is doing this: $withoutTax = $fields['balance_fee'] + $fields['balance_earnings']; $taxAmount = $fields['balance_tax']; $withTax = $fields['balance_gross']; if ( $withoutTax <> 0 ) { $taxPercent = round(($taxAmount / $withoutTax) * 100, 2); } else { $taxPercent = 0; } if ( $taxPercent <> 0 ) { $itemTaxed = 1; } else { $itemTaxed = 0; } $command = 'GetInvoice'; $values = array( 'invoiceid' => $invoiceId, ); //$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later // Call the localAPI function $invoice = localAPI($command, $values, $adminUsername); logModuleCall('paddle_checkout_gateway_callback', 'UpdateInvoice_localAPI_invoice', $invoice, ""); if ($invoice['result'] == 'success') { foreach ($invoice['items']['item'] as $item) { //error_log($vars['invoiceid'].' item '.$item['id'].' has description of "'.$item['description'].'"'); $text = $item['description']; $updatedInfo = array( 'invoiceid' => $invoiceId, 'taxrate' => $taxPercent, 'itemdescription' => array($item['id'] => $text), 'itemamount' => array($item['id'] => $item['amount']), 'itemtaxed' => array($item['id'] => $itemTaxed) ); $updatedInvoice = localAPI('UpdateInvoice', $updatedInfo, $adminUsername); logModuleCall('paddle_checkout_gateway_callback', 'UpdateInvoice', $updatedInfo, $updatedInvoice); } } else { //echo "An Error Occurred: " . $results['result']; } // let's now trigger the recalculate of each hostingId from this updated invoiceid // I think that this is not working in v8.2 or the UpdateClientProduct autorecalc is used for something else $invoiceitems = Capsule::table('tblinvoiceitems') ->where('invoiceid', $invoiceId) ->where('type', 'Hosting')->get(); //->first(); foreach( $invoiceitems as $invoiceitem ){ //$invoiceitem->relid this is the id from the tblHosting table $resultOfAPI = localAPI('UpdateClientProduct', array('serviceid' => $invoiceitem->relid, 'autorecalc' => true), $adminUsername); logModuleCall('paddle_checkout_gateway_callback', 'recalculateProductItems', $invoiceitem->relid, $resultOfAPI); } // 20210927 maybe a bug in v8.2 // not updating the tax and the total amount of the invoice with UpdateClientProduct 'autorecalc' // manualy updating the table tblinvoices try { Capsule::table('tblinvoices') ->where('id', $invoiceId) ->update([ "tax" => $taxAmount, "total" => $withTax ]); } catch (\Exception $e) { logModuleCall('paddle_checkout_gateway_callback', 'recalculateProductItems_ERROR', "tax " .$taxAmount . " total " .$withtax ,$e); echo "Error in updating tblInvoices. {$e->getMessage()}"; }
-
the problem is when the cust buys 2 item and only of them has promo but the invoice somehow calculate both it together in the same promo. this is not promotion setting problem. Can anyone help out?
-
Hi there. After a long search in Google and this community, I didn't really able to find a clue on how to handle this, if there is a product which upgrade will incurs a full charge, rather than default prorated charge in WHMCS. Do you guys has any hints or workaround? Here's the full list of issues I am experiencing now, hope will get any help from you here. Thanks in advance. 1. What's the proper procedures to take, if there is a product/service renewal or upgrade will incurs a full charge rather than prorated according to remaining days? 2. When a product/service renewed (recurring auto CC charged or invoice paid), which hook or function in Addons/Provisions can use to trigger follow up actions? Like post an API request to principle for such renewal action. 3. When a Renewal button being click, either on Admin/Client Panel, it will triggers invoice and charge directly on client deposited funds if sufficient fund available. Which localAPI should I call? 4. I noticed if the Product/Service being created with recurring terms, for example monthly or annually, it will automatically triggered an invoice by WHMCS cron. Wish to know if there is sufficient fund in client account, will the cron direct credited its balance and send a paid invoice? Which hook should I use if the invoice send is a paid invoice? Best Regards, Nelson
-
Hi, i live in Romania and in our country is mandatory to have the total of the invoice in the local currency also for example if the total is 5 Euro, to display under the currency in RON also. Plz help me configure this invoice so i can start my buissnes.
-
I have two accounts that don't have a credit card on file. (They were lost during a migration somehow). And I don't know what's causing those accounts to be delivered an email EVERY day that says "We tried to bill your card but you don't have one on file." What is the setting that's causing this? The only things I suspect are 2 settings in automation. 1. "Retry every week for..." was set to 0 (but I thought that meant disable not every day. 2. The "Send invoice payment reminder" for 2nd and 3rd were both set to 0 also. But those specifically say 0 to disable. I don't feel like either of those should behave that way though.
- 2 replies
-
- automation
- Cron
- (and 4 more)
-
Hello, It's almost half year, our customers complain on Paid Invoice getting terminated (Whether it is on time/due/suspended). It is not sure what causes it, the customer is increasing leading to increasing complains on service terminated (Which cannot be recovered) although that it has been paid. For example of Use Case: For Subscription A, due is on today and knowing termination date is 2 days after. I managed to paid it before termination date. However, the system still terminate my service on specified termination date. End of Use Case Known changes made last year: - Installed LiteSpeed Web Server. - Upgraded to php73 (from ea-php56 to ea-php73) of Apache + (Cloudlinux Uninstalled) - Updated CronJob accordingly for php73 [Note: I've also removed all custom hooks made to see if it is the causes, it doesn't seems like it] [Current version of WHMCS: 8.1.3 (Manual Update)] Modules Extension used: 1. ASPnix License Manager 2. Braintree Advacne Fraud Helper 3. Braintree Transaction Lookup 4. EunaRede Core (GA Ecommerce Tracking) Thank you. I try my best to give more details if needed.
- 3 replies
-
- terminated
- invoice generation
-
(and 2 more)
Tagged with:
-
Forgive me for a newbie but I have been reading documentation and this community community all day without an answer. I want to print the order number as reported in the customer order confirmation email on the customer's invoice and the invoice email. Seems a natural enough thing to want but the order_number seems not to exist in the context of invoices. Why? Is this a bug or a feature? Thanks, Hank Cohen
-
hello everyone. hope all are doing fine. can some one help me with correct my tpl file for the pdf invoice. basically what i am looking for is.... my product price is 55 euros which is included TAX . my tax rate is 21% so my product real price is 45.45 euros and 9.55 is TAX at the moment its showing like this which is accurate i know. but i want to hide that line 21.00% VAT from this pdf all i want it too looks like i dont want to remove the functionality just i want to hide the TAX thing from the invoicepdf here is my code <?php # Logo $logoFilename = 'placeholder.png'; if (file_exists(ROOTDIR . '/assets/img/logo.png')) { $logoFilename = 'logo.png'; } elseif (file_exists(ROOTDIR . '/assets/img/logo.jpg')) { $logoFilename = 'logo.jpg'; } $pdf->Ln(5); $pdf->SetFont($pdfFont, 'B', 15); $pdf->SetFillColor(255); $pdf->SetFont($pdfFont, '', 16); $pdf->Cell(100, 6, "My Bill Summary", 0, 1, 'L', '1'); $pdf->Image(ROOTDIR . '/assets/img/' . $logoFilename, 120, 25, 75); # Company Details $pdf->SetXY(15, 70); $pdf->SetFont($pdfFont, '', 13); foreach ($companyaddress as $addressLine) { $pdf->Cell(180, 4, trim($addressLine), 0, 1, 'R'); $pdf->SetFont($pdfFont, '', 9); } if ($taxCode) { $pdf->Cell(180, 4, $taxIdLabel . ': ' . trim($taxCode), 0, 1, 'R'); } $pdf->Ln(5); # Clients Details $pdf->SetXY(15, 70); $pdf->SetFont($pdfFont, 'B', 10); $pdf->SetFont($pdfFont, 'B', 14); if ($clientsdetails["companyname"]) { $pdf->Cell(0, 4, $clientsdetails["companyname"], 0, 1, 'L'); $pdf->Cell(0, 4, Lang::trans('invoicesattn') . ': ' . $clientsdetails["firstname"] . ' ' . $clientsdetails["lastname"], 0, 1, 'L'); } else { $pdf->Cell(0, 4, $clientsdetails["firstname"] . " " . $clientsdetails["lastname"], 0, 1, 'L'); } $pdf->SetFont($pdfFont, '', 12); $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["postcode"], 0, 1, 'L'); $pdf->Cell(0, 4, $clientsdetails["country"], 0, 1, 'L'); if (array_key_exists('tax_id', $clientsdetails) && $clientsdetails['tax_id']) { $pdf->Cell(0, 4, $taxIdLabel . ': ' . $clientsdetails['tax_id'], 0, 1, 'L'); } $pdf->Ln(5); $pdf->Ln(5); $pdf->Ln(5); # Header Bar /** * Invoice header * * You can optionally define a header/footer in a way that is repeated across page breaks. * For more information, see http://docs.whmcs.com/PDF_Invoice#Header.2FFooter */ $pdf->SetFont($pdfFont, 'B', 15); $pdf->SetFillColor(239); $pdf->SetFont($pdfFont, '', 12); if ($customfields) { foreach ($customfields as $customfield) { $pdf->Cell(75, 6, $customfield['fieldname'] . ' ' . $customfield['value'], 0, 1, 'L', '1'); } } $pdf->Cell(75, 6, "Invoice Number " . ' ' . $invoiceid, 0, 1, 'L', '1'); $pdf->Cell(75, 6, "Bill Issue Date" . ' ' . $datecreated, 0, 1, 'L', '1'); $pdf->Cell(75, 6, "Payment Method" . ' ' . $paymentmethod, 0, 1, 'L', '1'); $pdf->Ln(10); $startpage = $pdf->GetPage(); # Invoice Items $tblhtml = '<table width="85%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0"> <tr height="30" bgcolor="#efefef" style="font-weight:bold;text-align:center;"> <td width="80%">' . Lang::trans('invoicesdescription') . '</td> <td width="20%">' . Lang::trans('quotelinetotal') . '</td> </tr>'; foreach ($invoiceitems as $item) { $tblhtml .= ' <tr bgcolor="#fff"> <td align="left">' . nl2br($item['description']) . '<br /></td> <td align="center">' . $item['amount'] . '</td> </tr>'; } $tblhtml .= ' <tr height="30" bgcolor="#efefef" style="font-weight:bold;"> <td align="right">' . Lang::trans('invoicessubtotal') . '</td> <td align="center">' . $subtotal . '</td> </tr>'; if ($taxname) { $tblhtml .= ' <tr height="30" bgcolor="#efefef" style="font-weight:bold;"> <td align="right">' . $taxrate . '% ' . $taxname . '</td> <td align="center">' . $tax . '</td> </tr>'; } if ($taxname2) { $tblhtml .= ' <tr height="30" bgcolor="#efefef" style="font-weight:bold;"> <td align="right">' . $taxrate2 . '% ' . $taxname2 . '</td> <td align="center">' . $tax2 . '</td> </tr>'; } $tblhtml .= ' <tr height="30" bgcolor="#efefef" style="font-weight:bold;"> <td align="right">' . Lang::trans('invoicescredit') . '</td> <td align="center">' . $credit . '</td> </tr> <tr height="30" bgcolor="#efefef" style="font-weight:bold;font-size:16px;"> <td align="right">' . "Total Amount Due" . '</td> <td align="center">' . $total . '</td> </tr> </table>'; $pdf->writeHTML($tblhtml, true, false, false, false, ''); $pdf->Ln(5); $html = "<h2 style=\"color:red;\"> Please pay by ${duedate} </h2>"; $pdf->writeHTML($html, true, false, false, false, ''); $pdf->Ln(10); $pdf->SetFont($pdfFont, 'B', 15); $pdf->SetFillColor(239); $pdf->SetFont($pdfFont, '', 10); $pdf->Cell(125, 6, "Failure to pay your account in full may result in loss of service.", 0, 1, 'L', '1'); $pdf->Cell(125, 6, "Reactivation of your service could take up to 7 days and will incur a fee. ", 0, 1, 'L', '1'); $pdf->Ln(10); # Notes if ($notes) { $pdf->Ln(5); $pdf->SetFont($pdfFont, '', 8); $pdf->MultiCell(170, 5, Lang::trans('invoicesnotes') . ': ' . $notes); } /** * Invoice footer */ can someone please help me in this issue.. i really need to solve it Thanks a million in advnace
-
module How to add values from modules to invoice using module hooks?
code47 posted a question in Building Modules
Hello, I am creating a module for invoice to display data from database. I want to know how to add that fetch value from module to invoice using hooks.-
- invoice template
- invoice
-
(and 1 more)
Tagged with:
-
Hello everyone. greetings from me again. i need to print out monthly sales report to submit tax office and the way whmcs sales tax liability report print its not possible to submit. there is no company name showing and also we dont work with clients name so i dont need to show the client name in the report. also after print out the report it showing in the top the whole whmcs admin link and whmcs printer friendly report. is there any chance i can customize the pdf report? like the way we customize the pdf invoice Hope someone can help me on this issue Thanks again
-
Hello everyone. how are you? i need some expert help for my whmcs. basically i have setup a product with billing cycle quarterly with price of 150 euros. the customer used that for almost 2 and half months. now system generate an invoice for 150 euros again for the next 3 months. and now customer rang me and said he would like to go for monthly payment which is 55 a month. problem is invoice is generated and if i cancel the invoice system will not be generating any more invoice for him. so what can i do now? i need to remove or cancel that 3 months invoice and generate him a monthly invoice can someone please help with some idea. i am sure lot of people face this issue before Thanks very much in advance for reading my post
-
Hello, I am trying to customize viewinvoice.tpl I have almost finished customization but I have stuck in adding qty and item price of product and configurable options. I have attached screenshot of what i want to achieve.
-
Hello, currently we're using WHMCS 7.10.2 We've received a complaints for: - 2 Customers who has paid monthly recurring amount, but then getting suspended - This is because "next due date" not getting updated. (We've double-checked on payment portal, indeed the customer has paid) May I know what is the root cause behind this bug? Thanks!
- 2 replies
-
- invoice
- nextduedate
-
(and 1 more)
Tagged with:
-
hello thanks for reading my text. i have whmcs latest version and what is the issue is i can see the cron not generating the monthly invoice. i have a customer who have an active product due at 08/08/2020 but i cant understand why the cron is not generating the invoice when its suppose to be generate 14 days earlier. but if i click on the customer dashboard generate due invoice i can see system create the invoice for that client. so can someone guide me what can be issue?? i can see in the logs but i can't find any issue at all 😞 dont know what to do just to let you know i have customized pdf invoice . is that giving any issue? thanks a million in advance. please stay safe