Last active
December 28, 2015 09:39
-
-
Save jocoonopa/7480312 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @Route("/purchase/add_new_goods", name="orders_add_new_goods", options={"expose"=true}) | |
*/ | |
public function addNewGoodsAction(Request $request) | |
{ | |
if ( !$this->postCRSFCheck( $request ) ) | |
return new Response( 'error' ); | |
$em = $this->getDoctrine()->getManager(); | |
$em->getConnection()->beginTransaction(); | |
try{ | |
// 進貨訂單成立 | |
$this->setRequest( $request ) | |
->genGoods() | |
->putImg() | |
->setOrdersKind( self::OK_IN ) | |
->setOrdersStatus( self::OS_COMPLETE ) | |
->setPayType( self::PT_CASH ) | |
->newInOrders() | |
->recordOpe( $this->orders, '成立進貨訂單'); | |
$em->getConnection()->commit(); | |
}catch (Exception $e){ | |
$em->getConnection()->rollback(); | |
throw $e; | |
} | |
return new Response( $this->goodsPassport->getGoodsPassportId() ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment