コード例 #1
0
ファイル: DebtorController.php プロジェクト: PixelPartyRu/erp
 public function destroy($id)
 {
     $repayment = Repayment::where('debtor_id', '=', $id);
     $repayment->delete();
     $debtor = Debtor::find($id);
     $debtor->delete();
     Session::flash('message', 'Дебитор удален успешно!');
     //return Redirect::to('debtor');
 }
コード例 #2
0
 public function ClearTable()
 {
     DailyChargeCommission::Truncate();
     //ChargeCommission::Truncate();
     Bill::Truncate();
     //Repayment::Truncate();
     DeliveryToFinance::Truncate();
     //Finance::Truncate();
     $repayments = Repayment::OrderBy('date')->get();
     foreach ($repayments as $repayment) {
         $repayment->balance = $repayment->sum;
         $repayment->save();
     }
     return ['callback' => 'success', 'message' => 'Успешно', 'message_shot' => 'Таблицы очищены'];
 }