|
Lines 66-72
BEGIN {
Link Here
|
| 66 |
&GetLastOrderNotReceivedFromSubscriptionid &GetLastOrderReceivedFromSubscriptionid |
66 |
&GetLastOrderNotReceivedFromSubscriptionid &GetLastOrderReceivedFromSubscriptionid |
| 67 |
&ModItemOrder |
67 |
&ModItemOrder |
| 68 |
|
68 |
|
| 69 |
&GetParcels &GetParcel |
69 |
&GetParcels |
| 70 |
|
70 |
|
| 71 |
&GetInvoices |
71 |
&GetInvoices |
| 72 |
&GetInvoice |
72 |
&GetInvoice |
|
Lines 1896-1972
sub TransferOrder {
Link Here
|
| 1896 |
|
1896 |
|
| 1897 |
=head2 FUNCTIONS ABOUT PARCELS |
1897 |
=head2 FUNCTIONS ABOUT PARCELS |
| 1898 |
|
1898 |
|
| 1899 |
=cut |
|
|
| 1900 |
|
| 1901 |
#------------------------------------------------------------# |
| 1902 |
|
| 1903 |
=head3 GetParcel |
| 1904 |
|
| 1905 |
@results = &GetParcel($booksellerid, $code, $date); |
| 1906 |
|
| 1907 |
Looks up all of the received items from the supplier with the given |
| 1908 |
bookseller ID at the given date, for the given code (bookseller Invoice number). Ignores cancelled and completed orders. |
| 1909 |
|
| 1910 |
C<@results> is an array of references-to-hash. The keys of each element are fields from |
| 1911 |
the aqorders, biblio, and biblioitems tables of the Koha database. |
| 1912 |
|
| 1913 |
C<@results> is sorted alphabetically by book title. |
| 1914 |
|
| 1915 |
=cut |
| 1916 |
|
| 1917 |
sub GetParcel { |
| 1918 |
#gets all orders from a certain supplier, orders them alphabetically |
| 1919 |
my ( $supplierid, $code, $datereceived ) = @_; |
| 1920 |
my $dbh = C4::Context->dbh; |
| 1921 |
my @results = (); |
| 1922 |
$code .= '%' |
| 1923 |
if $code; # add % if we search on a given code (otherwise, let him empty) |
| 1924 |
my $strsth =" |
| 1925 |
SELECT authorisedby, |
| 1926 |
creationdate, |
| 1927 |
aqbasket.basketno, |
| 1928 |
closedate,surname, |
| 1929 |
firstname, |
| 1930 |
aqorders.biblionumber, |
| 1931 |
aqorders.ordernumber, |
| 1932 |
aqorders.parent_ordernumber, |
| 1933 |
aqorders.quantity, |
| 1934 |
aqorders.quantityreceived, |
| 1935 |
aqorders.unitprice, |
| 1936 |
aqorders.listprice, |
| 1937 |
aqorders.rrp, |
| 1938 |
aqorders.ecost, |
| 1939 |
aqorders.gstrate, |
| 1940 |
biblio.title |
| 1941 |
FROM aqorders |
| 1942 |
LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno |
| 1943 |
LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber |
| 1944 |
LEFT JOIN biblio ON aqorders.biblionumber=biblio.biblionumber |
| 1945 |
LEFT JOIN aqinvoices ON aqorders.invoiceid = aqinvoices.invoiceid |
| 1946 |
WHERE |
| 1947 |
aqbasket.booksellerid = ? |
| 1948 |
AND aqinvoices.invoicenumber LIKE ? |
| 1949 |
AND aqorders.datereceived = ? "; |
| 1950 |
|
| 1951 |
my @query_params = ( $supplierid, $code, $datereceived ); |
| 1952 |
if ( C4::Context->preference("IndependentBranches") ) { |
| 1953 |
unless ( C4::Context->IsSuperLibrarian() ) { |
| 1954 |
$strsth .= " and (borrowers.branchcode = ? |
| 1955 |
or borrowers.branchcode = '')"; |
| 1956 |
push @query_params, C4::Context->userenv->{branch}; |
| 1957 |
} |
| 1958 |
} |
| 1959 |
$strsth .= " ORDER BY aqbasket.basketno"; |
| 1960 |
my $result_set = $dbh->selectall_arrayref( |
| 1961 |
$strsth, |
| 1962 |
{ Slice => {} }, |
| 1963 |
@query_params); |
| 1964 |
|
| 1965 |
return @{$result_set}; |
| 1966 |
} |
| 1967 |
|
| 1968 |
#------------------------------------------------------------# |
| 1969 |
|
| 1970 |
=head3 GetParcels |
1899 |
=head3 GetParcels |
| 1971 |
|
1900 |
|
| 1972 |
$results = &GetParcels($bookseller, $order, $code, $datefrom, $dateto); |
1901 |
$results = &GetParcels($bookseller, $order, $code, $datefrom, $dateto); |
| 1973 |
- |
|
|