Funktionstüchtig
This commit is contained in:
@@ -67,21 +67,19 @@ namespace CardmarketBot
|
|||||||
IWebElement element;
|
IWebElement element;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
element = cd.FindElement(By.XPath("/html/body/main/section/div[3]/div[3]/div[2]"));
|
element = cd.FindElement(By.XPath("/html/body/main/section/div[3]/div[4]"));
|
||||||
|
|
||||||
string content = element.Text;
|
string content = element.Text;
|
||||||
|
|
||||||
List<string> bereitsbearbeitet = _usedRepository.Query;
|
List<string> bereitsbearbeitet = _usedRepository.Query;
|
||||||
string[] datas = content.Split("\r\n");
|
string[] datas = content.Split("\r\n");
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < datas.Length; i += 7)
|
for (int i = 8; i < datas.Length; i += 7)
|
||||||
{
|
{
|
||||||
if (bereitsbearbeitet.Find(x => x.Equals(datas[i])) != null) continue;
|
if (bereitsbearbeitet.Find(x => x.Equals(datas[i])) != null) continue;
|
||||||
ids.Add(datas[i]);
|
ids.Add(datas[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(OpenQA.Selenium.NotFoundException ex)
|
catch(OpenQA.Selenium.NotFoundException ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ static class Helper
|
|||||||
{
|
{
|
||||||
public enum Porto
|
public enum Porto
|
||||||
{
|
{
|
||||||
|
FAILED,
|
||||||
BRIEF085,
|
BRIEF085,
|
||||||
BRIEF100,
|
BRIEF100,
|
||||||
BRIEF160,
|
BRIEF160,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// See https://aka.ms/new-console-template for more information
|
// See https://aka.ms/new-console-template for more information
|
||||||
|
|
||||||
using ConsoleApp3.DataContracts;
|
using ConsoleApp3.DataContracts;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@@ -57,11 +58,11 @@ namespace CardmarketBot
|
|||||||
//rechnung.InvoiceNumber = string.Format("RE-{0}", await GetNextInvoiceNumber()); => Should be done by services.
|
//rechnung.InvoiceNumber = string.Format("RE-{0}", await GetNextInvoiceNumber()); => Should be done by services.
|
||||||
rechnung.InvoiceDate = kunde.Bezahldatum;
|
rechnung.InvoiceDate = kunde.Bezahldatum;
|
||||||
rechnung.Header = string.Format("Verkauf #{0}",kunde.BestellungID);
|
rechnung.Header = string.Format("Verkauf #{0}",kunde.BestellungID);
|
||||||
rechnung.HeadText = "Sehr geehrte Damen und Herren," +
|
rechnung.HeadText = "Sehr geehrte Damen und Herren, " +
|
||||||
"Wir stellen Ihnen für Ihre bestellung folgende Rechnung." +
|
"wir stellen Ihnen für ihre Bestellung folgende Rechnung. " +
|
||||||
"Bitte Beachte, dass der Lieferdatum die Bestelldatum entspricht.";
|
"Bitte Beachte, dass das Lieferdatum dem Bestelldatum entspricht.";
|
||||||
rechnung.FootText = "Ihre Rechnung ist bereits über Cardmarket beglichen worden.";
|
rechnung.FootText = "Ihre Rechnung ist bereits über Cardmarket beglichen worden.";
|
||||||
rechnung.TimeToPay = new DateTime(0);
|
rechnung.TimeToPay = new DateTime(14);
|
||||||
rechnung.Discount = 0;
|
rechnung.Discount = 0;
|
||||||
rechnung.Address = string.Format("{0}\n{1} {2}\n{3} {4}", kunde.Name, kunde.Strasse, kunde.Hausnummer, kunde.Plz, kunde.Ort); //"Damian Wessels\nDät Haartje 27A\n26683 Saterland";
|
rechnung.Address = string.Format("{0}\n{1} {2}\n{3} {4}", kunde.Name, kunde.Strasse, kunde.Hausnummer, kunde.Plz, kunde.Ort); //"Damian Wessels\nDät Haartje 27A\n26683 Saterland";
|
||||||
rechnung.AddressCountry = new ModelStaticCountry()
|
rechnung.AddressCountry = new ModelStaticCountry()
|
||||||
@@ -110,14 +111,26 @@ namespace CardmarketBot
|
|||||||
Id = null,
|
Id = null,
|
||||||
MapAll = true,
|
MapAll = true,
|
||||||
Quantity = 1,
|
Quantity = 1,
|
||||||
Price = PortoPreis[kunde.Versandskosten],
|
//Price = PortoPreis[kunde.Versandskosten],
|
||||||
Name = "Versandskosten",
|
Name = "Versandskosten",
|
||||||
PositionNumber = 0,
|
PositionNumber = 0,
|
||||||
Discount = 0,
|
Discount = 0,
|
||||||
TaxRate = 19,
|
TaxRate = 19,
|
||||||
PriceGross = PortoPreis[kunde.Versandskosten],
|
//PriceGross = PortoPreis[kunde.Versandskosten],
|
||||||
PriceTax = 19
|
PriceTax = 19
|
||||||
};
|
};
|
||||||
|
if(kunde.OverrideVersandskosten != null)
|
||||||
|
{
|
||||||
|
//Debugger.Break();
|
||||||
|
temp.InvoicePosSaves[temp.InvoicePosSaves.Length - 1].Price = Convert.ToDecimal(kunde.OverrideVersandskosten);
|
||||||
|
temp.InvoicePosSaves[temp.InvoicePosSaves.Length - 1].Price = Convert.ToDecimal(kunde.OverrideVersandskosten);
|
||||||
|
//Debugger.Break();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
temp.InvoicePosSaves[temp.InvoicePosSaves.Length - 1].Price = PortoPreis[kunde.Versandskosten];
|
||||||
|
temp.InvoicePosSaves[temp.InvoicePosSaves.Length - 1].PriceGross = PortoPreis[kunde.Versandskosten];
|
||||||
|
}
|
||||||
result.Add(temp);
|
result.Add(temp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,5 +48,6 @@ class Kunde
|
|||||||
plz = PLZ;
|
plz = PLZ;
|
||||||
ort = Ort;
|
ort = Ort;
|
||||||
land = Land;
|
land = Land;
|
||||||
|
Versandskosten = Helper.Porto.FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user