Support the ongoing development of Laravel.io →
Laravel Database Eloquent
Last updated 3 months 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 11 months ago.
0

Sign in to participate in this thread!

LoadForge

Your banner here too?

Moderators

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

Your logo here?

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

© 2022 Laravel.io - All rights reserved.