bug fix in sell invoice

This commit is contained in:
Hesabix 2024-12-30 14:31:51 +00:00
parent 70b21f13a6
commit f2e84b4499
2 changed files with 18 additions and 0 deletions

View file

@ -249,6 +249,20 @@ class SellController extends AbstractController
if(!$doc->getShortlink()){ if(!$doc->getShortlink()){
$doc->setShortlink($doc->getId()); $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->persist($doc);
$entityManager->flush(); $entityManager->flush();

View file

@ -71,6 +71,10 @@ class Explore
if (!array_key_exists('transferCost', $result)) if (!array_key_exists('transferCost', $result))
$result['transferCost'] = 0; $result['transferCost'] = 0;
$result['person'] = $person; $result['person'] = $person;
$result['pair_docs'] = [];
foreach($hesabdariDoc->getPairDoc() as $pair){
$result['pair_docs'][] = $pair->getCode();
}
return $result; return $result;
} }