Fun Question (from my perspective, at least :) )

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Fun Question (from my perspective, at least :) )

Post by heinscott » Wed Aug 13, 2008 8:53 am

Hello...

I have what I hope is a fairly easy, but fun question/scenario.
My boss wants to be able to start tracking inventory adjustments, in order to prevent fraud as a result of different employees making changes at various times. As such, I have created a InventoryHistory data object and datasource layer, and I am hoping to just run the static method .Add() each time an inventory adjustment is made. Okay, here are my questions:

1) What is the code for returning the current user? I have seen the nVelocity commands for this, but, am not sure what the code is on the C# side. This way, all I'll (hopefully) have to do, is find each place where inventory is adjusted, and add the line: InventoryHistory.Add();

2) Where are all the places in Able Commerce where inventory is adjusted? Many, of course, are obvious... Like Inventory reports, product editor, etc... I guess I mostly am concerned about where this happens on the customer side, and when. Of course, I could paste this in as soon as an order is finished, but, it would definitely be best to only do this once the inventory is acutally adjusted.

Thank you all for any help you can give me with this!

Scott
PoolGeek.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Fun Question (from my perspective, at least :) )

Post by mazhar » Wed Aug 13, 2008 9:14 am

1) What is the code for returning the current user? I have seen the nVelocity commands for this, but, am not sure what the code is on the C# side. This way, all I'll (hopefully) have to do, is find each place where inventory is adjusted, and add the line: InventoryHistory.Add();
Use the Token to get this information. Just add the CommerceBuilder.Common namespace into your C# class and then you can get this info as below

Code: Select all

 Token.Instance.User
2) Where are all the places in Able Commerce where inventory is adjusted? Many, of course, are obvious... Like Inventory reports, product editor, etc... I guess I mostly am concerned about where this happens on the customer side, and when. Of course, I could paste this in as soon as an order is finished, but, it would definitely be best to only do this once the inventory is acutally adjusted.
Have a look at the following post. It may help you
viewtopic.php?f=42&t=7220
Last edited by mazhar on Mon Oct 20, 2008 10:58 am, edited 1 time in total.

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Fun Question (from my perspective, at least :) )

Post by heinscott » Wed Aug 13, 2008 11:25 am

Thanks Mazhar. I appreciate your help. I did read through that post, but, I am still unsure when the actual inventory adjustment takes place. I know that I will not have access to how this occurs, but, if I can just imbed my statement somewhere near where it occurs, I should be fine with that. Of course, if inventory adjustment occurs conditionally (like on whether or not credit card is approved) I suppose I may run into a problem, but, I can always adjust my inventory manually if I must. Any ideas for me? Right now, I'm thinking my best bet may be to imbed the statement on the order finished page.
Any thoughts?

Scott

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Fun Question (from my perspective, at least :) )

Post by mazhar » Wed Aug 13, 2008 12:54 pm

For example for the shippable items the inventory is adjusted when the order is shipped i mean when the order status changes to Shipped. And in this case if we see from the admin side the last location available is the Admin/Orders/ShipOrder.aspx.cs file's following line

Code: Select all

//SHIP THE CURRENT SHIPMENT
            _OrderShipment.Ship();
            //RETURN TO SHIPMENTS PAGE

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Fun Question (from my perspective, at least :) )

Post by heinscott » Wed Aug 13, 2008 1:03 pm

Thanks, Mazhar! That's exactly what I'm looking for. This being the case, I can just past my code immediately following the OrderShipment.Ship();.
Perfect... Now just to find all the others!
Thanks again!

Scott

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Fun Question (from my perspective, at least :) )

Post by heinscott » Wed Aug 13, 2008 2:46 pm

Sorry for the confusion, but, are you absolutely positive that the inventory is adjusted after shipping status is changed? My warehouse guy is telling me that this makes no sense whatsoever. He says that many orders are not shipped out until after a whole weekend, and, in this case, we may have quanities that are dangerously low, and need to be reordered, but not show on the low quantity report because inventory is not adjusted. If this is indeed the case, can you tell me the rationale behind this decision?
I'm just trying to clarify this before he tells me that this is just not going to work for him, and I begin coding something that will.
Thanks again for the help.

Scott

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3055
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

Re: Fun Question (from my perspective, at least :) )

Post by Shopping Cart Admin » Wed Aug 13, 2008 2:51 pm

Hello,

It's based on how you have your order statuses setup, you can customize it to meet your business requirements. Change it to on order placed, if that would suit you better.
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

User avatar
compunerdy
Admiral (ADM)
Admiral (ADM)
Posts: 1283
Joined: Sun Nov 18, 2007 3:55 pm

Re: Fun Question (from my perspective, at least :) )

Post by compunerdy » Wed Aug 13, 2008 2:53 pm

I had to change mine to when the order is placed. If you do this just be sure to cancel any orders that you dont process so the inventory will get added back in.

User avatar
nickc
Captain (CAPT)
Captain (CAPT)
Posts: 276
Joined: Thu Nov 29, 2007 3:48 pm

Re: Fun Question (from my perspective, at least :) )

Post by nickc » Wed Aug 13, 2008 3:01 pm

Change it to on order placed, if that would suit you better.
This is I'm doing, and it's been working just fine. Make sure you "restock" on appropriate events (order void, cancel, etc.) as well. I've added triggers on Product and Variant "InStock" fields to write transaction records in my own tables for audit purposes - so all input (either store sales or admin changes to stock levels) are recorded as +/- transactions.

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Fun Question (from my perspective, at least :) )

Post by heinscott » Wed Aug 13, 2008 3:08 pm

Thank you all so much. All the information was very helpful. I think after setting the appropriate actions for the Statuses, I should be all set.
Once again, I appreciate how helpful everyone in these forums has been!

All the best,

Scott

Post Reply