bug fix in sell invoice
This commit is contained in:
parent
70b21f13a6
commit
f2e84b4499
|
@ -249,6 +249,20 @@ class SellController extends AbstractController
|
|||
if(!$doc->getShortlink()){
|
||||
$doc->setShortlink($doc->getId());
|
||||
}
|
||||
|
||||
//add pair docs
|
||||
if(array_key_exists('pair_docs',$params)){
|
||||
foreach($params['pair_docs'] as $pairCode){
|
||||
$pair = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
|
||||
'bid'=>$acc['bid'],
|
||||
'code'=>$pairCode,
|
||||
'type'=>'buy'
|
||||
]);
|
||||
if($pair){
|
||||
$doc->addPairDoc($pair);
|
||||
}
|
||||
}
|
||||
}
|
||||
$entityManager->persist($doc);
|
||||
$entityManager->flush();
|
||||
|
||||
|
|
|
@ -71,6 +71,10 @@ class Explore
|
|||
if (!array_key_exists('transferCost', $result))
|
||||
$result['transferCost'] = 0;
|
||||
$result['person'] = $person;
|
||||
$result['pair_docs'] = [];
|
||||
foreach($hesabdariDoc->getPairDoc() as $pair){
|
||||
$result['pair_docs'][] = $pair->getCode();
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue