[freeside-commits] freeside/httemplate/edit did_order.html, 1.1.2.4, 1.1.2.5
Erik Levinson
levinse at wavetail.420.am
Mon Apr 11 16:03:34 PDT 2011
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail.420.am:/tmp/cvs-serv22643/httemplate/edit
Modified Files:
Tag: FREESIDE_2_1_BRANCH
did_order.html
Log Message:
improvements to bulk DID orders, RT11291
Index: did_order.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/did_order.html,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -w -d -r1.1.2.4 -r1.1.2.5
--- did_order.html 6 Apr 2011 08:28:37 -0000 1.1.2.4
+++ did_order.html 11 Apr 2011 23:03:32 -0000 1.1.2.5
@@ -12,7 +12,15 @@
{ field => 'confirmed',
type => 'hidden',
},
- 'custnum',
+ { field => 'stock_or_customer',
+ type => 'radio',
+ options => [ 'Stock', 'Customer', ],
+ onchange => 'stockcust_changed',
+ curr_value_callback => $stock_or_customer,
+ },
+ { field => 'custnum',
+ type => 'search-cust_main',
+ },
{ type => 'tablebreak-tr-title',
value => 'Order Items',
},
@@ -22,31 +30,12 @@
'm2_label' => 'Item',
'm2_error_callback' => $m2_error_callback,
},
- #'msa',
- #{ field => 'latanum',
- # type => 'select-table',
- # name_col => 'description',
- # table => 'lata',
- # disable_empty => 1,
- # label_showkey => 1,
- #},
- #'rate_center',
- #{ field => 'state',
- # type => 'select-state',
- # country => 'US',
- #},
- #'quantity',
],
'labels' => {
'ordernum' => 'Order',
'vendornum' => 'Vendor',
'vendor_order_id' => 'Vendor Order #',
- 'custnum' => 'Customer',
- #'msa' => 'MSA',
- #'latanum' => 'LATA',
- #'rate_center' => 'Rate Center',
- #'state' => 'State',
- #'quantity' => 'Quantity',
+ 'custnum' => '',
'confirmed' => 'Confirmation Date',
'orderitemnum' => 'Item',
},
@@ -54,15 +43,14 @@
'table' => 'did_order',
'name' => 'Bulk DID Order',
'field_callback' => $field_callback,
+ 'html_bottom' => $javascript,
)
-
%>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Import');
-
my $field_callback = sub {
my ($cgi, $object, $field_hashref ) = @_;
if ($object->ordernum) {
@@ -77,7 +65,7 @@
my($cgi, $object) = @_;
#process_o2m fields in process/did_order.html
- my @fields = qw( msa npa latanum rate_center state quantity );
+ my @fields = qw( msa npa latanum ratecenter state quantity );
my @gfields = ( '', map "_$_", @fields );
map {
@@ -99,5 +87,31 @@
$cgi->param;
};
+my $stock_or_customer = sub{
+ my($cgi,$object,$field) = @_;
+ return 'Customer' if $object->custnum;
+ 'Stock';
+};
+
+my $javascript = <<END;
+ <SCRIPT TYPE="text/javascript">
+ function stockcust_changed() {
+ var f = document.edit_topform;
+ var custnum = f.custnum;
+ var custnum_search = f.custnum_search;
+ var custnum_select = f.custnum_select;
+ if ( f.stock_or_customer_Stock.checked ) {
+ custnum_search.disabled = true;
+ custnum_select.disabled = true;
+ }
+ else if ( f.stock_or_customer_Customer.checked ) {
+ custnum_search.disabled = false;
+ custnum_select.disabled = false;
+ }
+ custnum.value = '';
+ custnum_search.value = '';
+ }
+ </SCRIPT>
+END
</%init>
More information about the freeside-commits
mailing list