define custom WHMCS invoice status - whmcs

I need to create a custom invoice status for "Disputed" payments.
I found an article that said to just modify the status column in the DB table 'tblinvoices' with the desired status, but doing this doesn't register that as a status in the sense that the invoice PDF would show "DISPUTED" instead of this and the admin view of the invoice looks like this (note the upper right-hand corner where it would normally say the status like PAID, UNPAID, DRAFT, etc. is blank) and the client view of the invoice looks like this (note the upper right-hand corner where it would normally say the status like PAID, UNPAID, DRAFT, etc. is blank) and lastly the invoice list (overall, not on the client page) shows the status as unrecognised as you can see here

Things are not displayed properly cuz of lack of language translates. You should add proper translations for newly created status in language files for user and administrator in your WHMCS installation. https://developers.whmcs.com/languages/overrides/

Related

Automatically register payment and generate invoice when amount is zero

When pressing the "Confirm Sale" button, even if the total amount to be paid is zero (because of the 100% discount), the Register Payment popup is getting displayed - and I need to press Cancel in the popup to proceed (generate invoice & and mark it as paid).
Can I bypass displaying the popup - automatically generate the invoice and mark it as paid?
Please let me know.
Thanks.
There are two ways you can achieve this.
Write a module to overwrite the buttons named Create Invoice method and call a method to check if the total amount is zero then prepare the invoice values and automatically generate the invoice and view if needed. The rest with non-zero amount should follow the wizard path.
Create an automated action, where you can filter the SOs which are confirmed and has zero total and automatically create the invoices. You can combine this with scheduled actions to check it every X minutes or hours. This can be tricker than explained and may require some coding in the action.

Retrieve customer related to payment

Anyone know if it's possible to retrieve the customer name related to a transaction from the API?
I see it under "Paid by" if I follow the "payment_url" in the connect v1 https://connect.squareup.com/v1/{{location_id}}/payments/{{payment_id}} endpoint but can't see to find it anywhere else
Background: I'm working on a ticketing system that breaks out items by item_category so a kitchen gets only food items and the bar gets only drink items.
I have queues and itemized tickets by category BUT I can't seem to find the customer's name anywhere
You'll need to utilize the V2 Transactions API. When you call ListTransactions or RetrieveTransaction (ListTransactions), the Transaction object will have an array of Tenders, tenders, which has a field called customer_id. With this id, you will be able to pass it to RetrieveCustomer (RetrieveCustomer) to find out their name. Note that if you're not explicitly filling out their name, the name might not be available (an "instant profile" (Instant Profiles) will be created with whatever information can be retrieve from the card used to pay).
Update: Alternatively, as suggested by #Dan, would be to strip the payment_url from a V1 RetrievePayment (RetrievePayment) which includes the transaction_id at the end of the URL: https://squareup.com/dashboard/sales/transactions/TRANSACTION_ID. This is more efficient as you won't need to loop through transactions, and allow you to send it straight to RetrieveTransaction.

Is it possible to show the number of pre-orders on the product page?

My primary business is pre-orders, and this is how it works:
I list an item for sale.
My customers order the item. Their credit card is authorized but not charged.
Once a minimum number of orders are placed, the customers are charged, and the buy is live.
If, after a specified amount of time, the minimum is not reached, all orders are cancelled.
What i would like to do is this:
Specify the minimum number of orders needed for a particular item in the backend. (not 100% needed, but it would be nice).
Display the total number of pre-orders on the product page, so that my customers know how many are left before the buy is live (it would be great to show it in the following format: 23/50 Ordered).
Does anyone know if this is possible? If so, can you please explain to me what I need to do in order to make this happen?
Thanks!
P.S. - In case it doesn't show up, I'm using Bigcommerce
Store the minimum needed as a custom field & set the initial inventory to that same number. You'll also need to allow inventory to be displayed for pre-orders, though you can hide it from display if you'd like (we only want it present in the DOM).
As the products are pre-ordered, inventory will decrement. Use javascript to subtract the number left in inventory from the original number (the custom field) and display in the ProductDetails.html panel.

CRM - Lock fields in certain view

In the entity Quote for example, there is a view on the form that shows what products have been selected for the quote, with the ability to view;
Product Name
Price Per Unit
Quantity
Discount
Extended Amount
My issue is that Product Name, Price Per Unit and Extended Amount are locked on the view therefore cannot be changed.
I would like to do the same for discount, any suggestions?
Currently, you cannot change the behavior of this default line item view so you have a few options:
Create your own quote line item view and show that in place of the system view. The drawback here is your view will not allow you to do in-line edits - you would have to open the quote item to edit each entry.
Create a synchronous plugin on the QuoteDetail entity's pre-processing add and update event which is filtered on the discount field. This plugin would simply throw an exception whenever a non-zero amount is attempted to be pushed through. This effectively makes the discount field disabled as any entry will result in an error on save.

How can the check printing report be modified to include a supplier's invoice number?

When I receive an invoice from a supplier, I enter the invoice number (from the supplier) in the "Source Document" field of the supplier invoice. Now, when I print checks (using account_check_writing) it includes the supplier invoice number that OpenERP generates for my record of the supplier's invoice (for example, EXJ/2012/01283), but nowhere does it include the supplier's invoice number. This makes it difficult for the supplier to find the correct invoice in their records to apply the payment.
I have a handle on how to modify reports generally, but I'm not sure of the expression that will evaluate to the supplier's invoice number. I can follow the foreign key constraints from the database to see that account_voucher_line -> account_move_line -> account_move <- account_invoice, and I can find the account.move associated with the current voucher line in the report with "l.move_line_id.move_id". But now how do I find the invoice that also references that move_id, so I can grab the "Source Document" from it?
We already did it (improving the check writing report), and even more considering we improved the batch-printing wizard for checks too. You can grab the following branch and apply it on top of OpenERP 7:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-account_check_writing_jam
Alternatively, you can try it immediately on the fly on http://runbot.openerp.com, find the branch, build it, and connect to it with admin/admin.
In a nutshell, improvements are:
Shows Vendors/Supplier's invoice number
Optionally spills over to multiple pages. You can pay more than 10 invoice lines.
Optionally displays credits that are being applied with this check.
Suppresses invoices that are not part of this check payment.
Optionally works with pre-printed checks number or not.
Optionally resets check sequence during a batch-print if needed.
Optionally overwrite check numbers during a batch-print if needed.
Works with standard US checks (top, middle, or bottom pane).
Options are to be found in the following locations:
in Companies > Companies > Configuration tab
in Accounting > Configuration > Journals > Journals > Advanced Settings tab
in Accounting > Suppliers > Write Checks > Print button > Batch-print wizard
We hope to merge it in core soon.
Feedbacks welcome.
Enjoy,
__
Fabrice
OpenERP US