40
Views
6
Comments
How to calculate Total Amount
Question
Application Type
Reactive

Hi i'm jay currently working on inventory management system,


I'm just trying to multiply 

(Input_Quantity * Input_Price) and store the  result to the TotalAmount of the same entity.

Then show the total amount on the Total_Input. 


And is it possible to make a simple receipt of the current Transaction? When the save button is clicked it will output the (Product, Category, Quantity, Price, and total amount) on the second column..


I'll attach my oml


Regards,

Jay

CMP1.oml
2024-10-16 11-59-48
Nick Vandebriel

Hi Jay,

For the calculation you just need to do it in an assign like below: 

I currently did this in your save action. You could also do it in the onchange of your quantity but it's best to do the calculation server side aswell when saving the record. 

I don't really understand the receipt question, you could put some values in the second column but don't you have all the needed info already in the first colum? I would also disable your price and total field since this data should be fetched based on your product and quantity.

UserImage.jpg
jay buiza

Hi @Nick Vandebriel,


I've already got it on my latest oml.

My problem is when i order the quantity it doesn't subtract to the product quantity.

Example: i have a product Tire with 20 stocks, when i order 4 stocks it should subtract from the Product quantity. I'm stuck on this one.


But thank you for your efforts!


I'll attach my oml file so anyone can do their logic.


Regards,

Jay

CamMotorcycleParts1.oml
2024-10-16 11-59-48
Nick Vandebriel

Hi Jay,

I'm currently not at my computer but I'll try to write it down:

-In your save action you call your entity with the product and stock quantity. 

-filter this entity on the selected productid and also add a filter to check if the chosen quantity is lower or equal to the stock quantity. If the stock quantity is not enough you can throw an error.

-if you pass the filters you are going to update the filtered record by doing stock quantity -quantity. After updating the record I think you can just use the flow you have now(I haven't seen it but based on the first oml)

2024-10-12 12-11-20
Kerollos Adel
Champion

hallo @jay buiza

on change of text box of both add action as per attached OMl i think will help you 


personal-oqbcw6a2.outsystemscloud.com/CamMotorcycleParts/BillingTransaction_Order_?_ts=638650423653674665 



CMP1.oml
UserImage.jpg
jay buiza

Hi can  you check my latest oml and see if you can do something about it? 

2024-09-17 12-24-07
Rammurthy Naidu Boddu
Champion

Hi @jay buiza

Please check the OML


CMP1.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.