[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]

[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] [/if] [/search-region] |  |  |  |  |  |
[item-list]
[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]
[/item-list]
[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.

- [error all=1 show_var=1 keep=1 show_error=1 joiner="
- "]

[/if]

[L]Shipping Address[/L]

[loop list=`$Values->{customer_id} || 'NEW'`]

[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] |
[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]
| [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]

[error std_label="[L]Credit Card Information[/L]" name=mv_credit_card_valid] | [calc] my $accepted = $Variable->{CREDIT_CARDS_ACCEPTED}; my (@out); my (@cc); my $out; push @cc, 'visa' if $accepted =~ /visa/; push @cc, 'mc' if $accepted =~ /mc/; push @cc, 'disc' if $accepted =~ /discover/; push @cc, 'amex' if $accepted =~ /amex/; for (@cc) { push @out, qq{}; } return join ' ', @out; [/calc]
[L]Card Number[/L]: |
[if variable MV_DEMO_MODE]
| ([L]test number[/L] 4111 1111 1111 1111)
[/if]
[L]Expiration[/L]: | [display name=mv_credit_card_exp_month type=select default="[value name=mv_credit_card_exp_year default='[loop-data userdb mv_credit_card_exp_year]']" passed=| 1=01 - [L]January[/L], 2=02 - [L]February[/L], 3=03 - [L]March[/L], 4=04 - [L]April[/L], 5=05 - [L]May[/L], 6=06 - [L]June[/L], 7=07 - [L]July[/L], 8=08 - [L]August[/L], 9=09 - [L]September[/L], 10=10 - [L]October[/L], 11=11 - [L]November[/L], 12=12 - [L]December[/L]|] [comment] This should always return the current year as the first, then 7 more years. [/comment] [display type=select name=mv_credit_card_exp_year default="[value name=mv_credit_card_exp_year default='[loop-data userdb mv_credit_card_exp_year]']" passed=` my $year = $Tag->time( '', { format => '%Y' }, '%Y' ); my $out = ''; my @out; for ($year .. $year + 7) { /\d\d(\d\d)/; $last_two = $1; push @out, "$last_two=$_"; } return join ",", @out; `]

[L NEW_BROWSER_PAYMENT_MSG1]We will wait for a check sent to us referencing the order number you receive on your receipt.[/L]
[msg arg.0="[handling cod]"]There will be a %s charge added for COD.[/msg]

[L]Check Information[/L] |  |
[error name=check_acct std_label="[L]Account Number[/L]" required=1] |
[error name=check_route std_label="[L]Routing Number[/L]" required=1] |
[error name=check_num std_label="[L]Check Number[/L]" required=1] |
[error name=check_bank_phone std_label="[L]Bank Phone[/L]" required=1] |

[L]P.O. Information[/L] |
[error name=credit_limit_ok std_label="[L]PO Number[/L]" required=1] |
[if type=data term="userdb::credit_limit::[data session username]" op=">" compare=0.01]
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]
[/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]
[value name=gift_note default="[loop-data userdb gift_note]"]

[/loop] [error all=1 hide=1 comment="[L]Clear errors[/L]"] @_UI_STD_FOOTER_@