Compare commits
3 commits
2a66d960dd
...
89a3a070f9
| Author | SHA1 | Date | |
|---|---|---|---|
| 89a3a070f9 | |||
| 0cf74ff550 | |||
| 209ce1e3f8 |
24 changed files with 204 additions and 81 deletions
10
.idea/inspectionProfiles/Project_Default.xml
Executable file
10
.idea/inspectionProfiles/Project_Default.xml
Executable file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||||
|
<option name="processCode" value="true" />
|
||||||
|
<option name="processLiterals" value="true" />
|
||||||
|
<option name="processComments" value="true" />
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
0
.idea/modules.xml
Executable file → Normal file
0
.idea/modules.xml
Executable file → Normal file
0
.idea/php.xml
Executable file → Normal file
0
.idea/php.xml
Executable file → Normal file
6
.idea/sqldialects.xml
Executable file
6
.idea/sqldialects.xml
Executable file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="SqlDialectMappings">
|
||||||
|
<file url="file://$PROJECT_DIR$/class/actions_supplierlink3.class.php" dialect="GenericSQL" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
0
.idea/supplierlink3.iml
Executable file → Normal file
0
.idea/supplierlink3.iml
Executable file → Normal file
0
.idea/vcs.xml
Executable file → Normal file
0
.idea/vcs.xml
Executable file → Normal file
0
COPYING
Executable file → Normal file
0
COPYING
Executable file → Normal file
0
ChangeLog.md
Executable file → Normal file
0
ChangeLog.md
Executable file → Normal file
0
README.md
Executable file → Normal file
0
README.md
Executable file → Normal file
0
admin/about.php
Executable file → Normal file
0
admin/about.php
Executable file → Normal file
0
admin/setup.php
Executable file → Normal file
0
admin/setup.php
Executable file → Normal file
0
build/buildzip.php
Executable file → Normal file
0
build/buildzip.php
Executable file → Normal file
0
build/makepack-supplierlink3.conf
Executable file → Normal file
0
build/makepack-supplierlink3.conf
Executable file → Normal file
14
class/actions_supplierlink3.class.php
Executable file → Normal file
14
class/actions_supplierlink3.class.php
Executable file → Normal file
|
|
@ -862,22 +862,22 @@ class ActionsSupplierLink3 extends CommonHookActions
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prüfen ob Produktzeilen vorhanden sind
|
// Prüfen ob Produktzeilen oder Freitext-Zeilen vorhanden sind
|
||||||
|
// Freitext-Zeilen haben fk_product = 0 oder NULL
|
||||||
$sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."commandedet
|
$sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."commandedet
|
||||||
WHERE fk_commande = ".(int)$object->id."
|
WHERE fk_commande = ".(int)$object->id."
|
||||||
AND fk_product > 0
|
AND (product_type = 0 OR fk_product = 0 OR fk_product IS NULL)";
|
||||||
AND product_type = 0";
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$hasProducts = false;
|
$hasLines = false;
|
||||||
if ($resql) {
|
if ($resql) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$hasProducts = ($obj->nb > 0);
|
$hasLines = ($obj->nb > 0);
|
||||||
$this->debugLog('Produktzeilen gefunden: '.$obj->nb, 'addMoreActionsButtons');
|
$this->debugLog('Produkt-/Freitextzeilen gefunden: '.$obj->nb, 'addMoreActionsButtons');
|
||||||
} else {
|
} else {
|
||||||
$this->debugLog('SQL Fehler: '.$db->lasterror(), 'addMoreActionsButtons');
|
$this->debugLog('SQL Fehler: '.$db->lasterror(), 'addMoreActionsButtons');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($hasProducts) {
|
if ($hasLines) {
|
||||||
$buttonUrl = dol_buildpath('/custom/supplierlink3/create_supplier_order.php', 1).'?origin=commande&originid='.$object->id;
|
$buttonUrl = dol_buildpath('/custom/supplierlink3/create_supplier_order.php', 1).'?origin=commande&originid='.$object->id;
|
||||||
|
|
||||||
// Button per JavaScript einfügen (da Dolibarr resPrint bei diesem Hook nicht ausgibt)
|
// Button per JavaScript einfügen (da Dolibarr resPrint bei diesem Hook nicht ausgibt)
|
||||||
|
|
|
||||||
2
core/modules/modSupplierLink3.class.php
Executable file → Normal file
2
core/modules/modSupplierLink3.class.php
Executable file → Normal file
|
|
@ -76,7 +76,7 @@ class modSupplierLink3 extends DolibarrModules
|
||||||
$this->editor_squarred_logo = ''; // Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@supplierlink3'
|
$this->editor_squarred_logo = ''; // Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@supplierlink3'
|
||||||
|
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z'
|
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z'
|
||||||
$this->version = '2.0';
|
$this->version = '2.1';
|
||||||
// Url to the file with your last numberversion of this module
|
// Url to the file with your last numberversion of this module
|
||||||
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
|
//$this->url_last_version = 'http://www.example.com/versionmodule.txt';
|
||||||
|
|
||||||
|
|
|
||||||
253
create_supplier_order.php
Executable file → Normal file
253
create_supplier_order.php
Executable file → Normal file
|
|
@ -88,42 +88,51 @@ if ($action == 'create_supplier_orders') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($srcline && !empty($srcline->fk_product)) {
|
if ($srcline) {
|
||||||
// Günstigsten Lieferantenpreis für diesen Lieferanten finden
|
|
||||||
$sql = "SELECT pfp.rowid, pfp.ref_fourn, pfp.price, pfp.quantity as min_qty
|
|
||||||
FROM ".MAIN_DB_PREFIX."product_fournisseur_price pfp
|
|
||||||
WHERE pfp.fk_product = ".(int)$srcline->fk_product."
|
|
||||||
AND pfp.fk_soc = ".(int)$supplier_id."
|
|
||||||
ORDER BY pfp.price ASC
|
|
||||||
LIMIT 1";
|
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
$fournprice = 0;
|
$fournprice = 0;
|
||||||
$fournref = '';
|
$fournref = '';
|
||||||
$fournpricerowid = 0;
|
$fournpricerowid = 0;
|
||||||
|
|
||||||
if ($resql && $db->num_rows($resql) > 0) {
|
// Für Produkte: Günstigsten Lieferantenpreis für diesen Lieferanten finden
|
||||||
$objprice = $db->fetch_object($resql);
|
if (!empty($srcline->fk_product)) {
|
||||||
$fournprice = $objprice->price;
|
$sql = "SELECT pfp.rowid, pfp.ref_fourn, pfp.price, pfp.quantity as min_qty
|
||||||
$fournref = $objprice->ref_fourn;
|
FROM ".MAIN_DB_PREFIX."product_fournisseur_price pfp
|
||||||
$fournpricerowid = $objprice->rowid;
|
WHERE pfp.fk_product = ".(int)$srcline->fk_product."
|
||||||
|
AND pfp.fk_soc = ".(int)$supplier_id."
|
||||||
|
ORDER BY pfp.price ASC
|
||||||
|
LIMIT 1";
|
||||||
|
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
|
if ($resql && $db->num_rows($resql) > 0) {
|
||||||
|
$objprice = $db->fetch_object($resql);
|
||||||
|
$fournprice = $objprice->price;
|
||||||
|
$fournref = $objprice->ref_fourn;
|
||||||
|
$fournpricerowid = $objprice->rowid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Beschreibung für Freitext-Zeilen mit Hinweis versehen
|
||||||
|
$desc = $srcline->desc;
|
||||||
|
if (empty($srcline->fk_product)) {
|
||||||
|
$desc = "[FREITEXT - Produkt noch zuordnen]\n".$srcline->desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zeile zur Lieferantenbestellung hinzufügen
|
// Zeile zur Lieferantenbestellung hinzufügen
|
||||||
$result_line = $supplierorder->addline(
|
$result_line = $supplierorder->addline(
|
||||||
$srcline->desc, // Description
|
$desc, // Description
|
||||||
$fournprice, // Unit price
|
$fournprice, // Unit price
|
||||||
$srcline->qty, // Quantity
|
$srcline->qty, // Quantity
|
||||||
$srcline->tva_tx, // VAT rate
|
$srcline->tva_tx, // VAT rate
|
||||||
$srcline->localtax1_tx, // Local tax 1
|
$srcline->localtax1_tx, // Local tax 1
|
||||||
$srcline->localtax2_tx, // Local tax 2
|
$srcline->localtax2_tx, // Local tax 2
|
||||||
$srcline->fk_product, // Product ID
|
$srcline->fk_product, // Product ID (0 für Freitext)
|
||||||
$fournpricerowid, // Supplier price ID
|
$fournpricerowid, // Supplier price ID
|
||||||
$fournref, // Supplier ref
|
$fournref, // Supplier ref
|
||||||
$srcline->remise_percent, // Discount
|
$srcline->remise_percent, // Discount
|
||||||
'HT', // Price base type
|
'HT', // Price base type
|
||||||
0, // pu_ht_devise
|
0, // pu_ht_devise
|
||||||
0, // type
|
$srcline->product_type, // type (0=Produkt, 1=Dienstleistung)
|
||||||
0, // info_bits
|
0, // info_bits
|
||||||
false, // notrigger
|
false, // notrigger
|
||||||
null, // date_start
|
null, // date_start
|
||||||
|
|
@ -203,33 +212,106 @@ print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border centpercent tableforfield">';
|
print '<table class="border centpercent tableforfield">';
|
||||||
print '<tr class="liste_titre"><th colspan="2">Neue Lieferantenbestellung</th></tr>';
|
print '<tr class="liste_titre"><th colspan="2">Neue Lieferantenbestellung</th></tr>';
|
||||||
|
|
||||||
// Alle Lieferanten mit Shop-URL abrufen, die Produkte aus diesem Auftrag liefern können
|
// Prüfen ob Produkte im Auftrag sind
|
||||||
$sql = "SELECT DISTINCT s.rowid, s.nom
|
$sqlCheckProducts = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."commandedet
|
||||||
FROM ".MAIN_DB_PREFIX."societe s
|
WHERE fk_commande = ".(int)$originid." AND fk_product > 0";
|
||||||
INNER JOIN ".MAIN_DB_PREFIX."product_fournisseur_price pfp ON pfp.fk_soc = s.rowid
|
$resCheckProducts = $db->query($sqlCheckProducts);
|
||||||
WHERE pfp.fk_product IN (
|
$hasProducts = false;
|
||||||
SELECT cd.fk_product FROM ".MAIN_DB_PREFIX."commandedet cd
|
if ($resCheckProducts) {
|
||||||
WHERE cd.fk_commande = ".(int)$originid." AND cd.fk_product > 0
|
$objCheck = $db->fetch_object($resCheckProducts);
|
||||||
)
|
$hasProducts = ($objCheck->nb > 0);
|
||||||
AND s.fournisseur = 1
|
}
|
||||||
ORDER BY s.nom ASC";
|
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
// Automatische Lieferanten: Nur die, die Produkte aus diesem Auftrag liefern können
|
||||||
$suppliers = array();
|
$autoSuppliers = array();
|
||||||
if ($resql) {
|
if ($hasProducts) {
|
||||||
while ($obj = $db->fetch_object($resql)) {
|
$sql = "SELECT DISTINCT s.rowid, s.nom
|
||||||
$suppliers[$obj->rowid] = $obj->nom;
|
FROM ".MAIN_DB_PREFIX."societe s
|
||||||
|
INNER JOIN ".MAIN_DB_PREFIX."product_fournisseur_price pfp ON pfp.fk_soc = s.rowid
|
||||||
|
WHERE pfp.fk_product IN (
|
||||||
|
SELECT cd.fk_product FROM ".MAIN_DB_PREFIX."commandedet cd
|
||||||
|
WHERE cd.fk_commande = ".(int)$originid." AND cd.fk_product > 0
|
||||||
|
)
|
||||||
|
AND s.fournisseur = 1
|
||||||
|
ORDER BY s.nom ASC";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
|
$autoSuppliers[$obj->rowid] = $obj->nom;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Manuelle Lieferanten: Alle Lieferanten
|
||||||
|
$manualSuppliers = array();
|
||||||
|
$sql = "SELECT s.rowid, s.nom
|
||||||
|
FROM ".MAIN_DB_PREFIX."societe s
|
||||||
|
WHERE s.fournisseur > 0
|
||||||
|
ORDER BY s.nom ASC";
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
|
$manualSuppliers[$obj->rowid] = $obj->nom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wenn keine automatischen Lieferanten, Standard auf manuell
|
||||||
|
$defaultMode = !empty($autoSuppliers) ? 'auto' : 'manual';
|
||||||
|
|
||||||
|
// Auswahl-Modus
|
||||||
|
print '<tr class="oddeven"><td class="titlefield">Lieferanten-Auswahl</td>';
|
||||||
|
print '<td>';
|
||||||
|
print '<label style="margin-right: 15px;"><input type="radio" name="supplier_mode" value="auto" id="mode_auto"'.($defaultMode == 'auto' ? ' checked' : '').(!empty($autoSuppliers) ? '' : ' disabled').'> Automatisch <span class="opacitymedium">('.count($autoSuppliers).' passende)</span></label>';
|
||||||
|
print '<label><input type="radio" name="supplier_mode" value="manual" id="mode_manual"'.($defaultMode == 'manual' ? ' checked' : '').'> Manuell <span class="opacitymedium">(alle '.count($manualSuppliers).' Lieferanten)</span></label>';
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven"><td class="titlefield fieldrequired">Lieferant</td>';
|
print '<tr class="oddeven"><td class="titlefield fieldrequired">Lieferant</td>';
|
||||||
print '<td><select name="supplier_id" id="supplier_id" class="flat maxwidth300" required>';
|
print '<td><select name="supplier_id" id="supplier_id" class="flat maxwidth300" required>';
|
||||||
print '<option value="">-- Lieferant wählen --</option>';
|
print '<option value="">-- Lieferant wählen --</option>';
|
||||||
foreach ($suppliers as $id => $name) {
|
// Beide Listen als data-Attribute für JavaScript speichern
|
||||||
$selected = (GETPOST('supplier_id', 'int') == $id) ? ' selected' : '';
|
print '</select>';
|
||||||
print '<option value="'.$id.'"'.$selected.'>'.dol_escape_htmltag($name).'</option>';
|
|
||||||
|
// Hidden divs mit den Optionen für JavaScript
|
||||||
|
print '<div id="autoSupplierOptions" style="display:none;">';
|
||||||
|
foreach ($autoSuppliers as $id => $name) {
|
||||||
|
print '<span data-id="'.$id.'">'.dol_escape_htmltag($name).'</span>';
|
||||||
}
|
}
|
||||||
print '</select></td></tr>';
|
print '</div>';
|
||||||
|
print '<div id="manualSupplierOptions" style="display:none;">';
|
||||||
|
foreach ($manualSuppliers as $id => $name) {
|
||||||
|
print '<span data-id="'.$id.'">'.dol_escape_htmltag($name).'</span>';
|
||||||
|
}
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// JavaScript für Modus-Umschaltung
|
||||||
|
print '<script type="text/javascript">
|
||||||
|
function updateSupplierDropdown() {
|
||||||
|
var mode = document.querySelector(\'input[name="supplier_mode"]:checked\').value;
|
||||||
|
var select = document.getElementById("supplier_id");
|
||||||
|
var sourceDiv = (mode == "auto") ? document.getElementById("autoSupplierOptions") : document.getElementById("manualSupplierOptions");
|
||||||
|
|
||||||
|
// Dropdown leeren
|
||||||
|
select.innerHTML = \'<option value="">-- Lieferant wählen --</option>\';
|
||||||
|
|
||||||
|
// Optionen aus dem entsprechenden div laden
|
||||||
|
var spans = sourceDiv.getElementsByTagName("span");
|
||||||
|
for (var i = 0; i < spans.length; i++) {
|
||||||
|
var option = document.createElement("option");
|
||||||
|
option.value = spans[i].getAttribute("data-id");
|
||||||
|
option.text = spans[i].textContent;
|
||||||
|
select.appendChild(option);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Event-Listener für Radio-Buttons
|
||||||
|
document.getElementById("mode_auto").addEventListener("change", updateSupplierDropdown);
|
||||||
|
document.getElementById("mode_manual").addEventListener("change", updateSupplierDropdown);
|
||||||
|
|
||||||
|
// Initial laden
|
||||||
|
document.addEventListener("DOMContentLoaded", updateSupplierDropdown);
|
||||||
|
</script>';
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>Lieferanten-Referenz</td>';
|
print '<tr class="oddeven"><td>Lieferanten-Referenz</td>';
|
||||||
print '<td><input type="text" name="ref_supplier" value="'.dol_escape_htmltag($supplier_ref_default).'" class="flat quatrevingtpercent" placeholder="Kunde - Auftrag / Zeichen">';
|
print '<td><input type="text" name="ref_supplier" value="'.dol_escape_htmltag($supplier_ref_default).'" class="flat quatrevingtpercent" placeholder="Kunde - Auftrag / Zeichen">';
|
||||||
|
|
@ -254,55 +336,72 @@ print '<th class="right">Lagerbestand</th>';
|
||||||
print '<th colspan="2">Lieferanten</th>';
|
print '<th colspan="2">Lieferanten</th>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Produkte aus Kundenauftrag auflisten
|
// Zeilen aus Kundenauftrag auflisten (Produkte und Freitext)
|
||||||
foreach ($objectsrc->lines as $line) {
|
foreach ($objectsrc->lines as $line) {
|
||||||
// Nur Produkte, keine Dienstleistungen
|
// Dienstleistungen überspringen (nur Produkte und Freitext)
|
||||||
if (empty($line->fk_product) || $line->product_type != 0) {
|
if (!empty($line->fk_product) && $line->product_type != 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Produkt laden
|
$isFreitext = empty($line->fk_product);
|
||||||
$product = new Product($db);
|
$product = null;
|
||||||
$product->fetch($line->fk_product);
|
$qtyStock = 0;
|
||||||
|
$stockClass = '';
|
||||||
// Lagerbestand
|
|
||||||
$qtyStock = $product->stock_reel;
|
|
||||||
|
|
||||||
// Stock-Badge Farbe
|
|
||||||
$stockClass = 'badge-success';
|
|
||||||
if ($qtyStock <= 0) {
|
|
||||||
$stockClass = 'badge-danger';
|
|
||||||
} elseif ($product->seuil_stock_alerte > 0 && $qtyStock < $product->seuil_stock_alerte) {
|
|
||||||
$stockClass = 'badge-warning';
|
|
||||||
} elseif ($product->desiredstock > 0 && $qtyStock < $product->desiredstock) {
|
|
||||||
$stockClass = 'badge-secondary';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Lieferanten für dieses Produkt
|
|
||||||
$sql_suppliers = "SELECT pfp.fk_soc, pfp.price, pfp.ref_fourn, s.nom
|
|
||||||
FROM ".MAIN_DB_PREFIX."product_fournisseur_price pfp
|
|
||||||
INNER JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = pfp.fk_soc
|
|
||||||
WHERE pfp.fk_product = ".(int)$line->fk_product."
|
|
||||||
ORDER BY pfp.price ASC";
|
|
||||||
$ressuppliers = $db->query($sql_suppliers);
|
|
||||||
$supplierList = array();
|
$supplierList = array();
|
||||||
if ($ressuppliers) {
|
|
||||||
while ($objsup = $db->fetch_object($ressuppliers)) {
|
if (!$isFreitext) {
|
||||||
$supplierList[] = dol_escape_htmltag($objsup->nom).' ('.number_format($objsup->price, 2, ',', '.').' EUR)';
|
// Produkt laden
|
||||||
|
$product = new Product($db);
|
||||||
|
$product->fetch($line->fk_product);
|
||||||
|
|
||||||
|
// Lagerbestand
|
||||||
|
$qtyStock = $product->stock_reel;
|
||||||
|
|
||||||
|
// Stock-Badge Farbe
|
||||||
|
$stockClass = 'badge-success';
|
||||||
|
if ($qtyStock <= 0) {
|
||||||
|
$stockClass = 'badge-danger';
|
||||||
|
} elseif ($product->seuil_stock_alerte > 0 && $qtyStock < $product->seuil_stock_alerte) {
|
||||||
|
$stockClass = 'badge-warning';
|
||||||
|
} elseif ($product->desiredstock > 0 && $qtyStock < $product->desiredstock) {
|
||||||
|
$stockClass = 'badge-secondary';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Lieferanten für dieses Produkt
|
||||||
|
$sql_suppliers = "SELECT pfp.fk_soc, pfp.price, pfp.ref_fourn, s.nom
|
||||||
|
FROM ".MAIN_DB_PREFIX."product_fournisseur_price pfp
|
||||||
|
INNER JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = pfp.fk_soc
|
||||||
|
WHERE pfp.fk_product = ".(int)$line->fk_product."
|
||||||
|
ORDER BY pfp.price ASC";
|
||||||
|
$ressuppliers = $db->query($sql_suppliers);
|
||||||
|
if ($ressuppliers) {
|
||||||
|
while ($objsup = $db->fetch_object($ressuppliers)) {
|
||||||
|
$supplierList[] = dol_escape_htmltag($objsup->nom).' ('.number_format($objsup->price, 2, ',', '.').' EUR)';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven'.($isFreitext ? ' freitext-row' : '').'">';
|
||||||
|
|
||||||
// Checkbox
|
// Checkbox
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<input type="checkbox" name="toselect[]" value="'.$line->id.'" class="linecheckbox">';
|
print '<input type="checkbox" name="toselect[]" value="'.$line->id.'" class="linecheckbox">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Produkt
|
// Produkt oder Freitext
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $product->getNomUrl(1);
|
if ($isFreitext) {
|
||||||
print ' - '.dol_escape_htmltag($product->label);
|
print '<span class="badge badge-info" style="margin-right: 5px;">FREITEXT</span>';
|
||||||
|
// Beschreibung anzeigen (gekürzt wenn zu lang)
|
||||||
|
$desc = dol_string_nohtmltag($line->desc);
|
||||||
|
if (strlen($desc) > 100) {
|
||||||
|
$desc = substr($desc, 0, 100).'...';
|
||||||
|
}
|
||||||
|
print '<em>'.dol_escape_htmltag($desc).'</em>';
|
||||||
|
} else {
|
||||||
|
print $product->getNomUrl(1);
|
||||||
|
print ' - '.dol_escape_htmltag($product->label);
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Menge
|
// Menge
|
||||||
|
|
@ -310,12 +409,18 @@ foreach ($objectsrc->lines as $line) {
|
||||||
|
|
||||||
// Lagerbestand
|
// Lagerbestand
|
||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print '<span class="badge '.$stockClass.'">'.(int)$qtyStock.'</span>';
|
if ($isFreitext) {
|
||||||
|
print '<span class="opacitymedium">-</span>';
|
||||||
|
} else {
|
||||||
|
print '<span class="badge '.$stockClass.'">'.(int)$qtyStock.'</span>';
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Lieferanten
|
// Lieferanten
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if (!empty($supplierList)) {
|
if ($isFreitext) {
|
||||||
|
print '<span class="opacitymedium">Produkt manuell zuordnen</span>';
|
||||||
|
} elseif (!empty($supplierList)) {
|
||||||
print implode('<br>', $supplierList);
|
print implode('<br>', $supplierList);
|
||||||
} else {
|
} else {
|
||||||
print '<span class="opacitymedium">Keine Lieferanten</span>';
|
print '<span class="opacitymedium">Keine Lieferanten</span>';
|
||||||
|
|
@ -353,6 +458,8 @@ print '<style>
|
||||||
.badge.badge-warning { background-color: #fd7e14 !important; color: #fff !important; }
|
.badge.badge-warning { background-color: #fd7e14 !important; color: #fff !important; }
|
||||||
.badge.badge-secondary { background-color: #6c757d !important; color: #fff !important; }
|
.badge.badge-secondary { background-color: #6c757d !important; color: #fff !important; }
|
||||||
.badge.badge-success { background-color: #28a745 !important; color: #fff !important; }
|
.badge.badge-success { background-color: #28a745 !important; color: #fff !important; }
|
||||||
|
.badge.badge-info { background-color: #17a2b8 !important; color: #fff !important; }
|
||||||
|
.freitext-row { background-color: #fff3cd !important; }
|
||||||
</style>';
|
</style>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
|
||||||
0
img/README.md
Executable file → Normal file
0
img/README.md
Executable file → Normal file
0
js/replenish.js
Executable file → Normal file
0
js/replenish.js
Executable file → Normal file
0
langs/de_DE/supplierlink3.lang
Executable file → Normal file
0
langs/de_DE/supplierlink3.lang
Executable file → Normal file
0
langs/en_US/supplierlink3.lang
Executable file → Normal file
0
langs/en_US/supplierlink3.lang
Executable file → Normal file
0
lib/supplierlink3.lib.php
Executable file → Normal file
0
lib/supplierlink3.lib.php
Executable file → Normal file
0
modulebuilder.txt
Executable file → Normal file
0
modulebuilder.txt
Executable file → Normal file
0
sql/dolibarr_allversions.sql
Executable file → Normal file
0
sql/dolibarr_allversions.sql
Executable file → Normal file
0
supplierlink3index.php
Executable file → Normal file
0
supplierlink3index.php
Executable file → Normal file
Loading…
Reference in a new issue