How to mutiple quotaiton amount by a fixed variable

hi guys,
when i make a quotation all is fine but the final amount should multiple by no. of days an item has to be required for…

for example :
an item A has a price of 10 rs and the customer wants 10 pieces of item A
then total amount in the quotation is 10X10 = 100 , which is fine…

but this item has to be given for 4 days … so how do we mulple this 100 x 4 ?
so total is 400.

its a rental product… pls help…

any helps guys ?

you need to add a field to the quotation item for “days”

and then use a Client Scripts to calculate amount.

@moe01325 thanks a lot buddy i know this but i need the client scrpt code… do u know how to do it ?

as long as you dont invest some time yourself, and/or provide more specific questions it is very hard to help you.

frappe.ui.form.on("Quotation Item", "days", function(frm, cdt, cdn) {
    var d = locals[cdt][cdn];
    frappe.model.set_value(cdt, cdn, 'calc_rate', d.rate*d.days);

@moe01325 thanks a lot for coming to my rescue… i shall explain in as much detail as i can.

we want to make a quotation based on no. of days an item is required for example :
item A has a price of 10 $ and quantity we want is 4 so then the total amount i see in $40 , this is calculated automatically in the quotation item table.

what i need is to be also able to add a box in quotation item table which will say days (this i know how to add this field)… then the rule to get final amount should be : “item A price” X “quantity” X “no. of days” its required for = final net amount…

can u make get me this script buddy… pls

did you try the script I posted above?

cool… do i need to replac ffm, ctn, ctd, or any thing with field or doctype name ?

i tried but it doesnt work… do i need to restart bench or server ?

what datatype should i select when creating days field in quotation item doctype ? currency, data or float ? i ahv used currency

i have put the script in client scipt option in erpnext … or shall i put in custom scripts ?