Lines 3531-3622
sub CalcDateDue {
Link Here
|
3531 |
} |
3531 |
} |
3532 |
|
3532 |
|
3533 |
|
3533 |
|
3534 |
=head2 CheckRepeatableHolidays |
|
|
3535 |
|
3536 |
$countrepeatable = CheckRepeatableHoliday($itemnumber,$week_day,$branchcode); |
3537 |
|
3538 |
This function checks if the date due is a repeatable holiday |
3539 |
|
3540 |
C<$date_due> = returndate calculate with no day check |
3541 |
C<$itemnumber> = itemnumber |
3542 |
C<$branchcode> = localisation of issue |
3543 |
|
3544 |
=cut |
3545 |
|
3546 |
sub CheckRepeatableHolidays{ |
3547 |
my($itemnumber,$week_day,$branchcode)=@_; |
3548 |
my $dbh = C4::Context->dbh; |
3549 |
my $query = qq|SELECT count(*) |
3550 |
FROM repeatable_holidays |
3551 |
WHERE branchcode=? |
3552 |
AND weekday=?|; |
3553 |
my $sth = $dbh->prepare($query); |
3554 |
$sth->execute($branchcode,$week_day); |
3555 |
my $result=$sth->fetchrow; |
3556 |
return $result; |
3557 |
} |
3558 |
|
3559 |
|
3560 |
=head2 CheckSpecialHolidays |
3561 |
|
3562 |
$countspecial = CheckSpecialHolidays($years,$month,$day,$itemnumber,$branchcode); |
3563 |
|
3564 |
This function check if the date is a special holiday |
3565 |
|
3566 |
C<$years> = the years of datedue |
3567 |
C<$month> = the month of datedue |
3568 |
C<$day> = the day of datedue |
3569 |
C<$itemnumber> = itemnumber |
3570 |
C<$branchcode> = localisation of issue |
3571 |
|
3572 |
=cut |
3573 |
|
3574 |
sub CheckSpecialHolidays{ |
3575 |
my ($years,$month,$day,$itemnumber,$branchcode) = @_; |
3576 |
my $dbh = C4::Context->dbh; |
3577 |
my $query=qq|SELECT count(*) |
3578 |
FROM `special_holidays` |
3579 |
WHERE year=? |
3580 |
AND month=? |
3581 |
AND day=? |
3582 |
AND branchcode=? |
3583 |
|; |
3584 |
my $sth = $dbh->prepare($query); |
3585 |
$sth->execute($years,$month,$day,$branchcode); |
3586 |
my $countspecial=$sth->fetchrow ; |
3587 |
return $countspecial; |
3588 |
} |
3589 |
|
3590 |
=head2 CheckRepeatableSpecialHolidays |
3591 |
|
3592 |
$countspecial = CheckRepeatableSpecialHolidays($month,$day,$itemnumber,$branchcode); |
3593 |
|
3594 |
This function check if the date is a repeatble special holidays |
3595 |
|
3596 |
C<$month> = the month of datedue |
3597 |
C<$day> = the day of datedue |
3598 |
C<$itemnumber> = itemnumber |
3599 |
C<$branchcode> = localisation of issue |
3600 |
|
3601 |
=cut |
3602 |
|
3603 |
sub CheckRepeatableSpecialHolidays{ |
3604 |
my ($month,$day,$itemnumber,$branchcode) = @_; |
3605 |
my $dbh = C4::Context->dbh; |
3606 |
my $query=qq|SELECT count(*) |
3607 |
FROM `repeatable_holidays` |
3608 |
WHERE month=? |
3609 |
AND day=? |
3610 |
AND branchcode=? |
3611 |
|; |
3612 |
my $sth = $dbh->prepare($query); |
3613 |
$sth->execute($month,$day,$branchcode); |
3614 |
my $countspecial=$sth->fetchrow ; |
3615 |
return $countspecial; |
3616 |
} |
3617 |
|
3618 |
|
3619 |
|
3620 |
sub CheckValidBarcode{ |
3534 |
sub CheckValidBarcode{ |
3621 |
my ($barcode) = @_; |
3535 |
my ($barcode) = @_; |
3622 |
my $dbh = C4::Context->dbh; |
3536 |
my $dbh = C4::Context->dbh; |
3623 |
- |
|
|