[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: Inventory Tracking
I tried to use [data] to decrement the value, but I have a site that
needs people to be able to purchase more than one. So, I wrote a little
[perl] tag to handle it. It goes a little something like this:
[data base=inventory field=qty key=[item-code][item-modifier
size][item-modifier color][item-modifier option] value="[perl
interpolate=1]
my $curr = '[data base=inventory field=qty
key=[item-code][item-modifier size
][item-modifier color][item-modifier option]]';
my $quan = '[item-quantity]';
$curr =~ s/\D//g;
my $ret = $curr-$quan;
$ret;
[/perl]" op=decrement]
My inventory db has to handle products with the same number, but yet
different qualities.
For example, there is a shirt that could be red, green or blue, sizes
XL,L,S and with a logo or without the logo. So, it concatonates all
these with the code, and that is the "inventory" code. Looks that up,
subtracts the current quantity with the quantity the customer wants, and
that answer is what it sets the value to. The regex $curr =~ s/\D//g;
remove any whitespace so that it is eval'd as a number.
Works like a charm inside receipt.html.
Thompson-Jordan wrote:
>
> ****** message to minivend-users from "Thompson-Jordan" <Thompson-Jordan@mindspring.com> ******
>
> I believe you would use [data] to decrement the value in inventory.asc.
>
> Christopher Thompson
>
> > -----Original Message-----
> > From: owner-minivend-users@minivend.com
> > [mailto:owner-minivend-users@minivend.com]On Behalf Of Ray Hodel
> > Sent: Friday, July 23, 1999 9:49 AM
> > To: minivend-users@minivend.com
> > Subject: Inventory Tracking
> >
> >
> > Hello,
> >
> > I noticed that in the simple demo there is a file called inventory.asc
> > that contains the number of products in stock. Does MiniVend allow, or
> > is there a way, to have the system decrease the number of items in the
> > inventory file when a sale is made?
> >
> >
> > Ray Hodel
> >
> > --
> > MIS Director, ServInt
> > ServInt Internet Services
> > (703) 847-1381
> > http://www.servint.com
> -
> To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
> email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
> Archive of past messages: http://www.minivend.com/minivend/minivend-list