Header & Row data

Need tutorials for the below need.

How to create Sales Order form kind of solution in Django?

  1. On the header details the Vendor name will be selected and date of Order will be input;
  2. In row details user can add the items, its quantity, price. Row total will be calculated automatically.
  3. In the footer, user can input the % of tax. Then the tax amount and the total order amount (Sum of all row total) will be calculated automatically.

I am new to Django (only 7 months experience) and nill experienced with ajax/jquery or so whichever may be needed for accomplishing the need. Still I would like to take some help with start of creation of such form and the functionalities.

So, request any tutorials of similar context. - thank you!

modal form as below,

I am not personally aware of any tutorial addressing this specific type of project. However, you may find other conversations in this forum discussing some of the ideas that are relevent here. Search for “modelformsets”.

This is a lot to try and discuss all at once. So let’s break this down into parts, and then you can identify what parts you’re having problems with.

First, anything that you say will be done “automatically”, you need to decide where the work for that is going to be done - in the browser using JavaScript, or on the server using AJAX (and perhaps with the help of HTMX or some similar library).

You also need to define your models. Do you have some models defined yet?

I know from previous conversations that you know how to create forms.

I’d also suggest not trying to do this all at once. You are going to have a number of different aspects to this that you may not have worked on before - it’s important to have a functional starting point.

Start with the top part where the vendor is selected. Get your models defined, create your templates, forms, and views, and get that all working before adding the line items.

Typically, something like those line items are going to be created using formsets. In this case, it’s going to be a model formset since these line items are going to all be related to your base object.

Then, after you have that all working, look to add the totals components at the bottom.

Right Ken sir. I’ll come back on further assistance needed. - Thank you!