update for hooks

This commit is contained in:
Gloomy 2025-07-28 13:56:52 +00:00
parent be782e14bd
commit 163ec1ea2e
9 changed files with 69 additions and 7 deletions

View file

@ -90,7 +90,26 @@ class HookController extends AbstractController
$person = $personService->getPersonInfo($result['code'], $acc);
$result['person'] = $person;
return $this->json($result);
}
#[Route('/hooks/modify/commodity', name: 'app_modify_commodity')]
public function app_modify_commodity(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, $id = 0): JsonResponse
{
$acc = $access->hasRole('commodity');
if (!$acc)
throw $this->createAccessDeniedException();
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
$commodityService = new \App\Cog\CommodityService($entityManager);
$result = $commodityService->addOrUpdateCommodity($params, $acc, $id);
if (isset($result['error'])) {
return $this->json($result, 400);
}
$log->insert('کالا و خدمات', 'کالا / خدمات با نام ' . $params['name'] . ' افزوده/ویرایش شد.', $this->getUser(), $request->headers->get('activeBid'));
return $this->json($result);
}
@ -107,6 +126,13 @@ class HookController extends AbstractController
return $this->json($response);
}
#[Route('hooks/setting/getCurrency', name: 'api_hooks_getcurrency')]
public function api_hooks_getcurrency(Access $access, Log $log, Request $request, EntityManagerInterface $entityManager): JsonResponse
{

View file

@ -1,5 +1,10 @@
<?php
/**
* Developed by Mohammad Rezai
* https://pirouz.xyz 2025-07-28
*/
namespace App\Controller\Plugins;
use App\Service\Access;

View file

@ -1,5 +1,10 @@
<?php
/**
* Developed by Mohammad Rezai
* https://pirouz.xyz 2025-07-28
*/
namespace App\Dto;
use Symfony\Component\Validator\Constraints as Assert;

View file

@ -1,5 +1,10 @@
<?php
/**
* Developed by Mohammad Rezai
* https://pirouz.xyz 2025-07-28
*/
namespace App\Entity;
use App\Repository\PluginTaxInvoiceRepository;

View file

@ -1,5 +1,10 @@
<?php
/**
* Developed by Mohammad Rezai
* https://pirouz.xyz 2025-07-28
*/
namespace App\Repository;
use App\Entity\PluginTaxInvoice;

View file

@ -1,4 +1,9 @@
<template>
/*
* Developed by Mohammad Rezai
* https://pirouz.xyz 2025-07-28
*/
<template>
<div class="sticky-container">
<v-toolbar color="toolbar" title="صورتحساب‌های ارسالی به سامانه مودیان مالیاتی">
<template v-slot:prepend>

View file

@ -1,4 +1,9 @@
<template>
/*
* Developed by Mohammad Rezai
* https://pirouz.xyz 2025-07-28
*/
<template>
<div>
<v-toolbar color="toolbar" title="تنظیمات مالیاتی">
<template v-slot:prepend>

View file

@ -291,8 +291,8 @@
</div>
</div>
<div v-if="isPluginActive('taxsettings')" class="doc-footer">
<div class="action-buttons">
<div class="doc-footer">
<div v-if="isPluginActive('taxsettings')" class="action-buttons">
<router-link to="/acc/plugins/taxsettings/intro" class="btn btn-info">
<i class="fas fa-home"></i>
صفحه اصلی افزونه
@ -306,6 +306,9 @@
مدیریت فاکتورها
</router-link>
</div>
<div style="margin-top: 20px; font-size: 0.75rem; color: #888; text-align: center;">
Developed by <a href="https://pirouz.xyz" target="_blank" style="color: #667eea; text-decoration: none;">Mohammad Rezai</a> 2025
</div>
</div>
</div>
</template>

View file

@ -205,8 +205,8 @@
</div>
</div>
<div v-if="isPluginActive('taxsettings')" class="intro-footer">
<div class="action-buttons">
<div class="intro-footer">
<div v-if="isPluginActive('taxsettings')" class="action-buttons">
<router-link to="/acc/plugins/taxsettings/doc" class="btn btn-info">
<i class="fas fa-book"></i>
راهنمای کامل
@ -220,6 +220,9 @@
مدیریت فاکتورها
</router-link>
</div>
<div style="margin-top: 20px; font-size: 0.75rem; color: #888; text-align: center;">
Developed by <a href="https://pirouz.xyz" target="_blank" style="color: #667eea; text-decoration: none;">Mohammad Rezai</a> 2025
</div>
</div>
</div>
</template>