FileMaker Pro 8, Avoiding recreating the tax invoice - database

I am currently using FileMaker Pro 8 to create my proforma invoice and tax invoices. I want to avoid rewriting records from the proforma invoices table to the Tax invoice table by just editing a proforma invoice number and then a tax invoice is created automatically. How do I go about it?

Related

SQL Trigger - Allocation Amount

i need to create a complex trigger in my database.
I try to explain my problem:
In my database I have 3 tables: Cash table, invoice table and installment payment table. Now I need to create a trigger. When I enter a payment in the collection table, the trigger should divide the amount entered by covering the uncovered amounts of the invoices (invoice table) starting from the oldest invoice due date. Furthermore, if installment payments are envisaged, I would need to divide the amount also on any installments starting from the oldest installment due date.
like this function: https://andrewtuerk.wordpress.com/2013/01/17/splitting-allocations-across-multiple-records-in-a-single-statement/
or this: SQL Server Allocation of amount in bill
How can I activate a trigger when I insert row in table?
Many thanks,
Andrea.

Creating and Calculating Fields in Access

I've been working on an exercise for school that should have been rather simple. For some reason I cant quite figure out where I went wrong. I have been at it awhile so I may be overlooking something simple. I have some experience with data bases and actually implemented sqlite earlier today in an app but access is throwing me for a loop ! Any help is much appreciated.
Directions:
create a relationship between the tblEmployee table and the tblDepartment table as well as between the tblEmployee and the tblSale table. Be sure to enforce referential integrity in both relationships.
Create a query in Design view using the tblEmployee, tblProduct, tblSale, and tblSaleDetail tables. Add the First, Last, and Active? fields (in that order) to the query. Make the following changes to the query:
Display only active employees.
In the first empty column, calculate a new field, Total Sales (UnitPrice * Quantity) for each active employee.
Only display employees with more that than $300.00 in Total Sales.
Calculate a new field, Total Revenue (Total Sales – (Coupon * Quantity)) for each active employee.
Sum the UnitPrice, Quantity, Coupon, Total Sales, and Total Revenue fields.
Show First, Last, Total Sales, and Total Revenue in the query results.
Access Setup
When I run the query
Why is Total Sales not populated from that equation ?
Also, im a little unclear on where to add the > 300.00 to filter on employee sales.
The issue here isn't the total sales column, it is that you refer to a calculated field total sales when you create a column called total revenue.
Total Sales is only calculated once the query has been run, but total revenue wants to know what the value is before the query is run.
A workaround for this is to use the same calculation:
total revenue: ([Quantity]*[UnitPrice])-([coupon]*[quantity])
Another workaround is to create a query that calculates total sales. You can then insert that query into this one and use it as a subquery.
As for the ">300 for employee sales". I think the following may work:
I assume this is a monetary value by the 2 decimal places and not a 'number of sales' value. Therefore, I would add a new column.
SumOfSales: sum([tblSales].[quantity]*[tblSales].[UnitPrice])
Criteria: >300.00
Show: unticked

Database schema design strategy for pharmacy and drug prescriptions

I am in the process of designing a small database application for a health center in my local community. The health center can receive both In & Out-Patients.
The one area i am not sure of how best it should be implemented is how to bill the patient automatically from the drugs/medication they have be given. I don't want the user to type in the name and price of the drugs given to the patient. I want to automate it with a list of all available drugs and their CURRENT prices in a table so that the user just selects a drug from a list & i the software should be able to determine the total.
I also want to maintain the history of drugs over time. Some thing like drug XXX was selling at $1234 in January, $4567 in September, $12 in 2008. So if i am to print a receipt for a patient who visited in 2008, the patient should be billed at the rates of 2008 not the drug current rate.
I am just asking for some general guidance and suggestions on the best database schema of a scenario related to my problem description above.
Thanks a lot.
With a table of drugprices
DrugPriceID DrugID PriceStartDate DrugPrice
1 1 1-1-2008 1234
2 1 1-9-2008 4567
which links to a table of drugs on DrugID. The price applies until it is superseded by a new price.
A table of Patients, which links to a table of PatientOrders,
PatientOrderID PatientID OrderDate
5 3 4-5-2008
and a further table of OrderDrugs
OrderDrugID PatientOrderID DrugID
6 5 1

Show detail data in RDLC report

How can create a report that shows the master and detail rows in the same report?
I am working on trying to prepare statement for customers of their invoices and credits.
The structure is:
Customer
Invoice
Credit
Credit Detail
Payment
Payment Detail
The scenario for a customer:
A customer can have multiple Invoices,
Each Invoice can have multiple credits issued against a particular invoice.
Each Invoice can have multiple payments.
The statement should produce each outstanding invoice and list any payments or credits towards the invoice grouped under them.
There may be situations that the customer can have credits issued against no invoice. This also needs to be displayed without any invoice.
I need some advise on how this can be done using Winforms Report using RDLC.
I created statementdata and statementdetail table that is preprocessed consolidating all invoices with their credit and payment amounts along with credits that were not issued to invoice instead to the customer (special credit). StatementDetail table will have the details of the credits and payments. Once we have this it becomes a master detail scenario. This made me easily show a statement with the following structure.
Customer Name and Address - Header
invoice 1 - Detail Section
Details for Invoice 1 payment - Sub Grouping
Details for Invoice 1 credits - Sub Grouping
invoice 2
Details for Invoice 2 payment
Details for Invoice 2 credits
etc.,
Thanks

Database designing help for billing system

I am developing a Electronic Bill Payment System for a bank which has more than 100 customers subscribing for Electronic Bill Payment.
I have a table in which I am creating profile for customer like the following.
Customer Table
Customer_ID (Primary key)
Customer_Name
Address
Phone
Bill_Master
Customer_ID
Enrollment_Date
UtilityCompany_ID
Bill_Generation_Date (lets say 18th of every month)
Bill_Due_Date (lets say 27th of every month)
Our_CutOff_Date (when the bank will generate the bill for payment)
I have created the customer along with clue that which utility company's bill generates on which date and what will be the due date of EVERY MONTH.
I want to create an interface where the user will see the entries of all the customers whoz date is due for bill generation and after that user will click on the particular entry and generate the bill manually by entering the amount and other details so for this I am clueless how to find out which customer's utility company bill is due for generation..
Any help how should I design it and query of it? or would be a automatic procedure like job or something which will do it.
thanks
Well if its a query you need to generate bills that are due 27th of every month and also find the customer's utility company, then you can try this -
SELECT A.Customer_Name, B.UtilityCompany_ID FROM
Customer A inner join Bill_Master B on A.Customer_ID = B.Customer_ID
WHERE Bill_Due_Date BETWEEN GETDATE() AND DATEADD(MONTH,-1,GETDATE())

Resources