-
Posts
12 -
Joined
-
Last visited
About Sam666

Sam666's Achievements
Junior Member (1/3)
0
Reputation
-
Sam666 started following Mannually invoice selected item not generating invoices
-
Hello, I am trying to manually generate invoice by clicking `Invoice Selected Items`, however the WHMCS didn't generated any invoice, but the related service `nextinvoicedate` was added one cycle. I have read the docs about the billing logic, and investigated on MySQL tables, according to the billing logic it should generate a invoice, but not sure why didn't. Below are my step by step investigation. Appreciate if anyone can help. Analyzes the Next Due Date of all Active and Suspended services. [true] Determines whether the date is equal to or less than the number of days in the future, based on the Invoice Generation setting. [true] mysql> SELECT id, domainstatus, nextduedate, nextinvoicedate, NOW() AS Now FROM tblhosting WHERE id=1047 AND nextduedate < NOW(); +------+--------------+-------------+-----------------+---------------------+ | id | domainstatus | nextduedate | nextinvoicedate | Now | +------+--------------+-------------+-----------------+---------------------+ | 1047 | Suspended | 2022-12-29 | 2023-01-29 | 2023-02-10 20:57:20 | +------+--------------+-------------+-----------------+---------------------+ 1 row in set (0.00 sec) Ensures no invoice item exists for the service on the next due date. true mysql> SELECT COUNT(*) AS invoice_item_equal_next_due FROM tblinvoiceitems WHERE relid=1047 AND duedate=(SELECT nextduedate FROM tblhosting WHERE id=1047); +-----------------------------+ | invoice_item_equal_next_due | +-----------------------------+ | 0 | +-----------------------------+ 1 row in set (0.00 sec) Triggers the InvoiceCreation Action Hook point. Triggers the InvoiceCreationPreEmail Action Hook point. Sends the Invoice Created email to the client. Triggers the InvoiceCreated Action Hook point. Increments the Next Invoice Date of the service by one billing cycle. When I click Invoice Selected Items, then 0 Invoices Created , but the service nextinvoicedate, was added a cycle which is 2023-03-01. https://docs.whmcs.com/Billing_Logic
-
no invoice generated after change the next due date
Sam666 replied to Sam666's topic in Developer Corner
Hello @Kian, thank you for your reply. Yes it's due to the previousely deleted invoice items still remain on the tblinvoiceitems table, but those invoice items cannot be viewed on the client/service/invoice page. I have just manually find out on MySQL and deleted unnecessary invoice items, the the invoice can be generated now. Thanks again. -
Hello, I was tried to mannually generated the invoice for a service, the service next due date is 2022-12-07, and I have also check the 'tblhosting' table both the nextduedate and nextinvoicedate are 2022-12-07, then I click 'Invoice Selected Items' but no invoice being generated(the service status is Active), however the 'tblhosting' table's nextinvoicedate has been set to 2023-01-07 after clicked 'Invoice Selected Items'. According the blling logic, it should generate a invoice, I couldn't find the root cause why no invoice being generated. Appreciate if anyone can help. Analyzes the Next Due Date of all Active and Suspended services. [True, the service is Active and Next Due Date is 2022-12-07] Determines whether the date is equal to or less than the number of days in the future, based on the Invoice Generation setting. [True, the current date is 2023-01-07] Ensures no invoice item exists for the service on the next due date. [True, there's only one invoice for this service and the invoice item duedate is 2022-11-07] Generates a new invoice if the system evaluates the above points as true. https://docs.whmcs.com/Billing_Logic
-
Thank you @AladdinJ, yes just remove the `noinvoice` param if need to generate the invoice, but not set the `noinvoice` to `false`. 🙂
-
I am using the POST action, attached screenshot is my API test on postman, no matter set the `noinvoice` param to `true` or `false`, both didn't generate invoice. It seems this param has been ignored, or I have passed a wrong param/value? AddOrder API doc: https://developers.whmcs.com/api-reference/addorder/
-
Thanks @Kian, yes it's due to the product just allowed Monthly, the billing cycle params can be accepted now. BTW, I have another issue is the `noinvoice` param also not accepted by API. No matter set to "true" or "false", both no invoice being generated. Is there anything I have missed? https://www.example.com/clientarea/includes/api.php?action=AddOrder&clientid=1&paymentmethod=stripe&pid=41&billingcycle=annually&priceoverride=123&noinvoice=false&hostname=www.example.com&identifier=vmWf7bHEQY9y5Gwmrq9UWVnVojr8u1j9&secret=Ox123xEnP212T53k&responsetype=json"
-
Hello, I am able to add order via API AddOrder action, but the billingcycle always not passed to the API, no matter set to quarterly/semiannually/annually, it's always set to the default monthly(the other fields like priceoverride/hostname/clientid are able to pass to API). Below is the POST URL, is there anything wrong on my request? Appreciate if anyone can help. https://www.example.com/clientarea/includes/api.php?action=AddOrder&clientid=1&paymentmethod=stripe&pid=41&billingcycle=annually&priceoverride=123&noinvoice=false&hostname=www.example.com&identifier=vmWf7bHEQY9y5Gwmrq9UWVnVojr8u1j9&secret=Ox123xEnP212T53k&responsetype=json"
-
How can I pass multiple custom fields via API AddOrder?
Sam666 replied to Sam666's topic in Developer Corner
Thank you very much @Kian for your help. I have fixed this issue, I make a mistake that base64_encoded and serialized each custom field separately, I should base64_encoded and serialized all fields for the same product. My problem solved, thanks again @Kian -
Hello, I have JavaScript based apps and I am able to AddOrder via WHMCS API, but facing issue when trying to passing multiple customfields to WHMCS API. According to the API document, I will need to pass serialized and base64 value to WHMCS API, if I just pass a single custom field, I can just pass something like `YToxOntpOjczO3M6NjoiU2VydmVyIjt9` to API, and the API can accept the customfield value without issue. But if I put multiple custom fields, supporse I should pass an array to WHMCS API, on JavaScript I tried below different format but non of them works. ('YToxOntpOjczO3M6NjoiU2VydmVyIjt9', 'YToxOntpOjcwO3M6NzI6IlNvdGVjdGlvbiI7fQ==') (YToxOntpOjczO3M6NjoiU2VydmVyIjt9, YToxOntpOjcwO3M6NzI6IlNvdGVjdGlvbiI7fQ==) ('YToxOntpOjczO3M6NjoiU2VydmVyIjt9', 'YToxOntpOjcwO3M6NzI6IlNvdGVjdGlvbiI7fQ==') Array( [0] => YToxOntpOjczO3M6NjoiU2VydmVyIjt9 [1] => YToxOntpOjcwO3M6NzI6IlNvdGVjdGlvbiI7fQ==) JSON.stringify(["YToxOntpOjczO3M6NjoiU2VydmVyIjt9", "YToxOntpOjcwO3M6NzI6IlNvdGVjdGlvbiI7fQ=="]) Non of the above works. If I just pass a single field either `YToxOntpOjczO3M6NjoiU2VydmVyIjt9` or `YToxOntpOjcwO3M6NzI6IlNvdGVjdGlvbiI7fQ==` it works just fine, the WHMCS can accept the value, but multiple custom fields just didn't work. Appreciate if anyone can help.
-
Really frustrated with WHMCS + OnApp. I've just bough Hostbill, will move to Hostbill if everything works fine.
-
My very best WHMCS intergration for my company
Sam666 replied to stuntnmore's topic in Showcase Your Site
it looks nice.
