[set page_title]Change order number[/set] [set ui_class]Admin[/set] [set help_name]change_order_number[/set] [set icon_name]icon_config.gif[/set] @_UI_STD_HEAD_@ [calc] my $cfn = $Variable->{MV_ORDER_COUNTER_FILE} || 'etc/order.number'; $Values->{new_order_number} = $Tag->file($cfn); $Values->{new_order_number} =~ s/.*\n([A-Za-z0-9]+).*$/$1/s; $CGI->{new_order_number} = $Values->{new_order_number}; return; [/calc]

> Dire warning: If you don't know what you are doing, please don't set this. It will change the order number sequence on the live catalog, which should rarely be done.

[table-editor wizard=1 no_top=1 no_bottom=1 mv_todo=return left_width=100 table_width=500 no-meta=1 ui_wizard_fields="new_order_number" mv_nextpage="__UI_BASE__/genconfig" action_click="new_order_number" hidden.ui_return_to="__UI_BASE__/genconfig" next_text="Set last order number" widget.new_order_number=text_12 label.new_order_number="Last order number" help.new_order_number=|

> Set to value one less than what you want the next order number to be. For example, a value of 100000 will derive a next order number of 100001.

| ] [set new_order_number] [if cgi new_order_number] [perl] my $cfn = $Variable->{MV_ORDER_COUNTER_FILE} || 'etc/order.number'; my $on = $CGI->{new_order_number}; $on =~ s/\W+//g; $on =~ s/_+//g; my $contents = <<EOF; #COUNTER-1.0 $on EOF #Debug("Setting file=$cfn to contents=$contents"); my $opt = { file => $cfn, create => 1, type => 'text', body => $contents, }; my $status = $Tag->log($opt); if(! $status) { $Scratch->{ui_error} = errmsg( "Failed to set order number in file: %s", $cfn, ); } return; [/perl] [/if] [/set] @_UI_STD_FOOTER_@