POS-25: POS and Inventory create invoice using ASP.NET MVC | Jquery AngularJS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome to abc  tutorial this is reza with you   and today i will show you uh how you can save  invoice data so actually this is the part number   25 of inventory and point of sale management  system so in this playlist i show you how you can   stop create how you can make invoice and lot  of things so today i will show you how you can   save this data i mean already in if you see the  last three or four video where i already shown   you how you can make this page and how you can  load this item how you can dynamically create   a row how you can delete row and how you  can even calculate the discount where things   so now today i will show you how you can save  all this data so before starting please keep   subscribe my channel so now i'm moving  to the visual studio so in visual studio   we actually working in this home in voice  controller uh page right so before starting as   we know from previous video that in our  uh in our database end we have a few   column but a total amount but the  column discount vat and subtotal is not   exist in the cell cell table so i will add this  column to the table so now first i will start to   change the design of the database and i will add   like i will insert column here the column name  will be subtotal subtitle and it will be float and then after subtotal i will add discount  and fat percentage okay so discount percentage and i will add a vat percentage it will be looks like it will be integer   that percentage discount percentage so i will  just uh i will save it ctrl s but it's not   saving because of a our tool setting need to  be changed here so i will go to the designer yes from designer prevent saving  change that require table recreation   i will uncheck it and i will keep okay and i will  just again pick control s i mean save and then yes   yes it's saved so if i just  refresh the database check the change is here discount percentage  back percentage right and total   so we have sub total discount  percentage back percentage total okay   so we have subtotal this one percentage  that percent is total all right   so now i will move to the visual studio and  i will go to the invoice page in invoice page i will pick i mean i need customer name address  and phone number i need to check customer   name address and this is customer phone  number and here is the order number okay so for generating order number i will use a  different method like here order number or   inverse number will be shown so if  i go to the google and just random git uh generator for uh generating new  git every time when page is loading okay   this is my gate i'm just copying this code and if  i go to this is inverse page so home controller   i will go to invoice page and this is gate number will be object dot to string so i will show this git id in invoice  number section okay i will just show it here   if i run the page if i go to invoice see here a inverse number auto  generated inverse number is coming every time okay   so what i did i actually just add a git which is  a random id generator and this is actually the   invoice number i will show i will store it as an  invoice number inside the database so here i mean   order number not inverse order number so here it's  invoice i'm just changing it to invoice number i'm sorry order number if i load the page see there is a new  number is coming so this is order number so now first what i will store one by one i'm just   before it uh i'm i i need to change my model  in visual studio project because i already   added few column which is not exist in  my model here if i check if i check here sell see here uh   where is the cell in cell there is no subtotal and  discount percentage or bad percentage so i will close the project i will delete it and again i will add the model also before it i will just   i will delete it   okay so if i go to the new item loading the template i will go to data entity entity designer okay so i'm keeping this entity name so i will copy paste post it real posted real entities  and first tutorial entities next i'll keep all the table um all right so now everything is done so if i check my model and if i go to cell see here where prevent percentage and  discount percent subtotal is coming so now   now i will one by one i will add  everything so it will open the cell model   i will take this okay so now order number so order  number i will keep the model name as the same   so now order number is this right so i will also  keep a hidden because i'm just showing this order   number here but for uh storing the order number  into database in this field i have to keep it in a   in hood box okay so input the type will be hidden  because this is not required to show because i'm   showing here invoice number so type is hidden ng  model ng model and then value i mean order number   and value will be this this okay so in order  number i will make a object so   the cell object where we used this side object yes i will store everything  in sale of the sale object mean   i will uh pass this of my models data through  cell object so fill object already defined here   i will sail dot order number this will be order  number and then customer name so customer name   will be sell.customer name so where is our  customer name customer name is this okay so ng   model sale dot customer name okay so  i will pick customer name from here and then next is customer phone  number customer phone number is this   and the model name is customer phone is and the  next is customer address so i will copy this and here is customer address so customer  addresses this is my address okay so   these three things is done now order date so order  date will be um auto i mean i mean current date so   i will uh stored in it from the controller side  so next is payment method so always the payment   method i will set a default payment method for  this but you can select payment method even from   invoice part so i will i will never  um add any any drop down or anything   so subtotal so subtotal will be subtotal  subtotal will be this okay so this fellow so here so subtotal is calculating subtotal okay   and then we have already subtotal is calculating  how we stored subtotals the subtotal actually   stored from javascript site see here subtotal  calculation calculating and sub um storing   subtotal into the subtotal uh model okay cell dot  subtotal but that means sell.subtotal is defined   from javascript site not from the client side okay  now discount percentage so discount percentage is okay so when i mean once this calculate discount  is selecting that time actually we are selecting   discount calculation okay so this is the amount  of discount but here i will add scope dot   sale dot discount percentage this one percentage  is which one discount percentage is sell.discount or we can even directly write  it discount cell.discount okay   i will change the name of this  model because it's already used here   cell discount i will name it  as cell discount percentage   and also i will change the name of this discount  percentage okay discount amount is showing here   so now uh for same same work i  will do for a fat calculation okay so is the vet discount this is fat discount fat  discount but in our model we have bad percentage   so i will named it as a pet percentage   instead of instead of seller fat i  will write seller fat percentage okay so that means automatically we i i don't have to  write it again so that means automatically when   we are selecting uh when we are selecting  this discount from drop down i mean   uh at that time it's it's setting so  that is done and discount is done so   and the total amount the total amount where  we are capability the total amount sell the   total amount so actually what is the name of  this total amount but here is the total amount   so it's a spelling mistake so since it's already  added here so i i will just say anything because   it's wrongly this name is instead of  amount it's amount showing so i will   keep it we'll never work more  here same things i will go for so sale amount will be stored here so now everything done for storing data in cells detail sales detail  so i will now check the sales detail models   so sell i sells id sales id in sales tables id   so it will be it will be in in in controller  site so i will show you how we are generating   this cells id so product id so product id when  we are adding any product here so where is the product so when we are adding anything see here the product id okay here is category name unit  price to align total product id product regional category null unit  price zero quantity one line total zero you need price unit price and  then quantity quantity and then   line total line return all right so  almost everything is done here so now   i will work for saving data right so i will  copy a safe method from any of the topics method i'm just copying this sales talk all right so i'm just keeping here save save cell say invoice cell so now here  it will come first the cell   the single object okay because  the data what i putting in like   customer name customer phone number this is  a single data right for single data i will   use this cell single object and here for  sales detail i will at least sales detail sales detail all right so now here sale and sales detail is coming  so actually uh for a single sales multiple   sales detail will be created all right  so in that case if i go to sale here cell details is really this relation has exist so i will use a for each loop and multiple sales  detail is coming here so that's why i will add cell dot sales detail dot add all right so here cell dot cells i mean in cell cell model see here i collection  i mean multiple cell detail will   be related with the relate with the  single cells okay so that's why i'm i'm just pushing i mean pushing every  single sales detail to the sales   table okay so in sales detail what we have  the sales id will be automatically created   but i will push the product id  item dot product id all right so   the unit price item dot unit price and the quantity item dot quantity and the line total item dot line total right so and created by is uh   created by will be app helper okay what will be the created by   let me check where is the login method  what we are storing during learning username role id it means not user id  we are not storing user id but here now   okay uh created knowledge okay created by  also the nullable field so it's not mandatory   i will never put the created by there's  adding that means uh model is ready   to save so now single cells i will add all right so actually from here we will only  save so only save mean this one so i will just add i will i will add cell so if said then say will be success now if i just run the project if i log in go to invoice so here from for  c-sharp site i mean controller site work is   done now i will work on javascript  size for javascript side work   go to script go to uh home and then product  stock copy the product stock save method go to invoice controller so i will delete it here see here  the parameter i will be pass cell air cell and scope dot cell will be here and then here another is sell details   sale details will be so details will be the invoice card the product  what we are adding in the row okay this kind of   product will be passed as a sales detail so  save method name will be the save invest cell   after saving success message will be shown  and once they will be triggered save invoice   all right so saving this so i need to   provide a button here so i will  provide a pattern button here called save plus sorry all right so i'm just saving it if i reload  the page here save button is placed so   if i click on save then data  will be set okay so i will instead of button i will click save and click   save inverse javascript method will be  called here so i'm adding a debug here   and if i reload the page so now i will check javascript is updated  or not so i i'll go to source see here javascript is not updated so in that  case i will just clear the browse data for last   hour right now check see here it's coming so  if i click on that like i'm just adding razer and phone number is this and  see here order number is coming   and i added a product of samsung 1200 and discount  zero that is now discount 10 percent that is 10   and price is this so if i just click on save  button see what happened click on save button   see here the session data data is converted to the  json all right so if i now click on i'm already   clicked in debug mode so if i just go see here  data is coming so here see raise the customer name   address and phone number discount percentage is 10  coming all right and then sub total 1200 is coming   total amount what we call amount but wrongly  its amount so you can change this field name   no problem so uh vat percentage all right so  now if i see the product i mean sales detail see here one says detail is coming and the  line total is 1200 c very interesting things   is product id is coming and quantity is coming and  unit price is coming so now if i go to the next see here very interesting things in in sales  sorry in this cells sales detail is added here   right so in sales detail here is the sales there  is no sales id but automatically when it will   be added into the database then sales site  will be added so if i click on just continue   success so if i go to the database here  see the subtotal discount rate percentage   and everything is coming but we never given any  order date or created by or created date that's   why it's not saving so if i go to the sales detail  see here sales id sell side is one because this is   one all right this is very interesting that  sales id is saving automatically product id   unit price quantity line total and i never added  this from the controller you can add no problem   so that's all about the saving of invoice in to  the database it's very very interesting and very   simple things but few times it's very complex when  you are going to do this but in angularjs it's   very simple to save everything within the seconds  so thank you very much in la in next video i will   show you how you can edit your already existing  invoice so keep subscribe and keep watching you
Info
Channel: abctutorial
Views: 3,605
Rating: undefined out of 5
Keywords: point of sale, point of sale system, pos, point of sale software, create invoice in c#, create invoice, create invoice asap, invoice jquery, create invoice using jquery, angularjs crud operation in asp.net mvc, angularjs crud operations
Id: tZ61bT8YnyI
Channel Id: undefined
Length: 35min 5sec (2105 seconds)
Published: Sun Jun 06 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.