QBFC Billadd Transaction - quickbooks

I have an application that interfaces with QuickBooks and I am using the BILLADD transaction. The application pulls bill transactions from another data base and updates quickbooks. The billadd transactions that we are pushing to quickbooks have several expense lines. Some of the expense lines are negative(credits) to the vendor. I can manually enter a negative number on a new bill, but the get an error when trying to do it programmatically.
Can anyone tell me if it is possible to do this with billadd or do I need a different transaction type to add the credits?
Scott

As long as the total of the bill is not negative, you should be able to add negative expenses. If you need to enter a negative bill, you would need to enter it as a IVendorCreditAddRq. I tested it with adding a bill with -10, +100, and -50 line expenses and was able to save it without a problem.
Could you post your request and the response you are getting?

Related

Formula to sort rows of bank statement

I export my bank transactions to a PDF, that I then paste to a google spreadsheet.
Problem is: I may need to sort the transactions on my spreadsheet, and after reordering by date the amounts and balance may "shift" when there are several transactions on the same day:
It's not a big problem to me, but my accountant is all lost.
I would like to find a way to identify the orders of the transactions of a same date, by comparing the amounts/balance to the final balance of the previous date.
I managed to create a formula using a MATCH that would identify the first transaction of a specific date, but if I were to make it work for 10-20 potential transactions within a same date, it would get stupidly long and complex. I may eventually do that, but before i'd like to know if there is an easier solution.
I can add as many columns as I want, and I don't mind using scripts.
What I cannot do is create a column that would recalculate the balance according to the order the transactions are in. That would be the easiest solution, but if my accountant were to compare with what is on the real bank account, he would find discrepancies and be just as lost.
Thank you!
As #gries said:
Since your PDF contains the transactions already ordered the way you want you can assign to each of them an incremental ID.
In such a way, you will be able to restore the initial order ordering by the transaction ID instead of using the date that could be repeated.

Handling default values in window aggregations

I have an aggregation that looks at a sliding 30-day window (1 day period) of customer purchases, keyed by customer id, with the value being the purchase amount. I sum up the values by key, thus getting the aggregate purchase amount for each customer during the last 30 days. I store this number in a customer record in an external database.
My question is this: if a customer hasn't purchased anything in the last 30 days, how do I automatically reset the customer record to a default value, in this case zero? I'd prefer to keep all my logic in Dataflow and avoid doing too much work, since this will need to scale quite a bit. I'm basically looking for a way to automatically get a key-value for each key that was not in the current window but was in the last, and the value being a potentially configurable default.
Trying to answer my own question, but hoping for feedback as to whether this solution would scale:
I've thought about having a step after the initial window-and-sum. This transform would receive (customerId, purchaseSum) elements once a day, as the result of the 30-day window sum is made available. Since these elements are timestamped (with the timestamp of the most recent input element, I believe) I can re-window them. If I create a two-day window with a one-day period, I would then be able to group by key and process (customerId, [purchaseSumA, purchaseSumB]) for customers that had a purchase both in the last 30 days and in the last 31 days. In this case, I emit purchaseSumB. However, if there's only in element in the list, and the timestamp indicates that the purchase was made 31 days ago, I can assume that there were no purchases from the customer since, and I need to emit (customerId, 0). Does that make sense?
Is it an option to slightly amend the database schema? I suppose now you have something like
(customer_id int, purchases_last_month int)`
Instead how about
`(customer_id int, last_purchase datetime, purchases_last_month int)`
where this time last_purchase is the time of the last purchase made by this customer, and purchases_last_month refers to purchases made in the month before the last one? Then in your DoFn that writes to the database, you'd be making a conditional update (merge/upsert) that updates both last_purchase and purchases_last_month with the values from the current window, but only if last_purchase is increasing. This way you can deal with windows being processed out-of-order or in parallel, at the cost of slight increase in complexity in client queries (which you can address by adding a view on top of the table).

Detect VOIDed invoices from quickbooks

Our system pulls lots of data from quickbooks using the QBWC/QBXML.
We also poll TxnDeletedQuery to get a list of deleted invoices, etc...
How do I query for or detect a 'Voided' invoice? I don't see anything in the InvoiceQueryRs schema that would indicate a voided invoice.
Does quickbooks do anything but zero-out the line item quantities?
Thanks!
The only thing QuickBooks does when voiding is:
sets the quantities/rates to zero
adds a "VOID" string to the Memo field
To detect it, you'd have to parse the Memo field and look at the rates/quantities. There's no way to filter by it in a query unfortunately.

Is there a way to import aggregated sales into quickbooks

Is there a way to import aggregated sales into quickbooks using the webconnector.
For example. I have 500 dollars in sales, 300 dollars in liquer sales, and 200 dollars in discounts.
How do I import this data. Do i need to import all the line items and have quickbooks sum it up (which is terrible i feel).
Or can i just import the rolled up data?
If i can do the rolled up data, how would i do that? If not how do i have quickbooks magically sum up the line items?
If you create an invoice with a bunch of line items, it's always going to automatically sum up all of the line items to show the total invoice amount/balance.
With that said, if you simply don't want the actual line item detail to go into QuickBooks, there's a number of ways you can do that, but you should probably talk to your accountant first or actually find out how the accountant wants the data entered into QuickBooks first.
e.g. your question doesn't really sound programming related, it's more of a "how do I use QuickBooks question".
The most common ways of not sending line item detail are to either:
Just send an invoice with a single line item, for the sum of all of the stuff
OR
Send a Journal Entry, which is a base-level transaction that only allows a single amount

Quickbooks: Adding a negative value to an invoice using the QBDSK

Is there any way to add a line item containing a negative amount to an existing invoice?
I'm using QBSDK7 and QB Enterprise. (and if it matters .Net 3.5)
What we're attempting to do is automate the way we're creating invoices. We're already pulling in employee's time and applying it to the correct invoices, but when we go to add credits (just a negative amount on a line item on the invoice) using
InvoiceLineMod.Amount.SetValue(-1234)
it fails with the error "Transaction must be positive"
I've also tried adding a Service Item with a negative amount and giving it a positive quantity and I get the same result.
This seems like such a no-brainer as we have been doing this manually for the last 10 years. I'm guessing there is artificial restriction on this.
Some things to consider:
Credit Memos are no good as we need to display exact details of the reduction on the same page.
We don't have payments to apply yet in most cases.
This need to be done before any retainers are applied.
Any help would be greatly appreciated.
Can you show the complete code you're using to modify the invoice? Can you also show the exact error message you're getting?
It is possible, though to do you need to make sure that you're using a Discount Item as your ItemRef type (a Service Item will not work), and you need to make sure that the transaction as a whole is for a positive amount.
Sometimes our app has to adjust an invoice down with a negative number. I have been able to add negative line items using the following code. I have to set a quantity and a rate, instead of setting the amount.
IInvoiceLineAdd ila = ia.ORInvoiceLineAddList.Append().InvoiceLineAdd;
ila.ItemRef.ListID.SetValue(GetQBID(JobKey));
ila.Desc.SetValue("Adjustment");
ila.Quantity.SetValue(1);
ila.ORRatePriceLevel.Rate.SetValue(-1.00);
Quickbooks doesn't allow you to post an invoice with a negative balance. If you try to do it through the UI, it prompts you to create a credit memo instead. (And vice-versa if you try it with a credit memo.)
You can enter negative quantities and/or prices into the line items, but the total of the invoice has to be >= 0 or it won't post (i.e., add other line items that offset the negative amounts).
The solution is to use credit memos. Your client-side processing will be more complicated, but it's the only choice with Quickbooks.

Resources