fast sell
Before Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 30 KiB |
Before Width: | Height: | Size: 172 KiB |
After Width: | Height: | Size: 68 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 59 KiB |
Before Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 36 KiB |
|
@ -204,6 +204,7 @@ class ArchiveController extends AbstractController
|
||||||
$resp = [];
|
$resp = [];
|
||||||
foreach ($files as $file){
|
foreach ($files as $file){
|
||||||
$temp = [];
|
$temp = [];
|
||||||
|
$temp['id']=$file->getId();
|
||||||
$temp['filename']=$file->getFilename();
|
$temp['filename']=$file->getFilename();
|
||||||
$temp['fileType']=$file->getFileType();
|
$temp['fileType']=$file->getFileType();
|
||||||
$temp['submitter']=$file->getSubmitter()->getFullName();
|
$temp['submitter']=$file->getSubmitter()->getFullName();
|
||||||
|
@ -240,28 +241,26 @@ class ArchiveController extends AbstractController
|
||||||
if (!$acc)
|
if (!$acc)
|
||||||
throw $this->createAccessDeniedException();
|
throw $this->createAccessDeniedException();
|
||||||
$info = $this->getArchiveInfo($entityManager,$acc);
|
$info = $this->getArchiveInfo($entityManager,$acc);
|
||||||
if($info['remain'] > 0){
|
$uploadedFile = $request->files->get('image');
|
||||||
$uploadedFile = $request->files->get('image');
|
if ($uploadedFile) {
|
||||||
if ($uploadedFile) {
|
$originalFilename = pathinfo($uploadedFile->getClientOriginalName(), PATHINFO_FILENAME);
|
||||||
$originalFilename = pathinfo($uploadedFile->getClientOriginalName(), PATHINFO_FILENAME);
|
// this is needed to safely include the file name as part of the URL
|
||||||
// this is needed to safely include the file name as part of the URL
|
$safeFilename = $slugger->slug($originalFilename);
|
||||||
$safeFilename = $slugger->slug($originalFilename);
|
$newFilename = $safeFilename.'-'.uniqid().'.'.$uploadedFile->guessExtension();
|
||||||
$newFilename = $safeFilename.'-'.uniqid().'.'.$uploadedFile->guessExtension();
|
|
||||||
|
|
||||||
// Move the file to the directory where brochures are stored
|
// Move the file to the directory where brochures are stored
|
||||||
try {
|
try {
|
||||||
$uploadedFile->move(
|
$uploadedFile->move(
|
||||||
$this->getParameter('archiveTempMediaDir'),
|
$this->getParameter('archiveTempMediaDir'),
|
||||||
$newFilename
|
$newFilename
|
||||||
);} catch (FileException $e) {
|
);} catch (FileException $e) {
|
||||||
// ... handle exception if something happens during file upload
|
// ... handle exception if something happens during file upload
|
||||||
}
|
|
||||||
|
|
||||||
// updates the 'brochureFilename' property to store the PDF file name
|
|
||||||
// instead of its contents
|
|
||||||
//$product->setBrochureFilename($newFilename);
|
|
||||||
return $this->json(['name'=>$newFilename]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// updates the 'brochureFilename' property to store the PDF file name
|
||||||
|
// instead of its contents
|
||||||
|
//$product->setBrochureFilename($newFilename);
|
||||||
|
return $this->json(['name'=>$newFilename]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[Route('/api/archive/file/save', name: 'app_archive_file_save')]
|
#[Route('/api/archive/file/save', name: 'app_archive_file_save')]
|
||||||
|
@ -272,6 +271,10 @@ class ArchiveController extends AbstractController
|
||||||
throw $this->createAccessDeniedException();
|
throw $this->createAccessDeniedException();
|
||||||
foreach ($request->get('added_media') as $item){
|
foreach ($request->get('added_media') as $item){
|
||||||
if (file_exists(__DIR__ . '/../../../hesabixArchive/temp/'.$item) ){
|
if (file_exists(__DIR__ . '/../../../hesabixArchive/temp/'.$item) ){
|
||||||
|
$size = ceil(filesize(__DIR__ . '/../../../hesabixArchive/temp/'.$item)/(1024*1024));
|
||||||
|
$info = $this->getArchiveInfo($entityManager,$acc);
|
||||||
|
if($info['size'] < ($info['used'] + $size))
|
||||||
|
return $this->json(['result'=>'nem']);
|
||||||
$file = new ArchiveFile();
|
$file = new ArchiveFile();
|
||||||
$file->setBid($acc['bid']);
|
$file->setBid($acc['bid']);
|
||||||
$file->setDateSubmit(time());
|
$file->setDateSubmit(time());
|
||||||
|
@ -287,9 +290,10 @@ class ArchiveController extends AbstractController
|
||||||
rename(__DIR__ . '/../../../hesabixArchive/temp/'.$item,__DIR__ . '/../../../hesabixArchive/'.$item);
|
rename(__DIR__ . '/../../../hesabixArchive/temp/'.$item,__DIR__ . '/../../../hesabixArchive/'.$item);
|
||||||
$file->setRelatedDocType($request->get('doctype'));
|
$file->setRelatedDocType($request->get('doctype'));
|
||||||
$file->setRelatedDocCode($request->get('docid'));
|
$file->setRelatedDocCode($request->get('docid'));
|
||||||
|
|
||||||
$entityManager->persist($file);
|
$entityManager->persist($file);
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
|
$log->insert('آرشیو','فایل با نام ' . $file->getFilename() . ' افزوده شد.',$this->getUser(),$acc['bid']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,9 +25,21 @@ class CommodityController extends AbstractController
|
||||||
{
|
{
|
||||||
if(!$access->hasRole('commodity'))
|
if(!$access->hasRole('commodity'))
|
||||||
throw $this->createAccessDeniedException();
|
throw $this->createAccessDeniedException();
|
||||||
$items = $entityManager->getRepository(Commodity::class)->findBy([
|
$params = [];
|
||||||
'bid'=>$request->headers->get('activeBid')
|
if ($content = $request->getContent()) {
|
||||||
]);
|
$params = json_decode($content, true);
|
||||||
|
}
|
||||||
|
if(array_key_exists('speedAccess',$params)){
|
||||||
|
$items = $entityManager->getRepository(Commodity::class)->findBy([
|
||||||
|
'bid'=>$request->headers->get('activeBid'),
|
||||||
|
'speedAccess'=>true
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$items = $entityManager->getRepository(Commodity::class)->findBy([
|
||||||
|
'bid'=>$request->headers->get('activeBid')
|
||||||
|
]);
|
||||||
|
}
|
||||||
$res = [];
|
$res = [];
|
||||||
foreach ($items as $item){
|
foreach ($items as $item){
|
||||||
$temp = [];
|
$temp = [];
|
||||||
|
@ -36,6 +48,7 @@ class CommodityController extends AbstractController
|
||||||
$temp['unit'] = $item->getUnit()->getName();
|
$temp['unit'] = $item->getUnit()->getName();
|
||||||
$temp['des'] = $item->getDes();
|
$temp['des'] = $item->getDes();
|
||||||
$temp['priceBuy'] = $item->getPriceBuy();
|
$temp['priceBuy'] = $item->getPriceBuy();
|
||||||
|
$temp['speedAccess'] = $item->isSpeedAccess();
|
||||||
$temp['priceSell'] = $item->getPriceSell();
|
$temp['priceSell'] = $item->getPriceSell();
|
||||||
$temp['code'] = $item->getCode();
|
$temp['code'] = $item->getCode();
|
||||||
$temp['cat'] = null;
|
$temp['cat'] = null;
|
||||||
|
@ -83,7 +96,7 @@ class CommodityController extends AbstractController
|
||||||
'code'=>$code
|
'code'=>$code
|
||||||
]);
|
]);
|
||||||
$data->setUnit($data->getUnit()->getName());
|
$data->setUnit($data->getUnit()->getName());
|
||||||
$res = $provider->Entity2ArrayJustIncludes($data,['isCommodityCountCheck','getName','getUnit','getPriceBuy','getPriceSell','getCat','getOrderPoint','getdes','getId','getDayLoading','isKhadamat','getCode','getMinOrderCount','getLabel'],1);
|
$res = $provider->Entity2ArrayJustIncludes($data,['isSpeedAccess','isCommodityCountCheck','getName','getUnit','getPriceBuy','getPriceSell','getCat','getOrderPoint','getdes','getId','getDayLoading','isKhadamat','getCode','getMinOrderCount','getLabel'],1);
|
||||||
$res['cat'] = $data->getCat()->getId();
|
$res['cat'] = $data->getCat()->getId();
|
||||||
return $this->json($res);
|
return $this->json($res);
|
||||||
}
|
}
|
||||||
|
@ -135,6 +148,7 @@ class CommodityController extends AbstractController
|
||||||
$data->setCommodityCountCheck($params['commodityCountCheck']);
|
$data->setCommodityCountCheck($params['commodityCountCheck']);
|
||||||
}
|
}
|
||||||
$data->setMinOrderCount($params['minOrderCount']);
|
$data->setMinOrderCount($params['minOrderCount']);
|
||||||
|
$data->setSpeedAccess($params['speedAccess']);
|
||||||
$data->setDayLoading($params['dayLoading']);
|
$data->setDayLoading($params['dayLoading']);
|
||||||
$data->setOrderPoint($params['orderPoint']);
|
$data->setOrderPoint($params['orderPoint']);
|
||||||
//set cat
|
//set cat
|
||||||
|
|
|
@ -90,6 +90,8 @@ class PersonsController extends AbstractController
|
||||||
$person->setBirthday($params['birthday']);
|
$person->setBirthday($params['birthday']);
|
||||||
if(array_key_exists('tel',$params))
|
if(array_key_exists('tel',$params))
|
||||||
$person->setTel($params['tel']);
|
$person->setTel($params['tel']);
|
||||||
|
if(array_key_exists('speedAccess',$params))
|
||||||
|
$person->setSpeedAccess($params['speedAccess']);
|
||||||
if(array_key_exists('address',$params))
|
if(array_key_exists('address',$params))
|
||||||
$person->setAddress($params['address']);
|
$person->setAddress($params['address']);
|
||||||
if(array_key_exists('des',$params))
|
if(array_key_exists('des',$params))
|
||||||
|
|
|
@ -70,6 +70,9 @@ class Commodity
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
private ?string $dayLoading = null;
|
private ?string $dayLoading = null;
|
||||||
|
|
||||||
|
#[ORM\Column(nullable: true)]
|
||||||
|
private ?bool $speedAccess = null;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->setPriceBuy(0);
|
$this->setPriceBuy(0);
|
||||||
|
@ -329,4 +332,16 @@ class Commodity
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isSpeedAccess(): ?bool
|
||||||
|
{
|
||||||
|
return $this->speedAccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setSpeedAccess(?bool $speedAccess): static
|
||||||
|
{
|
||||||
|
$this->speedAccess = $speedAccess;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,6 +113,9 @@ class Person
|
||||||
#[ORM\OneToMany(mappedBy: 'person', targetEntity: Shareholder::class, orphanRemoval: true)]
|
#[ORM\OneToMany(mappedBy: 'person', targetEntity: Shareholder::class, orphanRemoval: true)]
|
||||||
private Collection $shareholders;
|
private Collection $shareholders;
|
||||||
|
|
||||||
|
#[ORM\Column(nullable: true)]
|
||||||
|
private ?bool $speedAccess = null;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->hesabdariRows = new ArrayCollection();
|
$this->hesabdariRows = new ArrayCollection();
|
||||||
|
@ -576,4 +579,16 @@ class Person
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isSpeedAccess(): ?bool
|
||||||
|
{
|
||||||
|
return $this->speedAccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setSpeedAccess(?bool $speedAccess): static
|
||||||
|
{
|
||||||
|
$this->speedAccess = $speedAccess;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ class twigFunctions
|
||||||
{
|
{
|
||||||
private EntityManagerInterface $em;
|
private EntityManagerInterface $em;
|
||||||
|
|
||||||
protected Request $request;
|
protected $request;
|
||||||
protected RequestStack $requestStack;
|
protected RequestStack $requestStack;
|
||||||
|
|
||||||
function __construct(
|
function __construct(
|
||||||
|
|