reichwaldl14 Posted October 12, 2011 Posted October 12, 2011 Is there a way to format a layout so that it will dynamically change when printing a receipt? I am in the process of creating a POS for a quick service restaurant where the receipt needs to show any modifications to the customers order? As of now, I am contemplating building a field which would build the order in html to print, but that doesn't sound efficient. I was hoping someone could point me in a direction where this could all be handled within filemaker. Here's an example. A customer orders 3 lattes, one with 2% milk and no foam, one with skim mik and caramel the other just normal... Receipt says: Latte........$3.50 Skim Caramel Latte........$3.50 No Foam 2% Latte........$3.50 Subtotal...$10.50 I need to receipt to be able to dynamically change so that any order with modifications will be reflected this way. Ideas?
Vaughan Posted October 12, 2011 Posted October 12, 2011 This is a data entry issue, not a layout issue. Each item purchased should have a list of options that can be selected. These can then be printed on the receipt.
reichwaldl14 Posted October 13, 2011 Author Posted October 13, 2011 And that is how they are set up. Each Line item has a related table with all of the modifiers that have been selected. I am working on having the printed receipt show these modifiers when they are present, but not when they haven't been selected. (i.e. I don't want to have an inch and a half of blank space on the receipt below each line item when there is nothing to print.)
IdealData Posted October 13, 2011 Posted October 13, 2011 Each line item should be recorded as a separate record - in your example there should be 7 records. The receipt layout needs to be sorted to reflect the desired order of items. There will be no blank spaces as the receipt layout should be based on the line items.
reichwaldl14 Posted October 13, 2011 Author Posted October 13, 2011 Great, Thank You IdealData. I've been stuck in a rut of thinking about this the wrong way. Just needed an a new perspective.
reichwaldl14 Posted October 13, 2011 Author Posted October 13, 2011 OK quick question, How do you print a variable length receipt with a footer for subtotal and total? I can only get it to print a certain length...
reichwaldl14 Posted October 13, 2011 Author Posted October 13, 2011 Nevermind, got it. Stupid questions should be googled first. Thanks for both of your helps!
wedgeman Posted November 20, 2013 Posted November 20, 2013 Nevermind, got it. Stupid questions should be googled first. Thanks for both of your helps! well, this is gonna make me sound/feel stupid, but apparently my google fu is rather weak... I'm trying to do exactly that--make a receipt which changes length based upon the number of items in the invoice.. This is essentlially a POS receipt thermal printer, and I'm trying to make the lenght of the printed receipt be relative to the number of items on the invoice.... The invoice/receipt layout is based on a portal from "invoiceitems" table, which are layed out on the receipt... am working in a mixed version environment--several users on 11 and 12, but the server is on 9.03.. any help would be greatly appreciated! the only initial idea I've had is to replicate the receipt layout multiple times with multiple qty of invoice items, then do a row count of related invoiceitems, then choose the corresponding layout... can somebody toss a bone my way?? thx!
doughemi Posted November 20, 2013 Posted November 20, 2013 Create your receipt layout as a list view in your invoice items table, not in a portal. Use Go To Related Records starting from your customer record (using the same relationship as your portal) to populate the invoice. In the header section of the receipt layout, place customer info from the related fields in the customer table.
wedgeman Posted November 20, 2013 Posted November 20, 2013 wow, thx for the fast response! that makes sense completely.. Only one more question (somewhat related on this): how do you get your printer layout to accurately reflect the length of the list? do you set the page layout to a very short page, so it just prints x number of pages until it prints the whole thing?
brian rich Posted November 20, 2013 Posted November 20, 2013 I assume that the receipt will consist of several blocks of text such as restaurant header, item details, cash tendered and so on. You want the item details text block to just accomodate the items purchased, and the cash tendered block to be immediately below this. This can be handled easily using Filemaker's ability to slide layout items when printing, and also allowing them to reduce to the size of the text they enclose. Set the item details field to slide up and to adjust to the size of the enclosing part, and the cash tendered block below it to slide up as well. You may find it easier to build the receipt data into a set of temporary variables and print using these. Have you looked at Virtual Lists as a way of solving this? Bruce Robertson developed the technique back about 2009 - I can't find his original posts but there is an example file here which might help http://fmlayoutmode.com/wp/?p=1799 HTH Brian
wedgeman Posted November 27, 2013 Posted November 27, 2013 ok, i've tried this numerous ways. 1. a form view in Invoice table, with items as a portal.. - doing this i have to make multiple forms of multiple lengths, do multiple page length layouts with various length portals (zebra printer lengths, say 3.25x6", 3.25x7", etc), then choose between them based on the qty of items in the portal ... restuts work but require numerous diferent lenth layouts, a counting operation, etc..... 2. I tried a list view in the InvoiceItems table, but (n00b here!), can' get it to print all records at the same time.. still not sure what i've done wrong in that..... layout looks great (on the screen), but wll only print ONE record per page! I chose "print all", "all records', etc.... what am i doing wrong?
doughemi Posted November 27, 2013 Posted November 27, 2013 #1 Forget about the portal--it'll only give you angina. #2 Make sure the layout is set for View as List, not View as Form in the View menu.
wedgeman Posted November 27, 2013 Posted November 27, 2013 thx.. yes, i fully understand the direct show as a LIST view.. I've turned off FORM and tABLE views, and showing only as list. The issue is that when it prints, it shows the header area (with customer data) and the footer (grand trailing summary) with final info, but only shows ONE record in the BODY area.... go figure. during the print process I'm choosing "print all", "ALL records", and have gone back thru this process a dozen times, rather unsuccessfully. I *AM* becoming proficient at pulling my hair out though! Any thooughts? #1 Forget about the portal--it'll only give you angina. #2 Make sure the layout is set for View as List, not View as Form in the View menu.
LaRetta Posted November 27, 2013 Posted November 27, 2013 The issue is that when it prints, it shows the header area (with customer data) and the footer (grand trailing summary) with final info, but only shows ONE record in the BODY area.... go figure. Do you have sub-summary part? Have you sorted by this part? Have you selected all items and set them to slide up? It would help if you provided a screen shot in layout mode of your layout in the InvoiceItems or SOME information so we can SEE what you are doing. Otherwise we are throwing darts at a dartboard and, I don't know about others, but I'm a terrible shot blindfolded. :-)
comment Posted November 27, 2013 Posted November 27, 2013 This is essentlially a POS receipt thermal printer, and I'm trying to make the lenght of the printed receipt be relative to the number of items on the invoice.... I think you ought to do separate troubleshooting for the file and for the printer. What do you see when you switch to preview mode? If you see multiple records per page, than the problem is (very likely) with the printer. I'm afraid I don't know enough about thermal printers to be more specific. There seems to be a requirement for "unlimited" page size here - I am not sure how you tell Filemaker something like that.
wedgeman Posted November 27, 2013 Posted November 27, 2013 Do you have sub-summary part?  Have you sorted by this part?  Have you selected all items and set them to slide up?   It would help if you provided a screen shot in layout mode of your layout in the InvoiceItems or SOME information so we can SEE what you are doing.  Otherwise we are throwing darts at a dartboard and, I don't know about others, but I'm a terrible shot blindfolded. :-)  thanks for the note.  in the header, i have the related Invoice ID record locator - that's how i "create the record" for the client. THen the records in the list (iinvoiceitems table) are each records which have that same invoiceID on them... So they show up as unique records in the list view.  Sorry-i didn't know i could post an image.... will figure that out shortly..   NOTE: a slight error was just noted: I mentioned previously that the footer was a grandtrailing summary.. it's not.. i'm running it as a 'footer", and getting the invoice totals & tax data from the Invoice table (separate table) based on the InvoiceID relationship.....      I think you ought to do separate troubleshooting for the file and for the printer. What do you see when you switch to preview mode? If you see multiple records per page, than the problem is (very likely) with the printer. I'm afraid I don't know enough about thermal printers to be more specific. There seems to be a requirement for "unlimited" page size here - I am not sure how you tell Filemaker something like that.  this brings up TWO issues. 1. the page layout seems to be what is determinning the legnth of the actual receipt... so if i make a 'paper' that's 3.25x4" long, the receipt will print on it.. but i really need a variable length (because the printer can print essentially ANY reasonable length of a page).. So how do I tell the printer what length to run on (ie., how does the printer know the length of a sheet of paper)?? Do i have to create multiple lengths for Page Setup, then choose each based on the # of records? or is there a better way to do this?   2. I'm trying this out on both a thermal printer AND a conventional letter sized laser, using conventional paper.. it's printing the same on both pages..   Images below:  1. this is the List view layout as recommended above, shown in edit mode. 2. This is the same, seen in browse mode.... 3. this is how it looks when actually printed..... only ONE record shows up. AND it doesn't "slide up" to keep the sheet clean...
comment Posted November 27, 2013 Posted November 27, 2013 I'm trying this out on both a thermal printer AND a conventional letter sized laser, using conventional paper.. it's printing the same on both pages.. Then it's probably not related to the printer (or you haven't got to the issues related to the printer yet...). It would probably be best if you posted your file or - preferably - a simplified version thereof. Otherwise we could be here all week.
LaRetta Posted November 27, 2013 Posted November 27, 2013 I see no leading sub-summary part. Your InvoiceID must be in sub-summary and sort by it as well. And did you select all objects and set them to slide up and also check 'resize enclosing part'? As Michael says, seeing the actual file might be quickest. Hey, we'll help you figure it out; no worries.
wedgeman Posted November 27, 2013 Posted November 27, 2013 Ok, it's attached here.. user name is x password is x invoice.fp7.zip
comment Posted November 27, 2013 Posted November 27, 2013 I have a better idea: try reproducing the problem in a new file. Or download the file from here and see how that goes: http://fmforums.com/forum/showpost.php?post/309136/
Lee Smith Posted November 27, 2013 Posted November 27, 2013 The easiest way is to save a copy the file as a "no record" or to save a copy and remove any confidential information.
wedgeman Posted November 27, 2013 Posted November 27, 2013 invoice.fp7.zip username & password are both x Please confirm that this is all you need.... thx!
wedgeman Posted November 28, 2013 Posted November 28, 2013 I have a better idea: try reproducing the problem in a new file. Or download the file from here and see how that goes: http://fmforums.com/forum/showpost.php?post/309136/ Thx... I tried this copy. 1. They don't show totals/summaries in this layout. And their location for totals is in the Invoices (just like mine), but when installed in either theFooter or Trailing Summary, it doesn't appear either. 2. BUT it does show all related records in the print, whereas mine shows only ONE at a time.... i've tried adding a few things ontheirs to get it to work, but unsucessful.... 3. I'm still at an impasse on how to force FM to get my printer to print varying length product. anybody got any ideas? My current "only" working solution is to go back, create this whole thing in 5-10 different layouts (with portals, each of different lengths), and build one at a time.. then create corresponding length PageSetup configs, and run a script to jump to the appropriate page setup config and matching layout during the print sequence...... Thoughts? i saw a couple folks downloaded this--was hoping to NOT have this hounding me while knawing on turkey tomorrow...
LaRetta Posted November 28, 2013 Posted November 28, 2013 (edited) I only have time for quick look ... heading out the door ... but your sub-summary is based upon Invoices::InvoiceNo and it should be based upon InvoiceItems::ID. And the sort needs to be changed to point to InvoiceItems:ID also. Also your fields in the body that are grouped - they need to be set to slide up and reduce enclosing part. That may not be necessary since I couldn't really review it but those things will help. Also in part setup, select the sub-summary and set page break before and set allow breaking across parts. I can't try any of that but I think it'll move you forward. BTW, if you see Comment's file, you will see his sub-summary is based upon LineItems (I believe). So again, if it works in his file then you know it is simple implementation you are dealing with. Gotta run. I hope this helps. Happy Thanksgiving! Also, 'ID' usually indicates the primary unique ID of a table. When using a foreign key, it is best to indicate the foreign key's table name. So in InvoiceItems, I suggest InvoiceID instead of ID. Wishing you the best with your design! Sorry it is segmented ... your InvoiceItems table ALSO needs a primary key (unique auto-enter serial or UUID) and *it* can be called simply ID. Edited November 28, 2013 by LaRetta
wedgeman Posted November 28, 2013 Posted November 28, 2013 I only have time for quick look ... heading out the door ... but your sub-summary is based upon Invoices::InvoiceNo and it should be based upon InvoiceItems::ID. And the sort needs to be changed to point to InvoiceItems:ID also. Also your fields in the body that are grouped - they need to be set to slide up and reduce enclosing part. That may not be necessary since I couldn't really review it but those things will help. Also in part setup, select the sub-summary and set page break before and set allow breaking across parts. I can't try any of that but I think it'll move you forward. BTW, if you see Comment's file, you will see his sub-summary is based upon LineItems (I believe). So again, if it works in his file then you know it is simple implementation you are dealing with. Gotta run. I hope this helps. Happy Thanksgiving! Also, 'ID' usually indicates the primary unique ID of a table. When using a foreign key, it is best to indicate the foreign key's table name. So in InvoiceItems, I suggest InvoiceID instead of ID. Wishing you the best with your design! Sorry it is segmented ... your InvoiceItems table ALSO needs a primary key (unique auto-enter serial or UUID) and *it* can be called simply ID. tx so much! "And the sort needs to be changed to point to InvoiceItems:ID also." where is this??
comment Posted November 28, 2013 Posted November 28, 2013 There's no script to print in your file. I tried to print manually and I got only one record in the body part, just like you said. The reason for this, AFAICT, is that the file has a "memory" of print options from the last performed print - and it has "Current record" selected in the "Print" radio button set. Once I changed that setting to "Records being browsed", it printed all records as you would expect. I'll try to address your other points later - i too must rush now. Happy Thanksgiving!
LaRetta Posted November 28, 2013 Posted November 28, 2013 Sort by InvoiceItems::ID (hopefully changed to InvoiceID) :-) And no, I don't know if this is the issue (along with my other suggestions) because I'm bopping in and out while I have a house full of guests, LOL. I'll try to look at the file again later. But in truth, if Comment is on it, you are in good hands.
wedgeman Posted November 29, 2013 Posted November 29, 2013 There's no script to print in your file. I tried to print manually and I got only one record in the body part, just like you said. The reason for this, AFAICT, is that the file has a "memory" of print options from the last performed print - and it has "Current record" selected in the "Print" radio button set. Once I changed that setting to "Records being browsed", it printed all records as you would expect. I'll try to address your other points later - i too must rush now. Happy Thanksgiving! tx i was practicing printing manually... hadn't thought that doing a script would net a different result than simply doing it manually (bad assumption i think!)... I manually set to "Records being browsed", but still got only one record... BUT, i'll make it a script and give that a shot.. thx! and hope all are enjoying the holiday!! Anyone got thoughts on how to dynamically tell the printer to use a different page length in page setup? I've been testing out the process of simply creating a dozen different thermal paper sizes (ie., 3.125x5.25", 3.125x5.5", etc), then using a "Get(count) of records to determine WHICH page setup to use... this of course seems (in my opinion) to be abit of a rube goldberg method....
comment Posted December 2, 2013 Posted December 2, 2013 I manually set to "Records being browsed", but still got only one record.. Well, that's strange because that's definitely NOT how it behaves here. I haven't made any scripts either - just changed the setting once and from this point on it prints all found records. Re the invoices demo file: They don't show totals/summaries in this layout. That's not quite true: the total is shown in a trailing sub-summary part. You won't see this unless records are sorted by InvoiceID. In version 8, you might also have to enter Preview mode - I don't remember exactly. There's a script called 'PrintOneInvoice' that does all that for you - just call it from the 'Invoices' layout.
LaRetta Posted December 2, 2013 Posted December 2, 2013 (edited) 2. I tried a list view in the InvoiceItems table, but (n00b here!), can' get it to print all records at the same time.. still not sure what i've done wrong in that..... layout looks great (on the screen), but wll only print ONE record per page! I chose "print all", "all records', etc.... So please can we just walk through this together and you make these changes to your file (as I indicated above)? Here is everything you should need (well maybe not everything, LOL): Naming: change your InvoiceItems::ID field name to InvoiceID. ID by itself indicates the primary key in a table and, in InvoiceItems, the invoice is a foreign key. Sub-summary part: change your leading sub-summary from being based upon Invoices::InvoiceID and base it on LineItems::InvoiceID. Create trailing sub-summary: Add a trailing sub-summary based upon InvoiceID. Place your sub-total and total fields from Invoices inside this sub-summary part. Page breaking: while there, set page break on LineItems::InvoiceID. Oversize your fields: Drag your field(s) in the body (Precio) a bit taller (to maybe 35 pt in height) The fields will REDUCE in height if not needed but never expand so always make them maximum height that you will need. All fields must slide: Select Precio field and in Inspector, set to Sliding up based upon all objects and be sure to check 'also reduce enclosing part' This is critical that all objects slide, text labels, lines and all fields. For test, show all: Just so you can see it working, show all records here in InvoiceItems table. Sort: Sort all records by InvoiceItems::InvoiceID (you MUST ALWAYS sort by the break field for summaries to work). Go to Preview Mode: page through the records. What does it show? In your current file, you only had ONE invoice in your found set (of its items). If we can get the above squared away AND if you have good data in your file (you currently lack good data except for the last invoice) then you should see it reduce as you wish and you can print & review multiple invoices. But until you have a better grasp of reporting, we aren't going to move forward. Hopefully this will help. If still stuck, please attach a NEW file with these changes in place so we can take it from there. The idea is to find the invoices first, then GTRR to their InvoiceItems, sort by InvoiceID (from LineItems) then print. Edited December 2, 2013 by LaRetta
LaRetta Posted December 2, 2013 Posted December 2, 2013 BTW, please do not feel bad about feeling very confused and lost with reporting. It is probably the least intuitive, clunkiest process in FileMaker second only to Import/Export mapping junk.
wedgeman Posted December 3, 2013 Posted December 3, 2013 2. I tried a list view in the InvoiceItems table, but (n00b here!), can' get it to print all records at the same time.. still not sure what i've done wrong in that..... layout looks great (on the screen), but wll only print ONE record per page! I chose "print all", "all records', etc.... So please can we just walk through this together and you make these changes to your file (as I indicated above)? Here is everything you should need (well maybe not everything, LOL): Naming: change your InvoiceItems::ID field name to InvoiceID. ID by itself indicates the primary key in a table and, in InvoiceItems, the invoice is a foreign key. Sub-summary part: change your leading sub-summary from being based upon Invoices::InvoiceID and base it on LineItems::InvoiceID. Create trailing sub-summary: Add a trailing sub-summary based upon InvoiceID. Place your sub-total and total fields from Invoices inside this sub-summary part. Page breaking: while there, set page break on LineItems::InvoiceID. Oversize your fields: Drag your field(s) in the body (Precio) a bit taller (to maybe 35 pt in height) The fields will REDUCE in height if not needed but never expand so always make them maximum height that you will need. All fields must slide: Select Precio field and in Inspector, set to Sliding up based upon all objects and be sure to check 'also reduce enclosing part' This is critical that all objects slide, text labels, lines and all fields. For test, show all: Just so you can see it working, show all records here in InvoiceItems table. Sort: Sort all records by InvoiceItems::InvoiceID (you MUST ALWAYS sort by the break field for summaries to work). Go to Preview Mode: page through the records. What does it show? In your current file, you only had ONE invoice in your found set (of its items). If we can get the above squared away AND if you have good data in your file (you currently lack good data except for the last invoice) then you should see it reduce as you wish and you can print & review multiple invoices. But until you have a better grasp of reporting, we aren't going to move forward. Hopefully this will help. If still stuck, please attach a NEW file with these changes in place so we can take it from there. The idea is to find the invoices first, then GTRR to their InvoiceItems, sort by InvoiceID (from LineItems) then print. thx.. this makes sense. Some of this I've gotten to work properly, some note. I ran out of time this weekend, so I bit the bullet, made 12 different length reports (with portals), arranged the scrip to do a record-count, then choose the appropriate length invoice based on this.. It's ugly scripting, but it works. And, unfortunately I didn't have the time to wait.. One thing that's been really perplexing was that if I did a Preview, it looks perfect.. it only didn't work when I actually printed (or did a print-to-pdf preview)..... i'm wondering if it's tied to the issue mentioned previously, that the FMP app is "remmebering" a previous, incorrect page setup format..... either way, will get back to you asap. tx!
LaRetta Posted December 3, 2013 Posted December 3, 2013 And it looks to me like Comment properly interpreted the deeper issue to begin with. Let us know how it goes. :-)
wedgeman Posted December 5, 2013 Posted December 5, 2013 Well, I **THINK** i fixed the first part of the issue - the printing issue where it was printing ONLY one record (even when chosen to print all returned records). Mavericks wasn't implementing my preferences properly (silly me for installing it, I thought that Apple would have actually made an OS that was problem-free!)... The issue which i still haven't resolved is that of effectively PRINTING a dynamic-length layout. This solution is running thermal paper printers, but in effect, they still operate much the same as a standard conventional printer--you have to tell them what size paper to print. So if your layout is always 3" wide, but may be 4" long, 4.5", 6", 7.25, etc ---- the printer has to know what length, or it's going to only assume what you told it previously... The issue gets a bit more complex with thermal printers that have cutters built in (I'm running both the old Zebra 2844's that are dirt cheap and run forever, and the Star TSP100's, which have built-in cutters, and are config'd to auto-cut the paper at the page-length point).... From what I can tell, Filemaker wants a page setup that defines length & width, and won't adjust these dimensions "on the fly". So the bigger question remains--is there a way to force FMP to adjust page sizes based on content, and stretch/downsize layouts accordingly? In conventional printing, we are used to adjusting a layout but leaving the paper size as a static component - but this is a need to force the papersize to change in dynamic proportion... The final target output of this is as follows.. We sell a single widget, and the full size of the receipt should be say.....3.25" wide by 4.0" length.. The list layout with summary creates a beautiful product*, but unless I script out a page setup change that correlates to it, the print job is still going to run with my previous Page Setup settings... In a small solution environment (1 or 2 systems) this isn't a big deal.. My current process is to create the same Custom Paper sizes on every system, which means manually creating them on each system (or if they're on comparable Mac OS versions, there's a way to copy them over), and giving them a uniform name set (ie Z3x6, Z3x6.2, Z3x6.5, etc).. I can then script out an adjustment based on length of receipt (count rows then choose layout based upon row count, then tell PageSetup to choose one of these Custom sizes by the name, based upon my Layout choice)..This method works but it's neither intuitive nor clean.. And if some user decides to reinstall an OS or replace a machine, well, then the custom pages have to be reinstalled on that local machine before it'll work again... Is there a way to force the Page Setup operation to create its own custom paper size, to avoid having to manually install these parameters?? *there is a bit of a caveat with the "beautiful list view/summary" option product. This client has requested a method of watermarking their receipts (apparently fraud is pretty high in their country), so our solution was to throw their logo in a VERY LIGHT (10-15% ) version beneath the back of the invoice, on an angle, in a way to prevent someone from scanning/copying, & changing the items on the invoice. It's not fool-proof, but it prevents the quickest/easiest method of fraud.... This is quite simple to do in a static layout where the items showing up are brought in by portal (ie, you can throw the logo on the back of the page, build a transparent portal, and display the portal on the page over the logo). BUT in the list/summary view (as Comment & LaRetta described), i can't seem to figure out a way to make a logo reside in this view without forcing EACH record to become the size of the entire logo.. So while the list view/summary setup SHOULD work, our logo watermark issue creates a complication.. Any thoughts on this? AND, is this something that's addressed by FMP13?
Recommended Posts
This topic is 4002 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now