Jump to content

Mas-J

Member
  • Posts

    27
  • Joined

  • Last visited

Everything posted by Mas-J

  1. Hi, I want to show 2 value on the Client Area page when on the Switch Account Page next to the Client Name instead of Client Name only, I want add client email & company name too or something client custom field to identify the project name on that client as example. I can do similar on admin area page on other case, because it have a value for the user ID to get any data from database. But, on the Client Area Switch Account Page I can't find it Variable Type Notes companyname string logo string systemurl string charset string pagetitle string filename string template string language string LANG array Active language translation strings todaysdate string Human friendly formatted version of todays date date_day string Current day of the month date_month string Current month date_year string Current year WEB_ROOT string The web path to the WHMCS doc root BASE_PATH_CSS string BASE_PATH_JS string BASE_PATH_FONTS string BASE_PATH_IMG string token string CSRF token value servedOverSsl bool True if page was loaded via https:// Here's the code that I write, I know it's not perfect because it not tested before Is there any clue ?
  2. Thank you once again for the new knowledge about WHMCS hooks, you're awesome @brian! Now I can add something new to the page 🙂
  3. Actually before your post I've write some code from Kian reference that you gave me but I can't submit it to community to ask you, the page say 403 forbidden I think it because the JS script. I've write your code (and double check) but the NID didn't appear, have you test it in your whmcs ? My code still not perfect like Kian said, when refresh page or change the services it will show 1970-01-01 After see your code and give a little modification I can show the NID value, thanks Thank you ! How about to know what value we can use for variable ? example variable $vars['filename'] with value 'clientsservices' Where I can know the list value like 'clientsservices' ? I want to know others value from some variables in WHMCS 🙂
  4. Hi @souzadavi can you share the script ? I need to modify for another function to calling some value from database & show it on products/services page 🙂
  5. Oh thank you for the correction @brian! How to determine the related service that page that admin open ? I think if using AdminClientServicesTabFields Hooks it can detect value of service ID. Can I use two Hooks in one file ? AdminClientServicesTabFields for related service ID AdminAreaHeaderOutput for the output in the page I got the logic, how can I know the parameter that can be used as variable like vars=['filename'] or $_Get ? Can you give me the reference link or document from WHMCS maybe ? I didn't know the keyword to find it.
  6. Dear All, I want to show the Next Invoice Date under Next Due Date when admin access Page Client Details on Product/Services Tab. But, I've no idea how to show it, I just know to get the Next Invoice Date value related from tblhosting Anyone can help me to show it ? Thank you. <?php use WHMCS\Database\Capsule; add_hook('AdminClientServicesTabFields', 1, function($vars) { $PID = $vars['id']; $nextinvoicedate = Capsule::table('tblhosting')->where('id', $PID)->pluck('nextinvoicedate'); $result = array(); $result['nextinvoicedate'] = $nextinvoicedate; return $result });
  7. Got the answer from Support, may it help someone who want select the query to get detail description on the order page
  8. This is my first custom hooks. I've create this code to work for my requirement, you can modify this code to suite your needs. It will change the due date (tblinvoices.duedate) when create recurring invoices as you wish without changing the billing period (tblhosting.nextduedate & tblhosting.nextinvoicedate) Email Cron reminder will follow the new due date. Backup first and please try on development server before use it on production ! Do with your own risk. <?php # Set Recurring Invoice Due Date to date 10 each month on actual billed period # Created by AULtramen if (!defined("WHMCS")) { die("This file cannot be accessed directly"); } use Illuminate\Database\Capsule\Manager as Capsule; add_hook("InvoiceCreation", 1, "SetDueDateRecurringInvoices"); function SetDueDateRecurringInvoices($vars) { #You can edit source with your needs if ($vars['source'] == 'autogen' || $vars['source'] == 'api') { #Change "16" to other value based on your Invoice Generation Date setting to Match any Due Date you want $duedate10 = Date('y-m-d', strtotime('+16 days')); Capsule::table('tblinvoices') ->where('id', '=', $vars['invoiceid']) ->update(['duedate' => $duedate10]); } else if ($vars['source'] == 'adminarea') { #Change "7" to other value based on your Invoice Generation Date setting to Match any Due Date you want $duedate7 = Date('y-m-d', strtotime('+7 days')); Capsule::table('tblinvoices') ->where('id', '=', $vars['invoiceid']) ->update(['duedate' => $duedate7]); } }
  9. Dear All, My Product setting Configuration Prorate Date: 1 Charge Next Month: 32 So, every product that client buy will have Next Due Date value on tblhosting 01/mm/yyyy on each month My Goal: I want to make all Invoices that created by automatic cron (recurring invoice, etc) and publish to client have a duedate value 10/mm/yyyy The Next Due Date from tblhosting do not need to be change, because I need the product period date is 1 until the end of the date of that billed month. Is it possible to do that by create Hooks ? If yes, which Hooks variable that I need to use to achieve it ? If due date value from tblinvoices can be overwrite by hook, does the invoice reminder cron will follow the new due date ?
  10. @brian! Thank you for the insight. However I've a prepare a 2 different query for last solution and tell my admin team to tick every new order to tick create invoice checkbox and don't send to client if there's need a modification for date period. With that, I can differentiate where's the Invoice come from new order and recurring. I still curious, how to get the list of item from this order page if when admin create manual order without tick the Create Invoice ?
  11. Dear All, My Goal: Select Invoice Items that come from Prorata Invoice or Recurring Invoice from database Problem: I didn't find any relation between tblinvoices & tblinvoiceitems with tblorders. Question: Which table that I should join so it can be related and I can get my correct result ?
  12. No problem, hehe.. It's not me, but I've vote for it but I think WHMCS didn't consider it since 2 years ago LoL Cool ! Thanks for the insight, however I can't create the script but I'll give this clue to our dev on other custom modules.
  13. Thanks for the suggestion, but this is not the solution for my question actually 🙂
  14. Finnaly I solved this and didn't why it can be working right now LoL <td> {if $paymentmodule == "localbank"} : 12312{$clientsdetails["customfields2"]} {elseif $paymentmodule == "banktransfer"} : 77777{$clientsdetails["customfields2"]} {/if} </td> Even I've change the script from @brian! it working too, thanks ! {if $paymentmodule == "localbank"} <td>: 123123{$clientsdetails["customfields2"]}</td> {else} <td>: 77777{$clientsdetails["customfields2"]}</td> {/if} or... {if $paymentmethod == "Local Bank"} <td>: 123123{$clientsdetails["customfields2"]}</td> {else} <td>: 77777{$clientsdetails["customfields2"]}</td> {/if}
  15. Actually why I'm doing in template, because I've custom template so there's no worries if there's update on template six. If there's an update on that template, I just need to compare the changes if needed. Then, for locating the description of the payment method by default is on the top of view invoice page, where my finance team want located that information after the transaction table. That's why I need use new script to make it appear on new table that I created. For the payment method description on the top of page I just write "See the payment instrcution below". Another reason, the PDF need to show the table of the payment method that my finance team want, so the invoice should as same as PDF hehehe... Maybe I'll consider to move it to the bottom and replace my custom code if I stuck and WHMCS support didn't give any clue 🙂 Btw, thanks for the suggestion @brian!
  16. Thank you for your suggestion @brian! 🙂 I've try the two option and the value of banktransfer is show the correct value, I didn't know why the template can't recognize the $paymentmethod or $paymentmodule for custom/copy banktransfer in this case is localbank. It's weird. Is it possible if I open ticket to WHMCS support ?
  17. I've already change it actually when post this thread 🙂 I can confirm it because I can see the difference when select one of them, the description will change when select the payment method That's why I asked, maybe there's another clue ? Maybe can you try on your dev environtment @brian! just for make sure ?
  18. Condition: I've create copy of banktransfer and rename it as localbank. My goal: I want to show some dynamic Virtual Account number (combination of fixed bank code + custom field) when payment method localbank is selected and client preview invoice then choose it (viewinvoice.tpl) I've try with several variable but there's no suitable value to match the selected payment method using if-else condition. Could you tell me what the correct variable for selected payment method ? Here's my custom script on viewinvoice.tpl {if $paymentmethod == "localbank"} <td>: 123123{$clientsdetails["customfields2"]}</td> {else} <td>: 77777{$clientsdetails["customfields2"]}</td> {/if} With that code, when localbank is selected the result always show the else result. Although when I change the $paymentmenthod value to banktransfer, it still show the else result.
  19. I need to add Restitution (one time) item with minus value if there's subscription that didn't meet the SLA from last month on the Invoice generate on the next month. I know it should need manual admin intervention. Is there any idea where I should implement it ? Use the billiable item or maybe is there any suggestion ?
  20. Thanks for the suggestion, but I can't use this method since my Invoice format Tags is not follow the incremental invoice ID. @Kian Do you mean Snapshoot invoice number = Store Client Data Snapshot ? In my code, I'm using variable from invoice number and when I see the table invoice_mod which is save the data of the invoice, I didn' see the value of it. Would you elaborate your suggestion, thank you. I've try some workaround, when I add payment to make the invoice become Paid. I added the transacion ID as same as the Virtual Account number. So, I change the variable when the Invoice Paid using {$transaction.transid|substr:9} instead of {$invoicenum} Why I substr to 9 ? Because to prevent our Admin if they forgot to input the transaction ID. Instead of show zero value it will show some variable of Custom Client Fields without the proforma invoice number. This is not solved at all, still need manual input from admin but can be used as workaround for now. Here's my code if you want to see, check the line substr($trans['transid'],9) on invoicepdf.tpl and {$transaction.transid|substr:9} on viewinvoice.tpl : invoicepdf.tpl #Start - Payment Method $pdf->SetFont($pdfFont,'',9); $paymethhtml = '<table width:"100%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0"> <tr height="30" bgcolor="#efefef" style="font-weight:bold;text-align:left;"> <td width="100%" colspan="2" align="left"> <h3 class="panel-title"><strong>Special Notes and Instructions</strong></h3> </td> </tr>'; $paymethhtml .= ' <tr bgcolor="#fff"> <td width="15%" align="left">Bank</td> <td width="85%" align="left">: BCA KCP Permata Buana</td> </tr>'; if ($status == 'Paid') { $paymethhtml .= ' <tr bgcolor="#fff"> <td width="15%" align="left">A/C Number</td> <td width="85%" align="left">: '.$clientsdetails["customfields2"].''.substr($clientsdetails["customfields1"],3).''. substr($trans['transid'],9) .'</td> </tr>'; } else { $paymethhtml .= ' <tr bgcolor="#fff"> <td width="15%" align="left">A/C</td> <td width="85%" align="left">: '.$clientsdetails["customfields2"].''.substr($clientsdetails["customfields1"],3).''.$invoicenum.'</td> </tr>'; } $paymethhtml .= ' <tr bgcolor="#fff"> <td width="15%" align="left">Account Name</td> <td width="85%" align="left">: '.$clientsdetails["companyname"].'</td> </tr> </table>'; $pdf->writeHTML($paymethhtml, true, false, false, false, ''); #End - Payment Method viewinvoice.tpl <!--Start - How to Payment--> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><strong>Special Notes and Instructions</strong></h3> </div> <div class="panel-body"> <div class="table-responsive"> <table class="table table-condensed" width="100%"> <thead> <tr> <td>Bank</td> <td>: BCA KCP Permata Buana</td> </tr> </thead> {if $status eq "Paid"} <tr> <td>A/C</td> <td>: {$clientsdetails["customfields2"]}{$clientsdetails["customfields1"]|substr:3}{$transaction.transid|substr:9}</td> </tr> {else} <tr> <td>A/C</td> <td>: {$clientsdetails["customfields2"]}{$clientsdetails["customfields1"]|substr:3}{$invoicenum}</td> </tr> {/if} <tr> <td>Account Name</td> <td>: {$clientsdetails.companyname}</td> </tr> </table> </div> </div> </div> <!--End - How to Payment--> Any suggestion will be appreciated 🙂
  21. That's my pain, actually I've create custom invoicing module with modulesgarden but it has been over 2 years and still buggy and can't be implemented until now where the one of the feature is adding some notes about proforma invoice number after the invoice Paid. With that I can show the Virtual Account number which is previously as Proforma Invoice Number. I'm still find some workaround about this, maybe one of the member in here have a solution 🙂 Btw, thanks for the sharing.
  22. Dear All, I want display some fix virtual account for payment when client view invoice & on PDF. This Virtual Account is consist of 5 digits our Bank Unique Number + 4 digits customer code from Custom Client fields + 7 digits Proforma Invoice Number I've succesfully create the custom code in viewinvoice.tpl & invoicepdf.tpl under template folder. The result is fine if the status still Unpaid because the Proforma Invoice number show as is. But when this Invoice has been Paid the Invoice Number value from Database is change with sequential Invoice Number, so the custom code that I created didn't show the previous Invoice Number which is a Proforma Invoice Number. Is there any idea how to get the Proforma Invoice Number after Invoice has been Paid ? Here's my code: invoicepdf.tpl #Start - Payment Method $pdf->SetFont($pdfFont,'',9); $paymethhtml = '<table width:"100%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0"> <tr height="30" bgcolor="#efefef" style="font-weight:bold;text-align:left;"> <td width="100%" colspan="2" align="left"> <h3 class="panel-title"><strong>Special Notes and Instructions</strong></h3> </td> </tr>'; $paymethhtml .= ' <tr bgcolor="#fff"> <td width="15%" align="left">Bank</td> <td width="85%" align="left">: BCA KCP Permata Buana</td> </tr>'; if ($status == 'Paid') { $paymethhtml .= ' <tr bgcolor="#fff"> <td width="15%" align="left">A/C Number</td> <td width="85%" align="left">: '.$clientsdetails["customfields2"].''.substr($clientsdetails["customfields1"],3).''.$invoicenum.'</td> </tr>'; } else { $paymethhtml .= ' <tr bgcolor="#fff"> <td width="15%" align="left">A/C</td> <td width="85%" align="left">: '.$clientsdetails["customfields2"].''.substr($clientsdetails["customfields1"],3).''.$invoicenum.'</td> </tr>'; } $paymethhtml .= ' <tr bgcolor="#fff"> <td width="15%" align="left">Account Name</td> <td width="85%" align="left">: '.$clientsdetails["companyname"].'</td> </tr> </table>'; $pdf->writeHTML($paymethhtml, true, false, false, false, ''); #End - Payment Method viewinvoice.tpl <!--Start - How to Payment--> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title"><strong>Special Notes and Instructions</strong></h3> </div> <div class="panel-body"> <div class="table-responsive"> <table class="table table-condensed" width="100%"> <thead> <tr> <td>Bank</td> <td>: BCA KCP Permata Buana</td> </tr> </thead> {if $status eq "Paid"} <tr> <td>A/C</td> <td>: {$clientsdetails["customfields2"]}{$clientsdetails["customfields1"]|substr:3}{$invoicenum}</td> </tr> {else} <tr> <td>A/C</td> <td>: {$clientsdetails["customfields2"]}{$clientsdetails["customfields1"]|substr:3}{$invoicenum}</td> </tr> {/if} <tr> <td>Account Name</td> <td>: {$clientsdetails.companyname}</td> </tr> </table> </div> </div> </div> <!--End - How to Payment-->
  23. If I want to test the invoicing flow for several months later, how the correct way to move forward the date and what should I do with whmcs system itself? Maybe I just need change the server date to the specific event date and run the whmcs cron or I need move the server date day-by-day with whmcs cron run. Which one is correct ? Or maybe there's a better way to do that, please advice. Thanks.
  24. Hello Everyone, I activate the proforma invoice feature for invoice. I want rename the PDF being sent to client if the invoice status is Unpaid become "Proforma Invoice-1900001" instead of the standard name "Invoice-1900001" So, it will make a differenciation between Unpaid invoice and Paid invoice PDF when client recieved it. Do you know what file and script should I edit to make it possible ?
  25. I have problem where some client have many branch office and subscription for each of it. Our client want the invoice sent separately for each site office and using different billing address depend on site office location. I didn't find WHMCS feature to fulfill it, please give me a suggestion for this case, thank you.
×
×
  • 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