View Single Post
  #1  
Old 05-26-2005, 02:47 PM
 
Tuner Tuner is offline
 

eXpert
  
Join Date: Jan 2003
Location: Scottsdale Arizona
Posts: 245
 

Default Update Quantity(add or subtract from Quantity)

OK This mod allow you to update you quantity relative to the current quantity. Tested on 4.0.13

If you check Relative update it will add to the quantity if the number is positive and subtract if the number is negative.

Find: (provider/inv_update.php)
Code:
while ($columns = fgetcsv ($fp, 65536, $delimiter)) { if (empty($columns[0])) { continue; } $columns[0] = addslashes($columns[0]); $pid = func_query_first_cell ("SELECT productid FROM $sql_tbl[products] WHERE productcode='$columns[0]' $provider_condition");
Below this last line Add the following code:
Code:
if (!empty($rel)){ $pquan = func_query_first_cell ("SELECT avail FROM $sql_tbl[products] WHERE productcode='$columns[0]' $provider_condition"); $pquan = $pquan + $columns[1]; } else { $pquan = $columns[1]; }

Now find (in provider/inv_update.tpl):
Code:
<TD>{$lng.lbl_csv_file}</TD> <TD><INPUT type="file" name="userfile">

Make Look Like this:
Code:
<TD>{$lng.lbl_csv_file}</TD> <TD><INPUT type="file" name="userfile"> <INPUT type="checkbox" name="rel">Relative Qauntity Change

Cheers
__________________
\"Then again it could all be horse crap\"
by some old Guy.
4.013
Reply With Quote