[interchange-cvs] interchange - heins modified 7 files
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Fri Apr 11 20:22:00 2003
User: heins
Date: 2003-04-12 00:21:24 GMT
Modified: . MANIFEST
Modified: dist/foundation catalog.cfg
Modified: dist/foundation/etc log_transaction
Modified: dist/lib/UI/pages/admin entry.html entry_select.html
Modified: dist/lib/UI/pages/include/menus OrderView.txt
Added: dist/lib/UI/pages/admin entry_items.html
Log:
* Significant upgrade to UI Order Entry. Funded in part by Groxis, Inc.
* Payment profiles and settings are same as in the standard foundation.
Works with online payment systems, PO, COD, check, etc.
* Added main_entry route to catalog.cfg so that you can easily remove the
email address for UI-entered orders if you are of a mind to.
* etc/log_transaction is only logging script used.
* Integrated new [userdb function=new_account no-login=1] so that users
can be added without having to do cheesy logout/login approach.
* Operator ends up on the admin/order_view page instead of going to
the receipt.
* Firmed up payment and logging logic a bit, closing a couple of
variable initialization holes that
* Added "Repeat Order" button to order_view so that you can duplicate
a previous order.
* Added item-select page so that you can select from a list to
get the ordered items.
* Allowed entering an order without saving shipping/billing address
to the user record.
* Tested in four scenarios:
-- Customer side, new user not logged in.
-- Customer side, existing logged-in user.
-- Order desk side, new user not logged in.
-- Order desk side, existing logged-in user.
Revision Changes Path
2.100 +3 -1 interchange/MANIFEST
rev 2.100, prev_rev 2.99
Index: MANIFEST
===================================================================
RCS file: /var/cvs/interchange/MANIFEST,v
retrieving revision 2.99
retrieving revision 2.100
diff -u -r2.99 -r2.100
--- MANIFEST 12 Apr 2003 00:10:01 -0000 2.99
+++ MANIFEST 12 Apr 2003 00:21:24 -0000 2.100
@@ -152,6 +152,7 @@
code/UI_Tag/list_keys.coretag
code/UI_Tag/list_pages.coretag
code/UI_Tag/menu_load.coretag
+code/UI_Tag/meta_info.coretag
code/UI_Tag/meta_record.coretag
code/UI_Tag/mm_locale.coretag
code/UI_Tag/mm_value.coretag
@@ -256,7 +257,6 @@
dist/catalog_before.cfg
dist/error.log
dist/etc/.empty
-dist/etc/jobs/i18n/update_locales
dist/foundation/backup/.empty
dist/foundation/catalog.cfg
dist/foundation/config/additional_fields
@@ -976,6 +976,7 @@
dist/lib/UI/pages/admin/do_view.html
dist/lib/UI/pages/admin/edit_metaconfig.html
dist/lib/UI/pages/admin/entry.html
+dist/lib/UI/pages/admin/entry_items.html
dist/lib/UI/pages/admin/entry_select.html
dist/lib/UI/pages/admin/env_vars.html
dist/lib/UI/pages/admin/error.html
@@ -1112,6 +1113,7 @@
dist/lib/UI/pages/include/Options/Matrix
dist/lib/UI/pages/include/Options/Simple
dist/lib/UI/pages/include/Options/old/item_option_matrix
+dist/lib/UI/pages/include/Options/old/item_option_modular
dist/lib/UI/pages/include/Options/old/item_option_simple
dist/lib/UI/pages/include/component_editor
dist/lib/UI/pages/include/menus/Accounting.txt
2.18 +26 -0 interchange/dist/foundation/catalog.cfg
rev 2.18, prev_rev 2.17
Index: catalog.cfg
===================================================================
RCS file: /var/cvs/interchange/dist/foundation/catalog.cfg,v
retrieving revision 2.17
retrieving revision 2.18
diff -u -r2.17 -r2.18
--- catalog.cfg 11 Apr 2003 18:52:28 -0000 2.17
+++ catalog.cfg 12 Apr 2003 00:21:24 -0000 2.18
@@ -324,9 +324,35 @@
track logs/tracking.asc
EOF
+## This route emails the order to you unless email is set to "",
+## and failsafe-logs the order report a couple of places
+Route main_entry <<EOF
+ attach 0
+ credit_card 1
+ email '__ORDERS_TO__'
+ encrypt 0
+ errors_to '__ORDERS_TO__'
+ pgp_cc_key "__PGP_KEY__"
+ pgp_key "__PGP_KEY__"
+ report etc/report
+ supplant 1
+ individual_track orders
+ track logs/tracking.asc
+EOF
+
+
# Order routes can be maintained in a database
# CHANGES TO THIS WILL OVERRIDE THE ROUTES ABOVE.
RouteDatabase route
+
+# Order desk route run if entered from admin
+# always
+Route entry master 1
+Route entry cascade "log main_entry copy_user"
+Route entry empty 1
+Route entry supplant 1
+Route entry no_receipt 1
+Route entry email '__ORDERS_TO__'
# Default route is run if no routes set, this should be last Route
# always
2.7 +96 -8 interchange/dist/foundation/etc/log_transaction
rev 2.7, prev_rev 2.6
Index: log_transaction
===================================================================
RCS file: /var/cvs/interchange/dist/foundation/etc/log_transaction,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -r2.6 -r2.7
--- log_transaction 18 Oct 2002 06:00:10 -0000 2.6
+++ log_transaction 12 Apr 2003 00:21:24 -0000 2.7
@@ -1,4 +1,5 @@
#### begin [value mv_order_number] #####
+[tmpn auto_create][/tmpn]
[loop list="transactions orderline inventory userdb"]
[flag type=write table="[loop-code]"]
[/loop]
@@ -77,7 +78,7 @@
[else]
Offline credit card [value mv_credit_card_type] [value mv_credit_card_reference].
- Payment: [value name=mv_payment set="COD"]
+ Payment: [value name=mv_payment set="credit_card"]
[/else]
[/if]
@@ -95,6 +96,12 @@
[goto if="[scratch mv_route_failed]"]
[if type=explicit compare=`
+ if($Session->{admin} and $Values->{order_desk_entry}) {
+ ## This is ordered from admin, don't login
+ ## We scrub that order_desk_entry value below if not admin
+ return 0;
+ }
+ delete $Values->{order_desk_entry};
return 1 if ! $Session->{logged_in} or $Session->{login_table} ne 'userdb';
return 0;
`]
@@ -128,10 +135,52 @@
[/if]
+[if value order_desk_entry]
+[try]
+ [tmpn tmp_compare][/tmpn]
+ [tmp tmp_username][data table=userdb col=username key="[value customer_id]"][/tmp]
+ [if !scratch tmp_username]
+ [tmp hide_status][userdb
+ function=new_account
+ no-login=1
+ assign-username=1
+ password='[value zip]'
+ verify='[value zip]'
+ ][/tmp]
+ [tmp tmp_username][data session auto_created_user][/tmp]
+ [if scratch hide_status]
+ Auto-created user [scratch tmp_username], no login.
+ [userdb function=save scratch=NONE username="[scratch tmp_username]" hide=1]
+ [/if]
+ [/if]
+
+ [value name=customer_id set="[scratch tmp_username]" hide=1]
+ [if !value customer_id]
+ Auto-create of user failed.
+ [perl] die errmsg("Auto-create of user failed."); [/perl]
+ [/else]
+ [/if]
+[/try]
+[catch error-set="Customer record creation" error-scratch="mv_route_failed"]
+There was an error adding to the customer table.
+[/catch]
+
+[/if]
+
+
[comment][perl] Log("Starting report."); [/perl][/comment]
[try]
+[if value order_desk_entry]
+[tmp tmp_username][value customer_id][/tmp]
+[tmp tmp_source][value name=salesperson default=ORDER_DESK][/tmp]
+Order desk entry, set next page to: [cgi name=mv_nextpage set="admin/order_view"]
+[else]
+[tmp tmp_username][data session username][/tmp]
+[tmp tmp_source][data session source][/tmp]
+[/else]
+[/if]
[seti total_cost][total-cost noformat=1][/seti]
Add main order [value mv_order_number] to transactions:
[import table=transactions type=LINE continue=NOTES]
@@ -139,7 +188,7 @@
store_id: __STORE_ID__
order_number: [value mv_order_number]
session: [data session id]
-username: [data session username]
+username: [scratch tmp_username]
shipmode: [value mv_shipmode] ([shipping-desc])
shipping: [shipping noformat=1]
nitems: [nitems]
@@ -182,7 +231,7 @@
archived: 0
complete: 0
comments: [value filter=mac name=gift_note]
-affiliate: [data session source]
+affiliate: [scratch tmp_source]
campaign: [value campaign]
parent: __PARENT__
po_number: [value filter=strip name=po_number]
@@ -214,7 +263,7 @@
store_id: __STORE_ID__
order_number: [value mv_order_number]
session: [data session id]
-username: [data session username]
+username: [scratch tmp_username]
shipmode: [item-modifier mv_shipmode]
sku: [item-code]
options: [item-filter mac strip][item-options report=1 type=value][/item-filter]
@@ -225,7 +274,7 @@
mv_si: [item-modifier mv_si]
mv_mp: [item-modifier mv_mp]
order_date: [value order_date]
-affiliate: [data session source]
+affiliate: [scratch tmp_source]
campaign: [value campaign]
status: pending
description: [filter mac][item-description][/filter]
@@ -283,10 +332,49 @@
[/if]
[try]
-[tmpn tmp_user_save]FAILED[/tmpn]
-[if type=explicit compare="[userdb save]"]
+[tmpn tmp_user_save]NO[/tmpn]
+[tmpn tmp_save][/tmpn]
+[if value order_desk_entry]
+
+ [calc]
+ ## Set this so that we can go to admin/order_view[/comment]
+ $CGI->{order} = $Values->{mv_order_number};
+
+ my @funcs;
+ #### Commented out until separate functions built
+ #for(qw/shipping billing/) {
+ # next if $Values->{"no_save_$_"};
+ # push @funcs, "set_$_";
+ # $Scratch->{tmp_user_save} = '';
+ #}
+ @funcs = 'save' unless $Values->{no_save};
+ $Scratch->{tmp_save} = join(" ", @funcs);
+ my $msg = errmsg("Order %s entered for customer %s",
+ $Values->{mv_order_number},
+ $Scratch->{tmp_username},
+ );
+ $Tag->warnings($msg);
+ return;
+ [/calc]
+ [seti tmp_user_save]
+ [loop list="[scratch tmp_save]"]
+ [loop-code]=[userdb
+ function="[loop-code]"
+ profile=default
+ username="[scratch tmp_username]"
+ scratch=NONE
+ ] [/loop]
+ [/seti]
+ [calc]
+ $Scratch->{tmp_user_save} =~ s/^\s+//;
+ $Scratch->{tmp_user_save} =~ s/\s+$//;
+ $Scratch->{tmp_user_save} =~ s/\s+/ /g;
+ return;
+ [/calc]
+
+[elsif type=explicit compare="[userdb save]"]
[tmpn tmp_user_save]SUCCESS[/tmpn]
-[/if]
+[/elsif][/if]
Saved user information to user database: [scratch tmp_user_save]
[if scratch auto_create]
Logout auto-created user: [userdb function=logout clear=0 clear_cart=0]
2.10 +686 -167 interchange/dist/lib/UI/pages/admin/entry.html
rev 2.10, prev_rev 2.9
Index: entry.html
===================================================================
RCS file: /var/cvs/interchange/dist/lib/UI/pages/admin/entry.html,v
retrieving revision 2.9
retrieving revision 2.10
diff -u -r2.9 -r2.10
--- entry.html 9 Sep 2002 18:36:53 -0000 2.9
+++ entry.html 12 Apr 2003 00:21:24 -0000 2.10
@@ -22,12 +22,152 @@
@_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]
+
<!-- ----- BEGIN REAL STUFF ----- -->
+<!-- begin initialization -->
+<!-- [set old_browser]1[/set][calc]
+ ## Browser check, standalone so syntax error will not
+ ## kill init code
+ my $regex = $Variable->{MV_DHTML_BROWSER};
+ $regex ||= 'MSIE [5-9].*Windows|Mozilla.*Gecko';
+
+ $regex = qr/$regex/;
+ if($Session->{browser} =~ $regex) {
+ delete $Scratch->{old_browser};
+ }
+ return $Scratch->{old_browser} ? 'Not a DHTML browser' : 'DHTML browser';
+[/calc] -->
+
+[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';
-<FORM ACTION="[process secure=1]" METHOD="POST">
+ ## 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]
+<!-- end initialization -->
+
+<FORM ACTION="[process secure=1]" METHOD="POST" name=checkout>
+
+[page href="admin/entry_items"
+ form="
+ hiddens=customer
+ caller=entry
+ customer=[either][cgi customer][or][value customer_id][/either]
+ "]Select items from list</A>
+[comment] Get previous order numbers for possible repeat [/comment]
+[if value customer_id]
+ [query
+ sql="
+ select order_number from transactions
+ where username = '[value customer_id]'
+ order by order_date desc
+ "
+ list=1
+ ]
+ [on-match]
+ <select name=repeat_order>
+ <option value="">none
+ [/on-match]
+ [list]<option>[sql-code][/list]
+ [on-match]
+ </select> <input type=submit value="Repeat previous order by [value customer_id]">
+ [/on-match]
+ [/query]
+[/if]
<INPUT TYPE=hidden NAME=mv_session_id VALUE="[data session id]">
+<INPUT TYPE=hidden NAME=mv_values_space VALUE="order_entry">
<INPUT TYPE=hidden NAME=mv_todo VALUE="refresh">
+<INPUT TYPE=hidden NAME=order_desk_entry VALUE="1">
<INPUT TYPE=hidden NAME=mv_search_page VALUE="__UI_BASE__/entry_select">
<table border=0 __UI_T_PROPERTIES__>
<COL WIDTH="10%">
@@ -169,69 +309,23 @@
</TBODY>
</TABLE>
-[if type=explicit compare="[error all=1 show_var=1 keep=1]"]
+[if errors]
<P>
<FONT COLOR=__CONTRAST__>There were errors in your last entry.</FONT>
-They are shown in <FONT COLOR=__CONTRAST__>this color</FONT> below.</FONT>
+Pointers are shown in <FONT COLOR=__CONTRAST__>this color</FONT> below.</FONT>
+ <ul>
+ <li>
+ [error all=1 show_var=1 keep=1 show_error=1 joiner="<LI>"]
+ </ul>
<P>
[/if]
<INPUT TYPE=hidden NAME=mv_doit VALUE=refresh>
<INPUT TYPE=hidden NAME=mv_nextpage VALUE="@@MV_PAGE@@">
-[comment] checkout_profile in etc/profiles.order [/comment]
-<INPUT TYPE=hidden NAME=mv_order_profile VALUE=checkout_profile>
-[comment] Order routes in catalog.cfg [/comment]
-
<br>
<TABLE border=0 WIDTH=600><TR><TD class=rmarq>
[L]Shipping Address[/L]
</TD></TR></TABLE>
-[calc]
- return unless $CGI->{customer};
- $Values->{customer_id} = $CGI->{customer}
- unless $CGI->{customer} eq 'NEW';
- for (qw/
- username
- password
- company
- fname
- lname
- address1
- address2
- address3
- city
- state
- zip
- country
- phone_day
- mv_shipmode
- b_nickname
- b_fname
- b_lname
- b_address1
- b_address2
- b_address3
- b_city
- b_state
- b_zip
- b_country
- b_phone
- mv_credit_card_type
- mv_credit_card_exp_month
- mv_credit_card_exp_year
- mv_credit_card_info
- email
- fax
- phone_night
- fax_order
- order_numbers
- email_copy
- mail_list
- /)
- {
- $Values->{$_} = '';
- }
-[/calc]
[loop list=`$Values->{customer_id} || 'NEW'`]
@@ -246,6 +340,13 @@
</TR>
<TR>
+ <TD ALIGN=RIGHT>[error name=company std_label=[L]Company[/L]]</TD>
+ <TD ALIGN=LEFT>
+ <INPUT TYPE=text NAME=company VALUE="[value name=company default="[loop-data userdb company]"]" size=60>
+ </TD>
+</TR>
+
+<TR>
<TD ALIGN=RIGHT>
[error name=fname std_label="[L]First Name[/L]" required=1]</TD>
<TD>
@@ -352,23 +453,30 @@
[/set]
[set [L]Clear[/L]]
-customer_id=
-customer=NEW
+[calc]
+ for(keys %$CGI) {
+ $CGI->{$_} = '';
+ }
+[/calc]
mv_todo=return
+customer=NEW
+mv_nextpage=@@MV_PAGE@@
[/set]
<TR>
<TD> </TD>
<TD>
- <B><INPUT TYPE=submit NAME=mv_click VALUE=[L]Find[/L]>
- <INPUT TYPE=submit NAME=mv_click VALUE=[L]Clear[/L]></B>
+ <B><INPUT TYPE=submit NAME=mv_click VALUE="[L]Find[/L]">
+ <INPUT TYPE=submit NAME=mv_click VALUE="[L]Clear[/L]"></B>
</TD>
</TR>
<TR>
<TD> </TD>
<TD>
<SMALL><I>[msg arg.0="<B>" arg.1="</B>"]%sBold%s fields needed to process the order[/msg]</I></SMALL>
+ <br>
+ <span class=cmessage><input type=checkbox name=no_save value=1 [checked no_save_shipping 1]> Don't save address in user record</span>
</TD>
</TR>
@@ -382,7 +490,7 @@
[if !scratch only_downloadable]
<P>
<TABLE WIDTH=600><TR><TD class=rmarq>
-[L]Choose your shipping method[/L]
+[L]Shipping method[/L]
</TD></TR></TABLE>
<P>
@@ -392,7 +500,7 @@
]
[shipping
label=1
- mode=| [data table=country key='[default country US]' sf=selector col=shipmodes]|
+ mode=| [data table=country key='[either][value country]' sf=selector col=shipmodes]|
]
</SELECT>
</TD>
@@ -408,94 +516,6 @@
</TR></TABLE>
[/if]
-
-[if variable CREDIT_CARDS_ACCEPTED =~ /\S/]
-<TABLE WIDTH=600><TR><TD class=rmarq>
-[error std_label="<B>Credit Card Information</B>" name=mv_credit_card_valid]
-</TD></TR></TABLE>
-
-<P>
-<TABLE><TR><TD VALIGN=TOP>
-Card Number<BR>
-<INPUT TYPE=text NAME=mv_credit_card_number SIZE=19 VALUE="">
-[if variable MV_PAYMENT_MODE =~ /minivend_test/]
- <BR>Interchange test should yield:
- <INPUT TYPE=radio NAME=mv_payment_test VALUE=success CHECKED>Success
- <INPUT TYPE=radio NAME=mv_payment_test VALUE=success>Failure
-[/if]
-</TD>
-<TD VALIGN=TOP>
- Expires
-<BR>
- <SELECT NAME=mv_credit_card_exp_month>
- <OPTION VALUE=1 [selected mv_credit_card_exp_month 1]> 01 - January
- <OPTION VALUE=2 [selected mv_credit_card_exp_month 2]> 02 - February
- <OPTION VALUE=3 [selected mv_credit_card_exp_month 3]> 03 - March
- <OPTION VALUE=4 [selected mv_credit_card_exp_month 4]> 04 - April
- <OPTION VALUE=5 [selected mv_credit_card_exp_month 5]> 05 - May
- <OPTION VALUE=6 [selected mv_credit_card_exp_month 6]> 06 - June
- <OPTION VALUE=7 [selected mv_credit_card_exp_month 7]> 07 - July
- <OPTION VALUE=8 [selected mv_credit_card_exp_month 8]> 08 - August
- <OPTION VALUE=9 [selected mv_credit_card_exp_month 9]> 09 - September
- <OPTION VALUE=10 [selected mv_credit_card_exp_month 10]> 10 - October
- <OPTION VALUE=11 [selected mv_credit_card_exp_month 11]> 11 - November
- <OPTION VALUE=12 [selected mv_credit_card_exp_month 12]> 12 - December
- </SELECT>
- <SELECT NAME=mv_credit_card_exp_year>
- <OPTION VALUE=00 [selected mv_credit_card_exp_year 00]> 2000
- <OPTION VALUE=01 [selected mv_credit_card_exp_year 01]> 2001
- <OPTION VALUE=02 [selected mv_credit_card_exp_year 02]> 2002
- <OPTION VALUE=03 [selected mv_credit_card_exp_year 03]> 2003
- <OPTION VALUE=04 [selected mv_credit_card_exp_year 04]> 2004
- <OPTION VALUE=05 [selected mv_credit_card_exp_year 05]> 2005
- <OPTION VALUE=06 [selected mv_credit_card_exp_year 06]> 2006
- <OPTION VALUE=07 [selected mv_credit_card_exp_year 07]> 2007
- <OPTION VALUE=08 [selected mv_credit_card_exp_year 08]> 2008
- <OPTION VALUE=09 [selected mv_credit_card_exp_year 09]> 2009
- <OPTION VALUE=10 [selected mv_credit_card_exp_year 10]> 2010
- </SELECT>
-</TD></TR></TABLE>
-
-<INPUT TYPE=radio NAME=fax_order VALUE=0
- [if !value fax_order]CHECKED[/if]>
-<I>Charge credit card</I><BR>
-
-[if variable CHECK_ACCEPTED]
- <INPUT TYPE=radio NAME=fax_order VALUE=1 [checked fax_order 1]>
- <I>Call customer for payment information</I><BR>
-[/if]
-
-[if variable PO_ACCEPTED]
- <INPUT TYPE=radio NAME=fax_order VALUE=2 [checked fax_order 2]>
- <I>I will pay by purchase order</I>
- [error name=credit_limit_ok std_label="PO Number" required=1] <INPUT NAME=po_number VALUE="[value po_number]" SIZE=14>
- [if type=data
- term="userdb::credit_limit::[value customer_id]"
- op=">"
- compare=0.01]
- <BR>
- Current credit limit:
- [currency]
- [data table=userdb col=credit_limit key="[value customer_id]"]
- [/currency]
-
- [if type=data
- term="userdb::credit_limit::[value customer_id]"
- op=<
- compare="[total-cost noformat=1]"
- ]
- <BR>
- <FONT COLOR=__CONTRAST__>Order total [total-cost] exceeds credit limit, please call.</FONT>
- [/if]
- <BR>
- [/if]
- </I><BR>
-[/if]
-
-[if variable COD_ACCEPTED]
- <INPUT TYPE=radio NAME=fax_order VALUE=3 [checked fax_order 3]>
- <I>I will pay by COD ([handling cod] extra charge will be added)</I><BR>
-[/if]
<br>
<TABLE WIDTH=__UI_MAIN_WIDTH__><TR><TD class=rmarq>
Billing Address (if different)
@@ -511,6 +531,13 @@
</TR>
<TR>
+ <TD ALIGN=RIGHT>Company</TD>
+ <TD ALIGN=LEFT>
+ <INPUT TYPE=text NAME=b_company VALUE="[value name=b_company default="[loop-data userdb b_company]"]" size=50>
+ </TD>
+</TR>
+
+<TR>
<TD ALIGN=RIGHT><B>Address</B></TD>
<TD ALIGN=LEFT>
<INPUT TYPE=text NAME=b_address1 VALUE="[value name=b_address1 default="[loop-data userdb b_address1]"]" size=50>
@@ -540,6 +567,12 @@
<INPUT TYPE=text NAME=b_country VALUE="[value name=b_country default="[loop-data userdb b_country]"]" size=20>
</TD>
</TR>
+<TR>
+ <TD ALIGN=RIGHT><B>Phone</B></TD>
+ <TD>
+ <INPUT TYPE=text NAME=b_phone VALUE="[value name=b_phone default="[loop-data userdb b_phone]"]" size=20>
+ </TD>
+</TR>
</TABLE><br>
@@ -549,33 +582,524 @@
<TABLE>
<TR>
- <TD valign=bottom>
+ <TD valign=top>
+ <b>Send receipt</b><br>
<INPUT TYPE=radio NAME=email_copy [checked name=email_copy value=1 default=1] VALUE="1">Yes
<INPUT TYPE=radio NAME=email_copy [checked name=email_copy value=0] VALUE="0">No
</TD>
- <TD valign=bottom>
- <I>Send an email copy of my receipt</I>
- </TD>
-</TR>
-<TR>
- <TD valign=bottom>
- <INPUT TYPE=radio NAME=mail_list [if-loop-data userdb mail_list]CHECKED[/if-loop-data] VALUE="1">Yes
- <INPUT TYPE=radio NAME=mail_list [if-loop-data userdb mail_list][else]CHECKED[/else][/if-loop-data] VALUE="0">No
- </TD>
- <TD valign=bottom>
- <I>Put customer on email information list</I>
+ <td>
+
+
+ </td>
+ <TD valign=top>
+ <b>Put on email lists</b><br>
+ [display table=userdb col=mail_list type=checkbox_left_2]
</TD>
</TR>
</TABLE>
+<!-- begin payment_select -->
+<table cellspacing="0" cellpadding="0" width="600">
+ <tr>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0" width="100%">
+ <tr class="rmarq">
+ <td colspan=4 class="rmarq"><b>[L]Payment Method[/L]</b></td>
+ </tr>
+ <tr>
+ <td colspan=4 class="contentbar1"> </td>
+ </tr>
+ <tr>
+ <td class="contentbar1"> </td>
+ <td class="contentbar1">
+
+[if !scratch old_browser]
+<script>
+var possible = ['credit_card', 'cod', 'postal', 'online_check', 'purchase_order'];
+
+function visible (selnam) {
+
+ if(selnam == undefined) {
+ var form = document.checkout;
+ if(form == undefined)
+ return;
+ var selec = form.mv_order_profile;
+ if(selec.selectedIndex == undefined)
+ selec.selectedIndex = 0;
+ selnam = selec.options[selec.selectedIndex].value;
+ }
+
+ // alert("selnam=" + selnam);
+
+ var sel = document.getElementById(selnam);
+ // alert("sel=" + sel);
+ if(sel == undefined)
+ return;
+
+ for(var i = 0; i < possible.length; i++) {
+ var xel = document.getElementById(possible[i]);
+ if(xel != undefined) {
+ xel.style.zIndex = 0;
+ xel.style.visibility = 'Hidden';
+ }
+ }
+
+ sel.style.visibility = 'Visible';
+ sel.style.zIndex = 2;
+
+ return;
+}
+</script>
+[/if]
+
+ <SELECT NAME="mv_order_profile"
+ onChange="[if scratch old_browser]
+ this.form.submit()
+ [else]
+ visible()
+ [/else]
+ [/if]">
+ [if variable CREDIT_CARDS_ACCEPTED]
+ <option [selected mv_order_profile credit_card] value="credit_card">[L]Credit Card[/L]
+ [/if]
+ [if variable CHECK_ACCEPTED]
+ <option [selected mv_order_profile online_check] value="online_check">[L]Online Check[/L]
+ [/if]
+ [if variable PO_ACCEPTED]
+ <option [selected mv_order_profile purchase_order] value="purchase_order">[L]Company P.O.[/L]
+ [/if]
+ [if variable POSTAL_ACCEPTED]
+ <option [selected mv_order_profile postal] value="postal">[L]Postal Billing[/L]
+ [/if]
+ [if variable COD_ACCEPTED]
+ <option [selected mv_order_profile cod] value="cod">[L]C.O.D.[/L]
+ [/if]
+ </SELECT>
+ </td>
+ <td colspan="2" class="contentbar1">
+ [if scratch old_browser]
+ ([L]will update display[/L])
+ [/if]
+ </td>
+ </tr>
+ <tr>
+ <td class="contentbar1" colspan="4"> </td>
+ </tr>
+ </table>
+
+ </td>
+ </tr>
+ </table>
+
+<!-- end payment_select -->
+
+<!-- begin payment_widgets -->
+<div
+ style="
+ Position:Relative;
+ Left:0; Top:0;
+ Visibility:Visible;
+ height: 160px;
+ z-index:1;
+ ">
+ <div
+ id=credit_card
+ style="
+ Position:Absolute;
+ Left:0; Top:0;
+ Visibility:Hidden;
+ z-index:0;
+ ">
+ <!--- credit card information --->
+ <table cellspacing=0 cellpadding="0" width="600">
+ <tr>
+ <td>
+ <table border=0 cellspacing=0 cellpadding=4 width="100%">
+ <tr>
+ <td colspan="2" class="rmarq" width="30%">
+ <b>
+ [error std_label="[L]Credit Card Information[/L]" name=mv_credit_card_valid]
+ </b>
+ </td>
+ <td class="rmarq">
+ [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{<IMG id="img_$_" SRC="__IMAGE_DIR__/small$_.png">};
+ }
+ return join ' ', @out;
+ [/calc]
+ </td>
+ </tr>
+ <tr>
+ <td align=right class="contentbar1" width="30%">
+ <b>[L]Card Number[/L]: </b>
+ </td>
+ <td colspan=2 class="contentbar1">
+<script>
+ var cards = [ 'visa', 'mc', 'disc', 'amex' ];
+ var cardimg = new Array;
+ for( var i = 0; i < cards.length; i++) {
+ var el = document.getElementById('img_' + cards[i]);
+ if(el != undefined) {
+ cardimg[cards[i]] = el;
+ el.border = 0;
+ }
+ }
+
+ function highlight_card (num) {
+
+ var ti = document.getElementById('textindication');
+ ti.innerHTML = '';
+ var e;
+ for(e in cardimg) {
+ cardimg[e].border = 0;
+ }
+
+ var type;
+ var desc;
+
+ if(num == undefined)
+ return;
+
+ if(num.substr(0,1) == '4') {
+ type = 'visa';
+ desc = '(Visa)';
+ }
+
+ if(
+ desc == undefined &&
+ num.substr(0,2) == '51' ||
+ num.substr(0,2) == '52' ||
+ num.substr(0,2) == '53' ||
+ num.substr(0,2) == '54' ||
+ num.substr(0,2) == '55'
+ )
+ {
+ type = 'mc';
+ desc = '(Mastercard)';
+ }
+
+ if(
+ desc == undefined &&
+ num.substr(0,4) == '6011'
+ )
+ {
+ type = 'disc';
+ desc = '(Discover card)';
+ }
+
+ if(
+ desc == undefined &&
+ num.substr(0,2) == '34' ||
+ num.substr(0,2) == '37'
+ )
+ {
+ type = 'amex';
+ desc = '(American Express card)';
+ }
+
+ if(
+ desc == undefined &&
+ num.substr(0,2) == '36' ||
+ num.substr(0,2) == '30'
+ )
+ {
+ type = 'diners';
+ desc = '(Diners Club card)';
+ }
+
+ if(
+ desc == undefined &&
+ num.substr(0,2) == '38'
+ )
+ {
+ type = 'carteblanche';
+ desc = '(Carte Blanche)';
+ }
+
+ if(
+ desc == undefined &&
+ num.substr(0,1) == '2'
+ )
+ {
+ type = 'enroute';
+ desc = '(En Route)';
+ }
+
+ if(
+ desc == undefined &&
+ num.substr(0,2) == '56'
+ )
+ {
+ type = 'bankcard';
+ desc = '(BankCard)';
+ }
+
+ if(
+ desc == undefined &&
+ num.substr(0,1) == '3' ||
+ num.substr(0,4) == '2131' ||
+ num.substr(0,4) == '1800'
+ )
+ {
+ type = 'jcb';
+ desc = '(JCB card)';
+ }
+
+ var el = cardimg[type];
+// alert("el is " + el);
+ if( el != undefined ) {
+ el.border = 2;
+ }
+ if( desc != undefined ) {
+ ti.innerHTML = desc;
+ }
+ }
+</script>
+ <b><INPUT TYPE=text NAME=mv_credit_card_number SIZE=22 onChange="highlight_card(this.value)"></b> <i id=textindication style="font-size: smaller"></i>
+ </td>
+ </tr>
+ [if variable MV_DEMO_MODE]
+ <tr>
+ <td class=contentbar1>
+ </td>
+ <td colspan=2 class=contentbar1>
+ ([L]test number[/L] <A HREF="javascript:void 0" onclick="checkout.mv_credit_card_number.value='4111 1111 1111 1111'; highlight_card('4'); return false;">4111 1111 1111 1111</A>)
+ </td>
+ </tr>
+ [/if]
+ <tr>
+ <td align=right class="contentbar1">
+ <b>[L]Expiration[/L]: </b>
+ </td>
+ <td colspan=2 class="contentbar1">
+
+ [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]|]
+
+
+ <SELECT NAME=mv_credit_card_exp_year>
+ [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;
+ `]
+
+ </td>
+ </tr>
+ </table>
+
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div
+ id=postal
+ style="
+ Position:Absolute;
+ Left:0; Top:0;
+ Visibility:Hidden;
+ z-index:0;
+ ">
+ [L NEW_BROWSER_PAYMENT_MSG1]We will wait for a check sent to us referencing the order number you receive on your receipt.[/L]
+ </div>
+ <div
+ id=cod
+ style="
+ Position:Absolute;
+ Left:0; Top:0;
+ Visibility:Hidden;
+ z-index:0;
+ ">
+ [msg arg.0="[handling cod]"]There will be a %s charge added for COD.[/msg]
+ </div>
+
+ <div
+ id=online_check
+ style="
+ Position:Absolute;
+ Left:0; Top:0;
+ Visibility:Hidden;
+ z-index:0;
+ ">
+ <table border="0" cellspacing="0" cellpadding="0" width="600">
+ <tr>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="4" width="100%">
+ <tr>
+ <td class="rmarq" colspan="2">
+ <b> [L]Check Information[/L]</b>
+ </td>
+ <td class="rmarq"> </td>
+ <td class="rmarq"> </td>
+ </tr>
+ <tr>
+ <td align="right" class="contentbar1">
+ [error name=check_acct std_label="[L]Account Number[/L]" required=1]
+ </td>
+ <td colspan="3 align="left" class="contentbar1">
+ <b>
+ <INPUT TYPE=text NAME=check_acct SIZE=22 value="[value check_acct]">
+ </b>
+ </td>
+ </tr>
+ <tr>
+ <td align="right" class="contentbar1">
+ [error name=check_route std_label="[L]Routing Number[/L]" required=1]
+
+ </td>
+ <td align="left" colspan="3" class="contentbar1">
+ <b><INPUT TYPE=text NAME=check_route SIZE=22 value="[value check_route]"></b>
+ </td>
+ </tr>
+ <tr>
+ <td align="right" class="contentbar1">
+ [error name=check_num std_label="[L]Check Number[/L]" required=1]
+ </td>
+ <td align="left" colspan="3" class="contentbar1">
+ <b>
+ <INPUT TYPE=text NAME=check_num SIZE=22 value="[value check_num]">
+ </b>
+ </td>
+ </tr>
+ <tr>
+ <td align="right" class="contentbar1">
+ [error name=check_bank_phone std_label="[L]Bank Phone[/L]" required=1]
+
+ </td>
+ <td align="left" colspan="3" class="contentbar1">
+ <b>
+ <INPUT TYPE=text NAME=check_bank_phone SIZE=22 value="[value check_bank_phone]">
+ </b>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=4 class=contentbar1> </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div
+ id=purchase_order
+ style="
+ Position:Absolute;
+ Left:0; Top:0;
+ Visibility:Visible;
+ z-index:0;
+ ">
+
+ <table cellspacing="0" cellpadding="0" width="600">
+ <tr>
+ <td>
+ <table border="0" cellspacing="0" cellpadding="0" width="100%">
+ <tr class="rmarq">
+ <td class="rmarq" colspan="2">
+ <b> [L]P.O. Information[/L] </b>
+ </td>
+ <td colspan=2 class="rmarq"> </td>
+ </tr>
+ <tr>
+ <td align=right class="contentbar1" width="30%">
+ [error name=credit_limit_ok std_label="[L]PO Number[/L]" required=1]
+ </td>
+ <td align=left colspan=3 class="contentbar1">
+ <b>
+ <INPUT NAME=project_id VALUE="[value project_id]" SIZE=14>
+ </b>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=4 class=contentbar1> </td>
+ </tr>
+
+ [if type=data
+ term="userdb::credit_limit::[data session username]"
+ op=">"
+ compare=0.01]
+
+ <tr>
+ <td align=right valign=top class=contentbar1>
+ <b> Available credit </b>
+ </td>
+ <td align=left colspan=3 class=contentbar1>
+ [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]"
+ ]
+ <BR>
+ [msg arg.0="[total-cost]"]Order total %s exceeds credit limit, please call.[/L]
+ [/if]
+ <BR>
+ </td>
+ </tr>
+
+ [/if]
+ <tr>
+ <td colspan=4 class=contentbar1> </td>
+ </tr>
+ </table>
+
+ </td>
+ </tr>
+ </table>
+ </div>
+</div>
+
+<script>
+ visible('[either][value mv_order_profile][or]credit_card[/either]');
+</script>
+<!-- end payment_widgets -->
<CENTER>
[set [L]Place Order[/L]]
mv_todo=submit
- mv_nextpage=admin/order
- [value name=mv_order_route set="log_entry main copy_user" hide=1]
+ [value name=mv_order_route set="entry" hide=1]
[/set]
-<INPUT name=mv_click TYPE=submit VALUE="[L]Place Order[/L]">
+<INPUT name=mv_click TYPE=submit VALUE="[L]Place Order[/L]" style="font-weight: bold">
</CENTER>
<P>
@@ -584,11 +1108,6 @@
</FORM>
[/loop]
[error all=1 hide=1 comment="Clear errors"]
-
-</TD></TR></TABLE>
-__MENUBOTTOM__
-__COPYRIGHT__
-<!-- current page: @@MV_PAGE@@ -->
<!-- ----- END REAL STUFF ----- -->
2.3 +1 -1 interchange/dist/lib/UI/pages/admin/entry_select.html
rev 2.3, prev_rev 2.2
Index: entry_select.html
===================================================================
RCS file: /var/cvs/interchange/dist/lib/UI/pages/admin/entry_select.html,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -r2.2 -r2.3
--- entry_select.html 18 Aug 2002 15:11:32 -0000 2.2
+++ entry_select.html 12 Apr 2003 00:21:24 -0000 2.3
@@ -79,7 +79,7 @@
rf=username,lname,fname
"]
<pre>
-<select name=customer size=10>
+<select name=customer size=10 onDblClick="this.form.submit()">
[search-list]<OPTION VALUE="[item-code]">[item-code]: [item-pos 1], [item-pos 2]</OPTION>
[/search-list]
[no-match]<OPTION VALUE=""> -- no matching customers --[/no-match]
2.1 interchange/dist/lib/UI/pages/admin/entry_items.html
rev 2.1, prev_rev 2.0
1.2 +1 -0 interchange/dist/lib/UI/pages/include/menus/OrderView.txt
rev 1.2, prev_rev 1.1
Index: OrderView.txt
===================================================================
RCS file: /var/cvs/interchange/dist/lib/UI/pages/include/menus/OrderView.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- OrderView.txt 14 Jan 2003 14:35:56 -0000 1.1
+++ OrderView.txt 12 Apr 2003 00:21:24 -0000 1.2
@@ -2,3 +2,4 @@
001 x001 admin/order_view order=%5Bcgi%20order%5D View Order 0 View the order
002 x002 admin/order_status order=%5Bcgi%20order%5D Order Status 0 Change the status of the order, possibly settling with credit card processor, and send email to customer with status update
003 x003 admin/flex_editor item_id=%5Bcgi%20order%5D&mv_data_table=transactions&ui_return_table=transactions&page_title=Edit%20order%20%5Bcgi%20order%5D&ui_return_to=admin/order&order=%5Bcgi%20order%5D Edit Order 0 Edit the order, possibly re-totalling
+004 x004 admin/entry repeat_order=%5Bcgi%20order%5D&pull_customer=1 Repeat this order 0