Lines 2156-2161
sub AddClaim {
Link Here
|
2156 |
|
2156 |
|
2157 |
my @invoices = GetInvoices( |
2157 |
my @invoices = GetInvoices( |
2158 |
invoicenumber => $invoicenumber, |
2158 |
invoicenumber => $invoicenumber, |
|
|
2159 |
supplierid => $supplierid, |
2159 |
suppliername => $suppliername, |
2160 |
suppliername => $suppliername, |
2160 |
shipmentdatefrom => $shipmentdatefrom, # ISO format |
2161 |
shipmentdatefrom => $shipmentdatefrom, # ISO format |
2161 |
shipmentdateto => $shipmentdateto, # ISO format |
2162 |
shipmentdateto => $shipmentdateto, # ISO format |
Lines 2200-2205
sub GetInvoices {
Link Here
|
2200 |
FROM aqinvoices |
2201 |
FROM aqinvoices |
2201 |
LEFT JOIN aqbooksellers ON aqbooksellers.id = aqinvoices.booksellerid |
2202 |
LEFT JOIN aqbooksellers ON aqbooksellers.id = aqinvoices.booksellerid |
2202 |
LEFT JOIN aqorders ON aqorders.invoiceid = aqinvoices.invoiceid |
2203 |
LEFT JOIN aqorders ON aqorders.invoiceid = aqinvoices.invoiceid |
|
|
2204 |
LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno |
2205 |
LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber |
2203 |
LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber |
2206 |
LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber |
2204 |
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber |
2207 |
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber |
2205 |
LEFT JOIN subscription ON biblio.biblionumber = subscription.biblionumber |
2208 |
LEFT JOIN subscription ON biblio.biblionumber = subscription.biblionumber |
Lines 2220-2230
sub GetInvoices {
Link Here
|
2220 |
push @bind_args, "%$args{suppliername}%"; |
2223 |
push @bind_args, "%$args{suppliername}%"; |
2221 |
} |
2224 |
} |
2222 |
if($args{shipmentdatefrom}) { |
2225 |
if($args{shipmentdatefrom}) { |
2223 |
push @bind_strs, " aqinvoices.shipementdate >= ? "; |
2226 |
push @bind_strs, " aqinvoices.shipmentdate >= ? "; |
2224 |
push @bind_args, $args{shipmentdatefrom}; |
2227 |
push @bind_args, $args{shipmentdatefrom}; |
2225 |
} |
2228 |
} |
2226 |
if($args{shipmentdateto}) { |
2229 |
if($args{shipmentdateto}) { |
2227 |
push @bind_strs, " aqinvoices.shipementdate <= ? "; |
2230 |
push @bind_strs, " aqinvoices.shipmentdate <= ? "; |
2228 |
push @bind_args, $args{shipmentdateto}; |
2231 |
push @bind_args, $args{shipmentdateto}; |
2229 |
} |
2232 |
} |
2230 |
if($args{billingdatefrom}) { |
2233 |
if($args{billingdatefrom}) { |
Lines 2256-2262
sub GetInvoices {
Link Here
|
2256 |
push @bind_args, $args{publicationyear}; |
2259 |
push @bind_args, $args{publicationyear}; |
2257 |
} |
2260 |
} |
2258 |
if($args{branchcode}) { |
2261 |
if($args{branchcode}) { |
2259 |
push @bind_strs, " aqorders.branchcode = ? "; |
2262 |
push @bind_strs, " borrowers.branchcode = ? "; |
2260 |
push @bind_args, $args{branchcode}; |
2263 |
push @bind_args, $args{branchcode}; |
2261 |
} |
2264 |
} |
2262 |
|
2265 |
|