almost finish bank card export part and pec gatepay
This commit is contained in:
parent
af3d3a9c06
commit
779e422909
|
@ -93,6 +93,7 @@ class ArchiveController extends AbstractController
|
||||||
$result = $payMGR->createRequest($order->getPrice(), $this->generateUrl('api_archive_buy_verify', ["id"=>$order->getId()], UrlGeneratorInterface::ABSOLUTE_URL), 'خرید فضای ابری');
|
$result = $payMGR->createRequest($order->getPrice(), $this->generateUrl('api_archive_buy_verify', ["id"=>$order->getId()], UrlGeneratorInterface::ABSOLUTE_URL), 'خرید فضای ابری');
|
||||||
if ($result['Success']) {
|
if ($result['Success']) {
|
||||||
$order->setGatePay($result['gate']);
|
$order->setGatePay($result['gate']);
|
||||||
|
$order->setVerifyCode($result['authkey']);
|
||||||
$entityManager->persist($order);
|
$entityManager->persist($order);
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
$log->insert('سرویس فضای ابری', 'صدور فاکتور سرویس فضای ابری به مقدار ' . $params['space'] . ' گیگابایت به مدت ' . $params['month'] . ' ماه ', $this->getUser(), $acc['bid']);
|
$log->insert('سرویس فضای ابری', 'صدور فاکتور سرویس فضای ابری به مقدار ' . $params['space'] . ' گیگابایت به مدت ' . $params['month'] . ' ماه ', $this->getUser(), $acc['bid']);
|
||||||
|
@ -107,7 +108,7 @@ class ArchiveController extends AbstractController
|
||||||
if (!$req)
|
if (!$req)
|
||||||
throw $this->createNotFoundException('');
|
throw $this->createNotFoundException('');
|
||||||
|
|
||||||
$res = $payMGR->verify($req->getPrice(), $id, $request);
|
$res = $payMGR->verify($req->getPrice(), $req->getVerifyCode(), $request);
|
||||||
if ($res['Success'] == false) {
|
if ($res['Success'] == false) {
|
||||||
$log->insert('سرویس فضای ابری', 'پرداخت ناموفق سرویس فضای ابری', $this->getUser(), $req->getBid());
|
$log->insert('سرویس فضای ابری', 'پرداخت ناموفق سرویس فضای ابری', $this->getUser(), $req->getBid());
|
||||||
return $this->render('buy/fail.html.twig', ['results' => $res]);
|
return $this->render('buy/fail.html.twig', ['results' => $res]);
|
||||||
|
|
|
@ -13,7 +13,12 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Writer\Exception;
|
||||||
|
use Symfony\Component\Serializer\SerializerInterface;
|
||||||
|
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||||
|
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||||
class BankController extends AbstractController
|
class BankController extends AbstractController
|
||||||
{
|
{
|
||||||
#[Route('/api/bank/list', name: 'app_bank_list')]
|
#[Route('/api/bank/list', name: 'app_bank_list')]
|
||||||
|
@ -141,4 +146,123 @@ class BankController extends AbstractController
|
||||||
$log->insert('بانکداری', ' حساب بانکی با نام ' . $name . ' حذف شد. ', $this->getUser(), $acc['bid']->getId());
|
$log->insert('بانکداری', ' حساب بانکی با نام ' . $name . ' حذف شد. ', $this->getUser(), $acc['bid']->getId());
|
||||||
return $this->json(['result' => 1]);
|
return $this->json(['result' => 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
#[Route('/api/bank/card/list/excel', name: 'app_bank_card_list_excel')]
|
||||||
|
public function app_bank_card_list_excel(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): BinaryFileResponse|JsonResponse|StreamedResponse
|
||||||
|
{
|
||||||
|
$acc = $access->hasRole('banks');
|
||||||
|
if (!$acc)
|
||||||
|
throw $this->createAccessDeniedException();
|
||||||
|
$params = [];
|
||||||
|
if ($content = $request->getContent()) {
|
||||||
|
$params = json_decode($content, true);
|
||||||
|
}
|
||||||
|
if (!array_key_exists('code', $params))
|
||||||
|
throw $this->createNotFoundException();
|
||||||
|
$bank = $entityManager->getRepository(BankAccount::class)->findOneBy(['bid' => $acc['bid'], 'code' => $params['code']]);
|
||||||
|
if (!$bank)
|
||||||
|
throw $this->createNotFoundException();
|
||||||
|
if (!array_key_exists('items', $params)) {
|
||||||
|
$transactions = $entityManager->getRepository(HesabdariRow::class)->findBy([
|
||||||
|
'bid' => $acc['bid'],
|
||||||
|
'bank' => $bank,
|
||||||
|
'year'=>$acc['year']
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
$transactions = [];
|
||||||
|
foreach ($params['items'] as $param) {
|
||||||
|
$prs = $entityManager->getRepository(HesabdariRow::class)->findOneBy([
|
||||||
|
'id' => $param['id'],
|
||||||
|
'bid' => $acc['bid'],
|
||||||
|
'bank' => $bank,
|
||||||
|
'year' => $acc['year']
|
||||||
|
]);
|
||||||
|
if ($prs) {
|
||||||
|
$transactions[] = $prs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$spreadsheet = new Spreadsheet();
|
||||||
|
$activeWorksheet = $spreadsheet->getActiveSheet();
|
||||||
|
$arrayEntity = [
|
||||||
|
[
|
||||||
|
'شماره تراکنش',
|
||||||
|
'تاریخ',
|
||||||
|
'توضیحات',
|
||||||
|
'تفضیل',
|
||||||
|
'بستانکار',
|
||||||
|
'بدهکار',
|
||||||
|
'سال مالی',
|
||||||
|
]
|
||||||
|
];
|
||||||
|
foreach ($transactions as $transaction) {
|
||||||
|
$arrayEntity[] = [
|
||||||
|
$transaction->getId(),
|
||||||
|
$transaction->getDoc()->getDate(),
|
||||||
|
$transaction->getDes(),
|
||||||
|
$transaction->getRef()->getName(),
|
||||||
|
$transaction->getBs(),
|
||||||
|
$transaction->getBd(),
|
||||||
|
$transaction->getYear()->getlabel()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$activeWorksheet->fromArray($arrayEntity, null, 'A1');
|
||||||
|
$activeWorksheet->setRightToLeft(true);
|
||||||
|
$writer = new Xlsx($spreadsheet);
|
||||||
|
$filePath = __DIR__ . '/../../var/' . $provider->RandomString(12) . '.xlsx';
|
||||||
|
$writer->save($filePath);
|
||||||
|
return new BinaryFileResponse($filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[Route('/api/bank/card/list/print', name: 'app_bank_card_list_print')]
|
||||||
|
public function app_bank_card_list_print(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
|
||||||
|
{
|
||||||
|
$acc = $access->hasRole('banks');
|
||||||
|
if (!$acc)
|
||||||
|
throw $this->createAccessDeniedException();
|
||||||
|
$params = [];
|
||||||
|
if ($content = $request->getContent()) {
|
||||||
|
$params = json_decode($content, true);
|
||||||
|
}
|
||||||
|
if (!array_key_exists('code', $params))
|
||||||
|
throw $this->createNotFoundException();
|
||||||
|
$bank = $entityManager->getRepository(BankAccount::class)->findOneBy(['bid' => $acc['bid'], 'code' => $params['code']]);
|
||||||
|
if (!$bank)
|
||||||
|
throw $this->createNotFoundException();
|
||||||
|
|
||||||
|
if (!array_key_exists('items', $params)) {
|
||||||
|
$transactions = $entityManager->getRepository(HesabdariRow::class)->findBy([
|
||||||
|
'bid' => $acc['bid'],
|
||||||
|
'bank' => $bank,
|
||||||
|
'year'=>$acc['year']
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
$transactions = [];
|
||||||
|
foreach ($params['items'] as $param) {
|
||||||
|
$prs = $entityManager->getRepository(HesabdariRow::class)->findOneBy([
|
||||||
|
'id' => $param['id'],
|
||||||
|
'bid' => $acc['bid'],
|
||||||
|
'bank' => $bank,
|
||||||
|
'year'=>$acc['year']
|
||||||
|
]);
|
||||||
|
if ($prs) {
|
||||||
|
$transactions[] = $prs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$pid = $provider->createPrint(
|
||||||
|
$acc['bid'],
|
||||||
|
$this->getUser(),
|
||||||
|
$this->renderView('pdf/bank_card.html.twig', [
|
||||||
|
'page_title' => 'کارت حساب' . ' ' . $bank->getName(),
|
||||||
|
'bid' => $acc['bid'],
|
||||||
|
'items' => $transactions,
|
||||||
|
'bank' => $bank
|
||||||
|
])
|
||||||
|
);
|
||||||
|
return $this->json(['id' => $pid]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,9 @@ use App\Entity\Year;
|
||||||
use App\Service\Jdate;
|
use App\Service\Jdate;
|
||||||
use App\Service\Log;
|
use App\Service\Log;
|
||||||
use App\Service\Notification;
|
use App\Service\Notification;
|
||||||
|
use App\Service\PayMGR;
|
||||||
use App\Service\Provider;
|
use App\Service\Provider;
|
||||||
|
use App\Service\twigFunctions;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
@ -24,7 +26,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
class PayController extends AbstractController
|
class PayController extends AbstractController
|
||||||
{
|
{
|
||||||
#[Route('/pay/sell/{id}', name: 'pay_sell')]
|
#[Route('/pay/sell/{id}', name: 'pay_sell')]
|
||||||
public function pay_sell(String $id,EntityManagerInterface $entityManager,Log $log): Response
|
public function pay_sell(string $id, PayMGR $payMGR, twigFunctions $twigFunctions, EntityManagerInterface $entityManager, Log $log): Response
|
||||||
{
|
{
|
||||||
$doc = $entityManager->getRepository(HesabdariDoc::class)->find($id);
|
$doc = $entityManager->getRepository(HesabdariDoc::class)->find($id);
|
||||||
if (!$doc)
|
if (!$doc)
|
||||||
|
@ -38,33 +40,6 @@ class PayController extends AbstractController
|
||||||
$totalPays += $relatedDoc->getAmount();
|
$totalPays += $relatedDoc->getAmount();
|
||||||
$amountPay = $doc->getAmount() - $totalPays;
|
$amountPay = $doc->getAmount() - $totalPays;
|
||||||
|
|
||||||
//get system settings
|
|
||||||
$settings = $entityManager->getRepository(Settings::class)->findAll()[0];
|
|
||||||
$data = array("merchant_id" => $settings->getZarinpalMerchant(),
|
|
||||||
"amount" => $amountPay,
|
|
||||||
"callback_url" => $this->generateUrl('pay_sell_verify',['id'=>$doc->getId()],UrlGeneratorInterface::ABSOLUTE_URL),
|
|
||||||
"description" => 'پرداخت فاکتور شماره ' . $doc->getCode() . ' کسب و کار ' .$doc->getBid()->getLegalName(),
|
|
||||||
);
|
|
||||||
$jsonData = json_encode($data);
|
|
||||||
$ch = curl_init('https://api.zarinpal.com/pg/v4/payment/request.json');
|
|
||||||
curl_setopt($ch, CURLOPT_USERAGENT, 'ZarinPal Rest Api v1');
|
|
||||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
|
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
|
||||||
'Content-Type: application/json',
|
|
||||||
'Content-Length: ' . strlen($jsonData)
|
|
||||||
));
|
|
||||||
|
|
||||||
$result = curl_exec($ch);
|
|
||||||
$err = curl_error($ch);
|
|
||||||
$result = json_decode($result, true, JSON_PRETTY_PRINT);
|
|
||||||
curl_close($ch);
|
|
||||||
if ($err) {
|
|
||||||
throw $this->createAccessDeniedException($err);
|
|
||||||
} else {
|
|
||||||
if (empty($result['errors'])) {
|
|
||||||
if ($result['data']['code'] == 100) {
|
|
||||||
$tempPay = new PayInfoTemp();
|
$tempPay = new PayInfoTemp();
|
||||||
$tempPay->setBid($doc->getBid());
|
$tempPay->setBid($doc->getBid());
|
||||||
$tempPay->setDateSubmit(time());
|
$tempPay->setDateSubmit(time());
|
||||||
|
@ -72,14 +47,16 @@ class PayController extends AbstractController
|
||||||
$tempPay->setPrice($amountPay);
|
$tempPay->setPrice($amountPay);
|
||||||
$tempPay->setStatus(0);
|
$tempPay->setStatus(0);
|
||||||
$tempPay->setDoc($doc);
|
$tempPay->setDoc($doc);
|
||||||
$tempPay->setVerifyCode($result['data']['authority']);
|
$entityManager->persist($tempPay);
|
||||||
$tempPay->setGatePay('zarinpal');
|
$entityManager->flush();
|
||||||
|
$result = $payMGR->createRequest($amountPay, $this->generateUrl('pay_sell_verify', ["id" => $doc->getId()], UrlGeneratorInterface::ABSOLUTE_URL), 'پرداخت فاکتور شماره ' . $doc->getCode() . ' کسب و کار ' . $doc->getBid()->getLegalName());
|
||||||
|
if ($result['Success']) {
|
||||||
|
$tempPay->setGatePay($result['gate']);
|
||||||
|
$tempPay->setVerifyCode($result['authkey']);
|
||||||
$entityManager->persist($tempPay);
|
$entityManager->persist($tempPay);
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
$log->insert('کیف پول', 'ایجاد تراکنش پرداخت برای فاکتور فروش ' . $doc->getCode(), $this->getUser(), $doc->getBid());
|
$log->insert('کیف پول', 'ایجاد تراکنش پرداخت برای فاکتور فروش ' . $doc->getCode(), $this->getUser(), $doc->getBid());
|
||||||
return $this->redirect('https://www.zarinpal.com/pg/StartPay/' . $result['data']["authority"]);
|
return $this->redirect($result['targetURL']);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $this->render('pay/fail.html.twig', [
|
return $this->render('pay/fail.html.twig', [
|
||||||
'type' => 'sell',
|
'type' => 'sell',
|
||||||
|
@ -88,48 +65,26 @@ class PayController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Route('pay/sell/verify/{id}', name: 'pay_sell_verify')]
|
#[Route('pay/sell/verify/{id}', name: 'pay_sell_verify')]
|
||||||
public function pay_sell_verify(String $id, Notification $notification,Provider $provider,Jdate $jdate,Request $request,EntityManagerInterface $entityManager,Log $log): Response
|
public function pay_sell_verify(string $id, PayMGR $payMGR, Notification $notification, Provider $provider, Jdate $jdate, Request $request, EntityManagerInterface $entityManager, Log $log): Response
|
||||||
{
|
{
|
||||||
$doc = $entityManager->getRepository(HesabdariDoc::class)->find($id);
|
$req = $entityManager->getRepository(PayInfoTemp::class)->find($id);
|
||||||
|
if (!$req)
|
||||||
|
throw $this->createNotFoundException('');
|
||||||
|
$doc = $req->getDoc();
|
||||||
if (!$doc)
|
if (!$doc)
|
||||||
throw $this->createNotFoundException();
|
throw $this->createNotFoundException();
|
||||||
|
|
||||||
$Authority = $request->get('Authority');
|
$res = $payMGR->verify($req->getPrice(), $req->getVerifyCode(), $request);
|
||||||
$status = $request->get('Status');
|
if ($res['Success'] == false) {
|
||||||
$req = $entityManager->getRepository(PayInfoTemp::class)->findOneBy(['verifyCode'=>$Authority]);
|
|
||||||
//get system settings
|
|
||||||
$settings = $entityManager->getRepository(Settings::class)->findAll()[0];
|
|
||||||
$data = array("merchant_id" => $settings->getZarinpalMerchant(), "authority" => $Authority, "amount" => $req->getPrice());
|
|
||||||
$jsonData = json_encode($data);
|
|
||||||
$ch = curl_init('https://api.zarinpal.com/pg/v4/payment/verify.json');
|
|
||||||
curl_setopt($ch, CURLOPT_USERAGENT, 'ZarinPal Rest Api v4');
|
|
||||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
|
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
|
||||||
'Content-Type: application/json',
|
|
||||||
'Content-Length: ' . strlen($jsonData)
|
|
||||||
));
|
|
||||||
|
|
||||||
$result = curl_exec($ch);
|
|
||||||
$err = curl_error($ch);
|
|
||||||
curl_close($ch);
|
|
||||||
$result = json_decode($result, true);
|
|
||||||
|
|
||||||
//-----------------------------------
|
|
||||||
$originalDoc = $req->getDoc();
|
|
||||||
//-----------------------------------
|
|
||||||
if ($err) {
|
|
||||||
$log->insert('کیف پول', 'خطا در پرداخت فاکتور فروش ' . $doc->getCode(), $this->getUser(), $doc->getBid());
|
$log->insert('کیف پول', 'خطا در پرداخت فاکتور فروش ' . $doc->getCode(), $this->getUser(), $doc->getBid());
|
||||||
return $this->redirectToRoute('shortlinks_show',['type'=>'sell','bid'=>$originalDoc->getBid()->getId(),'link'=>$originalDoc->getId(),'msg'=>'fail']);
|
return $this->redirectToRoute('shortlinks_show', ['type' => 'sell', 'bid' => $doc->getBid()->getId(), 'link' => $doc->getId(), 'msg' => 'fail']);
|
||||||
} else {
|
} else {
|
||||||
if(array_key_exists('code',$result['data'])){
|
|
||||||
if ($result['data']['code'] == 100) {
|
|
||||||
$req->setStatus(100);
|
$req->setStatus(100);
|
||||||
$req->setRefID($result['data']['ref_id']);
|
$req->setRefID($res['refID']);
|
||||||
$req->setCardPan($result['data']['card_pan']);
|
$req->setCardPan($res['card_pan']);
|
||||||
$entityManager->persist($req);
|
$entityManager->persist($req);
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
|
$originalDoc = $req->getDoc();
|
||||||
|
|
||||||
//create wallet transaction
|
//create wallet transaction
|
||||||
$wt = new WalletTransaction();
|
$wt = new WalletTransaction();
|
||||||
|
@ -229,8 +184,4 @@ class PayController extends AbstractController
|
||||||
return $this->redirectToRoute('shortlinks_show', ['type' => 'sell', 'bid' => $originalDoc->getBid()->getId(), 'link' => $originalDoc->getId(), 'msg' => 'success']);
|
return $this->redirectToRoute('shortlinks_show', ['type' => 'sell', 'bid' => $originalDoc->getBid()->getId(), 'link' => $originalDoc->getId(), 'msg' => 'success']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$log->insert('کیف پول','خطا در پرداخت فاکتور فروش ' . $originalDoc->getCode() ,$this->getUser(),$doc->getBid());
|
|
||||||
return $this->redirectToRoute('shortlinks_show',['type'=>'sell','bid'=>$originalDoc->getBid()->getId(),'link'=>$originalDoc->getId(),'msg'=>'fail']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,9 @@ class PluginController extends AbstractController
|
||||||
public function api_plugin_buy_verify(string $id, twigFunctions $twigFunctions, PayMGR $payMGR, Request $request, EntityManagerInterface $entityManager, Log $log): Response
|
public function api_plugin_buy_verify(string $id, twigFunctions $twigFunctions, PayMGR $payMGR, Request $request, EntityManagerInterface $entityManager, Log $log): Response
|
||||||
{
|
{
|
||||||
$req = $entityManager->getRepository(Plugin::class)->find($id);
|
$req = $entityManager->getRepository(Plugin::class)->find($id);
|
||||||
$res = $payMGR->verify($req->getPrice(), $id, $request);
|
if (!$req)
|
||||||
|
throw $this->createNotFoundException('');
|
||||||
|
$res = $payMGR->verify($req->getPrice(), $req->getVerifyCode(), $request);
|
||||||
if ($res['Success'] == false) {
|
if ($res['Success'] == false) {
|
||||||
$log->insert(
|
$log->insert(
|
||||||
'بازار افزونهها' . $req->getName(),
|
'بازار افزونهها' . $req->getName(),
|
||||||
|
|
|
@ -143,7 +143,10 @@ class SMSController extends AbstractController
|
||||||
public function api_sms_buy_verify(string $id, PayMGR $payMGR, twigFunctions $twigFunctions, Notification $notification, Request $request, EntityManagerInterface $entityManager, Log $log): Response
|
public function api_sms_buy_verify(string $id, PayMGR $payMGR, twigFunctions $twigFunctions, Notification $notification, Request $request, EntityManagerInterface $entityManager, Log $log): Response
|
||||||
{
|
{
|
||||||
$req = $entityManager->getRepository(SMSPays::class)->find($id);
|
$req = $entityManager->getRepository(SMSPays::class)->find($id);
|
||||||
$res = $payMGR->verify($req->getPrice(), $id, $request);
|
if (!$req)
|
||||||
|
throw $this->createNotFoundException('');
|
||||||
|
|
||||||
|
$res = $payMGR->verify($req->getPrice(), $req->getVerifyCode(), $request);
|
||||||
if ($res['Success'] == false) {
|
if ($res['Success'] == false) {
|
||||||
$log->insert('سرویس پیامک', 'پرداخت ناموفق شارژ سرویس پیامک', $this->getUser(), $req->getBid());
|
$log->insert('سرویس پیامک', 'پرداخت ناموفق شارژ سرویس پیامک', $this->getUser(), $req->getBid());
|
||||||
return $this->render('buy/fail.html.twig', ['results' => $res]);
|
return $this->render('buy/fail.html.twig', ['results' => $res]);
|
||||||
|
|
|
@ -32,7 +32,7 @@ class PayInfoTemp
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
private ?string $verifyCode = null;
|
private ?string $verifyCode = null;
|
||||||
|
|
||||||
#[ORM\Column(length: 255)]
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
private ?string $gatePay = null;
|
private ?string $gatePay = null;
|
||||||
|
|
||||||
#[ORM\ManyToOne]
|
#[ORM\ManyToOne]
|
||||||
|
|
|
@ -18,9 +18,6 @@ class Settings
|
||||||
#[ORM\Column(nullable: true)]
|
#[ORM\Column(nullable: true)]
|
||||||
private ?bool $activeSendSms = null;
|
private ?bool $activeSendSms = null;
|
||||||
|
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
|
||||||
private ?string $zarinpalMerchant = null;
|
|
||||||
|
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
private ?string $appSite = null;
|
private ?string $appSite = null;
|
||||||
|
|
||||||
|
@ -62,18 +59,6 @@ class Settings
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getZarinpalMerchant(): ?string
|
|
||||||
{
|
|
||||||
return $this->zarinpalMerchant;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setZarinpalMerchant(?string $zarinpalMerchant): static
|
|
||||||
{
|
|
||||||
$this->zarinpalMerchant = $zarinpalMerchant;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getAppSite(): ?string
|
public function getAppSite(): ?string
|
||||||
{
|
{
|
||||||
return $this->appSite;
|
return $this->appSite;
|
||||||
|
|
121
hesabixCore/templates/pdf/bank_card.html.twig
Normal file
121
hesabixCore/templates/pdf/bank_card.html.twig
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
{% extends "pdf/base.html.twig" %}
|
||||||
|
{% block body %}
|
||||||
|
<div style="width:100%; border:1px solid black;border-radius: 8px;margin-top:5px;text-align:center;">
|
||||||
|
<div class="tg-wrap" style="width:100%;border-radius: 8px 8px 0px 0px;text-align:center;background-color:gray">
|
||||||
|
<b style="color:white;">کارت حساب بانکی</b>
|
||||||
|
</div>
|
||||||
|
<table style="width:100%;">
|
||||||
|
<tbody>
|
||||||
|
<tr style="text-align:center;">
|
||||||
|
<td class="">
|
||||||
|
<p>
|
||||||
|
<b>نام:
|
||||||
|
</b>
|
||||||
|
{{ bank.name }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<p>
|
||||||
|
<b>
|
||||||
|
شماره حساب:
|
||||||
|
</b>
|
||||||
|
{{ bank.accountNum }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<p>
|
||||||
|
<b>شماره شبا:
|
||||||
|
</b>
|
||||||
|
{{ bank.shaba }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<p>
|
||||||
|
<b>شماره کارت:
|
||||||
|
</b>
|
||||||
|
{{ bank.cardNum }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;margin-top:5px;text-align:center;">
|
||||||
|
<table style="width:100%;">
|
||||||
|
<tbody>
|
||||||
|
<tr style="text-align: center; background-color: grey; text-color: white">
|
||||||
|
<td style="width: 35px;">ردیف</td>
|
||||||
|
<td class="center item">فاکتور/سند</td>
|
||||||
|
<td class="center item">تاریخ</td>
|
||||||
|
<td class="center item">توضیحات</td>
|
||||||
|
<td class="center item">تفضیل</td>
|
||||||
|
<td class="center item">بدهکار</td>
|
||||||
|
<td class="center item">بستانکار</td>
|
||||||
|
<td class="center item">سال مالی</td>
|
||||||
|
</tr>
|
||||||
|
{% set sumBs = 0 %}
|
||||||
|
{% set sumBd = 0 %}
|
||||||
|
{% for item in items %}
|
||||||
|
{% set sumBs = sumBs + item.bs %}
|
||||||
|
{% set sumBd = sumBd + item.bd %}
|
||||||
|
<tr class="stimol">
|
||||||
|
<td class="center item">{{ loop.index }}</td>
|
||||||
|
<td class="center item">{{ item.doc.code }}</td>
|
||||||
|
<td class="center item">{{ item.doc.date }}</td>
|
||||||
|
<td class="center item">{{ item.des }}</td>
|
||||||
|
<td class="center item">{{ item.ref.name }}</td>
|
||||||
|
<td class="center item">{{ item.bd | number_format }}</td>
|
||||||
|
<td class="center item">{{ item.bs | number_format }}</td>
|
||||||
|
<td class="center item">{{ item.year.label }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div style="width:100%; border:1px solid black;border-radius: 8px;margin-top:5px;text-align:center;">
|
||||||
|
<div class="tg-wrap" style="width:100%;border-radius: 8px 8px 0px 0px;text-align:center;background-color:gray">
|
||||||
|
<b style="color:white;">وضعیت حساب</b>
|
||||||
|
</div>
|
||||||
|
<table style="width:100%;">
|
||||||
|
<tbody>
|
||||||
|
<tr style="text-align:center;">
|
||||||
|
<td class="center">
|
||||||
|
<p>
|
||||||
|
<b>جمع بستانکار:
|
||||||
|
</b>
|
||||||
|
{{ sumBs | number_format }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<p>
|
||||||
|
<b>جمع بدهکار:
|
||||||
|
</b>
|
||||||
|
{{ sumBd | number_format }}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<p>
|
||||||
|
<b>تراز حساب:
|
||||||
|
</b>
|
||||||
|
<span>{{ (sumBs - sumBd) | abs |number_format }}</span>
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
<td class="center">
|
||||||
|
<p>
|
||||||
|
<b> وضعیت:
|
||||||
|
</b>
|
||||||
|
{% if sumBs > sumBd%}
|
||||||
|
بستانکار
|
||||||
|
{% elseif sumBs == sumBd %}
|
||||||
|
تسویه شده
|
||||||
|
{% else %}
|
||||||
|
بدهکار
|
||||||
|
{% endif %}
|
||||||
|
</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
Loading…
Reference in a new issue