Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3379 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a client who is being difficult about paying my invoices in a timely manner. If I put a date, even the day I send him the invoice, it goes into his 'I'll pay this sometime in the next week or two' pile. He says that the absolute only way he will process my invoice expediently is if I have 'due upon receipt' in the due date box he sees at the top of my printed invoice. So I'm wondering if there is a way to add 'due upon receipt' to the date due box at the bottom right of the invoices entry template. Right now, it's a calculated field. So what I want is to have both the option of the calculated field and the 'due upon receipt' text. I don't want to mess up the calculated field because it works great for all my other clients.

This is what the code looks like currently:

If (Terms = "Net/7"; Date ( Month ( Date_Invoice ) ; Day ( Date_Invoice ) + 7; Year ( Date_Invoice ) );
If (Terms = "Net/10"; Date ( Month ( Date_Invoice ) ; Day ( Date_Invoice ) + 10; Year ( Date_Invoice ) );
If (Terms = "Net/15"; Date ( Month ( Date_Invoice ) ; Day ( Date_Invoice ) + 15; Year ( Date_Invoice ) );
If (Terms = "Net/30"; Date ( Month ( Date_Invoice ) ; Day ( Date_Invoice ) + 30; Year ( Date_Invoice ) );
If (Terms = "Net/45"; Date ( Month ( Date_Invoice ) ; Day ( Date_Invoice ) + 45; Year ( Date_Invoice ) );
If (Terms = "Net/60"; Date ( Month ( Date_Invoice ) ; Day ( Date_Invoice ) + 60; Year ( Date_Invoice ) );
If (Terms = "Net/90"; Date ( Month ( Date_Invoice ) ; Day ( Date_Invoice ) + 90; Year ( Date_Invoice ) );
Date_Invoice )))))))

My instinct is to add another term (due upon receipt) and then another If to this code, but I really don't know my way around FM that well, so I don't want to try it lest I irreparably mess up my database.

Thanks,

Rae

Posted (edited)

Wow.

Let( [
d = Date_Invoice ;
t = GetAsNumber(Terms)
];

d + t )

Now just set the terms for this client to Net/0 and you're all set.

You should change this to an auto-entry date field, so unlike a calculated field, it won't change if you ever change your clients' terms -- it happens.

For the "Due upon receipt" -- put that on the layout as a block of text, and use the "Hide object when" option in the Inspector with a calculation of:

GetAsNumber(Terms) > 0
 

Edited by Fitch
Posted

I'm not quite sure what your code is doing. As I said, I'm not that familiar with FMP, just sort of muddling my way through using the FM Starting Point solution. I'm loathe to do any major changes to their coding without an explicit understanding of what I'm doing.

Thanks,

Rae

Posted

My code is doing the exact same thing as theirs, without all the confusion. I.e.:

1. we get the Terms value as a number, which ignores all non-numeric characters in the field.

2. we add that number to the date.

All those IF statements are not necessary.

I edited my original answer while you were replying, so please check that out and let me know if it makes sense.

Since you have FileMaker Advanced, you can put my formula in the Data Viewer and compare it to the existing formula.

Attached is a demo file.

invoice date.zip

Posted

I get the impression from you answer that you've never worked with the invoice module in FM Starting Point... If you did, you'd know that you can't set a client's terms, but rather set the individual invoice's term. When you do, that triggers the calculation based on the invoice date. So if I make my invoice on September 1st and select 'Net 7' as the term for that invoice, the date due field is autopopulated with September 8th and September 8th is what shows up on the printed invoice template as the due date. I fail to see how your code will do any of that.

I've been working with this solution for years and recently started over because I messed it up the first time really badly playing with things I didn't understand. So I'm loathe at this point to make any big changes to their code because there are so many fields and templates involved.

However, your edited bit about putting the Due Upon Receipt as a hidden object makes sense and is what I am going to be playing with!

Thanks!

Rae

Okay, got it done, and it was super easy once I got that nudge in the right direction! I only need the 'Due Upon Receipt' on the PDF I send, so I only mucked with that template.

First, I created the Net/0 term.

Then, I went to the template. For the Due Date object, I said to hide it if Term equals 0. I then created another object with the phrase Due Upon receipt and said to hide it if Term does not zero. Tested it and it works perfectly.

Thanks for your help!

Rae

Posted

One nice feature of my version (here simplified even further):

Date_Invoice + GetAsNumber(Terms)

... vs. the original calc is that you can add any arbitrary terms (Net/20, Net/120) and it will still work. Net/0 just happens to work in the original calc without modification because the calc defaults to the invoice date, which is the same as Net/0.

This topic is 3379 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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