Neu Laufende eBay+ Amazonangbote in Eigene Übersichten

Frederik von Bot

Sehr aktives Mitglied
8. September 2012
193
68
Hallo,

wir würden gerne in den Eigenen Übersichten laufende Angebote und Verkaufzahlen einbinden um Mehrfachangebote zu vermeiden. Die Möglichkeit würde viele Klicks ersparen.

Mit Sql Abfragen habe ich schlechte Erfahrungen gemacht deswegen meide ich es wie der Teufel das Weihwasser selber zu experimentieren.

In der Wiki bin ich fündig geworden, da würde ich gerne noch den Namen der laufenden Auktion, Titel zur ID

Beispiel
Unbenannt.JPG

--Amazon Angebote
SELECT tPlattform.cName AS 'Plattform',
jAmazon.nQuantity AS 'Menge',
jAmazon.fPrice AS 'Akt. Preis',
ISNULL(jLetzte30Tage.absatz, 0) AS 'Absatz 30 Tage',
ISNULL(jLetzte90Tage.absatz, 0) AS 'Abs. 90 Tage',
ISNULL(jLetzte365Tage.absatz, 0) AS 'Abs. 365 Tage',
ISNULL(jAbsatzGesamt.absatz, 0) AS 'Abs. Gesamt',
ISNULL(jVKDurchschnitt.vk, 0) 'Ø VK-Brutto',
ISNULL(jAmazon.cASIN1, '') AS 'ID'
FROM tPlattform
JOIN ( --läuft er überhaupt auf amazon?
SELECT nPlattform,
nQuantity,
ROUND(CONVERT(FLOAT, fPrice), 2) AS fPrice,
pf_amazon_angebot.cASIN1
FROM pf_amazon_angebot
JOIN pf_amazon_angebot_mapping ON pf_amazon_angebot_mapping.cSellerSKU = pf_amazon_angebot.cSellerSKU
AND pf_amazon_angebot_mapping.kUser = pf_amazon_angebot.kUser
WHERE pf_amazon_angebot_mapping.kArtikel = @Key
) AS jAmazon ON jAmazon.nPlattform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
AND tBestellung.dErstellt > DATEADD(DAY, -30, getdate())
GROUP BY nPlatform
) AS jLetzte30Tage ON jLetzte30Tage.nPlatform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
AND tBestellung.dErstellt > DATEADD(DAY, -90, getdate())
GROUP BY nPlatform
) AS jLetzte90Tage ON jLetzte90Tage.nPlatform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
AND tBestellung.dErstellt > DATEADD(DAY, -365, getdate())
GROUP BY nPlatform
) AS jLetzte365Tage ON jLetzte365Tage.nPlatform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
GROUP BY nPlatform
) AS jAbsatzGesamt ON jAbsatzGesamt.nPlatform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(AVG(tbestellpos.fVKPreis), 0.0)), 2) AS vk
FROM tbestellpos
JOIN tBestellung ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
GROUP BY nPlatform
) AS jVKDurchschnitt ON jVKDurchschnitt.nPlatform = tPlattform.nPlattform
UNION --eBay Angebote - normale Artikel
SELECT tPlattform.cName AS 'Plattform',
ISNULL(jEbay.Quantity, 0) AS 'Menge',
ISNULL(jEbay.StartPrice, 0) AS 'Akt. Preis',
ISNULL(jLetzte30Tage.absatz, 0) AS 'Absatz 30 Tage',
ISNULL(jLetzte90Tage.absatz, 0) AS 'Abs. 90 Tage',
ISNULL(jLetzte365Tage.absatz, 0) AS 'Abs. 365 Tage',
ISNULL(jAbsatzGesamt.absatz, 0) AS 'Abs. Gesamt',
ISNULL(jVKDurchschnitt.vk, 0) 'Ø VK-Brutto',
ISNULL(jEbay.ItemID, '') AS 'ID'
FROM tPlattform
JOIN ( --läuft er überhaupt auf ebay?
SELECT ebay_xx_sites.kPlattform,
ebay_item.Quantity,
ROUND(CONVERT(FLOAT, ebay_item.StartPrice), 2) AS StartPrice,
ebay_item.ItemID
FROM ebay_item
JOIN ebay_xx_sites ON ebay_xx_sites.SiteID = ebay_item.SiteID
WHERE ebay_item.kArtikel = @Key
AND ebay_item.Status IN (3,7)
) AS jEbay ON jEbay.kPlattform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
AND tBestellung.dErstellt > DATEADD(DAY, -30, getdate())
GROUP BY nPlatform
) AS jLetzte30Tage ON jLetzte30Tage.nPlatform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
AND tBestellung.dErstellt > DATEADD(DAY, -90, getdate())
GROUP BY nPlatform
) AS jLetzte90Tage ON jLetzte90Tage.nPlatform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
AND tBestellung.dErstellt > DATEADD(DAY, -365, getdate())
GROUP BY nPlatform
) AS jLetzte365Tage ON jLetzte365Tage.nPlatform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
GROUP BY nPlatform
) AS jAbsatzGesamt ON jAbsatzGesamt.nPlatform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(AVG(tbestellpos.fVKPreis), 0.0)), 2) AS vk
FROM tbestellpos
JOIN tBestellung ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
GROUP BY nPlatform
) AS jVKDurchschnitt ON jVKDurchschnitt.nPlatform = tPlattform.nPlattform
UNION --eBay Angebote - als Kindartikel im eBay Variationsangebot
SELECT tPlattform.cName AS 'Plattform',
jEbay.fAnzahl AS 'Menge',
jEbay.fPreis AS 'Akt. Preis',
ISNULL(jLetzte30Tage.absatz, 0) AS 'Absatz 30 Tage',
ISNULL(jLetzte90Tage.absatz, 0) AS 'Abs. 90 Tage',
ISNULL(jLetzte365Tage.absatz, 0) AS 'Abs. 365 Tage',
ISNULL(jAbsatzGesamt.absatz, 0) AS 'Abs. Gesamt',
ISNULL(jVKDurchschnitt.vk, 0) 'Ø VK-Brutto',
CONCAT('Varkombi-Kind: ', jEbay.ItemID) AS 'ID'
FROM tPlattform
JOIN ( --läuft er überhaupt auf ebay als Kindartikel?
SELECT ebay_xx_sites.kPlattform,
CONVERT(INT, ebay_item2kombi.fAnzahl) AS fAnzahl,
ROUND(CONVERT(FLOAT, ebay_item2kombi.fPreis), 2) AS fPreis,
ebay_item.ItemID
FROM ebay_item
JOIN ebay_xx_sites ON ebay_xx_sites.SiteID = ebay_item.SiteID
JOIN ebay_item2kombi ON ebay_item2kombi.kItem = ebay_item.kItem
JOIN tartikel ON tartikel.kEigenschaftKombi = ebay_item2kombi.kEigenschaftKombi
WHERE tartikel.kArtikel = @Key
AND ebay_item.Status IN (3,7)
) AS jEbay ON jEbay.kPlattform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
AND tBestellung.dErstellt > DATEADD(DAY, -30, getdate())
GROUP BY nPlatform
) AS jLetzte30Tage ON jLetzte30Tage.nPlatform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
AND tBestellung.dErstellt > DATEADD(DAY, -90, getdate())
GROUP BY nPlatform
) AS jLetzte90Tage ON jLetzte90Tage.nPlatform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
AND tBestellung.dErstellt > DATEADD(DAY, -365, getdate())
GROUP BY nPlatform
) AS jLetzte365Tage ON jLetzte365Tage.nPlatform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
GROUP BY nPlatform
) AS jAbsatzGesamt ON jAbsatzGesamt.nPlatform = tPlattform.nPlattform
LEFT JOIN (
SELECT nPlatform, ROUND(CONVERT(FLOAT, ISNULL(AVG(tbestellpos.fVKPreis), 0.0)), 2) AS vk
FROM tbestellpos
JOIN tBestellung ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
GROUP BY nPlatform
) AS jVKDurchschnitt ON jVKDurchschnitt.nPlatform = tPlattform.nPlattform
UNION --eBay Angebote - als Kindartikel im eBay Variationsangebot
SELECT tShop.cName AS 'Plattform',
ISNULL(jShop.fVerfuegbar, 0) AS 'Menge',
dbo.ifGetPrice(jShop.kArtikel, 0, 1, jShop.kShop, 1) AS 'Akt. Preis',
ISNULL(jLetzte30Tage.absatz, 0) AS 'Absatz 30 Tage',
ISNULL(jLetzte90Tage.absatz, 0) AS 'Abs. 90 Tage',
ISNULL(jLetzte365Tage.absatz, 0) AS 'Abs. 365 Tage',
ISNULL(jAbsatzGesamt.absatz, 0) AS 'Abs. Gesamt',
ISNULL(jVKDurchschnitt.vk, 0) 'Ø VK-Brutto',
jShop.cArtNr AS 'ID'
FROM tShop
JOIN ( --läuft er in Shops oder POS, etc.?
SELECT tArtikelShop.kShop,
tArtikelShop.kArtikel,
ROUND(CONVERT(FLOAT, ISNULL(vLagerbestandEx.fVerfuegbar, 0)), 2) AS fVerfuegbar,
tartikel.cArtNr
FROM tartikel
JOIN tArtikelShop ON tArtikelShop.kArtikel = tartikel.kArtikel
LEFT JOIN vLagerbestandEx ON vLagerbestandEx.kArtikel = tartikel.kArtikel
WHERE tartikel.kArtikel = @Key
AND tArtikelShop.cDelInet != 'Y'
) AS jShop ON jShop.kShop = tShop.kShop
LEFT JOIN (
SELECT kShop, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
AND tBestellung.dErstellt > DATEADD(DAY, -30, getdate())
GROUP BY kShop
) AS jLetzte30Tage ON jLetzte30Tage.kShop = tShop.kShop
LEFT JOIN (
SELECT kShop, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
AND tBestellung.dErstellt > DATEADD(DAY, -90, getdate())
GROUP BY kShop
) AS jLetzte90Tage ON jLetzte90Tage.kShop = tShop.kShop
LEFT JOIN (
SELECT kShop, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
AND tBestellung.dErstellt > DATEADD(DAY, -365, getdate())
GROUP BY kShop
) AS jLetzte365Tage ON jLetzte365Tage.kShop = tShop.kShop
LEFT JOIN (
SELECT kShop, ROUND(CONVERT(FLOAT, ISNULL(SUM(tbestellpos.nAnzahl), 0.0)), 2) AS absatz
FROM tbestellung
JOIN tbestellpos ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
GROUP BY kShop
) AS jAbsatzGesamt ON jAbsatzGesamt.kShop = tShop.kShop
LEFT JOIN (
SELECT kShop, ROUND(CONVERT(FLOAT, ISNULL(AVG(tbestellpos.fVKPreis), 0.0)), 2) AS vk
FROM tbestellpos
JOIN tBestellung ON tbestellpos.tBestellung_kBestellung = tBestellung.kBestellung
WHERE tbestellpos.tArtikel_kArtikel = @Key
AND tBestellung.nStorno = 0 -- Stornierte Aufträge nicht beachten
AND tbestellung.cType = 'B'
GROUP BY kShop
) AS jVKDurchschnitt ON jVKDurchschnitt.kShop = tShop.kShop
 
