some progress in wocommrace api base

This commit is contained in:
root 2024-11-03 11:10:50 +00:00
parent c417aadee4
commit 754633b4e7
409 changed files with 1065 additions and 10321 deletions

View file

@ -4,6 +4,7 @@ namespace App\Controller;
use App\Entity\PriceListDetail;
use App\Service\Explore;
use App\Service\Extractor;
use App\Service\Log;
use App\Service\Jdate;
use App\Service\Access;
@ -28,6 +29,58 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class CommodityController extends AbstractController
{
#[Route('/api/commodity/search/extra', name: 'app_commodity_search_extra')]
public function app_commodity_search_extra(Provider $provider, Extractor $extractor, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('commodity');
if (!$acc)
throw $this->createAccessDeniedException();
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
$take = 10;
if (array_key_exists('Take', $params['queryInfo']))
$take = $params['queryInfo']['Take'];
$items = $entityManager->getRepository(Commodity::class)->search([
'bid' => $acc['bid'],
'Take' => $take,
'Filters' => $params['queryInfo']['Filters']
]);
$res = [];
foreach ($items as $item) {
$res[] = Explore::ExploreCommodity($item);
}
return $this->json($extractor->operationSuccess([
'List' => $res,
'FilteredCount' => count($res)
]));
}
#[Route('/api/commodity/search/bycodes', name: 'app_commodity_search')]
public function app_commodity_search(Provider $provider, Explore $explore, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('commodity');
if (!$acc)
throw $this->createAccessDeniedException();
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
$items = $entityManager->getRepository(Commodity::class)->findBy([
'bid' => $request->headers->get('activeBid'),
'code' => $params['values']
]);
$res = [];
foreach ($items as $item) {
$res[] = Explore::ExploreCommodity($item);
}
return $this->json([
'Success' => true,
'result' => $res
]);
}
#[Route('/api/commodity/list', name: 'app_commodity_list')]
public function app_commodity_list(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
{
@ -163,10 +216,9 @@ class CommodityController extends AbstractController
$pricesAll = $entityManager->getRepository(PriceList::class)->findBy([
'bid' => $acc['bid']
]);
if(count($pricesAll) == 0){
if (count($pricesAll) == 0) {
$temp['prices'] = [];
}
else{
} else {
foreach ($pricesAll as $list) {
$priceDetails = $entityManager->getRepository(PriceListDetail::class)->findOneBy([
'list' => $list,
@ -187,7 +239,7 @@ class CommodityController extends AbstractController
}
}
}
$res[] = $temp;
}
return $this->json($res);
@ -196,7 +248,7 @@ class CommodityController extends AbstractController
* @throws Exception
*/
#[Route('/api/commodity/list/excel', name: 'app_commodity_list_excel')]
public function app_commodity_list_excel(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): BinaryFileResponse | JsonResponse | StreamedResponse
public function app_commodity_list_excel(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): BinaryFileResponse|JsonResponse|StreamedResponse
{
$acc = $access->hasRole('commodity');
if (!$acc)
@ -302,13 +354,12 @@ class CommodityController extends AbstractController
} else {
foreach ($pricesAll as $item) {
$priceDetails = $entityManager->getRepository(PriceListDetail::class)->findOneBy([
'list'=> $item,
'list' => $item,
'commodity' => $data
]);
if($priceDetails){
if ($priceDetails) {
$res['prices'][] = Explore::ExploreCommodityPriceListDetail($priceDetails);
}
else{
} else {
$spd = new PriceListDetail;
$spd->setList($item);
$spd->setMoney($acc['bid']->getMoney());
@ -319,11 +370,146 @@ class CommodityController extends AbstractController
}
}
}
return $this->json($res);
}
#[Route('/api/commodity/group/mod', name: 'app_commodity_group_mod')]
public function app_commodity_group_mod(Provider $provider, Extractor $extractor, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, $code = 0): JsonResponse
{
$acc = $access->hasRole('commodity');
if (!$acc)
throw $this->createAccessDeniedException();
$paramsAll = [];
if ($content = $request->getContent()) {
$paramsAll = json_decode($content, true);
}
if (!array_key_exists('items', $paramsAll))
return $this->json($extractor->paramsNotSend());
foreach ($paramsAll['items'] as $params) {
if (!array_key_exists('name', $params))
return $this->json(['result' => -1]);
if (count_chars(trim($params['name'])) == 0)
return $this->json(['result' => 3]);
if ($code == 0) {
$data = $entityManager->getRepository(Commodity::class)->findOneBy([
'name' => $params['name'],
'bid' => $acc['bid']
]);
//check exist before
if (!$data) {
$data = new Commodity();
$data->setCode($provider->getAccountingCode($request->headers->get('activeBid'), 'Commodity'));
}
} else {
$data = $entityManager->getRepository(Commodity::class)->findOneBy([
'bid' => $acc['bid'],
'code' => $code
]);
if (!$data)
throw $this->createNotFoundException();
}
if (!array_key_exists('unit', $params))
$unit = $entityManager->getRepository(CommodityUnit::class)->findAll()[0];
else
$unit = $entityManager->getRepository(CommodityUnit::class)->findOneBy(['name' => $params['unit']]);
if (!$unit)
throw $this->createNotFoundException('unit not fount!');
$data->setUnit($unit);
$data->setBid($acc['bid']);
$data->setname($params['name']);
if ($params['khadamat'] == 'true')
$data->setKhadamat(true);
else
$data->setKhadamat(false);
if (!array_key_exists('withoutTax', $params))
$data->setWithoutTax(false);
else {
if ($params['withoutTax'] == 'true')
$data->setWithoutTax(true);
else
$data->setWithoutTax(false);
}
if (array_key_exists('des', $params))
$data->setDes($params['des']);
if (array_key_exists('priceSell', $params))
$data->setPriceSell($params['priceSell']);
if (array_key_exists('priceBuy', $params))
$data->setPriceBuy($params['priceBuy']);
if (array_key_exists('commodityCountCheck', $params)) {
$data->setCommodityCountCheck($params['commodityCountCheck']);
}
if (array_key_exists('barcodes', $params)) {
$data->setBarcodes($params['barcodes']);
}
if (array_key_exists('minOrderCount', $params)) {
$data->setMinOrderCount($params['minOrderCount']);
}
if (array_key_exists('speedAccess', $params)) {
$data->setSpeedAccess($params['speedAccess']);
}
if (array_key_exists('dayLoading', $params)) {
$data->setDayLoading($params['dayLoading']);
}
if (array_key_exists('orderPoint', $params)) {
$data->setOrderPoint($params['orderPoint']);
}
//set cat
if (array_key_exists('cat', $params)) {
if ($params['cat'] != '') {
if (is_int($params['cat']))
$cat = $entityManager->getRepository(CommodityCat::class)->find($params['cat']);
else
$cat = $entityManager->getRepository(CommodityCat::class)->find($params['cat']['id']);
if ($cat) {
if ($cat->getBid() == $acc['bid']) {
$data->setCat($cat);
}
}
}
}
$entityManager->persist($data);
//save prices list
if (array_key_exists('prices', $params)) {
foreach ($params['prices'] as $item) {
$priceList = $entityManager->getRepository(PriceList::class)->findOneBy([
'bid' => $acc['bid'],
'id' => $item['list']['id']
]);
if ($priceList) {
$detail = $entityManager->getRepository(PriceListDetail::class)->findOneBy([
'list' => $priceList,
'commodity' => $data
]);
if (!$detail) {
$detail = new PriceListDetail;
}
$detail->setList($priceList);
$detail->setCommodity($data);
$detail->setPriceSell($item['priceSell']);
$detail->setPriceBuy(0);
$detail->setMoney($acc['bid']->getMoney());
$entityManager->persist($detail);
}
}
}
$entityManager->flush();
$log->insert('کالا و خدمات', 'کالا / خدمات با نام ' . $params['name'] . ' افزوده/ویرایش شد.', $this->getUser(), $request->headers->get('activeBid'));
}
return $this->json([
'Success' => true,
'result' => 1,
]);
}
#[Route('/api/commodity/mod/{code}', name: 'app_commodity_mod')]
public function app_commodity_mod(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, $code = 0): JsonResponse
{
@ -341,13 +527,13 @@ class CommodityController extends AbstractController
if ($code == 0) {
$data = $entityManager->getRepository(Commodity::class)->findOneBy([
'name' => $params['name'],
'bid'=> $acc['bid']
'bid' => $acc['bid']
]);
//check exist before
if ($data)
return $this->json(['result' => 2]);
$data = new Commodity();
$data->setCode($provider->getAccountingCode($request->headers->get('activeBid'), 'Commodity'));
if (!$data) {
$data = new Commodity();
$data->setCode($provider->getAccountingCode($request->headers->get('activeBid'), 'Commodity'));
}
} else {
$data = $entityManager->getRepository(Commodity::class)->findOneBy([
'bid' => $acc['bid'],
@ -356,29 +542,57 @@ class CommodityController extends AbstractController
if (!$data)
throw $this->createNotFoundException();
}
$unit = $entityManager->getRepository(CommodityUnit::class)->findOneBy(['name' => $params['unit']]);
if (!array_key_exists('unit', $params))
$unit = $entityManager->getRepository(CommodityUnit::class)->findAll()[0];
else
$unit = $entityManager->getRepository(CommodityUnit::class)->findOneBy(['name' => $params['unit']]);
if (!$unit)
throw $this->createNotFoundException('unit not fount!');
$data->setUnit($unit);
$data->setBid($acc['bid']);
$data->setname($params['name']);
if ($params['khadamat'] == 'true') $data->setKhadamat(true);
else $data->setKhadamat(false);
if ($params['withoutTax'] == 'true') $data->setWithoutTax(true);
else $data->setWithoutTax(false);
$data->setDes($params['des']);
$data->setPriceSell($params['priceSell']);
$data->setPriceBuy($params['priceBuy']);
if ($params['khadamat'] == 'true')
$data->setKhadamat(true);
else
$data->setKhadamat(false);
if (!array_key_exists('withoutTax', $params))
$data->setWithoutTax(false);
else {
if ($params['withoutTax'] == 'true')
$data->setWithoutTax(true);
else
$data->setWithoutTax(false);
}
if (array_key_exists('des', $params))
$data->setDes($params['des']);
if (array_key_exists('priceSell', $params))
$data->setPriceSell($params['priceSell']);
if (array_key_exists('priceBuy', $params))
$data->setPriceBuy($params['priceBuy']);
if (array_key_exists('commodityCountCheck', $params)) {
$data->setCommodityCountCheck($params['commodityCountCheck']);
}
if (array_key_exists('barcodes', $params)) {
$data->setBarcodes($params['barcodes']);
}
$data->setMinOrderCount($params['minOrderCount']);
$data->setSpeedAccess($params['speedAccess']);
$data->setDayLoading($params['dayLoading']);
$data->setOrderPoint($params['orderPoint']);
if (array_key_exists('minOrderCount', $params)) {
$data->setMinOrderCount($params['minOrderCount']);
}
if (array_key_exists('speedAccess', $params)) {
$data->setSpeedAccess($params['speedAccess']);
}
if (array_key_exists('dayLoading', $params)) {
$data->setDayLoading($params['dayLoading']);
}
if (array_key_exists('orderPoint', $params)) {
$data->setOrderPoint($params['orderPoint']);
}
//set cat
if (array_key_exists('cat', $params)) {
if ($params['cat'] != '') {
@ -421,7 +635,11 @@ class CommodityController extends AbstractController
}
$entityManager->flush();
$log->insert('کالا و خدمات', 'کالا / خدمات با نام ' . $params['name'] . ' افزوده/ویرایش شد.', $this->getUser(), $request->headers->get('activeBid'));
return $this->json(['result' => 1]);
return $this->json([
'Success' => true,
'result' => 1,
'code' => $data->getId()
]);
}
#[Route('/api/commodity/units', name: 'app_commodity_units')]
@ -615,7 +833,7 @@ class CommodityController extends AbstractController
}
private function getChildsLabel(EntityManagerInterface $entityManager, mixed $node)
{
$childs = $entityManager->getRepository(CommodityCat::class)->findBy([
$childs = $entityManager->getRepository(CommodityCat::class)->findBy([
'upper' => $node
]);
$temp = [];
@ -627,16 +845,18 @@ class CommodityController extends AbstractController
private function hasChild(EntityManagerInterface $entityManager, mixed $node)
{
if (count($entityManager->getRepository(CommodityCat::class)->findBy([
'upper' => $node
])) != 0)
if (
count($entityManager->getRepository(CommodityCat::class)->findBy([
'upper' => $node
])) != 0
)
return true;
return false;
}
private function getChilds(EntityManagerInterface $entityManager, mixed $node)
{
$childs = $entityManager->getRepository(CommodityCat::class)->findBy([
$childs = $entityManager->getRepository(CommodityCat::class)->findBy([
'upper' => $node
]);
$temp = [];
@ -795,7 +1015,7 @@ class CommodityController extends AbstractController
}
#[Route('/api/commodity/pricelist/view/{id}', name: 'app_commodity_pricelist_view')]
public function app_commodity_pricelist_view($id,Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
public function app_commodity_pricelist_view($id, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('commodity');
if (!$acc)
@ -808,12 +1028,12 @@ class CommodityController extends AbstractController
'list' => $price
]);
$res = [];
foreach($items as $item){
foreach ($items as $item) {
$temp = [];
$temp['id'] = $item->getId();
$temp['commodity'] = Explore::ExploreCommodity($item->getCommodity());
$temp['priceSell'] = $item->getPriceSell();
$res[] = $temp;
$res[] = $temp;
}
return $this->json($res);
}

View file

@ -36,23 +36,23 @@ use Symfony\Component\Security\Core\Exception\UserNotFoundException;
class HookController extends AbstractController
{
#[Route('hooks/setting/SetChangeHook', name: 'api_hook_SetChangeHook')]
public function api_hook_SetChangeHook(Access $access,Log $log,Request $request,EntityManagerInterface $entityManager): JsonResponse
{
public function api_hook_SetChangeHook(Access $access, Log $log, Request $request, EntityManagerInterface $entityManager): JsonResponse
{
$api = $entityManager->getRepository(APIToken::class)->findOneBy([
'token' => $request->headers->get('api-key'),
]);
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
$hook = $entityManager->getRepository(Hook::class)->findOneBy([
'url'=> $params['url'],
'password'=> $params['hookPassword'],
'url' => $params['url'],
'password' => $params['hookPassword'],
'bid' => $api->getBid(),
'submitter'=>$this->getUser()
'submitter' => $this->getUser()
]);
if(!$hook){
if (!$hook) {
$hook = new Hook();
$hook->setBid($api->getBid());
$hook->setSubmitter($this->getUser());
@ -61,10 +61,10 @@ class HookController extends AbstractController
$entityManager->persist($hook);
$entityManager->flush();
}
$year = $entityManager->getRepository(Year::class)->findOneBy(['bid'=>$api->getBid(),'head'=>true])->getId();
$year = $entityManager->getRepository(Year::class)->findOneBy(['bid' => $api->getBid(), 'head' => true])->getId();
return $this->json([
'Success'=>true,
'Success' => true,
'bid' => $api->getBid()->getId(),
'year' => $year,
'money' => $api->getBid()->getMoney()->getId()
@ -72,53 +72,52 @@ class HookController extends AbstractController
}
#[Route('hooks/setting/getCurrency', name: 'api_hooks_getcurrency')]
public function api_hooks_getcurrency(Access $access,Log $log,Request $request,EntityManagerInterface $entityManager): JsonResponse
public function api_hooks_getcurrency(Access $access, Log $log, Request $request, EntityManagerInterface $entityManager): JsonResponse
{
$api = $entityManager->getRepository(APIToken::class)->findOneBy([
'token' => $request->headers->get('api-key'),
]);
if(!$api)
if (!$api)
throw $this->createNotFoundException();
return $this->json([
'Success'=>true,
'ErrorCode' => 0,
'ErrorMessage' => '',
'Result' =>[
'moneyId' => $api->getBid()->getMoney()->getId(),
'moneyName' => $api->getBid()->getMoney()->getName(),
'moneylabel' => $api->getBid()->getMoney()->getLabel()
]
]);
return $this->json([
'Success' => true,
'ErrorCode' => 0,
'ErrorMessage' => '',
'Result' => [
'moneyId' => $api->getBid()->getMoney()->getId(),
'moneyName' => $api->getBid()->getMoney()->getName(),
'moneylabel' => $api->getBid()->getMoney()->getLabel()
]
]);
}
#[Route('hooks/setting/getAccounts', name: 'api_hooks_getAccounts')]
public function api_hooks_getAccounts(Provider $provider,Access $access,Log $log,Request $request,EntityManagerInterface $entityManager): JsonResponse
public function api_hooks_getAccounts(Provider $provider, Access $access, Log $log, Request $request, EntityManagerInterface $entityManager): JsonResponse
{
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
if(array_key_exists('speedAccess',$params)){
if (array_key_exists('speedAccess', $params)) {
$persons = $entityManager->getRepository(Person::class)->findBy([
'bid'=>$request->headers->get('activeBid'),
'speedAccess'=>true
'bid' => $request->headers->get('activeBid'),
'speedAccess' => true
]);
}
else{
} else {
$persons = $entityManager->getRepository(Person::class)->findBy([
'bid'=>$request->headers->get('activeBid')
'bid' => $request->headers->get('activeBid')
]);
}
$response = $provider->ArrayEntity2Array($persons,0);
foreach ($persons as $key =>$person){
$response = $provider->ArrayEntity2Array($persons, 0);
foreach ($persons as $key => $person) {
$rows = $entityManager->getRepository(HesabdariRow::class)->findBy([
'person'=>$person
'person' => $person
]);
$bs = 0;
$bd = 0;
foreach ($rows as $row){
foreach ($rows as $row) {
$bs += $row->getBs();
$bd += $row->getBd();
}
@ -127,48 +126,48 @@ class HookController extends AbstractController
$response[$key]['balance'] = $bs - $bd;
}
return $this->json([
'Success'=>true,
'Success' => true,
'ErrorCode' => 0,
'ErrorMessage' => '',
'Result' =>$response
'Result' => $response
]);
}
#[Route('hooks/setting/getBanks', name: 'api_hooks_getBanks')]
public function api_hooks_getBanks(Provider $provider,Access $access,Log $log,Request $request,EntityManagerInterface $entityManager): JsonResponse
public function api_hooks_getBanks(Provider $provider, Access $access, Log $log, Request $request, EntityManagerInterface $entityManager): JsonResponse
{
$datas = $entityManager->getRepository(BankAccount::class)->findBy([
'bid'=>$request->headers->get('activeBid')
'bid' => $request->headers->get('activeBid')
]);
foreach($datas as $data){
foreach ($datas as $data) {
$bs = 0;
$bd = 0;
$items = $entityManager->getRepository(HesabdariRow::class)->findBy([
'bank'=>$data
'bank' => $data
]);
foreach ($items as $item){
foreach ($items as $item) {
$bs += $item->getBs();
$bd += $item->getBd();
}
$data->setBalance($bd - $bs);
}
return $this->json([
'Success'=>true,
'Success' => true,
'ErrorCode' => 0,
'ErrorMessage' => '',
'Result' =>$provider->ArrayEntity2Array($datas,0)
'Result' => $provider->ArrayEntity2Array($datas, 0)
]);
}
#[Route('hooks/item/getitems', name: 'api_hooks_item_getitems')]
public function api_hooks_item_getitems(Provider $provider,Access $access,Log $log,Request $request,EntityManagerInterface $entityManager): JsonResponse
public function api_hooks_item_getitems(Provider $provider, Access $access, Log $log, Request $request, EntityManagerInterface $entityManager): JsonResponse
{
$items = $entityManager->getRepository(Commodity::class)->findBy([
'bid'=>$request->headers->get('activeBid')
'bid' => $request->headers->get('activeBid')
]);
$res = [];
foreach ($items as $item){
foreach ($items as $item) {
$temp = [];
$temp['id'] = $item->getId();
$temp['name'] = $item->getName();
@ -179,10 +178,10 @@ class HookController extends AbstractController
$temp['priceSell'] = $item->getPriceSell();
$temp['code'] = $item->getCode();
$temp['cat'] = null;
if($item->getCat())
if ($item->getCat())
$temp['cat'] = $item->getCat()->getName();
$temp['khadamat'] = false;
if($item->isKhadamat())
if ($item->isKhadamat())
$temp['khadamat'] = true;
$temp['commodityCountCheck'] = $item->isCommodityCountCheck();
@ -192,17 +191,17 @@ class HookController extends AbstractController
$res[] = $temp;
}
return $this->json([
'Success'=>true,
'Success' => true,
'ErrorCode' => 0,
'ErrorMessage' => '',
'Result' =>$res
'Result' => $res
]);
}
#[Route('hooks/setting/getBusinessInfo ', name: 'api_hooks_setting_getBusinessInfo')]
public function api_hooks_setting_getBusinessInfo(Provider $provider,Access $access,Log $log,Request $request,EntityManagerInterface $entityManager): JsonResponse
public function api_hooks_setting_getBusinessInfo(Provider $provider, Access $access, Log $log, Request $request, EntityManagerInterface $entityManager): JsonResponse
{
$bus = $entityManager->getRepository(Business::class)->findOneBy(['id'=>$request->headers->get('activeBid')]);
$bus = $entityManager->getRepository(Business::class)->findOneBy(['id' => $request->headers->get('activeBid')]);
$response = [];
$response['id'] = $bus->getId();
$response['name'] = $bus->getName();
@ -229,39 +228,39 @@ class HookController extends AbstractController
$response['shortlinks'] = $bus->isShortLinks();
$response['walletEnabled'] = $bus->isWalletEnable();
$response['walletMatchBank'] = null;
if($bus->isWalletEnable())
$response['walletMatchBank'] = $provider->Entity2Array($bus->getWalletMatchBank(),0);
if ($bus->isWalletEnable())
$response['walletMatchBank'] = $provider->Entity2Array($bus->getWalletMatchBank(), 0);
return $this->json([
'Success'=>true,
'Success' => true,
'ErrorCode' => 0,
'ErrorMessage' => '',
'Result' =>$response
'Result' => $response
]);
}
#[Route('hooks/commodity/import ', name: 'api_hooks_products_import')]
public function api_hooks_products_import(Provider $provider,Access $access,Log $log,Request $request,EntityManagerInterface $entityManager): JsonResponse
public function api_hooks_products_import(Provider $provider, Access $access, Log $log, Request $request, EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('commodity');
if(!$acc)
if (!$acc)
throw $this->createAccessDeniedException();
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
foreach($params['data'] as $item){
foreach ($params['data'] as $item) {
$data = $entityManager->getRepository(Commodity::class)->findOneBy([
'name'=>$item['post_title'],
'bid'=>$acc['bid']
'name' => $item['post_title'],
'bid' => $acc['bid']
]);
//check exist before
if($data)
if ($data)
continue;
$data = new Commodity();
$data->setCode($provider->getAccountingCode($request->headers->get('activeBid'),'Commodity'));
$data->setCode($provider->getAccountingCode($request->headers->get('activeBid'), 'Commodity'));
$unit = $entityManager->getRepository(CommodityUnit::class)->find(1);
if(!$unit)
if (!$unit)
throw $this->createNotFoundException('unit not fount!');
$data->setUnit($unit);
$data->setBid($acc['bid']);
@ -277,49 +276,70 @@ class HookController extends AbstractController
$data->setOrderPoint(0);
$entityManager->persist($data);
$entityManager->flush();
$log->insert('کالا و خدمات','کالا / خدمات از طریق hook با نام ' . $item['name'] . ' افزوده/ویرایش شد.',$this->getUser(),$request->headers->get('activeBid'));
$log->insert('کالا و خدمات', 'کالا / خدمات از طریق hook با نام ' . $item['name'] . ' افزوده/ویرایش شد.', $this->getUser(), $request->headers->get('activeBid'));
}
return $this->json([
'Success'=>true,
'Success' => true,
'ErrorCode' => 0,
'ErrorMessage' => '',
'Result' =>'ok'
'Result' => 'ok'
]);
}
#[Route('hooks/person/import ', name: 'api_hooks_person_import')]
public function api_hooks_person_import(Provider $provider,Access $access,Log $log,Request $request,EntityManagerInterface $entityManager): JsonResponse
public function api_hooks_person_import(Provider $provider, Access $access, Log $log, Request $request, EntityManagerInterface $entityManager): JsonResponse
{
$acc = $access->hasRole('person');
if(!$acc)
if (!$acc)
throw $this->createAccessDeniedException();
$params = [];
if ($content = $request->getContent()) {
$params = json_decode($content, true);
}
foreach($params['data'] as $item){
foreach ($params['data'] as $item) {
$person = $entityManager->getRepository(Person::class)->findOneBy([
'nikename'=>$item['nickname'],
'bid'=>$acc['bid']
'nikename' => $item['nickname'],
'bid' => $acc['bid']
]);
if($person)
if ($person)
continue;
$person = new Person();
$person->setCode($provider->getAccountingCode($request->headers->get('activeBid'),'person'));
$person->setCode($provider->getAccountingCode($request->headers->get('activeBid'), 'person'));
$person->setName($item['nickname']);
$person->setNikename($item['nickname']);
$person->setBid($acc['bid']);
$entityManager->persist($person);
$entityManager->flush();
$log->insert('اشخاص','شخص با نام مستعار ' . $item['nickname'] . ' از طریق hook افزوده/ویرایش شد.',$this->getUser(),$request->headers->get('activeBid'));
$log->insert('اشخاص', 'شخص با نام مستعار ' . $item['nickname'] . ' از طریق hook افزوده/ویرایش شد.', $this->getUser(), $request->headers->get('activeBid'));
}
return $this->json([
'Success'=>true,
'Success' => true,
'ErrorCode' => 0,
'ErrorMessage' => '',
'Result' =>'ok'
'Result' => 'ok'
]);
}
#[Route('hooks/setting/GetFiscalYear', name: 'api_hooks_fiscal_year')]
public function api_hooks_fiscal_year(Provider $provider, Access $access, Log $log, Request $request, EntityManagerInterface $entityManager): JsonResponse
{
$bus = $entityManager->getRepository(Business::class)->findOneBy(['id' => $request->headers->get('activeBid')]);
$year = $entityManager->getRepository(Year::class)->findOneBy(['bid' => $bus, 'head' => true]);
$response = [
'Name' => $year->getLabel(),
'StartDate' => date(DATE_ATOM, $year->getStart()),
'EndDate' => date(DATE_ATOM, $year->getEnd()),
];
return $this->json([
'Success' => true,
'ErrorCode' => 0,
'ErrorMessage' => '',
'Result' => $response
]);
}
}

View file

@ -2,6 +2,7 @@
namespace App\Controller;
use App\Service\Extractor;
use App\Service\Log;
use App\Entity\Person;
use App\Service\Access;
@ -83,6 +84,145 @@ class PersonsController extends AbstractController
$response['balance'] = $bs - $bd;
return $this->json($response);
}
#[Route('/api/person/group/mod', name: 'app_persons_group_mod')]
public function app_persons_group_mod(Provider $provider, Extractor $extractor, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, $code = 0): JsonResponse
{
$acc = $access->hasRole('person');
if (!$acc)
throw $this->createAccessDeniedException();
$paramsAll = [];
if ($content = $request->getContent()) {
$paramsAll = json_decode($content, true);
}
if (!array_key_exists('items', $paramsAll))
return $this->json($extractor->paramsNotSend());
foreach ($paramsAll['items'] as $params) {
if (!array_key_exists('nikename', $params))
return $this->json(['result' => -1]);
if (count_chars(trim($params['nikename'])) == 0)
return $this->json(['result' => 3]);
if ($code == 0) {
$person = $entityManager->getRepository(Person::class)->findOneBy([
'nikename' => $params['nikename'],
'bid' => $acc['bid']
]);
//check exist before
if (!$person) {
$person = new Person();
$person->setCode($provider->getAccountingCode($acc['bid'], 'person'));
}
} else {
$person = $entityManager->getRepository(Person::class)->findOneBy([
'bid' => $acc['bid'],
'code' => $code
]);
if (!$person)
throw $this->createNotFoundException();
}
$person->setBid($acc['bid']);
$person->setNikename($params['nikename']);
if (array_key_exists('name', $params))
$person->setName($params['name']);
if (array_key_exists('birthday', $params))
$person->setBirthday($params['birthday']);
if (array_key_exists('tel', $params))
$person->setTel($params['tel']);
if (array_key_exists('speedAccess', $params))
$person->setSpeedAccess($params['speedAccess']);
if (array_key_exists('address', $params))
$person->setAddress($params['address']);
if (array_key_exists('des', $params))
$person->setDes($params['des']);
if (array_key_exists('mobile', $params))
$person->setMobile($params['mobile']);
if (array_key_exists('mobile2', $params))
$person->setMobile2($params['mobile2']);
if (array_key_exists('fax', $params))
$person->setFax($params['fax']);
if (array_key_exists('website', $params))
$person->setWebsite($params['website']);
if (array_key_exists('email', $params))
$person->setEmail($params['email']);
if (array_key_exists('postalcode', $params))
$person->setPostalcode($params['postalcode']);
if (array_key_exists('shahr', $params))
$person->setShahr($params['shahr']);
if (array_key_exists('ostan', $params))
$person->setOstan($params['ostan']);
if (array_key_exists('keshvar', $params))
$person->setKeshvar($params['keshvar']);
if (array_key_exists('sabt', $params))
$person->setSabt($params['sabt']);
if (array_key_exists('codeeghtesadi', $params))
$person->setCodeeghtesadi($params['codeeghtesadi']);
if (array_key_exists('shenasemeli', $params))
$person->setShenasemeli($params['shenasemeli']);
if (array_key_exists('company', $params))
$person->setCompany($params['company']);
//inset cards
if (array_key_exists('accounts', $params)) {
foreach ($params['accounts'] as $item) {
$card = $entityManager->getRepository(PersonCard::class)->findOneBy([
'bid' => $acc['bid'],
'person' => $person,
'bank' => $item['bank']
]);
if (!$card)
$card = new PersonCard();
$card->setPerson($person);
$card->setBid($acc['bid']);
$card->setShabaNum($item['shabaNum']);
$card->setCardNum($item['cardNum']);
$card->setAccountNum($item['accountNum']);
$card->setBank($item['bank']);
$entityManager->persist($card);
}
}
//remove not sended accounts
$accounts = $entityManager->getRepository(PersonCard::class)->findBy([
'bid' => $acc['bid'],
'person' => $person,
]);
foreach ($accounts as $item) {
$deleted = true;
foreach ($params['accounts'] as $param) {
if ($item->getBank() == $param['bank']) {
$deleted = false;
}
}
if ($deleted) {
$entityManager->remove($item);
}
}
$entityManager->persist($person);
//insert new types
$types = $entityManager->getRepository(PersonType::class)->findAll();
foreach ($params['types'] as $item) {
if ($item['checked'] == true)
$person->addType($entityManager->getRepository(PersonType::class)->findOneBy([
'code' => $item['code']
]));
elseif ($item['checked'] == false) {
$person->removeType($entityManager->getRepository(PersonType::class)->findOneBy([
'code' => $item['code']
]));
}
}
$entityManager->flush();
$log->insert('اشخاص', 'شخص با نام مستعار ' . $params['nikename'] . ' افزوده/ویرایش شد.', $this->getUser(), $acc['bid']);
}
return $this->json([
'Success' => true,
'result' => 1,
]);
}
#[Route('/api/person/mod/{code}', name: 'app_persons_mod')]
public function app_persons_mod(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, $code = 0): JsonResponse
{
@ -103,10 +243,11 @@ class PersonsController extends AbstractController
'bid' => $acc['bid']
]);
//check exist before
if ($person)
return $this->json(['result' => 2]);
$person = new Person();
$person->setCode($provider->getAccountingCode($acc['bid'], 'person'));
if (!$person) {
$person = new Person();
$person->setCode($provider->getAccountingCode($acc['bid'], 'person'));
}
} else {
$person = $entityManager->getRepository(Person::class)->findOneBy([
'bid' => $acc['bid'],
@ -209,7 +350,10 @@ class PersonsController extends AbstractController
}
$entityManager->flush();
$log->insert('اشخاص', 'شخص با نام مستعار ' . $params['nikename'] . ' افزوده/ویرایش شد.', $this->getUser(), $acc['bid']);
return $this->json(['result' => 1]);
return $this->json([
'Success' => true,
'result' => 1,
]);
}
#[Route('/api/person/list/search', name: 'app_persons_list_search')]
@ -229,9 +373,9 @@ class PersonsController extends AbstractController
$response = [];
foreach ($persons as $key => $person) {
$temp = [
'id' => $person->getId(),
'id' => $person->getId(),
'nikename' => $person->getNikename(),
'code' => $person->getCode(),
'code' => $person->getCode(),
'mobile' => $person->getMobile()
];
$rows = $entityManager->getRepository(HesabdariRow::class)->findBy([
@ -274,9 +418,9 @@ class PersonsController extends AbstractController
$response = [];
foreach ($persons as $key => $person) {
$temp = [
'id' => $person->getId(),
'id' => $person->getId(),
'nikename' => $person->getNikename(),
'code' => $person->getCode(),
'code' => $person->getCode(),
'mobile' => $person->getMobile()
];
$rows = $entityManager->getRepository(HesabdariRow::class)->findBy([
@ -300,7 +444,7 @@ class PersonsController extends AbstractController
public function app_persons_list(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): Response
{
$acc = $access->hasRole('person');
if(!$acc)
if (!$acc)
throw $this->createAccessDeniedException();
$params = [];
if ($content = $request->getContent()) {
@ -466,6 +610,48 @@ class PersonsController extends AbstractController
return $this->json($result);
}
#[Route('/api/person/list/salesmen', name: 'app_persons_list_salesmen')]
public function app_persons_list_salesmen(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): Response
{
$acc = $access->hasRole('person');
if (!$acc)
throw $this->createAccessDeniedException();
$personType = $entityManager->getRepository(PersonType::class)->findOneBy([
'code' => 'salesman',
]);
$persons = $entityManager->getRepository(Person::class)->findBy([
'bid' => $acc['bid'],
]);
$res = [];
foreach ($persons as $key => $person) {
foreach($person->getType() as $type){
if($type->getCode() == $personType->getCode()){
$res[] = $person;
}
}
}
$response = Explore::ExplorePersons($res, $entityManager->getRepository(PersonType::class)->findAll());
foreach ($res as $key => $person) {
$rows = $entityManager->getRepository(HesabdariRow::class)->findBy([
'person' => $person
]);
$bs = 0;
$bd = 0;
foreach ($rows as $row) {
$bs += $row->getBs();
$bd += $row->getBd();
}
$response[$key]['bs'] = $bs;
$response[$key]['bd'] = $bd;
$response[$key]['balance'] = $bs - $bd;
}
return new Response(json_encode([
'Success' => true,
'result' => $response
]));
}
#[Route('/api/person/list/depositors/print/{amount}', name: 'app_persons_depositors_list_print')]
public function app_persons_depositors_list_print(string $amount, Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): JsonResponse
{
@ -550,7 +736,7 @@ class PersonsController extends AbstractController
* @throws Exception
*/
#[Route('/api/person/list/excel', name: 'app_persons_list_excel')]
public function app_persons_list_excel(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): BinaryFileResponse | JsonResponse | StreamedResponse
public function app_persons_list_excel(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): BinaryFileResponse|JsonResponse|StreamedResponse
{
$acc = $access->hasRole('person');
if (!$acc)
@ -581,7 +767,7 @@ class PersonsController extends AbstractController
* @throws Exception
*/
#[Route('/api/person/card/list/excel', name: 'app_persons_card_list_excel')]
public function app_persons_card_list_excel(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): BinaryFileResponse | JsonResponse | StreamedResponse
public function app_persons_card_list_excel(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): BinaryFileResponse|JsonResponse|StreamedResponse
{
$acc = $access->hasRole('person');
if (!$acc)
@ -615,15 +801,17 @@ class PersonsController extends AbstractController
}
$spreadsheet = new Spreadsheet();
$activeWorksheet = $spreadsheet->getActiveSheet();
$arrayEntity = [[
'شماره تراکنش',
'تاریخ',
'توضیحات',
'تفضیل',
'بستانکار',
'بدهکار',
'سال مالی',
]];
$arrayEntity = [
[
'شماره تراکنش',
'تاریخ',
'توضیحات',
'تفضیل',
'بستانکار',
'بدهکار',
'سال مالی',
]
];
foreach ($transactions as $transaction) {
$arrayEntity[] = [
$transaction->getId(),
@ -681,7 +869,7 @@ class PersonsController extends AbstractController
$acc['bid'],
$this->getUser(),
$this->renderView('pdf/person_card.html.twig', [
'page_title' => 'کارت حساب' . ' ' . $person->getNikename(),
'page_title' => 'کارت حساب' . ' ' . $person->getNikename(),
'bid' => $acc['bid'],
'items' => $transactions,
'person' => $person
@ -746,29 +934,29 @@ class PersonsController extends AbstractController
[
'bid' => $acc['bid'],
'type' => 'person_receive',
'year'=>$acc['year']
'year' => $acc['year']
],
['id' => 'DESC']
);
$res = [];
foreach($items as $item){
foreach ($items as $item) {
$temp = [
'id'=>$item->getId(),
'date'=>$item->getDate(),
'code'=>$item->getCode(),
'des'=>$item->getDes(),
'amount'=>$item->getAmount()
'id' => $item->getId(),
'date' => $item->getDate(),
'code' => $item->getCode(),
'des' => $item->getDes(),
'amount' => $item->getAmount()
];
$persons = [];
foreach($item->getHesabdariRows() as $row){
if($row->getPerson()){
foreach ($item->getHesabdariRows() as $row) {
if ($row->getPerson()) {
$persons[] = Explore::ExplorePerson($row->getPerson());
}
}
$temp['persons'] = $persons;
$res[] = $temp;
}
return $this->json($res);
}
@ -776,7 +964,7 @@ class PersonsController extends AbstractController
* @throws Exception
*/
#[Route('/api/person/receive/list/excel', name: 'app_persons_receive_list_excel')]
public function app_persons_receive_list_excel(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): BinaryFileResponse | JsonResponse | StreamedResponse
public function app_persons_receive_list_excel(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): BinaryFileResponse|JsonResponse|StreamedResponse
{
$acc = $access->hasRole('getpay');
if (!$acc)
@ -863,29 +1051,29 @@ class PersonsController extends AbstractController
[
'bid' => $acc['bid'],
'type' => 'person_send',
'year'=>$acc['year']
'year' => $acc['year']
],
['id' => 'DESC']
);
$res = [];
foreach($items as $item){
foreach ($items as $item) {
$temp = [
'id'=>$item->getId(),
'date'=>$item->getDate(),
'code'=>$item->getCode(),
'des'=>$item->getDes(),
'amount'=>$item->getAmount()
'id' => $item->getId(),
'date' => $item->getDate(),
'code' => $item->getCode(),
'des' => $item->getDes(),
'amount' => $item->getAmount()
];
$persons = [];
foreach($item->getHesabdariRows() as $row){
if($row->getPerson()){
foreach ($item->getHesabdariRows() as $row) {
if ($row->getPerson()) {
$persons[] = Explore::ExplorePerson($row->getPerson());
}
}
$temp['persons'] = $persons;
$res[] = $temp;
}
return $this->json($res);
}
@ -893,7 +1081,7 @@ class PersonsController extends AbstractController
* @throws Exception
*/
#[Route('/api/person/send/list/excel', name: 'app_persons_send_list_excel')]
public function app_persons_send_list_excel(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): BinaryFileResponse | JsonResponse | StreamedResponse
public function app_persons_send_list_excel(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager): BinaryFileResponse|JsonResponse|StreamedResponse
{
$acc = $access->hasRole('getpay');
if (!$acc)

View file

@ -0,0 +1,30 @@
<?php
namespace App\Controller;
use App\Entity\Project;
use App\Service\Access;
use App\Service\Explore;
use App\Service\Extractor;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
class ProjectController extends AbstractController
{
#[Route('/api/projects/list', name: 'api_project_list')]
public function api_project_list(Extractor $extractor,EntityManagerInterface $entityManagerInterface, Access $access): JsonResponse
{
$acc = $access->hasRole('join');
if (!$acc)
throw $this->createAccessDeniedException();
$projects = $entityManagerInterface->getRepository(Project::class)->findBy([
'bid' => $acc['bid']
]);
return $this->json(
$extractor->operationSuccess(Explore::ExploreProjects($projects))
);
}
}

View file

@ -6,6 +6,8 @@ use App\Entity\Commodity;
use App\Entity\HesabdariDoc;
use App\Entity\HesabdariRow;
use App\Entity\Person;
use App\Service\Explore;
use App\Service\Extractor;
use App\Service\Printers;
use App\Service\Provider;
use App\Entity\Storeroom;
@ -28,7 +30,7 @@ use Symfony\Component\Routing\Annotation\Route;
class StoreroomController extends AbstractController
{
#[Route('/api/storeroom/list/{type}', name: 'app_storeroom_list')]
public function app_storeroom_list(Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, string $type = 'active'): JsonResponse
public function app_storeroom_list(Extractor $extractor,Provider $provider, Request $request, Access $access, Log $log, EntityManagerInterface $entityManager, string $type = 'active'): JsonResponse
{
$acc = $access->hasRole('store');
if (!$acc)
@ -43,7 +45,7 @@ class StoreroomController extends AbstractController
'bid' => $acc['bid'],
]);
return $this->json($provider->ArrayEntity2Array($items, 0));
return $this->json($extractor->operationSuccess(Explore::ExploreStoreRooms($items)));
}
#[Route('/api/storeroom/mod/{code}', name: 'app_storeroom_mod')]

View file

@ -246,6 +246,12 @@ class Business
#[ORM\Column(length: 30, nullable: true)]
private ?string $profitCalcType = null;
/**
* @var Collection<int, Project>
*/
#[ORM\OneToMany(mappedBy: 'bid', targetEntity: Project::class, orphanRemoval: true)]
private Collection $projects;
public function __construct()
{
$this->logs = new ArrayCollection();
@ -280,6 +286,7 @@ class Business
$this->notes = new ArrayCollection();
$this->priceLists = new ArrayCollection();
$this->printOptions = new ArrayCollection();
$this->projects = new ArrayCollection();
}
public function getId(): ?int
@ -1750,4 +1757,34 @@ class Business
return $this;
}
/**
* @return Collection<int, Project>
*/
public function getProjects(): Collection
{
return $this->projects;
}
public function addProject(Project $project): static
{
if (!$this->projects->contains($project)) {
$this->projects->add($project);
$project->setBid($this);
}
return $this;
}
public function removeProject(Project $project): static
{
if ($this->projects->removeElement($project)) {
// set the owning side to null (unless already changed)
if ($project->getBid() === $this) {
$project->setBid(null);
}
}
return $this;
}
}

View file

@ -101,6 +101,12 @@ class HesabdariDoc
#[ORM\OneToMany(mappedBy: 'doc', targetEntity: Note::class)]
private Collection $notes;
#[ORM\ManyToOne(inversedBy: 'hesabdariDocs')]
private ?Project $project = null;
#[ORM\ManyToOne(inversedBy: 'hesabdariDocs')]
private ?Person $salesman = null;
public function __construct()
{
$this->hesabdariRows = new ArrayCollection();
@ -505,4 +511,28 @@ class HesabdariDoc
return $this;
}
public function getProject(): ?Project
{
return $this->project;
}
public function setProject(?Project $project): static
{
$this->project = $project;
return $this;
}
public function getSalesman(): ?Person
{
return $this->salesman;
}
public function setSalesman(?Person $salesman): static
{
$this->salesman = $salesman;
return $this;
}
}

View file

@ -137,6 +137,12 @@ class Person
#[ORM\OneToMany(mappedBy: 'person', targetEntity: PreInvoiceDoc::class, orphanRemoval: true)]
private Collection $preInvoiceDocs;
/**
* @var Collection<int, HesabdariDoc>
*/
#[ORM\OneToMany(mappedBy: 'salesman', targetEntity: HesabdariDoc::class)]
private Collection $hesabdariDocs;
public function __construct()
{
$this->hesabdariRows = new ArrayCollection();
@ -149,6 +155,7 @@ class Person
$this->personCards = new ArrayCollection();
$this->plugRepserviceOrders = new ArrayCollection();
$this->preInvoiceDocs = new ArrayCollection();
$this->hesabdariDocs = new ArrayCollection();
}
public function getId(): ?int
@ -773,4 +780,34 @@ class Person
return $this;
}
/**
* @return Collection<int, HesabdariDoc>
*/
public function getHesabdariDocs(): Collection
{
return $this->hesabdariDocs;
}
public function addHesabdariDoc(HesabdariDoc $hesabdariDoc): static
{
if (!$this->hesabdariDocs->contains($hesabdariDoc)) {
$this->hesabdariDocs->add($hesabdariDoc);
$hesabdariDoc->setSalesman($this);
}
return $this;
}
public function removeHesabdariDoc(HesabdariDoc $hesabdariDoc): static
{
if ($this->hesabdariDocs->removeElement($hesabdariDoc)) {
// set the owning side to null (unless already changed)
if ($hesabdariDoc->getSalesman() === $this) {
$hesabdariDoc->setSalesman(null);
}
}
return $this;
}
}

View file

@ -0,0 +1,94 @@
<?php
namespace App\Entity;
use App\Repository\ProjectRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ProjectRepository::class)]
class Project
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'projects')]
#[ORM\JoinColumn(nullable: false)]
private ?Business $bid = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
/**
* @var Collection<int, HesabdariDoc>
*/
#[ORM\OneToMany(mappedBy: 'project', targetEntity: HesabdariDoc::class)]
private Collection $hesabdariDocs;
public function __construct()
{
$this->hesabdariDocs = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getBid(): ?Business
{
return $this->bid;
}
public function setBid(?Business $bid): static
{
$this->bid = $bid;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
/**
* @return Collection<int, HesabdariDoc>
*/
public function getHesabdariDocs(): Collection
{
return $this->hesabdariDocs;
}
public function addHesabdariDoc(HesabdariDoc $hesabdariDoc): static
{
if (!$this->hesabdariDocs->contains($hesabdariDoc)) {
$this->hesabdariDocs->add($hesabdariDoc);
$hesabdariDoc->setProject($this);
}
return $this;
}
public function removeHesabdariDoc(HesabdariDoc $hesabdariDoc): static
{
if ($this->hesabdariDocs->removeElement($hesabdariDoc)) {
// set the owning side to null (unless already changed)
if ($hesabdariDoc->getProject() === $this) {
$hesabdariDoc->setProject(null);
}
}
return $this;
}
}

View file

@ -53,12 +53,12 @@ class CommodityRepository extends ServiceEntityRepository
->orderBy('p.id', 'ASC')
->getQuery()
->getResult()
;
;
}
/**
* @return Person[] Returns an array of Person objects
*/
public function searchByName(Business $bid,string $search,int $maxResults = 10): array
public function searchByName(Business $bid, string $search, int $maxResults = 10): array
{
return $this->createQueryBuilder('p')
->where('p.bid = :val')
@ -74,7 +74,7 @@ class CommodityRepository extends ServiceEntityRepository
/**
* @return Person[] Returns an array of Person objects
*/
public function getLasts(Business $bid,int $maxResults = 10): array
public function getLasts(Business $bid, int $maxResults = 10): array
{
return $this->createQueryBuilder('p')
->andWhere('p.bid = :val')
@ -112,4 +112,25 @@ class CommodityRepository extends ServiceEntityRepository
;
}
*/
/**
* @return Commodity[] Returns an array of Commodity objects
*/
public function search(array $params): array
{
$query = $this->createQueryBuilder('p');
$query->where('p.bid = :val')
->setParameter('val', $params['bid']);
foreach ($params['Filters'] as $filter) {
if ($filter['Operator'] == '=') {
$query->andWhere('p.' . $filter['Property'] . '=:' . $filter['Property'])
->setParameter($filter['Property'], $filter['Value']);
}
}
$query->setMaxResults($params['Take'])
->orderBy('p.id', 'ASC');
return $query->getQuery()->getResult();
}
}

View file

@ -0,0 +1,43 @@
<?php
namespace App\Repository;
use App\Entity\Project;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Project>
*/
class ProjectRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Project::class);
}
// /**
// * @return Project[] Returns an array of Project objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('p')
// ->andWhere('p.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('p.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?Project
// {
// return $this->createQueryBuilder('p')
// ->andWhere('p.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View file

@ -3,6 +3,8 @@
namespace App\Service;
use App\Entity\BankAccount;
use App\Entity\Project;
use App\Entity\Storeroom;
use App\Entity\User;
use App\Entity\Year;
use App\Entity\Business;
@ -57,15 +59,16 @@ class Explore
foreach ($hesabdariDoc->getHesabdariRows() as $item) {
if ($item->getPerson()) {
$person = self::ExplorePerson($item->getPerson());
}
elseif($item->getRef()->getCode() == '104'){
} elseif ($item->getRef()->getCode() == '104') {
$result['discountAll'] = $item->getBd();
} elseif ($item->getRef()->getCode() == '61') {
$result['transferCost'] = $item->getBs();
}
}
if (!array_key_exists('discountAll', $result)) $result['discountAll'] = 0;
if (!array_key_exists('transferCost', $result)) $result['transferCost'] = 0;
if (!array_key_exists('discountAll', $result))
$result['discountAll'] = 0;
if (!array_key_exists('transferCost', $result))
$result['transferCost'] = 0;
$result['person'] = $person;
return $result;
}
@ -93,15 +96,16 @@ class Explore
foreach ($hesabdariDoc->getHesabdariRows() as $item) {
if ($item->getPerson()) {
$person = self::ExplorePerson($item->getPerson());
}
elseif($item->getRef()->getCode() == '104'){
} elseif ($item->getRef()->getCode() == '104') {
$result['discountAll'] = $item->getBs();
} elseif ($item->getRef()->getCode() == '90') {
$result['transferCost'] = $item->getBd();
}
}
if (!array_key_exists('discountAll', $result)) $result['discountAll'] = 0;
if (!array_key_exists('transferCost', $result)) $result['transferCost'] = 0;
if (!array_key_exists('discountAll', $result))
$result['discountAll'] = 0;
if (!array_key_exists('transferCost', $result))
$result['transferCost'] = 0;
$result['person'] = $person;
return $result;
}
@ -123,20 +127,20 @@ class Explore
public static function ExploreHesabdariDoc(HesabdariDoc $doc)
{
return [
'id' => $doc->getId(),
'update' => $doc->getCode(),
'rows' => self::ExploreHesabdariRows($doc->getHesabdariRows()),
'submiter' => self::ExploreUser($doc->getSubmitter()),
'year' => self::ExploreYear($doc->getYear()),
'money' => self::ExploreMoney($doc->getMoney()),
'date_submit' => $doc->getDateSubmit(),
'date' => $doc->getDate(),
'type' => $doc->getType(),
'code' => $doc->getCode(),
'des' => $doc->getDes(),
'amount' => $doc->getAmount(),
'mdate' => '',
'plugin' => $doc->getPlugin(),
'id' => $doc->getId(),
'update' => $doc->getCode(),
'rows' => self::ExploreHesabdariRows($doc->getHesabdariRows()),
'submiter' => self::ExploreUser($doc->getSubmitter()),
'year' => self::ExploreYear($doc->getYear()),
'money' => self::ExploreMoney($doc->getMoney()),
'date_submit' => $doc->getDateSubmit(),
'date' => $doc->getDate(),
'type' => $doc->getType(),
'code' => $doc->getCode(),
'des' => $doc->getDes(),
'amount' => $doc->getAmount(),
'mdate' => '',
'plugin' => $doc->getPlugin(),
];
}
@ -151,20 +155,20 @@ class Explore
public static function ExploreHesabdariRow(HesabdariRow $row)
{
$temp = [
'id' => $row->getId(),
'bid' => self::ExploreBid($row->getBid()),
'year' => self::ExploreYear($row->getYear()),
'ref' => self::ExploreHesabdariTable($row->getRef()),
'person' => self::ExplorePerson($row->getPerson()),
'bank' => self::ExploreBank($row->getBank()),
'cashdesk' => self::ExploreCashdesk($row->getCashdesk()),
'salary' => self::ExploreSalary($row->getSalary()),
'bs' => $row->getBs(),
'bd' => $row->getBd(),
'des' => $row->getDes(),
'plugin' => $row->getPlugin(),
'commodity_count' => $row->getCommdityCount(),
'commodity' => self::ExploreCommodity($row->getCommodity(), $row->getCommdityCount(), $row->getDes()),
'id' => $row->getId(),
'bid' => self::ExploreBid($row->getBid()),
'year' => self::ExploreYear($row->getYear()),
'ref' => self::ExploreHesabdariTable($row->getRef()),
'person' => self::ExplorePerson($row->getPerson()),
'bank' => self::ExploreBank($row->getBank()),
'cashdesk' => self::ExploreCashdesk($row->getCashdesk()),
'salary' => self::ExploreSalary($row->getSalary()),
'bs' => $row->getBs(),
'bd' => $row->getBd(),
'des' => $row->getDes(),
'plugin' => $row->getPlugin(),
'commodity_count' => $row->getCommdityCount(),
'commodity' => self::ExploreCommodity($row->getCommodity(), $row->getCommdityCount(), $row->getDes()),
];
if (!$row->getTax())
$row->setTax(0);
@ -175,45 +179,47 @@ class Explore
return $temp;
}
public static function ExploreCommodity(Commodity | null $item, int | null $count = 0, string | null $des = '')
public static function ExploreCommodity(Commodity|null $item, int|null $count = 0, string|null $des = '')
{
if ($item){
$result = [
'id' => $item->getId(),
'code' => $item->getCode(),
'name' => $item->getName(),
'des' => $item->getDes(),
'priceBuy' => $item->getPriceBuy(),
'priceSell' => $item->getPriceSell(),
'khadamat' => $item->isKhadamat(),
'count' => $count,
'unit' => $item->getUnit()->getName(),
'withoutTax' => $item->isWithoutTax(),
'barcodes' => $item->getBarcodes(),
if ($item) {
$result = [
'id' => $item->getId(),
'code' => $item->getCode(),
'name' => $item->getName(),
'des' => $item->getDes(),
'priceBuy' => $item->getPriceBuy(),
'priceSell' => $item->getPriceSell(),
'khadamat' => $item->isKhadamat(),
'count' => $count,
'unit' => $item->getUnit()->getName(),
'withoutTax' => $item->isWithoutTax(),
'barcodes' => $item->getBarcodes(),
'commodityCountCheck' => $item->isCommodityCountCheck(),
'speedAccess' => $item->isSpeedAccess(),
'orderPoint' =>$item->getOrderPoint(),
'dayLoading' =>$item->getDayLoading(),
'minOrderCount' =>$item->getMinOrderCount(),
'speedAccess' => $item->isSpeedAccess(),
'orderPoint' => $item->getOrderPoint(),
'dayLoading' => $item->getDayLoading(),
'minOrderCount' => $item->getMinOrderCount(),
'unitData' => [
'name' => $item->getUnit()->getName(),
'floatNumber' => $item->getUnit()->getFloatNumber(),
],
];
if($des){ $result['des'] = $des;}
if ($des) {
$result['des'] = $des;
}
return $result;
}
return null;
}
public static function ExploreCommodityPriceListDetail(PriceListDetail | null $item)
public static function ExploreCommodityPriceListDetail(PriceListDetail|null $item)
{
return [
'id' => $item->getId(),
'list' => self::ExploreCommodityPriceListOne($item->getList()),
'priceBuy' => $item->getPriceBuy(),
'priceSell' => $item->getPriceSell(),
'id' => $item->getId(),
'list' => self::ExploreCommodityPriceListOne($item->getList()),
'priceBuy' => $item->getPriceBuy(),
'priceSell' => $item->getPriceSell(),
];
}
public static function ExploreCommodityPriceListDetails($items)
@ -223,58 +229,58 @@ class Explore
$result[] = self::ExploreCommodityPriceListDetail($item);
return $result;
}
public static function ExploreBank(BankAccount | null $item)
public static function ExploreBank(BankAccount|null $item)
{
if ($item)
return [
'id' => $item->getId(),
'code' => $item->getCode(),
'name' => $item->getName(),
'id' => $item->getId(),
'code' => $item->getCode(),
'name' => $item->getName(),
];
return null;
}
public static function ExploreCashdesk(Cashdesk | null $item)
public static function ExploreCashdesk(Cashdesk|null $item)
{
if ($item)
return [
'id' => $item->getId(),
'code' => $item->getCode(),
'name' => $item->getName(),
'des' => $item->getDes()
'id' => $item->getId(),
'code' => $item->getCode(),
'name' => $item->getName(),
'des' => $item->getDes()
];
return null;
}
public static function ExploreSalary(Salary | null $item)
public static function ExploreSalary(Salary|null $item)
{
if ($item)
return [
'id' => $item->getId(),
'code' => $item->getCode(),
'name' => $item->getName(),
'des' => $item->getDes()
'id' => $item->getId(),
'code' => $item->getCode(),
'name' => $item->getName(),
'des' => $item->getDes()
];
return null;
}
public static function ExplorePerson(Person | null $person, array $typesAll = [])
public static function ExplorePerson(Person|null $person, array $typesAll = [])
{
if ($person) {
$res = [
'id' => $person->getId(),
'code' => $person->getCode(),
'nikename' => $person->getNikename(),
'name' => $person->getName(),
'tel' => $person->getTel(),
'mobile' => $person->getmobile(),
'mobile2' => $person->getMobile2(),
'des' => $person->getDes(),
'company' => $person->getCompany(),
'shenasemeli' => $person->getShenasemeli(),
'sabt' => $person->getSabt(),
'shahr' => $person->getShahr(),
'keshvar' => $person->getKeshvar(),
'ostan' => $person->getOstan(),
'postalcode' => $person->getPostalcode(),
'id' => $person->getId(),
'code' => $person->getCode(),
'nikename' => $person->getNikename(),
'name' => $person->getName(),
'tel' => $person->getTel(),
'mobile' => $person->getmobile(),
'mobile2' => $person->getMobile2(),
'des' => $person->getDes(),
'company' => $person->getCompany(),
'shenasemeli' => $person->getShenasemeli(),
'sabt' => $person->getSabt(),
'shahr' => $person->getShahr(),
'keshvar' => $person->getKeshvar(),
'ostan' => $person->getOstan(),
'postalcode' => $person->getPostalcode(),
'codeeghtesadi' => $person->getCodeeghtesadi(),
'email' => $person->getEmail(),
'website' => $person->getWebsite(),
@ -322,25 +328,25 @@ class Explore
public static function ExploreHesabdariTable(HesabdariTable $table)
{
return [
'id' => $table->getId(),
'upper_id' => $table->getUpper()->getId(),
'name' => $table->getName(),
'type' => $table->getType(),
'code' => $table->getCode()
'id' => $table->getId(),
'upper_id' => $table->getUpper()->getId(),
'name' => $table->getName(),
'type' => $table->getType(),
'code' => $table->getCode()
];
}
public static function ExploreMoney(Money $money)
{
return [
'id' => $money->getId(),
'label' => $money->getLabel(),
'name' => $money->getName(),
'id' => $money->getId(),
'label' => $money->getLabel(),
'name' => $money->getName(),
];
}
public static function ExploreYear(Year | null $year)
public static function ExploreYear(Year|null $year)
{
$jdate = new Jdate();
if(!$year){
if (!$year) {
$year = new Year();
$year->setHead(true);
$year->setLabel('سال مالی اول');
@ -348,12 +354,12 @@ class Explore
$year->setEnd(time() + 31536000);
}
return [
'id' => $year->getId(),
'id' => $year->getId(),
'label' => $year->getLabel(),
'head' => $year->isHead(),
'head' => $year->isHead(),
'start' => $year->getStart(),
'end' => $year->getEnd(),
'now' => time(),
'end' => $year->getEnd(),
'now' => time(),
'startShamsi' => $jdate->jdate('Y/n/d', $year->getStart()),
'endShamsi' => $jdate->jdate('Y/n/d', $year->getEnd()),
];
@ -362,16 +368,16 @@ class Explore
public static function ExploreUser(User $user)
{
return [
'id' => $user->getId(),
'name' => $user->getFullName()
'id' => $user->getId(),
'name' => $user->getFullName()
];
}
public static function ExploreBid(Business $bid)
{
return [
'id' => $bid->getId(),
'name' => $bid->getName(),
'id' => $bid->getId(),
'name' => $bid->getName(),
'legal_name' => $bid->getLegalName()
];
}
@ -389,7 +395,7 @@ class Explore
return $result;
}
public static function SerializeCheque(Cheque | null $cheque)
public static function SerializeCheque(Cheque|null $cheque)
{
if (!$cheque)
return null;
@ -398,7 +404,7 @@ class Explore
if ($cheque->getType() == 'input')
$label = 'چک شماره ' . $cheque->getNumber() . ' مربوط به ' . $cheque->getPerson()->getNikename() . ' با مبلغ ' . $cheque->getAmount();
return [
'id' => $cheque->getId(),
'id' => $cheque->getId(),
'number' => $cheque->getNumber(),
'sayadNum' => $cheque->getSayadNum(),
'chequeBank' => $cheque->getBankOncheque(),
@ -423,4 +429,42 @@ class Explore
$result[] = self::SerializeCheque($cheque);
return $result;
}
public static function ExploreProject(Project $item)
{
return [
'id' => $item->getId(),
'name' => $item->getName()
];
}
public static function ExploreProjects(array $items)
{
$result = [];
foreach ($items as $item) {
$result[] = self::ExploreProject($item);
}
return $result;
}
public static function ExploreStoreroom(Storeroom $item)
{
return [
'id' => $item->getId(),
'code' => $item->getId(),
'name' => $item->getName(),
'tel' => $item->getTel(),
'address' => $item->getAdr(),
'manager' => $item->getManager()
];
}
public static function ExploreStorerooms(array $items)
{
$result = [];
foreach ($items as $item) {
$result[] = self::ExploreStoreroom($item);
}
return $result;
}
}

View file

@ -21,9 +21,11 @@ class Extractor
{
public function operationSuccess($data = ''){
return [
'Success'=>true,
'code' => 0,
'data' =>$data,
'message'=>'operation success'
'message'=>'operation success',
];
}
public function notFound($data = ''){

View file

@ -0,0 +1,20 @@
{% extends 'base.html.twig' %}
{% block title %}Hello ProjectController!{% endblock %}
{% block body %}
<style>
.example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; }
.example-wrapper code { background: #F5F5F5; padding: 2px 6px; }
</style>
<div class="example-wrapper">
<h1>Hello {{ controller_name }}! ✅</h1>
This friendly message is coming from:
<ul>
<li>Your controller at <code>/var/www/next.hesabix.ir/hesabixCore/src/Controller/ProjectController.php</code></li>
<li>Your template at <code>/var/www/next.hesabix.ir/hesabixCore/templates/project/index.html.twig</code></li>
</ul>
</div>
{% endblock %}

View file

@ -1 +0,0 @@
.*/**

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,82 +0,0 @@
CKEditor 4 - Releases
=====================
## Releases Code
This repository contains the official release versions of [CKEditor 4](https://ckeditor.com/ckeditor-4/).
There are four versions for each release &mdash; `standard-all`, `basic`, `standard`, and `full`.
They differ in the number of plugins that are compiled into the main `ckeditor.js` file as well as the toolbar configuration.
See the [comparison](https://ckeditor.com/cke4/presets) of the `basic`, `standard`, and `full` installation presets for more details.
The `standard-all` build includes all official CKSource plugins with only those from the `standard` installation preset compiled into the `ckeditor.js` file and enabled in the configuration.
All versions available in this repository were built using [CKBuilder](https://ckeditor.com/cke4/builder), so they are optimized and ready to be used in a production environment.
## Documentation
Developer documentation for CKEditor is available online at: <https://ckeditor.com/docs/>.
## Installation
### Git clone
To install one of the available releases, just clone this repository and switch to the respective branch (see next section):
git clone -b <release branch> git://github.com/ckeditor/ckeditor4-releases.git
### Git submodule
If you are using git for your project and you want to integrate CKEditor, we recommend to add this repository as a
[submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
git submodule add -b <release branch> git://github.com/ckeditor/ckeditor-releases.git <clone dir>
git commit -m "Added CKEditor submodule in <clone dir> directory."
### Using Package Managers
See the [Installing CKEditor with Package Managers](https://ckeditor.com/docs/ckeditor4/latest/guide/dev_package_managers.html) article for more details about installing CKEditor with [Bower](https://bower.io), [Composer](https://getcomposer.org/) and [npm](https://www.npmjs.com/).
## Repository Structure
### Branches
This repository contains the following branches:
- `master` and `latest` &ndash; the latest release of the `standard-all` preset (including betas).
- `stable` &ndash; the latest stable release of the `standard-all` preset (non-beta).
- `A.B.x` (e.g. `4.3.x`) &ndash; the latest release of the `standard-all` preset in the `A.B` branch.
- `(basic|standard|full)/stable` &ndash; the latest stable release tag point (non-beta).
- `(basic|standard|full)/latest` &ndash; the latest release tag point (including betas).
- `(basic|standard|full)/A.B.x` (e.g. `basic/4.0.x`) &ndash; the latest releases in the `A.B` branch.
### Tags
**Since version 4.3.3** this repository uses the following tag naming rules:
- `x.y.z` &ndash; contains the `standard-all` editor build, e.g. `4.3.3`, `4.4.0` etc.
- `(basic|standard|full)/x.y.z` &ndash; contains the editor build with a given preset, e.g. `basic/4.3.3`.
The version numbers follow the [Semantic Versioning 2.0.0](http://semver.org/) scheme.
Up to version **4.3.2** the tags were released in the following form `x.y[.z]/(basic|standard|full)`.
For example: `4.0/basic`, `4.0.1/standard`. This convention was changed in CKEditor 4.3.3 to conform to the Semantic Versioning scheme.
## Checking Your Installation
The editor comes with a few sample pages that can be used to verify if the installation succeeded. Take a look at the `samples` directory.
To test your installation, just call the following page for your website:
http://<your site>/<CKEditor installation path>/samples/index.html
For example:
http://www.example.com/ckeditor/samples/index.html
### License
Licensed under the GPL, LGPL, and MPL licenses, at your choice.
Please check the `LICENSE.md` file for more information about the license.

View file

@ -1,10 +0,0 @@
# Reporting a security issues
If you believe you have found a security issue in the CKEditor 4 software, please contact us immediately.
When reporting a potential security problem, please bear this in mind:
* Make sure to provide as many details as possible about the vulnerability.
* Please do not disclose publicly any security issues until we fix them and publish security releases.
Contact the security team at security@cksource.com. As soon as we receive the security report, we will work promptly to confirm the issue and then to provide a security fix.

View file

@ -1,10 +0,0 @@
/*
Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
(function(a){if("undefined"==typeof a)throw Error("jQuery should be loaded before CKEditor jQuery adapter.");if("undefined"==typeof CKEDITOR)throw Error("CKEditor should be loaded before CKEditor jQuery adapter.");CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},
ckeditor:function(g,e){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if("function"!==typeof g){var m=e;e=g;g=m}var k=[];e=e||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function d(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(d,100)},0)},null,null,
9999);else{if(e.autoUpdateElement||"undefined"==typeof e.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)e.autoUpdateElementJquery=!0;e.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",!0);c=a(this).is("textarea")?CKEDITOR.replace(h,e):CKEDITOR.inline(h,e);b.data("ckeditorInstance",c);c.on("instanceReady",function(e){var d=e.editor;setTimeout(function n(){if(d.element){e.removeListener();d.on("dataReady",function(){b.trigger("dataReady.ckeditor",[d])});d.on("setData",function(a){b.trigger("setData.ckeditor",
[d,a.data])});d.on("getData",function(a){b.trigger("getData.ckeditor",[d,a.data])},999);d.on("destroy",function(){b.trigger("destroy.ckeditor",[d])});d.on("save",function(){a(h.form).trigger("submit");return!1},null,null,20);if(d.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){d.updateElement()})};a(h.form).on("submit",c);a(h.form).on("form-pre-serialize",c);b.on("destroy.ckeditor",function(){a(h.form).off("submit",c);a(h.form).off("form-pre-serialize",
c)})}d.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[d]);g&&g.apply(d,[h]);l.resolve()}else setTimeout(n,100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,k).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}});CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(e){if(arguments.length){var m=
this,k=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(e,function(){f.resolve()});k.push(f.promise());return!0}return g.call(b,e)});if(k.length){var b=new a.Deferred;a.when.apply(this,k).done(function(){b.resolveWith(m)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}}))})(window.jQuery);

View file

@ -1,16 +0,0 @@
{
"bender": {
"port": 9001
},
"server": {
"port": 9002
},
"paths": {
"ckeditor4": "../ckeditor4/",
"runner": "./src/runner.html"
},
"browsers": {
"linux": [ "chrome", "firefox" ],
"macos": [ "safari" ]
}
}

View file

@ -1,10 +0,0 @@
{
"name": "ckeditor",
"description": "JavaScript WYSIWYG web text editor.",
"keywords": [ "ckeditor4", "ckeditor", "fckeditor", "editor", "wysiwyg", "html", "richtext", "text", "javascript" ],
"authors": "CKSource (https://cksource.com/)",
"license": "For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license/.",
"homepage": "https://ckeditor.com",
"main": "./ckeditor.js",
"moduleType": "globals"
}

View file

@ -1,194 +0,0 @@
/**
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license/
*/
/**
* This file was added automatically by CKEditor builder.
* You may re-use it at any time to build CKEditor again.
*
* If you would like to build CKEditor online again
* (for example to upgrade), visit one the following links:
*
* (1) https://ckeditor.com/cke4/builder
* Visit online builder to build CKEditor from scratch.
*
* (2) https://ckeditor.com/cke4/builder/6490967e78ab135a44d8c0998d90e841
* Visit online builder to build CKEditor, starting with the same setup as before.
*
* (3) https://ckeditor.com/cke4/builder/download/6490967e78ab135a44d8c0998d90e841
* Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
*
* NOTE:
* This file is not used by CKEditor, you may remove it.
* Changing this file will not change your CKEditor configuration.
*/
var CKBUILDER_CONFIG = {
skin: 'moono-lisa',
preset: 'full',
ignore: [
'.DS_Store',
'.bender',
'.editorconfig',
'.gitattributes',
'.gitignore',
'.idea',
'.jscsrc',
'.jshintignore',
'.jshintrc',
'.mailmap',
'.npm',
'.nvmrc',
'.travis.yml',
'bender-err.log',
'bender-out.log',
'bender.ci.js',
'bender.js',
'dev',
'gruntfile.js',
'less',
'node_modules',
'package-lock.json',
'package.json',
'tests'
],
plugins : {
'a11yhelp' : 1,
'about' : 1,
'basicstyles' : 1,
'bidi' : 1,
'blockquote' : 1,
'clipboard' : 1,
'colorbutton' : 1,
'colordialog' : 1,
'contextmenu' : 1,
'copyformatting' : 1,
'dialogadvtab' : 1,
'div' : 1,
'editorplaceholder' : 1,
'elementspath' : 1,
'enterkey' : 1,
'entities' : 1,
'exportpdf' : 1,
'filebrowser' : 1,
'find' : 1,
'floatingspace' : 1,
'font' : 1,
'format' : 1,
'forms' : 1,
'horizontalrule' : 1,
'htmlwriter' : 1,
'iframe' : 1,
'image' : 1,
'indentblock' : 1,
'indentlist' : 1,
'justify' : 1,
'language' : 1,
'link' : 1,
'list' : 1,
'liststyle' : 1,
'magicline' : 1,
'maximize' : 1,
'newpage' : 1,
'pagebreak' : 1,
'pastefromgdocs' : 1,
'pastefromlibreoffice' : 1,
'pastefromword' : 1,
'pastetext' : 1,
'preview' : 1,
'print' : 1,
'removeformat' : 1,
'resize' : 1,
'save' : 1,
'scayt' : 1,
'selectall' : 1,
'showblocks' : 1,
'showborders' : 1,
'smiley' : 1,
'sourcearea' : 1,
'specialchar' : 1,
'stylescombo' : 1,
'tab' : 1,
'table' : 1,
'tableselection' : 1,
'tabletools' : 1,
'templates' : 1,
'toolbar' : 1,
'undo' : 1,
'uploadimage' : 1,
'wysiwygarea' : 1
},
languages : {
'af' : 1,
'ar' : 1,
'az' : 1,
'bg' : 1,
'bn' : 1,
'bs' : 1,
'ca' : 1,
'cs' : 1,
'cy' : 1,
'da' : 1,
'de' : 1,
'de-ch' : 1,
'el' : 1,
'en' : 1,
'en-au' : 1,
'en-ca' : 1,
'en-gb' : 1,
'eo' : 1,
'es' : 1,
'es-mx' : 1,
'et' : 1,
'eu' : 1,
'fa' : 1,
'fi' : 1,
'fo' : 1,
'fr' : 1,
'fr-ca' : 1,
'gl' : 1,
'gu' : 1,
'he' : 1,
'hi' : 1,
'hr' : 1,
'hu' : 1,
'id' : 1,
'is' : 1,
'it' : 1,
'ja' : 1,
'ka' : 1,
'km' : 1,
'ko' : 1,
'ku' : 1,
'lt' : 1,
'lv' : 1,
'mk' : 1,
'mn' : 1,
'ms' : 1,
'nb' : 1,
'nl' : 1,
'no' : 1,
'oc' : 1,
'pl' : 1,
'pt' : 1,
'pt-br' : 1,
'ro' : 1,
'ru' : 1,
'si' : 1,
'sk' : 1,
'sl' : 1,
'sq' : 1,
'sr' : 1,
'sr-latn' : 1,
'sv' : 1,
'th' : 1,
'tr' : 1,
'tt' : 1,
'ug' : 1,
'uk' : 1,
'vi' : 1,
'zh' : 1,
'zh-cn' : 1
}
};

File diff suppressed because one or more lines are too long

View file

@ -1,20 +0,0 @@
{
"name": "ckeditor/ckeditor",
"description": "JavaScript WYSIWYG web text editor.",
"type": "library",
"keywords": [ "ckeditor4", "ckeditor", "fckeditor", "editor", "wysiwyg", "html", "richtext", "text", "javascript" ],
"homepage": "https://ckeditor.com/ckeditor-4/",
"license": [ "GPL-2.0+", "LGPL-2.1+", "MPL-1.1+" ],
"authors": [
{
"name": "CKSource",
"homepage": "https://cksource.com"
}
],
"support": {
"issues": "https://github.com/ckeditor/ckeditor4/issues",
"forum": "https://stackoverflow.com/tags/ckeditor",
"wiki": "https://ckeditor.com/docs/ckeditor4/latest/",
"source": "https://github.com/ckeditor/ckeditor4"
}
}

View file

@ -1,10 +0,0 @@
/**
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
};

View file

@ -1,208 +0,0 @@
/*
Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
body
{
/* Font */
/* Emoji fonts are added to visualise them nicely in Internet Explorer. */
font-family: sans-serif, Arial, Verdana, "Trebuchet MS", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 12px;
/* Text color */
color: #333;
/* Remove the background color to make it transparent. */
background-color: #fff;
margin: 20px;
}
.cke_editable
{
font-size: 13px;
line-height: 1.6;
/* Fix for missing scrollbars with RTL texts. (#10488) */
word-wrap: break-word;
}
blockquote
{
font-style: italic;
font-family: Georgia, Times, "Times New Roman", serif;
padding: 2px 0;
border-style: solid;
border-color: #ccc;
border-width: 0;
}
.cke_contents_ltr blockquote
{
padding-left: 20px;
padding-right: 8px;
border-left-width: 5px;
}
.cke_contents_rtl blockquote
{
padding-left: 8px;
padding-right: 20px;
border-right-width: 5px;
}
a
{
color: #0782C1;
}
ol,ul,dl
{
/* IE7: reset rtl list margin. (#7334) */
*margin-right: 0px;
/* Preserved spaces for list items with text direction different than the list. (#6249,#8049)*/
padding: 0 40px;
}
h1,h2,h3,h4,h5,h6
{
font-weight: normal;
line-height: 1.2;
}
hr
{
border: 0px;
border-top: 1px solid #ccc;
}
img.right
{
border: 1px solid #ccc;
float: right;
margin-left: 15px;
padding: 5px;
}
img.left
{
border: 1px solid #ccc;
float: left;
margin-right: 15px;
padding: 5px;
}
pre
{
white-space: pre-wrap; /* CSS 2.1 */
word-wrap: break-word; /* IE7 */
-moz-tab-size: 4;
tab-size: 4;
}
.marker
{
background-color: Yellow;
}
span[lang]
{
font-style: italic;
}
figure
{
text-align: center;
outline: solid 1px #ccc;
background: rgba(0,0,0,0.05);
padding: 10px;
margin: 10px 20px;
display: inline-block;
}
figure > figcaption
{
text-align: center;
display: block; /* For IE8 */
}
a > img {
padding: 1px;
margin: 1px;
border: none;
outline: 1px solid #0782C1;
}
/* Widget Styles */
.code-featured
{
border: 5px solid red;
}
.math-featured
{
padding: 20px;
box-shadow: 0 0 2px rgba(200, 0, 0, 1);
background-color: rgba(255, 0, 0, 0.05);
margin: 10px;
}
.image-clean
{
border: 0;
background: none;
padding: 0;
}
.image-clean > figcaption
{
font-size: .9em;
text-align: right;
}
.image-grayscale
{
background-color: white;
color: #666;
}
.image-grayscale img, img.image-grayscale
{
filter: grayscale(100%);
}
.embed-240p
{
max-width: 426px;
max-height: 240px;
margin:0 auto;
}
.embed-360p
{
max-width: 640px;
max-height: 360px;
margin:0 auto;
}
.embed-480p
{
max-width: 854px;
max-height: 480px;
margin:0 auto;
}
.embed-720p
{
max-width: 1280px;
max-height: 720px;
margin:0 auto;
}
.embed-1080p
{
max-width: 1920px;
max-height: 1080px;
margin:0 auto;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,27 +0,0 @@
{
"name": "ckeditor4",
"version": "4.22.1",
"description": "JavaScript WYSIWYG web text editor.",
"main": "ckeditor.js",
"repository": {
"type": "git",
"url": "git+https://github.com/ckeditor/ckeditor4-releases.git"
},
"keywords": [
"ckeditor4",
"ckeditor",
"fckeditor",
"editor",
"wysiwyg",
"html",
"richtext",
"text",
"javascript"
],
"author": "CKSource (https://cksource.com/)",
"license": "(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)",
"bugs": {
"url": "https://github.com/ckeditor/ckeditor4/issues"
},
"homepage": "https://ckeditor.com/ckeditor-4/"
}

View file

@ -1,10 +0,0 @@
/*
Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
CKEDITOR.dialog.add("a11yHelp",function(f){function m(a){for(var b,c,h=[],d=0;d<g.length;d++)c=g[d],b=a/g[d],1<b&&2>=b&&(a-=c,h.push(e[c]));h.push(e[a]||String.fromCharCode(a));return h.join("+")}function t(a,b){var c=f.getCommandKeystroke(b,!0);return c.length?CKEDITOR.tools.array.map(c,m).join(" / "):a}var a=f.lang.a11yhelp,b=f.lang.common.keyboard,p=CKEDITOR.tools.getNextId(),q=/\$\{(.*?)\}/g,g=[CKEDITOR.ALT,CKEDITOR.SHIFT,CKEDITOR.CTRL],e={8:b[8],9:a.tab,13:b[13],16:b[16],17:b[17],18:b[18],19:a.pause,
20:a.capslock,27:a.escape,33:a.pageUp,34:a.pageDown,35:b[35],36:b[36],37:a.leftArrow,38:a.upArrow,39:a.rightArrow,40:a.downArrow,45:a.insert,46:b[46],91:a.leftWindowKey,92:a.rightWindowKey,93:a.selectKey,96:a.numpad0,97:a.numpad1,98:a.numpad2,99:a.numpad3,100:a.numpad4,101:a.numpad5,102:a.numpad6,103:a.numpad7,104:a.numpad8,105:a.numpad9,106:a.multiply,107:a.add,109:a.subtract,110:a.decimalPoint,111:a.divide,112:a.f1,113:a.f2,114:a.f3,115:a.f4,116:a.f5,117:a.f6,118:a.f7,119:a.f8,120:a.f9,121:a.f10,
122:a.f11,123:a.f12,144:a.numLock,145:a.scrollLock,186:a.semiColon,187:a.equalSign,188:a.comma,189:a.dash,190:a.period,191:a.forwardSlash,192:a.graveAccent,219:a.openBracket,220:a.backSlash,221:a.closeBracket,222:a.singleQuote};e[CKEDITOR.ALT]=b[18];e[CKEDITOR.SHIFT]=b[16];e[CKEDITOR.CTRL]=CKEDITOR.env.mac?b[224]:b[17];return{title:a.title,minWidth:600,minHeight:400,contents:[{id:"info",label:f.lang.common.generalTab,expand:!0,elements:[{type:"html",id:"legends",style:"white-space:normal;",focus:function(){this.getElement().focus()},
html:function(){for(var b='\x3cdiv class\x3d"cke_accessibility_legend" role\x3d"document" aria-labelledby\x3d"'+p+'_arialbl" tabIndex\x3d"-1"\x3e%1\x3c/div\x3e\x3cspan id\x3d"'+p+'_arialbl" class\x3d"cke_voice_label"\x3e'+a.contents+" \x3c/span\x3e",e=[],c=a.legend,h=c.length,d=0;d<h;d++){for(var f=c[d],g=[],r=f.items,m=r.length,n=0;n<m;n++){var k=r[n],l=CKEDITOR.env.edge&&k.legendEdge?k.legendEdge:k.legend,l=l.replace(q,t);l.match(q)||g.push("\x3cdt\x3e%1\x3c/dt\x3e\x3cdd\x3e%2\x3c/dd\x3e".replace("%1",
k.name).replace("%2",l))}e.push("\x3ch1\x3e%1\x3c/h1\x3e\x3cdl\x3e%2\x3c/dl\x3e".replace("%1",f.name).replace("%2",g.join("")))}return b.replace("%1",e.join(""))}()+'\x3cstyle type\x3d"text/css"\x3e.cke_accessibility_legend{width:600px;height:400px;padding-right:5px;overflow-y:auto;overflow-x:hidden;}.cke_browser_quirks .cke_accessibility_legend,{height:390px}.cke_accessibility_legend *{white-space:normal;}.cke_accessibility_legend h1{font-size: 20px;border-bottom: 1px solid #AAA;margin: 5px 0px 15px;}.cke_accessibility_legend dl{margin-left: 5px;}.cke_accessibility_legend dt{font-size: 13px;font-weight: bold;}.cke_accessibility_legend dd{margin:10px}\x3c/style\x3e'}]}],
buttons:[CKEDITOR.dialog.cancelButton]}});

View file

@ -1,25 +0,0 @@
Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
cs.js Found: 30 Missing: 0
cy.js Found: 30 Missing: 0
da.js Found: 12 Missing: 18
de.js Found: 30 Missing: 0
el.js Found: 25 Missing: 5
eo.js Found: 30 Missing: 0
fa.js Found: 30 Missing: 0
fi.js Found: 30 Missing: 0
fr.js Found: 30 Missing: 0
gu.js Found: 12 Missing: 18
he.js Found: 30 Missing: 0
it.js Found: 30 Missing: 0
mk.js Found: 5 Missing: 25
nb.js Found: 30 Missing: 0
nl.js Found: 30 Missing: 0
no.js Found: 30 Missing: 0
pt-br.js Found: 30 Missing: 0
ro.js Found: 6 Missing: 24
tr.js Found: 30 Missing: 0
ug.js Found: 27 Missing: 3
vi.js Found: 6 Missing: 24
zh-cn.js Found: 30 Missing: 0

Some files were not shown because too many files have changed in this diff Show more