Started Contract Index
This commit is contained in:
@@ -366,6 +366,18 @@ class OrderController extends mfBaseController {
|
||||
$this->layout()->setFlash("Bestellung nicht gefunden", "error");
|
||||
$this->redirect("Order");
|
||||
}
|
||||
// refuse to save if there is a contract already
|
||||
|
||||
if($order->finish_date && is_array($order->contracts) && count($order->contracts)) {
|
||||
$this->layout()->setFlash("Bestellung kann nicht mehr bearbeitet werden, da sie bereits abgeschlossen und in Verrechnung ist.", "error");
|
||||
$this->redirect("Order", "edit", ['id' => $order->id]);
|
||||
}
|
||||
/*foreach($order->products as $p) {
|
||||
if($p->contract && $p->contract->id) {
|
||||
$this->layout()->setFlash("Bestellung kann nicht mehr bearbeitet werden, da sie bereits abgeschlossen und in Verrechnung ist.", "error");
|
||||
$this->redirect("Order", "edit", ['id' => $order->id]);
|
||||
}
|
||||
}*/
|
||||
} else {
|
||||
$id = false;
|
||||
$mode = "add";
|
||||
@@ -827,7 +839,7 @@ class OrderController extends mfBaseController {
|
||||
$of['order_id'] = $new_id;
|
||||
$of['file_id'] = $file_id;
|
||||
$of['name'] = $file->name;
|
||||
$of['description'] = $file->description;
|
||||
$of['description'] = $r->file_description;
|
||||
|
||||
$orderfile = OrderFileModel::create($of);
|
||||
if(!$orderfile->save()) {
|
||||
|
||||
Reference in New Issue
Block a user