1 # Copyright 2002-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: write_shipping.coretag,v 1.6 2007-03-30 23:40:54 pajamian Exp $
10 UserTag write-shipping Order file
11 UserTag write-shipping PosNumber 1
12 UserTag write-shipping addAttr
13 UserTag write-shipping Version $Revision: 1.6 $
14 UserTag write-shipping Routine <<EOR
16 my ($file, $opt) = @_;
18 unless($file = $Vend::Cfg->{Special}{'shipping.asc'}) {
19 my $dir = $Vend::Cfg->{Shipping}{dir} || $Vend::Cfg->{ProductDir};
20 $file = Vend::Util::catfile($dir,'shipping.asc');
24 ## This is set so the UI knows where to check for changes
25 $::Scratch->{ui_shipping_asc} = $file;
27 my $lines = $Vend::Cfg->{Shipping_line};
31 # ($mode, $desc, $crit, $min, $max, $cost, $query, $opt)
34 if (ref($line[7]) =~ /HASH/) {
35 $line[7] = uneval_it($line[7]);
37 push @outlines, \@line;
41 $Tag->backup_file($file);
43 open(SHIPOUT, ">$file")
44 or die errmsg("Can't write shipping to %s: %s", $file, $!);
46 print SHIPOUT join "\t", @$_;