Created
August 5, 2008 21:52
-
-
Save zackchandler/4126 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" ?> | |
| <?qbxml version="5.0" ?> | |
| <QBXML> | |
| <QBXMLMsgsRq onError="continueOnError"> | |
| <InvoiceQueryRq requestID="1" iterator="{iterator}" iteratorID="{iterator_id}"> | |
| <MaxReturned>50</MaxReturned> | |
| <ModifiedDateRangeFilter> | |
| <FromModifiedDate>{from_modified_date}</FromModifiedDate> | |
| <ToModifiedDate>{to_modified_date}</ToModifiedDate> | |
| </ModifiedDateRangeFilter> | |
| <IncludeLineItems>true</IncludeLineItems> | |
| <IncludeRetElement>TxnID</IncludeRetElement> | |
| <IncludeRetElement>EditSequence</IncludeRetElement> | |
| <IncludeRetElement>TxnNumber</IncludeRetElement> | |
| <IncludeRetElement>CustomerRef</IncludeRetElement> | |
| <IncludeRetElement>TxnDate</IncludeRetElement> | |
| <IncludeRetElement>RefNumber</IncludeRetElement> | |
| <IncludeRetElement>Subtotal</IncludeRetElement> | |
| <IncludeRetElement>SalesTaxPercentage</IncludeRetElement> | |
| <IncludeRetElement>SalesTaxTotal</IncludeRetElement> | |
| <IncludeRetElement>AppliedAmount</IncludeRetElement> | |
| <IncludeRetElement>BalanceRemaining</IncludeRetElement> | |
| <IncludeRetElement>InvoiceLineRet</IncludeRetElement> | |
| </InvoiceQueryRq> | |
| </QBXMLMsgsRq> | |
| </QBXML> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def parameterize(xml) | |
| xml.gsub!('{iterator}', iterator_id.blank? ? 'Start' : 'Continue') | |
| xml.gsub!('{iterator_id}', iterator_id || '') | |
| xml.gsub!('{from_modified_date}', ((transactions_last_synced_on || 10.years.ago) - 1.day).to_s(:qb_date)) | |
| xml.gsub!('{to_modified_date}', (Time.now + 1.day).to_s(:qb_date)) | |
| xml | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.update( | |
| :qb_date => '%Y-%m-%d' | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment