QuickBooks Online SalesReceipt Api and multiple payment methods - quickbooks-online

How do I add multiple payment methods to a sales receipt in quickbooks?
Here is the document:
https://developer.intuit.com/docs/api/accounting/salesreceipt
PaymentMethodRef just allows for one reference. Is this not possible?

Per the documentation, a Sales Receipt in QuickBooks only has a single payment method.
If someone paid for a single order in two ways, you could either:
Create two separate sales receipts (one for each payment method)
Create an invoice, and apply two separate payments against it

Related

Count two sales opportunities with the same client and same close date as one

Summary of my problem:
Our company offers two software products (for simplicity we'll call them product A and product B). In the past, when a client wanted to buy both products, the sales team would create a separate opportunity object for each product. Both of these opportunity objects have the same client ID (unique identifier for each client) and same close date but a different opportunity ID (unique identifier for each opportunity object).
In the present time, if a client wants to buy both products, the sales person will only create one opportunity object containing both products. This presents a challenge when comparing statistics from past years to the present as the past statistics are inflated to appear like 2 opportunities were closed when in reality it was one client buying the two products at the same time.
Example in table data format:
Simple example of data
What I am trying to achieve
In either my SQL query or later in Power BI, I would like to count these old opportunities as one. In other words, whenever an opportunity has the same client and same close date as another opportunity in the table, I want to count this once.
I attempted to flag this with a CASE statement unsuccessfully. I also tried to nest a query within a join but ran into issues because my query already has 4 JOINS and 6 WHERE statements. Any ideas? If I need to provide more examples or details, please let me know. THANKS!
Just add a column with the "main" opportunity id, then you can do a distinct count in Power BI on this column if you want only the "real" opportunities. You can use the OVER clause for this:
SELECT *,MIN(opportunityId) OVER (PARTITION BY ClientId,closeDate) as MainOpportunityId
FROM opportunities

one to many dimensional relation ssas

Need your help or suggestions over my case here in SSAS modeling
I am basically struggling with 4 tables, Customer, CustomerPhone, CustomerEmail, CustomerBusinesses.
Providing the sample data below, only the dimension Customer is linked to all, because Customer has one values.
The other tables will have a scenarios like a customer can have multiple emails, phone and can be a customer of mutiple businesses.
I cannot maintain all these into one custome dimension, because my fact is referring based on Global Customer ID, if I join the Global Customer ID's will duplicate
My reporting end is Power BI, and my intent is by selecting a Customer Name on filter and it show show me multiple phone, emails and for which all business he is been.
I tried using a reference Relationship, but it is not working, though it work, it has to queries against a measure group.
Would there be any way to achive this.
Let me know if any additional info is required here.
Thanks

SQL Server Database Design - Seperate Table for Sale and Purchase

I am building a new business application for my personal business which has close to ~100 transactions of sale and purchase per day. I am thinking of having Separate tables to record the sale and purchase with another linked table for Items that were sold and a seperate linked table with items that were purchased.
Example:
**SaleTable**
InvoiceNo
TotalAmt
**SaleTableDetail**
LinkedInvNo
ProductID
Quantity
Amount
etc.,
would this design be better or would it be more efficient to have one transactiontable with a column stating sale or purchase?
-From an App/Database/Query/Reporting Perspective
An invoice is not the same as a sales order. An invoice is a request for payment. A sales order is an agreement to sell products to a party at a price on a date.
A sales order is almost exactly the same as a purchase order, except you are the customer, and a sales order line item can reference a purchase order line item. You can put them in separate tables, but you should probably use Table Inheritance (CTI, extending from an abstract Order). Putting them in the same table with a "type" column is called Single Table Inheritance and is nice and simple.
Don't store totals in your operational db. You can put them in your analytic db though (warehouse).
You are starting small, thats a quick way to do. But, I am sure, very shortly you will run into differences between sale and purchase transactions, some fields will describe only a sale and some fields that will be applicable only for purchases.
In due course, you may want to keep track of modifications or a modification audit. Then you start having multiple rows for the same transaction with fields indicating obsoletion or you have to move history records to another table.
Also, consider the code-style-overhead in all your queries, you got to mention the Transaction Type as sale or purchase for simple queries.
It would be better to design your database with a model that maps business reality closest. At the highest level, everything may abstract to a "transaction", with date, amount and some kind of tag to indicate amount is paid or received against what context. That shouldn't mean we can have a table with Tag, Date, Amount, PayOrReceive to handle all the diverse transactions.

Show detail data in RDLC report

How can create a report that shows the master and detail rows in the same report?
I am working on trying to prepare statement for customers of their invoices and credits.
The structure is:
Customer
Invoice
Credit
Credit Detail
Payment
Payment Detail
The scenario for a customer:
A customer can have multiple Invoices,
Each Invoice can have multiple credits issued against a particular invoice.
Each Invoice can have multiple payments.
The statement should produce each outstanding invoice and list any payments or credits towards the invoice grouped under them.
There may be situations that the customer can have credits issued against no invoice. This also needs to be displayed without any invoice.
I need some advise on how this can be done using Winforms Report using RDLC.
I created statementdata and statementdetail table that is preprocessed consolidating all invoices with their credit and payment amounts along with credits that were not issued to invoice instead to the customer (special credit). StatementDetail table will have the details of the credits and payments. Once we have this it becomes a master detail scenario. This made me easily show a statement with the following structure.
Customer Name and Address - Header
invoice 1 - Detail Section
Details for Invoice 1 payment - Sub Grouping
Details for Invoice 1 credits - Sub Grouping
invoice 2
Details for Invoice 2 payment
Details for Invoice 2 credits
etc.,
Thanks

Suggestion on database design - multiple tables involved into a relation

My application needs to implement a one to one relation between multiple tables. I have a table which store companies (which can be customers and suppliers, or both). There are twi Bit fields, Customer and Supplier.
Then I have different tables for various operations: Invoices, Bank operations, Cashdesk operations. An I need to pair payments with invoices. A payment is not exact amount of an invoice, but it can be split over each number of invoices. Also, an invoice can be split over multiple payments. Payments can be from both bank or cashdesk operations
My original approach was to have a table, PaymentRelations, with Foreign Keys InvoiceID, BankOpID, CashOpID and Amount, and for any payment between between them, I create a record with only two foreign ID's filled, and the corresponding amount. This way in any moment I can know for each operation (invoice or payment) how much was paid.
Also there are RI requirements, so if a document is involved in payment relation, it cannot be deleted (or there is cascade delete, so if a payment of invoice document is deleted, the related PaymentRelations records are deleted, so the counterpart operations are freed - they are no longer involved into payment relations so their amount can be fully used into other payment relations).
But appeared another situation. Since partners can be both customers and suppliers, it is possible to compensate between same type of operation on customer and supplier side of the same partner (e.g. a partner is both customer and supplier, he made an invoice as supplier for 100 and received an invoice as customer for 150, 50 was compensated between the received and the sent invoice and the rest of each is paid through one or multiple payment operations).
This can also happen for the other operations (e.g. he paid through a bank operation 100, he received through another bank operation 200, and 50 needs to be compensated between those two operations; same apply for caskdesk operations).
What approach would you use to model this kind of relations?
I would buy accounting software instead of writing it. Some wheels are worth reinventing; this isn't one of them.
But if you must . . .
Bitfields are the wrong way to identify customers and suppliers. This SO answer should get you over the issues with customers and suppliers.
If I had to design an accounting system, I think I'd start with a spreadsheet. I'd design a table of transactions in that spreadsheet, so I could get the feel of how certain transactions were alike, and how others were different. At this stage, I wouldn't worry about NULLs, about repeating groups, about transitive dependencies, or anything else like that.
Having developed a working(ish) model in the spreadsheet, I'd then try to normalize it to 5NF.

Resources