displaying partrially shipped CO's

Chris Kelleher

Administrator
Staff member
> Dear Pegsters,
>
> I'm new to progress and programming in general (B.S. in Geology.) I have
> been programming in Symix for about 6 months (not continuously though) and
> have run into a problem that seems like it should be easy to solve. I just
> can't seem to make it work! I'm trying to write a report that will only
> display Customer Orders that have at leaset 1 Line item that has been
> shipped or partially shipped. I can make the report display all CO's that
> have orders pending but trying to add the code that will disregard the
CO's
> that don't have any Line Items that have been shipped has been
troublesome.
> The last time I worked on this was almost a month ago and I didn't keep a
> record of what I tried. I know I've tried to assign variables to the
> status(O,C, P, F) and tried using the co-ship but those didn't work. I
just
> can't seem to put my finger on what programming goof-up I'm doing!
>
> Thanks for any suggestions,
> Nick P.
> nicholas@ix.netcom.com
>
> P.S. Our conversion from Symix 3.0 to Symix 4.1 went pretty smoothly and
> we've worked out most of the kinks. Thanks to everyone who helped and
> reassured me it wouldn't be a nightmare!
>
 

Chris Kelleher

Administrator
Staff member
what about something like this -

for each coitem
where coitem.qty-ordered <> qty-shipped
and coitem.qty-shipped <> 0


darrin
 

Chris Kelleher

Administrator
Staff member
Nicholas Penton wrote:

I'm trying to write a report that will only
> > display Customer Orders that have at leaset 1 Line item that has been
> > shipped or partially shipped.

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
for each co no-lock
where can-find(first coitem
where coitem.co-num = co.co-num
and coitem.qty-shipped > 0):
[/code]

This was a quick code - but consider that some of the co might have
already be put to history - you should pull those order too!

The code above is probably sufficient but if you want to include history
you should:
1. go through both co and coh (and associated coitem and citemh) and
built a temp-table.

2. report using that temp-table so it would be sorted.

Jake Kacher
 

Chris Kelleher

Administrator
Staff member
I think there is a little more clarification needed on my part.

I can generate a report that will show all CO Line items in the Ordered
status but I only want to display the CO Lines (with status = Ordered) that
have had at least one other Line Item shipped or partially shipped.

For example: if an order had 5 Line Items and none of them were shipped,
then these Lines shouldn't show up in the report. If 1 Line was partially
shipped (qty-shipped > 0, qty-shipped < qty-ordered) but the other 4
weren't, then all the other Lines in this order will be displayed. If only
1 Line was fully shipped and the other 4 weren't, then only the other 4
Lines would appear in the report.

Thanks for all your help,

Nick
 

Chris Kelleher

Administrator
Staff member
sounds like you'd need a buffer -

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
def buffer x-co for co.

for each co
conditions blah blach
:
for each x-co
where x-co.co-num = co.co-num
and x-co.co-line = co.co-line
[/code]

darrin
 

Chris Kelleher

Administrator
Staff member
<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
define buffer b-coitem for symix.coitem.

for each co no-lock
where co.stat = "O",
each coitem no-lock
where coitem.co-num = co.co-num:

if can-find(first b-coitem no-lock
where b-coitem.co-num = co.co-num
and b-coitem.qty-shipped > 0
and b-coitem.qty-shipped < coitem.qty-ordered
and b-coitem.co-line <> coitem.co-line)
then
display
coitem.co-line
coitem.item
coitem.qty-ordered
coitem.qty-shipped.
end.
[/code]

Patrick T. Gordon
Senior Software Engineer
Software Services
Symix Computer Systems, Inc.
Columbus, OH 43231
Phone: 614/523-7000
Fax: 614/895-1195
 

Chris Kelleher

Administrator
Staff member
I already replied the solution yesterday:

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
for each co no-lock
where not can-find(first coitem
where coitem.co-num = co.co-num
and coitem.qty-shipped > 0),
each coitem no-lock
where coitem.co-num = co.co-num:

displ
co.co-num
coitem.co-line
coitem.qty-ordered
coitem.qty-shipped
[/code]

Jake Kacher
 

Chris Kelleher

Administrator
Staff member
After a few mods (and learning about temp-tables) this program pulled the
right kind of data that I needed but it didn't pull all of them for some
reason. It retrieved around 250 of 390 files.

Anyone have any ideas as to why it would do this?

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
define buffer b-coitem for symix.coitem.
for each coitem no-lock where coitem.stat = "O",
each co no-lock where co.co-num = coitem.co-num,
each item no-lock where item.item = coitem.item
break by co.co-num by coitem.co-line:

if can-find(first b-coitem no-lock
where b-coitem.co-num = co.co-num
and b-coitem.qty-shipped > 0
and b-coitem.qty-shipped < coitem.qty-ordered
/*and b-coitem.co-line <> coitem.co-line*/)

then
display
co.cust-num
co.co-num
coitem.co-line
co.stat
coitem.item format "x(10)"
item.description format "x(18)"
coitem.qty-shipped format "-z,zzz,zz9"
coitem.qty-ordered format "-z,zzz,zz9"
(coitem.qty-ordered - coitem.qty-shipped)
label "Backorder"
co.order-date
coitem.due-date
co.est-num label "Auth Code"
with width 132.
end.

[/code]

TIA
Nicholas
 

Chris Kelleher

Administrator
Staff member
Difference between coitem.stat and co.stat ?
Shipping changes the coitem stat to F until it is invoiced ...

Eric.
 

Chris Kelleher

Administrator
Staff member
I keep struggling understanding the logic of displaying only orders that have
any shipped quantity - if the order is late for a year and nothing was shipped
whatsoever they do not want to see it while more recent orders are shown.

I am beginning to suspect that this was a test, an exercise that the testee was
enterprising enough to pass along to us.

Jake Kacher
 

Chris Kelleher

Administrator
Staff member
This report is in addition to another report that displays all items in
ordered status which is usually around 50 pages. They wanted a quick easy
to read report, which was also similar to a report generated by their prev
inv system, to show which orders have started to ship but have not completly
shipped. They could then get the ball rolling as to getting those other
items shipped or have answers as to why those items haven't shipped.

Nick
 

Chris Kelleher

Administrator
Staff member
This works for me.

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
DEF BUFFER bu-coship FOR symix.co-ship.

FOR EACH symix.coitem WHERE
coitem.stat = "O" NO-LOCK,
EACH symix.co WHERE
co.co-num = coitem.co-num AND
co.stat = "O" NO-LOCK:

FIND FIRST bu-coship WHERE
bu-coship.co-num = co.co-num NO-LOCK NO-ERROR.
IF NOT AVAIL bu-coship THEN NEXT.
[/code]

Lee Timar
SysAdmin
Race Face Components
 

Chris Kelleher

Administrator
Staff member
Or, you could always give this a try:

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
for each symix.co no-lock /* Only do open orders */
where co.stat = "O",
first symix.co-ship no-lock /*Only orders that have a shipment record */
where symix.co-ship.co-num = symix.co.co-num,
each symix.coitem no-lock /* Show All Lines */
where symix.coitem.co-num = symix.co.co-num
and symix.coitem.stat = "O":

/*display-etc!*/

end.
[/code]

_______________________________________________
Jeff Smith
Product Developer
Single Source Systems Phone: 317-596-3000 Ext: 175
9003 Technology Dr. Fax: 317-596-3001
Fishers, IN 46038 jefsmi@singlesrc.com

The Developers of FS-Plus
 
Top