Skip to content
GitLab
Erkunden
Anmelden
Registrieren
Primärnavigation
Suchen oder aufrufen …
Projekt
discount
Verwalten
Aktivität
Mitglieder
Labels
Planen
Tickets
4
Ticketübersichten
Meilensteine
Wiki
Code
Merge Requests
0
Repository
Branch
Commits
Tags
Repository-Diagramm
Revisionen vergleichen
Build
Pipelines
Aufgaben
Pipeline-Zeitpläne
Artefakte
Bereitstellung
Releases
Betreiben
Umgebungen
Überwachen
Vorfälle
Service-Desk
Analysieren
Wertschöpfungskettenanalyse
Mitwirkenden-Analyse
CI/CD-Analyse
Repository-Analysen
Hilfe
Hilfe
Support
GitLab-Dokumentation
GitLab-Pläne vergleichen
Community-Forum
Zu GitLab beitragen
Feedback geben
Tastenkürzel
?
Code-Schnipsel
Gruppen
Projekte
Show more breadcrumbs
QUIQQER
discount
Commits
4956d79f
Commit
4956d79f
erstellt
vor 7 Jahren
von
Henning Leutz
Dateien durchsuchen
Optionen
Downloads
Patches
Einfaches Diff
fix: mysql strict
Übergeordneter
1dae2e24
No related branches found
Branches enthält Commit
No related tags found
Tags enthält Commit
Keine zugehörigen Merge Requests gefunden
Änderungen
2
Leerzeichenänderungen ausblenden
Inline
Nebeneinander
2 geänderte Dateien
bin/controls/Select.js
+2
-1
2 Ergänzungen, 1 Löschung
bin/controls/Select.js
src/QUI/ERP/Discount/Discount.php
+52
-42
52 Ergänzungen, 42 Löschungen
src/QUI/ERP/Discount/Discount.php
werden angezeigt
mit
54 Ergänzungen
und
43 Löschungen
bin/controls/Select.js
+
2
−
1
Zeige Datei @
4956d79f
...
...
@@ -36,7 +36,8 @@ define('package/quiqqer/discount/bin/controls/Select', [
Type
:
'
package/quiqqer/discount/bin/controls/Select
'
,
Binds
:
[
'
searchDiscounts
'
'
searchDiscounts
'
,
'
$onSearchButtonClick
'
],
initialize
:
function
(
options
)
{
...
...
This diff is collapsed.
Zum Erweitern klicken.
src/QUI/ERP/Discount/Discount.php
+
52
−
42
Zeige Datei @
4956d79f
...
...
@@ -61,7 +61,7 @@ public function __construct($id, Handler $Factory)
$cleanup
=
implode
(
','
,
$cleanup
);
if
(
!
empty
(
$cleanup
))
{
$cleanup
=
','
.
$cleanup
.
','
;
$cleanup
=
','
.
$cleanup
.
','
;
}
$this
->
setAttribute
(
'user_groups'
,
$cleanup
);
...
...
@@ -72,7 +72,7 @@ public function __construct($id, Handler $Factory)
$cleanup
=
implode
(
','
,
$cleanup
);
if
(
!
empty
(
$cleanup
))
{
$cleanup
=
','
.
$cleanup
.
','
;
$cleanup
=
','
.
$cleanup
.
','
;
}
$this
->
setAttribute
(
'articles'
,
$cleanup
);
...
...
@@ -83,7 +83,7 @@ public function __construct($id, Handler $Factory)
$cleanup
=
implode
(
','
,
$cleanup
);
if
(
!
empty
(
$cleanup
))
{
$cleanup
=
','
.
$cleanup
.
','
;
$cleanup
=
','
.
$cleanup
.
','
;
}
$this
->
setAttribute
(
'user_groups'
,
$cleanup
);
...
...
@@ -94,7 +94,7 @@ public function __construct($id, Handler $Factory)
$cleanup
=
implode
(
','
,
$cleanup
);
if
(
!
empty
(
$cleanup
))
{
$cleanup
=
','
.
$cleanup
.
','
;
$cleanup
=
','
.
$cleanup
.
','
;
}
$this
->
setAttribute
(
'articles'
,
$cleanup
);
...
...
@@ -108,7 +108,7 @@ public function __construct($id, Handler $Factory)
$this
->
Events
->
addEvent
(
'onDeleteEnd'
,
function
()
{
QUI\Translator
::
delete
(
'quiqqer/discount'
,
'discount.'
.
$this
->
getId
()
.
'.title'
'discount.'
.
$this
->
getId
()
.
'.title'
);
});
...
...
@@ -118,19 +118,19 @@ public function __construct($id, Handler $Factory)
if
(
$this
->
getAttribute
(
'date_from'
)
&&
!
Orthos
::
checkMySqlDatetimeSyntax
(
$this
->
getAttribute
(
'date_from'
))
)
{
throw
new
QUI\ERP\Discount\Exception
(
array
(
throw
new
QUI\ERP\Discount\Exception
(
[
'quiqqer/discount'
,
'exception.discount.date_from.wrong'
)
);
]
);
}
if
(
$this
->
getAttribute
(
'date_until'
)
&&
!
Orthos
::
checkMySqlDatetimeSyntax
(
$this
->
getAttribute
(
'date_until'
))
)
{
throw
new
QUI\ERP\Discount\Exception
(
array
(
throw
new
QUI\ERP\Discount\Exception
(
[
'quiqqer/discount'
,
'exception.discount.date_until.wrong'
)
);
]
);
}
$purchaseQuantityFrom
=
$this
->
getAttribute
(
'purchase_quantity_from'
);
...
...
@@ -139,45 +139,55 @@ public function __construct($id, Handler $Factory)
$purchaseValueUntil
=
$this
->
getAttribute
(
'purchase_value_until'
);
if
(
$purchaseQuantityFrom
===
false
||
$purchaseQuantityFrom
<
0
)
{
throw
new
QUI\ERP\Discount\Exception
(
array
(
if
(
$purchaseQuantityFrom
===
false
||
$purchaseQuantityFrom
<
0
)
{
throw
new
QUI\ERP\Discount\Exception
([
'quiqqer/discount'
,
'exception.discount.purchase_quantity_from.wrong'
)
);
]
);
}
if
(
$purchaseQuantityUntil
===
false
||
$purchaseQuantityUntil
<
0
)
{
throw
new
QUI\ERP\Discount\Exception
(
array
(
if
(
$purchaseQuantityUntil
===
false
||
$purchaseQuantityUntil
<
0
)
{
throw
new
QUI\ERP\Discount\Exception
([
'quiqqer/discount'
,
'exception.discount.purchase_quantity_until.wrong'
)
);
]
);
}
if
(
$purchaseValueFrom
===
false
||
$purchaseValueFrom
<
0
)
{
throw
new
QUI\ERP\Discount\Exception
(
array
(
if
(
$purchaseValueFrom
===
false
||
$purchaseValueFrom
<
0
)
{
throw
new
QUI\ERP\Discount\Exception
([
'quiqqer/discount'
,
'exception.discount.purchase_value_from.wrong'
)
);
]
);
}
if
(
$purchaseValueUntil
===
false
||
$purchaseValueUntil
<
0
)
{
throw
new
QUI\ERP\Discount\Exception
(
array
(
if
(
$purchaseValueUntil
===
false
||
$purchaseValueUntil
<
0
)
{
throw
new
QUI\ERP\Discount\Exception
([
'quiqqer/discount'
,
'exception.discount.purchase_value_until.wrong'
)
);
]
);
}
});
}
/**
* @param string $key
* @param array|bool|object|string $value
* @return QUI\QDOM|void
*/
public
function
setAttribute
(
$key
,
$value
)
{
if
(
$key
===
'lastSumDiscount'
&&
empty
(
$value
))
{
$value
=
null
;
}
if
(
$key
===
'lastProductDiscount'
&&
empty
(
$value
))
{
$value
=
null
;
}
parent
::
setAttribute
(
$key
,
$value
);
}
/**
* Return the discount title
*
...
...
@@ -192,7 +202,7 @@ public function getTitle($Locale = null)
return
$Locale
->
get
(
'quiqqer/discount'
,
'discount.'
.
$this
->
getId
()
.
'.title'
'discount.'
.
$this
->
getId
()
.
'.title'
);
}
...
...
@@ -312,14 +322,14 @@ public function canUsedBy(QUI\Interfaces\Users\User $User)
public
function
verifyCombinationWith
(
Discount
$Discount
)
{
if
(
$this
->
canCombinedWith
(
$Discount
)
===
false
)
{
throw
new
QUI\ERP\Discount\Exception
(
array
(
throw
new
QUI\ERP\Discount\Exception
(
[
'quiqqer/discount'
,
'exception.discount.not.combinable'
,
array
(
[
'id'
=>
$this
->
getId
(),
'discountId'
=>
$Discount
->
getId
()
)
)
);
]
]
);
}
}
...
...
@@ -332,14 +342,14 @@ public function verifyCombinationWith(Discount $Discount)
public
function
verifyUser
(
User
$User
)
{
if
(
$this
->
canUsedBy
(
$User
)
===
false
)
{
throw
new
QUI\ERP\Discount\Exception
(
array
(
throw
new
QUI\ERP\Discount\Exception
(
[
'quiqqer/discount'
,
'exception.discount.user.cant.use.discount'
,
array
(
[
'id'
=>
$this
->
getId
(),
'userId'
=>
$User
->
getId
()
)
)
);
]
]
);
}
}
...
...
@@ -377,7 +387,7 @@ public function toPriceFactor($Locale = null)
$hideDiscounts
=
(
int
)
$Config
->
getValue
(
'products'
,
'hideDiscounts'
);
if
(
$this
->
getAttribute
(
'scope'
)
==
Handler
::
DISCOUNT_SCOPE_TOTAL
)
{
return
new
PriceFactor
(
array
(
return
new
PriceFactor
(
[
'title'
=>
$this
->
getTitle
(
$Locale
),
'description'
=>
''
,
'priority'
=>
(
int
)
$this
->
getAttribute
(
'priority'
),
...
...
@@ -386,10 +396,10 @@ public function toPriceFactor($Locale = null)
'value'
=>
$this
->
getAttribute
(
'discount'
)
*
-
1
,
'visible'
=>
$hideDiscounts
?
false
:
true
,
'vat'
=>
$this
->
getAttribute
(
'vat'
)
)
);
]
);
}
return
new
QUI\ERP\Products\Utils\PriceFactor
(
array
(
return
new
QUI\ERP\Products\Utils\PriceFactor
(
[
'title'
=>
$this
->
getTitle
(
$Locale
),
'description'
=>
''
,
'priority'
=>
(
int
)
$this
->
getAttribute
(
'priority'
),
...
...
@@ -397,6 +407,6 @@ public function toPriceFactor($Locale = null)
'basis'
=>
$basis
,
'value'
=>
$this
->
getAttribute
(
'discount'
)
*
-
1
,
'visible'
=>
$hideDiscounts
?
false
:
true
)
);
]
);
}
}
This diff is collapsed.
Zum Erweitern klicken.
Vorschau
0%
Wiederholen
oder
Neue Datei anhängen
.
Abbrechen
You are about to add
0
people
to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Kommentar speichern
Abbrechen
Bitte
registrieren
oder
Anmelden
zum Kommentieren