fixed
This commit is contained in:
parent
aa0e450e64
commit
e36b200806
@ -45,7 +45,7 @@ class ContractNegotiationLogic extends BaseLogic
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
$contract = Contract::field('project_id')->where('id',$params['contract_id'])->findOrEmpty();
|
||||
$profit = $params['negotiation_amount'] - ($params['labor_costs'] + $params['material_costs']);
|
||||
$profit = $params['negotiation_amount'] - (($params['labor_costs']??0) + ($params['material_costs']??0));
|
||||
$profit_rate = $profit / $params['negotiation_amount'];
|
||||
Db::startTrans();
|
||||
try {
|
||||
@ -89,7 +89,7 @@ class ContractNegotiationLogic extends BaseLogic
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
$contract = Contract::field('project_id')->where('id',$params['contract_id'])->findOrEmpty();
|
||||
$profit = $params['negotiation_amount'] - ($params['labor_costs'] + $params['material_costs']);
|
||||
$profit = $params['negotiation_amount'] - (($params['labor_costs']??0) + ($params['material_costs']??0));
|
||||
$profit_rate = $profit / $params['negotiation_amount'];
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user