![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
FM8.5 I am trying to define the relationship between three tables CONTACTS, INVOICES and CHEQUE LIST. In my setup (and I do not know whether this approach is best) I have created a CHEQUE LISTt table separate from INVOICES or CONTACTS. I track the balance between what I have sold to a CONTACT through two portals on a CONTACT based layout, one portal based on Invoices listing Invoice #s and amounts, and another, based on CHEQUE LIST showing cheques received. On the CHEQUE LIST I manually assign the cheque amount to an Invoice by writing the Invoice # in a field called InvoiceReference. Both INVOICES and CHEQUE LIST have relationships with kp_Contact ID. There is a field that calculates the difference between two summary fields. I did it this way as sometimes people short pay, overpay or pay two Invoices at once. Now I am trying to create a layout that shows as a number the difference in days between when an Invoice was due (Date Shipped + Terms) and when it was paid (ChequeDate). Can you recommend how to do this? Thanks |
)
#3
| |||
| |||
|
|
In article ba209755-097f-45bb-b485-596c7bdf2... (AT) j12g2000pri (DOT) googlegroups.com>, Buckbuck <buck.matthe... (AT) yahoo (DOT) com> wrote: FM8.5 I am trying to define the relationship between three tables CONTACTS, INVOICES and CHEQUE LIST. In my setup (and I do not know whether this approach is best) I have created a CHEQUE LISTt table separate from INVOICES or CONTACTS. I track the balance between what I have sold to a CONTACT through two portals on a CONTACT based layout, one portal based on Invoices listing Invoice #s and amounts, and another, based on CHEQUE LIST showing cheques received. On the CHEQUE LIST I manually assign the cheque amount to an Invoice by writing the Invoice # in a field called InvoiceReference. Both INVOICES and CHEQUE LIST have relationships with kp_Contact ID. There is a field that calculates the difference between two summary fields. I did it this way as sometimes people short pay, overpay or pay two Invoices at once. Now I am trying to create a layout that shows as a number the difference in days between when an Invoice was due (Date Shipped + Terms) and when it was paid (ChequeDate). Can you recommend how to do this? Thanks It would probably be best to have this calculation done in the Invoices Table, which means defining a Relationship between the Invoices Table and the Cheque List Table, based on the invoice number. i.e. * * *rel_InvoicePayments * * * * * * * Match records in Invoices with records in Cheque List * * * * * when InvoiceNumber = Cheque List::InvoiceReference Then in the Invoices Table you can define a Calculation Field to work out the difference in days. i.e. * * *DaysDifference * *Calculation, Number, Unstored * * * = rel_InvoicePayments::ChequeDate - (DateShipped + Terms) FileMaker automatically calculates in days when adding or subtracting Date fields. This Field could then go in the Invoice Portal. BUT, because an invoice might be paid with multiple cheques, you probably want to use the date that the invoice has been FULLY paid off. Ths can be done in two ways: * * - define the rel_InvoicePayments Relationship to sort the * * * Related Records by ChequeDate in reverse order so that * * * the most recent date is first (for each invoice) and * * * used by the Calculation OR * * - change the Calculation to use the Max function to get * * * the most recent ChequeDate (for each invoice) * * * i.e. * * * * * DaysDifference * *Calculation, Number, Unstored * * * * * = Max(rel_InvoicePayments::ChequeDate) * * * * * * * * - (DateShipped + Terms) FileMaker automatically uses the Field data from the first Related Record when a Related Field is referenced, unless an aggregation / summary function is being used (e.g. Max, Min, Count, etc.) Helpfull Harry * ) |
#4
| |||
| |||
|
|
The problem I am having with this (assuming I have set it up as you described) is that the portal shows the same Date shipped in all the portal lines. This date changes as one moves to another Invoice record - it shows the ship date of the screened Invoice. Any ideas what might be wrong? |
)![]() |
| Thread Tools | |
| Display Modes | |
| |