# 05dec23 7fach GmbH (must "Beleg" Data) (load "messe/inst/pr/lib.l") (setq "*Fmt" (350 80 80) "*Cur" (or (: cur key) (firm 'cur 'key)) ) (de genBel () (co 'genBel (setq *Angb (isa '+Angb This) *Sum1 NIL *Sum2 0) (when (: kopf 0) (when *Angb (ps (if (: ansp anr) (hi> @ (: ansp nm)) ,"Dear Sir or Madam," ) ) (ps) ) (for S (: kopf 0) (apply ps (mupText S T) NIL) (ps) ) ) (unless *Angb (font 9 (bold (table "*Fmt" ,"Position" (ps T ,"Taxable") (ps T ,"Non taxable") ) ) ) (hline 6 510) (down 6) ) (setq *PrBelPos *Pos) (down 3) (for X (: pos 0) (yield T) (ifn X (down 9) (let (L (mupText (car X) T) D (- (apply height L) 10)) (table "*Fmt" (apply ps L NIL) (unless *Angb (let? S (when (; X 3 2) (out> This (cadr X))) (accu '*Sum1 (satz (firm (; X 3 2)) (or (cadddr X) (: snd pu d) (: dat)) ) S ) (down D) (ps T (money S "*Cur")) ) ) (let? S (when (or *Angb (not (; X 3 2))) (out> This (cadr X))) (inc '*Sum2 S) (down D) (ps T (money S "*Cur")) ) ) ) ) ) (let? Kap (unless *Angb (out> This (kap> This))) (down 9) (yield T) (table "*Fmt" (ps ,"3 % advanced payment charges") (when (: ukap 2) (accu '*Sum1 (satz (firm @) (or (: snd pu d) (: dat))) Kap ) (ps T (money Kap "*Cur")) ) (unless (: ukap 2) (inc '*Sum2 Kap) (ps T (money Kap "*Cur")) ) ) ) (unless *Angb (vline 350 *PrBelPos (+ 2 *Pos)) (vline 434 *PrBelPos (+ 2 *Pos)) ) (off *PrBelPos) (unless (: sv) (unless *Angb (hline 2 510 350) (down 8) (yield T) (setq *Sum1 (sort *Sum1)) (table "*Fmt" (down 9) (ps T (money (sum cdr *Sum1) "*Cur")) (ps T (money *Sum2 "*Cur")) ) (down 9) (yield T) (table "*Fmt" NIL (ps ,"Net.") (ps T (money (+ (sum cdr *Sum1) *Sum2) "*Cur")) ) ) (for S *Sum1 (yield T) (table "*Fmt" NIL (ps (format (/ (car S) 10) 1 ",") ,"% Vat") (let N (*/ (cdr S) (car S) 100.00) (inc '*Sum2 N) (ps T (money N "*Cur")) ) ) ) (hline 2 510 350) (down 2) (yield T) (table "*Fmt" NIL (ps ,"Total") (ps T (money (+ (sum cdr *Sum1) *Sum2) "*Cur")) ) ) (for S (: fuss 0) (down 12) (let L (mupText S T) (yield (+ 80 (apply height L))) (apply ps L NIL) ) ) (cond ((and *Angb (= *Name "deA")) (down 9) (for L (wrap 113 ,"Our quotation is based on the ADSp 2016 as our terms of business, the currently applicable tariffs and exchange rates, the information made available to us, as well as the assumption of an orderly transport process and is subject to change until confirmation of order. The deadlines and shipping instructions of the BTG guidelines for exhibition transactions apply.") (yield T) (ps (pack L)) ) (down 9) (for L (wrap 113 ,"We hope that our quotation meets with your approval and would be pleased to carry out the complete logistics process for you.") (yield T) (ps (pack L)) ) (down 9) (for L (wrap 113 ,"Should you have any questions, our BTG Messe Team will be happy to advise you at any time. We are looking forward to a good cooperation.") (yield T) (ps (pack L)) ) (down 9) (for L (wrap 113 ,"With best regards") (yield T) (ps (pack L)) ) (down 9) (yield T) (bold (ps "BTG MESSE-SPEDITION GMBH")) (bold (ps "86316 DERCHING / FRIEDBERG")) (down 9) (yield T) (if2 (: ok) (= *Lang "de") (table (200 200) (ps (: ok sign) " " (: ok nam)) (ps (: usr sign) " " (: usr nam)) ) (table (200 200) (ps (: ok nam)) (ps (: usr nam)) ) (ps (: usr sign) " " (: usr nam)) (ps (: usr nam)) ) ) (T (let? Uid (: ansp adr uid) # | Kd-DE | Kd-EU | # +-------+-------+------ # Mes-DE | | Ja | # Mes-EU | | Ja | # | | etl | (and (: ansp adr lnd eu) # Kd-EU (<> "DE" (: ansp adr lnd ctry)) # Not Kd-DE (or (: snd mes core ort lnd eu) # Mes-DE or Mes-EU (: etl) ) (bold (ps Uid ": " ,"As service recipient you carry the tax liability") ) ) ) (and (: snd) (exp> @) (not (: nat)) (= *Name "deA") (pre? "DE" (: ansp adr uid)) (not (: snd mes core ort lnd eu)) (bold (ps ,"tax free according to §4 UStG")) ) ) ) NIL ) ) (let (Name (next) Ttl (next) Svg (next)) (svgPages *A4-DX *A4-DY (tmp Name) (font (10 . "Arial")) (width "0.5") (english (: en) (while (page (in Svg (echo)) (window 34 56 0 0 (font 18 (ps Ttl)) ) (unless (gt0 (: nr)) (draft.svg) ) (cond ((=1 *Page) (window 280 60 0 0 (font 8 (for This (: prv) (unless (isa '+Angb This) (ps (text ,"for Receipt Number @1 dated @2" (: nr) (datStr (: dat)))) ) ) ) ) (window 40 90 250 90 (hline -3 180) (bold (ps (: ansp adr nm)) (and (: ansp adr nm2) (ps @)) (when (: pa) (ps NIL (: ansp anr nm) " " (: ansp nm2) " " (: ansp nm)) ) (with (: ansp adr) (ps (: str)) (and (: str2) (ps @)) (and (: str3) (ps @)) (ps (: plz) " " (: ort)) (and (lnd> This) (ps @)) ) ) (down 9) (down 9) (let Fmt (90 150) (when (: ansp adr uid) (table Fmt (ps ,"VAT-ID" ":") (ps (: ansp adr uid)) ) ) (when (: cref) (table Fmt (ps ,"Client Ref." ":") (ps @) ) ) (table Fmt (ps ,"Customer Code" ":") (ps (: ansp adr nr))) (when (and (: snd) (not (: se))) (down 9) (bold (for L (wrap 50 (: snd mes core nm)) (ps (pack L)) ) (ps (datStr (: snd mes core von)) " - " (datStr (: snd mes core bis)) ) (ps (: snd mes core ort nm) ", " (get (: snd mes core ort lnd) (lndKey)) ) ) ) ) ) (window 340 90 250 90 (hline -3 208) (let Fmt (100 150) (table Fmt (ps ,"Contact" ":") (ps (: usr nam))) (table Fmt (ps ,"E-Mail" ":") (ps (: usr em))) (table Fmt "Tel:" (ps (firm 'bas) (: usr dw))) (down 9) (bold (font 9 (ps ,"Please quote" ":")) (table Fmt (ps ,"Receipt Number" ":") (ps (: nr))) (table Fmt (ps ,"Date" ":") (ps (datStr (: dat)))) (and (: snd) (table Fmt (ps "Ref.:") (ps (: snd pos)))) ) (when (: snd) (down 9) (table Fmt (ps ,"Place of Collection" ":") (ps (: snd abh))) (table Fmt (ps ,"Pickup Date" ":") (ps (datStr (: snd pu d)))) (table Fmt (ps ,"Destination" ":") (ps (: snd dst))) (table Fmt ,"Merchandise Value" (and (: snd val) (ps (money @ (: snd cur key)))) ) ) ) ) (down 230) (indent 40 (when (: snd) (if (: sp) (ps (text ,"Shipment: @1 packages exhibition goods @2 kg / @3 cbm – Value: € @4" (sum cadr (: snd pak)) (round3 (sum get (: snd pak) 5)) (fmt3 (sum get (: snd pak) 9)) (money (: snd val)) ) ) (prPak> @ T) ) (down 12) ) ) ) (T (indent 40 (down 90) (when *Angb (bold (ps (: ansp adr nm)) (and (: ansp adr nm2) (ps @)) (when (: pa) (ps NIL (: ansp anr nm) " " (: ansp nm2) " " (: ansp nm)) ) (when (and (: snd) (not (: se))) (down 6) (for L (wrap 100 (: snd mes core nm)) (ps (pack L)) ) (ps (datStr (: snd mes core von)) " - " (datStr (: snd mes core bis)) ", " (: snd mes core ort nm) ) ) (window 260 90 250 90 (ps T (text ,"Page @1" *Page)) ) ) ) (when *PrBelPos (unless (: sv) (table "*Fmt" (ps T ,"Carryover") (unless *Angb (ps T (money (sum cdr *Sum1) "*Cur"))) (ps T (money *Sum2 "*Cur")) ) (hline 4 510) ) (setq *PrBelPos (+ 4 *Pos)) ) (down 12) ) ) ) (indent 40 (loop (NIL (genBel)) (T (or (=0 @) (>= *Pos (- *DY (or (num? @) 120))) ) (when *PrBelPos (unless *Angb (vline 350 *PrBelPos (+ 2 *Pos)) (vline 434 *PrBelPos (+ 2 *Pos)) ) (unless (: sv) (hline 2 510) (down 3) (table "*Fmt" (ps T ,"Carryover") (unless *Angb (ps T (money (sum cdr *Sum1) "*Cur"))) (ps T (money *Sum2 "*Cur")) ) ) ) T ) ) ) ) ) ) ) )