Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Well my logic breaks on this one and I know it can be better also. LineItems holds Quantity (number) of 'eaches' sold. Products holds QtyPerCase (number) of how many are in a case. Joined on ProductID.

Packing Slip requirements: Currently we just display eaches (only the Quantity field). Owner wants it changed to display total 'cases' and 'eaches'. What I have (yep, ugly) ...

Let(

[

cs = Div(Qty; Products::QtyPerCase) ;

ea = Qty / Products::QtyPerCase - cs

]

;

Case(

ea > 0 ; cs & " Cases, " & ea & " Eaches";

cs = 1; cs & " Case";

not cs; ea & " Eaches";

cs & " Cases")

)

If Quantity is 1 and QtyPerCase is 12 it displays as: 0 Cases, .0833333 Eaches. Geez. Need to fix the eaches and I'd like to eliminate the cases portion if it's under a case also. I got myself a bit lost. Does it show? crazy.gif

LaRetta

Try:

Let ( [

cs = Div ( Quantity ; QtyPerCase ) ;

pc = Mod ( Quantity ; QtyPerCase )

] ;

Case ( cs ; cs & " Case" & Case ( cs - 1 ; "s" ) ) &

Case ( pc ; Case ( cs ; ", " ) & pc & " Piece" & Case ( pc - 1 ; "s" ) )

)

And pardon me for changing the vocabulary - I've never heard of "eaches".

If Quantity = 25, you'd get "2 Cases, 1 Each", which to me means "Let's you and I get some beer - 2 cases, one each".

Blackstuff.gif

  • Author

I had tried using Mod() on the ... errr pieces portion. Oh! This means I'm *getting* it but just not quite *getting* it!! YAY!!! smile.gif

And I couldn't remember how you and JT and Ray split the (s) for single/plural in the Case() portion. Maybe I'll remember it now.

Yep, I had asked Owner about that wording ... biglaff.gif

It isn't 'bottles' because sometimes it could be tabs, etc. Eaches is all we could think of - pieces is perfect!

I will thank you in advance for the calculation, Michael. I have absolutely no doubt that it's perfect.

LaRetta

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.