bug fix in commodity custome code
This commit is contained in:
parent
532ca041f6
commit
63b6654cc8
31
hesabixCore/migrations/Version20250804133410.php
Normal file
31
hesabixCore/migrations/Version20250804133410.php
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20250804133410 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('ALTER TABLE commodity CHANGE code code VARCHAR(255) NOT NULL');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('ALTER TABLE commodity CHANGE code code BIGINT NOT NULL');
|
||||||
|
}
|
||||||
|
}
|
|
@ -33,7 +33,7 @@ class Commodity
|
||||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||||
private $des;
|
private $des;
|
||||||
|
|
||||||
#[ORM\Column(type: 'bigint')]
|
#[ORM\Column(type: 'string', length: 255)]
|
||||||
private $code;
|
private $code;
|
||||||
|
|
||||||
#[ORM\Column(nullable: true)]
|
#[ORM\Column(nullable: true)]
|
||||||
|
|
|
@ -99,6 +99,7 @@ class twigFunctions
|
||||||
$numberOfUnits = floor($hash / $unit);
|
$numberOfUnits = floor($hash / $unit);
|
||||||
return $numberOfUnits . ' ' . $text;
|
return $numberOfUnits . ' ' . $text;
|
||||||
}
|
}
|
||||||
|
return '0 کیلوهش';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHesabixLastVersionNumber(): string
|
public function getHesabixLastVersionNumber(): string
|
||||||
|
@ -111,7 +112,8 @@ class twigFunctions
|
||||||
|
|
||||||
public function systemSettings()
|
public function systemSettings()
|
||||||
{
|
{
|
||||||
return $this->em->getRepository(Settings::class)->findAll()[0];
|
$settings = $this->em->getRepository(Settings::class)->findAll();
|
||||||
|
return $settings[0] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCurrentUrl()
|
public function getCurrentUrl()
|
||||||
|
@ -123,14 +125,16 @@ class twigFunctions
|
||||||
{
|
{
|
||||||
// اگر پلاگین accpro فعال نباشد، مقدار پیشفرض را برمیگرداند
|
// اگر پلاگین accpro فعال نباشد، مقدار پیشفرض را برمیگرداند
|
||||||
if (!$pluginService->isActive('accpro', $bid)) {
|
if (!$pluginService->isActive('accpro', $bid)) {
|
||||||
return $side === 'left' ? $this->getStaticData('system', 'footerLeft') : $this->getStaticData('system', 'footerRight');
|
$defaultText = $side === 'left' ? $this->getStaticData('system', 'footerLeft') : $this->getStaticData('system', 'footerRight');
|
||||||
|
return $defaultText ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// دریافت تنظیمات چاپ
|
// دریافت تنظیمات چاپ
|
||||||
$printOptions = $this->em->getRepository(PrintOptions::class)->findOneBy(['bid' => $bid]);
|
$printOptions = $this->em->getRepository(PrintOptions::class)->findOneBy(['bid' => $bid]);
|
||||||
|
|
||||||
if (!$printOptions) {
|
if (!$printOptions) {
|
||||||
return $side === 'left' ? $this->getStaticData('system', 'footerLeft') : $this->getStaticData('system', 'footerRight');
|
$defaultText = $side === 'left' ? $this->getStaticData('system', 'footerLeft') : $this->getStaticData('system', 'footerRight');
|
||||||
|
return $defaultText ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// دریافت متن پانویس بر اساس سمت
|
// دریافت متن پانویس بر اساس سمت
|
||||||
|
@ -138,7 +142,8 @@ class twigFunctions
|
||||||
|
|
||||||
// اگر متن null یا خالی باشد، مقدار پیشفرض را برمیگرداند
|
// اگر متن null یا خالی باشد، مقدار پیشفرض را برمیگرداند
|
||||||
if ($footerText === null || $footerText === '') {
|
if ($footerText === null || $footerText === '') {
|
||||||
return $side === 'left' ? $this->getStaticData('system', 'footerLeft') : $this->getStaticData('system', 'footerRight');
|
$defaultText = $side === 'left' ? $this->getStaticData('system', 'footerLeft') : $this->getStaticData('system', 'footerRight');
|
||||||
|
return $defaultText ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $footerText;
|
return $footerText;
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 136 KiB |
Loading…
Reference in a new issue