[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]
[form-session-id] [page href="admin/entry_items" form=" hiddens=customer caller=entry customer=[either][cgi customer][or][value customer_id][/either] "][L]Select items from list[/L] [comment] Get previous order numbers for possible repeat [/comment] [if value customer_id] [query table=transactions sql=" select order_number from transactions where username = '[value customer_id]' order by order_date desc " list=1 ] [on-match] [/on-match] [/query] [/if] [form-session-id] [item-list] [/item-list]
[L]SKU[/L]   [L]Description[/L] [L]Quantity[/L] [L]Price[/L]   [L]Extension[/L]
[search-region prefix=sku] [if value mv_search_match_count] [/else] [/if] [search-list] [/if] [/search-region]        
[L]remove[/L]   [item-code]   [page [item-code]][item-description] [if-item-field weight]    [L]WEIGHT[/L]: [summary amount=`[item-quantity] * [item-field weight]`] [/if-item-field]     [if-item-data options o_enable]
[table-organize cols=2] [item-options td=1] [/table-organize]
[/if-item-data]
[discount-price] [if discount [item-code]]
[L]Item is discounted[/L] [item-discount] [/if]
  [item-subtotal]
                [summary format="[L]Shipping weight[/L]: %s" total=1]
[L]Subtotal[/L]   [subtotal]
[L]Shipping[/L]   [shipping]
[L]Tax[/L]   [salestax]
[L]TOTAL[/L]   [total-cost]
[if errors]

There were errors in your last entry. Pointers are shown in this color below.

[/if]
[L]Shipping Address[/L]
[loop list=`$Values->{customer_id} || 'NEW'`] [set [L]Find[/L]] mv_nextpage=__UI_BASE__/entry_select mv_change_frame=select mv_todo=back [/set] [set [L]Clear[/L]] [calc] for(keys %$CGI) { $CGI->{$_} = ''; } [/calc] mv_todo=return customer=NEW mv_nextpage=@@MV_PAGE@@ [/set]
[L]Customer ID[/L] [L]New customer[/L]
[error name=company std_label=[L]Company[/L]]
[error name=fname std_label="[L]First Name[/L]" required=1] [error name=lname std_label="[L]Last Name[/L]" required=1] 
[error name=address1 std_label=[L]Address[/L] required=1]
 
[error name=city std_label="[L]City[/L]" required=1]
[error name=state std_label="[L]State/Province[/L]" required=1] [error name=zip std_label="[L]Zip/Postal Code[/L]" required=1]
[error name=email std_label="[L]Email Address[/L]" required=1]
[L]Country[/L] [value name=country set="[value name=country default='[loop-data userdb country]']" hide=1] [if value country =~ /(^$|US|CA)/] [else] [/else] [/if] [L](will update display)[/L]
[error name=phone_day std_label="[L]Daytime Phone[/L]" required=1]
[error name=phone_night std_label="[L]Evening Phone[/L]" required=0]
 
  [msg arg.0="" arg.1=""]%sBold%s fields needed to process the order[/msg]
[L]Don't save address in user record[/L]
[set only_downloadable]1[/set] [set some_downloadable][/set] [item-list] [if-item-field weight][set only_downloadable][/set][/if-item-field] [if-item-field download][set some_downloadable]1[/set][/if-item-field] [/item-list] [if !scratch only_downloadable]

[L]Shipping method[/L]

[if session ship_message]
[L]Note:[/L] [data session ship_message]
[/if]
[/if]
[L]Billing Address (if different)[/L]
[L]First Name[/L] [L]Last Name[/L]
[L]Company[/L]
[L]Address[/L]
[L]City[/L] [L]State[/L] [L]Zip/Postal Code[/L]
[L]Country[/L]
[L]Phone[/L]

[L]Email preferences[/L]
[L]Send receipt[/L]
[L]Yes[/L] [L]No[/L]
    [L]Put on email lists[/L]
[display table=userdb col=mail_list type=checkbox_left_2]
[L]Payment Method[/L]
 
  [if !scratch old_browser] [/if] [if scratch old_browser] [L](will update display)[/L] [/if]
 

[if type=data term="userdb::credit_limit::[data session username]" op=">" compare=0.01] [/if]
[L]P.O. Information[/L]  
[error name=credit_limit_ok std_label="[L]PO Number[/L]" required=1]    
 
Available credit     [currency] [data table=userdb col=credit_limit key="[data session username]"] [/currency] [if type=data term="userdb::credit_limit::[data session username]" op=< compare="[total-cost noformat=1]" ]
[msg arg.0="[total-cost]"]Order total %s exceeds credit limit, please call.[/L] [/if]
 
[set [L]Place Order[/L]] mv_todo=submit [value name=mv_order_route set="entry" hide=1] [/set]

[L]Gift note or Special Instructions[/L]
[/loop] [error all=1 hide=1 comment="[L]Clear errors[/L]"] @_UI_STD_FOOTER_@