X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FAcquisition.pm;h=0a96a02c4f78d52e645a13eeee5dfca948b154bf;hb=03eea72de3973595b4ea03080d083fb31cf4215b;hp=2814977575320fbb52525dce12777ab1b2ea73ff;hpb=c13d3f0043324ca9625128b25c9edba7b41ebd7f;p=koha_gimpoz diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 2814977575..0a96a02c4f 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -62,6 +62,8 @@ BEGIN { &GetContracts &GetContract &GetItemnumbersFromOrder + + &AddClaim ); } @@ -924,7 +926,6 @@ sub NewOrder { =cut sub NewOrderItem { - #my ($biblioitemnumber,$ordernumber, $biblionumber) = @_; my ($itemnumber, $ordernumber) = @_; my $dbh = C4::Context->dbh; my $query = qq| @@ -1106,16 +1107,13 @@ sub ModReceiveOrder { ) = @_; my $dbh = C4::Context->dbh; -# warn "DATE BEFORE : $daterecieved"; -# $daterecieved=POSIX::strftime("%Y-%m-%d",CORE::localtime) unless $daterecieved; -# warn "DATE REC : $daterecieved"; $datereceived = C4::Dates->output('iso') unless $datereceived; my $suggestionid = GetSuggestionFromBiblionumber( $dbh, $biblionumber ); if ($suggestionid) { ModSuggestion( {suggestionid=>$suggestionid, - STATUS=>'AVAILABLE', - biblionumber=> $biblionumber} - ); + STATUS=>'AVAILABLE', + biblionumber=> $biblionumber} + ); } my $sth=$dbh->prepare(" @@ -1453,9 +1451,12 @@ sub GetLateOrders { DATE(aqbasket.closedate) AS orderdate, aqorders.rrp AS unitpricesupplier, aqorders.ecost AS unitpricelib, + aqorders.claims_count AS claims_count, + aqorders.claimed_date AS claimed_date, aqbudgets.budget_name AS budget, borrowers.branchcode AS branch, aqbooksellers.name AS supplier, + aqbooksellers.id AS supplierid, biblio.author, biblio.title, biblioitems.publishercode AS publisher, biblioitems.publicationyear, @@ -1517,6 +1518,7 @@ sub GetLateOrders { my @results; while (my $data = $sth->fetchrow_hashref) { $data->{orderdate} = format_date($data->{orderdate}); + $data->{claimed_date} = format_date($data->{claimed_date}); push @results, $data; } return @results; @@ -1676,8 +1678,6 @@ sub GetHistory { $line->{count} = $cnt++; $line->{toggle} = 1 if $cnt % 2; push @order_loop, $line; - $line->{creationdate} = format_date( $line->{creationdate} ); - $line->{datereceived} = format_date( $line->{datereceived} ); $total_qty += $line->{'quantity'}; $total_qtyreceived += $line->{'quantityreceived'}; $total_price += $line->{'quantity'} * $line->{'ecost'}; @@ -1779,6 +1779,31 @@ sub GetContract { return $result; } +=head3 AddClaim + +=over 4 + +&AddClaim($ordernumber); + +Add a claim for an order + +=back + +=cut +sub AddClaim { + my ($ordernumber) = @_; + my $dbh = C4::Context->dbh; + my $query = " + UPDATE aqorders SET + claims_count = claims_count + 1, + claimed_date = CURDATE() + WHERE ordernumber = ? + "; + my $sth = $dbh->prepare($query); + $sth->execute($ordernumber); + +} + 1; __END__