diff --git a/common/forms/LedgerForm.php b/common/forms/LedgerForm.php index 3f5a92e..97b1246 100644 --- a/common/forms/LedgerForm.php +++ b/common/forms/LedgerForm.php @@ -192,12 +192,19 @@ class LedgerForm extends BaseModel $totalBuyPrice = round($number * $v['buy_price'], 4); if ($productOrder['prescription']['category'] == 2) { - (new MonthlyPaymentModel)->save([ - 'store_id' => $productOrder->store_id, - 'order_id' => $productOrder->id, - 'amount' => $totalBuyPrice, - 'created_at' => $time, - ]); + $model = new MonthlyPaymentModel(); + $model->store_id = $productOrder->store_id; + $model->order_id = $productOrder->id; + $model->amount = $totalBuyPrice; + $model->created_at = $time; + $model->save(); + +// (new MonthlyPaymentModel)->save([ +// 'store_id' => $productOrder->store_id, +// 'order_id' => $productOrder->id, +// 'amount' => $totalBuyPrice, +// 'created_at' => $time, +// ]); } else { $ledger[] = [ @@ -246,12 +253,18 @@ class LedgerForm extends BaseModel $totalPrice = round($v['number'] * $v['price'], 4); $totalBuyPrice = round($v['number'] * $v['buy_price'], 4); if ($productOrder['prescription']['category'] == 2) { - (new MonthlyPaymentModel)->save([ - 'store_id' => $productOrder->store_id, - 'order_id' => $productOrder->id, - 'amount' => $totalBuyPrice, - 'created_at' => $time, - ]); +// (new MonthlyPaymentModel)->save([ +// 'store_id' => $productOrder->store_id, +// 'order_id' => $productOrder->id, +// 'amount' => $totalBuyPrice, +// 'created_at' => $time, +// ]); + $model = new MonthlyPaymentModel(); + $model->store_id = $productOrder->store_id; + $model->order_id = $productOrder->id; + $model->amount = $totalBuyPrice; + $model->created_at = $time; + $model->save(); } else { $ledger[] = [ 'order_id' => $this->order_id,