├── LICENSE
├── README.md
├── build.xml
├── build
├── built-jar.properties
└── classes
│ └── danfenfe
│ ├── DanfeNfe.class
│ └── Item.class
├── dist
├── README.TXT
├── README.TXT~
├── danfe
│ ├── brasao.png
│ ├── danfe_nfce_58.jasper
│ ├── danfe_nfce_58.jrxml
│ ├── danfe_nfce_80.jasper
│ ├── danfe_nfce_80.jrxml
│ ├── danfe_nfce_A4.jasper
│ ├── danfe_nfce_A4.jrxml
│ ├── danfe_nfse.jasper
│ └── ginfes_danfe_nfse.jrxml
├── danfeintegranfe.jar
└── lib
│ ├── barbecue-1.5-beta1.jar
│ ├── barcode4j.jar
│ ├── batik-all-1.8pre-r1084380.jar
│ ├── commons-beanutils-1.9.0.jar
│ ├── commons-collections-3.2.1.jar
│ ├── commons-digester-2.1.jar
│ ├── commons-logging-1.1.1.jar
│ ├── iText-2.1.7.js2.jar
│ ├── jasperreports-6.1.0.jar
│ ├── jasperreports-fonts-6.1.0.jar
│ ├── jasperreports-javaflow-6.1.0.jar
│ ├── org.w3c.css.sac-1.3.0.jar
│ ├── w3c.jar
│ ├── xalan.jar
│ └── zxing-2.1.jar
├── manifest.mf
├── nbproject
├── build-impl.xml
├── genfiles.properties
├── private
│ ├── private.properties
│ └── private.xml
├── project.properties
└── project.xml
└── src
└── danfenfe
├── DanfeNfe.java
└── Item.java
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | {description}
294 | Copyright (C) {year} {fullname}
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
341 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Java-Danfe
2 | Projeto em java para gerar pdf de arquivos xml para NF-e/NFC-e/NFS-e
3 |
4 | Author: Junior Tada
5 |
6 | Email: juniortada@gmail.com
7 |
--------------------------------------------------------------------------------
/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | Builds, tests, and runs the project danfeintegranfe.
12 |
13 |
73 |
74 |
--------------------------------------------------------------------------------
/build/built-jar.properties:
--------------------------------------------------------------------------------
1 | #Tue, 05 Jan 2016 15:33:35 -0200
2 |
3 |
4 | /home/junior/NetBeansProjects/danfeintegranfe=
5 |
--------------------------------------------------------------------------------
/build/classes/danfenfe/DanfeNfe.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/build/classes/danfenfe/DanfeNfe.class
--------------------------------------------------------------------------------
/build/classes/danfenfe/Item.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/build/classes/danfenfe/Item.class
--------------------------------------------------------------------------------
/dist/README.TXT:
--------------------------------------------------------------------------------
1 | ========================
2 | BUILD OUTPUT DESCRIPTION
3 | ========================
4 |
5 | When you build an Java application project that has a main class, the IDE
6 | automatically copies all of the JAR
7 | files on the projects classpath to your projects dist/lib folder. The IDE
8 | also adds each of the JAR files to the Class-Path element in the application
9 | JAR files manifest file (MANIFEST.MF).
10 |
11 | To run the project from the command line, go to the dist folder and
12 | type the following:
13 |
14 | java -jar danfe/danfeintegranfe.jar nfse.xml p=nfse tomador='nome_fantasia_tomador' prestador='nome_fantasia_prestador'
15 |
16 | To distribute this project, zip up the dist folder (including the lib folder)
17 | and distribute the ZIP file.
18 |
19 | Notes:
20 |
21 | * If two JAR files on the project classpath have the same name, only the first
22 | JAR file is copied to the lib folder.
23 | * Only JAR files are copied to the lib folder.
24 | If the classpath contains other types of files or folders, these files (folders)
25 | are not copied.
26 | * If a library on the projects classpath also has a Class-Path element
27 | specified in the manifest,the content of the Class-Path element has to be on
28 | the projects runtime path.
29 | * To set a main class in a standard Java project, right-click the project node
30 | in the Projects window and choose Properties. Then click Run and enter the
31 | class name in the Main Class field. Alternatively, you can manually type the
32 | class name in the manifest Main-Class element.
33 |
--------------------------------------------------------------------------------
/dist/README.TXT~:
--------------------------------------------------------------------------------
1 | ========================
2 | BUILD OUTPUT DESCRIPTION
3 | ========================
4 |
5 | When you build an Java application project that has a main class, the IDE
6 | automatically copies all of the JAR
7 | files on the projects classpath to your projects dist/lib folder. The IDE
8 | also adds each of the JAR files to the Class-Path element in the application
9 | JAR files manifest file (MANIFEST.MF).
10 |
11 | To run the project from the command line, go to the dist folder and
12 | type the following:
13 |
14 | java -jar "danfeintegranfe.jar"
15 |
16 | To distribute this project, zip up the dist folder (including the lib folder)
17 | and distribute the ZIP file.
18 |
19 | Notes:
20 |
21 | * If two JAR files on the project classpath have the same name, only the first
22 | JAR file is copied to the lib folder.
23 | * Only JAR files are copied to the lib folder.
24 | If the classpath contains other types of files or folders, these files (folders)
25 | are not copied.
26 | * If a library on the projects classpath also has a Class-Path element
27 | specified in the manifest,the content of the Class-Path element has to be on
28 | the projects runtime path.
29 | * To set a main class in a standard Java project, right-click the project node
30 | in the Projects window and choose Properties. Then click Run and enter the
31 | class name in the Main Class field. Alternatively, you can manually type the
32 | class name in the manifest Main-Class element.
33 |
--------------------------------------------------------------------------------
/dist/danfe/brasao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/danfe/brasao.png
--------------------------------------------------------------------------------
/dist/danfe/danfe_nfce_58.jasper:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/danfe/danfe_nfce_58.jasper
--------------------------------------------------------------------------------
/dist/danfe/danfe_nfce_58.jrxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 | 0) ? $P{dest}.get(0):" CONSUMIDOR NÃO IDENTIFICADO"]]>
460 |
461 |
462 |
463 |
464 |
465 |
466 | 10) ? "\n"+$P{nota}.get(10) : "")]]>
467 |
468 |
469 |
470 |
471 |
--------------------------------------------------------------------------------
/dist/danfe/danfe_nfce_80.jasper:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/danfe/danfe_nfce_80.jasper
--------------------------------------------------------------------------------
/dist/danfe/danfe_nfce_80.jrxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 | 0) ? $P{dest}.get(0):" CONSUMIDOR NÃO IDENTIFICADO"]]>
468 |
469 |
470 |
471 |
472 |
473 |
474 | 10) ? "\n"+$P{nota}.get(10) : "")]]>
475 |
476 |
477 |
478 |
479 |
--------------------------------------------------------------------------------
/dist/danfe/danfe_nfce_A4.jasper:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/danfe/danfe_nfce_A4.jasper
--------------------------------------------------------------------------------
/dist/danfe/danfe_nfce_A4.jrxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 | 0) ? $P{dest}.get(0):" CONSUMIDOR NÃO IDENTIFICADO"]]>
402 |
403 |
404 |
405 |
406 |
407 |
408 | 10) ? "\n"+$P{nota}.get(10) : "")]]>
409 |
410 |
411 |
412 |
413 |
--------------------------------------------------------------------------------
/dist/danfe/danfe_nfse.jasper:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/danfe/danfe_nfse.jasper
--------------------------------------------------------------------------------
/dist/danfe/ginfes_danfe_nfse.jrxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 |
811 |
812 |
813 |
814 |
815 |
816 |
817 |
818 |
819 |
820 |
821 |
822 |
823 |
824 |
825 |
826 |
827 |
828 |
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 |
837 |
838 |
839 |
840 |
841 |
842 |
843 |
844 |
845 |
846 |
847 |
848 |
849 |
850 |
851 |
852 |
853 |
854 |
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 |
863 |
864 |
865 |
866 |
867 |
868 |
869 |
870 |
871 |
872 |
873 |
874 |
875 |
876 |
877 |
878 |
879 |
880 |
881 |
882 |
883 |
884 |
885 |
886 |
887 |
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 |
896 |
897 |
898 |
899 |
900 |
901 |
902 |
903 |
904 |
905 |
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 |
929 |
930 |
931 |
932 |
933 |
934 |
935 |
936 |
937 |
938 |
939 |
940 |
941 |
942 |
943 |
944 |
945 |
946 |
947 |
948 |
949 |
950 |
951 |
952 |
953 |
954 |
955 |
956 |
957 |
958 |
959 |
960 |
961 |
962 |
963 |
964 |
965 |
966 |
967 |
968 |
969 |
970 |
971 |
972 |
973 |
974 |
975 |
976 |
977 |
978 |
979 |
980 |
981 |
982 |
983 |
984 |
985 |
986 |
987 |
988 |
989 |
990 |
991 |
992 |
993 |
994 |
995 |
996 |
997 |
998 |
999 |
1000 |
1001 |
1002 |
1003 |
1004 |
1005 |
1006 |
1007 |
1008 |
1009 |
1010 |
1011 |
1012 |
1013 |
1014 |
1015 |
1016 |
1017 |
1018 |
1019 |
1020 |
1021 |
1022 |
1023 |
1024 |
1025 |
1026 |
1027 |
1028 |
1029 |
1030 |
1031 |
1032 |
1033 |
1034 |
1035 |
1036 |
1037 |
1038 |
1039 |
1040 |
1041 |
1042 |
1043 |
1044 |
1045 |
1046 |
1047 |
1048 |
1049 |
1050 |
1051 |
1052 |
1053 |
1054 |
1055 |
1056 |
1057 |
1058 |
1059 |
1060 |
1061 |
1062 |
1063 |
1064 |
1065 |
1066 |
1067 |
1068 |
1069 |
1070 |
1071 |
1072 |
1073 |
1074 |
1075 |
1076 |
1077 |
1078 |
1079 |
1080 |
1081 |
1082 |
1083 |
1084 |
1085 |
1086 |
1087 |
1088 |
1089 |
1090 |
1091 |
1092 |
1093 |
1094 |
1095 |
1096 |
1097 |
1098 |
1099 |
1100 |
1101 |
1102 |
1103 |
1104 |
1105 |
1106 |
1107 |
1108 |
1109 |
1110 |
1111 |
1112 |
1113 |
1114 |
1115 |
1116 |
1117 |
1118 |
1119 |
1120 |
1121 |
1122 |
1123 |
1124 |
1125 |
1126 |
1127 |
1128 |
1129 |
1130 |
1131 |
1132 |
1133 |
1134 |
1135 |
1136 |
1137 |
1138 |
1139 |
1140 |
1141 |
1142 |
1143 |
1144 |
1145 |
1146 |
1147 |
1148 |
1149 |
1150 |
1151 |
1152 |
1153 |
1154 |
1155 |
1156 |
1157 |
1158 |
1159 |
1160 |
1161 |
1162 |
1163 |
1164 |
1165 |
1166 |
1167 |
1168 |
1169 |
1170 |
1171 |
1172 |
1173 |
1174 |
1175 |
1176 |
1177 |
1178 |
1179 |
1180 |
1181 |
1182 |
1183 |
1184 |
1185 |
1186 |
1187 |
1188 |
1189 |
1190 |
1191 |
1192 |
1193 |
1194 |
1195 |
1196 |
1197 |
1198 |
1199 |
1200 |
1201 |
1202 |
1203 |
1204 |
1205 |
1206 |
1207 |
1208 |
1209 |
1210 |
1211 |
1212 |
1213 |
1214 |
1215 |
1216 |
1217 |
1218 |
1219 |
1220 |
1221 |
1222 |
1223 |
1224 |
1225 |
1226 |
1227 |
1228 |
1229 |
1230 |
1231 |
1232 |
1233 |
1234 |
1235 |
1236 |
1237 |
1238 |
1239 |
1240 |
1241 |
1242 |
1243 |
1244 |
1245 |
1246 |
1247 |
1248 |
1249 |
1250 |
1251 |
1252 |
1253 |
1254 |
1255 |
1256 |
1257 |
1258 |
1259 |
1260 |
1261 |
1262 |
1263 |
1264 |
1265 |
1266 |
1267 |
1268 |
1269 |
1270 |
1271 |
1272 |
1273 |
1274 |
1275 |
1276 |
1277 |
1278 |
1279 |
1280 |
1281 |
1282 |
1283 |
1284 |
1285 |
1286 |
1287 |
1288 |
1289 |
1290 |
1291 |
1292 |
1293 |
1294 |
1295 |
1296 |
1297 |
1298 |
1299 |
1300 |
1301 |
1302 |
1303 |
1304 |
1305 |
1306 |
1307 |
1308 |
1309 |
1310 |
1311 |
1312 |
1313 |
1314 |
1315 |
1316 |
1317 |
1318 |
1319 |
1320 |
1321 |
1322 |
1323 |
1324 |
1325 |
1326 |
1327 |
1328 |
1329 |
1330 |
1331 |
1334 |
1335 |
1336 |
1337 |
1338 |
1339 |
1340 |
1341 |
1342 |
1343 |
1344 |
1345 |
1346 |
1347 |
1348 |
1349 |
1350 |
1351 |
1352 |
1353 |
1354 |
1355 |
1356 |
1357 |
1358 |
1359 |
1360 |
1361 |
1362 |
1363 |
1364 |
1365 |
1366 |
1367 |
1368 |
1369 |
1370 |
1371 |
1372 |
1373 |
1374 |
1375 |
1376 |
1377 |
1378 |
1379 |
1380 |
1381 |
1382 |
1383 |
1384 |
1385 |
1386 |
1387 |
1388 |
1389 |
1390 |
1391 |
1392 |
1393 |
1394 |
1395 |
1396 |
1397 |
1398 |
1399 |
1400 |
1401 |
--------------------------------------------------------------------------------
/dist/danfeintegranfe.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/danfeintegranfe.jar
--------------------------------------------------------------------------------
/dist/lib/barbecue-1.5-beta1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/barbecue-1.5-beta1.jar
--------------------------------------------------------------------------------
/dist/lib/barcode4j.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/barcode4j.jar
--------------------------------------------------------------------------------
/dist/lib/batik-all-1.8pre-r1084380.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/batik-all-1.8pre-r1084380.jar
--------------------------------------------------------------------------------
/dist/lib/commons-beanutils-1.9.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/commons-beanutils-1.9.0.jar
--------------------------------------------------------------------------------
/dist/lib/commons-collections-3.2.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/commons-collections-3.2.1.jar
--------------------------------------------------------------------------------
/dist/lib/commons-digester-2.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/commons-digester-2.1.jar
--------------------------------------------------------------------------------
/dist/lib/commons-logging-1.1.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/commons-logging-1.1.1.jar
--------------------------------------------------------------------------------
/dist/lib/iText-2.1.7.js2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/iText-2.1.7.js2.jar
--------------------------------------------------------------------------------
/dist/lib/jasperreports-6.1.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/jasperreports-6.1.0.jar
--------------------------------------------------------------------------------
/dist/lib/jasperreports-fonts-6.1.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/jasperreports-fonts-6.1.0.jar
--------------------------------------------------------------------------------
/dist/lib/jasperreports-javaflow-6.1.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/jasperreports-javaflow-6.1.0.jar
--------------------------------------------------------------------------------
/dist/lib/org.w3c.css.sac-1.3.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/org.w3c.css.sac-1.3.0.jar
--------------------------------------------------------------------------------
/dist/lib/w3c.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/w3c.jar
--------------------------------------------------------------------------------
/dist/lib/xalan.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/xalan.jar
--------------------------------------------------------------------------------
/dist/lib/zxing-2.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/juniortada/Java-Danfe/6622edee77ff2407e6d85aeb517138d63e3d5f6b/dist/lib/zxing-2.1.jar
--------------------------------------------------------------------------------
/manifest.mf:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.0
2 | X-COMMENT: Main-Class will be added automatically by build
3 |
4 |
--------------------------------------------------------------------------------
/nbproject/genfiles.properties:
--------------------------------------------------------------------------------
1 | build.xml.data.CRC32=2f176e96
2 | build.xml.script.CRC32=56bab9cf
3 | build.xml.stylesheet.CRC32=8064a381@1.75.2.48
4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6 | nbproject/build-impl.xml.data.CRC32=2f176e96
7 | nbproject/build-impl.xml.script.CRC32=07197e27
8 | nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48
9 |
--------------------------------------------------------------------------------
/nbproject/private/private.properties:
--------------------------------------------------------------------------------
1 | compile.on.save=true
2 | user.properties.file=/home/junior/.netbeans/8.0/build.properties
3 |
--------------------------------------------------------------------------------
/nbproject/private/private.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | file:/home/junior/NetBeansProjects/danfeintegranfe/src/danfenfe/DanfeNfe.java
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/nbproject/project.properties:
--------------------------------------------------------------------------------
1 | annotation.processing.enabled=true
2 | annotation.processing.enabled.in.editor=false
3 | annotation.processing.processor.options=
4 | annotation.processing.processors.list=
5 | annotation.processing.run.all.processors=true
6 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
7 | build.classes.dir=${build.dir}/classes
8 | build.classes.excludes=**/*.java,**/*.form
9 | # This directory is removed when the project is cleaned:
10 | build.dir=build
11 | build.generated.dir=${build.dir}/generated
12 | build.generated.sources.dir=${build.dir}/generated-sources
13 | # Only compile against the classpath explicitly listed here:
14 | build.sysclasspath=ignore
15 | build.test.classes.dir=${build.dir}/test/classes
16 | build.test.results.dir=${build.dir}/test/results
17 | # Uncomment to specify the preferred debugger connection transport:
18 | #debug.transport=dt_socket
19 | debug.classpath=\
20 | ${run.classpath}
21 | debug.test.classpath=\
22 | ${run.test.classpath}
23 | # Os arquivos em build.classes.dir que devem ser exclu\u00eddos do jar de distribui\u00e7\u00e3o
24 | dist.archive.excludes=
25 | # This directory is removed when the project is cleaned:
26 | dist.dir=dist
27 | dist.jar=${dist.dir}/danfeintegranfe.jar
28 | dist.javadoc.dir=${dist.dir}/javadoc
29 | excludes=
30 | file.reference.barbecue-1.5-beta1.jar=../Bibliotecas e Jars/barbecue-1.5-beta1/barbecue-1.5-beta1.jar
31 | file.reference.barcode4j.jar=../Bibliotecas e Jars/barcode4j-2.1.0/build/barcode4j.jar
32 | file.reference.batik-all-1.8pre-r1084380.jar=../Bibliotecas e Jars/batik-all-1.8pre-r1084380.jar
33 | file.reference.commons-beanutils-1.9.0.jar=../relatorio/dist/lib/commons-beanutils-1.9.0.jar
34 | file.reference.commons-collections-3.2.1.jar=../relatorio/dist/lib/commons-collections-3.2.1.jar
35 | file.reference.commons-digester-2.1.jar=../relatorio/dist/lib/commons-digester-2.1.jar
36 | file.reference.commons-logging-1.1.1.jar=../relatorio/dist/lib/commons-logging-1.1.1.jar
37 | file.reference.iText-2.1.7.js2.jar=../relatorio/dist/lib/iText-2.1.7.js2.jar
38 | file.reference.jasperreports-6.1.0.jar=../Bibliotecas e Jars/iReports/jasperreporsts-6.1.0/jasperreports-6.1.0.jar
39 | file.reference.jasperreports-fonts-6.1.0.jar=../Bibliotecas e Jars/iReports/jasperreporsts-6.1.0/jasperreports-fonts-6.1.0.jar
40 | file.reference.jasperreports-javaflow-6.1.0.jar=../Bibliotecas e Jars/iReports/jasperreporsts-6.1.0/jasperreports-javaflow-6.1.0.jar
41 | file.reference.org.w3c.css.sac-1.3.0.jar=../Bibliotecas e Jars/org.w3c.css.sac-1.3.0.jar
42 | file.reference.w3c.jar=../Bibliotecas e Jars/w3c.jar
43 | file.reference.xalan.jar=/home/junior/NetBeansProjects/Bibliotecas e Jars/xalan-j_2_7_2/xalan.jar
44 | file.reference.zxing-2.1.jar=../Bibliotecas e Jars/zxing-2.1.jar
45 | includes=**
46 | jar.compress=false
47 | javac.classpath=\
48 | ${file.reference.jasperreports-6.1.0.jar}:\
49 | ${file.reference.jasperreports-fonts-6.1.0.jar}:\
50 | ${file.reference.jasperreports-javaflow-6.1.0.jar}:\
51 | ${file.reference.commons-beanutils-1.9.0.jar}:\
52 | ${file.reference.commons-collections-3.2.1.jar}:\
53 | ${file.reference.commons-digester-2.1.jar}:\
54 | ${file.reference.commons-logging-1.1.1.jar}:\
55 | ${file.reference.iText-2.1.7.js2.jar}:\
56 | ${file.reference.barcode4j.jar}:\
57 | ${file.reference.zxing-2.1.jar}:\
58 | ${file.reference.batik-all-1.8pre-r1084380.jar}:\
59 | ${file.reference.w3c.jar}:\
60 | ${file.reference.org.w3c.css.sac-1.3.0.jar}:\
61 | ${file.reference.barbecue-1.5-beta1.jar}:\
62 | ${file.reference.xalan.jar}
63 | # Space-separated list of extra javac options
64 | javac.compilerargs=
65 | javac.deprecation=false
66 | javac.processorpath=\
67 | ${javac.classpath}
68 | javac.source=1.8
69 | javac.target=1.8
70 | javac.test.classpath=\
71 | ${javac.classpath}:\
72 | ${build.classes.dir}
73 | javac.test.processorpath=\
74 | ${javac.test.classpath}
75 | javadoc.additionalparam=
76 | javadoc.author=false
77 | javadoc.encoding=${source.encoding}
78 | javadoc.noindex=false
79 | javadoc.nonavbar=false
80 | javadoc.notree=false
81 | javadoc.private=false
82 | javadoc.splitindex=true
83 | javadoc.use=true
84 | javadoc.version=false
85 | javadoc.windowtitle=
86 | main.class=danfenfe.DanfeNfe
87 | manifest.file=manifest.mf
88 | meta.inf.dir=${src.dir}/META-INF
89 | mkdist.disabled=false
90 | platform.active=default_platform
91 | run.classpath=\
92 | ${javac.classpath}:\
93 | ${build.classes.dir}
94 | # Space-separated list of JVM arguments used when running the project.
95 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
96 | # To set system properties for unit tests define test-sys-prop.name=value:
97 | run.jvmargs=
98 | run.test.classpath=\
99 | ${javac.test.classpath}:\
100 | ${build.test.classes.dir}
101 | source.encoding=UTF-8
102 | src.dir=src
103 | test.src.dir=test
104 |
--------------------------------------------------------------------------------
/nbproject/project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | org.netbeans.modules.java.j2seproject
4 |
5 |
6 | danfeintegranfe
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/danfenfe/DanfeNfe.java:
--------------------------------------------------------------------------------
1 |
2 | package danfenfe;
3 |
4 | import java.io.File;
5 | import java.io.IOException;
6 | import java.nio.file.Path;
7 | import java.nio.file.Paths;
8 | import java.text.ParseException;
9 | import java.text.SimpleDateFormat;
10 | import java.util.ArrayList;
11 | import java.util.Collection;
12 | import java.util.Date;
13 | import java.util.HashMap;
14 | import java.util.List;
15 | import javax.xml.parsers.DocumentBuilder;
16 | import javax.xml.parsers.DocumentBuilderFactory;
17 | import javax.xml.parsers.ParserConfigurationException;
18 | import net.sf.jasperreports.engine.JRDataSource;
19 | import net.sf.jasperreports.engine.JRException;
20 | import net.sf.jasperreports.engine.JasperCompileManager;
21 | import net.sf.jasperreports.engine.JasperExportManager;
22 | import net.sf.jasperreports.engine.JasperFillManager;
23 | import net.sf.jasperreports.engine.JasperPrint;
24 | import net.sf.jasperreports.engine.JasperReport;
25 | import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
26 | import net.sf.jasperreports.engine.data.JRXmlDataSource;
27 | import net.sf.jasperreports.engine.util.JRLoader;
28 | import org.w3c.dom.Document;
29 | import org.w3c.dom.Element;
30 | import org.w3c.dom.Node;
31 | import org.w3c.dom.NodeList;
32 | import org.xml.sax.SAXException;
33 |
34 | /**
35 | *
36 | * @author Junior Tada
37 | *
38 | * Ex: java -jar danfenfe.jar nfce_autorizada.xml
39 | */
40 |
41 | public class DanfeNfe {
42 |
43 | private static HashMap map = new HashMap();
44 |
45 | /**
46 | * @param args the command line arguments
47 | */
48 |
49 | public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException, ParseException{
50 | String xml_nfe = null;
51 | String qrcode = null;
52 | String p = null;
53 | String logo = null;
54 | String prestador_fantasia = "";
55 | String tomador_fantasia = "";
56 | String path = System.getProperty("user.dir");
57 | Path danfe_nfce_80 = Paths.get(path, "danfe","danfe_nfce_80.jasper");
58 | String url = danfe_nfce_80.toAbsolutePath().toString();
59 |
60 | // Default impressao em papel 80mm para quando for compilar
61 | // String jrxml = "/home/junior/JaspersoftWorkspace/MyReports/danfe_nfce_80.jrxml";
62 | for(String arg: args){
63 | if(arg.contains(".xml")){
64 | xml_nfe = arg;
65 | }
66 | if(arg.contains("qrcode=")){
67 | qrcode = arg.replace("qrcode=", "");
68 | }
69 | if(arg.contains("url=")){
70 | url = arg.replace("url=", "");
71 | }
72 | if(arg.contains("logo=")){
73 | logo = arg.replace("logo=", "");
74 | }
75 | if(arg.contains("prestador=")){
76 | prestador_fantasia = arg.replace("prestador=", "");
77 | }
78 | if(arg.contains("tomador=")){
79 | // nome fantasia do tomador/cliente
80 | tomador_fantasia = arg.replace("tomador=", "");
81 | }
82 | if(arg.contains("p=")){
83 | p = arg.replace("p=", "");
84 | switch (p){
85 | case "58mm":
86 | //jrxml = "/home/junior/JaspersoftWorkspace/MyReports/danfe_nfce_58.jrxml";
87 | Path danfe_nfce_58 = Paths.get(path, "danfe","danfe_nfce_58.jasper");
88 | url = danfe_nfce_58.toAbsolutePath().toString();
89 | break;
90 | case "A4":
91 | //jrxml = "/home/junior/JaspersoftWorkspace/MyReports/danfe_nfce_A4.jrxml";
92 | Path danfe_nfce_A4 = Paths.get(path, "danfe","danfe_nfce_A4.jasper");
93 | url = danfe_nfce_A4.toAbsolutePath().toString();
94 | break;
95 | case "nfe":
96 | //nfe A4 retrato
97 | Path nfe = Paths.get(path, "danfe","danfeR.jasper");
98 | url = nfe.toAbsolutePath().toString();
99 | // teste
100 | //url = "/home/junior/JaspersoftWorkspace/MyReports/danfeR.jasper";
101 | break;
102 | case "nfse":
103 | //nfse A4 retrato
104 | Path nfse = Paths.get(path, "danfe","danfe_nfse.jasper");
105 | url = nfse.toAbsolutePath().toString();
106 | break;
107 | default:
108 | //jrxml = "/home/junior/JaspersoftWorkspace/MyReports/danfe_nfce_80.jrxml";
109 | url = danfe_nfce_80.toAbsolutePath().toString();
110 | break;
111 | }
112 | }
113 | }
114 | // Leitura de arquivo para xml de nfe
115 | if(!p.equals("nfse")){
116 | File inputFile = new File(xml_nfe);
117 | DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
118 | DocumentBuilder builder = factory.newDocumentBuilder();
119 | Document xml = builder.parse(inputFile);
120 | xml.getDocumentElement().normalize();
121 | // Dados do emitente
122 | NodeList emitList = xml.getElementsByTagName("emit");
123 | Node emitNode = emitList.item(0);
124 | Element emitElement = (Element) emitNode;
125 | List emit = new ArrayList<>();
126 | emit.add(emitElement.getElementsByTagName("xNome").item(0).getTextContent());
127 | emit.add(emitElement.getElementsByTagName("CNPJ").item(0).getTextContent());
128 | emit.add(emitElement.getElementsByTagName("IE").item(0).getTextContent());
129 | emit.add(emitElement.getElementsByTagName("xLgr").item(0).getTextContent());
130 | emit.add(emitElement.getElementsByTagName("nro").item(0).getTextContent());
131 | emit.add(emitElement.getElementsByTagName("xBairro").item(0).getTextContent());
132 | emit.add(emitElement.getElementsByTagName("xMun").item(0).getTextContent());
133 | emit.add(emitElement.getElementsByTagName("UF").item(0).getTextContent());
134 | emit.add(emitElement.getElementsByTagName("CEP").item(0).getTextContent());
135 | //for(int i = 0; i < emit.size(); i++){
136 | // System.out.println(emit.get(i)+" "+i);
137 | //}
138 | List dest = new ArrayList<>();
139 |
140 | // Dados do Destinatário
141 | NodeList destList = xml.getElementsByTagName("dest");
142 | if(destList.getLength() > 0){
143 | Node destNode = destList.item(0);
144 | Element destElement = (Element) destNode;
145 | try {
146 | dest.add("CPF: "+destElement.getElementsByTagName("CPF").item(0).getTextContent());
147 | } catch (Exception e) {
148 | dest.add("CNPJ: "+destElement.getElementsByTagName("CNPJ").item(0).getTextContent());
149 | }
150 | if(p.equalsIgnoreCase("nfe")){
151 | dest.add(destElement.getElementsByTagName("xNome").item(0).getTextContent());
152 | dest.add(destElement.getElementsByTagName("xLgr").item(0).getTextContent());
153 | dest.add(destElement.getElementsByTagName("nro").item(0).getTextContent());
154 | dest.add(destElement.getElementsByTagName("xBairro").item(0).getTextContent());
155 | dest.add(destElement.getElementsByTagName("xMun").item(0).getTextContent());
156 | dest.add(destElement.getElementsByTagName("UF").item(0).getTextContent());
157 | dest.add(destElement.getElementsByTagName("CEP").item(0).getTextContent());
158 | }
159 |
160 | //for(int i = 0; i < dest.size(); i++){
161 | // System.out.println(dest.get(i)+" "+i);
162 | //}
163 | }
164 |
165 | // Dados dos Itens
166 | Collection - itens = new ArrayList
- ();
167 | NodeList itensList = xml.getElementsByTagName("det");
168 | for(int i = 0; i < itensList.getLength(); i++){
169 | Node itensNode = itensList.item(i);
170 | Element itensElement = (Element) itensNode;
171 | Item item = new Item();
172 | item.setCodigo(itensElement.getElementsByTagName("cProd").item(0).getTextContent());
173 | item.setDescricao(itensElement.getElementsByTagName("xProd").item(0).getTextContent());
174 | item.setNcm(itensElement.getElementsByTagName("NCM").item(0).getTextContent());
175 | item.setCfop(itensElement.getElementsByTagName("CFOP").item(0).getTextContent());
176 | item.setQuantidade(itensElement.getElementsByTagName("qCom").item(0).getTextContent());
177 | item.setUnidade(itensElement.getElementsByTagName("uCom").item(0).getTextContent());
178 | item.setTotal(itensElement.getElementsByTagName("vUnCom").item(0).getTextContent());
179 | item.setValor(itensElement.getElementsByTagName("vProd").item(0).getTextContent());
180 | // csosn
181 | item.setCsosn(itensElement.getElementsByTagName("CSOSN").item(0).getTextContent());
182 | itens.add(item);
183 | }
184 | JRDataSource jr = new JRBeanCollectionDataSource(itens);
185 | // Dados da nota
186 | List nota = new ArrayList<>();
187 | // Total
188 | NodeList totList = xml.getElementsByTagName("ICMSTot");
189 | Node totNode = totList.item(0);
190 | Element totElement = (Element) totNode;
191 | nota.add(totElement.getElementsByTagName("vNF").item(0).getTextContent());
192 | // Numero, Serie, Emissao
193 | NodeList ideList = xml.getElementsByTagName("ide");
194 | Node ideNode = ideList.item(0);
195 | Element ideElement = (Element) ideNode;
196 | nota.add(ideElement.getElementsByTagName("nNF").item(0).getTextContent()); // Numero
197 | nota.add(ideElement.getElementsByTagName("serie").item(0).getTextContent()); // serie
198 | String data = ideElement.getElementsByTagName("dhEmi").item(0).getTextContent();
199 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
200 | SimpleDateFormat f = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
201 | Date date = sdf.parse(data);
202 | nota.add(f.format(date)); // Data/hora
203 | // Chave, Protocolo, Data/Hora Autorização
204 | NodeList protList = xml.getElementsByTagName("infProt");
205 | Node protNode = protList.item(0);
206 | Element protElement = (Element) protNode;
207 | nota.add(protElement.getElementsByTagName("chNFe").item(0).getTextContent()); // Chave
208 | nota.add(protElement.getElementsByTagName("nProt").item(0).getTextContent()); // Protocolo
209 | String dhRecbto = protElement.getElementsByTagName("dhRecbto").item(0).getTextContent();
210 | Date data_recibo = sdf.parse(dhRecbto);
211 | nota.add(f.format(data_recibo)); // Data/Hora recibo
212 | // Pagamento
213 | NodeList pagList = xml.getElementsByTagName("pag");
214 | Node pagNode = pagList.item(0);
215 | Element pagElement = (Element) pagNode;
216 | // Grupo obrigatório para a NFC-e, a critério da UF. Não informar para a NF-e.
217 | String tPag = "";
218 | try {
219 | tPag = pagElement.getElementsByTagName("tPag").item(0).getTextContent();
220 | switch (tPag){
221 | case "01":
222 | tPag = "Dinheiro";
223 | break;
224 | case "02":
225 | tPag = "Cheque";
226 | break;
227 | case "03":
228 | tPag = "Cartão de Crédito";
229 | break;
230 | case "04":
231 | tPag = "Cartão de Débito";
232 | break;
233 | case "05":
234 | tPag = "Crédito Loja";
235 | break;
236 | case "10":
237 | tPag = "Vale Alimentação";
238 | break;
239 | case "11":
240 | tPag = "Vale Refeição";
241 | break;
242 | case "12":
243 | tPag = "Vale Presente";
244 | break;
245 | case "13":
246 | tPag = "Vale Combustível";
247 | break;
248 | case "99":
249 | tPag = "Outros";
250 | break;
251 | default:
252 | tPag = "Outros";
253 |
254 | }
255 | } catch (Exception e) {
256 | System.out.println("Grupo obrigatório para a NFC-e, a critério da UF. Não informar para a NF-e: " + e);
257 | }
258 | nota.add(tPag);
259 | nota.add(itens.size()+"");
260 |
261 | // Tributos aprox
262 | try {
263 | nota.add(totElement.getElementsByTagName("vTotTrib").item(0).getTextContent());
264 | } catch (Exception e) {
265 | System.out.println("Valor total de tributos: " + e);
266 | }
267 | // Informação adicional
268 | try {
269 | NodeList infoList = xml.getElementsByTagName("infAdic");
270 | Node infoNode = infoList.item(0);
271 | Element infoElement = (Element) infoNode;
272 | nota.add(infoElement.getElementsByTagName("infAdFisco").item(0).getTextContent());
273 | } catch (Exception e) {
274 | nota.add("");
275 | System.out.println("Informação adicional: " + e);
276 | }
277 |
278 |
279 | //for(int z = 0; z < nota.size(); z++){
280 | // System.out.println(nota.get(z)+" "+z);
281 | //}
282 | // Dante NF-e
283 | // java -jar nota_autorizada.xml p=nfe
284 | if(p.equalsIgnoreCase("nfe")){
285 | gerarDanfeNFe(url, emit, dest, nota, jr);
286 | }
287 | // Danfe NFC-e
288 | else{
289 | gerarDanfe(url, emit, dest, nota, jr, qrcode);
290 | }
291 | }
292 | // Leitura de arquivo xml para nfse
293 | else{
294 | File inputFile = new File(xml_nfe);
295 | DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
296 | DocumentBuilder builder = factory.newDocumentBuilder();
297 | Document xml = builder.parse(inputFile);
298 | xml.getDocumentElement().normalize();
299 |
300 | // Dados do prestador
301 | NodeList emitList = xml.getElementsByTagName("PrestadorServico");
302 | Node emitNode = emitList.item(0);
303 | Element emitElement = (Element) emitNode;
304 | List emit = new ArrayList<>();
305 | emit.add(emitElement.getElementsByTagName("Cnpj").item(0).getTextContent());
306 | emit.add(emitElement.getElementsByTagName("InscricaoMunicipal").item(0).getTextContent());
307 | emit.add(emitElement.getElementsByTagName("RazaoSocial").item(0).getTextContent());
308 | emit.add(emitElement.getElementsByTagName("Endereco").item(1).getTextContent());
309 | emit.add(emitElement.getElementsByTagName("Numero").item(0).getTextContent());
310 | emit.add(emitElement.getElementsByTagName("Bairro").item(0).getTextContent());
311 | if(emitElement.getElementsByTagName("CodigoMunicipio").item(0).getTextContent().equals("3525904")){
312 | emit.add("Jundiaí");
313 | }
314 | else{
315 | emit.add(emitElement.getElementsByTagName("CodigoMunicipio").item(0).getTextContent());
316 | }
317 | emit.add(emitElement.getElementsByTagName("Uf").item(0).getTextContent());
318 | emit.add(emitElement.getElementsByTagName("Cep").item(0).getTextContent());
319 | emit.add(emitElement.getElementsByTagName("Telefone").item(0).getTextContent());
320 | emit.add(emitElement.getElementsByTagName("Email").item(0).getTextContent());
321 | // Nome Fantasia Prestador
322 | emit.add(prestador_fantasia);
323 | // Debug
324 | // System.out.println("Prestador");
325 | // for(int i = 0; i < emit.size(); i++){
326 | // System.out.println(emit.get(i)+" "+i);
327 | // }
328 |
329 | // Dados do tomador
330 | NodeList destList = xml.getElementsByTagName("TomadorServico");
331 | Node destNode = destList.item(0);
332 | Element destElement = (Element) destNode;
333 | List dest = new ArrayList<>();
334 | dest.add(destElement.getElementsByTagName("Cnpj").item(0).getTextContent());
335 | dest.add(destElement.getElementsByTagName("InscricaoMunicipal").item(0).getTextContent());
336 | dest.add(destElement.getElementsByTagName("RazaoSocial").item(0).getTextContent());
337 | dest.add(destElement.getElementsByTagName("Endereco").item(1).getTextContent());
338 | dest.add(destElement.getElementsByTagName("Numero").item(0).getTextContent());
339 | dest.add(destElement.getElementsByTagName("Bairro").item(0).getTextContent());
340 | if(destElement.getElementsByTagName("CodigoMunicipio").item(0).getTextContent().equals("3525904")){
341 | dest.add("Jundiaí");
342 | }
343 | else{
344 | dest.add(destElement.getElementsByTagName("CodigoMunicipio").item(0).getTextContent());
345 | }
346 | dest.add(destElement.getElementsByTagName("Uf").item(0).getTextContent());
347 | dest.add(destElement.getElementsByTagName("Cep").item(0).getTextContent());
348 | dest.add(destElement.getElementsByTagName("Telefone").item(0).getTextContent());
349 | dest.add(destElement.getElementsByTagName("Email").item(0).getTextContent());
350 | // Nome fantasia tomador
351 | dest.add(tomador_fantasia);
352 | // Debug
353 | // System.out.println("Tomador");
354 | // for(int i = 0; i < dest.size(); i++){
355 | // System.out.println(dest.get(i)+" "+i);
356 | // }
357 |
358 | // Dados do serviço
359 | NodeList serList = xml.getElementsByTagName("Servico");
360 | Node serNode = serList.item(0);
361 | Element serElement = (Element) serNode;
362 | List ser = new ArrayList<>();
363 | ser.add(serElement.getElementsByTagName("ValorServicos").item(0).getTextContent());
364 | ser.add(serElement.getElementsByTagName("IssRetido").item(0).getTextContent());
365 | ser.add(serElement.getElementsByTagName("ValorIss").item(0).getTextContent());
366 | ser.add(serElement.getElementsByTagName("ValorIssRetido").item(0).getTextContent());
367 | ser.add(serElement.getElementsByTagName("BaseCalculo").item(0).getTextContent());
368 | ser.add(serElement.getElementsByTagName("Aliquota").item(0).getTextContent());
369 | ser.add(serElement.getElementsByTagName("ValorLiquidoNfse").item(0).getTextContent());
370 | ser.add(serElement.getElementsByTagName("ItemListaServico").item(0).getTextContent());
371 | ser.add(serElement.getElementsByTagName("CodigoTributacaoMunicipio").item(0).getTextContent());
372 | ser.add(serElement.getElementsByTagName("Discriminacao").item(0).getTextContent());
373 | ser.add(serElement.getElementsByTagName("CodigoMunicipio").item(0).getTextContent());
374 | // Debug
375 | //System.out.println("Serviço");
376 | //for(int i = 0; i < ser.size(); i++){
377 | // System.out.println(ser.get(i)+" "+i);
378 | //}
379 |
380 | // Dados da nota
381 | NodeList notaList = xml.getElementsByTagName("InfNfse");
382 | Node notaNode = notaList.item(0);
383 | Element notaElement = (Element) notaNode;
384 | List nota = new ArrayList<>();
385 | nota.add(notaElement.getElementsByTagName("Numero").item(0).getTextContent());
386 | nota.add(notaElement.getElementsByTagName("CodigoVerificacao").item(0).getTextContent());
387 | // Ajusta data/hora emissão
388 | String data_xml = notaElement.getElementsByTagName("DataEmissao").item(0).getTextContent();
389 | SimpleDateFormat data_entrada = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
390 | SimpleDateFormat data_saida = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
391 | Date date = data_entrada.parse(data_xml);
392 | nota.add(data_saida.format(date));
393 | nota.add(notaElement.getElementsByTagName("NaturezaOperacao").item(0).getTextContent());
394 | nota.add(notaElement.getElementsByTagName("RegimeEspecialTributacao").item(0).getTextContent());
395 | nota.add(notaElement.getElementsByTagName("OptanteSimplesNacional").item(0).getTextContent());
396 | nota.add(notaElement.getElementsByTagName("IncentivadorCultural").item(0).getTextContent());
397 | // Ajusta data Competência
398 | String data_c = notaElement.getElementsByTagName("Competencia").item(0).getTextContent();
399 | SimpleDateFormat data_c_entrada = new SimpleDateFormat("yyyy-MM-dd");
400 | SimpleDateFormat data_c_saida = new SimpleDateFormat("dd/MM/yyyy");
401 | Date data_competencia = data_c_entrada.parse(data_c);
402 | nota.add(data_c_saida.format(data_competencia));
403 | // Debug
404 | // System.out.println("Nota");
405 | // for(int i = 0; i < nota.size(); i++){
406 | // System.out.println(nota.get(i)+" "+i);
407 | // }
408 |
409 | // Gera o danfe com jasper
410 | gerarDanfeNfse(url, emit, dest, ser, nota, xml_nfe, logo);
411 | }
412 | }
413 |
414 | // Cria o Danfe com os dados do xml
415 | private static void gerarDanfe(String url, List emit, List dest, List nota, JRDataSource itens, String qrcode){
416 | try {
417 | // Teste
418 | //String compilado = System.getProperty("user.dir") + "/danfe_nfce_80.jasper";;
419 | String output = "danfe.pdf";
420 | map.put("emit", emit);
421 | map.put("dest", dest);
422 | map.put("nota", nota);
423 | map.put("qrcode", qrcode);
424 | // Relatório compilado
425 | JasperReport report = (JasperReport) JRLoader.loadObjectFromFile(url);
426 | //InputStream jasperStream = getClass().getResourceAsStream("/Foo.jasper");
427 | //JasperReport report = (JasperReport) JRLoader.loadObject(jasperStream);
428 | // Relatório nao compilado
429 | //JasperReport report = JasperCompileManager.compileReport(jrxml);
430 | JasperPrint print = JasperFillManager.fillReport(report, map, itens);
431 | JasperExportManager.exportReportToPdfFile(print, output);
432 | } catch (JRException e) {
433 | System.out.println("erro: "+e.getMessage());
434 | }
435 | }
436 |
437 | private static void gerarDanfeNFe(String url, List emit, List dest, List nota, JRDataSource itens) {
438 | try {
439 | // Teste
440 | //String compilado = System.getProperty("user.dir") + "/danfe_nfce_80.jasper";;
441 | String output = "danfe.pdf";
442 | map.put("emit", emit);
443 | map.put("dest", dest);
444 | map.put("nota", nota);
445 | // Relatório compilado
446 | JasperReport report = (JasperReport) JRLoader.loadObjectFromFile(url);
447 | JasperPrint print = JasperFillManager.fillReport(report, map, itens);
448 | JasperExportManager.exportReportToPdfFile(print, output);
449 | } catch (JRException e) {
450 | System.out.println("erro: "+e.getMessage());
451 | }
452 | }
453 |
454 | private static void gerarDanfeNfse(String url, List emit, List dest, List ser, List nota, String xml, String logo) {
455 | try {
456 | // Teste
457 | //String compilado = System.getProperty("user.dir") + "/danfe_nfce_80.jasper";;
458 | String output = "danfe.pdf";
459 | map.put("emit", emit);
460 | map.put("dest", dest);
461 | map.put("ser", ser);
462 | map.put("nota", nota);
463 | map.put("logo", logo);
464 | // brasao
465 | String brasao = Paths.get(System.getProperty("user.dir"), "danfe","brasao.png").toAbsolutePath().toString();
466 | map.put("brasao", brasao);
467 | // JrDataSource
468 | JRDataSource jr = new JRXmlDataSource(xml);
469 | // Relatório compilado
470 | JasperReport report = (JasperReport) JRLoader.loadObjectFromFile(url);
471 | JasperPrint print = JasperFillManager.fillReport(report, map, jr);
472 | JasperExportManager.exportReportToPdfFile(print, output);
473 | } catch (JRException e) {
474 | System.out.println("erro: "+e.getMessage());
475 | }
476 | }
477 |
478 | }
479 |
--------------------------------------------------------------------------------
/src/danfenfe/Item.java:
--------------------------------------------------------------------------------
1 |
2 | package danfenfe;
3 |
4 | /**
5 | *
6 | * @author Junior Tada
7 | */
8 |
9 | public class Item {
10 |
11 | private String codigo;
12 | private String descricao;
13 | private String quantidade;
14 | private String ncm;
15 | private String cfop;
16 | private String csosn;
17 | private String unidade;
18 | private String valor;
19 | private String total;
20 |
21 | public String getCodigo() {
22 | return codigo;
23 | }
24 |
25 | public void setCodigo(String codigo) {
26 | this.codigo = codigo;
27 | }
28 |
29 | public String getDescricao() {
30 | return descricao;
31 | }
32 |
33 | public void setDescricao(String descricao) {
34 | this.descricao = descricao;
35 | }
36 |
37 | public String getQuantidade() {
38 | return quantidade;
39 | }
40 |
41 | public void setQuantidade(String quantidade) {
42 | this.quantidade = quantidade;
43 | }
44 |
45 | public String getNcm() {
46 | return ncm;
47 | }
48 |
49 | public void setNcm(String ncm) {
50 | this.ncm = ncm;
51 | }
52 |
53 | public String getCfop() {
54 | return cfop;
55 | }
56 |
57 | public void setCfop(String cfop) {
58 | this.cfop = cfop;
59 | }
60 |
61 | public String getCsosn() {
62 | return csosn;
63 | }
64 |
65 | public void setCsosn(String csosn) {
66 | this.csosn = csosn;
67 | }
68 |
69 | public String getUnidade() {
70 | return unidade;
71 | }
72 |
73 | public void setUnidade(String unidade) {
74 | this.unidade = unidade;
75 | }
76 |
77 | public String getValor() {
78 | return valor;
79 | }
80 |
81 | public void setValor(String valor) {
82 | this.valor = valor;
83 | }
84 |
85 | public String getTotal() {
86 | return total;
87 | }
88 |
89 | public void setTotal(String total) {
90 | this.total = total;
91 | }
92 |
93 |
94 |
95 | }
96 |
--------------------------------------------------------------------------------