Solved

# How to relate grouped dates to a  billing period.

Posted on 2007-07-27
265 Views
I am designing a filemaker pro database for a trucking company (using Macintsoh G5, OS 10.4.10 and have just gone to FMP vers. 9). The trucking compasny's largest customer sends them orders daily but insists upon receiving a grouped invoice twice monthly. I have therefore divided the year into 24 half-month periods. i.e. all orders received between the 1st. and 15th. of Jan are in billing period one. From the 16th. to the 31st. of Jan = billing period two. For example: an order received between the 1st and 15th of June falls into billing period 11. If the order comes in between the 16th and 30th of june, the billing period is the 12th. December consists of the 23rd and 24th billing periods,
I have designed a small script that finds all the orders within any given billing period and totals the costs of the individual orders for an invocie total to be billed. Everything quite simple& so far.
Problem: When an order comes in, it receives a date of order in field one. How can I write a script that will return the billing period in field two? In other words, if I type (for example) the date, January 6 into field one, I need to have (automatically) 01-(current year). In other words, the first period of the current year. Another example: if the order arrives between the 16th and the 30th of june  say the 17th of June  is typed into field one, I need to have 12-2007 in field two. In other words, the 12th billing period of the current year.

Can you help me?
0
Question by:DonEnnio
1 Comment

LVL 28

Accepted Solution

make field2 a calculated field or an auto-entered field from a calculation =
If ( Day (invoice_date) <= 15 ; (Month (invoice_date) *2) - 1 ;  Month (invoice_date) *2 )
which means multiply the invoice date month by 2, and substract 1 if invoice day <= the 15th.
0

## Featured Post

Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
how to add IIS SMTP to handle application/Scanner relays into office 365.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…