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 = [];
|
||||
foreach ($files as $file){
|
||||
$temp = [];
|
||||
$temp['id']=$file->getId();
|
||||
$temp['filename']=$file->getFilename();
|
||||
$temp['fileType']=$file->getFileType();
|
||||
$temp['submitter']=$file->getSubmitter()->getFullName();
|
||||
|
@ -240,28 +241,26 @@ class ArchiveController extends AbstractController
|
|||
if (!$acc)
|
||||
throw $this->createAccessDeniedException();
|
||||
$info = $this->getArchiveInfo($entityManager,$acc);
|
||||
if($info['remain'] > 0){
|
||||
$uploadedFile = $request->files->get('image');
|
||||
if ($uploadedFile) {
|
||||
$originalFilename = pathinfo($uploadedFile->getClientOriginalName(), PATHINFO_FILENAME);
|
||||
// this is needed to safely include the file name as part of the URL
|
||||
$safeFilename = $slugger->slug($originalFilename);
|
||||
$newFilename = $safeFilename.'-'.uniqid().'.'.$uploadedFile->guessExtension();
|
||||
$uploadedFile = $request->files->get('image');
|
||||
if ($uploadedFile) {
|
||||
$originalFilename = pathinfo($uploadedFile->getClientOriginalName(), PATHINFO_FILENAME);
|
||||
// this is needed to safely include the file name as part of the URL
|
||||
$safeFilename = $slugger->slug($originalFilename);
|
||||
$newFilename = $safeFilename.'-'.uniqid().'.'.$uploadedFile->guessExtension();
|
||||
|
||||
// Move the file to the directory where brochures are stored
|
||||
try {
|
||||
$uploadedFile->move(
|
||||
$this->getParameter('archiveTempMediaDir'),
|
||||
$newFilename
|
||||
);} catch (FileException $e) {
|
||||
// ... 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]);
|
||||
// Move the file to the directory where brochures are stored
|
||||
try {
|
||||
$uploadedFile->move(
|
||||
$this->getParameter('archiveTempMediaDir'),
|
||||
$newFilename
|
||||
);} catch (FileException $e) {
|
||||
// ... 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]);
|
||||
}
|
||||
}
|
||||
#[Route('/api/archive/file/save', name: 'app_archive_file_save')]
|
||||
|
@ -272,6 +271,10 @@ class ArchiveController extends AbstractController
|
|||
throw $this->createAccessDeniedException();
|
||||
foreach ($request->get('added_media') as $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->setBid($acc['bid']);
|
||||
$file->setDateSubmit(time());
|
||||
|
@ -287,9 +290,10 @@ class ArchiveController extends AbstractController
|
|||
rename(__DIR__ . '/../../../hesabixArchive/temp/'.$item,__DIR__ . '/../../../hesabixArchive/'.$item);
|
||||
$file->setRelatedDocType($request->get('doctype'));
|
||||
$file->setRelatedDocCode($request->get('docid'));
|
||||
|
||||
$entityManager->persist($file);
|
||||
$entityManager->flush();
|
||||
$log->insert('آرشیو','فایل با نام ' . $file->getFilename() . ' افزوده شد.',$this->getUser(),$acc['bid']);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,9 +25,21 @@ class CommodityController extends AbstractController
|
|||
{
|
||||
if(!$access->hasRole('commodity'))
|
||||
throw $this->createAccessDeniedException();
|
||||
$items = $entityManager->getRepository(Commodity::class)->findBy([
|
||||
'bid'=>$request->headers->get('activeBid')
|
||||
]);
|
||||
$params = [];
|
||||
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 = [];
|
||||
foreach ($items as $item){
|
||||
$temp = [];
|
||||
|
@ -36,6 +48,7 @@ class CommodityController extends AbstractController
|
|||
$temp['unit'] = $item->getUnit()->getName();
|
||||
$temp['des'] = $item->getDes();
|
||||
$temp['priceBuy'] = $item->getPriceBuy();
|
||||
$temp['speedAccess'] = $item->isSpeedAccess();
|
||||
$temp['priceSell'] = $item->getPriceSell();
|
||||
$temp['code'] = $item->getCode();
|
||||
$temp['cat'] = null;
|
||||
|
@ -83,7 +96,7 @@ class CommodityController extends AbstractController
|
|||
'code'=>$code
|
||||
]);
|
||||
$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();
|
||||
return $this->json($res);
|
||||
}
|
||||
|
@ -135,6 +148,7 @@ class CommodityController extends AbstractController
|
|||
$data->setCommodityCountCheck($params['commodityCountCheck']);
|
||||
}
|
||||
$data->setMinOrderCount($params['minOrderCount']);
|
||||
$data->setSpeedAccess($params['speedAccess']);
|
||||
$data->setDayLoading($params['dayLoading']);
|
||||
$data->setOrderPoint($params['orderPoint']);
|
||||
//set cat
|
||||
|
|
|
@ -90,6 +90,8 @@ class PersonsController extends AbstractController
|
|||
$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))
|
||||
|
|
|
@ -70,6 +70,9 @@ class Commodity
|
|||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $dayLoading = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $speedAccess = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->setPriceBuy(0);
|
||||
|
@ -329,4 +332,16 @@ class Commodity
|
|||
|
||||
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)]
|
||||
private Collection $shareholders;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?bool $speedAccess = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->hesabdariRows = new ArrayCollection();
|
||||
|
@ -576,4 +579,16 @@ class Person
|
|||
|
||||
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;
|
||||
|
||||
protected Request $request;
|
||||
protected $request;
|
||||
protected RequestStack $requestStack;
|
||||
|
||||
function __construct(
|
||||
|
|