bug fix in create business
This commit is contained in:
parent
5343345f15
commit
5dd4818f63
|
@ -197,11 +197,15 @@ class BusinessController extends AbstractController
|
||||||
if ($params['profitCalcType'] == 'lis' || $params['profitCalcType'] == 'avgis') {
|
if ($params['profitCalcType'] == 'lis' || $params['profitCalcType'] == 'avgis') {
|
||||||
$business->setProfitCalcType($params['profitCalcType']);
|
$business->setProfitCalcType($params['profitCalcType']);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$business->setProfitCalcType('lis');
|
$business->setProfitCalcType('lis');
|
||||||
}
|
}
|
||||||
|
if (array_key_exists('commodityUpdateSellPriceAuto', $params)) {
|
||||||
$business->setCommodityUpdateSellPriceAuto($params['commodityUpdateSellPriceAuto']);
|
$business->setCommodityUpdateSellPriceAuto($params['commodityUpdateSellPriceAuto']);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$business->setCommodityUpdateSellPriceAuto(true);
|
||||||
|
}
|
||||||
if (array_key_exists('walletEnabled', $params)) {
|
if (array_key_exists('walletEnabled', $params)) {
|
||||||
if ($params['walletEnabled']) {
|
if ($params['walletEnabled']) {
|
||||||
if (array_key_exists('walletMatchBank', $params)) {
|
if (array_key_exists('walletMatchBank', $params)) {
|
||||||
|
|
|
@ -34,17 +34,17 @@ class UiGeneralController extends AbstractController
|
||||||
$lastBusiness = $entityManager->getRepository(Business::class)->findLast();
|
$lastBusiness = $entityManager->getRepository(Business::class)->findLast();
|
||||||
if($lastBusiness)
|
if($lastBusiness)
|
||||||
return $this->render('general/home.html.twig',[
|
return $this->render('general/home.html.twig',[
|
||||||
'business' => $busCount + 11405,
|
'business' => $busCount,
|
||||||
'users' => $users + 29471,
|
'users' => $users,
|
||||||
'docs' => $docs + 105412,
|
'docs' => $docs,
|
||||||
'lastBusinessName' => $lastBusiness->getname(),
|
'lastBusinessName' => $lastBusiness->getname(),
|
||||||
'lastBusinessOwner' => $lastBusiness->getOwner()->getFullName(),
|
'lastBusinessOwner' => $lastBusiness->getOwner()->getFullName(),
|
||||||
'blogPosts'=> $entityManager->getRepository(BlogPost::class)->findBy([],['dateSubmit'=>'DESC'],3)
|
'blogPosts'=> $entityManager->getRepository(BlogPost::class)->findBy([],['dateSubmit'=>'DESC'],3)
|
||||||
]);
|
]);
|
||||||
return $this->render('general/home.html.twig',[
|
return $this->render('general/home.html.twig',[
|
||||||
'business' => $busCount + 11405,
|
'business' => $busCount,
|
||||||
'users' => $users + 29471,
|
'users' => $users,
|
||||||
'docs' => $docs + 105412,
|
'docs' => $docs,
|
||||||
'lastBusinessName' => 'ثبت نشده',
|
'lastBusinessName' => 'ثبت نشده',
|
||||||
'lastBusinessOwner' => 'ثبت نشده',
|
'lastBusinessOwner' => 'ثبت نشده',
|
||||||
'blogPosts'=> $entityManager->getRepository(BlogPost::class)->findBy([],['dateSubmit'=>'DESC'],3)
|
'blogPosts'=> $entityManager->getRepository(BlogPost::class)->findBy([],['dateSubmit'=>'DESC'],3)
|
||||||
|
|
|
@ -382,7 +382,6 @@ class HesabdariController extends AbstractController
|
||||||
'id' => $row['chequeOwner']
|
'id' => $row['chequeOwner']
|
||||||
]);
|
]);
|
||||||
$cheque = new Cheque();
|
$cheque = new Cheque();
|
||||||
echo $hesabdariRow->getRef();
|
|
||||||
$cheque->setBid($acc['bid']);
|
$cheque->setBid($acc['bid']);
|
||||||
$cheque->setSubmitter($this->getUser());
|
$cheque->setSubmitter($this->getUser());
|
||||||
$cheque->setPayDate($row['chequeDate']);
|
$cheque->setPayDate($row['chequeDate']);
|
||||||
|
@ -392,7 +391,7 @@ class HesabdariController extends AbstractController
|
||||||
$cheque->setSayadNum($row['chequeSayadNum']);
|
$cheque->setSayadNum($row['chequeSayadNum']);
|
||||||
$cheque->setDateSubmit(time());
|
$cheque->setDateSubmit(time());
|
||||||
$cheque->setDes($row['des']);
|
$cheque->setDes($row['des']);
|
||||||
$dateArray = explode('-', $row['chequeDate']);
|
$dateArray = explode('/', $row['chequeDate']);
|
||||||
$dateGre = strtotime($jdate->jalali_to_gregorian($dateArray['0'], $dateArray['1'], $dateArray['2'], '/'));
|
$dateGre = strtotime($jdate->jalali_to_gregorian($dateArray['0'], $dateArray['1'], $dateArray['2'], '/'));
|
||||||
$cheque->setDateStamp($dateGre);
|
$cheque->setDateStamp($dateGre);
|
||||||
$cheque->setPerson($person);
|
$cheque->setPerson($person);
|
||||||
|
|
|
@ -76,9 +76,11 @@ class PersonsController extends AbstractController
|
||||||
$bs = 0;
|
$bs = 0;
|
||||||
$bd = 0;
|
$bd = 0;
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
|
if ($row->getDoc()->getMoney() == $acc['money']) {
|
||||||
$bs += $row->getBs();
|
$bs += $row->getBs();
|
||||||
$bd += $row->getBd();
|
$bd += $row->getBd();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$response['bs'] = $bs;
|
$response['bs'] = $bs;
|
||||||
$response['bd'] = $bd;
|
$response['bd'] = $bd;
|
||||||
$response['balance'] = $bs - $bd;
|
$response['balance'] = $bs - $bd;
|
||||||
|
@ -379,14 +381,17 @@ class PersonsController extends AbstractController
|
||||||
'mobile' => $person->getMobile()
|
'mobile' => $person->getMobile()
|
||||||
];
|
];
|
||||||
$rows = $entityManager->getRepository(HesabdariRow::class)->findBy([
|
$rows = $entityManager->getRepository(HesabdariRow::class)->findBy([
|
||||||
'person' => $person
|
'person' => $person,
|
||||||
]);
|
]);
|
||||||
$bs = 0;
|
$bs = 0;
|
||||||
$bd = 0;
|
$bd = 0;
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
|
//check for that calulate is in match money type
|
||||||
|
if ($row->getDoc()->getMoney() == $acc['money']) {
|
||||||
$bs += $row->getBs();
|
$bs += $row->getBs();
|
||||||
$bd += $row->getBd();
|
$bd += $row->getBd();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$temp['bs'] = $bs;
|
$temp['bs'] = $bs;
|
||||||
$temp['bd'] = $bd;
|
$temp['bd'] = $bd;
|
||||||
$temp['balance'] = $bs - $bd;
|
$temp['balance'] = $bs - $bd;
|
||||||
|
|
Loading…
Reference in a new issue