{{vtScript}} ## Rechnung in easybill erstellen, falls noch nicht geschehen {{vtIf: {abgeschlossen} .eq. 1 .and. {Rechnungsbetrag} .gt. 0 .and. {vtGlobal:pxtcEasybillApiKey} .neq. }} {{vtIf: {easybill_id} .eq. .or. {vtGetValue:force} .eq. 1}} {{vtDo: -act="update", -obj="{vtID}", easybill_id="-1" }} {{vtIf: {vtGet:ID_Bilder} .eq.}} {{vtInclude: includes/initialize.html}} {{vtEndIf}} {{vtIf: {vtConfig:pxtcUseEasybillSoapApi} .eq. 1 }} {{vtLoad: templates/pixtacy/resources/easybill.class.php}} {{vtElse}} {{vtLoad: templates/pixtacy/resources/easybill-rest.class.php}} {{vtEndIf}} {{vtSet: Easybill_Kd_Id="0"}} {{vtSet: Easybill_Kd_Nr="0"}} {{vtIf: {UserID} .gt. 0 }} {{vtUse: {UserID} }} {{vtIf: {Easybill_Kd_Id} .gt. 0 .and. {AccountType} .neq. 2 }} {{vtSet: Easybill_Kd_Id="{Easybill_Kd_Id}" }} {{vtEndIf}} {{vtIf: {Easybill_Kd_Nr} .gt. 0 .and. {AccountType} .neq. 2 }} {{vtSet: Easybill_Kd_Nr="{Easybill_Kd_Nr}" }} {{vtEndIf}} {{vtEndUse}} {{vtEndIf}} {{vtIf: {Language} .neq. .and. {Language} .neq. {vtGet:Language} }} {{vtInclude: languages/{Language}.txt }} {{vtInclude: /config/languages/{Language}.txt }} {{vtEndIf}} {{vtCalc: createEasybillInvoice( '{vtGet:Easybill_Kd_Id}', '{vtGet:Easybill_Kd_Nr}' ) }} {{vtSet: Ergebnis}} {{vtIf: {Language} .neq. .and. {Language} .neq. {vtGet:Language} }} {{vtInclude: languages/{vtGet:Language}.txt }} {{vtInclude: /config/languages/{vtGet:Language}.txt }} {{vtEndIf}} {{vtIf: {vtGet:Ergebnis[document_id]} .gt. 1 }} {{vtDo: -act="update", -obj="{vtID}", easybill_id="{vtGet:Ergebnis[document_id]}", easybill_number="{vtGet:Ergebnis[document_number]}", easybill_ts="{vtDate|d.m.Y H:i}", easybill_error=""}} {{vtElse}} {{vtDo: -act="update", -obj="{vtID}", easybill_id="", easybill_ts="{vtDate|d.m.Y H:i}", easybill_error="{vtGet:Ergebnis[error]}"}} {{vtEndIf}} {{vtIf: {UserID} .gt. 0 .and. {vtGet:Ergebnis[customer_id]} .gt. 0 }} {{vtUse: {UserID} }} {{vtIf: {vtPageType} .eq. vtuser .and. {AccountType} .neq. 2 }} {{vtDo: -act="update", -obj="{vtID}", Easybill_Kd_Id="{vtGet:Ergebnis[customer_id]}", Easybill_Kd_Nr="{vtGet:Ergebnis[customer_number]}"}} {{vtEndIf}} {{vtEndUse}} {{vtEndIf}} {{vtEndIf}} {{vtEndIf}} {{vtIf: {vtGetValue:-met} .eq. easybill }} {{vtRedirect}} {{vtEndIf}} {{vtEndScript}}