app = $app; $this->parsetarget = $parsetarget; parent::__construct($app,$parsetarget); $this->ExtendsForm(); } function Edit() { $id = (int)$this->app->Secure->GetGET('id'); if($this->app->Secure->GetPOST('submit')) { $this->app->erp->ObjektProtokoll('verkaufspreise', $id, 'verkaufspreise_edit', 'Verkaufspreis editiert'); } parent::Edit(); } function ExtendsForm() { $action = $this->app->Secure->GetGET("action"); $this->app->YUI->AutoComplete("adresse","kunde"); //$this->app->YUI->AutoComplete("vpe","vpeartikel"); $this->app->YUI->AutoComplete("projekt","projektname",1); $this->app->YUI->DatePicker("gueltig_bis"); $this->app->YUI->DatePicker("gueltig_ab"); $this->app->YUI->AutoComplete("gruppe","gruppe"); $this->form->ReplaceFunction("gruppe",$this,"ReplaceGruppe"); $this->form->ReplaceFunction("projekt",$this,"ReplaceProjekt"); $this->form->ReplaceFunction("adresse",$this,"ReplaceKunde"); $this->form->ReplaceFunction("gueltig_bis",$this,"ReplaceDatum"); $this->form->ReplaceFunction("gueltig_ab",$this,"ReplaceDatum"); $this->form->ReplaceFunction("preis",$this,"ReplaceBetrag"); $this->form->ReplaceFunction("ab_menge",$this,"ReplaceAb_menge"); if($action=="verkauf") { // liste zuweisen $pid = $this->app->Secure->GetGET("id"); $this->app->Secure->POST["artikel"]=$pid; $field = new HTMLInput("artikel","hidden",$pid); $this->form->NewField($field); } $this->app->Secure->POST["firma"]=$this->app->User->GetFirma(); $field = new HTMLInput("firma","hidden",$this->app->User->GetFirma()); $this->form->NewField($field); $this->app->Tpl->Set('PREISTABELLE',''); $_waehrungen = $this->app->erp->GetWaehrungUmrechnungskurseTabelle('EUR'); $waehrungen['EUR'] = 1; foreach($_waehrungen as $waehrung => $kurs)$waehrungen[$waehrung] = $kurs; if($_waehrungen) { foreach($waehrungen as $k => $v)$waehrung_felder[$k] = $k; $field = new HTMLSelect("waehrung",1,"waehrung"); $field->AddOptionsAsocSimpleArray($waehrung_felder); $this->form->NewField($field); } $htmltabelle = "
"; $this->app->Tpl->Set('PREISTABELLEPOPUP', $htmltabelle); } function ReplaceGruppe($db,$value,$fromform) { return $this->app->erp->ReplaceGruppe($db,$value,$fromform); } function ReplaceProjekt($db,$value,$fromform) { return $this->app->erp->ReplaceProjekt($db,$value,$fromform); } function ReplaceKunde($db,$value,$fromform) { return $this->app->erp->ReplaceKunde($db,$value,$fromform); } function ReplaceDatum($db,$value,$fromform) { return $this->app->erp->ReplaceDatum($db,$value,$fromform); } function ReplaceBetrag($db,$value,$fromform) { return $this->app->erp->ReplaceBetrag($db,$value,$fromform); } public function Table() { $table = new EasyTable($this->app); $table->Query("SELECT nummer, name_de as name,barcode, id FROM verkaufspreise order by nummer"); $table->Display($this->parsetarget); } public function Search() { $this->app->Tpl->Set($this->parsetarget,"suchmaske"); //$this->app->Table( //$table = new OrderTable("veranstalter"); //$table->Heading(array('Name','Homepage','Telefon')); } function ReplaceAb_menge($db,$value,$fromform) { return str_replace(',','.', $value); } } ?>