Jump to content
Sign in to follow this  
code47

Invoice template customization.

Recommended Posts

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.

invoice .png

Share this post


Link to post
Share on other sites
On 18/10/2020 at 15:22, code47 said:

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.

WHMCS wouldn't store quantity as a separate value - it would have to be calculated.

Share this post


Link to post
Share on other sites
15 hours ago, brian! said:

WHMCS wouldn't store quantity as a separate value - it would have to be calculated.

Yes I know that WHMCS wouldn't store quantity as a seperate value but is there any way by which we can use database helper in viewinvoice.tpl so we can can count the number of times product was stored in invoiceitems table in database. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By Balram
      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
    • By Fany
      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.

    • By Davor
      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()}"; }  
    • By SwiftModders
      A powerful and beautiful WHMCS client theme by SwiftModders
      Take your customer’s user experience to another level with the most powerful and customizable WHMCS theme available. The Allure Theme comes with a custom-built WHMCS module that allows full control over the look and feel of your WHMCS client area. With 20+ editable options, easy adjustments for over 20 different colors, built-in favicon support, RTL, and much more!
      Learn More | View Demo | Documentation | Order Now
      Feature Highlights
          
      Additional Features
      Fully Responsive: This theme comes with a fully responsive design framework built around Bootstrap 3 and an easy to use mobile menu. SwiftModders Theme Installer: Easily manage all of your SwiftModders WHMCS Themes from one module. The Theme Installer will offer you insight into available updates, problems with your install, debugging tools, and much more! Fast & Friendly Support: One of my missions is to ensure that every client who purchases this team is well-supported and most importantly, happy! Favicon Support: Take advantage of the excellent service over at RealFaviconGenerator and add favicon support quickly and easily to your WHMCS client area. Menu Manager: As of version 1.1.0, you can now manage your WHMCS menu directly from the Theme Installer! This powerful feature comes FREE with all WHMCS Client Theme’s and makes customizing your WHMCS installation even easier. Unencoded TPL Files: There is nothing more annoying for a developer than not having access to source files. Luckily this theme offers unencoded TPL files. Three Custom Order Forms: This theme provides its own set of custom order forms that are integrated into the look and feel of your customizations. Automatic Updates: As of version 1.3.0, you can automatically update your SwiftModders WHMCS Themes from the Theme Installer. Save your time, save your effort, and leave all the work to the module! License Pricing
      LIMITED TIME OFFER: We’re keeping the summer season hot with 35% OFF all SwiftModders products! No promotional code required.
      Personal (1 Site) - $70 $45.50 per year Pro (5 Sites) - $175 $113.75 per year Agency (Unlimited Sites) - $315 $204.75 per year Personal+ (1 Site) - $140 $91 one-time Pro+ (5 Sites) - $350 $227.50 one-time Agency+ (Unlimited Sites) - $630 $409.50 one-time ORDER NOW
      All licenses will remain active for the lifetime of the product. All non-"+" licenses will require a yearly subscription for continued access to downloads and support. Before purchasing, be sure to read our License Agreement.
      Need Help? Available Services
      Theme Installation ($15): If you're not confident in your ability to install the theme yourself, I can do it for you! Give yourself peace of mind by hiring me to do the process for you. It's quick, easy, and best of all inexpensive. Theme Customization ($100): Want to make sure that your client theme matches your branding? You can hire me to adjust your theme settings to match your brand colors, fonts, logo and more. The "Theme Customization" service is NOT an integration service. I will not integrate anything from your current website design. I will match your brand colors, logo and additional style assets. Nothing additional will be done outside of that.
      Refund Policy
      You will find the refund policy for all SwiftModders products in the License Agreement.
      Browser Support
      Microsoft Edge 12+ Google Chrome 29+ Mozilla Firefox 29+ Apple Safari (iOS) 9+ SwiftModders does not provide technical support for older, outdated browsers. Please update your browser and browse safer.
       
    • By mohd
      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? 
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated