CalDAV finds recurring event outside of search range - caldav

I am trying to retrieve all events (recurring or not) between 2 date-times from a Synology calendar via CalDAV:
curl --user "user:password" -X REPORT --data '<?xml version="1.0" encoding="UTF-8"?>
<C:calendar-query xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:D="DAV:">
<D:prop>
<C:calendar-data>
<C:expand start="20230207T100000Z" end="20230207T110000Z" />
</C:calendar-data>
</D:prop>
<C:filter>
<C:comp-filter name="VCALENDAR">
<C:comp-filter name="VEVENT">
<C:time-range start="20230207T100000Z" end="20230207T110000Z" />
</C:comp-filter>
</C:comp-filter>
</C:filter>
</C:calendar-query>' https://server/caldav.php/user/calid/
The query above finds the following all day recurring event. The event is recurring weekly before and after the queried date-time, but not within the time-range.
<?xml version="1.0" encoding="utf-8" ?>
<multistatus xmlns="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav">
<response>
<href>/caldav.php/user/calid/eventid.ics</href>
<propstat>
<prop>
<C:calendar-data>BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:xxx
VERSION:2.0
BEGIN:VEVENT
CREATED:20230201T210000Z
DTSTAMP:20230201T210000Z
LAST-MODIFIED:20230201T210000Z
SEQUENCE:0
SUMMARY:My Weekly Monday Event
TRANSP:OPAQUE
UID:xxx-xxx-xxx-xxx-xxx
URL;VALUE=URI:
DTSTART;VALUE=DATE:20230206
DURATION:P1D
RECURRENCE-ID;VALUE=DATE:20230206
END:VEVENT
END:VCALENDAR
</C:calendar-data>
</prop>
<status>HTTP/1.1 200 OK</status>
</propstat>
</response>
</multistatus>
Notice I am looking for events on February 7th while the event happens on February 6th. If I change the search range to February 8th the event is no longer included.
Any idea why the event is included in the result? The recurring event does show correctly in Evolution, iOS, and Synology, so I am probably doing something wrong.

Related

QBO API V3 : Product Inventory is not getting updated

We want to manually adjust/update the Inventory of an Item using QBO V3 API.
But, the QtyOnHand did not get updated on QBO properly. We re-checked using QBO browser app too.
First Request : Create a product of type "Inventory" on QBO with "QtyOnHand" set to 100.
a. The response appropriately mentioned that the product is created.
Second Request : Update the above product with "QtyOnHand" set to 200.
b. The response still contains the older QtyOnHand (100). It didn't reflect that new QtyOnHand.
How can we manually adjust / update QtyOnHand using QBO V3 API?
For reference, our update request is:
<IntuitBatchRequest xmlns="http://schema.intuit.com/finance/v3">
<BatchItemRequest operation="update" bId="0">
<Item>
<Id>2091</Id>
<SyncToken>0</SyncToken>
<Name>Product 26--var 2</Name>
<Description>false</Description>
<Taxable>true</Taxable>
<UnitPrice>1000.00</UnitPrice>
<Type>Inventory</Type>
<IncomeAccountRef>62</IncomeAccountRef>
<ExpenseAccountRef>111</ExpenseAccountRef>
<AssetAccountRef>112</AssetAccountRef>
<TrackQtyOnHand>true</TrackQtyOnHand>
<QtyOnHand>200</QtyOnHand>
<InvStartDate>2014-01-21</InvStartDate>
</Item>
</BatchItemRequest>
</IntuitBatchRequest>
Our response XML is:
<?xml version="1.0" encoding="UTF-8"?>
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2014-01-20T23:21:44.559-08:00">
<BatchItemResponse bId="0">
<Item domain="QBO" sparse="false">
<Id>2091</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2014-01-20T22:44:10-08:00</CreateTime>
<LastUpdatedTime>2014-01-20T22:44:10-08:00</LastUpdatedTime>
</MetaData>
<Name>Product 26--var 2</Name>
<Description>false</Description>
<Active>true</Active>
<FullyQualifiedName>Product 26--var 2</FullyQualifiedName>
<Taxable>true</Taxable>
<UnitPrice>1000</UnitPrice>
<Type>Inventory</Type>
<IncomeAccountRef name="Sales">62</IncomeAccountRef>
<PurchaseCost>0</PurchaseCost>
<ExpenseAccountRef name="Cost of Goods Sold">111</ExpenseAccountRef>
<AssetAccountRef name="Inventory Asset">112</AssetAccountRef>
<TrackQtyOnHand>true</TrackQtyOnHand>
<QtyOnHand>100</QtyOnHand>
<InvStartDate>2014-01-21</InvStartDate>
</Item>
</BatchItemResponse>
</IntuitResponse>
The QtyOnHand field is not an update-able field.
Inventory adjustments are made when:
You create a transaction that uses up inventory (Sales Receipts, Invoices, etc.)
You create a transaction that returns inventory (Credit Memos)
You issue an Inventory Adjustment (unfortunately, Intuit's API does not support this yet)
Given that the API does not support inventory adjustments yet, I don't think you'll be able to do what you're trying to do.

quickbooks online api invoice DocNumber

My script for automatically generating invoices using the V2 api has stopped working even though my code is unchanged. The problem seems to be related to my use of the AUTO_GENERATE flag for the DocNumber field. I need QBO to auto-generate a DocNumber and this method was working fine for me up until today. I tried removing DocNumber completely, which created an invoice, however that invoice had no DocNumber id associated with it which I require. Please let me know if there is a workaround of if something was changed on QBO's side which could be fixed.
Also, please don't ask me to just upgrade to the V3 API, eventually I would like to but this is not feasible right now.
MY HTTP request:
POST /qbo30/resource/invoice/v2/<MY_REALM_ID>
...oauth headers...
<Invoice xmlns="http://www.intuit.com/sb/cdm/v2">
<Header>
<DocNumber>AUTO_GENERATE</DocNumber>
<CustomerId>399</CustomerId>
<SalesTermId>12</SalesTermId>
<Msg/>
<Note>Nov 2013</Note>
</Header>
<Line>
<ItemId>5</ItemId>
<Desc>Clickthrough Advertising</Desc>
<Qty>125</Qty>
<UnitPrice>0.25</UnitPrice>
<Amount>31.25</Amount>
</Line>
<Line>
<ItemId>17</ItemId>
<Desc>Minimum Monthly Charge</Desc>
<Qty>1</Qty>
<UnitPrice>68.75</UnitPrice>
<Amount>68.75</Amount>
</Line>
</Invoice>
QBO's response:
reply: 'HTTP/1.1 400 Bad Request\r\n'
header: Date: Mon, 02 Dec 2013 21:19:39 GMT
header: Server: Apache
header: Content-Length: 283
header: Vary: Accept-Encoding
header: Connection: close
header: Content-Type: application/xml
<FaultInfo xmlns="http://www.intuit.com/sb/cdm/baseexceptionmodel/xsd">
<Message>You must specify a different number. This number has already been used.</Message>
<ErrorCode>BAD_REQUEST</ErrorCode>
<Cause>-13006</Cause>
</FaultInfo>
It turns out I had two invoices in our system with the same invoice number. I had to change the number on the offending invoice, then create a new dummy invoice with a higher number which seems to have incremented the auto-increment value appropriately.
Thanks for the comments and the assistance!
Just now, I've tried this. It is working fine for me. PFB details.
Please check if you are missing something.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Invoice xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:ns2="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:ns3="http://www.intuit.com/sb/cdm/qbo">
<Header>
<DocNumber>AUTO_GENERATE</DocNumber>
<TxnDate>2013-12-02-08:00</TxnDate>
<CustomerId idDomain="QBO">1</CustomerId>
<SubTotalAmt>100.00</SubTotalAmt>
<TotalAmt>100123.00</TotalAmt>
<ToBePrinted>true</ToBePrinted>
<ToBeEmailed>false</ToBeEmailed>
<SalesTermId idDomain="QBO">3</SalesTermId>
<DueDate>2014-01-01-08:00</DueDate>
<ShipMethodId idDomain="QBO" />
<Balance>100321.00</Balance>
<DiscountTaxable>true</DiscountTaxable>
</Header>
<Line>
<Desc>Test</Desc>
<Amount>100.00</Amount>
<Taxable>false</Taxable>
<ItemId idDomain="QBO">2</ItemId>
</Line>
</Invoice>
Response
<Invoice xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbp="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo">
<Id idDomain="QBO">9</Id>
<SyncToken>0</SyncToken>
<MetaData>
<CreateTime>2013-12-02T23:17:49-08:00</CreateTime>
<LastUpdatedTime>2013-12-02T23:17:49-08:00</LastUpdatedTime>
</MetaData>
<Header>
<DocNumber>1003</DocNumber>
<TxnDate>2013-12-02-08:00</TxnDate>
<CustomerId idDomain="QBO">1</CustomerId>
<SubTotalAmt>100.00</SubTotalAmt>
<TotalAmt>100.00</TotalAmt>
<ToBePrinted>true</ToBePrinted>
<ToBeEmailed>false</ToBeEmailed>
<SalesTermId idDomain="QBO">3</SalesTermId>
<DueDate>2014-01-01-08:00</DueDate>
<ShipMethodId idDomain="QBO" />
<Balance>100.00</Balance>
<DiscountTaxable>true</DiscountTaxable>
</Header>
<Line>
<Desc>Test</Desc>
<Amount>100.00</Amount>
<Taxable>false</Taxable>
<ItemId idDomain="QBO">2</ItemId>
</Line>
</Invoice>
It could be a bug or there could be some issues in your QBO account. Please raise a support ticket for this.
Thanks

Unable to Add/Modify Mobile Phone field using IPP against QuickBooks desktop

I can't seem to modify or add the Mobile phone field in QuickBooks for QB Desktop. Online works fine, no dice in desktop but according to the XML response of the MOD request it seems to be working fine.
It shows the field being created/modified (idDomain is created, id value generated) however SyncManager never pushes the changes to QuickBooks.
I can modify the Mobile value on the QB side and I'll be able to see that change in my IPP application but no go when heading the other direction.
Here's the XML traces:
http://pastebin.com/qprwAh9z
Any ideas?
I was able to replicate this. The mobile phone number does not sync to the QB desktop file.Seems like a bug.
Please submit a support ticket here:
Link - http://developer.intuit.com/Support/Incident
It looks like, the problem is when you use 'Mobile' in the Phone's 'Tag' field.
Instead of 'Mobile', I tried 'Home' in the Tag field. As an alternate solution you can try the following (I will take a look if there is any constraint in the intermediate QBXML/QBSDK side )
IDS Req
<?xml version="1.0" encoding="UTF-8"?>
<Add xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" RequestId="22f39648c5ab1111988854e808163dc9" xmlns="http://www.intuit.com/sb/cdm/v2">
<ExternalRealmId>657117515</ExternalRealmId>
<Object xsi:type="Customer">
<TypeOf>Person</TypeOf>
<Name>SampleCust-IDS12</Name>
<Address>
...
</Address>
<Address>
...
</Address>
<Phone>
<DeviceType>LandLine</DeviceType>
<FreeFormNumber>0123456789</FreeFormNumber>
<Default>1</Default>
<Tag>Business</Tag>
</Phone>
<Phone>
<DeviceType>LandLine</DeviceType>
<FreeFormNumber>1234567890</FreeFormNumber>
<Default>0</Default>
<Tag>Home</Tag>
</Phone>
...
</Object>
</Add>
Create Response
<RestResponse xmlns="http://www.intuit.com/sb/cdm/v2">
<Success RequestId="22f39648c5ab1111988854e808163dc9">
<PartyRoleRef>
<Id idDomain="NG">1221097</Id>
<SyncToken>1</SyncToken>
<LastUpdatedTime>2013-07-19T11:25:43Z</LastUpdatedTime>
<PartyReferenceId idDomain="NG">1261065</PartyReferenceId>
</PartyRoleRef>
<RequestName>CustomerAdd</RequestName>
<ProcessedTime>2013-07-19T11:25:43Z</ProcessedTime>
</Success>
</RestResponse>
QBXML [ 2nd phone no is coming under AltPhone tag ]
<?qbxml version="9.0" ?>
<QBXML>
<QBXMLMsgsRq onError="continueOnError" newMessageSetID="13ff6ae6e2c76b59e49">
<CustomerAddRq requestID="EsbKeyMapHeader:1221097:0">
<CustomerAdd>
<Name>SampleCust-IDS12</Name>
..
<BillAddress>
...
</BillAddress>
<ShipAddress>
...
</ShipAddress>
<PrintAs>SampleCust</PrintAs>
<Phone>0123456789</Phone>
<AltPhone>1234567890</AltPhone>
<Fax></Fax>
..
</CustomerAddRq>
</QBXMLMsgsRq>
</QBXML>
QB's view [ There is no specific field for Mobile. Mobile/LandLine is kindOf Metadata. I'll check and confirm this behaviour ]
Thanks

what is the metadata attribute pair in MQFTE ? Why is it used?

I am working with wmqfte. While creating a transfer there is a parameter for metadata attribute pair. Why is this used for ?
One of the FTE engagements I worked on required email notifications of transfer status. Our approach to this was to add an email step in the transfer and the way we passed in the source and destination addresses was with metadata pairs. The transfer XML is provided below for an example:
<?xml version="1.0" encoding="UTF-8"?><request version="4.00" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FileTransfer.xsd">
<!DOCTYPE request>
<managedTransfer>
<originator>
<hostName>host.example.com</hostName>
<userID>me</userID>
</originator>
<sourceAgent QMgr="QMGR01" agent="AGENT01"/>
<destinationAgent QMgr="QMGR02" agent="AGENT02"/>
<transferSet priority="5">
<metaDataSet>
<metaData key="email.from">fteadmin#example.com</metaData>
<metaData key="email.to">"dept#example.com</metaData>
</metaDataSet>
<item checksumMethod="MD5" mode="binary">
<source disposition="delete" recursive="false">
<file>/root/path/file</file>
</source>
<destination exist="overwrite" type="directory">
<file>/root/path/</file>
</destination>
</item>
</transferSet>
<job>
<name>Your Job Name Here</name>
</job>
</managedTransfer>
</request>
A better way of sending status emails is to watch the transfer notifications published at the Coordination QMgr. However this example does show one possible use for the metadata pairs.

