Generalizado el informe de egresos para que cree el necesitado segun su id

This commit is contained in:
Daniel Cortes
2019-01-16 23:50:39 -03:00
parent 0e0ffd96d2
commit 7b3a1148a1
11 changed files with 468 additions and 219 deletions

289
.idea/workspace.xml generated
View File

@@ -10,22 +10,19 @@
<bookmark url="file://$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeLibroDeVentas.java" line="107" mnemonic="0" /> <bookmark url="file://$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeLibroDeVentas.java" line="107" mnemonic="0" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="a633d35a-56a6-4479-b4c4-f97198052fb7" name="Default Changelist" comment=""> <list default="true" id="a633d35a-56a6-4479-b4c4-f97198052fb7" name="Default Changelist" comment="Generad">
<change afterPath="$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeEgresosFacturaMateriaPrima.java" afterDir="false" /> <change afterPath="$PROJECT_DIR$/src/danielcortes/xyz/views/TipoEgresoSelectDialog.form" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/InformeEgresosFacturasMateriaPrimaContent.java" afterDir="false" /> <change afterPath="$PROJECT_DIR$/src/danielcortes/xyz/views/TipoEgresoSelectDialog.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/InformeEgresosFacturasMateriaPrimaContentDAO.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/SQLiteInformeEgresosFacturasMateriaPrimaContentDAO.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/danielcortes/xyz/utils/Pair.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dist/caja.jar" beforeDir="false" afterPath="$PROJECT_DIR$/dist/caja.jar" afterDir="false" /> <change beforePath="$PROJECT_DIR$/dist/caja.jar" beforeDir="false" afterPath="$PROJECT_DIR$/dist/caja.jar" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dist/mackena.dat" beforeDir="false" afterPath="$PROJECT_DIR$/dist/mackena.dat" afterDir="false" /> <change beforePath="$PROJECT_DIR$/dist/mackena.dat" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/dist/rodriguez.dat" beforeDir="false" afterPath="$PROJECT_DIR$/dist/rodriguez.dat" afterDir="false" /> <change beforePath="$PROJECT_DIR$/dist/rodriguez.dat" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/Main.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/controllers/InformesController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/controllers/InformesController.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/controllers/InformesController.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/controllers/InformesController.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeLibroDeVentas.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeLibroDeVentas.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeEgresosFacturaMateriaPrima.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeEgresos.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/models/informe/InformeLibroDeVentasContent.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/libro_de_ventas/InformeLibroDeVentasContent.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/InformeEgresosFacturasMateriaPrimaContent.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/InformeEgresosContent.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/models/informe/InformeLibroDeVentasContentDAO.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/libro_de_ventas/InformeLibroDeVentasContentDAO.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/InformeEgresosFacturasMateriaPrimaContentDAO.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/InformeEgresosContentDAO.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/models/informe/SQLiteInformeLibroDeVentasContentDAO.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/libro_de_ventas/SQLiteInformeLibroDeVentasContentDAO.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/SQLiteInformeEgresosFacturasMateriaPrimaContentDAO.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/SQLiteInformeEgresosContentDAO.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.form" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.form" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.form" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.form" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.java" afterDir="false" />
</list> </list>
@@ -89,7 +86,17 @@
<favorites_list name="caja" /> <favorites_list name="caja" />
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300" /> <leaf>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="69">
<caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
</state>
</provider>
</entry>
</file>
</leaf>
</component> </component>
<component name="FileTemplateManagerImpl"> <component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES"> <option name="RECENT_TEMPLATES">
@@ -154,13 +161,6 @@
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
<list> <list>
<option value="$PROJECT_DIR$/src/danielcortes/xyz/models/efectivo/SQLiteEfectivoDAO.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/models/efectivo/MysqlEfectivoDAO.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/models/efectivo/EfectivoDAO.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/models/documentos/MysqlDocumentosDAO.java" />
<option value="$USER_HOME$/Downloads/TimesheetDemo.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/Demo.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/Informe.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/models/informe/InformeContent.java" /> <option value="$PROJECT_DIR$/src/danielcortes/xyz/models/informe/InformeContent.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/controllers/IngresosController.java" /> <option value="$PROJECT_DIR$/src/danielcortes/xyz/controllers/IngresosController.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/models/caja/CajaDAO.java" /> <option value="$PROJECT_DIR$/src/danielcortes/xyz/models/caja/CajaDAO.java" />
@@ -201,10 +201,17 @@
<option value="$PROJECT_DIR$/src/danielcortes/xyz/utils/Pair.java" /> <option value="$PROJECT_DIR$/src/danielcortes/xyz/utils/Pair.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/InformeEgresosFacturasMateriaPrimaContent.java" /> <option value="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/InformeEgresosFacturasMateriaPrimaContent.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeEgresosFacturaMateriaPrima.java" /> <option value="$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeEgresosFacturaMateriaPrima.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/Main.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.form" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.java" /> <option value="$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/Main.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/InformeEgresosContentDAO.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/SQLiteInformeEgresosContentDAO.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeEgresos.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/views/MonthSelectDialog.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/views/TipoEgresoSelectDialog.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/controllers/InformesController.java" /> <option value="$PROJECT_DIR$/src/danielcortes/xyz/controllers/InformesController.java" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.form" />
<option value="$PROJECT_DIR$/src/danielcortes/xyz/views/TipoEgresoSelectDialog.form" />
<option value="$PROJECT_DIR$/.gitignore" />
</list> </list>
</option> </option>
</component> </component>
@@ -232,7 +239,6 @@
</order> </order>
</component> </component>
<component name="ProjectFrameBounds" extendedState="6"> <component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="683" />
<option name="y" value="-18" /> <option name="y" value="-18" />
<option name="width" value="683" /> <option name="width" value="683" />
<option name="height" value="765" /> <option name="height" value="765" />
@@ -251,6 +257,7 @@
</navigator> </navigator>
<panes> <panes>
<pane id="Scope" /> <pane id="Scope" />
<pane id="PackagesPane" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
@@ -276,6 +283,36 @@
<item name="xyz" type="462c0819:PsiDirectoryNode" /> <item name="xyz" type="462c0819:PsiDirectoryNode" />
<item name="controllers" type="462c0819:PsiDirectoryNode" /> <item name="controllers" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path>
<item name="caja" type="b2602c69:ProjectViewProjectNode" />
<item name="caja" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="xyz" type="462c0819:PsiDirectoryNode" />
<item name="models" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="caja" type="b2602c69:ProjectViewProjectNode" />
<item name="caja" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="xyz" type="462c0819:PsiDirectoryNode" />
<item name="views" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="caja" type="b2602c69:ProjectViewProjectNode" />
<item name="caja" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="xyz" type="462c0819:PsiDirectoryNode" />
<item name="views" type="462c0819:PsiDirectoryNode" />
<item name="InformesView" type="e9f4de52:FormNode" />
</path>
<path>
<item name="caja" type="b2602c69:ProjectViewProjectNode" />
<item name="caja" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="xyz" type="462c0819:PsiDirectoryNode" />
<item name="views" type="462c0819:PsiDirectoryNode" />
<item name="TipoEgresoSelectDialog" type="e9f4de52:FormNode" />
</path>
<path> <path>
<item name="caja" type="b2602c69:ProjectViewProjectNode" /> <item name="caja" type="b2602c69:ProjectViewProjectNode" />
<item name="Scratches and Consoles" type="1a2a3e82:ScratchProjectViewPane$MyProjectNode" /> <item name="Scratches and Consoles" type="1a2a3e82:ScratchProjectViewPane$MyProjectNode" />
@@ -284,7 +321,6 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="PackagesPane" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
@@ -298,7 +334,7 @@
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.STATE" value="ToolWindow" /> <property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.STATE" value="ToolWindow" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" /> <property name="aspect.path.notification.shown" value="true" />
<property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1547620318413" /> <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1547693323710" />
<property name="com.intellij.ide.scratch.LRUPopupBuilder$1/Change SQL Dialect" value="SQLite" /> <property name="com.intellij.ide.scratch.LRUPopupBuilder$1/Change SQL Dialect" value="SQLite" />
<property name="database.console.LAST_STATE" value="false" /> <property name="database.console.LAST_STATE" value="false" />
<property name="database.data.extractors.current.id" value="Tab-separated (TSV)_id" /> <property name="database.data.extractors.current.id" value="Tab-separated (TSV)_id" />
@@ -528,6 +564,9 @@
<workItem from="1547574832331" duration="6614000" /> <workItem from="1547574832331" duration="6614000" />
<workItem from="1547608589749" duration="2384000" /> <workItem from="1547608589749" duration="2384000" />
<workItem from="1547612814042" duration="7499000" /> <workItem from="1547612814042" duration="7499000" />
<workItem from="1547620415099" duration="227000" />
<workItem from="1547658180848" duration="766000" />
<workItem from="1547682336611" duration="3953000" />
</task> </task>
<task id="LOCAL-00001" summary="First!! :3 Existe una pequeña base de proyecto por ahora"> <task id="LOCAL-00001" summary="First!! :3 Existe una pequeña base de proyecto por ahora">
<created>1545280618093</created> <created>1545280618093</created>
@@ -858,11 +897,25 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1547590232009</updated> <updated>1547590232009</updated>
</task> </task>
<option name="localTasksCounter" value="48" /> <task id="LOCAL-00048" summary="Agregado informe que muestra los egresos de facturas materia prima">
<created>1547620493306</created>
<option name="number" value="00048" />
<option name="presentableId" value="LOCAL-00048" />
<option name="project" value="LOCAL" />
<updated>1547620493306</updated>
</task>
<task id="LOCAL-00049" summary="Ignorando los archivos dat en dist, :/">
<created>1547620625508</created>
<option name="number" value="00049" />
<option name="presentableId" value="LOCAL-00049" />
<option name="project" value="LOCAL" />
<updated>1547620625508</updated>
</task>
<option name="localTasksCounter" value="50" />
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="317039000" /> <option name="totallyTimeSpent" value="321985000" />
</component> </component>
<component name="TodoView"> <component name="TodoView">
<todo-panel id="selected-file"> <todo-panel id="selected-file">
@@ -875,8 +928,9 @@
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="0" y="-18" width="1366" height="765" extended-state="6" /> <frame x="0" y="-18" width="1366" height="765" extended-state="6" />
<editor active="true" />
<layout> <layout>
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.49438202" weight="0.2587519" /> <window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.49438202" visible="true" weight="0.16133942" />
<window_info id="Image Layers" order="1" /> <window_info id="Image Layers" order="1" />
<window_info id="Designer" order="2" /> <window_info id="Designer" order="2" />
<window_info x="458" y="95" width="450" height="453" id="UI Designer" order="3" weight="0.20243531" /> <window_info x="458" y="95" width="450" height="453" id="UI Designer" order="3" weight="0.20243531" />
@@ -1002,8 +1056,6 @@
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" /> <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_NEW_TODO" value="false" /> <option name="CHECK_NEW_TODO" value="false" />
<MESSAGE value="Documentado el controlador de ingresos" />
<MESSAGE value="Mas documentacion!! &#10;Bendita documentacion &lt;3" />
<MESSAGE value="Mas documentacion y cambiados la mayoria de los action listeners por keybindings" /> <MESSAGE value="Mas documentacion y cambiados la mayoria de los action listeners por keybindings" />
<MESSAGE value="Comodidades!&#10;Arreglado el problema de index al ordenar las tablas" /> <MESSAGE value="Comodidades!&#10;Arreglado el problema de index al ordenar las tablas" />
<MESSAGE value="Reordenado el resumen de arqueo para mayor claridad" /> <MESSAGE value="Reordenado el resumen de arqueo para mayor claridad" />
@@ -1027,19 +1079,15 @@
<MESSAGE value="Agregado en documentos el campo de retiros" /> <MESSAGE value="Agregado en documentos el campo de retiros" />
<MESSAGE value="Cambiado el nombre del informe mensual a libro de ventas mensual, ademas se agrego una utilidad para strings que por ahora solo contiene el toUpperCase aunque se ira llenando a medida que se necesite." /> <MESSAGE value="Cambiado el nombre del informe mensual a libro de ventas mensual, ademas se agrego una utilidad para strings que por ahora solo contiene el toUpperCase aunque se ira llenando a medida que se necesite." />
<MESSAGE value="Se me olvido cambiar el nombre del modelo" /> <MESSAGE value="Se me olvido cambiar el nombre del modelo" />
<option name="LAST_COMMIT_MESSAGE" value="Se me olvido cambiar el nombre del modelo" /> <MESSAGE value="Agregado informe que muestra los egresos de facturas materia prima" />
<MESSAGE value="Ignorando los archivos dat en dist, :/" />
<option name="LAST_COMMIT_MESSAGE" value="Ignorando los archivos dat en dist, :/" />
</component> </component>
<component name="antWorkspaceConfiguration"> <component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" /> <option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" /> <option name="FILTER_TARGETS" value="false" />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/views/MonthSelectDialog.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/Demo.java" />
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/File.java" />
<entry file="file://$APPLICATION_CONFIG_DIR$/consoles/db/6e2ee496-6ca2-4cc4-a2b0-4f122e6bfd50/console_1.sql" />
<entry file="jar://$MAVEN_REPOSITORY$/org/apache/poi/poi/4.0.1/poi-4.0.1-sources.jar!/org/apache/poi/hssf/usermodel/HSSFRow.java"> <entry file="jar://$MAVEN_REPOSITORY$/org/apache/poi/poi/4.0.1/poi-4.0.1-sources.jar!/org/apache/poi/hssf/usermodel/HSSFRow.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="253"> <state relative-caret-position="253">
@@ -1286,13 +1334,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/views/MonthSelectDialog.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1104">
<caret line="85" selection-start-line="85" selection-end-line="89" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/utils/StringUtils.java"> <entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/utils/StringUtils.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="115"> <state relative-caret-position="115">
@@ -1333,16 +1374,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/InformeEgresosFacturasMateriaPrimaContentDAO.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="253">
<caret line="33" column="81" selection-start-line="33" selection-start-column="81" selection-end-line="33" selection-end-column="81" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/models/informes/libro_de_ventas/SQLiteInformeLibroDeVentasContentDAO.java"> <entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/models/informes/libro_de_ventas/SQLiteInformeLibroDeVentasContentDAO.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="23"> <state relative-caret-position="23">
@@ -1423,7 +1454,7 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/InformeEgresosFacturasMateriaPrimaContent.java"> <entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/InformeEgresosContent.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="98"> <state relative-caret-position="98">
<caret line="28" column="56" lean-forward="true" selection-start-line="28" selection-start-column="56" selection-end-line="28" selection-end-column="56" /> <caret line="28" column="56" lean-forward="true" selection-start-line="28" selection-start-column="56" selection-end-line="28" selection-end-column="56" />
@@ -1448,43 +1479,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/SQLiteInformeEgresosFacturasMateriaPrimaContentDAO.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="393">
<caret line="53" lean-forward="true" selection-start-line="53" selection-end-line="53" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeEgresosFacturaMateriaPrima.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="231">
<caret line="93" column="28" selection-start-line="93" selection-start-column="28" selection-end-line="93" selection-end-column="28" />
<folding>
<element signature="method#InformeEgresosFacturaMateriaPrima#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="method#fillHeaders#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="e#2832#2906#1" />
<element signature="method#fillData#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="e#3012#3685#1" />
<element signature="e#4013#4266#1" />
<element signature="method#fillTotales#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="e#4554#5020#1" />
<element signature="e#4947#4989#1" />
<element signature="e#4978#5019#1" />
<element signature="method#addBorders#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="e#6107#6137#1" />
<element signature="method#setStyles#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="e#7875#7912#1" />
<element signature="e#8245#8527#1" />
<element signature="e#8331#8613#1" />
<element signature="e#8479#8527#1" />
<element signature="method#generateStyles#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="method#generarInforme#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="e#4005#4081#0" />
<element signature="e#4104#4148#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeLibroDeVentas.java"> <entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeLibroDeVentas.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="324"> <state relative-caret-position="324">
@@ -1515,9 +1509,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.java"> <entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="184"> <state relative-caret-position="184">
@@ -1527,38 +1518,96 @@
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/Main.java"> <entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/Main.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="140"> <state relative-caret-position="301">
<caret line="62" column="11" selection-start-line="62" selection-start-column="11" selection-end-line="62" selection-end-column="11" /> <caret line="53" column="19" lean-forward="true" selection-start-line="53" selection-start-column="19" selection-end-line="53" selection-end-column="19" />
<folding> <folding>
<element signature="imports" expanded="true" />
<element signature="method#run#0;class#Main#0" /> <element signature="method#run#0;class#Main#0" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/InformeEgresosContentDAO.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="230">
<caret line="32" column="58" lean-forward="true" selection-start-line="32" selection-start-column="58" selection-end-line="32" selection-end-column="58" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/models/informes/egresos/SQLiteInformeEgresosContentDAO.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345">
<caret line="57" column="45" lean-forward="true" selection-start-line="57" selection-start-column="45" selection-end-line="57" selection-end-column="45" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/informes/InformeEgresos.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2">
<caret line="70" column="75" selection-start-line="70" selection-start-column="75" selection-end-line="70" selection-end-column="75" />
<folding>
<element signature="method#InformeEgresosFacturaMateriaPrima#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="method#fillHeaders#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="method#fillData#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="method#fillTotales#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="method#addBorders#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="method#setStyles#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="method#generateStyles#0;class#InformeEgresosFacturaMateriaPrima#0" />
<element signature="method#generarInforme#0;class#InformeEgresosFacturaMateriaPrima#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/views/MonthSelectDialog.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="49">
<caret line="81" column="28" lean-forward="true" selection-start-line="81" selection-start-column="28" selection-end-line="81" selection-end-column="28" />
<folding>
<element signature="e#2297#2425#0" expanded="true" />
<element signature="e#2424#2425#0" expanded="true" />
<element signature="docComment;method#$$$setupUI$$$#0;class#MonthSelectDialog#0" />
<element signature="method#$$$setupUI$$$#0;class#MonthSelectDialog#0" />
<element signature="docComment;method#$$$getRootComponent$$$#0;class#MonthSelectDialog#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/views/TipoEgresoSelectDialog.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="324">
<caret line="72" column="18" selection-start-line="72" selection-start-column="18" selection-end-line="72" selection-end-column="18" />
<folding>
<element signature="method#TipoEgresoSelectDialog#0;class#TipoEgresoSelectDialog#0" />
<element signature="e#2651#2652#0" expanded="true" />
<element signature="e#2688#2689#0" expanded="true" />
<element signature="method#createTipoEgresoCombo#0;class#TipoEgresoSelectDialog#0" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/views/MonthSelectDialog.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
<entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/controllers/InformesController.java"> <entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/controllers/InformesController.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="253"> <state relative-caret-position="299">
<caret line="51" column="5" selection-start-line="51" selection-start-column="5" selection-end-line="51" selection-end-column="5" /> <caret line="91" column="31" lean-forward="true" selection-start-line="91" selection-start-column="31" selection-end-line="91" selection-end-column="31" />
<folding> </state>
<element signature="method#InformesController#0;class#InformesController#0" /> </provider>
<element signature="method#setupViewEvents#0;class#InformesController#0" /> </entry>
<element signature="method#generarInformeLibroDeVentasListener#0;class#InformesController#0" /> <entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/views/InformesView.form">
<element signature="e#2055#2632#1" /> <provider selected="true" editor-type-id="ui-designer" />
<element signature="e#2373#2622#1" /> </entry>
<element signature="method#generarInformeEgresosFacturasMateriaPrima#0;class#InformesController#0" /> <entry file="file://$PROJECT_DIR$/src/danielcortes/xyz/views/TipoEgresoSelectDialog.form">
<element signature="e#2785#3362#1" /> <provider selected="true" editor-type-id="ui-designer" />
<element signature="e#3103#3352#1" /> </entry>
<element signature="method#askForMonth#0;class#InformesController#0" /> <entry file="file://$PROJECT_DIR$/.gitignore">
<element signature="e#2819#2879#1" /> <provider selected="true" editor-type-id="text-editor">
<element signature="e#2885#2921#1" /> <state relative-caret-position="69">
<element signature="method#askForFile#0;class#InformesController#0" /> <caret line="3" lean-forward="true" selection-start-line="3" selection-end-line="3" />
<element signature="e#3334#3533#1" />
<element signature="e#3539#3575#1" />
<element signature="method#showConfirmation#0;class#InformesController#0" />
<element signature="e#3974#4142#1" />
<element signature="e#3992#4056#0" />
<element signature="e#4079#4131#0" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>

