001/*
002 * Copyright (C) 2014 konik.io
003 *
004 * This file is part of Konik library.
005 *
006 * Konik library is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU Affero General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * Konik library is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU Affero General Public License for more details.
015 *
016 * You should have received a copy of the GNU Affero General Public License
017 * along with Konik library.  If not, see <http://www.gnu.org/licenses/>.
018 */
019package io.konik.zugferd.unece.codes;
020
021import javax.xml.bind.annotation.XmlEnum;
022import javax.xml.bind.annotation.XmlEnumValue;
023import javax.xml.bind.annotation.XmlType;
024
025import io.konik.util.KonikEnum;
026
027/**
028 * = The Payment Means Code
029 * 
030 * Represents payment code according to +UNCL 4461+.
031 * 
032 * @see http://www.unece.org/trade/untdid/d13b/tred/tred4461.htm[UN/EDIFACT 4461 Payment means code^]
033 */
034@XmlEnum
035@XmlType(name = "PaymentMeansCodeType")
036public enum PaymentMeansCode {
037   /**
038    * Instrument not defined
039    * 
040    * Not defined legally enforceable agreement between two or
041    * more parties (expressing a contractual right or a right
042    * to the payment of money).
043    **/
044   @XmlEnumValue("1")
045   _1("Instrument not defined"),
046
047   /**
048    * Automated clearing house credit
049    * 
050    * A credit transaction made through the automated clearing
051    * house system.
052    **/
053   @XmlEnumValue("2")
054   _2("Automated clearing house credit"),
055
056   /**
057    * Automated clearing house debit
058    * 
059    * A debit transaction made through the automated clearing
060    * house system.
061    **/
062   @XmlEnumValue("3")
063   _3("Automated clearing house debit"),
064
065   /**
066    * ACH demand debit reversal
067    * 
068    * A request to reverse an ACH debit transaction to a
069    * demand deposit account.
070    **/
071   @XmlEnumValue("4")
072   _4("ACH demand debit reversal"),
073
074   /**
075    * ACH demand credit reversal
076    * 
077    * A request to reverse a credit transaction to a demand
078    * deposit account.
079    **/
080   @XmlEnumValue("5")
081   _5("ACH demand credit reversal"),
082
083   /**
084    * ACH demand credit
085    * 
086    * A credit transaction made through the ACH system to a
087    * demand deposit account.
088    **/
089   @XmlEnumValue("6")
090   _6("ACH demand credit"),
091
092   /**
093    * ACH demand debit
094    * 
095    * A debit transaction made through the ACH system to a
096    * demand deposit account.
097    **/
098   @XmlEnumValue("7")
099   _7("ACH demand debit"),
100
101   /**
102    * Hold
103    * 
104    * Indicates that the bank should hold the payment for
105    * collection by the beneficiary or other instructions.
106    **/
107   @XmlEnumValue("8")
108   _8("Hold"),
109
110   /**
111    * National or regional clearing
112    * 
113    * Indicates that the payment should be made using the
114    * national or regional clearing.
115    **/
116   @XmlEnumValue("9")
117   _9("National or regional clearing"),
118
119   /**
120    * In cash
121    * 
122    * Payment by currency (including bills and coins) in
123    * circulation, including checking account deposits.
124    **/
125   @XmlEnumValue("10")
126   _10("In cash"),
127
128   /**
129    * ACH savings credit reversal
130    * 
131    * A request to reverse an ACH credit transaction to a
132    * savings account.
133    **/
134   @XmlEnumValue("11")
135   _11("ACH savings credit reversal"),
136
137   /**
138    * ACH savings debit reversal
139    * 
140    * A request to reverse an ACH debit transaction to a
141    * savings account.
142    **/
143   @XmlEnumValue("12")
144   _12("ACH savings debit reversal"),
145
146   /**
147    * ACH savings credit
148    * 
149    * A credit transaction made through the ACH system to a
150    * savings account.
151    **/
152   @XmlEnumValue("13")
153   _13("ACH savings credit"),
154
155   /**
156    * ACH savings debit
157    * 
158    * A debit transaction made through the ACH system to a
159    * savings account.
160    **/
161   @XmlEnumValue("14")
162   _14("ACH savings debit"),
163
164   /**
165    * Bookentry credit
166    * 
167    * A credit entry between two accounts at the same bank
168    * branch. Synonym: house credit.
169    **/
170   @XmlEnumValue("15")
171   _15("Bookentry credit"),
172
173   /**
174    * Bookentry debit
175    * 
176    * A debit entry between two accounts at the same bank
177    * branch. Synonym: house debit.
178    **/
179   @XmlEnumValue("16")
180   _16("Bookentry debit"),
181
182   /**
183    * ACH demand cash concentration/disbursement (CCD) credit
184    * 
185    * A credit transaction made through the ACH system to a
186    * demand deposit account using the CCD payment format.
187    **/
188   @XmlEnumValue("17")
189   _17("ACH demand cash concentration/disbursement (CCD) credit"),
190
191   /**
192    * ACH demand cash concentration/disbursement (CCD) debit
193    * 
194    * A debit transaction made through the ACH system to a
195    * demand deposit account using the CCD payment format.
196    **/
197   @XmlEnumValue("18")
198   _18("ACH demand cash concentration/disbursement (CCD) debit"),
199
200   /**
201    * ACH demand corporate trade payment (CTP) credit
202    * 
203    * A credit transaction made through the ACH system to a
204    * demand deposit account using the CTP payment format.
205    **/
206   @XmlEnumValue("19")
207   _19("ACH demand corporate trade payment (CTP) credit"),
208
209   /**
210    * Cheque
211    * 
212    * Payment by a pre-printed form on which instructions are
213    * given to an account holder (a bank or building society)
214    * to pay a stated sum to a named recipient.
215    **/
216   @XmlEnumValue("20")
217   _20("Cheque"),
218
219   /**
220    * Banker's draft
221    * 
222    * Issue of a banker's draft in payment of the funds.
223    **/
224   @XmlEnumValue("21")
225   _21("Banker's draft"),
226
227   /**
228    * Certified banker's draft
229    * 
230    * Cheque drawn by a bank on itself or its agent. A person
231    * who owes money to another buys the draft from a bank for
232    * cash and hands it to the creditor who need have no fear
233    * that it might be dishonoured.
234    **/
235   @XmlEnumValue("22")
236   _22("Certified banker's draft"),
237
238   /**
239    * Bank cheque (issued by a banking or similar establishment)
240    * 
241    * Payment by a pre-printed form, which has been completed
242    * by a financial institution, on which instructions are
243    * given to an account holder (a bank or building society)
244    * to pay a stated sum to a named recipient.
245    **/
246   @XmlEnumValue("23")
247   _23("Bank cheque (issued by a banking or similar establishment)"),
248
249   /**
250    * Bill of exchange awaiting acceptance
251    * 
252    * Bill drawn by the creditor on the debtor but not yet
253    * accepted by the debtor.
254    **/
255   @XmlEnumValue("24")
256   _24("Bill of exchange awaiting acceptance"),
257
258   /**
259    * Certified cheque
260    * 
261    * Payment by a pre-printed form stamped with the paying
262    * bank's certification on which instructions are given to
263    * an account holder (a bank or building society) to pay a
264    * stated sum to a named recipient .
265    **/
266   @XmlEnumValue("25")
267   _25("Certified cheque"),
268
269   /**
270    * Local cheque
271    * 
272    * Indicates that the cheque is given local to the
273    * recipient.
274    **/
275   @XmlEnumValue("26")
276   _26("Local cheque"),
277
278   /**
279    * ACH demand corporate trade payment (CTP) debit
280    * 
281    * A debit transaction made through the ACH system to a
282    * demand deposit account using the CTP payment format.
283    **/
284   @XmlEnumValue("27")
285   _27("ACH demand corporate trade payment (CTP) debit"),
286
287   /**
288    * ACH demand corporate trade exchange (CTX) credit
289    * 
290    * A credit transaction made through the ACH system to a
291    * demand deposit account using the CTX payment format.
292    **/
293   @XmlEnumValue("28")
294   _28("ACH demand corporate trade exchange (CTX) credit"),
295
296   /**
297    * ACH demand corporate trade exchange (CTX) debit
298    * 
299    * A debit transaction made through the ACH system to a
300    * demand account using the CTX payment format.
301    **/
302   @XmlEnumValue("29")
303   _29("ACH demand corporate trade exchange (CTX) debit"),
304
305   /**
306    * Credit transfer
307    * 
308    * Payment by credit movement of funds from one account to
309    * another.
310    **/
311   @XmlEnumValue("30")
312   _30("Credit transfer"),
313
314   /**
315    * Debit transfer
316    * 
317    * Payment by debit movement of funds from one account to
318    * another.
319    **/
320   @XmlEnumValue("31")
321   _31("Debit transfer"),
322
323   /**
324    * ACH demand cash concentration/disbursement plus (CCD+)
325    * 
326    * credit
327    * A credit transaction made through the ACH system to a
328    * demand deposit account using the CCD+ payment format.
329    **/
330   @XmlEnumValue("32")
331   _32("ACH demand cash concentration/disbursement plus (CCD+)"),
332
333   /**
334    * ACH demand cash concentration/disbursement plus (CCD+)
335    * 
336    * debit
337    * A debit transaction made through the ACH system to a
338    * demand deposit account using the CCD+ payment format.
339    **/
340   @XmlEnumValue("33")
341   _33("ACH demand cash concentration/disbursement plus (CCD+)"),
342
343   /**
344    * ACH prearranged payment and deposit (PPD)
345    * 
346    * A consumer credit transaction made through the ACH
347    * system to a demand deposit or savings account.
348    **/
349   @XmlEnumValue("34")
350   _34("ACH prearranged payment and deposit (PPD)"),
351
352   /**
353    * ACH savings cash concentration/disbursement (CCD) credit
354    * 
355    * A credit transaction made through the ACH system to a
356    * demand deposit or savings account.
357    **/
358   @XmlEnumValue("35")
359   _35("ACH savings cash concentration/disbursement (CCD) credit"),
360
361   /**
362    * ACH savings cash concentration/disbursement (CCD) debit
363    * 
364    * A debit transaction made through the ACH system to a
365    * savings account using the CCD payment format.
366    **/
367   @XmlEnumValue("36")
368   _36("ACH savings cash concentration/disbursement (CCD) debit"),
369
370   /**
371    * ACH savings corporate trade payment (CTP) credit
372    * 
373    * A credit transaction made through the ACH system to a
374    * savings account using the CTP payment format.
375    **/
376   @XmlEnumValue("37")
377   _37("ACH savings corporate trade payment (CTP) credit"),
378
379   /**
380    * ACH savings corporate trade payment (CTP) debit
381    * 
382    * A debit transaction made through the ACH system to a
383    * savings account using the CTP payment format.
384    **/
385   @XmlEnumValue("38")
386   _38("ACH savings corporate trade payment (CTP) debit"),
387
388   /**
389    * ACH savings corporate trade exchange (CTX) credit
390    * 
391    * A credit transaction made through the ACH system to a
392    * savings account using the CTX payment format.
393    **/
394   @XmlEnumValue("39")
395   _39("ACH savings corporate trade exchange (CTX) credit"),
396
397   /**
398    * ACH savings corporate trade exchange (CTX) debit
399    * 
400    * A debit transaction made through the ACH system to a
401    * savings account using the CTX payment format.
402    **/
403   @XmlEnumValue("40")
404   _40("ACH savings corporate trade exchange (CTX) debit"),
405
406   /**
407    * ACH savings cash concentration/disbursement plus (CCD+)
408    * 
409    * credit
410    * A credit transaction made through the ACH system to a
411    * savings account using the CCD+ payment format.
412    **/
413   @XmlEnumValue("41")
414   _41("ACH savings cash concentration/disbursement plus (CCD+)"),
415
416   /**
417    * Payment to bank account
418    * 
419    * Payment by an arrangement for settling debts that is
420    * operated by the Post Office.
421    **/
422   @XmlEnumValue("42")
423   _42("Payment to bank account"),
424
425   /**
426    * ACH savings cash concentration/disbursement plus (CCD+)
427    * 
428    * debit
429    * A debit transaction made through the ACH system to a
430    * savings account using the CCD+ payment format.
431    **/
432   @XmlEnumValue("43")
433   _43("ACH savings cash concentration/disbursement plus (CCD+)"),
434
435   /**
436    * Accepted bill of exchange
437    * 
438    * Bill drawn by the creditor on the debtor and accepted by
439    * the debtor.
440    **/
441   @XmlEnumValue("44")
442   _44("Accepted bill of exchange"),
443
444   /**
445    * Referenced home-banking credit transfer
446    * 
447    * A referenced credit transfer initiated through home-
448    * banking.
449    **/
450   @XmlEnumValue("45")
451   _45("Referenced home-banking credit transfer"),
452
453   /**
454    * Interbank debit transfer
455    * 
456    * A debit transfer via interbank means.
457    **/
458   @XmlEnumValue("46")
459   _46("Interbank debit transfer"),
460
461   /**
462    * Home-banking debit transfer
463    * 
464    * A debit transfer initiated through home-banking.
465    **/
466   @XmlEnumValue("47")
467   _47("Home-banking debit transfer"),
468
469   /**
470    * Bank card
471    * 
472    * Payment by means of a card issued by a bank or other
473    * financial institution.
474    **/
475   @XmlEnumValue("48")
476   _48("Bank card"),
477
478   /**
479    * Direct debit
480    * 
481    * The amount is to be, or has been, directly debited to
482    * the customer's bank account.
483    **/
484   @XmlEnumValue("49")
485   _49("Direct debit"),
486
487   /**
488    * Payment by postgiro
489    * 
490    * A method for the transmission of funds through the
491    * postal system rather than through the banking system.
492    **/
493   @XmlEnumValue("50")
494   _50("Payment by postgiro"),
495
496   /**
497    * FR, norme 6 97-Telereglement CFONB (French Organisation for
498    * 
499    * Banking Standards) - Option A
500    * A French standard procedure that allows a debtor to pay
501    * an amount due to a creditor. The creditor will forward
502    * it to its bank, which will collect the money on the bank
503    * account of the debtor.
504    **/
505   @XmlEnumValue("51")
506   _51("FR, norme 6 97-Telereglement CFONB (French Organisation for"),
507
508   /**
509    * Urgent commercial payment
510    * 
511    * Payment order which requires guaranteed processing by
512    * the most appropriate means to ensure it occurs on the
513    * requested execution date, provided that it is issued to
514    * the ordered bank before the agreed cut-off time.
515    **/
516   @XmlEnumValue("52")
517   _52("Urgent commercial payment"),
518
519   /**
520    * Urgent Treasury Payment
521    * 
522    * Payment order or transfer which must be executed, by the
523    * most appropriate means, as urgently as possible and
524    * before urgent commercial payments.
525    **/
526   @XmlEnumValue("53")
527   _53("Urgent Treasury Payment"),
528
529   /**
530    * Promissory note
531    * 
532    * Payment by an unconditional promise in writing made by
533    * one person to another, signed by the maker, engaging to
534    * pay on demand or at a fixed or determinable future time
535    * a sum certain in money, to order or to bearer.
536    **/
537   @XmlEnumValue("60")
538   _60("Promissory note"),
539
540   /**
541    * Promissory note signed by the debtor
542    * 
543    * Payment by an unconditional promise in writing made by
544    * the debtor to another person, signed by the debtor,
545    * engaging to pay on demand or at a fixed or determinable
546    * future time a sum certain in money, to order or to
547    * bearer.
548    **/
549   @XmlEnumValue("61")
550   _61("Promissory note signed by the debtor"),
551
552   /**
553    * Promissory note signed by the debtor and endorsed by a bank
554    * 
555    * Payment by an unconditional promise in writing made by
556    * the debtor to another person, signed by the debtor and
557    * endorsed by a bank, engaging to pay on demand or at a
558    * fixed or determinable future time a sum certain in
559    * money, to order or to bearer.
560    **/
561   @XmlEnumValue("62")
562   _62("Promissory note signed by the debtor and endorsed by a bank"),
563
564   /**
565    * Promissory note signed by the debtor and endorsed by a
566    * 
567    * third party
568    * Payment by an unconditional promise in writing made by
569    * the debtor to another person, signed by the debtor and
570    * endorsed by a third party, engaging to pay on demand or
571    * at a fixed or determinable future time a sum certain in
572    * money, to order or to bearer.
573    **/
574   @XmlEnumValue("63")
575   _63("Promissory note signed by the debtor and endorsed by a"),
576
577   /**
578    * Promissory note signed by a bank
579    * 
580    * Payment by an unconditional promise in writing made by
581    * the bank to another person, signed by the bank, engaging
582    * to pay on demand or at a fixed or determinable future
583    * time a sum certain in money, to order or to bearer.
584    **/
585   @XmlEnumValue("64")
586   _64("Promissory note signed by a bank"),
587
588   /**
589    * Promissory note signed by a bank and endorsed by another
590    * 
591    * bank
592    * Payment by an unconditional promise in writing made by
593    * the bank to another person, signed by the bank and
594    * endorsed by another bank, engaging to pay on demand or
595    * at a fixed or determinable future time a sum certain in
596    * money, to order or to bearer.
597    **/
598   @XmlEnumValue("65")
599   _65("Promissory note signed by a bank and endorsed by another"),
600
601   /**
602    * Promissory note signed by a third party
603    * 
604    * Payment by an unconditional promise in writing made by a
605    * third party to another person, signed by the third
606    * party, engaging to pay on demand or at a fixed or
607    * determinable future time a sum certain in money, to
608    * order or to bearer.
609    **/
610   @XmlEnumValue("66")
611   _66("Promissory note signed by a third party"),
612
613   /**
614    * Promissory note signed by a third party and endorsed by a
615    * 
616    * bank
617    * Payment by an unconditional promise in writing made by a
618    * third party to another person, signed by the third party
619    * and endorsed by a bank, engaging to pay on demand or at
620    * a fixed or determinable future time a sum certain in
621    * money, to order or to bearer.
622    **/
623   @XmlEnumValue("67")
624   _67("Promissory note signed by a third party and endorsed by a"),
625
626   /**
627    * Bill drawn by the creditor on the debtor
628    * 
629    * Bill drawn by the creditor on the debtor.
630    **/
631   @XmlEnumValue("70")
632   _70("Bill drawn by the creditor on the debtor"),
633
634   /**
635    * Bill drawn by the creditor on a bank
636    * 
637    * Bill drawn by the creditor on a bank.
638    **/
639   @XmlEnumValue("74")
640   _74("Bill drawn by the creditor on a bank"),
641
642   /**
643    * Bill drawn by the creditor, endorsed by another bank
644    * 
645    * Bill drawn by the creditor, endorsed by another bank.
646    **/
647   @XmlEnumValue("75")
648   _75("Bill drawn by the creditor, endorsed by another bank"),
649
650   /**
651    * Bill drawn by the creditor on a bank and endorsed by a
652    * 
653    * third party
654    * Bill drawn by the creditor on a bank and endorsed by a
655    * third party.
656    **/
657   @XmlEnumValue("76")
658   _76("Bill drawn by the creditor on a bank and endorsed by a"),
659
660   /**
661    * Bill drawn by the creditor on a third party
662    * 
663    * Bill drawn by the creditor on a third party.
664    **/
665   @XmlEnumValue("77")
666   _77("Bill drawn by the creditor on a third party"),
667
668   /**
669    * Bill drawn by creditor on third party, accepted and
670    * 
671    * endorsed by bank
672    * Bill drawn by creditor on third party, accepted and
673    * endorsed by bank.
674    **/
675   @XmlEnumValue("78")
676   _78("Bill drawn by creditor on third party, accepted and"),
677
678   /**
679    * Not transferable banker's draft
680    * 
681    * Issue a bankers draft not endorsable.
682    **/
683   @XmlEnumValue("91")
684   _91("Not transferable banker's draft"),
685
686   /**
687    * Not transferable local cheque
688    * 
689    * Issue a cheque not endorsable in payment of the funds.
690    **/
691   @XmlEnumValue("92")
692   _92("Not transferable local cheque"),
693
694   /**
695    * Reference giro
696    * 
697    * Ordering customer tells the bank to use the payment
698    * system 'Reference giro'. Used in the Finnish national
699    * banking system.
700    **/
701   @XmlEnumValue("93")
702   _93("Reference giro"),
703
704   /**
705    * Urgent giro
706    * 
707    * Ordering customer tells the bank to use the bank service
708    * 'Urgent Giro' when transferring the payment. Used in
709    * Finnish national banking system.
710    **/
711   @XmlEnumValue("94")
712   _94("Urgent giro"),
713
714   /**
715    * Free format giro
716    * 
717    * Ordering customer tells the ordering bank to use the
718    * bank service 'Free Format Giro' when transferring the
719    * payment. Used in Finnish national banking system.
720    **/
721   @XmlEnumValue("95")
722   _95("Free format giro"),
723
724   /**
725    * Requested method for payment was not used
726    * 
727    * If the requested method for payment was or could not be
728    * used, this code indicates that.
729    **/
730   @XmlEnumValue("96")
731   _96("Requested method for payment was not used"),
732
733   /**
734    * Clearing between partners
735    * 
736    * Amounts which two partners owe to each other to be
737    * compensated in order to avoid useless payments.
738    **/
739   @XmlEnumValue("97")
740   _97("Clearing between partners"),
741
742   /**
743    * Mutually defined
744    * 
745    * A code assigned within a code list to be used on an
746    * interim basis and as defined among trading partners
747    * until a precise code can be assigned to the code list.
748    **/
749   @XmlEnumValue("ZZZ")
750   _ZZZ("Mutually defined");
751
752   /** prefix before the code in this Enumeration. */
753   public static final String PREFIX = "_";
754
755   /** the description for the code. */
756   private final String description;
757
758   PaymentMeansCode(String descirption) {
759      this.description = descirption;
760   }
761
762   /**
763    * Gets the code.
764    *
765    * @return the code
766    */
767   public String getCode() {
768      return name().substring(1);
769   }
770
771   /**
772    * Gets the description.
773    *
774    * @return the description
775    */
776   public String getDescription() {
777      return description;
778   }
779
780   /**
781    * Gets the type by the provided code.
782    *
783    * @param code the code
784    * @return the type by code or throws a IllegalArgumentException if the type does not exist.
785    */
786   public static PaymentMeansCode getByCode(String code) {
787      return valueOf(PREFIX + code);
788   }
789
790   /**
791    * Checks if the given code is contained in the Enumeration.
792    *
793    * @param code the code
794    * @return true, if is known code
795    */
796   public static boolean isKnownCode(final String code) {
797      return KonikEnum.isKnownCode(PaymentMeansCode.class, code);
798   }
799
800   @Override
801   public String toString() {
802      return new StringBuilder().append("[").append(getCode()).append("] ").append(description).toString();
803   }
804}