November Happy Hour will be moved to Thursday December 5th.

It seems impossible to create purchase orders with free items in commerce manager

Vote:
 

Hi, 

we are building a site where everthing is basically free, meaning cost = 0 of all variants. We can do the purchase order in code of course, but it seems there is some hard checks in commerce manager where it is impossible to release a shipment if there is no payments associated with a purchase order.

When creating a purchase order with line items not having any cost it is impossible to add payments to the order from commerce manager. Which makes a lot of sense as there is no cost associated with the order.

The code blocking the release of the order is in:

 Mediachase.Commerce.Manager.Order.CommandHandlers.PurchaseOrderHandlers.ReleaseShipmentHandler

right here:
if (purchaseOrder.OrderForms.Count == 0 || purchaseOrder.OrderForms[0].Payments.Count == 0 || purchaseOrder.OrderForms[0].Shipments.Count == 0 || (purchaseOrder.OrderForms[0].CapturedPaymentTotal + purchaseOrder.OrderForms[0].AuthorizedPaymentTotal) < purchaseOrder.OrderForms[0].Total)
{
CommandHandlerHelper.ShowInfoMessage(OrderStrings.Order_PurchaseOrder_PaymentLess, base.CommandManager);
return;
}

Notice that it is checking for Payments on the order and if there is none it will refuse to release the shipments.

How would I go about creating such an order from commerce manager? It will be customer care people doing this and not developers of course.

I can see two possible ways of fixing this: 
1) Telling customer care to add a dummy cost to one of the items so they can add a payment and then release the order

2) Creating a custom implementation if the ReleaseShipmentHandler and configuring it in the commerce manager, this will of course be destroyed the next time we update commerce manager from NuGet.

Any other suggestions?

#112323
Oct 28, 2014 8:00
Vote:
 

2th option is also my suggestion. When you customize Commerce Manager files, the changes are yours so I think you can use a simple source control to keep your works.

Yes, you'll have to manually re-deploy the change after upgrading Commerce Manager but I don't expect it to take too much work.

Regards.

/Q

#112379
Oct 28, 2014 11:49
Vote:
 

Hi Quan,

would you say this is by-design or a bug in commerce?

will go for the second solution if this is considered by-design.

#112434
Oct 28, 2014 12:23
Vote:
 

As it's possible in real-world for someone to create a 0$ order, I think it can be considered as a bug. I'll create a bug to see how we want to deal with this.

The suggestion for going to 2nd option is becausing having a bug go through the triage, fixing, testing can take weeks for it to be released (if we decide to fix it) - so if you need and you can, why not?

Regards.

/Q

#112439
Oct 28, 2014 12:31
Vote:
 

Thanks Quan :)

 will make a custom CompleteShipment handler.

#112440
Oct 28, 2014 12:48
Vote:
 

The bug is now activated and - when you have your site running - let me know. I would like to purchase something ;)

/Q

#112491
Oct 29, 2014 9:46
Vote:
 

We did it in a bit different way, We created a dummy payment provider AS FreeItemsProvider, On checkout out if orders total was zero this provider was adding into order.

Regards
/K

#112670
Nov 03, 2014 16:01
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.