BIN
dist/caja.jar vendored

Binary file not shown.

View File

@@ -24,11 +24,13 @@
package danielcortes.xyz.controllers; package danielcortes.xyz.controllers;
import danielcortes.xyz.informes.InformeEgresosFacturaMateriaPrima; import danielcortes.xyz.informes.InformeEgresos;
import danielcortes.xyz.informes.InformeLibroDeVentas; import danielcortes.xyz.informes.InformeLibroDeVentas;
import danielcortes.xyz.models.tipo_egreso.TipoEgreso;
import danielcortes.xyz.utils.StringUtils; import danielcortes.xyz.utils.StringUtils;
import danielcortes.xyz.views.MonthSelectDialog; import danielcortes.xyz.views.MonthSelectDialog;
import danielcortes.xyz.views.InformesView; import danielcortes.xyz.views.InformesView;
import danielcortes.xyz.views.TipoEgresoSelectDialog;
import javax.swing.*; import javax.swing.*;
import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.filechooser.FileNameExtensionFilter;
@@ -48,46 +50,54 @@ public class InformesController {
private void setupViewEvents() { private void setupViewEvents() {
this.view.getInformeLibroDeVentasButton().addActionListener(e -> generarInformeLibroDeVentasListener()); this.view.getInformeLibroDeVentasButton().addActionListener(e -> generarInformeLibroDeVentasListener());
this.view.getGenerarEgresosFacturasMateriaPrimaButton().addActionListener(e -> generarInformeEgresosFacturasMateriaPrima()); this.view.getGenerarEgresosFacturasMateriaPrimaButton().addActionListener(e -> generarInformeEgresosListener());
} }
private void generarInformeLibroDeVentasListener() { private void generarInformeLibroDeVentasListener() {
LocalDate month = askForMonth(); LocalDate month = askForMonth();
if (month != null) { if (month == null) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMMM YYYY"); return;
}
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMMM YYYY");
String formatedName = month.format(formatter); String formatedName = month.format(formatter);
String capitalized = StringUtils.toUpperCase(formatedName); String capitalized = StringUtils.toUpperCase(formatedName);
File saveFile = askForFile("Libro " + capitalized); File saveFile = askForFile("Libro " + capitalized);
if (saveFile == null) {
return;
}
if (saveFile != null) {
InformeLibroDeVentas informe = new InformeLibroDeVentas(month, saveFile); InformeLibroDeVentas informe = new InformeLibroDeVentas(month, saveFile);
File generatedFile = informe.generarInforme(); File generatedFile = informe.generarInforme();
this.showConfirmation(generatedFile); this.showConfirmation(generatedFile);
} }
}
private void generarInformeEgresosListener() {
TipoEgreso tipoEgreso = askForTipoEgreso();
if (tipoEgreso == null) {
return;
} }
private void generarInformeEgresosFacturasMateriaPrima() {
LocalDate month = askForMonth(); LocalDate month = askForMonth();
if (month != null) { if (month == null) {
return;
}
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMMM YYYY"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("MMMM YYYY");
String formatedMonth = month.format(formatter);
String formatedName = month.format(formatter); File saveFile = askForFile("Informe Egresos: " + tipoEgreso.getNombre() + " - " + StringUtils.toUpperCase(formatedMonth));
String capitalized = StringUtils.toUpperCase(formatedName); if (saveFile == null) {
return;
}
File saveFile = askForFile("Egresos Materia Prima " + capitalized); InformeEgresos informe = new InformeEgresos(tipoEgreso.getId(), month, saveFile);
if (saveFile != null) {
InformeEgresosFacturaMateriaPrima informe = new InformeEgresosFacturaMateriaPrima(month, saveFile);
File generatedFile = informe.generarInforme(); File generatedFile = informe.generarInforme();
this.showConfirmation(generatedFile); this.showConfirmation(generatedFile);
} }
}
}
private LocalDate askForMonth() { private LocalDate askForMonth() {
MonthSelectDialog monthSelectDialog = new MonthSelectDialog(this.view.getContentPanel()); MonthSelectDialog monthSelectDialog = new MonthSelectDialog(this.view.getContentPanel());
@@ -98,6 +108,15 @@ public class InformesController {
} }
} }
private TipoEgreso askForTipoEgreso() {
TipoEgresoSelectDialog tipoEgresoSelectDialog = new TipoEgresoSelectDialog(this.view.getContentPanel());
if (tipoEgresoSelectDialog.isAcepted()) {
return tipoEgresoSelectDialog.getTipoEgreso();
} else {
return null;
}
}
private File askForFile(String suggestedName) { private File askForFile(String suggestedName) {
JFileChooser chooser = new JFileChooser(); JFileChooser chooser = new JFileChooser();
chooser.setDialogType(JFileChooser.SAVE_DIALOG); chooser.setDialogType(JFileChooser.SAVE_DIALOG);

View File

@@ -25,8 +25,9 @@
package danielcortes.xyz.informes; package danielcortes.xyz.informes;
import danielcortes.xyz.models.caja.SQLiteCajaDAO; import danielcortes.xyz.models.caja.SQLiteCajaDAO;
import danielcortes.xyz.models.informes.egresos.InformeEgresosFacturasMateriaPrimaContent; import danielcortes.xyz.models.informes.egresos.InformeEgresosContent;
import danielcortes.xyz.models.informes.egresos.SQLiteInformeEgresosFacturasMateriaPrimaContentDAO; import danielcortes.xyz.models.informes.egresos.SQLiteInformeEgresosContentDAO;
import danielcortes.xyz.models.tipo_egreso.TipoEgreso;
import danielcortes.xyz.utils.Pair; import danielcortes.xyz.utils.Pair;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
@@ -41,7 +42,7 @@ import java.time.LocalDate;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.*; import java.util.*;
public class InformeEgresosFacturaMateriaPrima { public class InformeEgresos {
private final String[] titles = { private final String[] titles = {
"FECHA", "FECHA",
"", "",
@@ -49,7 +50,7 @@ public class InformeEgresosFacturaMateriaPrima {
"VALOR" "VALOR"
}; };
private List<InformeEgresosFacturasMateriaPrimaContent> informe; private List<InformeEgresosContent> informe;
private File saveFile; private File saveFile;
//Filas donde se almacenaran los totales //Filas donde se almacenaran los totales
@@ -67,9 +68,9 @@ public class InformeEgresosFacturaMateriaPrima {
private CreationHelper createHelper; private CreationHelper createHelper;
private HashMap<String, CellStyle> styles; private HashMap<String, CellStyle> styles;
public InformeEgresosFacturaMateriaPrima(LocalDate date, File saveFile) { public InformeEgresos(int tipoEgresoId, LocalDate date, File saveFile) {
new SQLiteCajaDAO().createCajasForMonth(date); new SQLiteCajaDAO().createCajasForMonth(date);
this.informe = new SQLiteInformeEgresosFacturasMateriaPrimaContentDAO().getInformeEgresosFactuasMateriaPrima(date); this.informe = new SQLiteInformeEgresosContentDAO().getInformeEgresosFactuasMateriaPrima(date, tipoEgresoId);
this.saveFile = saveFile; this.saveFile = saveFile;
this.wb = new HSSFWorkbook(); this.wb = new HSSFWorkbook();
@@ -97,7 +98,7 @@ public class InformeEgresosFacturaMateriaPrima {
int dayEnd; int dayEnd;
for (int informeID = 0; informeID < informe.size(); informeID++) { for (int informeID = 0; informeID < informe.size(); informeID++) {
InformeEgresosFacturasMateriaPrimaContent data = informe.get(informeID); InformeEgresosContent data = informe.get(informeID);
int cellCounter = 0; int cellCounter = 0;
Row dataRow = sheet.createRow(rowCounter); Row dataRow = sheet.createRow(rowCounter);
dataRows.add(dataRow); dataRows.add(dataRow);

View File

@@ -26,7 +26,7 @@ package danielcortes.xyz.models.informes.egresos;
import java.time.LocalDate; import java.time.LocalDate;
public class InformeEgresosFacturasMateriaPrimaContent { public class InformeEgresosContent {
private LocalDate fecha; private LocalDate fecha;
private String nro; private String nro;
private String descripcion; private String descripcion;
@@ -66,7 +66,7 @@ public class InformeEgresosFacturasMateriaPrimaContent {
@Override @Override
public String toString() { public String toString() {
return "InformeEgresosFacturasMateriaPrimaContent{" + return "InformeEgresosContent{" +
"fecha=" + fecha + "fecha=" + fecha +
", nro='" + nro + '\'' + ", nro='" + nro + '\'' +
", descripcion='" + descripcion + '\'' + ", descripcion='" + descripcion + '\'' +

View File

@@ -27,11 +27,11 @@ package danielcortes.xyz.models.informes.egresos;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.List; import java.util.List;
public abstract class InformeEgresosFacturasMateriaPrimaContentDAO { public abstract class InformeEgresosContentDAO {
/** /**
* Genera el informe con nombre muy largo * Genera el informe con nombre muy largo
* @param month mes sobre el cual se quiere le informe * @param month mes sobre el cual se quiere le informe
* @return lista del objeto que contiene los datos necesarios para el informe * @return lista del objeto que contiene los datos necesarios para el informe
*/ */
public abstract List<InformeEgresosFacturasMateriaPrimaContent> getInformeEgresosFactuasMateriaPrima(LocalDate month); public abstract List<InformeEgresosContent> getInformeEgresosFactuasMateriaPrima(LocalDate month, int tipoEgresoId);
} }

View File

@@ -25,7 +25,6 @@
package danielcortes.xyz.models.informes.egresos; package danielcortes.xyz.models.informes.egresos;
import danielcortes.xyz.data.SQLiteConnectionHolder; import danielcortes.xyz.data.SQLiteConnectionHolder;
import danielcortes.xyz.models.egreso.Egreso;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
@@ -35,11 +34,11 @@ import java.time.LocalDate;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class SQLiteInformeEgresosFacturasMateriaPrimaContentDAO extends InformeEgresosFacturasMateriaPrimaContentDAO { public class SQLiteInformeEgresosContentDAO extends InformeEgresosContentDAO {
private List<InformeEgresosFacturasMateriaPrimaContent> list; private List<InformeEgresosContent> list;
@Override @Override
public List<InformeEgresosFacturasMateriaPrimaContent> getInformeEgresosFactuasMateriaPrima(LocalDate date) { public List<InformeEgresosContent> getInformeEgresosFactuasMateriaPrima(LocalDate date, int tipoEgresoId) {
list = new ArrayList<>(); list = new ArrayList<>();
try { try {
Connection conn = new SQLiteConnectionHolder().getConnection(); Connection conn = new SQLiteConnectionHolder().getConnection();
@@ -49,12 +48,13 @@ public class SQLiteInformeEgresosFacturasMateriaPrimaContentDAO extends InformeE
"egresos.descripcion as \"descripcion\",\n" + "egresos.descripcion as \"descripcion\",\n" +
"egresos.valor as \"valor\"\n" + "egresos.valor as \"valor\"\n" +
"from egresos inner join caja on egresos.caja_id = caja.id\n" + "from egresos inner join caja on egresos.caja_id = caja.id\n" +
"where caja.fecha between date(?) and date(?) and egresos.tipo_egreso_id = 1\n" + "where caja.fecha between date(?) and date(?) and egresos.tipo_egreso_id = ? \n" +
"order by caja.fecha\n"; "order by caja.fecha\n";
PreparedStatement ps = conn.prepareStatement(query); PreparedStatement ps = conn.prepareStatement(query);
ps.setString(1, date.withDayOfMonth(1).toString()); ps.setString(1, date.withDayOfMonth(1).toString());
ps.setString(2, date.withDayOfMonth(date.lengthOfMonth()).toString()); ps.setString(2, date.withDayOfMonth(date.lengthOfMonth()).toString());
ps.setInt(3, tipoEgresoId);
ResultSet rs = ps.executeQuery(); ResultSet rs = ps.executeQuery();
this.fillInforme(rs); this.fillInforme(rs);
} catch (SQLException e) { } catch (SQLException e) {
@@ -65,7 +65,7 @@ public class SQLiteInformeEgresosFacturasMateriaPrimaContentDAO extends InformeE
private void fillInforme(ResultSet rs) throws SQLException { private void fillInforme(ResultSet rs) throws SQLException {
while (rs.next()) { while (rs.next()) {
InformeEgresosFacturasMateriaPrimaContent content = new InformeEgresosFacturasMateriaPrimaContent(); InformeEgresosContent content = new InformeEgresosContent();
content.setFecha(LocalDate.parse(rs.getString("fecha"))); content.setFecha(LocalDate.parse(rs.getString("fecha")));
content.setDescripcion(rs.getString("descripcion")); content.setDescripcion(rs.getString("descripcion"));
content.setNro(rs.getString("nro")); content.setNro(rs.getString("nro"));

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="danielcortes.xyz.views.InformesView"> <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="danielcortes.xyz.views.InformesView">
<grid id="27dc6" binding="contentPanel" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <grid id="27dc6" binding="contentPanel" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/> <margin top="0" left="0" bottom="0" right="0"/>
<constraints> <constraints>
<xy x="20" y="20" width="419" height="356"/> <xy x="20" y="20" width="419" height="356"/>
@@ -8,7 +8,7 @@
<properties/> <properties/>
<border type="none"/> <border type="none"/>
<children> <children>
<grid id="ae41b" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <grid id="ae41b" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/> <margin top="0" left="0" bottom="0" right="0"/>
<constraints> <constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
@@ -24,51 +24,26 @@
<text value="Libro de Ventas Mensual"/> <text value="Libro de Ventas Mensual"/>
</properties> </properties>
</component> </component>
</children>
</grid>
<grid id="7ae6d" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="etched" title="Egresos"/>
<children>
<component id="b9812" class="javax.swing.JButton" binding="GenerarEgresosFacturasMateriaPrimaButton"> <component id="b9812" class="javax.swing.JButton" binding="GenerarEgresosFacturasMateriaPrimaButton">
<constraints> <constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/> <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints> </constraints>
<properties> <properties>
<text value="Facturas Materia Prima"/> <text value="Informe de Egresos"/>
</properties> </properties>
</component> </component>
<vspacer id="91971">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children> </children>
</grid> </grid>
<grid id="a924" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> <hspacer id="c47e8">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints> <constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<hspacer id="1a8f0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints> </constraints>
</hspacer> </hspacer>
</children> </children>
</grid> </grid>
<vspacer id="215a5">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="d7cdc">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
</grid>
</form> </form>

View File

@@ -64,30 +64,21 @@ public class InformesView {
*/ */
private void $$$setupUI$$$() { private void $$$setupUI$$$() {
contentPanel = new JPanel(); contentPanel = new JPanel();
contentPanel.setLayout(new GridLayoutManager(2, 3, new Insets(0, 0, 0, 0), -1, -1)); contentPanel.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1));
final JPanel panel1 = new JPanel(); final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); panel1.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPanel.add(panel1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); contentPanel.add(panel1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Informes Generales")); panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Informes Generales"));
generarLibroVentasButton = new JButton(); generarLibroVentasButton = new JButton();
generarLibroVentasButton.setText("Libro de Ventas Mensual"); generarLibroVentasButton.setText("Libro de Ventas Mensual");
panel1.add(generarLibroVentasButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel1.add(generarLibroVentasButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPanel.add(panel2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Egresos"));
GenerarEgresosFacturasMateriaPrimaButton = new JButton(); GenerarEgresosFacturasMateriaPrimaButton = new JButton();
GenerarEgresosFacturasMateriaPrimaButton.setText("Facturas Materia Prima"); GenerarEgresosFacturasMateriaPrimaButton.setText("Informe de Egresos");
panel2.add(GenerarEgresosFacturasMateriaPrimaButton, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); panel1.add(GenerarEgresosFacturasMateriaPrimaButton, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPanel.add(panel3, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
final Spacer spacer1 = new Spacer(); final Spacer spacer1 = new Spacer();
panel3.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); panel1.add(spacer1, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
final Spacer spacer2 = new Spacer(); final Spacer spacer2 = new Spacer();
contentPanel.add(spacer2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); contentPanel.add(spacer2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
final Spacer spacer3 = new Spacer();
contentPanel.add(spacer3, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
} }
/** /**

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="danielcortes.xyz.views.TipoEgresoSelectDialog">
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="10" left="10" bottom="10" right="10"/>
<constraints>
<xy x="48" y="54" width="247" height="134"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="94766" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="9538f" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="true" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="e7465" class="javax.swing.JButton" binding="buttonOK">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="OK"/>
</properties>
</component>
<component id="5723f" class="javax.swing.JButton" binding="buttonCancel">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Cancel"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
<grid id="e3588" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="695a6" class="javax.swing.JComboBox" binding="tipoEgresoCombo" custom-create="true">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="373b9" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Seleccione el Tipo de Egreso:"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</form>

View File

@@ -0,0 +1,141 @@
/*
* MIT License
*
* Copyright (c) 2018-2019 Daniel Cortes
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package danielcortes.xyz.views;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import danielcortes.xyz.models.egreso.Egreso;
import danielcortes.xyz.models.egreso.SQLiteEgresoDAO;
import danielcortes.xyz.models.tipo_egreso.SQLiteTipoEgresoDAO;
import danielcortes.xyz.models.tipo_egreso.TipoEgreso;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.List;
public class TipoEgresoSelectDialog extends JDialog {
private JPanel contentPane;
private JButton buttonOK;
private JButton buttonCancel;
private JComboBox<TipoEgreso> tipoEgresoCombo;
private boolean acepted;
public TipoEgresoSelectDialog(JComponent parent) {
$$$setupUI$$$();
setContentPane(contentPane);
setModalityType(ModalityType.APPLICATION_MODAL);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
getRootPane().setDefaultButton(buttonOK);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
buttonCancel.doClick();
}
});
contentPane.registerKeyboardAction(e -> onCancel(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
buttonOK.addActionListener(e -> onOK());
buttonCancel.addActionListener(e -> onCancel());
pack();
setLocationRelativeTo(parent);
setVisible(true);
}
private void onOK() {
this.acepted = true;
dispose();
}
private void onCancel() {
this.acepted = false;
dispose();
}
public boolean isAcepted() {
return this.acepted;
}
public TipoEgreso getTipoEgreso() {
return (TipoEgreso) tipoEgresoCombo.getSelectedItem();
}
private void createUIComponents() {
createTipoEgresoCombo();
}
private void createTipoEgresoCombo() {
List<TipoEgreso> tiposEgreso = new SQLiteTipoEgresoDAO().findAll();
tipoEgresoCombo = new JComboBox<>();
for (TipoEgreso tipoEgreso : tiposEgreso) {
tipoEgresoCombo.addItem(tipoEgreso);
}
}
/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
createUIComponents();
contentPane = new JPanel();
contentPane.setLayout(new GridLayoutManager(2, 1, new Insets(10, 10, 10, 10), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));
final JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1, true, false));
panel1.add(panel2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
buttonOK = new JButton();
buttonOK.setText("OK");
panel2.add(buttonOK, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
buttonCancel = new JButton();
buttonCancel.setText("Cancel");
panel2.add(buttonCancel, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(2, 2, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
panel3.add(tipoEgresoCombo, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label1 = new JLabel();
label1.setText("Seleccione el Tipo de Egreso:");
panel3.add(label1, new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}
/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return contentPane;
}
}