Skip to content

Commit

Permalink
Merge branch 'vtk-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiddons committed Nov 24, 2024
2 parents cbde662 + 4ee18c8 commit 9cae10d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
18 changes: 0 additions & 18 deletions module/CudiBundle/Controller/Admin/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,24 +185,6 @@ public function deleteAction()
);
}

Check failure on line 186 in module/CudiBundle/Controller/Admin/ArticleController.php

View workflow job for this annotation

GitHub Actions / Lint

Expected 1 blank line after function; 2 found

public function historyAction()
{
$article = $this->getArticleEntity();
if ($article === null) {
return new ViewModel();
}

$history = $this->getEntityManager()
->getRepository('CudiBundle\Entity\Article\History')
->findAllByArticle($article);

return new ViewModel(
array(
'history' => $history,
'current' => $article,
)
);
}

public function searchAction()
{
Expand Down
11 changes: 11 additions & 0 deletions module/CudiBundle/Controller/Admin/Sale/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,16 @@ public function deleteAction()
if ($saleArticle === null) {
return new ViewModel();
}

$bookings = $this->getEntityManager()
->getRepository('CudiBundle\Entity\Sale\Booking')
->findAllActiveByArticleAndPeriod($saleArticle, $this->getActiveStockPeriodEntity());

$idsCancelled = array();
foreach ($bookings as $booking) {
$booking->setStatus('canceled', $this->getEntityManager());
$idsCancelled[] = $booking->getId();
}

$saleArticle->setIsHistory(true);
$this->getEntityManager()->flush();
Expand All @@ -291,6 +301,7 @@ public function deleteAction()
'result' => (object) array('status' => 'success'),
)
);

}

Check failure on line 305 in module/CudiBundle/Controller/Admin/Sale/ArticleController.php

View workflow job for this annotation

GitHub Actions / Lint

Function closing brace must go on the next line following the body; found 1 blank lines before brace

public function assignAllAction()
Expand Down

0 comments on commit 9cae10d

Please sign in to comment.