Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payment receipt template returns true for template type #52

Open
rogerfar opened this issue Apr 7, 2021 · 4 comments
Open

Payment receipt template returns true for template type #52

rogerfar opened this issue Apr 7, 2021 · 4 comments

Comments

@rogerfar
Copy link
Contributor

rogerfar commented Apr 7, 2021

I was using a sample company today and noticed that all the templates of type Payment Receipt return a TemplateType of true.

Very strange behaviour, but breaks XML deserialization because it's expecting an enum.

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="13.0"?>
<QBXML>
	<QBXMLMsgsRq onError="continueOnError">
		<TemplateQueryRq requestID="10a28a0a-526d-4dac-9282-5e87db89cbb7" />
	</QBXMLMsgsRq>
</QBXML>
<QBXML>
	<QBXMLMsgsRs>
		<TemplateQueryRs requestID="10a28a0a-526d-4dac-9282-5e87db89cbb7"
               			statusCode="0"
               			statusSeverity="Info"
               			statusMessage="Status OK">
			<TemplateRet>
				<ListID>A0000-1193777333</ListID>
				<TimeCreated>2007-10-30T14:48:53-07:00</TimeCreated>
				<TimeModified>2008-01-01T15:40:55-07:00</TimeModified>
				<EditSequence>1199227255</EditSequence>
				<Name>Work Order</Name>
				<IsActive>true</IsActive>
				<TemplateType>SalesOrder</TemplateType>
			</TemplateRet>
			<TemplateRet>
				<ListID>80000028-1924956754</ListID>
				<TimeCreated>2030-12-31T07:12:34-07:00</TimeCreated>
				<TimeModified>2030-12-31T07:12:34-07:00</TimeModified>
				<EditSequence>1924956754</EditSequence>
				<Name>Intuit Standard Payment Receipt</Name>
				<IsActive>true</IsActive>
				<TemplateType>true</TemplateType>
			</TemplateRet>
			<TemplateRet>
				<ListID>8000002A-1988119998</ListID>
				<TimeCreated>2032-12-31T08:33:18-07:00</TimeCreated>
				<TimeModified>2032-12-31T08:33:18-07:00</TimeModified>
				<EditSequence>1988119998</EditSequence>
				<Name>New Payment Receipt Template</Name>
				<IsActive>true</IsActive>
				<TemplateType>true</TemplateType>
			</TemplateRet>
		</TemplateQueryRs>
	</QBXMLMsgsRs>
</QBXML>

This seems a new type of template introduced in QB 2021 (https://www.intuitiveaccountant.com/accounting-tech/general-ledger/quickbooks-desktop-2021-customize-payment-receipts/).

I'm not sure if this something we should fix in the parser, or address with Intuit, but doing the latter will 99% result in a, works as intended, or we don't really care response.

@jsgoupil
Copy link
Owner

jsgoupil commented Apr 8, 2021

I doubt Intuit moves about these things. You can raise it on their developer community forum and see what people say about this.
Wait a few days if you get an answer, but in the end, we should probably fix the qbxml130_modified.xsd then regenerate the Objects.cs

<xsd:element name="TemplateRet">
	<xsd:complexType>
		<xsd:sequence>
			<xsd:group ref="ListCore"/>
			<xsd:element name="Name" minOccurs="0">
				<xsd:simpleType>
					<xsd:restriction base="STRTYPE">
						<xsd:maxLength value="31"/>
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			<xsd:element ref="IsActive" minOccurs="0"/>
			<xsd:element ref="TemplateType" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
</xsd:element>

Also, to note, that the XSD says minOccurs="0" but here it says it's mandatory:
image

@rogerfar
Copy link
Contributor Author

So I received an answer from the development group, they weren't aware of the new template and they're looking into it... So maybe a fix in 2029 from Intuit?

@rogerfar
Copy link
Contributor Author

Unfortunately found another example, VendorQueryRs has a field ReportingPeriod which can return Annual, but according to the XML:

image

Contacting support about these kind of issues got me nowhere, so I manually filter the responses before parsing the XML:

xml = xml.Replace("<TemplateType>true</TemplateType>", "<TemplateType>PurchaseOrder</TemplateType>");
xml = xml.Replace("<ReportingPeriod>Annual</ReportingPeriod>", "<ReportingPeriod>Monthly</ReportingPeriod>");

@jsgoupil
Copy link
Owner

I think for those, I am fully open to edit the XML and generate new Objects.cs
But I think based on the other bug we should move towards QbXML 16.

I think though, when I use this quickbooks-sync package, I know I will not be using QbXML 16 features and still need to support some QuickBooks v19, but I would still like to be able to update. In this case, we should be able to say which QBXML do we want to send to the wire.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants