Skip to content
Code-Schnipsel Gruppen Projekte

Revisionen vergleichen

Änderungen werden so angezeigt, als ob die Quellrevision mit der Zielrevision zusammengeführt würde. Erfahre mehr über den Vergleich von Revisionen.

Quelle

Zielprojekt auswählen
No results found

Ziel

Zielprojekt auswählen
  • quiqqer/erp
1 Ergebnis
Änderungen anzeigen
......@@ -28,7 +28,7 @@ public static function getEntityType(): string;
* @param Locale|null $Locale $Locale (optional) - If omitted use \QUI::getLocale()
* @return mixed
*/
public static function getEntityTypeTitle(Locale $Locale = null): mixed;
public static function getEntityTypeTitle(null | Locale $Locale = null): mixed;
/**
* Get the entity the output is created for
......@@ -36,7 +36,7 @@ public static function getEntityTypeTitle(Locale $Locale = null): mixed;
* @param int|string $entityId
* @return mixed
*/
public static function getEntity(int|string $entityId): mixed;
public static function getEntity(int | string $entityId): mixed;
/**
* Get download filename (without file extension)
......@@ -44,7 +44,7 @@ public static function getEntity(int|string $entityId): mixed;
* @param int|string $entityId
* @return string
*/
public static function getDownloadFileName(int|string $entityId): string;
public static function getDownloadFileName(int | string $entityId): string;
/**
* Get output Locale by entity
......@@ -52,7 +52,7 @@ public static function getDownloadFileName(int|string $entityId): string;
* @param int|string $entityId
* @return Locale
*/
public static function getLocale(int|string $entityId): Locale;
public static function getLocale(int | string $entityId): Locale;
/**
* Fill the OutputTemplate with appropriate entity data
......@@ -60,7 +60,7 @@ public static function getLocale(int|string $entityId): Locale;
* @param int|string $entityId
* @return array
*/
public static function getTemplateData(int|string $entityId): array;
public static function getTemplateData(int | string $entityId): array;
/**
* Checks if $User has permission to download the document of $entityId
......@@ -69,7 +69,7 @@ public static function getTemplateData(int|string $entityId): array;
* @param User $User
* @return bool
*/
public static function hasDownloadPermission(int|string $entityId, User $User): bool;
public static function hasDownloadPermission(int | string $entityId, User $User): bool;
/**
* Get e-mail address of the document recipient
......@@ -77,7 +77,7 @@ public static function hasDownloadPermission(int|string $entityId, User $User):
* @param int|string $entityId
* @return string|false - E-Mail address or false if no e-mail address available
*/
public static function getEmailAddress(int|string $entityId): bool|string;
public static function getEmailAddress(int | string $entityId): bool | string;
/**
* Get e-mail subject when document is sent via mail
......@@ -85,7 +85,7 @@ public static function getEmailAddress(int|string $entityId): bool|string;
* @param int|string $entityId
* @return string
*/
public static function getMailSubject(int|string $entityId): string;
public static function getMailSubject(int | string $entityId): string;
/**
* Get e-mail body when document is sent via mail
......@@ -93,5 +93,5 @@ public static function getMailSubject(int|string $entityId): string;
* @param int|string $entityId
* @return string
*/
public static function getMailBody(int|string $entityId): string;
public static function getMailBody(int | string $entityId): string;
}
......@@ -17,17 +17,17 @@ class OutputTemplate
/**
* @var string|OutputTemplateProviderInterface
*/
protected string|OutputTemplateProviderInterface $TemplateProvider;
protected string | OutputTemplateProviderInterface $TemplateProvider;
/**
* @var string|OutputProviderInterface
*/
protected string|OutputProviderInterface $OutputProvider;
protected string | OutputProviderInterface $OutputProvider;
/**
* @var string|null
*/
protected string|null $template;
protected string | null $template;
/**
* @var QUI\Interfaces\Template\EngineInterface
......@@ -42,7 +42,7 @@ class OutputTemplate
/**
* @var string|int
*/
protected string|int $entityId;
protected string | int $entityId;
/**
* The entity the output is created for
......@@ -66,11 +66,11 @@ class OutputTemplate
* @param string|null $template (optional) - Template identifier (from template provider)
*/
public function __construct(
OutputTemplateProviderInterface|string $TemplateProvider,
OutputProviderInterface|string $OutputProvider,
int|string $entityId,
OutputTemplateProviderInterface | string $TemplateProvider,
OutputProviderInterface | string $OutputProvider,
int | string $entityId,
string $entityType,
string $template = null
null | string $template = null
) {
$this->Engine = QUI::getTemplateManager()->getEngine();
$this->TemplateProvider = $TemplateProvider;
......@@ -168,6 +168,14 @@ public function getHTML(bool $preview = false): string
*/
public function getPDFDocument(): QUI\HtmlToPdf\Document
{
if (!class_exists('QUI\HtmlToPdf\Document')) {
QUI\System\Log::addError('Missing html2pdf module. Please install the html2pdf module.');
throw new QUI\Exception(
'An error has occurred. Please try again or contact support if the issue persists.'
);
}
$Locale = $this->OutputProvider::getLocale($this->entityId);
QUI::getLocale()->setTemporaryCurrent($Locale->getCurrent());
......@@ -216,7 +224,7 @@ public function getEngine(): QUI\Interfaces\Template\EngineInterface
/**
* @return OutputTemplateProviderInterface|string
*/
public function getTemplateProvider(): OutputTemplateProviderInterface|string
public function getTemplateProvider(): OutputTemplateProviderInterface | string
{
if (is_string($this->TemplateProvider)) {
return $this->TemplateProvider;
......
......@@ -34,7 +34,10 @@ public static function getTemplates(string $entityType): array;
* @param Locale|null $Locale $Locale (optional) - If omitted use \QUI::getLocale()
* @return string
*/
public static function getTemplateTitle(int|string $templateId, Locale $Locale = null): string;
public static function getTemplateTitle(
int | string $templateId,
null | Locale $Locale = null
): string;
/**
* Get HTML for document header area
......@@ -46,11 +49,11 @@ public static function getTemplateTitle(int|string $templateId, Locale $Locale =
* @return string|false
*/
public static function getHeaderHtml(
int|string $templateId,
int | string $templateId,
string $entityType,
EngineInterface $Engine,
mixed $Entity
): bool|string;
): bool | string;
/**
* Get HTML for document body area
......@@ -62,11 +65,11 @@ public static function getHeaderHtml(
* @return string|false
*/
public static function getBodyHtml(
int|string $templateId,
int | string $templateId,
string $entityType,
EngineInterface $Engine,
mixed $Entity
): bool|string;
): bool | string;
/**
* Get HTML for document footer area
......@@ -78,9 +81,9 @@ public static function getBodyHtml(
* @return string|false
*/
public static function getFooterHtml(
int|string $templateId,
int | string $templateId,
string $entityType,
EngineInterface $Engine,
mixed $Entity
): bool|string;
): bool | string;
}
......@@ -31,19 +31,8 @@ class Process
*/
const PROCESS_ACTIVE_DATE = '2024-08-01 00:00:00';
/**
* @var string
*/
protected string $processId;
/**
* @var null|array
*/
protected ?array $transactions = null;
/**
* @var null|QUI\ERP\Comments
*/
protected ?Comments $History = null;
/**
......@@ -166,7 +155,11 @@ class_exists('QUI\ERP\Accounting\Invoice\Invoice')
$groups[$uuid][] = $Entity;
if (class_exists('QUI\ERP\SalesOrders\Handler')) {
$salesOrder = $Entity->getPaymentData('salesOrder');
$salesOrder = $Entity->getPaymentDataEntry('salesOrder');
if (empty($salesOrder)) {
$salesOrder = $Entity->getCustomDataEntry('salesOrder');
}
if ($salesOrder) {
try {
......
......@@ -43,6 +43,7 @@ public function getEntity($entityHash, $entityPlugin = false): ErpEntityInterfac
if ($entityPlugin === false || $entityPlugin === 'quiqqer/booking') {
try {
// @todo quiqqer/booking
// @phpstan-ignore-next-line
} catch (\Exception) {
}
}
......@@ -70,6 +71,7 @@ public function getEntity($entityHash, $entityPlugin = false): ErpEntityInterfac
if ($entityPlugin === false || $entityPlugin === 'quiqqer/delivery-notes') {
try {
// @todo quiqqer/delivery-notes
// @phpstan-ignore-next-line
} catch (\Exception) {
}
}
......
......@@ -292,7 +292,7 @@ public static function convertUserDataToErpUser(array $user): User
/**
* @deprecated use getUUID()
*/
public function getId(): int|false
public function getId(): int | false
{
return $this->id;
}
......@@ -433,7 +433,7 @@ public function getStatus(): int
* @param int|string $id - only for the interface, has no effect
* @return Address
*/
public function getAddress(int|string $id = 0): QUI\Users\Address
public function getAddress(int | string $id = 0): QUI\Users\Address
{
return new Address($this->address, $this);
}
......@@ -514,7 +514,7 @@ public function isSU(): bool
return false;
}
public function isInGroup(int|string $groupId): bool
public function isInGroup(int | string $groupId): bool
{
return false;
}
......@@ -541,7 +541,7 @@ public function deactivate(?UserInterface $PermissionUser = null): bool
return true;
}
public function disable(UserInterface|null $PermissionUser = null): bool
public function disable(UserInterface | null $PermissionUser = null): bool
{
return true;
}
......@@ -561,7 +561,7 @@ public function delete(?UserInterface $PermissionUser = null): bool
/**
* This user has nowhere permissions
*/
public function getPermission(string $right, bool|array|string|callable $ruleset = false): bool
public function getPermission(string $right, bool | array | string | callable $ruleset = false): bool
{
return false;
}
......@@ -571,7 +571,7 @@ public function getStandardAddress(): Address
return $this->getAddress();
}
public function addAddress(array $params = [], QUI\Interfaces\Users\User $ParentUser = null): ?Address
public function addAddress(array $params = [], null | QUI\Interfaces\Users\User $ParentUser = null): ?Address
{
return null;
}
......@@ -579,7 +579,7 @@ public function addAddress(array $params = [], QUI\Interfaces\Users\User $Parent
/**
* Does nothing
*/
public function setGroups(array|string $groups)
public function setGroups(array | string $groups)
{
}
......@@ -632,12 +632,15 @@ public function getAvatar(): ?QUI\Projects\Media\Image
/**
* Does nothing
*/
public function setPassword(string $new, ?UserInterface $PermissionUser = null)
public function setPassword(string $new, null | UserInterface $PermissionUser = null)
{
}
public function changePassword(string $newPassword, string $oldPassword, UserInterface $ParentUser = null): void
{
public function changePassword(
string $newPassword,
string $oldPassword,
null | UserInterface $ParentUser = null
): void {
}
/**
......@@ -672,14 +675,14 @@ public function setCompanyStatus(bool $status)
/**
* Does nothing
*/
public function addToGroup(int|string $groupId)
public function addToGroup(int | string $groupId)
{
}
/**
* Does nothing
*/
public function removeGroup(Group|int|string $Group)
public function removeGroup(Group | int | string $Group)
{
}
......@@ -743,7 +746,7 @@ public function getAuthenticator(string $authenticator): AuthenticatorInterface
);
}
public function enableAuthenticator(string $authenticator, UserInterface $ParentUser = null): void
public function enableAuthenticator(string $authenticator, null | UserInterface $ParentUser = null): void
{
throw new QUI\Users\Exception(
['quiqqer/core', 'exception.authenticator.not.found'],
......@@ -751,7 +754,7 @@ public function enableAuthenticator(string $authenticator, UserInterface $Parent
);
}
public function disableAuthenticator(string $authenticator, UserInterface $ParentUser = null): void
public function disableAuthenticator(string $authenticator, null | UserInterface $ParentUser = null): void
{
throw new QUI\Users\Exception(
['quiqqer/core', 'exception.authenticator.not.found'],
......
......@@ -15,7 +15,7 @@ class Sites
* @param QUI\Locale|null $Locale - in which language the page should be
* @return QUI\Projects\Site|null
*/
public static function getTermsAndConditions(QUI\Locale $Locale = null): ?QUI\Projects\Site
public static function getTermsAndConditions(null | QUI\Locale $Locale = null): ?QUI\Projects\Site
{
if ($Locale === null) {
$Locale = QUI::getLocale();
......@@ -43,7 +43,7 @@ public static function getTermsAndConditions(QUI\Locale $Locale = null): ?QUI\Pr
* @param QUI\Locale|null $Locale - in which language the page should be
* @return QUI\Projects\Site|null
*/
public static function getRevocation(QUI\Locale $Locale = null): ?QUI\Projects\Site
public static function getRevocation(null | QUI\Locale $Locale = null): ?QUI\Projects\Site
{
if ($Locale === null) {
$Locale = QUI::getLocale();
......@@ -71,7 +71,7 @@ public static function getRevocation(QUI\Locale $Locale = null): ?QUI\Projects\S
* @param QUI\Locale|null $Locale - in which language the page should be
* @return QUI\Projects\Site|null
*/
public static function getPrivacyPolicy(QUI\Locale $Locale = null): ?QUI\Projects\Site
public static function getPrivacyPolicy(null | QUI\Locale $Locale = null): ?QUI\Projects\Site
{
if ($Locale === null) {
$Locale = QUI::getLocale();
......
......@@ -227,7 +227,7 @@ public static function isNettoUser(UserInterface $User): bool
* @return bool|QUI\ERP\Areas\Area
* @throws QUI\Exception
*/
public static function getUserArea(UserInterface $User): bool|QUI\ERP\Areas\Area
public static function getUserArea(UserInterface $User): bool | QUI\ERP\Areas\Area
{
$CurrentAddress = $User->getAttribute('CurrentAddress');
......@@ -276,7 +276,7 @@ public static function getUserArea(UserInterface $User): bool|QUI\ERP\Areas\Area
* @throws Exception
* @throws QUI\Permissions\Exception
*/
public static function getUserERPAddress(UserInterface $User): null|Address|array
public static function getUserERPAddress(UserInterface $User): null | Address | array
{
if (!QUI::getUsers()->isUser($User)) {
throw new QUI\Exception([
......