[set page_title][L]Order Entry[/L][/set] [set ui_class]Orders[/set] [set help_name]order_entry.main[/set] [set icon_name]icon_orders.gif[/set] [seti meta_header] [/seti] @_UI_STD_HEAD_@ [calc] return unless $CGI->{customer}; %$Values = (); $Values->{customer_id} = $CGI->{customer} eq 'NEW' ? '' : $CGI->{customer}; return; [/calc] [if cgi repeat_order] [perl tables=orderline] my $db = $Db{orderline}; my $on = $db->quote($CGI->{repeat_order}, 'order_number'); my $q = qq{SELECT sku,quantity,username FROM orderline WHERE order_number = $on ORDER BY order_number}; my $ary = $db->query($q) || []; my @i; my @q; @$Items = (); for(@$ary) { push @i, $_->[0]; push @q, $_->[1]; } if (@i) { if($CGI->{pull_customer}) { %$Values = (); $Values->{customer_id} = $ary->[0][2]; } } else { $Tag->warnings(errmsg("Order number %s not found", $on)); } $CGI->{mv_order_item} = join "\0", @i; $CGI->{mv_order_quantity} = join "\0", @q; $CGI->{mv_todo} = 'refresh'; return; [/perl] [if cgi mv_order_item][update process][/if] [/if] [perl tables="country products"] ## This section sets the shipping, handling, taxing, and payment ## initializations, as well as browser check ## Start with payment mode if none there $Values->{mv_order_profile} ||= $Variable->{DEFAULT_PAYMENT_MODE} ||'credit_card'; ## Check for COD order my @handling; if($Values->{mv_handling}) { @handling = split /[\s,\0]+/, $Values->{mv_handling}; @handling = grep /\S/ && $_ ne 'cod', @handling; $Values->{mv_handling} = join " ", @handling; } if($Values->{mv_order_profile} eq 'cod') { push @handling, 'cod'; } if(@handling) { $Values->{mv_handling} = join " ", @handling; } #Debug("mv_handling=$Values->{mv_handling}"); my $db = $Db{country} or return; my $domestic = $Variable->{DOMESTIC_SHIPPING} || 'US CA'; $domestic =~ s/\W+/ /g; my @dom = grep /\S/, split /\s+/, $domestic; my %dom; @dom{@dom} = @dom; my $modes; if($Values->{country}) { $modes = tag_data('country', 'shipmodes', $Values->{country}); @modes = grep /\S/, split /[\s,\0]+/, $modes; } delete $Scratch->{only_download}; my $hardgoods; for(@$Items) { next if tag_data('__ProductFiles_0__', 'download', $_->{code}); $hardgoods = 1; } ! $hardgoods and $Scratch->{only_download} = 1; return unless @modes; my %modes; @modes{@modes} = @modes; if(! $modes{$Values->{mv_shipmode}}) { $Values->{mv_shipmode} = shift @modes; } return; [/perl]
[/loop] [error all=1 hide=1 comment="[L]Clear errors[/L]"] @_UI_STD_FOOTER_@