mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-15 04:27:14 +01:00
Bugfix shopimport, bugfixes presta, support for project specific number ranges
This commit is contained in:
parent
d705d1a3eb
commit
0e3afa437b
@ -29440,10 +29440,22 @@ function Firmendaten($field,$projekt="")
|
||||
$process_lock = $this->app->erp->ProzessLock("erpapi_getnextnummer");
|
||||
|
||||
$eigenernummernkreis = 0;
|
||||
$newbelegnr = '';
|
||||
if($eigenernummernkreis=='1')
|
||||
{
|
||||
$allowedtypes = ['angebot', 'auftrag', 'rechnung', 'lieferschein', 'arbeitsnachweis', 'reisekosten',
|
||||
'bestellung', 'gutschrift', 'kundennummer', 'lieferantennummer', 'mitarbeiternummer', 'waren',
|
||||
'produktion', 'sonstiges', 'anfrage', 'artikelnummer', 'kalkulation', 'preisanfrage', 'proformarechnung',
|
||||
'retoure', 'verbindlichkeit', 'goodspostingdocument', 'receiptdocument'];
|
||||
|
||||
} else {
|
||||
$dbfield = "next_$type";
|
||||
$dbvalue = $this->app->DB->Select("SELECT $dbfield FROM projekt WHERE id='$projekt' LIMIT 1");
|
||||
if (!empty($dbvalue)) {
|
||||
$newbelegnr = $this->CalcNextNummer($dbvalue);
|
||||
$this->app->DB->Update("UPDATE projekt SET $dbfield='$newbelegnr' WHERE id='$projekt' LIMIT 1");
|
||||
}
|
||||
}
|
||||
if (empty($newbelegnr)) {
|
||||
// naechste
|
||||
switch($type)
|
||||
{
|
||||
|
@ -830,7 +830,7 @@ class Shopimport
|
||||
// denn fall das es kunde 1:1 schon gibt = alte Kundennummer verwenden kommt vor allem vor, wenn ein Kunde an einem Tag oefters bestellt hat
|
||||
// $adresse = $this->app->erp->KundeAnlegen($typ,$name,$abteilung,
|
||||
// $unterabteilung,$ansprechpartner,$adresszusatz,$strasse,$land,$plz,$ort,$email,$telefon,$telefax,$ustid,$partner,$projekt);
|
||||
if(strlen($warenkorb['kundennummer'])!=''){
|
||||
if(!empty($warenkorb['kundennummer'])){
|
||||
$adresse = $this->app->DB->Select("SELECT id FROM adresse WHERE kundennummer='{$warenkorb['kundennummer']}' $adresseprojekt AND geloescht!=1 LIMIT 1");
|
||||
}
|
||||
|
||||
|
@ -253,15 +253,11 @@ class Shopimporter_Presta extends ShopimporterBase
|
||||
if (!empty($cart['lieferadresse_land']) && $this->taxationByDestinationCountry) {
|
||||
$taxedCountry = $cart['lieferadresse_land'];
|
||||
}
|
||||
if (strval($order->total_paid_tax_incl) === strval($order->total_paid_tax_excl)) {
|
||||
if ($this->app->erp->IstEU($taxedCountry)) {
|
||||
$cart['ust_befreit'] = 1;
|
||||
} elseif ($this->app->erp->Export($taxedCountry)) {
|
||||
$cart['ust_befreit'] = 2;
|
||||
} else {
|
||||
$cart['ust_befreit'] = 3;
|
||||
}
|
||||
}
|
||||
$lieferschwelle = $this->app->DB->Select("SELECT * FROM lieferschwelle WHERE empfaengerland='$taxedCountry' LIMIT 1");
|
||||
if ($this->app->erp->IstEU($taxedCountry) || !empty($lieferschwelle['ueberschreitungsdatum'])) {
|
||||
$cart['ust_befreit'] = 1;
|
||||
} elseif ($this->app->erp->Export($taxedCountry)) {
|
||||
$cart['ust_befreit'] = 2;
|
||||
|
||||
$taxes = [];
|
||||
$this->app->erp->RunHook('getTaxRatesFromShopOrder', 2, $taxedCountry, $taxes);
|
||||
|
Loading…
Reference in New Issue
Block a user