bug fix in ippanel sms service and sell invoice
This commit is contained in:
parent
87c081b387
commit
70b21f13a6
|
@ -104,7 +104,8 @@ class BuyController extends AbstractController
|
|||
'code' => $params['update'],
|
||||
'money' => $acc['money']
|
||||
]);
|
||||
if (!$doc) return $this->json($extractor->notFound());
|
||||
if (!$doc)
|
||||
return $this->json($extractor->notFound());
|
||||
|
||||
$rows = $entityManager->getRepository(HesabdariRow::class)->findBy([
|
||||
'doc' => $doc
|
||||
|
@ -239,7 +240,8 @@ class BuyController extends AbstractController
|
|||
'code' => $params['label']['code'],
|
||||
'type' => 'buy'
|
||||
]);
|
||||
if (!$label) return $this->json($extractor->notFound());
|
||||
if (!$label)
|
||||
return $this->json($extractor->notFound());
|
||||
}
|
||||
foreach ($params['items'] as $item) {
|
||||
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
|
||||
|
@ -248,7 +250,8 @@ class BuyController extends AbstractController
|
|||
'code' => $item['code'],
|
||||
'money' => $acc['money']
|
||||
]);
|
||||
if (!$doc) return $this->json($extractor->notFound());
|
||||
if (!$doc)
|
||||
return $this->json($extractor->notFound());
|
||||
if ($params['label'] != 'clear') {
|
||||
$doc->setInvoiceLabel($label);
|
||||
$entityManager->persist($doc);
|
||||
|
@ -327,15 +330,22 @@ class BuyController extends AbstractController
|
|||
}
|
||||
$temp['relatedDocsPays'] = $pays;
|
||||
|
||||
$temp['commodities'] = [];
|
||||
foreach ($item->getHesabdariRows() as $item) {
|
||||
if ($item->getRef()->getCode() == '104') {
|
||||
$temp['discountAll'] = $item->getBd();
|
||||
} elseif ($item->getRef()->getCode() == '90') {
|
||||
$temp['transferCost'] = $item->getBs();
|
||||
}
|
||||
if ($item->getCommodity()) {
|
||||
$temp['commodities'][] = Explore::ExploreCommodity($item->getCommodity(), $item->getCommdityCount());
|
||||
}
|
||||
if(!array_key_exists('discountAll',$temp)) $temp['discountAll'] = 0;
|
||||
if(!array_key_exists('transferCost',$temp)) $temp['transferCost'] = 0;
|
||||
}
|
||||
if (!array_key_exists('discountAll', $temp))
|
||||
$temp['discountAll'] = 0;
|
||||
if (!array_key_exists('transferCost', $temp))
|
||||
$temp['transferCost'] = 0;
|
||||
|
||||
$dataTemp[] = $temp;
|
||||
}
|
||||
return $this->json($dataTemp);
|
||||
|
@ -350,14 +360,16 @@ class BuyController extends AbstractController
|
|||
}
|
||||
|
||||
$acc = $access->hasRole('buy');
|
||||
if (!$acc) throw $this->createAccessDeniedException();
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
|
||||
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
|
||||
'bid' => $acc['bid'],
|
||||
'code' => $params['code'],
|
||||
'money' => $acc['money']
|
||||
]);
|
||||
if (!$doc) throw $this->createNotFoundException();
|
||||
if (!$doc)
|
||||
throw $this->createNotFoundException();
|
||||
$pdfPid = 0;
|
||||
if ($params['pdf']) {
|
||||
$pdfPid = $provider->createPrint(
|
||||
|
@ -414,14 +426,16 @@ class BuyController extends AbstractController
|
|||
}
|
||||
|
||||
$acc = $access->hasRole('buy');
|
||||
if (!$acc) throw $this->createAccessDeniedException();
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
|
||||
$doc = $entityManager->getRepository(HesabdariDoc::class)->findOneBy([
|
||||
'bid' => $acc['bid'],
|
||||
'code' => $params['code'],
|
||||
'money' => $acc['money']
|
||||
]);
|
||||
if (!$doc) throw $this->createNotFoundException();
|
||||
if (!$doc)
|
||||
throw $this->createNotFoundException();
|
||||
$person = null;
|
||||
$discount = 0;
|
||||
$transfer = 0;
|
||||
|
@ -466,7 +480,9 @@ class BuyController extends AbstractController
|
|||
}
|
||||
$note = '';
|
||||
$printSettings = $entityManager->getRepository(PrintOptions::class)->findOneBy(['bid' => $acc['bid']]);
|
||||
if($printSettings){$note = $printSettings->getBuyNoteString();}
|
||||
if ($printSettings) {
|
||||
$note = $printSettings->getBuyNoteString();
|
||||
}
|
||||
$pdfPid = $provider->createPrint(
|
||||
$acc['bid'],
|
||||
$this->getUser(),
|
||||
|
|
|
@ -35,7 +35,7 @@ class PrintersController extends AbstractController
|
|||
#[Route('/api/printers/options/info', name: 'app_printers_options_info')]
|
||||
public function app_printers_options_info(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||
{
|
||||
$acc = $access->hasRole('settings');
|
||||
$acc = $access->hasRole('join');
|
||||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$settings = $entityManager->getRepository(PrintOptions::class)->findOneBy(['bid' => $acc['bid']]);
|
||||
|
|
|
@ -65,8 +65,8 @@ class SMS
|
|||
$password = $this->registryMGR->get('sms', 'password');
|
||||
$from = $this->registryMGR->get('sms', 'fromNum');
|
||||
$input_data = [];
|
||||
foreach ($params as $param) {
|
||||
$input_data['%p' . strval(array_search($param, $params)) . '%'] = $param;
|
||||
foreach ($params as $key=>$param) {
|
||||
$input_data['p' . strval(array_search($param, $params))] = $param;
|
||||
}
|
||||
$url = "https://ippanel.com/patterns/pattern?username=" . $username . "&password=" . urlencode($password) . "&from=$from&to=" . json_encode($toArray) . "&input_data=" . urlencode(json_encode($input_data)) . "&pattern_code=$bodyID";
|
||||
$handler = curl_init($url);
|
||||
|
|
Loading…
Reference in a new issue