Lines 1780-1786
sub AddReturn {
Link Here
|
1780 |
} |
1780 |
} |
1781 |
|
1781 |
|
1782 |
# case of a return of document (deal with issues and holdingbranch) |
1782 |
# case of a return of document (deal with issues and holdingbranch) |
1783 |
my $today = dt_from_string( $return_date, 'iso' ); |
1783 |
|
|
|
1784 |
# If $return_date was not passed in, we will get back our current date/time |
1785 |
my $return_date_dt = dt_from_string( $return_date, 'iso' ); |
1784 |
|
1786 |
|
1785 |
if ($doreturn) { |
1787 |
if ($doreturn) { |
1786 |
my $datedue = $issue->{date_due}; |
1788 |
my $datedue = $issue->{date_due}; |
Lines 1792-1798
sub AddReturn {
Link Here
|
1792 |
# FIXME: check issuedate > returndate, factoring in holidays |
1794 |
# FIXME: check issuedate > returndate, factoring in holidays |
1793 |
#$circControlBranch = _GetCircControlBranch($item,$borrower) unless ( $item->{'issuedate'} eq C4::Dates->today('iso') );; |
1795 |
#$circControlBranch = _GetCircControlBranch($item,$borrower) unless ( $item->{'issuedate'} eq C4::Dates->today('iso') );; |
1794 |
$circControlBranch = _GetCircControlBranch($item,$borrower); |
1796 |
$circControlBranch = _GetCircControlBranch($item,$borrower); |
1795 |
$issue->{'overdue'} = DateTime->compare($issue->{'date_due'}, $today ) == -1 ? 1 : 0; |
1797 |
$issue->{'overdue'} = DateTime->compare($issue->{'date_due'}, $return_date_dt ) == -1 ? 1 : 0; |
1796 |
} |
1798 |
} |
1797 |
|
1799 |
|
1798 |
if ($borrowernumber) { |
1800 |
if ($borrowernumber) { |
Lines 1805-1816
sub AddReturn {
Link Here
|
1805 |
: ( $control eq 'PatronLibrary' ) ? $borrower->{branchcode} |
1807 |
: ( $control eq 'PatronLibrary' ) ? $borrower->{branchcode} |
1806 |
: $issue->{branchcode}; |
1808 |
: $issue->{branchcode}; |
1807 |
|
1809 |
|
1808 |
my $date_returned = |
|
|
1809 |
$return_date ? dt_from_string($return_date) : $today; |
1810 |
|
1811 |
my ( $amount, $type, $unitcounttotal ) = |
1810 |
my ( $amount, $type, $unitcounttotal ) = |
1812 |
C4::Overdues::CalcFine( $item, $borrower->{categorycode}, |
1811 |
C4::Overdues::CalcFine( $item, $borrower->{categorycode}, |
1813 |
$control_branchcode, $datedue, $date_returned ); |
1812 |
$control_branchcode, $datedue, $return_date_dt ); |
1814 |
|
1813 |
|
1815 |
$type ||= q{}; |
1814 |
$type ||= q{}; |
1816 |
|
1815 |
|
Lines 1890-1896
sub AddReturn {
Link Here
|
1890 |
|
1889 |
|
1891 |
if ( $issue->{overdue} && $issue->{date_due} ) { |
1890 |
if ( $issue->{overdue} && $issue->{date_due} ) { |
1892 |
# fix fine days |
1891 |
# fix fine days |
1893 |
my ($debardate,$reminder) = _debar_user_on_return( $borrower, $item, $issue->{date_due}, $today ); |
1892 |
my ($debardate,$reminder) = _debar_user_on_return( $borrower, $item, $issue->{date_due}, $return_date_dt ); |
1894 |
if ($reminder){ |
1893 |
if ($reminder){ |
1895 |
$messages->{'PrevDebarred'} = $debardate; |
1894 |
$messages->{'PrevDebarred'} = $debardate; |
1896 |
} else { |
1895 |
} else { |
Lines 1900-1907
sub AddReturn {
Link Here
|
1900 |
} elsif ( $issue->{date_due} and $borrower->{'debarred'} ) { |
1899 |
} elsif ( $issue->{date_due} and $borrower->{'debarred'} ) { |
1901 |
my $borrower_debar_dt = dt_from_string( $borrower->{debarred} ); |
1900 |
my $borrower_debar_dt = dt_from_string( $borrower->{debarred} ); |
1902 |
$borrower_debar_dt->truncate(to => 'day'); |
1901 |
$borrower_debar_dt->truncate(to => 'day'); |
1903 |
my $today_dt = $today->clone()->truncate(to => 'day'); |
1902 |
my $return_date_dt_clone = $return_date_dt->clone()->truncate(to => 'day'); |
1904 |
if ( DateTime->compare( $borrower_debar_dt, $today_dt ) != -1 ) { |
1903 |
if ( DateTime->compare( $borrower_debar_dt, $return_date_dt_clone ) != -1 ) { |
1905 |
$messages->{'PrevDebarred'} = $borrower->{'debarred'}; |
1904 |
$messages->{'PrevDebarred'} = $borrower->{'debarred'}; |
1906 |
} |
1905 |
} |
1907 |
} |
1906 |
} |
1908 |
- |
|
|