Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 02-04-2009 15:53:30

stage
Member
Registered: 12-12-2005
Posts: 170

updating inventory quantities

I know this is beyond the scope of this forum and I will need a mod, but I just want a direction to head in.

Every night, I want to auto-upload an inventory file, in a comma-delimited format with 2 columns: Product Reference String and Quantity.

When the qty is zero, I want the product updated with the "Use Declining Balance Inventory" set to Yes.
When the qty is >0, I want this field set to No.
I will leave all Inventory Counts in CCP at zero all the time. 

So . . . . if we are out of stock on an item, CCP won't allow an order for it.

Any thoughts on the most efficient way to implement this would be appreciated.

Thanks,
Nathan

Offline

 

#2 02-04-2009 16:55:25

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: updating inventory quantities

I would just add a third column for the value of product_useinv (the Yes/No for Use Declinging Balance Inventory) and upload all three columns.  You can use Excel or whatever is manipulating your CSV file to set the Y or N in the third column (easily done in Excel with an if statement, for example).  Then you don't actually have to modify CCP at all - just make yourself a new script to import the file.  For that matter, if you use the complete product.csv file for the upload, you wouldn't even need to import anything; you could just overwrite the file everyday with an automated FTP upload.  Just a thought.


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#3 02-04-2009 21:57:58

stage
Member
Registered: 12-12-2005
Posts: 170

Re: updating inventory quantities

What a great idea - thanks!!

Currently I use the ATS EasyAdmin DataPort mod to upload and import csv files.  Are you familiar with it?  If I could somehow automate that process, then I could probably do this all by myself.

Nathan

Offline

 

#4 02-05-2009 07:57:12

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: updating inventory quantities

Sure.  Not familiar with that mod, no.  But I would suppose if you open up the hood and have a look, it wouldn't be that tough to plug a chunk of it into CCP's cron.pl file and have it run automatically at set intervals.


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#5 02-05-2009 09:02:32

stage
Member
Registered: 12-12-2005
Posts: 170

Re: updating inventory quantities

CCP has its own cron file?  Wow, I didn't know that.

Offline

 

#6 02-05-2009 09:13:42

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: updating inventory quantities

Yup.  It runs things like deleting carts, deleting orders, etc, according to the settings in the admin.  Wouldn't be hard to add a bit in there if you were confident with your PERL.  Of course, if you screwed up, you could delete damn near everything, so backup well if you're going to play there.


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#7 02-05-2009 10:02:53

stage
Member
Registered: 12-12-2005
Posts: 170

Re: updating inventory quantities

Not confident in my Perl, but I was a Unix sysadmin years ago so at least I'm confident in the potential dangers of a cron file :-)

Offline

 

#8 02-05-2009 10:10:05

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: updating inventory quantities

Indeed.  Very different sort of file (PERL code vs. UNIX commands), but very similar sorts of risks :-)


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

Board footer