Name

Levy — define levy section (levy key)

SYNOPSIS

DESCRIPTION

  • add_to -

  • check_status -

  • description -

  • exclude_if -

  • include_if -

  • free_message -

  • keep_if_zero -

  • label_value -

  • mode -

  • mode_from_scratch -

  • mode_from_values -

  • multi -

  • part_number -

  • sort -

  • tax_fields -

  • tax_type -

  • type -

DIRECTIVE TYPE AND DEFAULT VALUE

Catalog directive

EXAMPLES

Example: Defining a Levy


          

NOTES

See the levy glossary entry for a complete discussion.

AVAILABILITY

Levy is available in Interchange versions:

4.6.0-5.7.0 (git-head)

SOURCE

Interchange 5.7.0:

Source: lib/Vend/Config.pm
Line 708

['Levy',        'locale',           ''],

Source: lib/Vend/Config.pm
Line 3064 (context shows lines 3064-3128)

sub parse_locale {
my($item,$settings) = @_;
return ($settings || '') unless $settings =~ /[^\d.]/;
$settings = '' if "\L$settings" eq 'default';
my $name;
my ($c, $store);
if(defined $C) {
  $c = $C->{$item} || { };
  $C->{$item . "_repository"} = {}
    unless $C->{$item . "_repository"};
  $store = $C->{$item . "_repository"};
}
else {
  no strict 'refs';
  $c = ${"Global::$item"} || {};
  ${"Global::$item" . "_repository"} = {}
    unless ${"Global::$item" . "_repository"};
  $store = ${"Global::$item" . "_repository"};
}

my ($eval, $safe);
if ($settings =~ s/^\s*([-\w.@]+)(?:\s+)?//) {
  $name = $1;

  undef $eval;
  $settings =~ /^\s*{/
    and $settings =~ /}\s*$/
      and $eval = 1;
  $eval and ! $safe and $safe = new Vend::Safe;
  if(! defined $store->{$name} and $item eq 'Locale') {
      my $past = POSIX::setlocale(POSIX::LC_ALL);
    if(POSIX::setlocale(POSIX::LC_ALL, $name) ) {
      $store->{$name} = POSIX::localeconv();
    }
    POSIX::setlocale(POSIX::LC_ALL, $past);
  }

  my($sethash);
  if ($eval) {
    $sethash = $safe->reval($settings)
      or config_warn("bad Locale setting in %s: %s", $name, $@),
          $sethash = {};
  }
  else {
    $settings =~ s/^\s+//;
    $settings =~ s/\s+$//;
    $sethash = {};
    %{$sethash} = Text::ParseWords::shellwords($settings);
  }
  $c = $store->{$name} || {};
  my $nodefaults = delete $sethash->{MV_LOCALE_NO_DEFAULTS};
  for (keys %{$sethash}) {
    $c->{$_} = $sethash->{$_};
  }
}
else {
  config_error("Bad locale setting $settings.\n");
}

$C->{LastLocale} = $name if $C and $item eq 'Locale';

$store->{$name} = $c unless $store->{$name};

return $c;
}

AUTHORS

Interchange Development Group

SEE ALSO

levy-list(7ic), Levies(7ic)

DocBook! Interchange!