-
Aug 10th, 2016, 08:18 PM
#1
Thread Starter
Fanatic Member
Advice/Logic on how to set up invoice page
I am using php/mysql/jQuery to create a CMS for invoicing contacts.
I'm well on my way.
My db has a table to handle the various items that can be invoiced. My items table has a field called 'active' which is set to 'Y' by default. Company users can change the item to inactive (inactive = 'N') if they don't want to sell that item anymore.
On my invoice details page, I have a list of the items in a table that were added. If the user clicks on the table row, a form opens that shows the invoiced item details for editing along with more information that is part of that item previously invoiced.
The user can also add items to the invoice, of course.
When items are added, the modal form shows and the items are inside a select box which is dynamically filled from my DB WHERE Active = 'Y'. This way the items that aren't currently sold, won't show up.
I am using the same modal form to edit the item on the invoice page. So when the edit/update form is shown I am populating the select box the same way as when inserting. The problem is: if the item was made inactive, it won't be selected from the select box because it is no longer a current option.
I like using the same modal form for adding and updating. It's been working well for me.
How can I go about this so if the item is NOT part of the active items in the select box to display it anyway as an option. I'm missing the logic behind this.
Thanks.
-
Aug 11th, 2016, 11:05 AM
#2
Re: Advice/Logic on how to set up invoice page
Pass in a flag to it... then use that flag to determine if you include inactive items or not.
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|