fix: sales quantity should use rounded float numbers

This commit is contained in:
hackerESQ
2024-11-07 18:20:53 -06:00
parent 0d40fd92f0
commit af3726cb91
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ class Transaction extends Model
public function scopeBeforeDate($query, $date)
{
return $query->whereDate('date', '<', $date);
return $query->whereDate('date', '<=', $date);
}
public function scopeMyTransactions()
+1 -1
View File
@@ -50,7 +50,7 @@ class QuantityValidationRule implements ValidationRule
$maxQuantity = $purchase_qty - $sales_qty;
if ($value > $maxQuantity) {
if (round($value, 3) > round($maxQuantity, 3)) {
$fail(__('The quantity must not be greater than the available quantity.'));
}
}