NSXMLParser : requesting guidance with making grouped tables from an RSS/XML feed

Im making a group table that is populated from an XML/RSS feed, ive managed to parse the data to the table just fine, but im stuck on how to make the table grouped?
ie, i want an events listing, and i want to organise the events in groups, using the Month for each group, how would i achieve this?
below is my XML structure, its pretty basic
<EventsUpcoming>
<Event id="1">
<month>July</month>
<title>Ian Moss</title>
<date>Saturday, July 1st</date>
<ticket>$35 On the door</ticket>
<description>
Ian Moss from Cold Chisel fame will be touring Australia and the only venue to secure him in Perth is the Blvd.
</description>
</Event>
<Event id="2">
<month>August</month>
<title>Cold Chisel</title>
<date>Saturday, August 3rd</date>
<ticket>$25 on the door</ticket>
<description>
From Khe San fame, Cold Chisel is back with the legendary Jimmy Barnes, dont miss out this gig. Its gonna go down in the books for sure!
</description>
</Event>
<Event id="3">
<month>September</month>
<title>Australian Crawl</title>
<date>Saturday, September 1st</date>
<ticket>Free</ticket>
<description>
They're one of Australia's most iconic band names, be sure to come down and check them out before they die.
</description>
</Event>
</EventsUpcoming>
If anyone knows any tutorial sites that might be helpful or just tips on how to go about doing this, thatd be much appreciated. Thanks in advance :)
NSMutableSet doesn't store the duplicate values,it only stores distinct ones.So at the time of parsing,you can use NSMutableSet to store the 'month' value of each xml element and set the number of sections in a tableview to the count of your NSMutableSet.