diff --git a/hesabixCore/migrations/Version20250804133410.php b/hesabixCore/migrations/Version20250804133410.php new file mode 100644 index 00000000..68c7eb53 --- /dev/null +++ b/hesabixCore/migrations/Version20250804133410.php @@ -0,0 +1,31 @@ +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'); + } +} diff --git a/hesabixCore/src/Entity/Commodity.php b/hesabixCore/src/Entity/Commodity.php index e56dd70d..5f3f68ea 100644 --- a/hesabixCore/src/Entity/Commodity.php +++ b/hesabixCore/src/Entity/Commodity.php @@ -33,7 +33,7 @@ class Commodity #[ORM\Column(type: 'string', length: 255, nullable: true)] private $des; - #[ORM\Column(type: 'bigint')] + #[ORM\Column(type: 'string', length: 255)] private $code; #[ORM\Column(nullable: true)] diff --git a/hesabixCore/src/Service/twigFunctions.php b/hesabixCore/src/Service/twigFunctions.php index 4ed93fc0..6b33b515 100644 --- a/hesabixCore/src/Service/twigFunctions.php +++ b/hesabixCore/src/Service/twigFunctions.php @@ -99,6 +99,7 @@ class twigFunctions $numberOfUnits = floor($hash / $unit); return $numberOfUnits . ' ' . $text; } + return '0 کیلوهش'; } public function getHesabixLastVersionNumber(): string @@ -111,7 +112,8 @@ class twigFunctions 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() @@ -123,14 +125,16 @@ class twigFunctions { // اگر پلاگین accpro فعال نباشد، مقدار پیش‌فرض را برمی‌گرداند 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]); 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 یا خالی باشد، مقدار پیش‌فرض را برمی‌گرداند 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; diff --git a/webUI/public/img/plugins/taxplugin.jpg b/webUI/public/img/plugins/taxplugin.jpg index 8b2765dc..ae8acfdf 100644 Binary files a/webUI/public/img/plugins/taxplugin.jpg and b/webUI/public/img/plugins/taxplugin.jpg differ