&GetUsedMarcStructure
&GetXmlBiblio
&GetCOinSBiblio
+ &GetMarcPrice
+ &GetMarcQuantity
&GetAuthorisedValueDesc
&GetMarcStructure
return $coins_value;
}
+
+=head2 GetMarcPrice
+
+return the prices in accordance with the Marc format.
+=cut
+
+sub GetMarcPrice {
+ my ( $record, $marcflavour ) = @_;
+ my @listtags;
+ my $subfield;
+
+ if ( $marcflavour eq "MARC21" ) {
+ @listtags = ('345', '020');
+ $subfield="c";
+ } elsif ( $marcflavour eq "UNIMARC" ) {
+ @listtags = ('345', '010');
+ $subfield="d";
+ } else {
+ return;
+ }
+
+ for my $field ( $record->field(@listtags) ) {
+ for my $subfield_value ($field->subfield($subfield)){
+ #check value
+ return $subfield_value if ($subfield_value);
+ }
+ }
+ return 0; # no price found
+}
+
+=head2 GetMarcQuantity
+
+return the quantity of a book. Used in acquisition only, when importing a file an iso2709 from a bookseller
+Warning : this is not really in the marc standard. In Unimarc, Electre (the most widely used bookseller) use the 969$a
+
+=cut
+
+sub GetMarcQuantity {
+ my ( $record, $marcflavour ) = @_;
+ my @listtags;
+ my $subfield;
+
+ if ( $marcflavour eq "MARC21" ) {
+ return 0
+ } elsif ( $marcflavour eq "UNIMARC" ) {
+ @listtags = ('969');
+ $subfield="a";
+ } else {
+ return;
+ }
+
+ for my $field ( $record->field(@listtags) ) {
+ for my $subfield_value ($field->subfield($subfield)){
+ #check value
+ if ($subfield_value) {
+ # in France, the cents separator is the , but sometimes, ppl use a .
+ # in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation
+ $subfield_value =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR";
+ return $subfield_value;
+ }
+ }
+ }
+ return 0; # no price found
+}
+
+
=head2 GetAuthorisedValueDesc
my $subfieldvalue =get_authorised_value_desc(
sub GetMarcISBN {
my ( $record, $marcflavour ) = @_;
my $scope;
- if ( $marcflavour eq "MARC21" ) {
- $scope = '020';
- } else { # assume unimarc if not marc21
+ if ( $marcflavour eq "UNIMARC" ) {
$scope = '010';
+ } else { # assume marc21 if not unimarc
+ $scope = '020';
}
my @marcisbns;
my $isbn = "";
sub GetMarcNotes {
my ( $record, $marcflavour ) = @_;
my $scope;
- if ( $marcflavour eq "MARC21" ) {
- $scope = '5..';
- } else { # assume unimarc if not marc21
+ if ( $marcflavour eq "UNIMARC" ) {
$scope = '3..';
+ } else { # assume marc21 if not unimarc
+ $scope = '5..';
}
my @marcnotes;
my $note = "";
sub GetMarcSubjects {
my ( $record, $marcflavour ) = @_;
my ( $mintag, $maxtag );
- if ( $marcflavour eq "MARC21" ) {
- $mintag = "600";
- $maxtag = "699";
- } else { # assume unimarc if not marc21
+ if ( $marcflavour eq "UNIMARC" ) {
$mintag = "600";
$maxtag = "611";
+ } else { # assume marc21 if not unimarc
+ $mintag = "600";
+ $maxtag = "699";
}
my @marcsubjects;
# tagslib useful for UNIMARC author reponsabilities
my $tagslib =
&GetMarcStructure( 1, '' ); # FIXME : we don't have the framework available, we take the default framework. May be buggy on some setups, will be usually correct.
- if ( $marcflavour eq "MARC21" ) {
- $mintag = "700";
- $maxtag = "720";
- } elsif ( $marcflavour eq "UNIMARC" ) { # assume unimarc if not marc21
+ if ( $marcflavour eq "UNIMARC" ) {
$mintag = "700";
$maxtag = "712";
+ } elsif ( $marcflavour eq "MARC21" || $marcflavour eq "NORMARC" ) { # assume marc21 or normarc if not unimarc
+ $mintag = "700";
+ $maxtag = "720";
} else {
return;
}
sub GetMarcSeries {
my ( $record, $marcflavour ) = @_;
my ( $mintag, $maxtag );
- if ( $marcflavour eq "MARC21" ) {
- $mintag = "440";
- $maxtag = "490";
- } else { # assume unimarc if not marc21
+ if ( $marcflavour eq "UNIMARC" ) {
$mintag = "600";
$maxtag = "619";
+ } else { # assume marc21 if not unimarc
+ $mintag = "440";
+ $maxtag = "490";
}
my @marcseries;