Handling shipping

Contains tips for configurators working with Aware IM
Post Reply
woof65
Posts: 16
Joined: Sun Aug 05, 2007 4:10 pm
Location: Louisville, KY
Contact:

Handling shipping

Post by woof65 »

I'm using the Ordering app as my basis for my own database, and I am trying to add shipping. I want the customer to be able to see when each item on a particular order is shipped, or if it has not yet shipped. In this way, we can ship out partial shipments while we are waiting for other stuff to come in stock. Right now, the Ordering app merely says the order is "Completed" when the customer places the order, but this is not correct. It is in progress, waiting to be fulfilled and shipped.

I am trying to get my head around the best approach to achieve my goal. I have written out my rules of behavior like the documentation says to do, logically working through the process of ordering, then fulfilling a purchase order.

Should I create a new BO called 'Shipping' and link it to the LineItems BO to give each item on a purchase order a separate shipping 'path'? Or should this be integrated into the LineItems BO itself? In which BO should I define the rules for shipping, such as saying that "once all items have shipped, the order status must be set to 'Complete' "? I'd really appreciate any advice you could give.
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

One approach is to have a state attribute both for the order and a line item. The states of the order could be "In Progress" and "Completed". States of the line item "In Progress" and "Shipped". The user would manually mark a line item as shipped when necessary. You will also have a rule on the LineItem object that will change the state of the Order to completed if all line items have been shipped. The rule could like like this:

If ThisLineItem.State WAS CHANGED TO 'Shipped' AND NOT EXISTS LineItem WHERE (LineItem IN ThisLineItem.Order.LineItems AND LineItem <> ThisLineItem AND LineItem.State <> 'Shipped') Then
ThisLineItem.Order.State = 'Completed'

This rule is triggered when a state of a particular LineItem (ThisLineItem) changes to "Shipped". It then checks all other line items that belong to the same order (ThisLineItem.Order) and if all of them are already in the shipped state then the order can be marked as completed.
Aware IM Support Team
woof65
Posts: 16
Joined: Sun Aug 05, 2007 4:10 pm
Location: Louisville, KY
Contact:

Post by woof65 »

Cool. This is much simpler than I thought. Thanks for your help once again.
woof65
Posts: 16
Joined: Sun Aug 05, 2007 4:10 pm
Location: Louisville, KY
Contact:

Post by woof65 »

By the way, after making the changes you gave, the PurchaseOrder will have three States: 'New', 'In Progress', and 'Completed'. Should the LineItem State have three as well, being 'New', 'In Progress', and 'Shipped'? Or do I not need to worry with the "New" LineItem state since, in PurchaseOrder, t is meant for the purpose of autodeletion of abandoned orders, and all LineItems of an abandoned order would get deleted with the order?
woof65
Posts: 16
Joined: Sun Aug 05, 2007 4:10 pm
Location: Louisville, KY
Contact:

Post by woof65 »

My final rule, after editing for how I named things and for what AwareIM wanted me to do looks like this:

If ThisLineItem.ShipStatus WAS CHANGED TO 'Shipped' AND NOT (EXISTS LineItem WHERE (LineItem IN ThisLineItem.PurchaseOrder.Items AND LineItem <> ThisLineItem AND LineItem.ShipStatus <> 'Shipped')) Then
ThisLineItem.PurchaseOrder.State = 'Completed'

Does this appear to do what you intend?
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

The rule looks good to me. As far as autodeletion is concerned if LineItem has a child relationship with an Order the system will automatically delete all line items of an order when this order has been deleted. So you don't need to worry about this.
Aware IM Support Team
Post Reply