quickbooks-php
quickbooks-php copied to clipboard
QuickBooks_Cast::cast - Truncate Not working
It appears that the function that allows you to truncate a string is only working on some fields.
Ones we have found so far.
Company Name: A very Long Company Name that Is Above 51 Letters Will Break Imports Company Phone Number: Example: 0800 000 000 ext456
This causes imports to break because QBO only allows a set amount of characters for fields. If the truncate worked then this would be resolved.
I still don't feel it's the correct way to work as some companies will only pay an invoice if the company name is exactly correct.
anyhoo... please fix it as it's causing us a headache!
QuickBooks does not have a "Company Name" field in it's API. It does have "CompanyName". Is that what you mean? That field is present for many objects -- Customers, Vendors, etc. Which object are you using? Can you post your code so we can try to reproduce?
Yes this will be for CompanyName - This is the error I get.
Error with Invoice #71608: 2050: [String length is either shorter or longer than supported by specification, String length specified does not match the supported length. Min:0 Max:50 supported. Supplied length:51]
[String length is either shorter or longer than supported by specification, String length specified does not match the supported length. Min:0 Max:21 supported. Supplied length:22]
I have a file yes. But I didn't write it. Not sure what I should be hiding? Don't want to accidentally share my access keys etc.
My developer says there is an auto truncate function that is not working that should support these fields. 50 does seem a bit low for company name. We have 10 invoices queued up with longer than 50 letter names.
was there ever any action on that? We are using v2.0 and looks like we have something similar. CustomerAdd adds the full name for our companies, but when invoices are addes, the customerref field is truncated in our code base to avoid the maxlength problem.
I think I need an example of some actual code that is breaking to be able to reproduce and fix this. Do you have example code that you can share?
I am still digging through the code to understand if it's the framework itself or not. When attempting to AddInvoiceItem request, if item contains special characters but just under 30 characters, it looks like when serialized item becomes over 30 characters and thus causes the issue.