mirror of
https://github.com/OpenXE-org/OpenXE.git
synced 2024-11-14 20:17:14 +01:00
lieferantengutschrift drucken
This commit is contained in:
parent
00da78e863
commit
04de0df0b6
@ -75,7 +75,9 @@
|
||||
[MANUELLFREIGABEEINKAUF]
|
||||
[MANUELLFREIGABEBUCHHALTUNG]
|
||||
[ALSBEZAHLTMARKIEREN]
|
||||
<option value="drucken">{|drucken|}</option>
|
||||
</select>
|
||||
{|Drucker|}: <select name="seldrucker">[SELDRUCKER]</select>
|
||||
<button name="submit" value="ausfuehren" class="ui-button-icon">{|Ausführen|}</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
@ -514,6 +514,31 @@ class lieferantengutschrift {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'drucken':
|
||||
$drucker = $this->app->Secure->GetPOST('seldrucker');
|
||||
foreach ($selectedIds as $id) {
|
||||
$file_attachments = $this->app->erp->GetDateiSubjektObjekt('%','lieferantengutschrift',$id);
|
||||
if (!empty($file_attachments)) {
|
||||
foreach ($file_attachments as $file_attachment) {
|
||||
if ($this->app->erp->GetDateiEndung($file_attachment) == 'pdf') {
|
||||
$file_contents = $this->app->erp->GetDatei($file_attachment);
|
||||
$lieferantengutschrift = $this->app->DB->SelectRow("SELECT DATE_FORMAT(rechnungsdatum, '%Y%m%d') rechnungsdatum, belegnr FROM lieferantengutschrift WHERE id = ".$id." LIMIT 1");
|
||||
$file_name = $lieferantengutschrift['rechnungsdatum']."_LG".$lieferantengutschrift['belegnr'].".pdf";
|
||||
$file_path = rtrim($this->app->erp->GetTMP(),'/')."/".$file_name;
|
||||
$handle = fopen ($file_path, "wb");
|
||||
if ($handle)
|
||||
{
|
||||
fwrite($handle, $file_contents);
|
||||
fclose($handle);
|
||||
$this->app->printer->Drucken($drucker,$file_path);
|
||||
} else {
|
||||
$this->app->YUI->Message('error',"Drucken fehlgeschlagen!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -542,6 +567,8 @@ class lieferantengutschrift {
|
||||
$this->app->User->SetParameter('table_lieferantengutschrift_list_zahlbarbis', '');
|
||||
$this->app->User->SetParameter('table_lieferantengutschrift_list_skontobis', '');
|
||||
|
||||
$this->app->Tpl->Set('SELDRUCKER', $this->app->erp->GetSelectDrucker());
|
||||
|
||||
$this->app->Tpl->Parse('PAGE', "lieferantengutschrift_list.tpl");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user