Jump to content

Mas-J

Member
  • Content Count

    26
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Mas-J

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thank you once again for the new knowledge about WHMCS hooks, you're awesome @brian! Now I can add something new to the page 🙂
  2. 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 🙂
  3. 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 🙂
  4. 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.
  5. 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 });
  6. Got the answer from Support, may it help someone who want select the query to get detail description on the order page
  7. 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]); } }
  8. 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 ?
  9. @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 ?
  10. 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 ?
  11. 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.
  12. Thanks for the suggestion, but this is not the solution for my question actually 🙂
  13. 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}
  14. 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!
  15. 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 ?
×
×
  • 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