invoice_printer 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8708e88c11fb7880fe93e8b3657c0d716256b1b4
4
- data.tar.gz: bef849e96a2a87917399b44c229dc3d68ec5df12
3
+ metadata.gz: 54e6e870b9c6dd877736812b7d41af08a48ebf72
4
+ data.tar.gz: 3661b458c65247c90f47fc1f2e2d7f9526c2cb4f
5
5
  SHA512:
6
- metadata.gz: a2c925e6119a3a8311adaf75fa636ecaa224661048d1a1979016e804accd6a35400c3ce4ae6a075882cdb9ea4426274349daba663cfc4fdf066a382c6e17e4bc
7
- data.tar.gz: 559f529c5cbd6b2229000928d429dbb8d92513c872cf4e42606ff5752f9e3c1a74a4e6a1a96e61090df2fe99d6e1284deecb8ad173a017fb737b44a32797305c
6
+ metadata.gz: 22be70421a81c07eed5ba7b676e4f8dcb0d58a7c5ce83330eacb60396164df4782536dcb81820fee0fd3cd111f702851e5c8753bb1df7ba82de7eef6f889dd22
7
+ data.tar.gz: f0ca098063bb4b407a791d5a39a0487286beb106bb51d0913654323daaabfd5afcbb2e6cc238f22032d4a5c42cf7418440087f50eeb91422b1a0a73c8daa19cd
data/README.md CHANGED
@@ -7,7 +7,7 @@ designed only to provide an interface to build the PDF version of these document
7
7
 
8
8
  **This project is still in development. 0.0.x versions are all development versions.**
9
9
 
10
- <img src="https://github.com/strzibny/invoice_printer/raw/master/examples/czech_invoice.jpg" width="150" />
10
+ <img src="https://github.com/strzibny/invoice_printer/raw/master/examples/czech_invoice.jpg" width="193" />
11
11
 
12
12
  See more usecases in the `examples/` directory.
13
13
 
@@ -23,6 +23,7 @@ See more usecases in the `examples/` directory.
23
23
  - Configurable labels
24
24
  - Configurable font file
25
25
  - Logotype
26
+ - Note
26
27
  - Well tested
27
28
 
28
29
  ## Installation
@@ -104,7 +105,8 @@ invoice = InvoicePrinter::Document.new(
104
105
  bank_account_number: '156546546465',
105
106
  account_iban: 'IBAN464545645',
106
107
  account_swift: 'SWIFT5456',
107
- items: [item]
108
+ items: [item],
109
+ note: 'A note...'
108
110
  )
