Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Picking List: only the first item of an order is printed
12-15-2017, 07:01 AM
Post: #7
RE: Picking List: only the first item of an order is printed
(12-15-2017 03:04 AM)VortecCPI Wrote:  I suggest you echo the $sql variable to the screen and start by looking at that.

That's what I'm doing.
I have two orders that are printed on the picking list, each has two lines

the screen echo renders one query for the first order, then another query for the second order. But each query doesn't loop through the entire order, only the first line: here are orders 30 and 31 each should have two items

Code:
SELECT salesorderdetails.stkcode, stockmaster.description, salesorderdetails.orderlineno, salesorderdetails.quantity, salesorderdetails.qtyinvoiced, SUM(pickinglistdetails.qtyexpected) as qtyexpected, SUM(pickinglistdetails.qtypicked) as qtypicked, salesorderdetails.unitprice, salesorderdetails.narrative, stockmaster.decimalplaces FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid LEFT JOIN pickinglists ON salesorderdetails.orderno=pickinglists.orderno LEFT JOIN pickinglistdetails ON pickinglists.pickinglistno=pickinglistdetails.pickinglistno WHERE salesorderdetails.orderno='30' AND salesorderdetails.orderlineno=pickinglistdetails.orderlineno

SELECT salesorderdetails.stkcode, stockmaster.description, salesorderdetails.orderlineno, salesorderdetails.quantity, salesorderdetails.qtyinvoiced, SUM(pickinglistdetails.qtyexpected) as qtyexpected, SUM(pickinglistdetails.qtypicked) as qtypicked, salesorderdetails.unitprice, salesorderdetails.narrative, stockmaster.decimalplaces FROM salesorderdetails INNER JOIN stockmaster ON salesorderdetails.stkcode=stockmaster.stockid LEFT JOIN pickinglists ON salesorderdetails.orderno=pickinglists.orderno LEFT JOIN pickinglistdetails ON pickinglists.pickinglistno=pickinglistdetails.pickinglistno WHERE salesorderdetails.orderno='31' AND salesorderdetails.orderlineno=pickinglistdetails.orderlineno
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Picking List: only the first item of an order is printed - HDeriauFF - 12-15-2017 07:01 AM

Forum Jump:


User(s) browsing this thread: 2 Guest(s)