Zuletzt bearbeitet:
  • Gefällt mir
Reaktionen: bilder_lf
Ähnliche Themen
Titel Forum Antworten Datum
Neu Kind-Artikel nicht bei Ebay anbieten Allgemeine Fragen zu JTL-Shop 1
Neu Neues Tool - eBay Penner finden, beenden und neu listen Schnittstellen Import / Export 0
Rechnung an geänderte Emailadresse geht immer noch an die Alte (Ebay-Auftrag) JTL-Wawi 1.11 6
Neu eBay-Abgleich Fehlermeldung: Datenverarbeitung fehlgeschlagen: Die Sequenz enthält keine Elemente eBay-Anbindung - Fehler und Bugs 8
Neu eBay Vorlage lässt sich nicht mehr öffnen JTL-Wawi - Fehler und Bugs 0
Neu ebay artikelnamen User helfen Usern - Fragen zu JTL-Wawi 4
Problem beim Import über Ameise/eBay JTL-Wawi 1.11 1
Neu Nach Update auf 1.11.10.0 Abgleich zu Ebay über 3 Stunden bei neuen Angeboten eBay-Anbindung - Fehler und Bugs 2
Neu WAWI 2.0.2 Auftragsuche nach Ebay-Benutzernamen funktioniert nicht JTL-Wawi - Fehler und Bugs 1
Ebay angebote lassen sich nicht mehr bei JTL bearbeiten JTL-Wawi 2.0 0
Neu Probleme beim Erstellen von Artikeln aus Angeboten von eBay User helfen Usern - Fragen zu JTL-Wawi 1
Neu eBay Attribute - Ändern / Überschreiben JTL-Ameise - Fehler und Bugs 9
globale Angebotsvorlage anpassen für eBay Angebote "Artikelspezifisch" JTL-Wawi 1.11 0
Neu Ebay Kategoriemapping Einrichtung und Installation von JTL-eazyAuction 2
Neu DRIGEND HILFE!!! Ebay Abgleich endet mit Arithmetischer Überlauffehler für tinyint-Datentyp, Wert = -1. Die Anweisung wurde beendet. eBay-Anbindung - Fehler und Bugs 4
Neu Ebay Variantenartikel aktuallisieren / Obergrenze 250 Varianten eBay-Anbindung - Fehler und Bugs 0
Neu [Tool] FloTax — eBay + Billbee → DATEV/Lexoffice | §25a | OSS | Reverse Charge | von JTL-Partner Dienstleistung, Jobs und Ähnliches 0

Ähnliche Themen