How can I fix this error message in D365 (Quantity cannot be invoiced because inventory transactions with a status of Received are insufficient - microsoft-dynamics

I'm trying to see how to fix this error in D365 when a Project Invoice proposal is trying to Post. There are no inventory for an item that this invoice is coming from. I checked the item model groups and tested different scenarios. A customer returned the items and now I'm trying to take them out of our transactions for the Sales Order from a project.
There is no packing slip or anything that ties to the return nor an RMA issued. Where am I not looking in D365 or have not clicked on to remove this error message from allowing the project invoice to post?

Related

Strong Consistency when you need to query multiple entities (thousands)

In an application that has many 'shops' every registered admin user has a 'shop' entity, each shop sells items where each item belongs to a certain 'category'. Having multiple clients (100's in some cases) each client has an account to follow up on their purchases and past orders. Each shop generates invoices for their clients, clients pays the invoice.
Admin User -- > Shop
Shop ---> clients
|-> items Categories
|-> items
|-> invoices
|-> payments received
An admin page shows a report showing invoices within the year (from Jan to Dec) this page is a client requirement. The shop is able to manually generate a new invoice when a purchase is made, and records a payment when it is paid. Note: This all happens in the actual shop, there is no online client purchases.
As a single shop generates few invoices per month (~100's), and multiple payments per month (~100's), showing this per year easily goes to thousands entities to show on a single page.
To optimize loading the page and generating the sales year report (total sales, revenue, payment...etc.), we thought we'd structure the data in a way where each item category per year is also an entity. This means that whenever a purchase is made for an item in this category, we need to add the item's purchase price to the itemCategory at that year in this month.
itemCategory Model:
itemCategory(ndb.Model):
shopID = ndb.KeyProperty()
year = ndb.IntegerProperty()
monthly_sales = ndb.FloatProperty(repeated=True) #12 months
This way we can load the entire sales table by reading just the list of itemCategory for this shop for this year, instead of reading all individual purchases through the year. This would save lots of Datastore reads and decrease page load time on the expense of an extra read, sum & write to this summary like entity.
Category Jan Feb Mar ... Dec
--------------------------------------
Men's shoes 1000 1300 850 ... 1400
Kids shoes 600 850 650 ... 900
The challenge at this point is that strong consistency is quite essential, for individual purchases and for the itemCategory entities. Because if the shop tries to add multiple purchases in a successive short timed way, with eventual consistency itemCategory might have not been updated with the last purchase sum yet. Resulting in wrong sales values. Also the same for individual purchase if there was a requirement to edit one right after it was added, a query for the entity without its ID might have no results. So it seems that Ancestor queries is essential here with maybe the shop as the parent entity. Yet, this will result in a contention issue later on (at least until Datastore is migrated to Firestore) with all those entities (thousands in this case!) having one single parent!
The same goes for invoices, generating a new invoice means knowing the latest invoice number so that they are always in sequence without gaps. Querying invoice with eventual consistency may result in duplicate invoice numbers.
What is the optimum way to structure the data at this point for strong consistency? Unfortunately the project has been there for a few years, and was started using Google Datastore rather than Cloud SQL (which seem to be more appropriate for this kind of projects). Hopefully all these issues goes away after the migration to Firestore having Strong consistency for all reads
Consider exporting the data and then importing it into a Cloud Firestore in Datastore Mode project. No more eventual consistemcy issues.
There are certain ways you can achieve strong consistency.
Query using key. Whenever you try to read an object via its key it is strongly consistent.
Another approach would be to use NDB Asynchronous Operations. See related documentation here.
A really naive approach would be to provide a delay which could help you but the delay should be provided in such a way that it is sufficient for the object to get updated.
And the final approach could be to export data into Cloud Firestore. There you can achieve strong consistency always.
Hope this answers your question!!!

How to get a transaction details using invoice number?

We are using authorize.net for payments in our checkout but in some cases we are not getting any response from authorize.net so we are unable to store transaction details in our database and also customers are being charged more than once. So to resolve this we are planning to get the transaction details before sending the payment but we don't have transaction id in our side, so we need a API to get the transaction details using invoice number.
I have searched lot in the API documentation but couldn't able to find it, so any reference might be helpful.
You cannot retrieve transaction information through their API with an invoice number. If you know the dates, and other helpful information about these missing transactions, you can use their Transaction Reporting API to get those day's transaction and retrieve the necessary information that way.
One way to avoid this in the future is to use either Silent Post1 or their new Webhooks API to get notified whenever a payment is made (and any other event you specify).
1 I am the author of that article.

Sharepoint 2013 workflow history change user ID

I'm creating a custom workflow in Sharepoint 2013 with Visual Studio for the approval of the elements added to a list. It's as simple as: A user creates the element (initiator) and a different one approves it (approver).
The problem comes when I use the WriteToHistory box to leave trace of the steps. The User ID in the history item that is created is always the initiator and there's no evident way of changing it. Therefore, I thought I could replace the WriteToHistory element with a CreateListItem to create the history item and all its fields manually. When I do so, I can update all of the fields in the history item (even the WorkflowInstance value, that links this new history item with its workflow instance) but not the User ID...
I'm getting the error when the workflows runs and tries to add the new history item
Retrying last request. Next attempt scheduled in less than one minute.
Details of last request: HTTP BadRequest to <siteURL>/_vti_bin/client.svc/web/lists(guid'<workflowHistoryListGUID>')/Items
Correlation Id: 42e20e0f-61d2-4a35-9339-429d395dbdfb Instance Id: c329fba8-dbbd-4123-8411-b90a34ec8fbb
I don't know which items the last two GUIDs refer to. Additional information:
I'm setting the User ID field using its internal name. This field type is a person or group but I don't know how to create an SPUser in the workflow. I've passed a GUID and an Int32 with the user id and nothing changed
I'm not providing values for all the mandatory fields
The rest of the fields work perfectly whatever their types are: string, dates, etc.
Can anybody advise the way of customizing the User ID in the history items? Thanks

How to get the transaction id of a duplicate transaction in authorize.net?

Some time I get duplicate transaction error (error code 11) in authorize.net. How can I get to know the duplicate transaction id so that I can verify it. Or, is there any way to get the transaction id by sending the invoice number or any other parameters? I am using AIM wrapper.
Unfortunately Authorize.Net does not report the ID of the duplicate transaction. The best you can do is get a transaction history and look for a very recent transaction that contains the same payment information. You can use their reporting API and make a call to getUnsettledTransactionListRequest.

How can i delete a customer under sales in openerp

I am a newbie to openerp. I have a customer called 'flipflop' under sales.
Related to this customer i have one sale which is in sales order status.
When i try to delete this customer i am getting a warning like below,
Integrity Error
The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records still reference it
- creation/update: a mandatory field is not correctly set
[object with reference: Users - res.users]
So what i did is i went to sales orders and tried to delete the particular sale which is related to this customer , but in here also i am getting a warning like below,
Invalid Action!
In order to delete a confirmed sales order, you must cancel it.
To do so, you must first cancel related picking for delivery orders.
So where i can find these delivery orders and how can i cancel it?
Am i doing in the correct way?
Is there any other way that i can delete this customer and its related sales.
Note:I wouldn't like to go into the database and delete it.
When you Confirm the Sale Order, the Procurement and Delivery Order is made. Based on Product Configuration, Manufacture Order or Purchase Order is generate when you click on Run the Procurement. Now Follow the below steps.
Warehouse => Receive/Deliver By Orders => Delivery Order => Find your SO their. Source Document is your SO name. And Cancel that Delivery.
Accounting => Customers => Customer Invoice => Find your SO their. Source Document is your SO name. And Cancel that Invoice. And also cancel related Journal Entry also.
Sales => Sale Order => find your Record and Cancel it.
Customer => find your customer name and Delete it.
Hope this will help you.