Default privacy:
@@ -401,6 +414,7 @@
Messaging
[% END %]
Branches limitations
+ Can be guarantee
Default privacy
@@ -478,6 +492,7 @@
No limitation
[% END %]
+ [% IF category.canbeguarantee %] Yes [% ELSE %] no [% END %]
[% SWITCH category.default_privacy %]
[% CASE 'default' %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref
@@ -159,6 +159,11 @@ Patrons:
yes: Do
no: "Don't"
- charge a fee when a patron changes to a category with an enrollment fee.
+ -
+ - "These additional following database columns will be transferred from guarantor to guarantee:"
+ - pref: AdditionalGuarantorField
+ class: multi
+ - (separate columns with |)
"Norwegian patron database":
-
- pref: NorwegianPatronDBEnable
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
@@ -131,14 +131,9 @@
.val(borrower.firstname)
.before('' + borrower.firstname + ' ').get(0).type = 'hidden';
- form.streetnumber.value = borrower.streetnumber;
- form.address.value = borrower.address;
- form.address2.value = borrower.address2;
- form.city.value = borrower.city;
- form.state.value = borrower.state;
- form.zipcode.value = borrower.zipcode;
- form.country.value = borrower.country;
- form.branchcode.value = borrower.branchcode;
+ [% FOREACH field IN guarantor_attributes %]
+ $(form.[% field %]).val(borrower.[% field %]);
+ [% END %]
form.guarantorsearch.value = _("Change");
@@ -435,7 +430,6 @@
[% END %]
[% ELSE %]
- [% IF ( C ) %]
[% IF ( guarantorid ) %]
[% ELSE %]
@@ -453,9 +447,8 @@
[% END %]
- [% END %]
- [% UNLESS nocontactfirstname %]
-
+ [% UNLESS nocontactfirstname %]
+
First name:
[% IF ( guarantorid ) %]
[% contactfirstname %]
@@ -1025,6 +1018,7 @@
[% patron_attribute.description %]:
+
[% IF ( patron_attribute.use_dropdown ) %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
@@ -232,13 +232,24 @@ function validate1(date) {
[% END %][% END %]
[% IF ( isguarantee ) %]
[% IF ( guaranteeloop ) %]
- Guarantees:
+ Guarantees:
+ [% FOREACH guaranteeloo IN guaranteeloop %]
+
+ [% guaranteeloo.name %]
+ [% guaranteeloo.finesguarantee %] $
+ [% END %]
+
+ Total
+ [% amounttot %] $
+
+
+
[% END %]
- [% ELSE %]
+ [% END %]
[% IF ( guarantorborrowernumber ) %]
Guarantor: [% guarantorsurname %][%IF ( guarantorfirstname ) %], [% guarantorfirstname %] [% END %]
[% END %]
- [% END %]
+
--- a/members/memberentry.pl
+++ a/members/memberentry.pl
@@ -39,6 +39,7 @@ use C4::Log;
use C4::Letters;
use C4::Branch; # GetBranches
use C4::Form::MessagingPreferences;
+use C4::Category;
use Koha::Borrower::Debarments;
use Koha::DateUtils;
use Email::Valid;
@@ -232,8 +233,9 @@ if ( ( $op eq 'insert' ) and !$nodouble ) {
}
}
- #recover all data from guarantor address phone ,fax...
-if ( $guarantorid ) {
+#recover all data from guarantor address phone ,fax...
+if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P')) {
+
if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) {
$category_type = $guarantordata->{categorycode} eq 'I' ? 'P' : 'C';
$guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'};
@@ -245,8 +247,14 @@ if ( $guarantorid ) {
zipcode country city state phone phonepro mobile fax email emailpro branchcode
B_streetnumber B_streettype B_address B_address2
B_city B_state B_zipcode B_country B_email B_phone)) {
- $newdata{$_} = $guarantordata->{$_};
+ $newdata{$_} = $guarantordata->{$_};
}
+ my $additionalGuarantorField=C4::Context->preference("AdditionalGuarantorField");
+ my @field_add=split(/\|/,$additionalGuarantorField);
+ my $guarantordata=GetMember(borrowernumber => $guarantorid);
+ foreach (@field_add) {
+ $newdata{$_} = $guarantordata->{$_};
+ }
}
}
}
@@ -674,7 +682,8 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) {
$template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
}
-$template->param( "showguarantor" => ($category_type=~/A|I|S|X/) ? 0 : 1); # associate with step to know where you are
+$template->param( "showguarantor" => $categorycode ? C4::Category->get($categorycode)->{'canbeguarantee'} : 1); # associate with step to know where you are
+$template->param( "guarantor_attributes" => C4::Members::Attributes::get_guarantor_shared_attributes() );
$debug and warn "memberentry step: $step";
$template->param(%data);
$template->param( "step_$step" => 1) if $step; # associate with step to know where u are
--- a/members/moremember.pl
+++ a/members/moremember.pl
@@ -171,33 +171,34 @@ if ( $count ) {
# the array, which is probably better done as a foreach loop.
#
my @guaranteedata;
+ my $amount;
+ my $totalmount = 0;
+
for ( my $i = 0 ; $i < $count ; $i++ ) {
+ my ($amount,$accts,undef) = GetMemberAccountRecords($guarantees->[$i]->{'borrowernumber'});
push(@guaranteedata,
{
borrowernumber => $guarantees->[$i]->{'borrowernumber'},
cardnumber => $guarantees->[$i]->{'cardnumber'},
+ finesguarantee => sprintf("%.2f",$amount),
name => $guarantees->[$i]->{'firstname'} . " "
. $guarantees->[$i]->{'surname'}
}
);
+ $totalmount += $amount;
}
$template->param( guaranteeloop => \@guaranteedata );
+ $template->param( amounttot => sprintf("%.2f",$totalmount));
}
-else {
- if ($data->{'guarantorid'}){
- my ($guarantor) = GetMember( 'borrowernumber' =>$data->{'guarantorid'});
- $template->param(guarantor => 1);
- foreach (qw(borrowernumber cardnumber firstname surname)) {
- $template->param("guarantor$_" => $guarantor->{$_});
- }
+( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' || $category_type eq 'I' );
+
+if ($data->{'guarantorid'}){
+ my ($guarantor) = GetMember( 'borrowernumber' =>$data->{'guarantorid'});
+ $template->param(guarantor => 1);
+ foreach (qw(borrowernumber cardnumber firstname surname)) {
+ $template->param("guarantor$_" => $guarantor->{$_});
}
- if ($category_type eq 'C'){
- $template->param('C' => 1);
- }
}
-
-$template->param( adultborrower => 1 ) if ( $category_type eq 'A' || $category_type eq 'I' );
-
my %bor;
$bor{'borrowernumber'} = $borrowernumber;
--