| 
      
            Lines 64-70
          SELECT
      
      
        Link Here
      
     | 
  
        
          | 64 | 
              aqinvoices.invoicenumber,  | 
          64 | 
              aqinvoices.invoicenumber,  | 
        
        
          | 65 | 
              quantityreceived,  | 
          65 | 
              quantityreceived,  | 
        
        
          | 66 | 
              unitprice,  | 
          66 | 
              unitprice,  | 
        
          
            
              | 67 | 
                  datereceived  | 
              67 | 
                  datereceived,  | 
            
            
               | 
               | 
              68 | 
                  aqbooksellers.name as vendorname  | 
            
        
          | 68 | 
          FROM (aqorders, aqbasket)  | 
          69 | 
          FROM (aqorders, aqbasket)  | 
        
        
          | 69 | 
          LEFT JOIN biblio ON  | 
          70 | 
          LEFT JOIN biblio ON  | 
        
        
          | 70 | 
              biblio.biblionumber=aqorders.biblionumber  | 
          71 | 
              biblio.biblionumber=aqorders.biblionumber  | 
        
  
    | 
      
            Lines 74-79
          LEFT JOIN items ON
      
      
        Link Here
      
     | 
  
        
          | 74 | 
              aqorders_items.itemnumber = items.itemnumber  | 
          75 | 
              aqorders_items.itemnumber = items.itemnumber  | 
        
        
          | 75 | 
          LEFT JOIN aqinvoices ON  | 
          76 | 
          LEFT JOIN aqinvoices ON  | 
        
        
          | 76 | 
              aqorders.invoiceid = aqinvoices.invoiceid  | 
          77 | 
              aqorders.invoiceid = aqinvoices.invoiceid  | 
        
            
               | 
               | 
              78 | 
              LEFT JOIN aqbooksellers ON  | 
            
            
              | 79 | 
                  aqbasket.booksellerid = aqbooksellers.id  | 
            
        
          | 77 | 
          WHERE  | 
          80 | 
          WHERE  | 
        
        
          | 78 | 
              aqorders.basketno=aqbasket.basketno AND  | 
          81 | 
              aqorders.basketno=aqbasket.basketno AND  | 
        
        
          | 79 | 
              budget_id=? AND  | 
          82 | 
              budget_id=? AND  | 
        
  
    | 
      
            Lines 93-100
          while ( my $data = $sth->fetchrow_hashref ) {
      
      
        Link Here
      
     | 
  
        
          | 93 | 
              my $recv = $data->{'quantityreceived'}; | 
          96 | 
              my $recv = $data->{'quantityreceived'}; | 
        
        
          | 94 | 
              if ( $recv > 0 ) { | 
          97 | 
              if ( $recv > 0 ) { | 
        
        
          | 95 | 
                  my $rowtotal = $recv * $data->{'unitprice'}; | 
          98 | 
                  my $rowtotal = $recv * $data->{'unitprice'}; | 
        
          
            
              | 96 | 
                      $data->{'rowtotal'}  = sprintf( "%.2f", $rowtotal ); | 
              99 | 
                      $data->{'rowtotal'}  = $rowtotal; | 
            
            
              | 97 | 
                      $data->{'unitprice'} = sprintf( "%.2f", $data->{'unitprice'} ); | 
               | 
               | 
            
        
          | 98 | 
                  $subtotal += $rowtotal;  | 
          100 | 
                  $subtotal += $rowtotal;  | 
        
        
          | 99 | 
                  push @spent, $data;  | 
          101 | 
                  push @spent, $data;  | 
        
        
          | 100 | 
              }  | 
          102 | 
              }  | 
        
  
    | 
      
            Lines 112-118
          $sth->execute($bookfund);
      
      
        Link Here
      
     | 
  
        
          | 112 | 
          my @shipmentcosts;  | 
          114 | 
          my @shipmentcosts;  | 
        
        
          | 113 | 
          while (my $data = $sth->fetchrow_hashref) { | 
          115 | 
          while (my $data = $sth->fetchrow_hashref) { | 
        
        
          | 114 | 
              push @shipmentcosts, { | 
          116 | 
              push @shipmentcosts, { | 
        
          
            
              | 115 | 
                      shipmentcost => sprintf("%.2f", $data->{shipmentcost}), | 
              117 | 
                      shipmentcost => $data->{shipmentcost}, | 
            
        
          | 116 | 
                  invoicenumber => $data->{invoicenumber} | 
          118 | 
                  invoicenumber => $data->{invoicenumber} | 
        
        
          | 117 | 
              };  | 
          119 | 
              };  | 
        
        
          | 118 | 
              $total += $data->{shipmentcost}; | 
          120 | 
              $total += $data->{shipmentcost}; | 
        
  
    | 
      
            Lines 124-131
          while ( my $adj = $adjustments->next ){
      
      
        Link Here
      
     | 
  
        
          | 124 | 
              $total += $adj->adjustment;  | 
          126 | 
              $total += $adj->adjustment;  | 
        
        
          | 125 | 
          }  | 
          127 | 
          }  | 
        
        
          | 126 | 
           | 
          128 | 
           | 
        
            
              | 127 | 
              $total = sprintf( "%.2f", $total );  | 
               | 
               | 
            
            
              | 128 | 
               | 
            
        
          | 129 | 
          $template->param(  | 
          129 | 
          $template->param(  | 
        
        
          | 130 | 
              fund => $bookfund,  | 
          130 | 
              fund => $bookfund,  | 
        
        
          | 131 | 
              spent => \@spent,  | 
          131 | 
              spent => \@spent,  |