Support the ongoing development of Laravel.io →
Laravel Database Eloquent
Last updated 1 year ago.
0

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.

0

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;
0

@rvxlab this is my form action:

action="{{ route('presupuestos-productos.store') }}" is this what you mean?

0

@j-jemoh you mean this to this?

     $presupuestoProducto->discount = ($presupuestoProducto->sale_price* $presupuestoProducto->discount_percentage)/100;
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.