109
111
  ```
110
112
 
@@ -17,7 +17,7 @@ endobj
17
17
  >>
18
18
  endobj
19
19
  4 0 obj
20
- << /Length 7914
20
+ << /Length 8111
21
21
  >>
22
22
  stream
23
23
  q
@@ -698,9 +698,24 @@ ET
698
698
 
699
699
 
700
700
  q
701
- 180.0 0.0 0.0 35.0 36.0 51.0 cm
701
+ 180.0 0.0 0.0 35.0 36.0 61.0 cm
702
702
  /I1 Do
703
703
  Q
704
+
705
+ BT
706
+ 36.0 38.5 Td
707
+ /F1.0 10 Tf
708
+ <4f736f6261206a65207a617073876e61207620> Tj
709
+ /F1.1 10 Tf
710
+ <25> Tj
711
+ /F1.0 10 Tf
712
+ <69766e6f7374656e736b8e6d2072656a7374> Tj
713
+ /F1.1 10 Tf
714
+ <23> Tj
715
+ /F1.0 10 Tf
716
+ <926b752e> Tj
717
+ ET
718
+
704
719
  Q
705
720
 
706
721
  endstream
@@ -772,67 +787,74 @@ stream
772
787
  endstream
773
788
  endobj
774
789
  9 0 obj
775
- << /Length1 27536
776
- /Length 14388
790
+ << /Length1 27572
791
+ /Length 14409
777
792
  /Filter [/FlateDecode]
778
793
  >>
779
794
  stream
780
- x�ռ |�y'zfopH�� Co�I���'@��S|HTCIPH��eI�]۲+�6^�[+��MҬ
781
- ���=ŏ�z
782
- ol`(eb�߾�w{(^�.��.�z_v h�fT0���[�~��Tʖ*>]^�C,�э
783
- Z΋B0v�KZ������l*B�,?��3��>p��:뛔�����_��7{�������4j��N߳�Dqi��"K��
784
- 2Ʋ�;:yoU���lo���F�g5�����'4w$�����x��lt��MGB=����^�<�rh�]U�?�r�YF��檨���[{k*\�"lWK #�hW��"y��x�ޟ�*�ʰ���M5Z.f��
785
- �v�q%X�����4#g�̠Ln�Aa�Õ�iѠRaP*Z�L�i�Q2=R�(ګ�Ȑir����"mD�M�6,';���RB�~��5��k��k�܆)a�zTST%$;�Dv"����;���h��wҊT���+�w�����>\b~U:W^>k����
786
- ��ǀ߀JP=}�o��Q��t)���SU_B��3\4\6�
787
- ����<����cP�y@�d���4/&�à��w1��K�R��ͫ������-�{Ot4n�郻ߥ��̷��6���Q��K��L۬g/&��<y�;�lC�w��������WtV�M9����E����n��b��۷"�����ʪq�6r}H�SrJFِ�a0��`�OgjQ����aT5��H��w���q��Bj!F�*���qvh�Mg蟅^xh������Cϯ�_���^��}���h3�j�z�y���z���Sʰ�ѥ�c�ݖ���{N?����.-4�����b������TT`�y}�� �t:NwQwY�)T:��ѩ�%�$U�X�t$z� u��*��3?xz����s���{[�7���zk�����+�%{�gc3�����7j���:}�|f�w����x���
788
- ���]8�r�"��bH�B��5��c��`�������lK^W����ԟ�
789
- heMݸ��|\iP��:�,�á ��MT\8a���n��}SF������_f��y$�oN
790
- Z��b&���3�z"Q{B�M��3�\�����C�RA�L1D�8:�L{�{ ���B����������7�T7OܷޗC�Bzr���Lk��Z��) 26C���m+���g)\H�Ss����Z�Rg��B �Y��(Ɔmq'�ۡ�� URN@R��%�V�����`��V(Ae�TL�����*vަ�WVSg�fto�s�����o�5�< 2gA�T�'Yt���QV(i���F���4(�T�
791
- �����xOC��
792
- iUaaI��l`O���ǼMo��G2d| ։�lCq�J!�b��Q��g��rԱ����8ziy�Y,x#�9ɷ�-�*�;�ѯ��|�?K6ij�̙�ikv��-?�fo<v~ԋ����-�iGCS���]�\���q��qRq %��'�/�ib2M��ݷ=�މЯ���#C�뿳ɮ_����:Ŕ����j9jɡd9������lv0��dSlJ]�]��ص�V[���255���_;Ҧ{d��L�|�����);Mi���fZ(JF�2
793
- ���L��Ҵ�l}��BcPh���!mP(h8xP8��S
794
- }~�BϤ!.��Ti&TL�\T\Vk
795
- J�M�i� zJ�Ѫ^ȧ�)̶�6/��m��$RB�ug��h�vZ��j3��t!� ���OQSfF,E�,�*�r��֬xC������6C�0���|g��߽�f0LV�/_z_�lڟ�"���#G�7O@{�k��p����|����p��9���8��WeV����IGoy%�S B��@��i �TqqC��V|��h�詢g�^(��O��MG
796
- �ݿ��A��Fj�����PNt$ ��Ȳ�����zJ��0���p��̡�Gv��g�<7�N�->��͍/����#��{cgj,[]
797
- a��),,˨-�qd��Qֲ�Pٳe?.{�LQVg��(uTAAT�Ȉu^89u���D�{�-�aW��;9������{b���μ�:����0��n������~���}MǏ�˨�k\q�ڷ��),t.{+[=�d(�^�z���s��%�=�ِ�Q����o���~\�c9f����yJ�tn���<��ʕ���o�ey�I)�O5r���V(�eVj�'#0S:�Gsl�b�vZ�;
798
- *�b<���4/Ox��QyU�h�B��*��(�R( ���޺!�b�aoEcE�4w~l��hG�Sa*��kؽ�3k;���o��;:�U2�*���*3�^���6�B�V�4r�ZE��f�!�Z�edԸ\�h�,����*��^S�d5�1���S@i
799
- ЀF�P�@#�J��k���Lo��fA�f��Z�5�p gnh��<���"Uf��*��M)��v�fJ��K��{��"��F����M�����B�C�r�ܭ�Q�����ّ\� �Lr
800
- C"��T����Vyn(~he�h?�BS�I3��栱���*���f��Q��r�̕Sm�M�*�Ӆ�\E�F+z�3ԟ"���x�l'�P!�Be��N��+��|iav�^��[����� cG?W�����c|�|�s|�{��DK��sv�y��`y�x�o�#�pd��w��� #m,ƾ����0ąu��,e�;0ޓ
801
- �+�������c��,�O8��̀��V8��c�f1WC5�*l����|�L�֯���{�����w��q���./w�;;��b<J!����scc���Ώ���m�w�dF���#]>�'��XL���LRR*�)
802
- ł2ݜ;-���n)�ͧ�)zeB^����3�=�]�Y;;����/ottz����%���!sf]�Ә�U�����/M�wYx������,%���U�?5;�&�UE t���:�Yi�P���ۖ��o͓8HP�+p�����h�^6�U%�=;z�����;8����P{,���hQ[^V�kT��uc�|.���Xj��LlT�Ӗ;�2=��5Se&�cҤ�<
803
- vJ*��W��n'۵yqf#��v���ăzጓ��\��z�kky�� ���~K����6���x�[g�?<�{X_����C=5��ϼ�ee����gy�����\Nd����ʜ�>��o�[�o��>�n��7Y��*̆�C�����J,��[��/C��GGVnz�nL��4)i��1���L��@���PL�����yI��;�aU���w��zK{��pd�OI�تL��7�f��_���o�έ2
804
- ��ƪ��m/"+l,Zs��-.��x�*�,CZƠ4U�,� ,Jc�U-�S13Lg*J���&�ʴ�@Df���t�;��ɾTl��2gQ6J ����K{�M��4"MKv"Գ2��DQ��XQD�{�6��3�U�+~ZP�R���ݲJ�eD�(�b(����$�����I|b�VS���f
805
- "P%٧���=��ݡ������_�z�[��=��5�� �@��x�x�6����}5�ar�S���OQ2r����,ο,����/O˞�߁� ��&�8E���5�:e�����%��ϨR�,{��&��x;�3�ґ�(d�Q�����C\����gvp'}�����蟩B���D��.������01�?ɢ��C^*���7�9ŗ?Uꔇ�����T�T���S߯���P���%�w�2�V����c/��1�)���W3J3V2^���Fu?՗�W�/ge�d�g.f�3��� [x)~��So S�.�g?�[����%�yd�B��Fy2�~��]��Ad��#|^GKx��3�|]�9��CWe���*�Jϡ��F6�=�"}�� �����vВ�*:�� :.��YtIV}g� ~>�.�i�a:��Y����s�7a��#c0�K�u4ΨP'�?%�|���E�0]�����
806
- e2=��,�w���<�����"T{�
807
- �#�Q-��:T�P#j��׌ZP+jC.�F}��~4��F#h��q4���Q4f���hQ=��DoEb\n J>�6J��W�~
808
- p��~(AB?����b?(w�~ؘP�+� QG�~ʋ�+G,�I_��G�~ʢ�$������%�~.�������*�C���j����~5*�O��t�>'k�}U�עl�J�ע�3��Q#�,���&����ә�~����؟��[~.���C-�6����(W����mn�p_��y����su�#c"\����->P�zQt�� �e�:�`���@�X���Z��G�� ��@ˋ�al=��h�qIt"䊇O>�����->��D�j�H�Њ��8���� �%���V�;�X���؎]�]�W�1{����7�7�77��[+��N�tl�}�*`���q���$��;��zB�ZvdO^�N����H0����(!�@4\����&S��\0���h���|�\h)Uq���y��W�} Y�a����BK�-���s}��hDŃ�1yc� ��ѕpp}9ZO6M<{�hzd����b+��F��z����0X�E���52<
809
- 0 l[�i�L�=�X=,BkI�XHKX�A"�ے$\�TBbDZ)����A��'H�������Q���sb��e'W�nȝ��R��/�cCZ
810
- ,\�p�b�\L���E~5t�����HW#!η� ��Wy�`�q}1�mcED���%\����#}�,����X��=��� Or��^���;>W5p}�bx��y6��?Z�w;�z� �[��)�,o�#W VsX���� EA8��jt0��~ �����$�����Ba_4N�
811
- 0t���������� ����`�!@����
812
-
813
- ������pU�� �X�~�����/N�_���fˀC�a?/,hC����%hBd���Rz{DN�KIPyd���F-,����B8f����D1 �>��uߪ�����8ꁘRC?x�Fh�'6a��w������C����>�Y�����ĩ�! �]�paa�l.B�n���N
814
- �.H A΀nbK"Cq�B�_��ŷ�������K�n&% L�ή�9~}+�ccf��ѕPv#��uc<^��-p�e��k���+�A�o�=b-���m�a
815
- &X~�=>䝘G�*�ޑa���|x-!� ������ű�m�7 /� ��th1
816
- N R`}8g�%��6���s>��2/O��'��mKJ�r��Ք(
817
- lN'�>Q�S�
818
- ~�������o�By�s�O!�O��X���q5� 3���(��PS��@�������"�*1!����P�����|��V�?��V`�aЎ
819
- �틡y�,�9�_��b\#��q��Az� I33jR���En�b�儸�46�q%,V�
795
+ x�ռ |�y'zfopH�� $!�_H��~��
796
+ A`H�"
797
+ )1~H��ږ�XylU�����$�Ɛ�:r�6N��q9Ͷ���8n���o�4�m��uD�~�� ey{����"8gΜ�����RB����e��o��;�_���!De.�n/�)~�Ih���3�!�ϲf+@�jƜ[Y��I�)\�����++�/���P����5ߙ
798
+ CHa�oE��P�{��<O9��!�M��L mF&W(Uj�6�M�����,C6�A�y������R���L��U�����\�`ilB��C-��N^�&\�����;��_rt��{������P�� 4h9��Q[]W�USk���3S5��3�3����VǶYW[�Y]�3l��mM&����
799
+ i��%F%�@c���h�2����M-`�mV=e���漭��f�@Wi�|�Dh?��ldR��R_������������y&�������y�����nm��,�7�-:X*���[X:�,�.�u3���g
800
+ �?piz���ζ��ƞ|����M�ы� 4LVW�oۼP&;�:5Vo?���c������ԏ?��o>a�k8T?�^�4���q�܉�չ���bc�����WY��ɻ*+*8�Κ������
801
+ V�,�n�a�ᖀk~6�m�l����b@�"4+q4PVI *�% f�>��g8Q�Z~��L}��`��wŻ��<��E6��]
802
+ L��$#2����皘��/럜�������3ӏ�
803
+ ��K"�h��Y݊�f����K��y��wO��?���^
804
+ ��PHv��+�ʷ]D�9eer
805
+ ��H��
806
+ R��je�L����RE�^]F�L��ӌL�pi%�o�[��q��<�GJ ]��k��׮I�׮�p����QM5PU��Rى��+�oӊ�Ҳ�o��4�iW�oS�{/�/}����l��bִ��sb�����4�2R����^]�R(
807
+ \��F��ԅ :g�h�l�*�E�yP�Ǡ��� ��`�y^Ld�A�)�b*���TO%�Wi㹯�S���=�Yش��~�>2ߚS�ڜۻFU�.��2����������ܳ�y������W�5XY?��s��x̦>�ioSA8>|l߂���++��U���!�N�)ecV��h�C~:Sju�\-����Gjd��>$�9s�R 1:W�����C[n:C�$��C�텅'��:�������G�<��v����'[����_+���|J�4��r��ni���{��Ba��f�/:.����IL5BV�ק*5��N��tuu1B����DLR��AJG��PW�R����O�����{.]po����y_o]�%���%�d <�llf���}"��z] ro���O���X�O�Q#��L�`�r '_]D�Q )TH��@�&�@}��1 <9c55Z��m��*��{��ӽ����N��{Ik��Т#�zr=�}^�--�e�� �t2NvQvY�)T�4�sVI)�2��F�G��.-��y��Л��.|d�����;�����K�_���z����iX�A�-,E
808
+ Q�\~�֫��4�'Cn��"W�|��50?Vww���y��{[@'�:t�.}��%�ˠ�
809
+ he�v\JE>�4(RiP��Ѕ��Ɨ+/��~�[�S�>qϩ|���(�_f��y$�oO
810
+ Z��b&���L��HԖP`�e��G]ˋ�r��!@��r�"g�dƽ�=t��{!j������@�^�{��'�[��!B!=
811
+ 9�ڌ� Z5hi-���!Sd�6
812
+ @�J�L*�%Hi\ϲϳ�b6�/Tv�����<&W���ZD.W�Eq[��v��ƥLp�8�*l����m��|�b��~�=7���w}��1FRcʗ�}g�#�ԗ��$EC�{�B,"V����2)���G^z|����{��"]TD�[�����j�������k.�Ao��?|*�%�=gI��e����;�ϟ^�'�����/�~Lb_1ľ��>��X�K�����bT�P��9qJ!����z�i)q0���޿�N������{L~i�7ּ�;���k���މ��qw�^}�"ZF���l��M��>�Oɕ��PȨ�1-���>6=��<��lN�̴Y-������J�D�|��V���Ʃ���/{?���;���z�o/*��9��X��������ݗ�܊��ڊaG�^?�����9G rl}��"Wa��Yt��X�������Ξ�h��)DE"ZUTTڟ�&��V|���m�H��ob�:q^T�m(�@)Z,�96�LZ�:V~����C/./��#����8'���W���+�յc
813
+
814
+ M��
815
+ �OzJ�/(P�4ep�*͈J蜋��
816
+ zMA)i6�~^O�5Z��T�ٶZ煏�:?O"%=Pw���-�.˼Xm�/I7b�����/5eb�R�Ҭ*��jˊ7�{��o3� ���ͷ����6�a�2~��{z�d����_�),<b�yؓ݃EEv&r������N����W_�Y`�oC'�UTN�auM�-�P%%�iTZ{�Q{�H�S��?_,/.�2Y��8=����J�7)�h��� �q?
817
+ �&��j�s�a����HG�^�������I{yp.���`�}pz���j���cܚ{��������u���ݽ��˹E�U]u��yb��5�CN��Ec�5EŘ�*�*�GY]n�ְJՂ)5��r(�����]�pR�%jl��M�8�J:|җPR���1{gz���刣���v�sg�k�l5i�H���:wR�����'�8����=�7͝�ʕ��Z�^��[�E�_�K�a�^2�M9c��QN��2ҩt��F ��*)�ƀqE r�o�Ŝ<IJI�o�b��-���v8N%��7�2������]�6�r�_־�������x��s�q������h�����{g�]��U�\��l��;:JWU:�7-��k�2P~�4�Q�eOgJb�v��]�9O,'(����z)Rt�� �.G�����ꝝ��vϺ)���]s�!�s>���?�Ɠ��k���?��[��m���K��|e���!$a��@�%��:lE�O�U�eԕg��k��Z)K��<T�l����)W����4J]!UX�7U$2b��GN� �4��^gM�F����ND�`#)m`螵�}����_��ҽG�����?au�j��po��#
818
+ 0�,��+.��?���1��=�����uj^��k�\���B�_��9Yh1 &K�x����eL Ws��^?���*��eT&�)�x�OY^�
819
+ �������� :��Q��P @Z1yC�t3�ފƊ��j���ZO�*��X>8���>�{�eu��5�,h8vt��<d�U*6nG/�Uf�jg�
820
+ �R�Vi���W�
821
+ B
822
+ �\�Ȩq���@Y15FEn����^Sd5�1���S@i
823
+ ЀF�P�@#�J��k�w�Lo��fAf��:�5�r gnh��DuME��6=U
824
+ �R�/�P-�b��c����#�E~7r����F�=%/���m9~���(d�� I��H.[�SF9�!Cx*A���
825
+ �<�?��2Qt�W)GQ3��栱�څZ*��^;R˨��r�̕ScM�)�3������V�pg�?Efa��F|�RrD˚��"'Wr
826
+ ��xO*8�����ҏྲ\>�B�7|6Z���˨1�Ὰ򨁤Pac���}�+gڵ~��������p��u� k]~wE���յ�����)���gύ���kl�;?6vn�Q|߹��6\�q�
827
+ �>)�(�b�W��d�ʔ2�LQ(���i��Ooإ�7�R�� yZ�jL_���4 t7e��Ԝ��_�负z�������!Sf}�3?����[��_�l莳�—�?�e۳�K
828
+ ˡ��{�Kw
829
+ �Ǒ����Sg(JZ)�}̯!#�#/�,h3SijEnt^R%���X'�����7��*0���FR/�))���Y[�����ߪs���#��
830
+ ����Ly��F_��^���7}?�c{
831
+ t�KY���9c���Q�;�L~a��_�)����\�B?MɴH�d�#�:�6��Z��!8- 'ɸ��Z&^�#ā.�N<��W�O�>�3�Y�o;�7�������4�;��(��Q��A�(�Y�2�4��J�l��$R*�t�j �(TR����.�S����)� R7~���;z����;�Q�J����,ww��:?���~�`ۋ�
832
+ ���x�K�7�J6����1(M�6�"��X�PU�T � �YE��R�(F�� Pe�` "˷�[u�ۏ�ɾTl��xDF��(+%���o~����hm�B���d;{�Y�|w��2?����+l.�g�W��R���h�eB�0��Q�P=IX95�T��������~X[(|�@�f���v�zw���:��?����+ݺ%�a�?���K3� }��E��1R�I-O�W�Ͽ*<�ԑ�j���y����)�d�9�O�E�Yx�)�^��=C�
833
+ ��AK�����踬>g�%Y���ςx}]����tڭ��%h��o�8�=F�`����h�Q�.�JV��ᓋN�@ h��3Ɗ���3�`S�%M��W�4�4�O������;z���䐹uȂfAf6���L�H]Ŀ�#��#(�ȕ�1��SV΀o�7��;&�v��]�w��!�T���!b�H�+� �8���o�����e'��U(��!g�ޜ�*"ʃ(\�
834
+ Q*F�_���AuȌ�QjDM�bd jEm�����#ȃ��DCh��Q4����BG�4�Ώ�yD(�@O"�TL-��v���d��0��O�/������P���~����~P���y��_D2F�e(/������~9*��(����Vj�O�1J4J�L�W!-m�U(�n��HO��jTF��5�0}N�נ
835
+ �Ճ|0� -/Z��
836
+ � �W���
837
+ ��Ap2l@�F8t�F̄���F(%����0cC�,������hf�t3K������z0�#�ր P����0��^6��X
838
+ �A̓\p�;�����"ܚo�EV�����5Ln`�/]ٯ7+
839
+ 㗠 �e��J��9�,%A�
840
+ ����/��t�}�Rl�/: N�bJ
841
+ ���,
842
+ ��e�IJ`8�IY
843
+ �̀U�
844
+ �!G�Y����B�M�롰d1A�|�A�� I���[L�o���RRS��W�@)�5>�@�JԤ��?�/�����be
845
+ �J�-�K�
846
+ �ᄜ��H���'�2)�8Q�8�DaN�(�&*E���5�z=��)��Kb���0 �
847
+ �틡y�,�9�_��b\#��q��Az� �I3�3�R���En�b�儸�46�q%,V�
820
848
  �µvq~=
821
- �ܰ��ԈI�f������7�;��'�C����yQJb��q �� �L8tXp�zد6��M� �}�-��T"8YJAvm3B$�철(�@q��B$��d��5X�_rw��؏[{qw���D��?�L�,3�ĩ%uW��C���7�0K[� T�K� Y�:RtƵ+�р��R�;�;�����I�[؏M��MN;�ݜw�9�u�]\�s�K-ܴw�325���q���,l8��,7�vYX� �&&��q�;4:�u�`�;�;8���z`����
822
- �&<���$��l�N�����l�-d.�
823
- ���-l��ـZ7r�g�߉�P���ks8�-�Kvyw{g�����%��� xpH-�},
824
- طDy>�D0��,����%",'A�'�׮鮐�W���������X"+��)~�G‹=����a]����ɱ4$�4L��M�,�2h"DH�n��ɘ��7�Ѫ6�����H|��l�����3�� ���Ĩ"z����I��N��Hl\��v|��)��G��AlgQ�~'�!��N( �!Hn��%M ��d�$�E1���%��,��@�!H�JVI�.9� �"�e�T�
825
- Y��h1B8]��1>�
826
- ^&�V@�K�H�m#��H206k��{1&(�|P\Om7�rP䱈�; �+�-RGD����Rw.��%�S����5?���Ƕ�����"��a�d_���!l<
827
- ����N��d���XU%���w�:>"RL���Wl�5�>��'*�SGt'X���wɵ�
828
- ����:�*$�̭�=R���,3!�
829
- �c�F�cxʿ�O6E�Ҝ;��l��N�]҉�%{� ���D�Bv�"^���Ss�~���v���F<�
830
- ��n�h�NE�!�~jռ?e�����k\K�I��.B��7�� �RiI������T�3��}�N��ǫ�Sw�\J�v0�;�C�LN���g������52��Wz�nD�c��O5�D?R<���n�nmG������I����S,���O�w�<�n]Ҭ�(|gI�S�I���ݼ�=�{�iN�����n��TUN�)��wA8��+H�ĝ���A�c}�S��J0�R��y�z�s�;�K!Z�Ϝ{���������>�b<���^f2��˕v-��K\�1%�bd���w�H8�_Bw�!�u���ҹ+���ߥS9���E��� �1��<K<� ���hƍ�{xG�7��^r�炞R�U�_J�n���<0n��h��;�=��'��WD�.�n4#>Ӛ TG����䙝���� ���h��q=�7I�3�!�E@: ��USQyɊ2V�K/� �um/���[��p{8��OD�$2”'��)"�q�;E�9��O��g�0�� �� �2+ʪ�<Ŝ%#��_M������!��E��UH��lD�2n'�ԋ�ppp��H���<������ɪ�D nQ�N�d�t�'��s��N��āx%j�:`�i�#� 7�� Ye��?�J�q�3�I�d�] �-h~0I���ل���n�r��Iw*�`� .9;���x���t<,�7��bK�Ke�x���r}L�R`�%��ҕ�PXC��)�
831
- G��R�+y�4��D���6��AyJ=("��K��t����%���$P�o
832
- LA_�i�����1�}&���.�b>ن���/-h3���g2�}O�Q�c����h~Q�u�{��S�Nɞ��&�Ӎ]���6ƨ��Ӡ���� ���n�z��+�s�0��u�s�6\T�So����<4�p̓S��y`�|͙�s5�O���oj� u�̯��g(�?�O���~�O�5iS��TFM���F3��QLQ5hJ]��bj詫z)��SW��W&'jk�*o��T��bԣ�� ����)����c3W(�ӳ?�$�)�M��.���A]�A=���O$=/ႪE�\ |M�ND��Ԓ�;��3S��c�#�C��^ϑ>���������ho�nmi���Y�*��̥�<�^��j5j�R!�14�,ns��X��*�O�6��×Ա㠫/uL�[ øԑ��o�C鈏�t\ꨳpn3��2sW���h?�2�r��=Dڲ
833
- r��EI ���y+..F-p�X����� �]�jzͽ��΂�h���B+Ve޸BUuQ�AW�ۮ�H��ecL�����͸]%%���Z1EoLIhqA�=�]��vቫ:��P�0|�gb�&]`�.<��ƪͮX�'�K���,f�;Vkb�����\g�.� ������{�A��Y�� �Km�!�WR��<~Ձ�"vnlF��B��E�����|�5�N��sN���`.��r/��[+y�s�\��O~���s1�baѿ�?}���%�mr&�pA��yu_i��x�0�b��Y�1��G�Apb�L�� �1��gŬn�Ź/,����yl�d���Wq/�`<�q�rzA)� 3���i� ������� �Y� ?��d�Ū��+!+�Y�۾��`̹�\����,�tp}�f��:P�����f�$
834
- Q�P�v0N�B\f��:=�-�<�h C����f̼y� 6����aY�L���f��E+�L����[1� ���@�)�>B�㗞}���m��<0qS6�w�C`�p�Ù�D���f��9�w�w�ֹ� W� 6L��
835
- >���D��dO��O�3��������+:��G'g��T�,���`��� `��?�raa�6�A�/��](F���P�"-�1�=1���w��n�_����*��C��Q�����������ko ����w��C�*��?E�$���꟣o�7P��H���3��k�g𙸻C5��R��E_����s� �s��Y���[���'��-��oGɃ
849
+ �ܰ��ԈI�f������ĝ}����`�˼(%1�����ą &�:,��P=�W�PȦE�;�G@*��� 3��!�HvY�I���K
850
+ !�I�S���,�/�;�^�G���;�^l��ڟe&q�v�Ԓ��[�!bb�` ���P*���,E):�ڕ�h��q)��tz�����-��&F�&���n�;�������.��9�efn�;����`ĸsxr6�sx���̬{vZ��8���]����ry��p=0ox�����@tr�LIy�0��,��u�x���f��;9�i�Q'7����N
851
+ ��������u%4~"���d��9������^��p�!�ڂO��.�OL-!G��Dc�E"��+���3~|�!��v�g���G������M��(�{��4�I"/��w�>t����<H* �ƶ�-�g#j���! ��~'B=��[���eDзt",������
852
+ �! �~�XN�A�$�>*Z��*X�!�,��%���<a% ��U��B SN���6�I��~bg�$��t�̍&��'����%��K⌄T|0R:A�2H�̪x½I�'*>%����u�/As}M@(`��!�����DzD6�.����i�$^�N��B�^I���'�ۢ�c����
853
+ ���Z /��t>"�u��W�/'�Ґ(�0�o6ɲ���i"I�=6&cd# �G�E�ڄv0޳#��R<�I2xt�c�"̌��$�J$��f��Q��n'Y�:�#�qU����k�p�!oI�I��E��a�����:�$� �� K�4-���ђtŜ��F�H���� 1 Y%���H/��ܖ�R�7 J�G�$���~��~��#Hw3n�I& I�ڐd�͏��`�X%/�7K�VB"H8L����=�K<&�K`���;Rm=�20�S$r��ޤ�$��v������_O��0S��ę�DEl��H7a�!����%!%�#q��O�x��n��}��h!���2���%�w��>��*�$�I6�u"�,������K�e�sԗ,T��?൪a^�G��d�~qͰo�w���E�L�c�d���ͦ� ^��M���/qh#BP����+�'R����V�>R�|'=H������}�:�s|�D�,a?�X��V�q�c�H�G��A���M���f?R�!�R�'XӇU�B�� #��8!u����n��`�C�徏��g�5�Α��H&Ix|�XY@�����L�����E��N����NN�,�x��aB�>C���K�4t���ǰw�s�C?�X����x�]#rI�4a�TMf��Y��4��-�,Ɏ%�:��V�JE���z<��qn�x������q-�%v�B�T?����D{�/�ğ� �!b %iM���6��]w�S��W���!�do6B�d��;p۵/S�,kĿ;3!~
854
+ xyQs��".3J�����P/#>i!I:��P���X��T�R��o�w�;��f|�/U��b]"�*^> a��K����Gީ�KއU�*�s--�۟&Nn�=Jܲr+�iǶ�B���"��e�mĽT���vb/M$#�j#���W����c�������vS�!E����b����"uD�^�N-u�!�ºZ=��p��_[�~lw��/q��O��+I�ƣ����{N�a+�AgZ�:�UUb�~p}���#"�ľl� X��S}��:�Dw�U 1���H��VH͆gԋUy �dnE����d� l�� �Kg3k�$��q�5�텾�xN$� �Iڔ֓8P,��)��%��w}�Dɦ����j��XYo�����6�zV��5B�S5~�)b��ܹ�f��t��B�N�px��Ղ�z�I �9�x���sL�y�e�'����+䲻բ�;�����U�z��eC�?���q-�B$K���ވ�'$�J�%iZ�c"R����I;U��O��r)���t��39!��=$�B�O ��>^�Ⱥ���K@<Ո�H� �ǻY�Y�9�6��3�' ��b�_N��۫?��A�uI����%N�&�gw��@��%�n>�~��:PT9I��w��̺F� awʲ�?�3m��N)�+��J�Vx������/�h�?r�Ţ���^��>�܋=���n{���^f,Wڵ|ػ:,q�Ɣ�o��A��<
855
+ U�M�]�n�B#���1n_ 6:6�v��Β>�Kh��1%��1f�8w���'����B]Z����1>�t�q_��HL_�1�b5��y�23�\�X� �
856
+ ����/��n�2��'�(*t��p�<���B௴cy��-�M��،p�V� �a���� �ɫғ�)���$>}�T�U�^��V�b��z3H�|W�7<�bL�¢_}���%�mr&�pA��yu_i��x�0�b��YL1��G�Apb�L�� �1��g�,n�Ź/,����il�ed���Wq�/Za<�q�rzA)�� 3���q�0������� �Y� ?��d��j��+%+�Y�۾��`̹�B��Ѕ�,�tp}���� t�.r�5����P�H��#p+��0����S{=�����ׇ@*1�+b�$Z:�cֹ#4a4TùyW��r�H�`�4���0�Pauz�GLx.��@�ta-�q14�͘xӬ l�1:�yò&��0
857
+
836
858
  endstream
837
859
  endobj
838
860
  10 0 obj
@@ -860,7 +882,7 @@ x
860
882
  endstream
861
883
  endobj
862
884
  12 0 obj
863
- [229 229 229 229 229 851 229 229 229 229 229 229 223 395 223 493 649 403 616 604 646 605 600 537 615 600 223 229 229 229 229 229 229 695 666 649 685 229 559 229 707 293 564 676 229 804 709 740 642 229 675 604 589 229 229 852 229 229 229 229 229 229 229 229 229 532 562 518 562 546 229 562 564 255 255 549 264 849 564 566 562 229 403 475 378 564 520 229 229 538 511 229 229 229 229 229 229 229 229 229 229 229 229 532 229 229 229 229 229 229 229 229 229 229 255 229 229 229 229 229 229 229 229 229 564 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229]
885
+ [229 229 229 229 229 851 229 229 229 229 229 229 223 395 223 493 649 403 616 604 646 605 600 537 615 600 223 229 229 229 229 229 229 695 666 649 685 229 559 229 707 293 564 676 229 804 709 740 642 229 675 604 589 229 229 852 229 229 229 229 229 229 229 229 229 532 562 518 562 546 229 562 564 255 255 549 264 849 564 566 562 229 403 475 378 564 520 229 229 538 511 229 229 229 229 229 229 229 229 229 229 229 229 532 229 229 229 229 229 229 546 229 229 229 255 229 229 229 229 229 229 229 229 229 564 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229 229]
864
886
  endobj
865
887
  13 0 obj
866
888
  << /Length1 18916
@@ -938,23 +960,23 @@ xref
938
960
  0000000109 00000 n
939
961
  0000000158 00000 n
940
962
  0000000215 00000 n
941
- 0000008181 00000 n
942
- 0000008396 00000 n
943
- 0000008563 00000 n
944
- 0000008730 00000 n
945
- 0000012506 00000 n
946
- 0000026985 00000 n
947
- 0000027199 00000 n
948
- 0000028561 00000 n
949
- 0000029475 00000 n
950
- 0000037553 00000 n
951
- 0000037768 00000 n
952
- 0000038096 00000 n
963
+ 0000008378 00000 n
964
+ 0000008593 00000 n
965
+ 0000008760 00000 n
966
+ 0000008927 00000 n
967
+ 0000012703 00000 n
968
+ 0000027203 00000 n
969
+ 0000027417 00000 n
970
+ 0000028779 00000 n
971
+ 0000029693 00000 n
972
+ 0000037771 00000 n
973
+ 0000037986 00000 n
974
+ 0000038314 00000 n
953
975
  trailer
954
976
  << /Size 17
955
977
  /Root 2 0 R
956
978
  /Info 1 0 R
957
979
  >>
958
980
  startxref
959
- 39010
981
+ 39228
960
982
  %%EOF
@@ -67,7 +67,8 @@ invoice = InvoicePrinter::Document.new(
67
67
  bank_account_number: '156546546465',
68
68
  account_iban: 'IBAN464545645',
69
69
  account_swift: 'SWIFT5456',
70
- items: [first_item, second_item]
70
+ items: [first_item, second_item],
71
+ note: 'Osoba je zapsána v živnostenském rejstříku.'
71
72
  )
72
73
 
73
74
  InvoicePrinter.print(
@@ -29,7 +29,8 @@ invoice = InvoicePrinter::Document.new(
29
29
  due_date: '19/03/2016',
30
30
  total: '$ 900',
31
31
  bank_account_number: '156546546465',
32
- items: [item]
32
+ items: [item],
33
+ note: 'This is a note at the end.'
33
34
  )
34
35
 
35
36
  InvoicePrinter.print(
@@ -17,8 +17,9 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ['lib']
19
19
 
20
+ spec.add_dependency 'json'
20
21
  spec.add_dependency 'prawn'
21
- spec.add_dependency 'prawn-table'
22
+ spec.add_dependency 'prawn-layout'
22
23
 
23
24
  spec.add_development_dependency 'bundler', '~> 1.7'
24
25
  spec.add_development_dependency 'rake', '~> 10.0'
@@ -34,7 +34,8 @@ module InvoicePrinter
34
34
  # items: [
35
35
  # InvoicePrinter::Document::Item.new,
36
36
  # InvoicePrinter::Document::Item.new
37
- # ]
37
+ # ],
38
+ # note: 'A note at the end.'
38
39
  # )
39
40
  #
40
41
  # +amount should equal the sum of all item's +amount+,
@@ -77,7 +78,8 @@ module InvoicePrinter
77
78
  :account_iban,
78
79
  :account_swift,
79
80
  # Collection of InvoicePrinter::Invoice::Items
80
- :items
81
+ :items,
82
+ :note
81
83
 
82
84
  def initialize(number: nil,
83
85
  provider_name: nil,
@@ -108,7 +110,8 @@ module InvoicePrinter
108
110
  bank_account_number: nil,
109
111
  account_iban: nil,
110
112
  account_swift: nil,
111
- items: nil)
113
+ items: nil,
114
+ note: nil)
112
115
  @number = String(number)
113
116
  @provider_name = String(provider_name)
114
117
  @provider_ic = String(provider_ic)
@@ -139,9 +142,50 @@ module InvoicePrinter
139
142
  @account_iban = String(account_iban)
140
143
  @account_swift = String(account_swift)
141
144
  @items = items
145
+ @note = String(note)
142
146
 
143
147
  raise InvalidInput, 'items are not only a type of InvoicePrinter::Document::Item' \
144
148
  unless @items.select{ |i| !i.is_a?(InvoicePrinter::Document::Item) }.empty?
145
149
  end
150
+
151
+ def to_h
152
+ {
153
+ 'number': @number,
154
+ 'provider_name': @provider_name,
155
+ 'provider_ic': @provider_ic,
156
+ 'provider_dic': @provider_dic,
157
+ 'provider_street': @provider_street,
158
+ 'provider_street_number': @provider_street_number,
159
+ 'provider_postcode': @provider_postcode,
160
+ 'provider_city': @provider_city,
161
+ 'provider_city_part': @provider_city_part,
162
+ 'provider_extra_address_line': @provider_extra_address_line,
163
+ 'purchaser_name': @purchaser_name,
164
+ 'purchaser_ic': @purchaser_ic,
165
+ 'purchaser_dic': @purchaser_dic,
166
+ 'purchaser_street': @purchaser_street,
167
+ 'purchaser_street_number': @purchaser_street_number,
168
+ 'purchaser_postcode': @purchaser_postcode,
169
+ 'purchaser_city': @purchaser_city,
170
+ 'purchaser_city_part': @purchaser_city_part,
171
+ 'purchaser_extra_address_line': @purchaser_extra_address_line,
172
+ 'issue_date': @issue_date,
173
+ 'due_date': @due_date,
174
+ 'subtotal': @subtotal,
175
+ 'tax': @tax,
176
+ 'tax2': @tax2,
177
+ 'tax3': @tax3,
178
+ 'total': @total,
179
+ 'bank_account_number': @bank_account_number,
180
+ 'account_iban': @account_iban,
181
+ 'account_swift': @account_swift,
182
+ 'items': @items.map(&:to_h),
183
+ 'note': @note
184
+ }
185
+ end
186
+
187
+ def to_json
188
+ to_h.to_json
189
+ end
146
190
  end
147
191
  end
@@ -54,7 +54,6 @@ module InvoicePrinter
54
54
  @@labels = DEFAULT_LABELS.merge(labels)
55
55
  end
56
56
 
57
-
58
57
  def initialize(document: Document.new, labels: {}, font: nil, logo: nil)
59
58
  @document = document
60
59
  @labels = PDFDocument.labels.merge(labels)
@@ -123,6 +122,7 @@ module InvoicePrinter
123
122
  build_items
124
123
  build_total
125
124
  build_logo
125
+ build_note
126
126
  build_footer
127
127
  end
128
128
 
@@ -563,8 +563,22 @@ module InvoicePrinter
563
563
  end
564
564
 
565
565
  # Insert a logotype at the left bottom of the document
566
+ #
567
+ # If a note is present, position it on top of it.
566
568
  def build_logo
567
- @pdf.image(@logo, at: [0, 50]) if @logo && !@logo.empty?
569
+ bottom = @document.note.empty? ? 50 : 60
570
+ @pdf.image(@logo, at: [0, bottom]) if @logo && !@logo.empty?
571
+ end
572
+
573
+ # Note at the end
574
+ def build_note
575
+ @pdf.text_box(
576
+ "#{@document.note}",
577
+ size: 10,
578
+ at: [0, 10],
579
+ width: 450,
580
+ align: :left
581
+ )
568
582
  end
569
583
 
570
584
  # Include page numbers if we got more than one page
@@ -1,3 +1,3 @@
1
1
  module InvoicePrinter
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+
3
+ class NotesTest < Minitest::Test
4
+ include InvoicePrinterHelpers
5
+
6
+ def test_setting_a_note
7
+ params = default_document_params.merge(
8
+ note: 'ABC is a registered trademark.'
9
+ )
10
+ invoice = InvoicePrinter::Document.new(params)
11
+ rendered_pdf = InvoicePrinter.render(document: invoice)
12
+ pdf_analysis = PDF::Inspector::Text.analyze(rendered_pdf)
13
+
14
+ assert_equal true, pdf_analysis.strings.include?('ABC is a registered trademark.')
15
+ end
16
+ end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: invoice_printer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Strzibny
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-11 00:00:00.000000000 Z
11
+ date: 2016-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: json
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: prawn
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -25,7 +39,7 @@ dependencies:
25
39
  - !ruby/object:Gem::Version
26
40
  version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
- name: prawn-table
42
+ name: prawn-layout
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - ">="
@@ -95,6 +109,7 @@ files:
95
109
  - test/invoice_printer_test.rb
96
110
  - test/items_table_test.rb
97
111
  - test/labels_test.rb
112
+ - test/notes_test.rb
98
113
  - test/payment_box_test.rb
99
114
  - test/test_ext.rb
100
115
  - test/test_helper.rb
@@ -118,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
133
  version: '0'
119
134
  requirements: []
120
135
  rubyforge_project:
121
- rubygems_version: 2.4.8
136
+ rubygems_version: 2.5.1
122
137
  signing_key:
123
138
  specification_version: 4
124
139
  summary: Super simple PDF invoicing in pure Ruby
@@ -128,7 +143,7 @@ test_files:
128
143
  - test/invoice_printer_test.rb
129
144
  - test/items_table_test.rb
130
145
  - test/labels_test.rb
146
+ - test/notes_test.rb
131
147
  - test/payment_box_test.rb
132
148
  - test/test_ext.rb
133
149
  - test/test_helper.rb
134
- has_rdoc: