From c686b68d6da254a16d4a103f431b3f015ce3c72d Mon Sep 17 00:00:00 2001 From: niepra01 <rolf.niepraschk@ptb.de> Date: Fri, 24 Apr 2015 12:11:31 +0200 Subject: [PATCH] setcommand --- versandauftrag/test-versandauftrag.pdf | Bin 70313 -> 70313 bytes versandauftrag/vl-versandauftrag.cls | 64 ++++++++++++++----------- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/versandauftrag/test-versandauftrag.pdf b/versandauftrag/test-versandauftrag.pdf index 7aaeb1d86596e1163831b220b3403b3a50408940..eae7bee4a3bcc1941e3845493eeb4783eefa3fef 100644 GIT binary patch delta 133 zcmZ3vlx5{omWC~ivpKa)42=v84UDu6jMNPb)HS*Eee+XX5=&AQG+eBV3=B;TOpKsP zwjbqWyvy!vZ02a{=xSkMU}kLS=xX9@Y3k}`VdU&&1|*G*jLq#7YzQft{#20h2ml5x BA;<s# delta 133 zcmZ3vlx5{omWC~ivpKbl4NXlAjSaL7jMNPb)HS*Eee+XX5=&AQG+eBV3=B;TOpKsP zwjbqWyvy!v?(FPr>T2#}>f&taWMJ%OWNu{O<m6^yX6oYVW@2Vwr(i=!$@Hg!j7I<; Ct0GJQ diff --git a/versandauftrag/vl-versandauftrag.cls b/versandauftrag/vl-versandauftrag.cls index b90110c..bb63f62 100644 --- a/versandauftrag/vl-versandauftrag.cls +++ b/versandauftrag/vl-versandauftrag.cls @@ -2,7 +2,7 @@ \listfiles \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{vl-versandauftrag} - [2015/04/23 v0.1f Dokumentenklasse (RN/PTB)] + [2015/04/24 v0.1g Dokumentenklasse (RN/PTB)] \DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}} \ProcessOptions\relax \PassOptionsToPackage{paper=a4,pagesize}{typearea} @@ -38,7 +38,7 @@ \let\vl@tempdimc=\@ovdx \newcommand\vl@tempa{} -\newcommand*\vl@setboolean[3][false]{% #1=default (opt.), #2=ifXXX, #3=value +\newcommand*\vl@setboolean[3][false]{% #1=default (opt.), #2=if, #3=value \edef\vl@tempa{\trim@spaces{#3}}% \expandafter\csname #2\ifx\@empty\vl@tempa #1\else\vl@tempa\fi\endcsname } @@ -48,48 +48,54 @@ \setcounter{#2}{\ifx\@empty\vl@tempa #1\else\vl@tempa\fi}% } +\newcommand*\vl@setcommand[3][]{% #1=default (opt.), #2=macro, #3=value + \edef\vl@tempa{\trim@spaces@noexp{#3}}% + \expandafter\protected@xdef\csname #2\endcsname{% + \ifx\@empty\vl@tempa #1\else\vl@tempa\fi}% +} + \newif\ifInland \Inlandtrue \newcommand*\Inland[1]{\vl@setboolean{Inland}{#1}} \newif\ifEU \EUtrue \newcommand*\EU[1]{\vl@setboolean{EU}{#1}} \newcommand*\vl@ShippingNo{} -\newcommand*\ShippingNo[1]{\xdef\vl@ShippingNo{\trim@spaces@noexp{#1}}} +\newcommand*\ShippingNo[1]{\vl@setcommand{vl@ShippingNo}{#1}} \newcommand*\vl@ShippingName{} -\newcommand*\ShippingName[1]{\xdef\vl@ShippingName{\trim@spaces@noexp{#1}}} +\newcommand*\ShippingName[1]{\vl@setcommand{vl@ShippingName}{#1}} \newcommand*\vl@ShippingContact{} -\newcommand*\ShippingContact[1]{\xdef\vl@ShippingContact{\trim@spaces@noexp{#1}}} +\newcommand*\ShippingContact[1]{\vl@setcommand{vl@ShippingContact}{#1}} \newcommand*\vl@ShippingStreet{} -\newcommand*\ShippingStreet[1]{\xdef\vl@ShippingStreet{\trim@spaces@noexp{#1}}} +\newcommand*\ShippingStreet[1]{\vl@setcommand{vl@ShippingStreet}{#1}} \newcommand*\vl@ShippingTown{} -\newcommand*\ShippingTown[1]{\xdef\vl@ShippingTown{\trim@spaces@noexp{#1}}} +\newcommand*\ShippingTown[1]{\vl@setcommand{vl@ShippingTown}{#1}} \newcommand*\vl@ShippingZipcode{} -\newcommand*\ShippingZipcode[1]{\xdef\vl@ShippingZipcode{\trim@spaces@noexp{#1}}} +\newcommand*\ShippingZipcode[1]{\vl@setcommand{vl@ShippingZipcode}{#1}} \newcommand*\vl@ShippingLand{} -\newcommand*\ShippingLand[1]{\xdef\vl@ShippingLand{\trim@spaces@noexp{#1}}} -\newcommand*\vl@costUnit{} -\newcommand*\CostUnit[1]{\xdef\vl@costUnit{\trim@spaces@noexp{#1}}} -\newcommand*\vl@financeUnit{} -\newcommand*\FinanceUnit[1]{\xdef\vl@financeUnit{\trim@spaces@noexp{#1}}} -\newcommand*\vl@account{} -\newcommand*\Account[1]{\xdef\vl@account{\trim@spaces@noexp{#1}}} +\newcommand*\ShippingLand[1]{\vl@setcommand{vl@ShippingLand}{#1}} +\newcommand*\vl@CostUnit{} +\newcommand*\CostUnit[1]{\vl@setcommand{vl@CostUnit}{#1}} +\newcommand*\vl@FinanceUnit{} +\newcommand*\FinanceUnit[1]{\vl@setcommand{vl@FinanceUnit}{#1}} +\newcommand*\vl@Account{} +\newcommand*\Account[1]{\vl@setcommand{vl@Account}{#1}} \newcommand*\vl@SAPNo{} -\newcommand*\SAPNo[1]{\xdef\vl@SAPNo{\trim@spaces@noexp{#1}}} -\newcommand*\vl@value{} -\newcommand*\Value[1]{\xdef\vl@value{\trim@spaces@noexp{#1}}} +\newcommand*\SAPNo[1]{\vl@setcommand{vl@SAPNo}{#1}} +\newcommand*\vl@Value{} +\newcommand*\Value[1]{\vl@setcommand{vl@Value}{#1}} \newcommand*\vl@DateOfArrival{} -\newcommand*\DateOfArrival[1]{\xdef\vl@DateOfArrival{\trim@spaces@noexp{#1}}} +\newcommand*\DateOfArrival[1]{\vl@setcommand{vl@DateOfArrival}{#1}} \newcommand*\vl@WorkingGroup{} -\newcommand*\WorkingGroup[1]{\xdef\vl@WorkingGroup{\trim@spaces@noexp{#1}}} +\newcommand*\WorkingGroup[1]{\vl@setcommand{vl@WorkingGroup}{#1}} \newcommand*\vl@TelefonExtension{} -\newcommand*\TelefonExtension[1]{\xdef\vl@TelefonExtension{\trim@spaces@noexp{#1}}} +\newcommand*\TelefonExtension[1]{\vl@setcommand{vl@TelefonExtension}{#1}} \newcommand*\vl@Date{} -\newcommand*\Date[1]{\xdef\vl@Date{\trim@spaces@noexp{#1}}} +\newcommand*\Date[1]{\vl@setcommand{vl@Date}{#1}} \newcommand*\vl@Content{} -\newcommand*\Content[1]{\xdef\vl@Content{#1}} +\newcommand*\Content[1]{\vl@setcommand{vl@Content}{#1}} \newcommand*\vl@Purchaser{} -\newcommand*\Purchaser[1]{\xdef\vl@Purchaser{#1}} +\newcommand*\Purchaser[1]{\vl@setcommand{vl@Purchaser}{#1}} \newcommand*\vl@Referee{} -\newcommand*\Referee[1]{\xdef\vl@Referee{#1}} +\newcommand*\Referee[1]{\vl@setcommand{vl@Referee}{#1}} \newcounter{vl@TransportType} \setcounter{vl@TransportType}{0} \newcommand*\TransportType[1]{\vl@setcounter{vl@TransportType}{#1}} @@ -300,12 +306,12 @@ \put(232bp,\vl@tempdimc){\vl@TelefonExtension}% \put(310bp,\vl@tempdimc){\vl@Date}% \vl@tempdimc=394bp % -14bp - \put(\vl@tempdima,\vl@tempdimc){\vl@costUnit}% - \put(218bp,\vl@tempdimc){\vl@financeUnit}% - \put(401bp,\vl@tempdimc){\vl@account}% + \put(\vl@tempdima,\vl@tempdimc){\vl@CostUnit}% + \put(218bp,\vl@tempdimc){\vl@FinanceUnit}% + \put(401bp,\vl@tempdimc){\vl@Account}% \vl@tempdimc=366bp % \put(\vl@tempdima,\vl@tempdimc){\vl@SAPNo}% - \put(218bp,\vl@tempdimc){\vl@value}% + \put(218bp,\vl@tempdimc){\vl@Value}% \put(401bp,\vl@tempdimc){\vl@DateOfArrival}% % TODO: mehrzeilige Ausgabe vorsehen? \put(\vl@tempdima,320bp){\vl@ShippingName}% -- GitLab