public function actionConsignment() { $consignments = ConsignmentModel::read(); $consignments = ReportModel::getRemains($consignments, 'IFNULL(wf.name, wt.name) AS stock', 'WHERE consignment.id = :id GROUP BY stock'); $this->render('consignment', ['consignments' => $consignments]); }
public function actionWorkshopTo() { $consignments = ConsignmentModel::read(); $places_workshop = PlaceModel::readByColumnValue('id_warehouse', 2); if (isset($_POST['id_consignment']) && isset($_POST['id_from']) && isset($_POST['qty']) && isset($_POST['qty_t']) && isset($_POST['kr']) && isset($_POST['parts'])) { $move = new MoveModel(); $move->id_type = '4'; $move->id_consignment = $_POST['id_consignment']; $move->id_from = $_POST['id_from']; $move->qty_from = $_POST['qty']; $move->qty_t = $_POST['qty_t']; $move->kr = $_POST['kr']; $move->parts = $_POST['parts']; $move->create(); header('Location: /report/main'); } $this->render('workshop_to', ['consignments' => $consignments, 'places_workshop' => $places_workshop]); }
public function actionDelete($id) { $consignment = ConsignmentModel::readById($id); $consignment->delete(); header('Location: /consignment/read'); }