What does your form controller action look like?
Also please do not calculate prices this way, this will cause floating point rounding errors. Look into using brick/money.
I am assuming the prices and the discount is from the database right? In this case change this code section from
$presupuestoProducto->discount = ($sale_price * $discount_percentage)/100;
TO
$presupuestoProducto->discount = ($presupuestoProducto* $presupuestoProducto)/100;
@rvxlab this is my form action:
action="{{ route('presupuestos-productos.store') }}" is this what you mean?
@j-jemoh you mean this to this?
$presupuestoProducto->discount = ($presupuestoProducto->sale_price* $presupuestoProducto->discount_percentage)/100;
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community