mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-12-25 06:00:28 +01:00
Bugfixes angebot, ajax to repair
This commit is contained in:
parent
ef13e61896
commit
0b0224f6ba
@ -4671,7 +4671,7 @@ title: 'Abschicken',
|
||||
$ddate = $result[0]['gueltigbis'];
|
||||
$result[0]['gueltigbis'] = $this->app->String->Convert($result[0]['gueltigbis'],"%1-%2-%3","%3.%2.%1");
|
||||
$duedt = explode("-", $ddate);
|
||||
$date = mktime(0, 0, 0, $duedt[1], $duedt[2], $duedt[0]);
|
||||
$date = mktime(0, 0, 0, (int) $duedt[1], (int) $duedt[2], (int) $duedt[0]);
|
||||
$week = date('W/Y', $date);
|
||||
$text = str_replace('{GUELTIGBIS}',$result[0]['gueltigbis'],$text);
|
||||
$text = str_replace('{GUELTIGBISWOCHE}',$week,$text);
|
||||
@ -45019,6 +45019,7 @@ function Firmendaten($field,$projekt="")
|
||||
$letzter_preis = 0;
|
||||
|
||||
// einmal rueckwaerts aufraeumen
|
||||
|
||||
$cvkarr = !empty($vkarr)?count($vkarr):0;
|
||||
for($vi=0;$vi<$cvkarr;$vi++)
|
||||
{
|
||||
@ -45043,7 +45044,14 @@ function Firmendaten($field,$projekt="")
|
||||
if($vkarr[$vi]['ab_menge'] > 0)
|
||||
$vkarr2[] = $vkarr[$vi];
|
||||
}
|
||||
$vkarr = array_reverse($vkarr2);
|
||||
|
||||
if (!is_null($vkarr2)) {
|
||||
$vkarr = array_reverse($vkarr2);
|
||||
}
|
||||
else {
|
||||
$vkarr = $vkarr2;
|
||||
}
|
||||
|
||||
// an schluss pruefen und unnötige rausschmeissen
|
||||
return $vkarr;
|
||||
}
|
||||
|
@ -409,7 +409,7 @@ class Angebot extends GenAngebot
|
||||
FROM angebot_position ap, artikel a
|
||||
WHERE ap.angebot='$id' AND a.id=ap.artikel
|
||||
ORDER by ap.sort"
|
||||
);
|
||||
,0,"");
|
||||
$artikel = $table->DisplayNew("return","Preis","noAction","false",0,0,false);
|
||||
|
||||
$this->app->Tpl->Add('JAVASCRIPT',"
|
||||
@ -427,7 +427,7 @@ class Angebot extends GenAngebot
|
||||
FROM angebot_position ap, artikel a
|
||||
WHERE ap.angebot='$id' AND a.id=ap.artikel
|
||||
ORDER by ap.sort"
|
||||
);
|
||||
,0,"");
|
||||
$artikel = $table->DisplayNew("return","Preis","noAction");
|
||||
}
|
||||
|
||||
@ -460,7 +460,7 @@ class Angebot extends GenAngebot
|
||||
}
|
||||
|
||||
$tmp = new EasyTable($this->app);
|
||||
$tmp->Query("SELECT zeit,bearbeiter,grund FROM angebot_protokoll WHERE angebot='$id' ORDER by zeit DESC");
|
||||
$tmp->Query("SELECT zeit,bearbeiter,grund FROM angebot_protokoll WHERE angebot='$id' ORDER by zeit DESC",0,"");
|
||||
$tmp->DisplayNew('PROTOKOLL',"Protokoll","noAction");
|
||||
|
||||
$this->app->Tpl->Set('RECHNUNGLIEFERADRESSE',$this->AngebotRechnungsLieferadresse($auftragArr[0]['id']));
|
||||
@ -526,7 +526,7 @@ class Angebot extends GenAngebot
|
||||
|
||||
// wenn abweichende rechnungsadresse bei kunden aktiv ist dann diese verwenden
|
||||
|
||||
$abweichende = $this->app->DB->Select("SELECT abweichende_rechnungsadresse FROM adresse WHERE id='".$data[0][adresse]."' LIMIT 1");
|
||||
$abweichende = $this->app->DB->Select("SELECT abweichende_rechnungsadresse FROM adresse WHERE id='".$data[0]['adresse']."' LIMIT 1");
|
||||
if($abweichende=="1")
|
||||
{
|
||||
$adresse_data = $this->app->DB->SelectArr("SELECT * FROM adresse WHERE id='".$data[0]['adresse']."' LIMIT 1");
|
||||
@ -680,11 +680,11 @@ class Angebot extends GenAngebot
|
||||
if(a.porto,'-',if((SELECT SUM(l.menge) FROM lager_platz_inhalt l WHERE l.artikel=ap.artikel) > ap.menge,(SELECT TRIM(SUM(l.menge))+0 FROM lager_platz_inhalt l WHERE l.artikel=ap.artikel),
|
||||
if((SELECT SUM(l.menge) FROM lager_platz_inhalt l WHERE l.artikel=ap.artikel)>0,CONCAT('<font color=red><b>',(SELECT TRIM(SUM(l.menge))+0 FROM lager_platz_inhalt l WHERE l.artikel=ap.artikel),'</b></font>'),
|
||||
'<font color=red><b>aus</b></font>'))) as Lager,".$this->app->erp->FormatPreis("ap.preis*(100-ap.rabatt)/100",2)." as preis
|
||||
FROM angebot_position ap, artikel a WHERE ap.angebot='$id' AND a.id=ap.artikel");
|
||||
FROM angebot_position ap, artikel a WHERE ap.angebot='$id' AND a.id=ap.artikel",0,"");
|
||||
$artikel = $table->DisplayNew("return","Preis","noAction");
|
||||
} else {
|
||||
$table->Query("SELECT SUBSTRING(ap.bezeichnung,1,20) as artikel, ap.nummer as Nummer, TRIM(ap.menge)+0 as Menge,".$this->app->erp->FormatPreis("ap.preis*(100-ap.rabatt)/100",2)." as preis
|
||||
FROM angebot_position ap, artikel a WHERE ap.angebot='$id' AND a.id=ap.artikel");
|
||||
FROM angebot_position ap, artikel a WHERE ap.angebot='$id' AND a.id=ap.artikel",0,"");
|
||||
$artikel = $table->DisplayNew("return","Preis","noAction");
|
||||
}
|
||||
echo $artikel;
|
||||
@ -857,7 +857,7 @@ class Angebot extends GenAngebot
|
||||
|
||||
$this->app->Tpl->Set('TABTEXT',"Protokoll");
|
||||
$tmp = new EasyTable($this->app);
|
||||
$tmp->Query("SELECT zeit,bearbeiter,grund FROM angebot_protokoll WHERE angebot='$id' ORDER by zeit DESC");
|
||||
$tmp->Query("SELECT zeit,bearbeiter,grund FROM angebot_protokoll WHERE angebot='$id' ORDER by zeit DESC",0,"");
|
||||
$tmp->DisplayNew('TAB1',"Protokoll","noAction");
|
||||
|
||||
$this->app->Tpl->Parse('PAGE',"tabview.tpl");
|
||||
@ -1273,7 +1273,7 @@ class Angebot extends GenAngebot
|
||||
CONCAT('<input type=\"text\" size=\"8\" value=\"00.00.0000\" id=\"datum',v.id,'\">
|
||||
<img src=\"./themes/new/images/kalender.png\" height=\"12\" onclick=\"displayCalendar(document.forms[1].datum',v.id,',\'dd.mm.yyyy\',this)\" border=0 align=right>') as Lieferdatum,
|
||||
CONCAT('<input type=\"text\" size=\"3\" value=\"\" id=\"menge',v.id,'\">') as menge, v.id as id
|
||||
FROM artikel a LEFT JOIN verkaufspreise v ON a.id=v.artikel LEFT JOIN projekt p ON v.projekt=p.id WHERE v.ab_menge>=1");
|
||||
FROM artikel a LEFT JOIN verkaufspreise v ON a.id=v.artikel LEFT JOIN projekt p ON v.projekt=p.id WHERE v.ab_menge>=1",0,"");
|
||||
$table->DisplayNew('INHALT', "<input type=\"button\"
|
||||
onclick=\"document.location.href='index.php?module=angebot&action=addposition&id=$id&sid=%value%&menge=' + document.getElementById('menge%value%').value + '&datum=' + document.getElementById('datum%value%').value;\" value=\"anlegen\">");
|
||||
$this->app->Tpl->Parse('UEBERSICHT',"rahmen70.tpl");
|
||||
@ -1814,7 +1814,7 @@ class Angebot extends GenAngebot
|
||||
$table = new EasyTable($this->app);
|
||||
$table->Query("SELECT bezeichnung as artikel, nummer as Nummer, menge, vpe as VPE, FORMAT(preis,4) as preis
|
||||
FROM angebot_position
|
||||
WHERE angebot='$id'");
|
||||
WHERE angebot='$id'",0,"");
|
||||
$table->DisplayNew('POSITIONEN',"Preis","noAction");
|
||||
|
||||
// $bearbeiter = $this->app->DB->Select("SELECT bearbeiter FROM angebot WHERE id='$id' LIMIT 1");
|
||||
|
@ -187,17 +187,23 @@ class WidgetAngebot extends WidgetGenAngebot
|
||||
|
||||
|
||||
$zahlungsweisenmodule = $this->app->DB->SelectArr("SELECT id, modul, type FROM zahlungsweisen WHERE verhalten = 'rechnung'");
|
||||
for($iz=0;$iz<count($zahlungsweisenmodule);$iz++) $cmdcheck[] = " cmd=='".$zahlungsweisenmodule[$iz]['type']."'";
|
||||
|
||||
if (!is_null($zahlungsweisenmodule)) {
|
||||
for($iz=0;$iz<count($zahlungsweisenmodule);$iz++) $cmdcheck[] = " cmd=='".$zahlungsweisenmodule[$iz]['type']."'";
|
||||
}
|
||||
|
||||
$field = new HTMLSelect("zahlungsweise",0);
|
||||
if(count($zahlungsweisenmodule) > 0)
|
||||
$field->onchange="var cmd = this.form.zahlungsweise.options[this.form.zahlungsweise.selectedIndex].value; if(".implode(' || ',$cmdcheck).") cmd='rechnung'; aktion_buchen(cmd);";
|
||||
else
|
||||
$field->onchange="var cmd = this.form.zahlungsweise.options[this.form.zahlungsweise.selectedIndex].value; aktion_buchen(cmd);";
|
||||
|
||||
if (!is_null($zahlungsweisenmodule)) {
|
||||
if(count($zahlungsweisenmodule) > 0)
|
||||
$field->onchange="var cmd = this.form.zahlungsweise.options[this.form.zahlungsweise.selectedIndex].value; if(".implode(' || ',$cmdcheck).") cmd='rechnung'; aktion_buchen(cmd);";
|
||||
else
|
||||
$field->onchange="var cmd = this.form.zahlungsweise.options[this.form.zahlungsweise.selectedIndex].value; aktion_buchen(cmd);";
|
||||
}
|
||||
|
||||
$field->AddOptionsSimpleArray($zahlungsweise);
|
||||
$this->form->NewField($field);
|
||||
|
||||
|
||||
$field = new HTMLSelect("zahlungsstatus",0);
|
||||
$field->AddOptionsSimpleArray($zahlungsstatus);
|
||||
$this->form->NewField($field);
|
||||
|
Loading…
Reference in New Issue
Block a user