Multiple items update at once with a "invoice" output format

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
User avatar
urichard
Posts: 16
Joined: 2018-11-01 12:11

Multiple items update at once with a "invoice" output format

Post by urichard » 2019-02-22 12:43

Hi There Appgini

I really hope someone can help me and i hope this would be possible.

How to create a form that has lookup information from another table but instead of just showing one item at a time, rather shows all of the items in this other table and each item goes into its own line, what then has to display in the same line as this item is an open text box to enter an integer value quantity

After multiple items have had a value entered into this open empty text box and lets say there is 20 items in total in this table lookup but a value has been entered in the space provided for only 10 of those items then only should there be a button at the BOTTOM of this FORM that will compile only the items updated or changed into an "invoice" like format which will not include all the items but only these 10.

Basically what i want to do is to be able to lookup a table and create a complete invoice from this lookup table from few items only (which then should also clear the next time i want to access the same table and make a new invoice)

If i should be doing this in the hooks folders, firstly i just like to know if this is possible and what code do i use with which hook?

Please Help

Kind Regards
Richard
richardaslabbert@gmail.com[/color]

Kind Regards
Richard

sjohn
Veteran Member
Posts: 67
Joined: 2018-05-23 09:32

Re: Multiple items update at once with a "invoice" output format

Post by sjohn » 2019-02-23 10:07

Should it be only you that could perform this operation?
Or should also other persons be able to do it.

If it is more persons, then you could create an invoice by creating a invoice-header ( parent ) and then "attach" invoice lines ( will be child ) from a product table. This would be much like you see it in Notrthwind.

Another solution is to create two fields in the table you want to do the operation on.
One field is a mark-field, the other field is a quantity (integer) field.

You then create a view of the table.
The view is the same table but defined with certain "rules". You create the view in AppGini and then afterwards delete the table on the server and create it manually as a view.
In this view is only shown records from the original table that has a value in the mark-field - you define this in the view.

Then you will see the original table with all records, where you can mark/unmark records and where you can input a value.
You will have the same table in a view that will only show the records you have marked.

You should have a routine where you could reset the marks and values for all records in the original table.

When the routine has just been performed, then the original table will show no values in the mark-field and the quantity field.
The view table will show no records ( as no fields is marked in the original )
This will require no code other than the code needed to "wipe out" the information in the mark-field and the quantity field.
More people can operate on the table at the same time, but you can only have one "invoice" active at a time.

What should be the reason you don't want to use invoice header/lines?
Or is there something I have not understood.

sjohn
Veteran Member
Posts: 67
Joined: 2018-05-23 09:32

Re: Multiple items update at once with a "invoice" output format

Post by sjohn » 2019-02-23 10:24

Just to clarify :
You create the view table as a "normal" table in Appgini. It could be a copy of the original table.
The view has to be created on the server.

User avatar
urichard
Posts: 16
Joined: 2018-11-01 12:11

Re: Multiple items update at once with a "invoice" output format

Post by urichard » 2019-02-23 11:36

Hi Sjohn

Thanks for the reply

You have it 60% correct, i'm a complete newbie to php coding and appgini even though its been 6 months already lol, i know the basics and that's about it so I have separated all my questions here with points

1. I honestly am not sure by what you mean with invoice header/lines but if i understand correctly i don't mind having a invoice header (actually want to print the header with details from the database of the client placing the order (i.o.w invoice from a partner sent to me with their details on and vice versa) that can automatically be part of the "printed invoice" ?

2. Regarding the invoice lines: is this going to be possible to have each item/ product on a separate line where a value can be entered to place an order by the client for that product/ item, but instead of having a "mark/unmarked" checkbox (i guess) to actually just show all the products on this table but only the products that a value has been entered into (placing an order) is then automatically included in the invoice method and not the other products which has no value (not ordered). What hook can be used for this?

3. I actually want to also "print to pdf" each invoice created and then save it as a backup and also be able to mail this invoice as a pdf (or any other recommended method if you know of one) to a client who submitted their email in the database when they were registering as a client (this process of sending the email i would love to make automatic after a trigger is performed like the click of a button on the table you mentioned for creating an invoice).. ok my apologies this is just additional to the post above here but that is mainly the reason for creating the invoice and i also want to save the invoice on the server and be able to create a next inv etc.

4. The other thing is how can i enter a hook or php code (just direct me into the correct direction) to again automatically "wipe out" this invoice after the trigger is performed as mentioned above here, i know this should be possible hopefully?

5. Also, how do i create this "view" you are mentioning here on the server, please show me a tutorial or a help file or maybe something else to show me step by step?

6. Lastly, I've had a look at the Northwind demo and i really like the whole sample but would like to modify it according to my needs how can i do this because the only files provided is the generated files?

Your help in this would be very much appreciated.

Kind Regards
Richard
richardaslabbert@gmail.com[/color]

Kind Regards
Richard

sjohn
Veteran Member
Posts: 67
Joined: 2018-05-23 09:32

Re: Multiple items update at once with a "invoice" output format

Post by sjohn » 2019-02-24 10:23

1+2 : You create an invoice. On this invoice you create lines. You create the invoice-lines by choosing from another table ( the products table). On each line you put in a quantity. This way you have a copy of the product as a invoice-line. When you delete a line in the invoice it is not the product you delete - it is the link between the invoice and the product.
This is how most invoices is normally made. With the Northwing product you should be able to do that.
Instead of the Northwind project, you could look at the "Online Invoicing System" you find here : https://bigprof.com/appgini/free-open-s ... plications

3 : I am not sure if the Northwind or the OIC system is able to print PDF. Maybe you can use the AppGini report tool for that- I don't know.

4 : You could make a PHP-routine that did the job. Maybe someone of the coders will have a good solution how to make a button that do the job. This is only needed if you will NOT use the invoive method.

5: here is a good link : https://www.guru99.com/views.html - you can find more information of view by using google - again - the view is only needed if you will NOT use the invoice method.

6 : If you have downloaded the Northwind project ( https://bigprof.com/demo/nwdemo.zip ) then you should find a northwind.axp file in the root of the installation files. This file IS the project - you can change it as you wish.

Post Reply