commit fe0ce5adbd11e69d1b15eb3fb8706bf1c4ab7039 Author: gleimar Date: Wed Jun 27 18:01:07 2012 +0000 copia do projeto scia git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@19145 d1611594-4594-4d17-8e1d-87c2c4800839 diff --git a/.classpath b/.classpath new file mode 100644 index 000000000..a24716602 --- /dev/null +++ b/.classpath @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 000000000..43053a260 --- /dev/null +++ b/.project @@ -0,0 +1,45 @@ + + + ventaboletosadm + + + modelWeb + LibreriasAdmVenta + CustomAdmVenta + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipselabs.tapiji.tools.core.I18NBuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.jsdt.core.jsNature + org.eclipselabs.tapiji.tools.core.nature + + diff --git a/.settings/.jsdtscope b/.settings/.jsdtscope new file mode 100644 index 000000000..f152bed35 --- /dev/null +++ b/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..938e50ead --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,5 @@ +#Mon May 14 12:48:03 BRT 2012 +eclipse.preferences.version=1 +encoding//src/java/rebel.xml=UTF-8 +encoding//web/WEB-INF/i3-label_es_MX.label=UTF-8 +encoding//web/WEB-INF/i3-label_pt_BR.label=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..8b6b99288 --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,280 @@ +#Wed Feb 08 14:33:42 BRST 2012 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=false +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=9999 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..026bc19aa --- /dev/null +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,4 @@ +#Wed Feb 08 14:33:42 BRST 2012 +eclipse.preferences.version=1 +formatter_profile=_rjconsultores +formatter_settings_version=11 diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component new file mode 100644 index 000000000..aa11e4c7c --- /dev/null +++ b/.settings/org.eclipse.wst.common.component @@ -0,0 +1,15 @@ + + + + + + + uses + + + uses + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 000000000..795869ead --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.container b/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 000000000..3bd5d0a48 --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.name b/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 000000000..05bd71b6e --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/.settings/org.hibernate.eclipse.console.prefs b/.settings/org.hibernate.eclipse.console.prefs new file mode 100644 index 000000000..d739aa4d9 --- /dev/null +++ b/.settings/org.hibernate.eclipse.console.prefs @@ -0,0 +1,4 @@ +#Fri Oct 14 14:34:32 BRT 2011 +default.configuration= +eclipse.preferences.version=1 +hibernate3.enabled=false diff --git a/.settings/org.jboss.ide.eclipse.as.core.prefs b/.settings/org.jboss.ide.eclipse.as.core.prefs new file mode 100644 index 000000000..fc4ce1fc9 --- /dev/null +++ b/.settings/org.jboss.ide.eclipse.as.core.prefs @@ -0,0 +1,3 @@ +#Mon Oct 17 21:38:50 BRST 2011 +eclipse.preferences.version=1 +org.jboss.ide.eclipse.as.core.singledeployable.deployableList= diff --git a/.settings/org.zkoss.eclipse.preferences.prefs b/.settings/org.zkoss.eclipse.preferences.prefs new file mode 100644 index 000000000..606b1e041 --- /dev/null +++ b/.settings/org.zkoss.eclipse.preferences.prefs @@ -0,0 +1,6 @@ +#Fri Nov 11 14:47:02 BRST 2011 +eclipse.preferences.version=1 +setting.zk_facet_install_history=\n\n +visualeditor.custom_web_content_path=/ventaboletosadm/web +visualeditor.custom_zk_package=zk-bin-eval-5.0.7.1 +visualeditor.is_use_zks_lib=true diff --git a/src/conf/MANIFEST.MF b/src/conf/MANIFEST.MF new file mode 100644 index 000000000..59499bce4 --- /dev/null +++ b/src/conf/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/src/java/applicationContext-security.xml b/src/java/applicationContext-security.xml new file mode 100644 index 000000000..7f747e607 --- /dev/null +++ b/src/java/applicationContext-security.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/componente/esquemaoperacional/GridRutaTramo.java b/src/java/com/rjconsultores/ventaboletos/web/gui/componente/esquemaoperacional/GridRutaTramo.java new file mode 100644 index 000000000..749e3fc6d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/componente/esquemaoperacional/GridRutaTramo.java @@ -0,0 +1,683 @@ +package com.rjconsultores.ventaboletos.web.gui.componente.esquemaoperacional; + +import java.math.BigDecimal; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.event.Events; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zkplus.databind.DataBinder; +import org.zkoss.zkplus.spring.SpringUtil; +import org.zkoss.zul.Column; +import org.zkoss.zul.Columns; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Grid; +import org.zkoss.zul.Hbox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Label; +import org.zkoss.zul.ListModelList; +import org.zkoss.zul.Menuitem; +import org.zkoss.zul.Menupopup; +import org.zkoss.zul.RendererCtrl; +import org.zkoss.zul.Row; +import org.zkoss.zul.RowRenderer; +import org.zkoss.zul.Spinner; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoServicio; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.service.TramoService; +import com.rjconsultores.ventaboletos.service.TramoServicioService; +import com.rjconsultores.ventaboletos.utilerias.DateUtil.Hora; +import com.rjconsultores.ventaboletos.vo.esquemaoperacional.SecuenciaRutaTramoVO; +import com.rjconsultores.ventaboletos.web.utilerias.ConstraintNumberBD; +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.StringDecimalToDecimalConverter; + +/** + * Grid con la representacion de los tramos y secuencias de la ruta + * + * @author gleimar + * + */ +public class GridRutaTramo extends Grid implements RowRenderer, RendererCtrl { + private List lsVias; + private List lsSecuenciaRutaTramoVO; + private ClaseServicio claseServicio; + private DataBinder dataBinder; + private boolean mostraPopupGrid; + private static Logger log = Logger.getLogger(GridRutaTramo.class); + + public GridRutaTramo() { + lsSecuenciaRutaTramoVO = new ArrayList(); + this.setRowRenderer(this); + this.appendChild(generarColumns()); + dataBinder = new DataBinder(); + mostraPopupGrid = true; + } + + public boolean isMostraPopupGrid() { + return mostraPopupGrid; + } + + public void setMostraPopupGrid(boolean mostraPopupGrid) { + this.mostraPopupGrid = mostraPopupGrid; + } + + /** + * Informa la lista de vias disponibles + * + * @param lsVias + */ + public void setLsVias(List lsVias) { + this.lsVias = lsVias; + } + + /** + * Cuás es la clase de servicio confiugrada + * + * @return + */ + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + /** + * Indica cuál es la clase de servicio usada para hacer la búsqueda de los tramos + * + * @param claseServicio + */ + public void setClaseServicio(ClaseServicio claseServicio) { + if (!lsSecuenciaRutaTramoVO.isEmpty()) { + lsSecuenciaRutaTramoVO.clear(); + actualizaModel(); + } + this.claseServicio = claseServicio; + } + + private ListModelList getListViaCombobox() { + return new ListModelList(lsVias); + } + + /** + * Limpia los registros que existen y agrega todos + * + * @param lsSecuenciaRutaTramoVO + */ + public void agregarTodos(List lsSecuenciaRutaTramoVO) { + this.lsSecuenciaRutaTramoVO.clear(); + this.lsSecuenciaRutaTramoVO.addAll(lsSecuenciaRutaTramoVO); + actualizaModel(); + } + + /** + * Agrega un nuevo tramo. Si la origen es la ultima parada, agrega al fin. Sino agrega al medio de la secuencia. + * + * La parada destino es la que tienes que agregar. + * + * @param origen + * @param destino + * @throws IllegalArgumentException + * - Los parametros origen y destino son obligatorios + * @throws ParadaExisteException + * - Cuándo el destino que se intenta agregar ya está agregado + */ + public void agregarSecuencia(Parada origen, Parada destino, Via via) throws IllegalArgumentException, ParadaExisteException { + dataBinder.saveAll(); + dataBinder = new DataBinder(); + + if ((origen == null) || (destino == null)) { + throw new IllegalArgumentException(Labels.getLabel("gridRutaSecuencia.agregarSecuencia.exception.origenDestinoObligatorio")); + } + + if (existe(destino)) { + MessageFormat mf = new MessageFormat(Labels.getLabel("gridRutaSecuencia.paradaExisteException.msg")); + Object[] o = { destino.getDescparada() }; + throw new ParadaExisteException(mf.format(o)); + } + + if (lsSecuenciaRutaTramoVO.isEmpty()) { + SecuenciaRutaTramoVO s = new SecuenciaRutaTramoVO(origen, destino, 1, via); + llenarTramo(s); + lsSecuenciaRutaTramoVO.add(s); + } else if ((getUltimaParada() != null) && (getUltimaParada().equals(origen))) { + Integer secuence = lsSecuenciaRutaTramoVO.size() + 1; + SecuenciaRutaTramoVO secuenciaRutaVO = new SecuenciaRutaTramoVO(origen, destino, secuence, via); + llenarTramo(secuenciaRutaVO); + lsSecuenciaRutaTramoVO.add(secuenciaRutaVO); + } else { + List lsParadas = new ArrayList(); + + for (SecuenciaRutaTramoVO s : lsSecuenciaRutaTramoVO) { + if (!lsParadas.contains(s.getOrigen())) { + lsParadas.add(s.getOrigen()); + } + if (!lsParadas.contains(s.getDestino())) { + lsParadas.add(s.getDestino()); + } + } + int indexOf = lsParadas.indexOf(origen); + if (indexOf != -1) { + lsParadas.add(indexOf + 1, destino); + } else { + indexOf = lsParadas.indexOf(destino); + if (indexOf != -1) { + lsParadas.add(indexOf, origen); + } + } + + List lsSecuenciaRutaTramoNuevoVO = new ArrayList(); + for (int i = 1; i < lsParadas.size(); i++) { + Parada origenTramo = lsParadas.get(i - 1); + Parada destinoTramo = lsParadas.get(i); + SecuenciaRutaTramoVO s = buscarSecuencia(origenTramo, destinoTramo); + + if (s == null) { + s = new SecuenciaRutaTramoVO(origenTramo, destinoTramo, i, null); + } + s.setSecuencia(i); + lsSecuenciaRutaTramoNuevoVO.add(s); + } + lsSecuenciaRutaTramoVO.clear(); + lsSecuenciaRutaTramoVO.addAll(lsSecuenciaRutaTramoNuevoVO); + } + + actualizaModel(); + + } + + /** + * Hace la búsqueda de una secuencia por la origen y destino + * + * @param origenTramo + * @param destinoTramo + * @return + */ + private SecuenciaRutaTramoVO buscarSecuencia(Parada origenTramo, Parada destinoTramo) { + boolean fueEncontrado = false; + SecuenciaRutaTramoVO s = null; + for (int j = 0; (j < lsSecuenciaRutaTramoVO.size()) && !fueEncontrado; j++) { + if (lsSecuenciaRutaTramoVO.get(j).getOrigen().equals(origenTramo) + && lsSecuenciaRutaTramoVO.get(j).getDestino().equals(destinoTramo)) { + s = lsSecuenciaRutaTramoVO.get(j); + + fueEncontrado = true; + } + + } + return s; + } + + /** + * Indica si la parada ya esta agregada + * + * @param parada + * @return + */ + public boolean existe(Parada parada) { + boolean fueEncontrado = false; + SecuenciaRutaTramoVO s = null; + for (int j = 0; (j < lsSecuenciaRutaTramoVO.size()) && !fueEncontrado; j++) { + if (lsSecuenciaRutaTramoVO.get(j).getOrigen().equals(parada) || lsSecuenciaRutaTramoVO.get(j).getDestino().equals(parada)) { + fueEncontrado = true; + } + + } + return fueEncontrado; + } + + private Columns generarColumns() { + Columns columns = new Columns(); + + Column columnSecuencia = new Column("#"); + columnSecuencia.setWidth("5%"); + columns.appendChild(columnSecuencia); + + Column columnOrigen = new Column(Labels.getLabel("gridRutaSecuencia.columnOrigen.label")); + columnOrigen.setWidth("10%"); + columns.appendChild(columnOrigen); + + Column columnDestino = new Column(Labels.getLabel("gridRutaSecuencia.columnDestino.label")); + columnDestino.setWidth("10%"); + columns.appendChild(columnDestino); + + Column columnVia = new Column(Labels.getLabel("gridRutaSecuencia.columnVia.label")); + columnVia.setWidth("25%"); + columns.appendChild(columnVia); + + Column kmsReal = new Column(Labels.getLabel("gridRutaSecuencia.columnKmsReal.label")); + kmsReal.setWidth("15%"); + columns.appendChild(kmsReal); + + Column kmsConductor = new Column(Labels.getLabel("gridRutaSecuencia.columnKmsConductor.label")); + kmsConductor.setWidth("15%"); + columns.appendChild(kmsConductor); + + Column tiempoRecorrido = new Column(Labels.getLabel("gridRutaSecuencia.columnTiempoRecorrido.label")); + tiempoRecorrido.setWidth("15%"); + columns.appendChild(tiempoRecorrido); + + Column columnIDTramo = new Column(Labels.getLabel("gridRutaSecuencia.columnIDTramo.label")); + columnIDTramo.setWidth("5%"); + columns.appendChild(columnIDTramo); + + return columns; + } + + @Override + public void render(Row row, Object obj) throws Exception { + final SecuenciaRutaTramoVO secuenciaRutaTramoVO = (SecuenciaRutaTramoVO) obj; + dataBinder.bindBean(row.getUuid(), secuenciaRutaTramoVO);// binder + // row->bean + + // Cell secuencia + Intbox ibxSumSecuencia = new Intbox(secuenciaRutaTramoVO.getSecuencia()); + ibxSumSecuencia.setWidth("70%"); + ibxSumSecuencia.setReadonly(true); + row.appendChild(ibxSumSecuencia); + + // Cell Origen + Label lblOrigen = new Label(secuenciaRutaTramoVO.getOrigen().getCveparada()); + lblOrigen.setWidth("80%"); + Menupopup mnuOrigen = new Menupopup(); + + Menuitem mniAgregarDespues = new Menuitem(Labels.getLabel("gridRutaSecuencia.msg.agregarDespues")); + mniAgregarDespues.addEventListener(Events.ON_CLICK, new EventListener() { + + @Override + public void onEvent(Event arg0) throws Exception { + Map params = new LinkedHashMap(); + params.put("gridRutaSecuencia", GridRutaTramo.this); + params.put("origen", secuenciaRutaTramoVO.getOrigen()); + + PantallaUtileria.openWindow("/gui/esquema_operacional/generacion_tramo_ruta/nuevaParada.zul", + Labels.getLabel("nuevaParadaController.window.title"), params, PantallaUtileria.MODAL, getDesktop()); + } + }); + mnuOrigen.appendChild(mniAgregarDespues); + Menuitem mniEliminarPasoOrigen = new Menuitem(Labels.getLabel("gridRutaSecuencia.msg.eliminarPaso")); + mniEliminarPasoOrigen.addEventListener(Events.ON_CLICK, new EventListener() { + + @Override + public void onEvent(Event arg0) throws Exception { + removerParada(secuenciaRutaTramoVO.getOrigen()); + } + }); + mnuOrigen.appendChild(mniEliminarPasoOrigen); + mnuOrigen.setPage(getPage()); + if (mostraPopupGrid) { + lblOrigen.setContext(mnuOrigen); + } + row.appendChild(lblOrigen); + + // Cell Destino + Label lblDestino = new Label(secuenciaRutaTramoVO.getDestino().getCveparada()); + lblDestino.setWidth("80%"); + Menupopup mnuDestino = new Menupopup(); + + Menuitem mniEliminarPasoDestino = new Menuitem(Labels.getLabel("gridRutaSecuencia.msg.eliminarPaso")); + mniEliminarPasoDestino.addEventListener(Events.ON_CLICK, new EventListener() { + + @Override + public void onEvent(Event arg0) throws Exception { + removerParada(secuenciaRutaTramoVO.getDestino()); + } + }); + mnuDestino.appendChild(mniEliminarPasoDestino); + mnuDestino.setPage(getPage()); + if (mostraPopupGrid) { + lblDestino.setContext(mnuDestino); + } + row.appendChild(lblDestino); + + // son creados antes pues el cboVia los estan ocupando + final MyCustomTextboxDecimal dKmsReal = new MyCustomTextboxDecimal((secuenciaRutaTramoVO.getKmReal() == null) ? BigDecimal.ZERO + : secuenciaRutaTramoVO.getKmReal()); + dKmsReal.setWidth("90%"); + final MyCustomTextboxDecimal dKmsConductor = new MyCustomTextboxDecimal( + (secuenciaRutaTramoVO.getKmPagoConductor() == null) ? BigDecimal.ZERO : secuenciaRutaTramoVO.getKmPagoConductor()); + dKmsConductor.setWidth("90%"); + final Spinner spHora = new Spinner(); + final Spinner spMinuto = new Spinner(); + final Label lblID = new Label(""); + + // Cell Via + final Combobox cboVia = new Combobox(); + cboVia.setId(cboVia.getUuid()); + cboVia.setReadonly(true); + ListModelList listModelList = getListViaCombobox(); + if (secuenciaRutaTramoVO.getVia() != null) { + listModelList.addSelection(secuenciaRutaTramoVO.getVia()); + } + cboVia.setModel(listModelList); + cboVia.setConstraint("no empty"); + cboVia.addEventListener(Events.ON_CHANGE, new EventListener() { + + @Override + public void onEvent(Event evt) throws Exception { + if (cboVia.getSelectedItem() != null) { + + BigDecimal kmPagoConductorAntigo = secuenciaRutaTramoVO.getKmPagoConductor(); + BigDecimal kmRealAntigo = secuenciaRutaTramoVO.getKmReal(); + Hora tiempoRecorridoAntigo = secuenciaRutaTramoVO.getTiempoRecorrido(); + + secuenciaRutaTramoVO.setVia((Via) cboVia.getSelectedItem().getValue()); + llenarTramo(secuenciaRutaTramoVO); + + boolean tramoEditable = (secuenciaRutaTramoVO.getTramoId() == null); + boolean tramoServicioEditable = (secuenciaRutaTramoVO.getTramoServicioId() == null); + + if (!tramoEditable) {// cuando el tramo no es editable, es porque ya existe. Entonces lleno la pantalla con los nuevos + // valores + dKmsReal.setValueBigDecimal(secuenciaRutaTramoVO.getKmReal()); + dKmsConductor.setValueBigDecimal(secuenciaRutaTramoVO.getKmPagoConductor()); + + } else { + secuenciaRutaTramoVO.setKmPagoConductor(kmPagoConductorAntigo); + secuenciaRutaTramoVO.setKmReal(kmRealAntigo); + } + + lblID.setValue((secuenciaRutaTramoVO.getTramoId() != null) ? secuenciaRutaTramoVO.getTramoId().toString() : ""); + + if (!tramoServicioEditable) {// cuando el tramoServicio no es editable, es porque ya existe. Entonces lleno la pantalla + // con los nuevos valores + spHora.setValue(secuenciaRutaTramoVO.getTiempoRecorrido().getHora()); + spMinuto.setValue(secuenciaRutaTramoVO.getTiempoRecorrido().getMinuto()); + } else { + secuenciaRutaTramoVO.setTiempoRecorrido(tiempoRecorridoAntigo); + } + + dKmsReal.setReadonly(!tramoEditable); + dKmsConductor.setReadonly(!tramoEditable); + spHora.setDisabled(!tramoServicioEditable); + spMinuto.setDisabled(!tramoServicioEditable); + + } + } + }); + row.appendChild(cboVia); + boolean esTramoEditable = (secuenciaRutaTramoVO.getTramoId() == null); + boolean esTramoServicioEditable = (secuenciaRutaTramoVO.getTramoServicioId() == null); + + // Cell Kms Real + dKmsReal.setReadonly(!esTramoEditable); + dataBinder.addBinding(dKmsReal, "value", row.getUuid() + ".kmReal", null, null, "save", + "com.rjconsultores.ventaboletos.web.utilerias.StringDecimalToDecimalConverter", null, null, null); + + row.appendChild(dKmsReal); + + // Cell Kms Conductor + dKmsConductor.setReadonly(!esTramoEditable); + dataBinder.addBinding(dKmsConductor, "value", row.getUuid() + ".kmPagoConductor", null, null, "save", + "com.rjconsultores.ventaboletos.web.utilerias.StringDecimalToDecimalConverter", null, null, null); + row.appendChild(dKmsConductor); + + // Cell Tiempo Recorrido + Hbox hbox = new Hbox(); + + spHora.setWidth("40px"); + spHora.setConstraint("max 99,no negative,no empty"); + spHora.setReadonly(!esTramoServicioEditable); + spHora.setButtonVisible(esTramoServicioEditable); + + hbox.appendChild(spHora); + Label lbl = new Label(":"); + hbox.appendChild(lbl); + + spMinuto.setWidth("40px"); + spMinuto.setConstraint("max 59,no negative,no empty"); + spMinuto.setReadonly(!esTramoServicioEditable); + spMinuto.setButtonVisible(esTramoServicioEditable); + hbox.appendChild(spMinuto); + + if (secuenciaRutaTramoVO.getTiempoRecorrido() != null) { + Hora hora = secuenciaRutaTramoVO.getTiempoRecorrido(); + spHora.setValue(hora.getHora()); + spMinuto.setValue(hora.getMinuto()); + } + dataBinder.addBinding(spHora, "value", row.getUuid() + ".tiempoRecorrido.hora", null, null, "save", null, null, null, null); + dataBinder.addBinding(spMinuto, "value", row.getUuid() + ".tiempoRecorrido.minuto", null, null, "save", null, null, null, null); + row.appendChild(hbox); + + // Cell ID Tramo + if (secuenciaRutaTramoVO.getTramoId() != null) { + lblID.setValue(secuenciaRutaTramoVO.getTramoId().toString()); + } else { + lblID.setValue(""); + } + row.appendChild(lblID); + } + + /** + * Quita la parada de la lista de tramos + * + * @param parada + */ + private void removerParada(Parada parada) { + dataBinder.saveAll(); + dataBinder = new DataBinder(); + + // ADICIONAR VALIDAÇÃO DO TRAMANHO DA LISTA + List lsParadas = new ArrayList(); + + BigDecimal totalKmRealRemovido = BigDecimal.ZERO; + BigDecimal totalKmConductorRemovido = BigDecimal.ZERO; + Hora totalTiempoRecorridoRemovido = new Hora(); + + for (SecuenciaRutaTramoVO s : lsSecuenciaRutaTramoVO) { + if (!s.getOrigen().equals(parada)) { + if (!lsParadas.contains(s.getOrigen())) { + lsParadas.add(s.getOrigen()); + } + } else { + totalKmConductorRemovido = totalKmConductorRemovido.add(s.getKmPagoConductor()); + totalKmRealRemovido = totalKmRealRemovido.add(s.getKmReal()); + totalTiempoRecorridoRemovido = totalTiempoRecorridoRemovido.sumar(s.getTiempoRecorrido()); + } + if (!s.getDestino().equals(parada)) { + if (!lsParadas.contains(s.getDestino())) { + lsParadas.add(s.getDestino()); + } + } else { + totalKmConductorRemovido = totalKmConductorRemovido.add(s.getKmPagoConductor()); + totalKmRealRemovido = totalKmRealRemovido.add(s.getKmReal()); + totalTiempoRecorridoRemovido = totalTiempoRecorridoRemovido.sumar(s.getTiempoRecorrido()); + } + } + + List lsSecuenciaRutaTramoNuevoVO = new ArrayList(); + + for (int i = 1; i < lsParadas.size(); i++) { + Parada origenTramo = lsParadas.get(i - 1); + Parada destinoTramo = lsParadas.get(i); + + SecuenciaRutaTramoVO s = buscarSecuencia(origenTramo, destinoTramo); + if (s == null) { + s = new SecuenciaRutaTramoVO(origenTramo, destinoTramo, i, null); + // si no existe, es el tramo nuevo. Entonces agrego los valores eliminados + s.setKmPagoConductor(totalKmConductorRemovido); + s.setKmReal(totalKmRealRemovido); + s.setTiempoRecorrido(totalTiempoRecorridoRemovido); + } + s.setSecuencia(i); + lsSecuenciaRutaTramoNuevoVO.add(s); + } + lsSecuenciaRutaTramoVO.clear(); + lsSecuenciaRutaTramoVO.addAll(lsSecuenciaRutaTramoNuevoVO); + + actualizaModel(); + } + + /** + * Actualiza el modelo de grid + */ + private void actualizaModel() { + this.setModel(new ListModelList(lsSecuenciaRutaTramoVO, false)); + } + + /** + * Indica si hay tramos + * + * @return + */ + public boolean isEmpty() { + return lsSecuenciaRutaTramoVO.isEmpty(); + } + + /** + * Regresa la primera parada de los tramos + * + * @return + */ + public Parada getPrimeraParada() { + if (lsSecuenciaRutaTramoVO.isEmpty()) { + return null; + } + return lsSecuenciaRutaTramoVO.get(0).getOrigen(); + } + + /** + * Regresa la ultima parada de los tramos + * + * @return + */ + public Parada getUltimaParada() { + if (lsSecuenciaRutaTramoVO.isEmpty()) { + return null; + } + return lsSecuenciaRutaTramoVO.get(lsSecuenciaRutaTramoVO.size() - 1).getDestino(); + } + + /** + * Llena el tramo con los datos de un busqueda + * + * @param secuenciaRutaTramoVO + */ + private void llenarTramo(SecuenciaRutaTramoVO secuenciaRutaTramoVO) { + TramoServicioService tramoServicioService = (TramoServicioService) SpringUtil.getBean("tramoServicioService"); + + Parada destino = secuenciaRutaTramoVO.getDestino(); + Parada origen = secuenciaRutaTramoVO.getOrigen(); + Via via = secuenciaRutaTramoVO.getVia(); + + TramoServicio tramoServicio = null; + if ((destino != null) && (origen != null) && (via != null) && (claseServicio != null)) { + tramoServicio = tramoServicioService.buscar(origen, destino, via, claseServicio); + } + + Tramo tramo = null; + if (tramoServicio != null) { + tramo = tramoServicio.getTramo(); + } else { + TramoService tramoService = (TramoService) SpringUtil.getBean("tramoService"); + if ((destino != null) && (origen != null) && (via != null)) { + tramo = tramoService.buscar(origen, destino, via); + } + } + + if (tramoServicio != null) { + Hora hora = new Hora(tramoServicio.getTiemporecorrido()); + secuenciaRutaTramoVO.setTiempoRecorrido(hora); + secuenciaRutaTramoVO.setTramoServicioId(tramoServicio.getTramoservicioId()); + } else { + secuenciaRutaTramoVO.setTiempoRecorrido(null); + secuenciaRutaTramoVO.setTramoServicioId(null); + } + + if (tramo != null) { + secuenciaRutaTramoVO.setKmPagoConductor(tramo.getKmPagoConductor()); + secuenciaRutaTramoVO.setKmReal(tramo.getKmReal()); + secuenciaRutaTramoVO.setTramoId(tramo.getTramoId()); + } else { + secuenciaRutaTramoVO.setKmPagoConductor(BigDecimal.ZERO); + secuenciaRutaTramoVO.setKmReal(BigDecimal.ZERO); + secuenciaRutaTramoVO.setTramoId(null); + } + } + + @Override + public void doCatch(Throwable arg0) throws Throwable { + throw arg0; + } + + @Override + public void doFinally() { + // TODO Auto-generated method stub + + } + + @Override + public void doTry() { + // TODO Auto-generated method stub + + } + + public void debugList() { + dataBinder.saveAll(); + for (SecuenciaRutaTramoVO s : lsSecuenciaRutaTramoVO) { + log.debug(s); + } + } + + public List getLsSecuenciaRutaTramoVO() { + dataBinder.saveAll(); + return lsSecuenciaRutaTramoVO; + } + + class MyCustomTextboxDecimal extends Textbox { + + public MyCustomTextboxDecimal() { + super(); + this.setConstraint(new ConstraintNumberBD(8, 2, true)); + ejecutaJavaScript(); + } + + public void setValueBigDecimal(BigDecimal kmPagoConductor) { + this.setValue(getBigDecimal(kmPagoConductor)); + + } + + public MyCustomTextboxDecimal(String value) throws WrongValueException { + super(value); + this.setConstraint(new ConstraintNumberBD(8, 2, true)); + ejecutaJavaScript(); + } + + public MyCustomTextboxDecimal(BigDecimal value) throws WrongValueException { + super(); + this.setValue(getBigDecimal(value)); + this.setConstraint(new ConstraintNumberBD(8, 2, true)); + ejecutaJavaScript(); + } + + private void ejecutaJavaScript() { + Clients.evalJavaScript("jQuery('#" + this.getUuid() + + "').format({allow_negative:false,precision: 2,decimal:'.',autofix:true});"); + } + + private String getBigDecimal(BigDecimal val) { + return (String) new StringDecimalToDecimalConverter().coerceToUi(val, this); + + } + + public BigDecimal getValueBigDecimal() { + return getBigDecimal(this.getValue()); + } + + private BigDecimal getBigDecimal(String val) { + return (BigDecimal) new StringDecimalToDecimalConverter().coerceToBean(val, this); + } + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/componente/esquemaoperacional/ParadaExisteException.java b/src/java/com/rjconsultores/ventaboletos/web/gui/componente/esquemaoperacional/ParadaExisteException.java new file mode 100644 index 000000000..2fd7c51a2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/componente/esquemaoperacional/ParadaExisteException.java @@ -0,0 +1,10 @@ +package com.rjconsultores.ventaboletos.web.gui.componente.esquemaoperacional; + + +public class ParadaExisteException extends Exception { + + public ParadaExisteException(String msg) { + super(msg); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/IndexController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/IndexController.java new file mode 100644 index 000000000..ede8dec7b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/IndexController.java @@ -0,0 +1,118 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Caption; +import org.zkoss.zul.Menubar; +import org.zkoss.zul.Toolbarbutton; + +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.service.ConstanteService; +import com.rjconsultores.ventaboletos.service.UsuarioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.menu.MenuFactory; +import com.rjconsultores.ventaboletos.web.utilerias.menu.MenuFactoryPropertiesImpl; + +/** + * + * @author Administrador + */ +@Controller("indexController") +@Scope("prototype") +public class IndexController extends MyGenericForwardComposer { + + @Autowired + private UsuarioService usuarioService; + @Autowired + private ConstanteService constanteService; + private static Logger log = Logger.getLogger(IndexController.class); + private Usuario usuario; + private Toolbarbutton toolBar; + private Toolbarbutton toolBarUser; + private Menubar menubar; + private Caption lblNombreAplicacion; + + public Toolbarbutton getToolBar() { + return toolBar; + } + + public void setToolBar(Toolbarbutton toolBar) { + this.toolBar = toolBar; + } + + public Toolbarbutton getToolBarUser() { + return toolBarUser; + } + + public void setToolBarUser(Toolbarbutton toolBarUser) { + this.toolBarUser = toolBarUser; + } + + public Usuario getUsuario() { + return usuario; + } + + public void setUsuario(Usuario usuario) { + this.usuario = usuario; + } + + private void cargarNombreAmbiente() { + String strNombre = lblNombreAplicacion.getLabel(); + strNombre = strNombre + " - " + constanteService.buscarNombreAmbiente(); + lblNombreAplicacion.setLabel(strNombre); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + cargarNombreAmbiente(); + + usuario = UsuarioLogado.getUsuarioLogado(); + + if (usuario == null) { + toolBarUser.setVisible(Boolean.FALSE); + + openWindow("/login.zul", Labels.getLabel("winLogin.title"), arg, MODAL, Boolean.FALSE); + } else { + usuario = usuarioService.obtenerID(usuario.getUsuarioId()); + + toolBarUser.setVisible(Boolean.TRUE); + toolBarUser.setLabel(usuario.getNombusuario()); + + if (usuario.getUsuarioPerfilList().isEmpty()) { + return; + } + MenuFactory menuFactory = new MenuFactoryPropertiesImpl(desktop, usuario.getUsuarioPerfilList()); + menuFactory.construirMenu(menubar); + + } + } + + public void onClick$toolBar(Event ev) { + UsuarioLogado.setUsuarioLogado(null); + + desktop.getExecution().sendRedirect("/index.zul"); + } + + public void onClick$toolBarUser(Event ev) { + Map args = new HashMap(); + args.put("usuario", usuario); + args.put("usuarioList", null); + args.put("usrAdmin", Boolean.FALSE); + + openWindow("/gui/seguridad/editarUsuario.zul", Labels.getLabel("editarUsuarioController.window.title"), args, MODAL); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/LoginController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/LoginController.java new file mode 100644 index 000000000..d3f793742 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/LoginController.java @@ -0,0 +1,91 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores; + +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.service.UsuarioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.Base64; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import java.security.MessageDigest; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; + +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Textbox; + +/** + * + * @author rodrigo + */ +@Controller("loginController") +@Scope("prototype") +public class LoginController extends MyGenericForwardComposer { + + @Autowired + private UsuarioService usuarioService; + private Usuario usuario; + private Textbox txtUsuario; + private Textbox txtSenha; + private Logger log = Logger.getLogger(LoginController.class); + + public Textbox getTxtSenha() { + return txtSenha; + } + + public void setTxtSenha(Textbox txtSenha) { + this.txtSenha = txtSenha; + } + + public Textbox getTxtUsuario() { + return txtUsuario; + } + + public void setTxtUsuario(Textbox txtUsuario) { + this.txtUsuario = txtUsuario; + } + + public void onOK$txtSenha(Event ev) { + onClick$btnAcessar(ev); + } + public void onClick$btnAcessar(Event ev) { + String stUsuario = txtUsuario.getText(); + String senha = txtSenha.getText(); + + try { + if ((stUsuario != null) && (senha != null)) { + MessageDigest md = MessageDigest.getInstance("MD5"); + byte[] pass = md.digest(senha.getBytes()); + senha = Base64.byteArrayToBase64(pass); + + usuario = usuarioService.buscarPeloNomeSenha(stUsuario, senha); + + if (usuario != null) { + UsuarioLogado.setUsuarioLogado(usuario); + + desktop.getExecution().sendRedirect("/index.zul"); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("winLogin.lblloginIncorreto"), + Labels.getLabel("winLogin.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } else { + Messagebox.show( + Labels.getLabel("winLogin.lblloginIncorreto"), + Labels.getLabel("winLogin.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaArticuloController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaArticuloController.java new file mode 100644 index 000000000..14299fb88 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaArticuloController.java @@ -0,0 +1,132 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Articulo; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderArticulo; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaArticuloController") +@Scope("prototype") +public class BusquedaArticuloController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwArticulo; + private MyListbox articuloList; + private Paging pagingArticulo; + private Textbox txtNome; + + public MyListbox getArticuloList() { + return articuloList; + } + + public void setArticuloList(MyListbox articuloList) { + this.articuloList = articuloList; + } + + public Paging getPagingArticulo() { + return pagingArticulo; + } + + public void setPagingArticulo(Paging pagingArticulo) { + this.pagingArticulo = pagingArticulo; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + articuloList.setItemRenderer(new RenderArticulo()); + articuloList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Articulo a = (Articulo) articuloList.getSelected(); + verArticulo(a); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verArticulo(Articulo a) { + if (a == null) { + return; + } + + Map args = new HashMap(); + args.put("articulo", a); + args.put("articuloList", articuloList); + + openWindow("/gui/catalogos/editarArticulo.zul", + Labels.getLabel("editarArticuloController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject articuloBusqueda = + new HibernateSearchObject(Articulo.class, + pagingArticulo.getPageSize()); + + articuloBusqueda.addFilterLike("descarticulo", + "%" + txtNome.getText().trim().concat("%")); + + articuloBusqueda.addSortAsc("descarticulo"); + articuloBusqueda.addFilterNotEqual("articuloId", -1); + + articuloBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwArticulo.init(articuloBusqueda, articuloList, pagingArticulo); + + if (articuloList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaArticuloController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verArticulo(new Articulo()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaAsociacionClaseServicioMarcaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaAsociacionClaseServicioMarcaController.java new file mode 100644 index 000000000..b173a1504 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaAsociacionClaseServicioMarcaController.java @@ -0,0 +1,194 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.MarcaClaseServicio; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderClaseServicioMarca; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Paging; + +/** + * + * @author rodrigo + */ +@Controller("busquedaAsociacionClaseServicioMarcaController") +@Scope("prototype") +public class BusquedaAsociacionClaseServicioMarcaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwMarcaClaseServicio; + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseServicioService; + private List lsMarcas; + private List lsClaseServicios; + private MyListbox marcaClaseServicioList; + private Paging pagingMarcaClaseServicio; + private Combobox cmbMarca; + private Combobox cmbProducto; + + public MyListbox getMarcaClaseServicioList() { + return marcaClaseServicioList; + } + + public void setMarcaClaseServicioList(MyListbox marcaClaseServicioList) { + this.marcaClaseServicioList = marcaClaseServicioList; + } + + public Paging getPagingMarcaClaseServicio() { + return pagingMarcaClaseServicio; + } + + public void setPagingMarcaClaseServicio(Paging pagingMarcaClaseServicio) { + this.pagingMarcaClaseServicio = pagingMarcaClaseServicio; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Combobox getCmbProducto() { + return cmbProducto; + } + + public void setCmbProducto(Combobox cmbProducto) { + this.cmbProducto = cmbProducto; + } + + public ClaseServicioService getClaseServicioService() { + return claseServicioService; + } + + public void setClaseServicioService(ClaseServicioService claseServicioService) { + this.claseServicioService = claseServicioService; + } + + public List getLsClaseServicios() { + return lsClaseServicios; + } + + public void setLsClaseServicios(List lsClaseServicios) { + this.lsClaseServicios = lsClaseServicios; + } + + public List getLsMarcas() { + return lsMarcas; + } + + public void setLsMarcas(List lsMarcas) { + this.lsMarcas = lsMarcas; + } + + public MarcaService getMarcaService() { + return marcaService; + } + + public void setMarcaService(MarcaService marcaService) { + this.marcaService = marcaService; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsMarcas = marcaService.obtenerTodos(); + lsClaseServicios = claseServicioService.obtenerTodos(); + + super.doAfterCompose(comp); + + marcaClaseServicioList.setItemRenderer(new RenderClaseServicioMarca()); + marcaClaseServicioList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + MarcaClaseServicio m = (MarcaClaseServicio) marcaClaseServicioList.getSelected(); + verMarcaClaseServicio(m); + } + }); + + refreshLista(); + + cmbMarca.focus(); + } + + private void verMarcaClaseServicio(MarcaClaseServicio m) { + if (m == null) { + return; + } + + Map args = new HashMap(); + args.put("marcaClaseServicio", m); + args.put("marcaClaseServicioList", marcaClaseServicioList); + + openWindow("/gui/catalogos/editarAsociacionClaseServicioMarca.zul", + Labels.getLabel("editarAsociacionClaseServicioMarcaController.window.title"), + args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject marcaClaseServicioBusqueda = + new HibernateSearchObject(MarcaClaseServicio.class, pagingMarcaClaseServicio.getPageSize()); + + String marca = cmbMarca.getText().trim(); + String tipoServico = cmbProducto.getText().trim(); + + if ((marca != null) && (!marca.isEmpty())) { + marcaClaseServicioBusqueda.addFilterLike("marcaClaseservicioPK.marca.descmarca", "%" + cmbMarca.getText().toUpperCase().trim().concat("%")); + } + + if ((tipoServico != null) && (!tipoServico.isEmpty())) { + marcaClaseServicioBusqueda.addFilterLike("marcaClaseservicioPK.claseservicio.descclase", "%" + cmbProducto.getText().toUpperCase().trim().concat("%")); + } + marcaClaseServicioBusqueda.addFilterNotEqual("marcaClaseservicioPK.claseservicio.claseservicioId", -1); + + marcaClaseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + marcaClaseServicioBusqueda.addSortAsc("marcaClaseservicioPK.marca.descmarca"); + + plwMarcaClaseServicio.init(marcaClaseServicioBusqueda, marcaClaseServicioList, pagingMarcaClaseServicio); + + if (marcaClaseServicioList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaAsociacionClaseServicioMarcaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verMarcaClaseServicio(new MarcaClaseServicio()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaCategoriaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaCategoriaController.java new file mode 100644 index 000000000..0886330c8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaCategoriaController.java @@ -0,0 +1,127 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCategoria; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaCategoriaController") +@Scope("prototype") +public class BusquedaCategoriaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwCategoria; + private MyListbox categoriaList; + private Paging pagingCategoria; + private Textbox txtNombre; + + public Paging getPagingCategoria() { + return pagingCategoria; + } + + public void setPagingCategoria(Paging pagingCategoria) { + this.pagingCategoria = pagingCategoria; + } + + public MyListbox getCategoriaList() { + return categoriaList; + } + + public void setCategoriaList(MyListbox categoriaList) { + this.categoriaList = categoriaList; + } + + public PagedListWrapper getPlwCategoria() { + return plwCategoria; + } + + public void setPlwCategoria(PagedListWrapper plwCategoria) { + this.plwCategoria = plwCategoria; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new Categoria()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + categoriaList.setItemRenderer(new RenderCategoria()); + categoriaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Categoria c = (Categoria) categoriaList.getSelected(); + verPeriodo(c); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verPeriodo(Categoria c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("categoria", c); + args.put("categoriaList", categoriaList); + + openWindow("/gui/catalogos/editarCategoria.zul", + Labels.getLabel("editarCategoriaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(Categoria.class, pagingCategoria.getPageSize()); + + claseServicioBusqueda.addFilterLike("desccategoria", "%" + txtNombre.getText().trim().concat("%")); + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + claseServicioBusqueda.addFilterNotEqual("categoriaId", -1); + claseServicioBusqueda.addSortAsc("desccategoria"); + + plwCategoria.init(claseServicioBusqueda, categoriaList, pagingCategoria); + if (categoriaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaCategoriaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaCiudadController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaCiudadController.java new file mode 100644 index 000000000..8992ed828 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaCiudadController.java @@ -0,0 +1,244 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.service.EstadoService; +import com.rjconsultores.ventaboletos.service.PlazaService; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCiudad; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Listheader; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Row; +import org.zkoss.zul.Textbox; + +/** + * + * @author MCosso + */ +@Controller("busquedaCiudadController") +@Scope("prototype") +public class BusquedaCiudadController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwCiudad; + @Autowired + private EstadoService estadoService; + @Autowired + private PlazaService plazaService; + private MyListbox ciudadList; + private Paging pagingCiudad; + private List lsEstado; + private List lsPlaza; + private Textbox txtNombre; + private Textbox txtEquivalencia; + private Combobox cmbEstado; + private Combobox cmbPlaza; + private Row rowEquivalencia; + private Listheader headerEquivalencia; + private Intbox txtZonaHoraria; + + public MyListbox getCiudadList() { + return ciudadList; + } + + public void setCiudadList(MyListbox ciudadList) { + this.ciudadList = ciudadList; + } + + public Combobox getCmbEstado() { + return cmbEstado; + } + + public void setCmbEstado(Combobox cmbEstado) { + this.cmbEstado = cmbEstado; + } + + public Combobox getCmbPlaza() { + return cmbPlaza; + } + + public void setCmbPlaza(Combobox cmbPlaza) { + this.cmbPlaza = cmbPlaza; + } + + public List getLsEstado() { + return lsEstado; + } + + public void setLsEstado(List lsEstado) { + this.lsEstado = lsEstado; + } + + public List getLsPlaza() { + return lsPlaza; + } + + public void setLsPlaza(List lsPlaza) { + this.lsPlaza = lsPlaza; + } + + public Paging getPagingCiudad() { + return pagingCiudad; + } + + public void setPagingCiudad(Paging pagingCiudad) { + this.pagingCiudad = pagingCiudad; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public Textbox getTxtEquivalencia() { + return txtEquivalencia; + } + + public void setTxtEquivalencia(Textbox txtEquivalencia) { + this.txtEquivalencia = txtEquivalencia; + } + + public Intbox getTxtZonaHoraria() { + return txtZonaHoraria; + } + + public void setTxtZonaHoraria(Intbox txtZonaHoraria) { + this.txtZonaHoraria = txtZonaHoraria; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verCiudad(new Ciudad()); + } + + public Listheader getHeaderEquivalencia() { + return headerEquivalencia; + } + + public void setHeaderEquivalencia(Listheader headerEquivalencia) { + this.headerEquivalencia = headerEquivalencia; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEstado = estadoService.obtenerTodos(); + lsPlaza = plazaService.obtenerTodos(); + super.doAfterCompose(comp); + + ciudadList.setItemRenderer(new RenderCiudad()); + ciudadList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Ciudad ciu = (Ciudad) ciudadList.getSelected(); + verCiudad(ciu); + } + }); + + refreshLista(); + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + headerEquivalencia.setVisible(Boolean.FALSE); + } + + txtNombre.focus(); + } + + private void verCiudad(Ciudad ci) { + if (ci == null) { + return; + } + + Map args = new HashMap(); + args.put("ciudad", ci); + args.put("ciudadList", ciudadList); + + openWindow("/gui/catalogos/editarCiudad.zul", + Labels.getLabel("editarCiudadController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject ciudadBusqueda = + new HibernateSearchObject(Ciudad.class, pagingCiudad.getPageSize()); + + ciudadBusqueda.addFilterEqual("activo", true); + ciudadBusqueda.addFilterLike("nombciudad", txtNombre.getText().trim().concat("%")); + ciudadBusqueda.addFilterNotEqual("ciudadId", -1); + + if (!txtEquivalencia.getText().isEmpty()) { + ciudadBusqueda.addFilterLike("equivalenciaId", "%" + txtEquivalencia.getText().trim().concat("%")); + } + + Comboitem cbiEstado = cmbEstado.getSelectedItem(); + Comboitem cbiPlaza = cmbPlaza.getSelectedItem(); + + if (cbiEstado != null) { + Estado estado = (Estado) cbiEstado.getValue(); + ciudadBusqueda.addFilterEqual("estado", estado); + } + + if (cbiPlaza != null) { + Plaza plaza = (Plaza) cbiPlaza.getValue(); + ciudadBusqueda.addFilterEqual("plaza", plaza); + } + + if (txtZonaHoraria.getValue() != null) { + ciudadBusqueda.addFilterEqual("zonaHoraria", txtZonaHoraria.getValue()); + } + + ciudadBusqueda.addSortAsc("nombciudad"); + + plwCiudad.init(ciudadBusqueda, ciudadList, pagingCiudad); + + if (ciudadList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaCiudadController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaClaseServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaClaseServicioController.java new file mode 100644 index 000000000..d301443fa --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaClaseServicioController.java @@ -0,0 +1,131 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderClaseServicio; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaClaseServicioController") +@Scope("prototype") +public class BusquedaClaseServicioController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwClaseServico; + private MyListbox claseServicioList; + private Paging pagingClaseServicio; + private Textbox txtNome; + + public MyListbox getClaseServicioList() { + return claseServicioList; + } + + public void setClaseServicioList(MyListbox claseServicioList) { + this.claseServicioList = claseServicioList; + } + + public Paging getPagingClaseServicio() { + return pagingClaseServicio; + } + + public void setPagingClaseServicio(Paging pagingClaseServicio) { + this.pagingClaseServicio = pagingClaseServicio; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + claseServicioList.setItemRenderer(new RenderClaseServicio()); + claseServicioList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ClaseServicio c = (ClaseServicio) claseServicioList.getSelected(); + verClaseServicio(c); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verClaseServicio(ClaseServicio c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("claseServicio", c); + args.put("claseServicioList", claseServicioList); + + openWindow("/gui/catalogos/editarClaseServicio.zul", + Labels.getLabel("editarClaseServicioController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(ClaseServicio.class, + pagingClaseServicio.getPageSize()); + + claseServicioBusqueda.addFilterLike("descclase", + "%" + txtNome.getText().trim().concat("%")); + claseServicioBusqueda.addFilterNotEqual("claseservicioId", -1); + + claseServicioBusqueda.addSortAsc("descclase"); + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwClaseServico.init(claseServicioBusqueda, claseServicioList, pagingClaseServicio); + + if (claseServicioList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaClaseServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verClaseServicio(new ClaseServicio()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaColoniaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaColoniaController.java new file mode 100644 index 000000000..42d385a9a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaColoniaController.java @@ -0,0 +1,161 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Colonia; +import com.rjconsultores.ventaboletos.service.CiudadService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderColonia; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaColoniaController") +@Scope("prototype") +public class BusquedaColoniaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwColonia; + private MyListbox coloniaList; + private Paging pagingColonia; + private Textbox txtNombre; + private Combobox cmbCiudad; + + public MyListbox getColoniaList() { + return coloniaList; + } + + public void setColoniaList(MyListbox coloniaList) { + this.coloniaList = coloniaList; + } + + public Paging getPagingColonia() { + return pagingColonia; + } + + public void setPagingColonia(Paging pagingColonia) { + this.pagingColonia = pagingColonia; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verColonia(new Colonia()); + } + + public Combobox getCmbCiudad() { + return cmbCiudad; + } + + public void setCmbCiudad(Combobox cmbCiudad) { + this.cmbCiudad = cmbCiudad; + } + + public PagedListWrapper getPlwColonia() { + return plwColonia; + } + + public void setPlwColonia(PagedListWrapper plwColonia) { + this.plwColonia = plwColonia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + + super.doAfterCompose(comp); + + coloniaList.setItemRenderer(new RenderColonia()); + coloniaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Colonia ciu = (Colonia) coloniaList.getSelected(); + verColonia(ciu); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verColonia(Colonia ci) { + if (ci == null) { + return; + } + + Map args = new HashMap(); + args.put("colonia", ci); + args.put("coloniaList", coloniaList); + + openWindow("/gui/catalogos/editarColonia.zul", + Labels.getLabel("editarColoniaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject coloniaBusqueda = + new HibernateSearchObject(Colonia.class, pagingColonia.getPageSize()); + + coloniaBusqueda.addFilterEqual("activo", true); + coloniaBusqueda.addFilterLike("desccolonia", "%" + txtNombre.getText().trim().concat("%")); + coloniaBusqueda.addFilterNotEqual("coloniaId", -1); + + + Comboitem cbiCiudad = cmbCiudad.getSelectedItem(); + + if (cbiCiudad != null) { + Ciudad ciudad = (Ciudad) cbiCiudad.getValue(); + coloniaBusqueda.addFilterEqual("ciudad", ciudad); + } + + coloniaBusqueda.addSortAsc("desccolonia"); + + plwColonia.init(coloniaBusqueda, coloniaList, pagingColonia); + + if (coloniaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaColoniaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaCuponConvenioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaCuponConvenioController.java new file mode 100644 index 000000000..62ca9c4f9 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaCuponConvenioController.java @@ -0,0 +1,162 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.CuponConvenio; +import com.rjconsultores.ventaboletos.entidad.TipoConvenio; +import com.rjconsultores.ventaboletos.service.CuponConvenioService; +import com.rjconsultores.ventaboletos.service.TipoConvenioService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCuponConvenio; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Paging; + +/** + * + * @author Shiro + */ +@Controller("busquedaCuponConvenioController") +@Scope("prototype") +public class BusquedaCuponConvenioController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwCuponConvenio; + @Autowired + private TipoConvenioService tipoConService; + @Autowired + private CuponConvenioService cuponConService; + private MyListbox CuponConvenioList; + private Paging pagingCuponC; + private Combobox cmbTipoConvenio; + private List tipoConList; + + public CuponConvenioService getCuponConService() { + return cuponConService; + } + + public void setCuponConService(CuponConvenioService cuponConService) { + this.cuponConService = cuponConService; + } + + public List getTipoConList() { + return tipoConList; + } + + public void setTipoConList(List tipoConList) { + this.tipoConList = tipoConList; + } + + public TipoConvenioService getTipoConService() { + return tipoConService; + } + + public void setTipoConService(TipoConvenioService tipoConService) { + this.tipoConService = tipoConService; + } + + public MyListbox getCuponConvenioList() { + return CuponConvenioList; + } + + public void setCuponConvenioList(MyListbox CuponConvenioList) { + this.CuponConvenioList = CuponConvenioList; + } + + public Combobox getCmbTipoConvenio() { + return cmbTipoConvenio; + } + + public void setCmbTipoConvenio(Combobox cmbTipoConvenio) { + this.cmbTipoConvenio = cmbTipoConvenio; + } + + public Paging getPagingCuponC() { + return pagingCuponC; + } + + public void setPagingCuponC(Paging pagingCuponC) { + this.pagingCuponC = pagingCuponC; + } + + public PagedListWrapper getPlwCuponConvenio() { + return plwCuponConvenio; + } + + public void setPlwCuponConvenio(PagedListWrapper plwCuponConvenio) { + this.plwCuponConvenio = plwCuponConvenio; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + TipoConvenio tipoConvenio = (TipoConvenio) (cmbTipoConvenio.getSelectedItem() != null ? cmbTipoConvenio.getSelectedItem().getValue() : null); + + List cuponConveniosList = cuponConService.pesquisar(tipoConvenio); + CuponConvenioList.setData(cuponConveniosList); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verCuponConvenio(new CuponConvenio()); + + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + tipoConList = tipoConService.obtenerTodos(); + super.doAfterCompose(comp); + + CuponConvenioList.setItemRenderer(new RenderCuponConvenio()); + CuponConvenioList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + CuponConvenio cc = (CuponConvenio) CuponConvenioList.getSelected(); + verCuponConvenio(cc); + } + }); + refreshLista(); + } + + private void verCuponConvenio(CuponConvenio cc) { + if (cc == null) { + return; + } + + Map args = new HashMap(); + args.put("cc", cc); + args.put("CuponConvenioList", CuponConvenioList); + + openWindow("/gui/catalogos/editarCuponConvenio.zul", + Labels.getLabel("editarProductoServicioController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject cupon = + new HibernateSearchObject(CuponConvenio.class, pagingCuponC.getPageSize()); + + cupon.addFilterEqual("activo", Boolean.TRUE); + cupon.addFilterNotEqual("cuponConvenioID", -1); + + cupon.addSortAsc("tipoConvenio.descTipo"); + + plwCuponConvenio.init(cupon, CuponConvenioList, pagingCuponC); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaEmpresaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaEmpresaController.java new file mode 100644 index 000000000..fb0a835d5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaEmpresaController.java @@ -0,0 +1,229 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEmpresa; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Listheader; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Row; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaEmpresaController") +@Scope("prototype") +public class BusquedaEmpresaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwEmpresa; + private MyListbox empresaList; + private Paging pagingEmpresa; + private Textbox txtNombre; + private Textbox txtEquivalencia; + private Textbox txtRFC; + private Combobox cmbExterna; + private Combobox cmbIndTipo; + private Row rowEquivalencia; + private Listheader headerEquivalencia; + + public Combobox getCmbExterna() { + return cmbExterna; + } + + public void setCmbExterna(Combobox cmbExterna) { + this.cmbExterna = cmbExterna; + } + + public Paging getPagingEmpresa() { + return pagingEmpresa; + } + + public void setPagingEmpresa(Paging pagingEmpresa) { + this.pagingEmpresa = pagingEmpresa; + } + + public MyListbox getEmpresaList() { + return empresaList; + } + + public void setEmpresaList(MyListbox empresaList) { + this.empresaList = empresaList; + } + + public PagedListWrapper getPlwEmpresa() { + return plwEmpresa; + } + + public void setPlwEmpresa(PagedListWrapper plwEmpresa) { + this.plwEmpresa = plwEmpresa; + } + + public Textbox getTxtEquivalencia() { + return txtEquivalencia; + } + + public void setTxtEquivalencia(Textbox txtEquivalencia) { + this.txtEquivalencia = txtEquivalencia; + } + + public Listheader getHeaderEquivalencia() { + return headerEquivalencia; + } + + public void setHeaderEquivalencia(Listheader headerEquivalencia) { + this.headerEquivalencia = headerEquivalencia; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + public Textbox getTxtRFC() { + return txtRFC; + } + + public void setTxtRFC(Textbox txtRFC) { + this.txtRFC = txtRFC; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new Empresa()); + } + + public Combobox getCmbIndTipo() { + return cmbIndTipo; + } + + public void setCmbIndTipo(Combobox cmbIndTipo) { + this.cmbIndTipo = cmbIndTipo; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + empresaList.setItemRenderer(new RenderEmpresa()); + empresaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Empresa emp = (Empresa) empresaList.getSelected(); + verPeriodo(emp); + } + }); + + refreshLista(); + + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + headerEquivalencia.setVisible(Boolean.FALSE); + } + + txtNombre.focus(); + } + + private void verPeriodo(Empresa emp) { + if (emp == null) { + return; + } + + Map args = new HashMap(); + args.put("empresa", emp); + args.put("empresaList", empresaList); + + openWindow("/gui/catalogos/editarEmpresa.zul", + Labels.getLabel("editarEmpresaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject empresaBusqueda = + new HibernateSearchObject(Empresa.class, pagingEmpresa.getPageSize()); + + Comboitem ci = cmbExterna.getSelectedItem(); + String value; + if (ci != null) { + value = (String) ci.getValue(); + + if (value.equals("1")) { + empresaBusqueda.addFilterEqual("indExterna", Boolean.TRUE); + } else { + empresaBusqueda.addFilterEqual("indExterna", Boolean.FALSE); + } + } + + Comboitem cbiTipo = cmbIndTipo.getSelectedItem(); + Short tipo = null; + if (cbiTipo != null) { + tipo = Short.parseShort(cbiTipo.getValue().toString()); + empresaBusqueda.addFilterEqual("indTipo", tipo); + } + + if (!txtRFC.getText().isEmpty()) { + empresaBusqueda.addFilterEqual("rfc", txtRFC.getText()); + } + + empresaBusqueda.addFilterNotEqual("empresaId", -1); + empresaBusqueda.addFilterLike("nombempresa", "%" + txtNombre.getText().trim().concat("%")); + + if (!txtEquivalencia.getText().isEmpty()) { + empresaBusqueda.addFilterEqual("equivalenciaId", txtEquivalencia.getText()); + } + + empresaBusqueda.addFilterEqual("activo", Boolean.TRUE); + empresaBusqueda.addSortAsc("nombempresa"); + + plwEmpresa.init(empresaBusqueda, empresaList, pagingEmpresa); + + if (empresaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaEmpresaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaEstadoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaEstadoController.java new file mode 100644 index 000000000..787af83ef --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaEstadoController.java @@ -0,0 +1,208 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Pais; +import com.rjconsultores.ventaboletos.service.PaisService; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEstado; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Listheader; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Row; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaEstadoController") +@Scope("prototype") +public class BusquedaEstadoController extends MyGenericForwardComposer { + + @Autowired + private PaisService paisService; + @Autowired + private transient PagedListWrapper plwEstado; + private MyListbox estadoList; + private Paging pagingEstado; + private Textbox txtNombre; + private Textbox txtEquivalencia; + private Combobox cmbPais; + private List lsPais; + private Row rowEquivalencia; + private Listheader headerEquivalencia; + + public Combobox getCmbPais() { + return cmbPais; + } + + public void setCmbPais(Combobox cmbPais) { + this.cmbPais = cmbPais; + } + + public MyListbox getEstadoList() { + return estadoList; + } + + public void setEstadoList(MyListbox estadoList) { + this.estadoList = estadoList; + } + + public List getLsPais() { + return lsPais; + } + + public void setLsPais(List lsPais) { + this.lsPais = lsPais; + } + + public Paging getPagingEstado() { + return pagingEstado; + } + + public void setPagingEstado(Paging pagingEstado) { + this.pagingEstado = pagingEstado; + } + + public PaisService getPaisService() { + return paisService; + } + + public void setPaisService(PaisService paisService) { + this.paisService = paisService; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public Textbox getTxtEquivalencia() { + return txtEquivalencia; + } + + public void setTxtEquivalencia(Textbox txtEquivalencia) { + this.txtEquivalencia = txtEquivalencia; + } + + public Listheader getHeaderEquivalencia() { + return headerEquivalencia; + } + + public void setHeaderEquivalencia(Listheader headerEquivalencia) { + this.headerEquivalencia = headerEquivalencia; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsPais = paisService.obtenerTodos(); + super.doAfterCompose(comp); + + estadoList.setItemRenderer(new RenderEstado()); + estadoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Estado est = (Estado) estadoList.getSelected(); + verPeriodo(est); + } + }); + + refreshLista(); + + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + headerEquivalencia.setVisible(Boolean.FALSE); + } + + txtNombre.focus(); + } + + public void onClick$btnRefresh(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) throws InterruptedException { + verPeriodo(new Estado()); + } + + private void verPeriodo(Estado e) { + if (e == null) { + return; + } + + Map args = new HashMap(); + args.put("estado", e); + args.put("estadoList", estadoList); + + openWindow("/gui/catalogos/editarEstado.zul", + Labels.getLabel("editarEstadoController.window.title"), args, MODAL); + } + + private void refreshLista() throws InterruptedException { + HibernateSearchObject estadoBusqueda = + new HibernateSearchObject(Estado.class, pagingEstado.getPageSize()); + + estadoBusqueda.addFilterLike("nombestado", "%" + txtNombre.getText().trim().concat("%")); + + Comboitem itemPais = cmbPais.getSelectedItem(); + if (itemPais != null) { + Pais pais = (Pais) itemPais.getValue(); + estadoBusqueda.addFilterEqual("pais", pais); + } + + if (!txtEquivalencia.getText().isEmpty()) { + estadoBusqueda.addFilterLike("equivalenciaId", txtEquivalencia.getText().trim().concat("%")); + } + + estadoBusqueda.addFilterEqual("activo", Boolean.TRUE); + estadoBusqueda.addSortAsc("nombestado"); + estadoBusqueda.addFilterNotEqual("estadoId", -1); + + plwEstado.init(estadoBusqueda, estadoList, pagingEstado); + + if (estadoList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaEstadoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaFormaPagoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaFormaPagoController.java new file mode 100644 index 000000000..8a82f2e1b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaFormaPagoController.java @@ -0,0 +1,170 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderFormaPago; +import java.util.HashMap; +import java.util.Map; +import org.zkoss.zk.ui.Component; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Listheader; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Row; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaFormaPagoController") +@Scope("prototype") +public class BusquedaFormaPagoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwFormaPago; + private MyListbox formaPagoList; + private Paging pagingFormaPago; + private Textbox txtNome; + private Textbox txtEquivalencia; + private Row rowEquivalencia; + private Listheader headerEquivalencia; + + public MyListbox getFormaPagoList() { + return formaPagoList; + } + + public void setFormaPagoList(MyListbox formaPagoList) { + this.formaPagoList = formaPagoList; + } + + public Paging getPagingFormaPago() { + return pagingFormaPago; + } + + public void setPagingFormaPago(Paging pagingFormaPago) { + this.pagingFormaPago = pagingFormaPago; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Textbox getTxtEquivalencia() { + return txtEquivalencia; + } + + public void setTxtEquivalencia(Textbox txtEquivalencia) { + this.txtEquivalencia = txtEquivalencia; + } + + public Listheader getHeaderEquivalencia() { + return headerEquivalencia; + } + + public void setHeaderEquivalencia(Listheader headerEquivalencia) { + this.headerEquivalencia = headerEquivalencia; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + formaPagoList.setItemRenderer(new RenderFormaPago()); + formaPagoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + FormaPago c = (FormaPago) formaPagoList.getSelected(); + verFormaPago(c); + } + }); + + refreshLista(); + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + headerEquivalencia.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + private void verFormaPago(FormaPago f) { + if (f == null) { + return; + } + + Map args = new HashMap(); + args.put("formaPago", f); + args.put("busquedaFormaPagoController", this); + args.put("formaPagoList", formaPagoList); + + openWindow("/gui/catalogos/editarFormaPago.zul", + Labels.getLabel("editarFormaPagoController.window.title"), args, MODAL); + } + + public void refreshLista() { + HibernateSearchObject formaPagoBusqueda = + new HibernateSearchObject(FormaPago.class, + pagingFormaPago.getPageSize()); + + formaPagoBusqueda.addFilterLike("descpago", "%" + txtNome.getText().trim().concat("%")); + + if (!txtEquivalencia.getText().isEmpty()) { + formaPagoBusqueda.addFilterLike("equivalenciaId", txtEquivalencia.getText().trim().concat("%")); + } + + formaPagoBusqueda.addFilterNotEqual("formapagoId", -1); + formaPagoBusqueda.addSortAsc("descpago"); + formaPagoBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwFormaPago.init(formaPagoBusqueda, formaPagoList, pagingFormaPago); + + if (formaPagoList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaFormaPagoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verFormaPago(new FormaPago()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaMarcaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaMarcaController.java new file mode 100644 index 000000000..78c58ca7c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaMarcaController.java @@ -0,0 +1,172 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMarca; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Listheader; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Row; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaMarcaController") +@Scope("prototype") +public class BusquedaMarcaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwMarca; + private MyListbox marcaList; + private Paging pagingMarca; + private Textbox txtNome; + private Textbox txtEquivalencia; + private Row rowEquivalencia; + private Listheader headerEquivalencia; + + public MyListbox getMarcaList() { + return marcaList; + } + + public void setMarcaList(MyListbox marcaList) { + this.marcaList = marcaList; + } + + public Paging getPagingMarca() { + return pagingMarca; + } + + public void setPagingMarca(Paging pagingMarca) { + this.pagingMarca = pagingMarca; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Textbox getTxtEquivalencia() { + return txtEquivalencia; + } + + public void setTxtEquivalencia(Textbox txtEquivalencia) { + this.txtEquivalencia = txtEquivalencia; + } + + public Listheader getHeaderEquivalencia() { + return headerEquivalencia; + } + + public void setHeaderEquivalencia(Listheader headerEquivalencia) { + this.headerEquivalencia = headerEquivalencia; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + marcaList.setItemRenderer(new RenderMarca()); + marcaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Marca c = (Marca) marcaList.getSelected(); + verMarca(c); + } + }); + + refreshLista(); + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + headerEquivalencia.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + private void verMarca(Marca m) { + if (m == null) { + return; + } + + Map args = new HashMap(); + args.put("busquedaMarcaController", this); + args.put("marca", m); + args.put("marcaList", marcaList); + + openWindow("/gui/catalogos/editarMarca.zul", + Labels.getLabel("editarMarcaController.window.title"), args, MODAL); + } + + public void refreshLista() { + HibernateSearchObject marcaBusqueda = + new HibernateSearchObject(Marca.class, + pagingMarca.getPageSize()); + + marcaBusqueda.addFilterLike("descmarca", + "%" + txtNome.getText().trim().concat("%")); + + if (!txtEquivalencia.getText().isEmpty()) { + marcaBusqueda.addFilterEqual("equivalenciaId", txtEquivalencia.getText()); + } + + marcaBusqueda.addSortAsc("descmarca"); + marcaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + marcaBusqueda.addFilterNotEqual("marcaId", -1); + + plwMarca.init(marcaBusqueda, marcaList, pagingMarca); + + if (marcaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaMarcaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verMarca(new Marca()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaMonedaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaMonedaController.java new file mode 100644 index 000000000..20966d2e5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaMonedaController.java @@ -0,0 +1,174 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMoneda; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Listheader; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Row; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaMonedaController") +@Scope("prototype") +public class BusquedaMonedaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwMoneda; + private MyListbox monedaList; + private Paging pagingMoneda; + private Textbox txtNombre; + private Textbox txtEquivalencia; + private Row rowEquivalencia; + private Listheader headerEquivalencia; + + public Paging getPagingMoneda() { + return pagingMoneda; + } + + public void setPagingMoneda(Paging pagingMoneda) { + this.pagingMoneda = pagingMoneda; + } + + public MyListbox getMonedaList() { + return monedaList; + } + + public void setMonedaList(MyListbox monedaList) { + this.monedaList = monedaList; + } + + public PagedListWrapper getPlwMoneda() { + return plwMoneda; + } + + public void setPlwMoneda(PagedListWrapper plwMoneda) { + this.plwMoneda = plwMoneda; + } + + public Textbox getTxtEquivalencia() { + return txtEquivalencia; + } + + public void setTxtEquivalencia(Textbox txtEquivalencia) { + this.txtEquivalencia = txtEquivalencia; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public Listheader getHeaderEquivalencia() { + return headerEquivalencia; + } + + public void setHeaderEquivalencia(Listheader headerEquivalencia) { + this.headerEquivalencia = headerEquivalencia; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new Moneda()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + monedaList.setItemRenderer(new RenderMoneda()); + monedaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Moneda c = (Moneda) monedaList.getSelected(); + verPeriodo(c); + } + }); + + refreshLista(); + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + headerEquivalencia.setVisible(Boolean.FALSE); + } + + txtNombre.focus(); + } + + private void verPeriodo(Moneda c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("busquedaMonedaController", this); + args.put("moneda", c); + args.put("monedaList", monedaList); + + openWindow("/gui/catalogos/editarMoneda.zul", + Labels.getLabel("editarMonedaController.window.title"), args, MODAL); + } + + public void refreshLista() throws InterruptedException { + HibernateSearchObject monedaBusqueda = + new HibernateSearchObject(Moneda.class, pagingMoneda.getPageSize()); + + monedaBusqueda.addFilterLike("descmoneda", "%" + txtNombre.getText().trim().concat("%")); + if (!txtEquivalencia.getText().isEmpty()) { + monedaBusqueda.addFilterLike("equivalenciaId", txtEquivalencia.getText().trim().concat("%")); + } + + monedaBusqueda.addFilterEqual("activo", Boolean.TRUE); + monedaBusqueda.addSortAsc("descmoneda"); + monedaBusqueda.addFilterNotEqual("monedaId", -1); + + plwMoneda.init(monedaBusqueda, monedaList, pagingMoneda); + + if (monedaList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaMonedaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaPaisController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaPaisController.java new file mode 100644 index 000000000..a48a5a108 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaPaisController.java @@ -0,0 +1,157 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Pais; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPais; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Listheader; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Row; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaPaisController") +@Scope("prototype") +public class BusquedaPaisController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwPais; + private MyListbox paisList; + private Paging pagingPais; + private Textbox txtNombre; + private Row rowEquivalencia; + private Listheader headerEquivalencia; + + public Paging getPagingPais() { + return pagingPais; + } + + public void setPagingPais(Paging pagingPais) { + this.pagingPais = pagingPais; + } + + public MyListbox getPaisList() { + return paisList; + } + + public void setPaisList(MyListbox paisList) { + this.paisList = paisList; + } + + public PagedListWrapper getPlwPais() { + return plwPais; + } + + public void setPlwPais(PagedListWrapper plwPais) { + this.plwPais = plwPais; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public Listheader getHeaderEquivalencia() { + return headerEquivalencia; + } + + public void setHeaderEquivalencia(Listheader headerEquivalencia) { + this.headerEquivalencia = headerEquivalencia; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new Pais()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + paisList.setItemRenderer(new RenderPais()); + paisList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Pais c = (Pais) paisList.getSelected(); + verPeriodo(c); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verPeriodo(Pais c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("busquedaPaisController", this); + args.put("pais", c); + args.put("paisList", paisList); + + openWindow("/gui/catalogos/editarPais.zul", + Labels.getLabel("editarPaisController.window.title"), args, MODAL); + } + + public void refreshLista() throws InterruptedException { + HibernateSearchObject paisBusqueda = + new HibernateSearchObject(Pais.class, pagingPais.getPageSize()); + + paisBusqueda.addFilterLike("nombpais", "%" + txtNombre.getText().trim().concat("%")); + + paisBusqueda.addFilterEqual("activo", Boolean.TRUE); + paisBusqueda.addSortAsc("nombpais"); + //paisBusqueda.addFilterNotEqual("paisId", -1); + + plwPais.init(paisBusqueda, paisList, pagingPais); + + if (paisList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaPaisController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaPlazaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaPlazaController.java new file mode 100644 index 000000000..515f5023c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaPlazaController.java @@ -0,0 +1,132 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPlaza; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaPlazaController") +@Scope("prototype") +public class BusquedaPlazaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwPlaza; + private MyListbox plazaList; + private Paging pagingPlaza; + private Textbox txtNome; + + public MyListbox getPlazaList() { + return plazaList; + } + + public void setPlazaList(MyListbox plazaList) { + this.plazaList = plazaList; + } + + public Paging getPagingPlaza() { + return pagingPlaza; + } + + public void setPagingPlaza(Paging pagingPlaza) { + this.pagingPlaza = pagingPlaza; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + plazaList.setItemRenderer(new RenderPlaza()); + plazaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Plaza a = (Plaza) plazaList.getSelected(); + verPlaza(a); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verPlaza(Plaza a) { + if (a == null) { + return; + } + + Map args = new HashMap(); + args.put("plaza", a); + args.put("plazaList", plazaList); + + openWindow("/gui/catalogos/editarPlaza.zul", + Labels.getLabel("editarPlazaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject plazaBusqueda = + new HibernateSearchObject(Plaza.class, + pagingPlaza.getPageSize()); + + plazaBusqueda.addFilterLike("nombplaza", + "%" + txtNome.getText().trim().concat("%")); + + plazaBusqueda.addSortAsc("nombplaza"); + plazaBusqueda.addFilterNotEqual("plazaId", -1); + + plazaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwPlaza.init(plazaBusqueda, plazaList, pagingPlaza); + + if (plazaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaPlazaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPlaza(new Plaza()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaProductoServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaProductoServicioController.java new file mode 100644 index 000000000..f0763c247 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaProductoServicioController.java @@ -0,0 +1,137 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderProductoServicio; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Shiro + */ +@Controller("busquedaProductoServicioControllerMX") +@Scope("prototype") +public class BusquedaProductoServicioController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwProductoServicio; + private MyListbox PSList; + private Paging pagingPS; + private Textbox txtNombre; + + public MyListbox getPSList() { + return PSList; + } + + public void setPSList(MyListbox PSList) { + this.PSList = PSList; + } + + public Paging getPagingPS() { + return pagingPS; + } + + public void setPagingPS(Paging pagingPS) { + this.pagingPS = pagingPS; + } + + public PagedListWrapper getPlwProductoServicio() { + return plwProductoServicio; + } + + public void setPlwProductoServicio(PagedListWrapper plwProductoServicio) { + this.plwProductoServicio = plwProductoServicio; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verProductoServicio(new ProductoServicio()); + + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + PSList.setItemRenderer(new RenderProductoServicio()); + PSList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ProductoServicio ps = (ProductoServicio) PSList.getSelected(); + verProductoServicio(ps); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verProductoServicio(ProductoServicio ps) { + if (ps == null) { + return; + } + + Map args = new HashMap(); + args.put("ps", ps); + args.put("PSList", PSList); + + openWindow("/gui/catalogos/editarProductoServicio.zul", + Labels.getLabel("indexController.mniProductoServicio.label"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(ProductoServicio.class, pagingPS.getPageSize()); + + claseServicioBusqueda.addFilterLike("descproductoservicio", "%" + txtNombre.getText().trim().concat("%")); + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + claseServicioBusqueda.addSortAsc("descproductoservicio"); + claseServicioBusqueda.addFilterNotEqual("productoservicioId", -1); + + plwProductoServicio.init(claseServicioBusqueda, PSList, pagingPS); + if (PSList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaPeriodoVacacionalController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaPtovtaEmpresaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaPtovtaEmpresaController.java new file mode 100644 index 000000000..2c3683792 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaPtovtaEmpresaController.java @@ -0,0 +1,166 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPtovtaEmpresa; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Paging; + +/** + * + * @author Rafius + */ +@Controller("busquedaPtovtaEmpresaController") +@Scope("prototype") +public class BusquedaPtovtaEmpresaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwPtovtaEmpresa; + private MyListbox ptovtaEmpresaList; + private Paging pagingPtovtaEmpresa; + @Autowired + private EmpresaService empresaService; + @Autowired + private PuntoVentaService puntoVentaService; + private List lsEmpresa; + private List lsPuntoVenta; + private Combobox cmbEmpresa; + private Combobox cmbPuntoVenta; + + public Paging getPagingPtovtaEmpresa() { + return pagingPtovtaEmpresa; + } + + public void setPagingPtovtaEmpresa(Paging pagingPtovtaEmpresa) { + this.pagingPtovtaEmpresa = pagingPtovtaEmpresa; + } + + public MyListbox getPtovtaEmpresaList() { + return ptovtaEmpresaList; + } + + public void setPtovtaEmpresaList(MyListbox ptovtaEmpresaList) { + this.ptovtaEmpresaList = ptovtaEmpresaList; + } + + public PagedListWrapper getPlwPtovtaEmpresa() { + return plwPtovtaEmpresa; + } + + public void setPlwPtovtaEmpresa(PagedListWrapper plwPtovtaEmpresa) { + this.plwPtovtaEmpresa = plwPtovtaEmpresa; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new PtovtaEmpresa()); + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsPuntoVenta() { + return lsPuntoVenta; + } + + public void setLsPuntoVenta(List lsPuntoVenta) { + this.lsPuntoVenta = lsPuntoVenta; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.obtenerTodos(); + lsPuntoVenta = puntoVentaService.obtenerTodos(); + + super.doAfterCompose(comp); + + ptovtaEmpresaList.setItemRenderer(new RenderPtovtaEmpresa()); + ptovtaEmpresaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PtovtaEmpresa c = (PtovtaEmpresa) ptovtaEmpresaList.getSelected(); + verPeriodo(c); + } + }); + + refreshLista(); + + + } + + private void verPeriodo(PtovtaEmpresa c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("ptovtaEmpresa", c); + args.put("ptovtaEmpresaList", ptovtaEmpresaList); + + openWindow("/gui/catalogos/editarPtovtaEmpresa.zul", + Labels.getLabel("editarPtovtaEmpresaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject ptovtaEmpresa = + new HibernateSearchObject(PtovtaEmpresa.class, pagingPtovtaEmpresa.getPageSize()); + + Empresa empresa = (Empresa) (cmbEmpresa.getSelectedItem() != null ? cmbEmpresa.getSelectedItem().getValue() : null); + PuntoVenta puntoVenta = (PuntoVenta) (cmbPuntoVenta.getSelectedItem() != null ? cmbPuntoVenta.getSelectedItem().getValue() : null); + + if (empresa != null) { + ptovtaEmpresa.addFilterEqual("empresa", empresa); + } + if (puntoVenta != null) { + ptovtaEmpresa.addFilterEqual("puntoVenta", puntoVenta); + } + ptovtaEmpresa.addFilterEqual("activo", Boolean.TRUE); + + + plwPtovtaEmpresa.init(ptovtaEmpresa, ptovtaEmpresaList, pagingPtovtaEmpresa); + if (ptovtaEmpresaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaPtovtaEmpresaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaPuntoVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaPuntoVentaController.java new file mode 100644 index 000000000..88b09c421 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaPuntoVentaController.java @@ -0,0 +1,322 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Nodo; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.service.CiudadService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.service.NodoService; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPuntoVenta; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaPuntoVentaController") +@Scope("prototype") +public class BusquedaPuntoVentaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwPuntoVenta; + @Autowired + private EmpresaService empresaService; + @Autowired + private TipoPuntoVentaService tipoPuntoVentaService; + @Autowired + private MonedaService monedaService; + @Autowired + private NodoService nodoService; + private MyListbox puntoVentaList; + private Paging pagingPuntoVenta; + private Textbox txtNombre; + private Textbox txtCalle; + private Textbox txtNumero; + private Textbox txtColonia; + private Textbox txtTelefonoUno; + private Textbox txtTelefonoDos; + private List lsEmpresas; + private List lsTipoPuntoVenta; + private List lsMoneda; + private List lsNodos; + private Combobox cmbEmpresa; + private Combobox cmbTipoPontoVenta; + private Combobox cmbMoneda; + private Combobox cmbNodo; + private Radio radAprobacionAutorizado; + private Radio radAprobacionLatente; + + public Radio getRadAprobacionAutorizado() { + return radAprobacionAutorizado; + } + + public void setRadAprobacionAutorizado(Radio radAprobacionAutorizado) { + this.radAprobacionAutorizado = radAprobacionAutorizado; + } + + public Radio getRadAprobacionLatente() { + return radAprobacionLatente; + } + + public void setRadAprobacionLatente(Radio radAprobacionLatente) { + this.radAprobacionLatente = radAprobacionLatente; + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public Combobox getCmbMoneda() { + return cmbMoneda; + } + + public void setCmbMoneda(Combobox cmbMoneda) { + this.cmbMoneda = cmbMoneda; + } + + public Combobox getCmbNodo() { + return cmbNodo; + } + + public void setCmbNodo(Combobox cmbNodo) { + this.cmbNodo = cmbNodo; + } + + public Combobox getCmbTipoPontoVenta() { + return cmbTipoPontoVenta; + } + + public void setCmbTipoPontoVenta(Combobox cmbTipoPontoVenta) { + this.cmbTipoPontoVenta = cmbTipoPontoVenta; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public Paging getPagingPuntoVenta() { + return pagingPuntoVenta; + } + + public void setPagingPuntoVenta(Paging pagingPuntoVenta) { + this.pagingPuntoVenta = pagingPuntoVenta; + } + + public MyListbox getPuntoVentaList() { + return puntoVentaList; + } + + public void setPuntoVentaList(MyListbox puntoVentaList) { + this.puntoVentaList = puntoVentaList; + } + + public PagedListWrapper getPlwPuntoVenta() { + return plwPuntoVenta; + } + + public void setPlwPuntoVenta(PagedListWrapper plwPuntoVenta) { + this.plwPuntoVenta = plwPuntoVenta; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new PuntoVenta()); + } + + public List getLsEmpresas() { + return lsEmpresas; + } + + public void setLsEmpresas(List lsEmpresas) { + this.lsEmpresas = lsEmpresas; + } + + public List getLsMoneda() { + return lsMoneda; + } + + public void setLsMoneda(List lsMoneda) { + this.lsMoneda = lsMoneda; + } + + public List getLsNodos() { + return lsNodos; + } + + public void setLsNodos(List lsNodos) { + this.lsNodos = lsNodos; + } + + public List getLsTipoPuntoVenta() { + return lsTipoPuntoVenta; + } + + public void setLsTipoPuntoVenta(List lsTipoPuntoVenta) { + this.lsTipoPuntoVenta = lsTipoPuntoVenta; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + lsEmpresas = empresaService.obtenerIndTipo1(); + lsTipoPuntoVenta = tipoPuntoVentaService.obtenerTodos(); + lsMoneda = monedaService.obtenerTodos(); + lsNodos = nodoService.obtenerTodos(); + + puntoVentaList.setItemRenderer(new RenderPuntoVenta()); + puntoVentaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PuntoVenta c = (PuntoVenta) puntoVentaList.getSelected(); + verPeriodo(c); + } + }); + + refreshLista(); + txtNombre.focus(); + } + + private void verPeriodo(PuntoVenta c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("puntoVenta", c); + args.put("puntoVentaList", puntoVentaList); + + openWindow("/gui/catalogos/editarPuntoVenta.zul", + Labels.getLabel("editarPuntoVentaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(PuntoVenta.class, + pagingPuntoVenta.getPageSize()); + + claseServicioBusqueda.addFilterLike("nombpuntoventa", + "%" + txtNombre.getText().trim().concat("%")); + + Comboitem itemEmpresa = cmbEmpresa.getSelectedItem(); + Comboitem itemTipoPontoVenta = cmbTipoPontoVenta.getSelectedItem(); + Comboitem itemMoneda = cmbMoneda.getSelectedItem(); + Comboitem itemNodo = cmbNodo.getSelectedItem(); + + Empresa empresa; + TipoPuntoVenta tipoPontoVenta; + Moneda moneda; + Nodo nodo; + Ciudad ciudad; + String statusAprobacion = null; + + if (radAprobacionAutorizado.isChecked()) { + statusAprobacion = "A"; + } else if (radAprobacionLatente.isChecked()) { + statusAprobacion = "L"; + } + + if (statusAprobacion != null) { + claseServicioBusqueda.addFilterEqual("statusaprobacion", statusAprobacion); + } + + if (itemEmpresa != null) { + empresa = (Empresa) itemEmpresa.getValue(); + claseServicioBusqueda.addFilterEqual("empresa", empresa); + } + + if (itemTipoPontoVenta != null) { + tipoPontoVenta = (TipoPuntoVenta) itemTipoPontoVenta.getValue(); + claseServicioBusqueda.addFilterEqual("tipoPuntoVenta", tipoPontoVenta); + } + + if (itemMoneda != null) { + moneda = (Moneda) itemMoneda.getValue(); + claseServicioBusqueda.addFilterEqual("moneda", moneda); + } + + if (itemNodo != null) { + nodo = (Nodo) itemNodo.getValue(); + claseServicioBusqueda.addFilterEqual("nodo", nodo); + } + + if (!txtCalle.getText().isEmpty()) { + claseServicioBusqueda.addFilterLike("direccioncalle", txtCalle.getText()); + } + + if (!txtNumero.getText().isEmpty()) { + claseServicioBusqueda.addFilterLike("direccionnumero", txtNumero.getText()); + } + + if (!txtColonia.getText().isEmpty()) { + claseServicioBusqueda.addFilterLike("direccioncolonia", txtColonia.getText()); + } + + if (!txtTelefonoUno.getText().isEmpty()) { + claseServicioBusqueda.addFilterLike("numtelefonouno", txtTelefonoUno.getText()); + } + + if (!txtTelefonoDos.getText().isEmpty()) { + claseServicioBusqueda.addFilterLike("numtelefonodos", txtTelefonoDos.getText()); + } + + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + claseServicioBusqueda.addSortAsc("nombpuntoventa"); + claseServicioBusqueda.addFilterNotEqual("puntoventaId", -1); + + plwPuntoVenta.init(claseServicioBusqueda, puntoVentaList, pagingPuntoVenta); + + if (puntoVentaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoConvenioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoConvenioController.java new file mode 100644 index 000000000..b32afe0d4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoConvenioController.java @@ -0,0 +1,127 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.TipoConvenio; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoConvenio; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Shiro + */ +@Controller("busquedaTipoConvenioController") +@Scope("prototype") +public class BusquedaTipoConvenioController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTipoConvenio; + private MyListbox tConvenioList; + private Paging pagingTipoConvenio; + private Textbox txtNombre; + + public Paging getPagingTipoConvenio() { + return pagingTipoConvenio; + } + + public void setPagingTipoConvenio(Paging pagingTipoConvenio) { + this.pagingTipoConvenio = pagingTipoConvenio; + } + + public PagedListWrapper getPlwTipoConvenio() { + return plwTipoConvenio; + } + + public void setPlwTipoConvenio(PagedListWrapper plwTipoConvenio) { + this.plwTipoConvenio = plwTipoConvenio; + } + + public MyListbox gettConvenioList() { + return tConvenioList; + } + + public void settConvenioList(MyListbox tConvenioList) { + this.tConvenioList = tConvenioList; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTipoConvenio(new TipoConvenio()); + + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tConvenioList.setItemRenderer(new RenderTipoConvenio()); + tConvenioList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TipoConvenio tc = (TipoConvenio) tConvenioList.getSelected(); + verTipoConvenio(tc); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verTipoConvenio(TipoConvenio tc) { + if (tc == null) { + return; + } + + Map args = new HashMap(); + args.put("tc", tc); + args.put("tConvenioList", tConvenioList); + + openWindow("/gui/catalogos/editarTipoConvenio.zul", + Labels.getLabel("busquedaTipoConvenioController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(TipoConvenio.class, pagingTipoConvenio.getPageSize()); + + claseServicioBusqueda.addFilterLike("descTipo", "%" + txtNombre.getText().trim().concat("%")); + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + claseServicioBusqueda.addFilterNotEqual("tipoConvenioID", -1); + claseServicioBusqueda.addSortAsc("descTipo"); + + plwTipoConvenio.init(claseServicioBusqueda, tConvenioList, pagingTipoConvenio); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoCorteController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoCorteController.java new file mode 100644 index 000000000..c9a5554e5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoCorteController.java @@ -0,0 +1,131 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.TipoCorte; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoCorte; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaTipoCorteController") +@Scope("prototype") +public class BusquedaTipoCorteController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTipoCorte; + private MyListbox tipoCorteList; + private Paging pagingTipoCorte; + private Textbox txtNome; + + public Paging getPagingTipoCorte() { + return pagingTipoCorte; + } + + public void setPagingTipoCorte(Paging pagingTipoCorte) { + this.pagingTipoCorte = pagingTipoCorte; + } + + public MyListbox getTipoCorteList() { + return tipoCorteList; + } + + public void setTipoCorteList(MyListbox tipoCorteList) { + this.tipoCorteList = tipoCorteList; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tipoCorteList.setItemRenderer(new RenderTipoCorte()); + tipoCorteList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TipoCorte a = (TipoCorte) tipoCorteList.getSelected(); + verTipoCorte(a); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verTipoCorte(TipoCorte a) { + if (a == null) { + return; + } + + Map args = new HashMap(); + args.put("tipoCorte", a); + args.put("tipoCorteList", tipoCorteList); + + openWindow("/gui/catalogos/editarTipoCorte.zul", + Labels.getLabel("editarTipoCorteController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject tipoCorteBusqueda = + new HibernateSearchObject(TipoCorte.class, + pagingTipoCorte.getPageSize()); + + tipoCorteBusqueda.addFilterLike("desctipo", + "%" + txtNome.getText().trim().concat("%")); + + tipoCorteBusqueda.addSortAsc("desctipo"); + tipoCorteBusqueda.addFilterEqual("activo", Boolean.TRUE); + tipoCorteBusqueda.addFilterNotEqual("tipocorteId", -1); + + plwTipoCorte.init(tipoCorteBusqueda, tipoCorteList, pagingTipoCorte); + + if (tipoCorteList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaArticuloController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTipoCorte(new TipoCorte()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoPuntoVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoPuntoVentaController.java new file mode 100644 index 000000000..306b2d83e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoPuntoVentaController.java @@ -0,0 +1,171 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoPuntoVenta; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Listheader; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Row; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaTipoPuntoVentaController") +@Scope("prototype") +public class BusquedaTipoPuntoVentaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTipoPuntoVenta; + private MyListbox tipoPuntoVentaList; + private Paging pagingTipoPuntoVenta; + private Textbox txtNome; + private Textbox txtEquivalenciaTPV; + private Row rowEquivalencia; + private Listheader headerEquivalencia; + + public Paging getPagingTipoPuntoVenta() { + return pagingTipoPuntoVenta; + } + + public void setPagingTipoPuntoVenta(Paging pagingTipoPuntoVenta) { + this.pagingTipoPuntoVenta = pagingTipoPuntoVenta; + } + + public MyListbox getTipoPuntoVentaList() { + return tipoPuntoVentaList; + } + + public void setTipoPuntoVentaList(MyListbox tipoPuntoVentaList) { + this.tipoPuntoVentaList = tipoPuntoVentaList; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Listheader getHeaderEquivalencia() { + return headerEquivalencia; + } + + public void setHeaderEquivalencia(Listheader headerEquivalencia) { + this.headerEquivalencia = headerEquivalencia; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + public Textbox getTxtEquivalenciaTPV() { + return txtEquivalenciaTPV; + } + + public void setTxtEquivalenciaTPV(Textbox txtEquivalenciaTPV) { + this.txtEquivalenciaTPV = txtEquivalenciaTPV; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tipoPuntoVentaList.setItemRenderer(new RenderTipoPuntoVenta()); + tipoPuntoVentaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TipoPuntoVenta tpv = (TipoPuntoVenta) tipoPuntoVentaList.getSelected(); + verTipoPuntoVenta(tpv); + } + }); + + refreshLista(); + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + headerEquivalencia.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + private void verTipoPuntoVenta(TipoPuntoVenta tpv) { + if (tpv == null) { + return; + } + + Map args = new HashMap(); + args.put("tipoPuntoVenta", tpv); + args.put("tipoPuntoVentaList", tipoPuntoVentaList); + + openWindow("/gui/catalogos/editarTipoPuntoVenta.zul", + Labels.getLabel("editarTipoPuntoVentaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(TipoPuntoVenta.class, + pagingTipoPuntoVenta.getPageSize()); + + claseServicioBusqueda.addFilterLike("desctipo", + "%" + txtNome.getText().trim().concat("%")); + + if (!txtEquivalenciaTPV.getText().isEmpty()) { + claseServicioBusqueda.addFilterLike("equivalenciaId", txtEquivalenciaTPV.getText().trim().concat("%")); + } + + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + claseServicioBusqueda.addSortAsc("desctipo"); + claseServicioBusqueda.addFilterNotEqual("tipoptovtaId", -1); + + plwTipoPuntoVenta.init(claseServicioBusqueda, tipoPuntoVentaList, + pagingTipoPuntoVenta); + + if (tipoPuntoVentaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTipoPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTipoPuntoVenta(new TipoPuntoVenta()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoServicioController.java new file mode 100644 index 000000000..2027296d5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoServicioController.java @@ -0,0 +1,129 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.TipoServicio; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoServicio; +import java.util.HashMap; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaTipoServicioController") +@Scope("prototype") +public class BusquedaTipoServicioController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTipoServicio; + private MyListbox tipoServicioList; + private Paging pagingTipoServicio; + private Textbox txtNombre; + + public Paging getPagingTipoServicio() { + return pagingTipoServicio; + } + + public void setPagingTipoServicio(Paging pagingTipoServicio) { + this.pagingTipoServicio = pagingTipoServicio; + } + + public MyListbox getTipoServicioList() { + return tipoServicioList; + } + + public void setTipoServicioList(MyListbox tipoServicioList) { + this.tipoServicioList = tipoServicioList; + } + + public PagedListWrapper getPlwTipoServicio() { + return plwTipoServicio; + } + + public void setPlwTipoServicio(PagedListWrapper plwTipoServicio) { + this.plwTipoServicio = plwTipoServicio; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new TipoServicio()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tipoServicioList.setItemRenderer(new RenderTipoServicio()); + tipoServicioList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TipoServicio ts = (TipoServicio) tipoServicioList.getSelected(); + verPeriodo(ts); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verPeriodo(TipoServicio ts) { + if (ts == null) { + return; + } + + Map args = new HashMap(); + args.put("tipoServicio", ts); + args.put("tipoServicioList", tipoServicioList); + + openWindow("/gui/catalogos/editarTipoServicio.zul", + Labels.getLabel("editarTipoServicioController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(TipoServicio.class, pagingTipoServicio.getPageSize()); + + claseServicioBusqueda.addFilterLike("descservicio", "%" + txtNombre.getText().trim().concat("%")); + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + claseServicioBusqueda.addSortAsc("descservicio"); + claseServicioBusqueda.addFilterNotEqual("tiposervicioId", -1); + + plwTipoServicio.init(claseServicioBusqueda, tipoServicioList, pagingTipoServicio); + + if (tipoServicioList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTipoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoVentaController.java new file mode 100644 index 000000000..bf66d8901 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTipoVentaController.java @@ -0,0 +1,136 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.TipoVenta; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoVenta; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaTipoVentaController") +@Scope("prototype") +public class BusquedaTipoVentaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTipoVenta; + private MyListbox tipoVentaList; + private Paging pagingTipoVenta; + private Textbox txtNombre; + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public Paging getPagingTipoVenta() { + return pagingTipoVenta; + } + + public void setPagingTipoVenta(Paging pagingTipoVenta) { + this.pagingTipoVenta = pagingTipoVenta; + } + + public MyListbox getTipoVentaList() { + return tipoVentaList; + } + + public void setTipoVentaList(MyListbox tipoVentaList) { + this.tipoVentaList = tipoVentaList; + } + + public PagedListWrapper getPlwTipoVenta() { + return plwTipoVenta; + } + + public void setPlwTipoVenta(PagedListWrapper plwTipoVenta) { + this.plwTipoVenta = plwTipoVenta; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new TipoVenta()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tipoVentaList.setItemRenderer(new RenderTipoVenta()); + tipoVentaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TipoVenta ts = (TipoVenta) tipoVentaList.getSelected(); + verPeriodo(ts); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verPeriodo(TipoVenta ts) { + if (ts == null) { + return; + } + + Map args = new HashMap(); + args.put("tipoVenta", ts); + args.put("tipoVentaList", tipoVentaList); + + openWindow("/gui/catalogos/editarTipoVenta.zul", + Labels.getLabel("editarTipoVentaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseVentaBusqueda = + new HibernateSearchObject(TipoVenta.class, pagingTipoVenta.getPageSize()); + + claseVentaBusqueda.addFilterLike("desctipoventa", "%" + txtNombre.getText().trim().concat("%")); + claseVentaBusqueda.addFilterEqual("activo", Boolean.TRUE); + claseVentaBusqueda.addSortAsc("desctipoventa"); + claseVentaBusqueda.addFilterNotEqual("tipoventaId", -1); + + plwTipoVenta.init(claseVentaBusqueda, tipoVentaList, pagingTipoVenta); + + if (tipoVentaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTipoVentaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTurnoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTurnoController.java new file mode 100644 index 000000000..883051871 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/BusquedaTurnoController.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Turno; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTurno; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaTurnoController") +@Scope("prototype") +public class BusquedaTurnoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTurno; + private MyListbox turnoList; + private Paging pagingTurno; + private Textbox txtNome; + + public Paging getPagingTurno() { + return pagingTurno; + } + + public void setPagingTurno(Paging pagingTurno) { + this.pagingTurno = pagingTurno; + } + + public MyListbox getTurnoList() { + return turnoList; + } + + public void setTurnoList(MyListbox turnoList) { + this.turnoList = turnoList; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + turnoList.setItemRenderer(new RenderTurno()); + turnoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Turno a = (Turno) turnoList.getSelected(); + verTurno(a); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verTurno(Turno t) { + if (t == null) { + return; + } + + Map args = new HashMap(); + args.put("turno", t); + args.put("turnoList", turnoList); + + openWindow("/gui/catalogos/editarTurno.zul", + Labels.getLabel("editarTurnoController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject turnoBusqueda = + new HibernateSearchObject(Turno.class, + pagingTurno.getPageSize()); + + turnoBusqueda.addFilterLike("descturno", + "%" + txtNome.getText().trim().concat("%")); + + turnoBusqueda.addSortAsc("descturno"); + turnoBusqueda.addFilterEqual("activo", Boolean.TRUE); + turnoBusqueda.addFilterNotEqual("turnoId", -1); + plwTurno.init(turnoBusqueda, turnoList, pagingTurno); + + if (turnoList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTurnoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTurno(new Turno()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarArticuloController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarArticuloController.java new file mode 100644 index 000000000..1e324a547 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarArticuloController.java @@ -0,0 +1,145 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Articulo; +import com.rjconsultores.ventaboletos.service.ArticuloService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarArticuloController") +@Scope("prototype") +public class EditarArticuloController extends MyGenericForwardComposer { + + @Autowired + private ArticuloService articuloService; + private Articulo articulo; + private MyListbox articuloList; + private Button btnApagar; + private MyTextbox txtNome; + private static Logger log = Logger.getLogger(EditarArticuloController.class); + + public Articulo getArticulo() { + return articulo; + } + + public void setArticulo(Articulo articulo) { + this.articulo = articulo; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + articulo = (Articulo) Executions.getCurrent().getArg().get("articulo"); + articuloList = (MyListbox) Executions.getCurrent().getArg().get("articuloList"); + + if (articulo.getArticuloId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + + try { + articulo.setActivo(Boolean.TRUE); + articulo.setFecmodif(Calendar.getInstance().getTime()); + articulo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsArticulo = articuloService.buscar(articulo.getDescarticulo()); + + if (!lsArticulo.isEmpty()) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarArticuloController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (articulo.getArticuloId() == null) { + articuloService.suscribir(articulo); + articuloList.addItem(articulo); + } else { + articuloService.actualizacion(articulo); + articuloList.updateItem(articulo); + } + + Messagebox.show( + Labels.getLabel("editarArticuloController.MSG.suscribirOK"), + Labels.getLabel("editarArticuloController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error("editarArticuloController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarArticuloController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarArticuloController.MSG.borrarPergunta"), + Labels.getLabel("editarArticuloController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + articuloService.borrar(articulo); + + Messagebox.show( + Labels.getLabel("editarArticuloController.MSG.borrarOK"), + Labels.getLabel("editarArticuloController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + articuloList.removeItem(articulo); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarAsociacionClaseServicioMarcaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarAsociacionClaseServicioMarcaController.java new file mode 100644 index 000000000..afe9172a1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarAsociacionClaseServicioMarcaController.java @@ -0,0 +1,215 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.MarcaClaseServicio; +import com.rjconsultores.ventaboletos.entidad.MarcaClaseServicioPK; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Messagebox; + +/** + * + * @author rodrigo + */ +@Controller("editarAsociacionClaseServicioMarcaController") +@Scope("prototype") +public class EditarAsociacionClaseServicioMarcaController extends MyGenericForwardComposer { + + @Autowired + private MarcaClaseServicioService marcaClaseServicioService; + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseServicioService; + private MarcaClaseServicio marcaClaseServicio; + private List lsMarcas; + private List lsClaseServicios; + private MyListbox marcaClaseServicioList; + private Combobox cmbMarca; + private Combobox cmbClaseServicio; + private Button btnApagar; + private static Logger log = + Logger.getLogger(EditarAsociacionClaseServicioMarcaController.class); + + public List getLsClaseServicios() { + return lsClaseServicios; + } + + public void setLsClaseServicios(List lsClaseServicios) { + this.lsClaseServicios = lsClaseServicios; + } + + public List getLsMarcas() { + return lsMarcas; + } + + public void setLsMarcas(List lsMarcas) { + this.lsMarcas = lsMarcas; + } + + public MarcaClaseServicio getMarcaClaseServicio() { + return marcaClaseServicio; + } + + public void setMarcaClaseServicio(MarcaClaseServicio marcaClaseServicio) { + this.marcaClaseServicio = marcaClaseServicio; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsMarcas = marcaService.obtenerTodos(); + lsClaseServicios = claseServicioService.obtenerTodos(); + + marcaClaseServicioList = (MyListbox) Executions.getCurrent().getArg().get("marcaClaseServicioList"); + marcaClaseServicio = (MarcaClaseServicio) Executions.getCurrent().getArg().get("marcaClaseServicio"); + + super.doAfterCompose(comp); + + if (marcaClaseServicio.getMarcaClaseservicioPK() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + cmbMarca.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + cmbMarca.getSelectedItem().getValue(); + cmbClaseServicio.getSelectedItem().getValue(); + + try { + if (marcaClaseServicio.getMarcaClaseservicioPK() != null) { + MarcaClaseServicioPK marcaClaseServicioPK = new MarcaClaseServicioPK(); + marcaClaseServicioPK.setMarca((Marca) cmbMarca.getSelectedItem().getValue()); + marcaClaseServicioPK.setClaseservicio((ClaseServicio) cmbClaseServicio.getSelectedItem().getValue()); + + MarcaClaseServicio mcs = marcaClaseServicioService.obtenerID(marcaClaseServicioPK); + + + if (mcs != null && !mcs.getMarcaClaseservicioPK().equals(marcaClaseServicio.getMarcaClaseservicioPK())) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarAsociacionClaseServicioMarcaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + } + if (marcaClaseServicio.getMarcaClaseservicioPK() == null) { + MarcaClaseServicioPK marcaClaseServicioPK = new MarcaClaseServicioPK(); + marcaClaseServicioPK.setMarca((Marca) cmbMarca.getSelectedItem().getValue()); + marcaClaseServicioPK.setClaseservicio((ClaseServicio) cmbClaseServicio.getSelectedItem().getValue()); + + MarcaClaseServicio mcs = marcaClaseServicioService.obtenerID(marcaClaseServicioPK); + + + if (mcs == null || !mcs.getActivo()) { + marcaClaseServicio.setMarcaClaseservicioPK(marcaClaseServicioPK); + if (mcs == null) { + marcaClaseServicio.setActivo(true); + marcaClaseServicioService.suscribir(marcaClaseServicio); + marcaClaseServicioList.addItem(marcaClaseServicio); + } else { + mcs.setActivo(true); + marcaClaseServicioService.suscribir(mcs); + marcaClaseServicioList.addItem(mcs); + } + + Messagebox.show( + Labels.getLabel("editarAsociacionClaseServicioMarcaController.MSG.suscribirOK"), + Labels.getLabel("editarAsociacionClaseServicioMarcaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarAsociacionClaseServicioMarcaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + marcaClaseServicio.getMarcaClaseservicioPK().setMarca((Marca) cmbMarca.getSelectedItem().getValue()); + marcaClaseServicio.getMarcaClaseservicioPK().setClaseservicio((ClaseServicio) cmbClaseServicio.getSelectedItem().getValue()); + + marcaClaseServicioService.actualizacion(marcaClaseServicio); + marcaClaseServicioList.updateItem(marcaClaseServicio); + + Messagebox.show( + Labels.getLabel("editarAsociacionClaseServicioMarcaController.MSG.suscribirOK"), + Labels.getLabel("editarAsociacionClaseServicioMarcaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + + closeWindow(); + } catch (Exception ex) { + log.error("editarAsociacionClaseServicioMarcaController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarAsociacionClaseServicioMarcaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarAsociacionClaseServicioMarcaController.MSG.borrarPergunta"), + Labels.getLabel("editarAsociacionClaseServicioMarcaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + marcaClaseServicioService.borrar(marcaClaseServicio); + + Messagebox.show( + Labels.getLabel("editarAsociacionClaseServicioMarcaController.MSG.borrarOK"), + Labels.getLabel("editarAsociacionClaseServicioMarcaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + marcaClaseServicioList.removeItem(marcaClaseServicio); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarCategoriaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarCategoriaController.java new file mode 100644 index 000000000..ee816438c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarCategoriaController.java @@ -0,0 +1,171 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.service.CategoriaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarCategoriaController") +@Scope("prototype") +public class EditarCategoriaController extends MyGenericForwardComposer { + + @Autowired + private CategoriaService categoriaService; + private Categoria categoria; + private MyListbox categoriaList; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarCategoriaController.class); + private MyTextbox txtNome; + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + categoria = (Categoria) Executions.getCurrent().getArg().get("categoria"); + categoriaList = (MyListbox) Executions.getCurrent().getArg().get("categoriaList"); + + if (categoria.getCategoriaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + if (categoria.getCategoriaId() == 1) { + btnApagar.setVisible(Boolean.FALSE); + txtNome.setDisabled(Boolean.TRUE); + + Messagebox.show( + Labels.getLabel("MSG.noEditabled"), + Labels.getLabel("editarCategoriaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + try { + categoria.setActivo(true); + categoria.setFecmodif(Calendar.getInstance().getTime()); + categoria.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (categoria.getCategoriaId() != null) { + List lsCategoria = categoriaService.buscar(categoria.getDesccategoria()); + if (!lsCategoria.isEmpty()) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + } + + if (categoria.getCategoriaId() == null) { + List lsCategoria = + categoriaService.buscar(categoria.getDesccategoria().trim()); + + if (lsCategoria.isEmpty()) { + categoriaService.suscribir(categoria); + categoriaList.addItem(categoria); + + Messagebox.show( + Labels.getLabel("editarCategoriaController.MSG.suscribirOK"), + Labels.getLabel("editarCategoriaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + categoriaService.actualizacion(categoria); + categoriaList.updateItem(categoria); + + Messagebox.show( + Labels.getLabel("editarCategoriaController.MSG.suscribirOK"), + Labels.getLabel("editarCategoriaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + + closeWindow(); + } catch (Exception ex) { + log.error("editarCategoriaController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarCategoriaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarCategoriaController.MSG.borrarPergunta"), + Labels.getLabel("editarCategoriaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + categoriaService.borrar(categoria); + + Messagebox.show( + Labels.getLabel("editarCategoriaController.MSG.borrarOK"), + Labels.getLabel("editarCategoriaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + categoriaList.removeItem(categoria); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public Categoria getCategoria() { + return categoria; + } + + public void setCategoria(Categoria categoria) { + this.categoria = categoria; + } + + public MyListbox getCategoriaList() { + return categoriaList; + } + + public void setCategoriaList(MyListbox categoriaList) { + this.categoriaList = categoriaList; + } + + public CategoriaService getCategoriaService() { + return categoriaService; + } + + public void setCategoriaService(CategoriaService categoriaService) { + this.categoriaService = categoriaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarCiudadController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarCiudadController.java new file mode 100644 index 000000000..ee7b526e3 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarCiudadController.java @@ -0,0 +1,230 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.service.CiudadService; +import com.rjconsultores.ventaboletos.service.EstadoService; +import com.rjconsultores.ventaboletos.service.PlazaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Row; + +/** + * + * @author MCosso + */ +@Controller("editarCiudadController") +@Scope("prototype") +public class EditarCiudadController extends MyGenericForwardComposer { + + @Autowired + private CiudadService ciudadService; + @Autowired + private EstadoService estadoService; + @Autowired + private PlazaService plazaService; + private List lsEstado; + private List lsPlaza; + private Ciudad ciudad; + private MyListbox ciudadList; + private static Logger log = Logger.getLogger(EditarCiudadController.class); + private MyTextbox txtNome; + private Combobox cmbEstado; + private Combobox cmbPlaza; + private Button btnApagar; + private Row rowEquivalencia; + + public Ciudad getCiudad() { + return ciudad; + } + + public void setCiudad(Ciudad ciudad) { + this.ciudad = ciudad; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public MyListbox getCiudadList() { + return ciudadList; + } + + public void setCiudadList(MyListbox ciudadList) { + this.ciudadList = ciudadList; + } + + public List getLsEstado() { + return lsEstado; + } + + public void setLsEstado(List lsEstado) { + this.lsEstado = lsEstado; + } + + public List getLsPlaza() { + return lsPlaza; + } + + public void setLsPlaza(List lsPlaza) { + this.lsPlaza = lsPlaza; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public Combobox getCmbEstado() { + return cmbEstado; + } + + public void setCmbEstado(Combobox cmbEstado) { + this.cmbEstado = cmbEstado; + } + + public Combobox getCmbPlaza() { + return cmbPlaza; + } + + public void setCmbPlaza(Combobox cmbPlaza) { + this.cmbPlaza = cmbPlaza; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEstado = estadoService.obtenerTodos(); + lsPlaza = plazaService.obtenerTodos(); + + super.doAfterCompose(comp); + + ciudad = (Ciudad) Executions.getCurrent().getArg().get("ciudad"); + ciudadList = (MyListbox) Executions.getCurrent().getArg().get("ciudadList"); + + if (ciudad.getCiudadId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + cmbEstado.getValue(); + cmbEstado.getValue(); + + try { + ciudad.setActivo(Boolean.TRUE); + ciudad.setFecmodif(Calendar.getInstance().getTime()); + ciudad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsCiudad = ciudadService.buscar(ciudad.getNombciudad(), + ciudad.getEstado(), ciudad.getPlaza()); + + boolean podeSalvar = false; + if (lsCiudad.isEmpty()) { + podeSalvar = true; + } else { + if (ciudad.getCiudadId() != null) { + for (Ciudad c : lsCiudad) { + if (c.getCiudadId().equals(ciudad.getCiudadId())) { + podeSalvar = true; + } + } + } + } + if (podeSalvar) { + if (ciudad.getCiudadId() == null) { + ciudadService.suscribir(ciudad); + ciudadList.addItem(ciudad); + } else { + ciudadService.actualizacion(ciudad); + ciudadList.updateItem(ciudad); + } + + Messagebox.show( + Labels.getLabel("editarCiudadController.MSG.suscribirOK"), + Labels.getLabel("editarCiudadController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarCiudadController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error("editarCiudadController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarCiudadController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarCiudadController.MSG.borrarPergunta"), + Labels.getLabel("editarCiudadController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + ciudadService.borrar(ciudad); + + Messagebox.show( + Labels.getLabel("editarCiudadController.MSG.borrarOK"), + Labels.getLabel("editarCiudadController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + ciudadList.removeItem(ciudad); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarClaseServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarClaseServicioController.java new file mode 100644 index 000000000..1c9a3c5ef --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarClaseServicioController.java @@ -0,0 +1,145 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.util.resource.Labels; +import org.zkoss.zul.Button; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarClaseServicioController") +@Scope("prototype") +public class EditarClaseServicioController extends MyGenericForwardComposer { + + @Autowired + private ClaseServicioService claseServicioService; + private ClaseServicio claseServicio; + private MyListbox claseServicioList; + private MyTextbox txtNome; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarClaseServicioController.class); + + public ClaseServicio getClaseServicio() { + return claseServicio; + } + + public void setClaseServicio(ClaseServicio claseServicio) { + this.claseServicio = claseServicio; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + claseServicio = (ClaseServicio) Executions.getCurrent().getArg().get("claseServicio"); + claseServicioList = (MyListbox) Executions.getCurrent().getArg().get("claseServicioList"); + + if (claseServicio.getClaseservicioId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getText(); + + try { + String nomeClaseServicio = claseServicio.getDescclase(); + List lsClaseServicio = claseServicioService.buscarPorNome(nomeClaseServicio); + + if (lsClaseServicio.isEmpty()) { + claseServicio.setActivo(Boolean.TRUE); + claseServicio.setFecmodif(Calendar.getInstance().getTime()); + claseServicio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (claseServicio.getClaseservicioId() == null) { + claseServicioService.suscribir(claseServicio); + claseServicioList.addItem(claseServicio); + } else { + claseServicioService.actualizacion(claseServicio); + claseServicioList.updateItem(claseServicio); + } + + Messagebox.show( + Labels.getLabel("editarClaseServicioController.MSG.suscribirOK"), + Labels.getLabel("editarClaseServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarClaseServicioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error("editarClaseServicioController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarClaseServicioController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarClaseServicioController.MSG.borrarPergunta"), + Labels.getLabel("editarClaseServicioController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + claseServicioService.borrar(claseServicio); + + Messagebox.show( + Labels.getLabel("editarClaseServicioController.MSG.borrarOK"), + Labels.getLabel("editarClaseServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + claseServicioList.removeItem(claseServicio); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarColoniaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarColoniaController.java new file mode 100644 index 000000000..8c50d87b3 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarColoniaController.java @@ -0,0 +1,223 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Colonia; +import com.rjconsultores.ventaboletos.service.ColoniaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarColoniaController") +@Scope("prototype") +public class EditarColoniaController extends MyGenericForwardComposer { + + @Autowired + private ColoniaService coloniaService; + private Colonia colonia; + private MyListbox coloniaList; + private static Logger log = Logger.getLogger(EditarColoniaController.class); + private MyTextbox txtNome; + private Button btnApagar; + private Combobox cmbCiudad; + private Intbox codpostal; + + + + public Colonia getColonia() { + return colonia; + } + + public void setColonia(Colonia colonia) { + this.colonia = colonia; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public MyListbox getColoniaList() { + return coloniaList; + } + + public void setColoniaList(MyListbox coloniaList) { + this.coloniaList = coloniaList; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public ColoniaService getColoniaService() { + return coloniaService; + } + + public void setColoniaService(ColoniaService coloniaService) { + this.coloniaService = coloniaService; + } + + public Combobox getCmbCiudad() { + return cmbCiudad; + } + + public void setCmbCiudad(Combobox cmbCiudad) { + this.cmbCiudad = cmbCiudad; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + super.doAfterCompose(comp); + + colonia = (Colonia) Executions.getCurrent().getArg().get("colonia"); + coloniaList = (MyListbox) Executions.getCurrent().getArg().get("coloniaList"); + + if (colonia.getColoniaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + cmbCiudad.setText(colonia.getCiudad().getNombciudad()); + + } + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + cmbCiudad.getValue(); + codpostal.getValue(); + try { + colonia.setActivo(Boolean.TRUE); + colonia.setFecmodif(Calendar.getInstance().getTime()); + colonia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + Comboitem ciudad = cmbCiudad.getSelectedItem(); + if (ciudad != null) { + colonia.setCiudad((Ciudad) ciudad.getValue()); + } + + + List lsColonia = coloniaService.buscar(colonia.getDesccolonia()); + + boolean podeSalvar = false; + if (lsColonia.isEmpty()) { + podeSalvar = true; + } else { + if (colonia.getColoniaId() != null) { + for (Colonia c : lsColonia) { + if (c.getColoniaId().equals(colonia.getColoniaId())) { + podeSalvar = true; + } + } + } else { + for (Colonia c : lsColonia) { + if (!(c.getDesccolonia().toUpperCase().equals(colonia.getDesccolonia())) || !(c.getCodpostal().equals(colonia.getCodpostal())) + || !(c.getCiudad().equals(colonia.getCiudad()))) { + podeSalvar = true; + } else { + podeSalvar = false; + break; + } + } + } + } + if (podeSalvar) { + if (colonia.getColoniaId() == null) { + coloniaService.suscribir(colonia); + coloniaList.addItem(colonia); + } else { + coloniaService.actualizacion(colonia); + coloniaList.updateItem(colonia); + } + + Messagebox.show( + Labels.getLabel("editarColoniaController.MSG.suscribirOK"), + Labels.getLabel("editarColoniaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarColoniaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error("editarColoniaController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarColoniaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarColoniaController.MSG.borrarPergunta"), + Labels.getLabel("editarColoniaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + coloniaService.borrar(colonia); + + Messagebox.show( + Labels.getLabel("editarColoniaController.MSG.borrarOK"), + Labels.getLabel("editarColoniaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + coloniaList.removeItem(colonia); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + /** + * @return the codpostal + */ + public Intbox getCodpostal() { + return codpostal; + } + + /** + * @param codpostal the codpostal to set + */ + public void setCodpostal(Intbox codpostal) { + this.codpostal = codpostal; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarCuponConvenioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarCuponConvenioController.java new file mode 100644 index 000000000..0bf53975b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarCuponConvenioController.java @@ -0,0 +1,180 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.CuponConvenio; +import com.rjconsultores.ventaboletos.entidad.TipoConvenio; +import com.rjconsultores.ventaboletos.service.CuponConvenioService; +import com.rjconsultores.ventaboletos.service.TipoConvenioService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Shiro + */ +@Controller("editarCuponConvenioController") +@Scope("prototype") +public class EditarCuponConvenioController extends MyGenericForwardComposer { + + @Autowired + private CuponConvenioService cuponConService; + @Autowired + private TipoConvenioService tipoConService; + private CuponConvenio cc; + private MyListbox CuponConvenioList; + private Combobox cmbTipoConvenio; + private Intbox folioInicio; + private Intbox folioFin; + private List tipoConvenioList; + private static Logger log = Logger.getLogger(EditarCuponConvenioController.class); + + public Combobox getCmbTipoConvenio() { + return cmbTipoConvenio; + } + + public void setCmbTipoConvenio(Combobox cmbTipoConvenio) { + this.cmbTipoConvenio = cmbTipoConvenio; + } + + public MyListbox getCuponConvenioList() { + return CuponConvenioList; + } + + public void setCuponConvenioList(MyListbox CuponConvenioList) { + this.CuponConvenioList = CuponConvenioList; + } + + public CuponConvenio getCc() { + return cc; + } + + public void setCc(CuponConvenio cc) { + this.cc = cc; + } + + public CuponConvenioService getCuponConService() { + return cuponConService; + } + + public void setCuponConService(CuponConvenioService cuponConService) { + this.cuponConService = cuponConService; + } + + public Intbox getFolioFin() { + return folioFin; + } + + public void setFolioFin(Intbox folioFin) { + this.folioFin = folioFin; + } + + public Intbox getFolioInicio() { + return folioInicio; + } + + public void setFolioInicio(Intbox folioInicio) { + this.folioInicio = folioInicio; + } + + public TipoConvenioService getTipoConService() { + return tipoConService; + } + + public void setTipoConService(TipoConvenioService tipoConService) { + this.tipoConService = tipoConService; + } + + public List getTipoConvenioList() { + return tipoConvenioList; + } + + public void setTipoConvenioList(List tipoConvenioList) { + this.tipoConvenioList = tipoConvenioList; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + tipoConvenioList = tipoConService.obtenerTodos(); + super.doAfterCompose(comp); + + cc = (CuponConvenio) Executions.getCurrent().getArg().get("cc"); + CuponConvenioList = (MyListbox) Executions.getCurrent().getArg().get("CuponConvenioList"); + + + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + try { + cc.setActivo(Boolean.TRUE); + cc.setFecmodif(Calendar.getInstance().getTime()); + cc.setUsuarioId(0); + cc.setTipoConvenio((TipoConvenio) cmbTipoConvenio.getSelectedItem().getValue()); + cc.setFolioInicio(folioInicio.getValue()); + cc.setFolioFinal(folioFin.getValue()); + + if (cc.getCuponConvenioID() == null) { + cuponConService.suscribir(cc); + CuponConvenioList.addItem(cc); + } else { + cuponConService.actualizacion(cc); + CuponConvenioList.updateItem(cc); + } + + Messagebox.show( + Labels.getLabel("editarCuponConvenioController.MSG.suscribirOK"), + Labels.getLabel("editarCuponConvenioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } catch (Exception ex) { + log.error("editarCuponConvenioController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarCuponConvenioController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarCuponConvenioController.MSG.BorrarPergunta"), + Labels.getLabel("editarCuponConvenioController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + cuponConService.borrar(cc); + + Messagebox.show( + Labels.getLabel("editarCuponConvenioController.MSG.BorrarOK"), + Labels.getLabel("editarCuponConvenioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + CuponConvenioList.removeItem(cc); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarDetDiagramaAutobusController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarDetDiagramaAutobusController.java new file mode 100644 index 000000000..5d9df15ec --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarDetDiagramaAutobusController.java @@ -0,0 +1,298 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import java.util.Calendar; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Row; + +import com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.service.DetDiagramaAutobusService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; + +/** + * + * @author Administrador + */ +@Controller("editarDetDiagramaAutobusController") +@Scope("prototype") +public class EditarDetDiagramaAutobusController extends MyGenericForwardComposer { + + @Autowired + private DetDiagramaAutobusService detDiagramaAutobusService; + private DetDiagramaAutobus detDiagramaAutobus; + private Short numefila; + private Short numecolumna; + private DiagramaAutobus diagramaAutobus; + private Checkbox chkVendible; + private Intbox txtAsiento; + private Button button; + private Combobox cmbTipo; + private Row rowAsiento; + private Row rowVendible; + private static Logger log = Logger.getLogger(EditarDetDiagramaAutobusController.class); + public final static String ASIENTO = "ASIENTO"; + private String itemCombo = ASIENTO; + + public DetDiagramaAutobus getDetDiagramaAutobus() { + return detDiagramaAutobus; + } + + public void setDetDiagramaAutobus(DetDiagramaAutobus detDiagramaAutobus) { + this.detDiagramaAutobus = detDiagramaAutobus; + } + + public Checkbox getChkVendible() { + return chkVendible; + } + + public void setChkVendible(Checkbox chkVendible) { + this.chkVendible = chkVendible; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + detDiagramaAutobus = (DetDiagramaAutobus) Executions.getCurrent().getArg().get("detDiagramaAutobus"); + + super.doAfterCompose(comp); + + numefila = (Short) Executions.getCurrent().getArg().get("numefila"); + numecolumna = (Short) Executions.getCurrent().getArg().get("numecolumna"); + diagramaAutobus = (DiagramaAutobus) Executions.getCurrent().getArg().get("diagramaAutobus"); + button = (Button) Executions.getCurrent().getArg().get("button"); + + chkVendible.setChecked(detDiagramaAutobus.getVendible() == null ? true : detDiagramaAutobus.getVendible()); + + if ((numefila == 2) || (numefila == 4) || (numefila == 6)) { + itemCombo = DetDiagramaAutobus.TV; + + List children = cmbTipo.getChildren(); + for (Component c : children) { + if (c instanceof Comboitem) { + Comboitem ci = (Comboitem) c; + if (((String) ci.getValue()).equals(ASIENTO)) { + ci.setVisible(false); + } + } + } + rowAsiento.setVisible(false); + rowVendible.setVisible(false); + } else { + + if (detDiagramaAutobus.getAsiento() != null) { + boolean noEsAsiento = noEsAsiento(detDiagramaAutobus.getAsiento()); + + if (!noEsAsiento) { + txtAsiento.setValue(Integer.parseInt(detDiagramaAutobus.getAsiento())); + } + + rowAsiento.setVisible(!noEsAsiento); + rowVendible.setVisible(!noEsAsiento); + + itemCombo = noEsAsiento ? detDiagramaAutobus.getAsiento() : ASIENTO; + } + } + + txtAsiento.focus(); + } + + public void onClick$btnApagar(Event ev) { + try { + + detDiagramaAutobus.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + detDiagramaAutobus.setFecmodif(Calendar.getInstance().getTime()); + detDiagramaAutobus.setActivo(Boolean.FALSE); + + if (detDiagramaAutobus.getDetdiagramaautobusId() != null) { + detDiagramaAutobusService.borrar(detDiagramaAutobus); + } + + button.setLabel(""); + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + Clients.alert(Labels.getLabel("MSG.Error"), Labels.getLabel("editarDiagramaAutobusController.window.title"), Messagebox.ERROR); + } + } + + private boolean noEsAsiento(String str) { + return str.equals(DetDiagramaAutobus.CF) + || str.equals(DetDiagramaAutobus.PT) + || str.equals(DetDiagramaAutobus.TV) + || str.equals(DetDiagramaAutobus.WC); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + if (cmbTipo.getSelectedItem().getValue().equals(ASIENTO) && (txtAsiento.getValue() == null)) { + Messagebox.show( + Labels.getLabel("editarDiagramaAutobusController.msg.asientoObligatorio"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + return; + } + + try { + // checando se jah existe esse assento: + List lsDetDiagramaAutobus = diagramaAutobus.getDetDiagramaAutobusList(); + Boolean existeAsiento = Boolean.FALSE; + String novoAsiento = (noEsAsiento(cmbTipo.getSelectedItem().getValue().toString()) ? cmbTipo.getSelectedItem().getValue().toString() : txtAsiento.getValue().toString());// si + // es + // asiento, + // saco + // el + // numero. + // Sino, + // saco + // la + // descripción + // del + // combobox + Boolean temLetraNovoAsiento = novoAsiento.matches("^[a-zA-Z]+$"); + if (!temLetraNovoAsiento) { + for (DetDiagramaAutobus dda : lsDetDiagramaAutobus) { + String asiento = dda.getAsiento(); + if (asiento != null) { + Boolean temLetra = asiento.matches("^[a-zA-Z]+$"); + if (!temLetra) { + if (dda.getAsiento().equals(novoAsiento)) { + if (((dda.getDetdiagramaautobusId() == null) || (detDiagramaAutobus.getDetdiagramaautobusId() == null)) || (!dda.getDetdiagramaautobusId().equals(detDiagramaAutobus.getDetdiagramaautobusId()))) { + existeAsiento = Boolean.TRUE; + } + } + } + } + } + } + + if (!existeAsiento) { + + detDiagramaAutobus.setActivo(Boolean.TRUE); + detDiagramaAutobus.setFecmodif(Calendar.getInstance().getTime()); + detDiagramaAutobus.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + detDiagramaAutobus.setNumecolumna(numecolumna); + detDiagramaAutobus.setNumefila(numefila); + detDiagramaAutobus.setDiagramaAutobus(diagramaAutobus); + if (!cmbTipo.getSelectedItem().getValue().equals(ASIENTO)) { + detDiagramaAutobus.setVendible(Boolean.FALSE); + } else { + detDiagramaAutobus.setVendible(chkVendible.isChecked()); + } + detDiagramaAutobus.setAsiento(novoAsiento); + + + if (detDiagramaAutobus.getDetdiagramaautobusId() == null) { + Integer posicionDdaExiste = null; + for (int i = 0; i < diagramaAutobus.getDetDiagramaAutobusList().size(); i++) { + DetDiagramaAutobus dda = diagramaAutobus.getDetDiagramaAutobusList().get(i); + + if ((dda.getNumecolumna() == numecolumna) && (dda.getNumefila() == numefila)) { + posicionDdaExiste = i; + } + + } + if (posicionDdaExiste == null) { + diagramaAutobus.getDetDiagramaAutobusList().add(detDiagramaAutobus); + } else { + diagramaAutobus.getDetDiagramaAutobusList().set(posicionDdaExiste, detDiagramaAutobus); + } + + log.debug("add no existe=" + novoAsiento); + } else { + Integer index = diagramaAutobus.getDetDiagramaAutobusList().indexOf(detDiagramaAutobus); + DetDiagramaAutobus temp = diagramaAutobus.getDetDiagramaAutobusList().get(index); + + temp.setActivo(detDiagramaAutobus.getActivo()); + temp.setAsiento(detDiagramaAutobus.getAsiento()); + temp.setDetdiagramaautobusId(detDiagramaAutobus.getDetdiagramaautobusId()); + temp.setDiagramaAutobus(detDiagramaAutobus.getDiagramaAutobus()); + temp.setFecmodif(detDiagramaAutobus.getFecmodif()); + temp.setInternet(detDiagramaAutobus.getInternet()); + temp.setNumecolumna(detDiagramaAutobus.getNumecolumna()); + temp.setNumefila(detDiagramaAutobus.getNumefila()); + temp.setUsuarioId(detDiagramaAutobus.getUsuarioId()); + if (!cmbTipo.getSelectedItem().getValue().equals(ASIENTO)) { + temp.setVendible(Boolean.FALSE); + } else { + temp.setVendible(detDiagramaAutobus.getVendible()); + } + log.debug("add ya existe=" + detDiagramaAutobus.getAsiento()); + } + log.debug("cant itens=" + diagramaAutobus.getDetDiagramaAutobusList().size()); + closeWindow(); + button.setLabel(detDiagramaAutobus.getAsiento()); + } else { + Messagebox.show( + Labels.getLabel("editarDiagramaAutobusController.Existe.Asiento"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onChange$cmbTipo(Event ev) { + cambiarPantallaTipo(); + } + + private void cambiarPantallaTipo() { + Comboitem o = cmbTipo.getSelectedItem(); + if (o == null) { + return; + } + + String strSelected = (String) o.getValue(); + if (strSelected.equals(DetDiagramaAutobus.CF) + || strSelected.equals(DetDiagramaAutobus.PT) + || strSelected.equals(DetDiagramaAutobus.TV) + || strSelected.equals(DetDiagramaAutobus.WC)) { + + rowAsiento.setVisible(false); + rowVendible.setVisible(false); + + chkVendible.setChecked(false); + + } else { + txtAsiento.setValue((Integer) null); + chkVendible.setChecked(true); + + rowAsiento.setVisible(true); + rowVendible.setVisible(true); + } + } + + public String getItemCombo() { + return itemCombo; + } + + public void setItemCombo(String itemCombo) { + this.itemCombo = itemCombo; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarEmpresaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarEmpresaController.java new file mode 100644 index 000000000..c8e7af265 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarEmpresaController.java @@ -0,0 +1,228 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; + +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Row; + +/** + * + * @author Rafius + */ +@Controller("editarEmpresaController") +@Scope("prototype") +public class EditarEmpresaController extends MyGenericForwardComposer { + + @Autowired + private EmpresaService empresaService; + private Empresa empresa; + private MyListbox empresaList; + private static Logger log = Logger.getLogger(EditarEmpresaController.class); + private MyTextbox txtNome; + private Button btnApagar; + private Combobox cmbIndTipo; + private Checkbox chkExterna; + private Checkbox chkPagoConductor; + private Row rowEquivalencia; + + public Empresa getEmpresa() { + return empresa; + } + + public void setEmpresa(Empresa empresa) { + this.empresa = empresa; + } + + public MyListbox getEmpresaList() { + return empresaList; + } + + public void setEmpresaList(MyListbox empresaList) { + this.empresaList = empresaList; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public Combobox getCmbIndTipo() { + return cmbIndTipo; + } + + public void setCmbIndTipo(Combobox cmbIndTipo) { + this.cmbIndTipo = cmbIndTipo; + } + + public Checkbox getChkExterna() { + return chkExterna; + } + + public void setChkExterna(Checkbox chkExterna) { + this.chkExterna = chkExterna; + } + + public Checkbox getChkPagoConductor() { + return chkPagoConductor; + } + + public void setChkPagoConductor(Checkbox chkPagoConductor) { + this.chkPagoConductor = chkPagoConductor; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + empresa = (Empresa) Executions.getCurrent().getArg().get("empresa"); + empresaList = (MyListbox) Executions.getCurrent().getArg().get("empresaList"); + + txtNome.focus(); + + if (empresa.getEmpresaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + chkExterna.setChecked(true); + } else { + chkExterna.setChecked(empresa.getIndExterna() == null ? false : empresa.getIndExterna()); + chkPagoConductor.setChecked(empresa.getPagoConductor() == null ? false : empresa.getPagoConductor()); + } + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + cmbIndTipo.getValue(); + try { + if (empresa.getIndExterna() == null) { + empresa.setIndExterna(Boolean.FALSE); + } + + empresa.setActivo(Boolean.TRUE); + empresa.setFecmodif(Calendar.getInstance().getTime()); + empresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + empresa.setIndExterna(chkExterna.isChecked()); + empresa.setPagoConductor(chkPagoConductor.isChecked()); + + if (empresa.getEmpresaId() == null) { + List lsEmpresa = + empresaService.buscar(empresa.getNombempresa(), empresa.getIndExterna(), + empresa.getIndTipo()); + + if (!lsEmpresa.isEmpty()) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarEmpresaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + + empresaService.suscribir(empresa); + empresaList.addItem(empresa); + } else { + empresaService.actualizacion(empresa); + empresaList.updateItem(empresa); + } + + Messagebox.show( + Labels.getLabel("editarEmpresaController.MSG.suscribirOK"), + Labels.getLabel("editarEmpresaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + + } catch (Exception ex) { + log.error("editarEmpresaController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarEmpresaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$chkExterna(Event ev) { + if (!chkExterna.isChecked()) { + chkExterna.setChecked(false); + } else { + chkExterna.setChecked(true); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarEmpresaController.MSG.borrarPergunta"), + Labels.getLabel("editarEmpresaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + empresaService.borrar(empresa); + + Messagebox.show( + Labels.getLabel("editarEmpresaController.MSG.borrarOK"), + Labels.getLabel("editarEmpresaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + empresaList.removeItem(empresa); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarEstadoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarEstadoController.java new file mode 100644 index 000000000..f02228482 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarEstadoController.java @@ -0,0 +1,224 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.entidad.Pais; +import com.rjconsultores.ventaboletos.service.EstadoService; +import com.rjconsultores.ventaboletos.service.PaisService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Row; + +/** + * + * @author Rafius + */ +@Controller("editarEstadoController") +@Scope("prototype") +public class EditarEstadoController extends MyGenericForwardComposer { + + @Autowired + private EstadoService estadoService; + @Autowired + private PaisService paisService; + private Estado estado; + private List lsPais; + private MyListbox estadoList; + private static Logger log = Logger.getLogger(EditarEstadoController.class); + private MyTextbox txtNome; + private Combobox cmbPais; + private Button btnApagar; + private Row rowEquivalencia; + + public Estado getEstado() { + return estado; + } + + public void setEstado(Estado estado) { + this.estado = estado; + } + + public MyListbox getEstadoList() { + return estadoList; + } + + public void setEstadoList(MyListbox estadoList) { + this.estadoList = estadoList; + } + + public EstadoService getEstadoService() { + return estadoService; + } + + public void setEstadoService(EstadoService estadoService) { + this.estadoService = estadoService; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public List getLsPais() { + return lsPais; + } + + public void setLsPais(List lsPais) { + this.lsPais = lsPais; + } + + public PaisService getPaisService() { + return paisService; + } + + public void setPaisService(PaisService paisService) { + this.paisService = paisService; + } + + public Combobox getCmbPais() { + return cmbPais; + } + + public void setCmbPais(Combobox cmbPais) { + this.cmbPais = cmbPais; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsPais = paisService.obtenerTodos(); + super.doAfterCompose(comp); + + estado = (Estado) Executions.getCurrent().getArg().get("estado"); + estadoList = (MyListbox) Executions.getCurrent().getArg().get("estadoList"); + + if (estado.getEstadoId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + cmbPais.getValue(); + try { + + estado.setActivo(Boolean.TRUE); + estado.setFecmodif(Calendar.getInstance().getTime()); + estado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsEstado = estadoService.buscar(estado.getNombestado(), estado.getPais()); + + boolean podeSalvar = false; + if (lsEstado.isEmpty()) { + podeSalvar = true; + } else { + if (estado.getEstadoId() == null) { + podeSalvar = false; + } else { + for (Estado e : lsEstado) { + if (e.getEstadoId().equals(estado.getEstadoId())) { + podeSalvar = true; + } + } + } + } + + if (podeSalvar) { + if (estado.getEstadoId() == null) { + estadoService.suscribir(estado); + estadoList.addItem(estado); + } else { + estadoService.actualizacion(estado); + estadoList.updateItem(estado); + } + Messagebox.show( + Labels.getLabel("editarEstadoController.MSG.suscribirOK"), + Labels.getLabel("editarEstadoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarEstadoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } catch (Exception ex) { + log.error("editarEstadoController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarEstadoController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarEstadoController.MSG.borrarPergunta"), + Labels.getLabel("editarEstadoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + estadoService.borrar(estado); + + Messagebox.show( + Labels.getLabel("editarEstadoController.MSG.borrarOK"), + Labels.getLabel("editarEstadoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + estadoList.removeItem(estado); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarFormaPagoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarFormaPagoController.java new file mode 100644 index 000000000..67c2fbe66 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarFormaPagoController.java @@ -0,0 +1,213 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.service.FormaPagoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Row; + +/** + * + * @author Administrador + */ +@Controller("editarFormaPagoController") +@Scope("prototype") +public class EditarFormaPagoController extends MyGenericForwardComposer { + + @Autowired + private FormaPagoService formaPagoService; + private FormaPago formaPago; + private MyListbox formaPagoList; + private MyTextbox txtNome; + private Button btnApagar; + private BusquedaFormaPagoController busquedaFormaPagoController; + private Button btnSalvar; + private Radio rd1; + private Radio rd2; + private Radio rd3; + private Radio rd4; + private static Logger log = Logger.getLogger(EditarFormaPagoController.class); + private Row rowEquivalencia; + + public FormaPago getFormaPago() { + return formaPago; + } + + public void setFormaPago(FormaPago formaPago) { + this.formaPago = formaPago; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Button getBtnSalvar() { + return btnSalvar; + } + + public void setBtnSalvar(Button btnSalvar) { + this.btnSalvar = btnSalvar; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + busquedaFormaPagoController = (BusquedaFormaPagoController) Executions.getCurrent().getArg().get("busquedaFormaPagoController"); + formaPago = (FormaPago) Executions.getCurrent().getArg().get("formaPago"); + formaPagoList = (MyListbox) Executions.getCurrent().getArg().get("formaPagoList"); + + if (formaPago.getFormapagoId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + + if (formaPago.getIndoperacion() == null) { + rd4.setChecked(true); + } else if (formaPago.getIndoperacion() == 1) { + rd1.setChecked(true); + } else if (formaPago.getIndoperacion() == 2) { + rd2.setChecked(true); + } else if (formaPago.getIndoperacion() == 3) { + rd3.setChecked(true); + } + + + if (formaPago.getFormapagoId() <= 11 || (formaPago.getFormapagoId() >= 96 && formaPago.getFormapagoId() <= 99)) { + btnApagar.setVisible(Boolean.FALSE); + btnSalvar.setVisible(Boolean.FALSE); + txtNome.setDisabled(Boolean.TRUE); + + Messagebox.show( + Labels.getLabel("MSG.noEditabled"), + Labels.getLabel("editarFormaPagoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getText(); + + try { + formaPago.setActivo(Boolean.TRUE); + formaPago.setFecmodif(Calendar.getInstance().getTime()); + formaPago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (rd4.isChecked()) { + formaPago.setIndoperacion(null); + } else if (rd1.isChecked()) { + formaPago.setIndoperacion(new Short("1")); + } else if (rd2.isChecked()) { + formaPago.setIndoperacion(new Short("2")); + } else if (rd3.isChecked()) { + formaPago.setIndoperacion(new Short("3")); + } + + if (formaPago.getFormapagoId() == null) { + List lsFP = + formaPagoService.buscarPorDescricao(formaPago.getDescpago()); + + if (lsFP.isEmpty()) { + formaPagoService.suscribir(formaPago); + formaPagoList.addItem(formaPago); + + Messagebox.show( + Labels.getLabel("editarFormaPagoController.MSG.suscribirOK"), + Labels.getLabel("editarFormaPagoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarFormaPagoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + formaPagoService.actualizacion(formaPago); + formaPagoList.updateItem(formaPago); + + Messagebox.show( + Labels.getLabel("editarFormaPagoController.MSG.suscribirOK"), + Labels.getLabel("editarFormaPagoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + busquedaFormaPagoController.refreshLista(); + closeWindow(); + } catch (Exception ex) { + log.error("editarFormaPagoController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarFormaPagoController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarFormaPagoController.MSG.borrarPergunta"), + Labels.getLabel("editarFormaPagoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + formaPagoService.borrar(formaPago); + + Messagebox.show( + Labels.getLabel("editarFormaPagoController.MSG.borrarOK"), + Labels.getLabel("editarFormaPagoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + formaPagoList.removeItem(formaPago); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarMarcaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarMarcaController.java new file mode 100644 index 000000000..764eaede6 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarMarcaController.java @@ -0,0 +1,253 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import java.io.IOException; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.UiException; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.UploadEvent; +import org.zkoss.zul.Button; +import org.zkoss.zul.Image; +import org.zkoss.zul.Row; + +/** + * + * @author Administrador + */ +@Controller("editarMarcaController") +@Scope("prototype") +public class EditarMarcaController extends MyGenericForwardComposer { + + @Autowired + private MarcaService marcaService; + private Marca marca; + private MyListbox marcaList; + private BusquedaMarcaController busquedaMarcaController; + private Image img; + private MyTextbox txtNome; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarMarcaController.class); + private Row rowEquivalencia; + + public Image getImg() { + return img; + } + + public void setImg(Image img) { + this.img = img; + } + + public Marca getMarca() { + return marca; + } + + public void setMarca(Marca marca) { + this.marca = marca; + } + + public MyListbox getMarcaList() { + return marcaList; + } + + public void setMarcaList(MyListbox marcaList) { + this.marcaList = marcaList; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + marca = (Marca) Executions.getCurrent().getArg().get("marca"); + busquedaMarcaController = (BusquedaMarcaController) Executions.getCurrent().getArg().get("busquedaMarcaController"); + if (marca.getLogotipomarca() != null) { + img.setContent(new org.zkoss.image.AImage(marca.getDescmarca(), + marca.getLogotipomarca())); + } + marcaList = (MyListbox) Executions.getCurrent().getArg().get("marcaList"); + + if (marca.getMarcaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void uploadPhoto(UploadEvent event) { + org.zkoss.util.media.Media media = event.getMedia(); + + try { + if (media instanceof org.zkoss.image.Image) { + img.setContent(new org.zkoss.image.AImage(media.getName(), + media.getStreamData())); + } else { + Messagebox.show( + Labels.getLabel("editarMarcaController.MSG.errorIMG") + " " + media, + Labels.getLabel("editarMarcaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } catch (IOException ex) { + log.error(ex); + throw UiException.Aide.wrap(ex); + } catch (InterruptedException ex) { + log.error(ex); + throw UiException.Aide.wrap(ex); + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getText(); + + try { + String nomeMarca = marca.getDescmarca(); + List lsMarcas = marcaService.buscarPorNome(nomeMarca); + boolean podeSalvar = false; + if (lsMarcas.isEmpty()) { + podeSalvar = true; + } else { + for (Marca m : lsMarcas) { + if (m.getMarcaId().equals(marca.getMarcaId())) { + podeSalvar = true; + } + } + } + + if (podeSalvar) { + marca.setActivo(Boolean.TRUE); + marca.setFecmodif(Calendar.getInstance().getTime()); + marca.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (img.getContent() != null) { + marca.setLogotipomarca(img.getContent().getByteData()); + } + + if (marca.getLogotipomarca() == null) { + int resp = Messagebox.show( + Labels.getLabel("editarMarcaController.MSG.SinImagenPergunta"), + Labels.getLabel("editarMarcaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + if (marca.getMarcaId() == null) { + marcaService.suscribir(marca); + marcaList.addItem(marca); + + Messagebox.show( + Labels.getLabel("editarMarcaController.MSG.suscribirOK"), + Labels.getLabel("editarMarcaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + marcaService.actualizacion(marca); + marcaList.updateItem(marca); + + Messagebox.show( + Labels.getLabel("editarMarcaController.MSG.suscribirOK"), + Labels.getLabel("editarMarcaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } + } else { + if (marca.getMarcaId() == null) { + marcaService.suscribir(marca); + marcaList.addItem(marca); + } else { + marcaService.actualizacion(marca); + marcaList.updateItem(marca); + } + + Messagebox.show( + Labels.getLabel("editarMarcaController.MSG.suscribirOK"), + Labels.getLabel("editarMarcaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + busquedaMarcaController.refreshLista(); + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarMarcaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error("editarMarcaController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarMarcaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarMarcaController.MSG.borrarPergunta"), + Labels.getLabel("editarMarcaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + marcaService.borrar(marca); + + Messagebox.show( + Labels.getLabel("editarMarcaController.MSG.borrarOK"), + Labels.getLabel("editarMarcaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + marcaList.removeItem(marca); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarMonedaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarMonedaController.java new file mode 100644 index 000000000..196cabe4b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarMonedaController.java @@ -0,0 +1,214 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Row; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarMonedaController") +@Scope("prototype") +public class EditarMonedaController extends MyGenericForwardComposer { + + @Autowired + private MonedaService monedaService; + private Moneda moneda; + private MyListbox monedaList; + private Button btnApagar; + private Button btnSalvar; + private BusquedaMonedaController busquedaMonedaController; + private static Logger log = Logger.getLogger(EditarMonedaController.class); + private MyTextbox txtNome; + private Row rowEquivalencia; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public Button getBtnSalvar() { + return btnSalvar; + } + + public void setBtnSalvar(Button btnSalvar) { + this.btnSalvar = btnSalvar; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + busquedaMonedaController = (BusquedaMonedaController) Executions.getCurrent().getArg().get("busquedaMonedaController"); + moneda = (Moneda) Executions.getCurrent().getArg().get("moneda"); + monedaList = (MyListbox) Executions.getCurrent().getArg().get("monedaList"); + + if (moneda.getMonedaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + if (moneda.getMonedaId() <= 2) { + btnApagar.setVisible(Boolean.FALSE); + btnSalvar.setVisible(Boolean.FALSE); + txtNome.setDisabled(Boolean.TRUE); + + Messagebox.show( + Labels.getLabel("MSG.noEditabled"), + Labels.getLabel("editarMonedaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + try { + moneda.setActivo(true); + moneda.setFecmodif(Calendar.getInstance().getTime()); + moneda.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (moneda.getMonedaId() == null) { + List lsMoneda = monedaService.buscar(moneda.getDescmoneda()); + + boolean podeSalvar = false; + if (lsMoneda.isEmpty()) { + podeSalvar = true; + } else { + for (Moneda m : lsMoneda) { + if (m.getMonedaId().equals(moneda.getMonedaId())) { + podeSalvar = true; + } + } + } + + if (!podeSalvar) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarMonedaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + monedaService.suscribir(moneda); + monedaList.addItem(moneda); + + Messagebox.show( + Labels.getLabel("editarMonedaController.MSG.suscribirOK"), + Labels.getLabel("editarMonedaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + busquedaMonedaController.refreshLista(); + closeWindow(); + } + } else { + monedaService.actualizacion(moneda); + monedaList.updateItem(moneda); + + Messagebox.show( + Labels.getLabel("editarMonedaController.MSG.suscribirOK"), + Labels.getLabel("editarMonedaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + busquedaMonedaController.refreshLista(); + closeWindow(); + } + } catch (Exception ex) { + log.error("editarMonedaController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarMonedaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarMonedaController.MSG.borrarPergunta"), + Labels.getLabel("editarMonedaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + monedaService.borrar(moneda); + + Messagebox.show( + Labels.getLabel("editarMonedaController.MSG.borrarOK"), + Labels.getLabel("editarMonedaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + monedaList.removeItem(moneda); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public Moneda getMoneda() { + return moneda; + } + + public void setMoneda(Moneda moneda) { + this.moneda = moneda; + } + + public MyListbox getMonedaList() { + return monedaList; + } + + public void setMonedaList(MyListbox monedaList) { + this.monedaList = monedaList; + } + + public MonedaService getMonedaService() { + return monedaService; + } + + public void setMonedaService(MonedaService monedaService) { + this.monedaService = monedaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPaisController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPaisController.java new file mode 100644 index 000000000..9d6448c01 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPaisController.java @@ -0,0 +1,196 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Pais; +import com.rjconsultores.ventaboletos.service.PaisService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarPaisController") +@Scope("prototype") +public class EditarPaisController extends MyGenericForwardComposer { + + @Autowired + private PaisService paisService; + private Pais pais; + private MyListbox paisList; + private Button btnApagar; + private Button btnSalvar; + private BusquedaPaisController busquedaPaisController; + private static Logger log = Logger.getLogger(EditarPaisController.class); + private MyTextbox txtNome; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public Button getBtnSalvar() { + return btnSalvar; + } + + public void setBtnSalvar(Button btnSalvar) { + this.btnSalvar = btnSalvar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + busquedaPaisController = (BusquedaPaisController) Executions.getCurrent().getArg().get("busquedaPaisController"); + pais = (Pais) Executions.getCurrent().getArg().get("pais"); + paisList = (MyListbox) Executions.getCurrent().getArg().get("paisList"); + + if (pais.getPaisId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } +// else { +// if (pais.getPaisId() <= 2) { +// btnApagar.setVisible(Boolean.FALSE); +// btnSalvar.setVisible(Boolean.FALSE); +// txtNome.setDisabled(Boolean.TRUE); +// +// Messagebox.show( +// Labels.getLabel("MSG.noEditabled"), +// Labels.getLabel("editarPaisController.window.title"), +// Messagebox.OK, Messagebox.INFORMATION); +// } +// } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + try { + pais.setActivo(true); + pais.setFecmodif(Calendar.getInstance().getTime()); + pais.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + + boolean podeSalvar = false; + List lsPais = paisService.buscar(pais.getNombpais()); + if (lsPais.isEmpty()) { + podeSalvar = true; + } else { + if (pais.getPaisId() != null) { + for (Pais p : lsPais) { + if (p.getPaisId().equals(pais.getPaisId())) { + podeSalvar = true; + } + } + } + } + + if (podeSalvar) { + if (pais.getPaisId() == null) { + paisService.suscribir(pais); + paisList.addItem(pais); + } else { + paisService.actualizacion(pais); + paisList.updateItem(pais); + } + Messagebox.show( + Labels.getLabel("editarPaisController.MSG.suscribirOK"), + Labels.getLabel("editarPaisController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + busquedaPaisController.refreshLista(); + closeWindow(); + + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPaisController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } catch (Exception ex) { + log.error("editarPaisController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPaisController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarPaisController.MSG.borrarPergunta"), + Labels.getLabel("editarPaisController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + paisService.borrar(pais); + + Messagebox.show( + Labels.getLabel("editarPaisController.MSG.borrarOK"), + Labels.getLabel("editarPaisController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + paisList.removeItem(pais); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public Pais getPais() { + return pais; + } + + public void setPais(Pais pais) { + this.pais = pais; + } + + public MyListbox getPaisList() { + return paisList; + } + + public void setPaisList(MyListbox paisList) { + this.paisList = paisList; + } + + public PaisService getPaisService() { + return paisService; + } + + public void setPaisService(PaisService paisService) { + this.paisService = paisService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPlazaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPlazaController.java new file mode 100644 index 000000000..dd5e286bd --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPlazaController.java @@ -0,0 +1,145 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.service.PlazaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarPlazaController") +@Scope("prototype") +public class EditarPlazaController extends MyGenericForwardComposer { + + @Autowired + private PlazaService plazaService; + private Plaza plaza; + private MyListbox plazaList; + private Button btnApagar; + private MyTextbox txtNome; + private static Logger log = Logger.getLogger(EditarPlazaController.class); + + public Plaza getPlaza() { + return plaza; + } + + public void setPlaza(Plaza plaza) { + this.plaza = plaza; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + plaza = (Plaza) Executions.getCurrent().getArg().get("plaza"); + plazaList = (MyListbox) Executions.getCurrent().getArg().get("plazaList"); + + if (plaza.getPlazaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + + try { + plaza.setActivo(Boolean.TRUE); + plaza.setFecmodif(Calendar.getInstance().getTime()); + plaza.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsPlaza = plazaService.buscar(plaza.getNombplaza()); + + if (!lsPlaza.isEmpty() && (!lsPlaza.get(0).equals(plaza))) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPlazaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (plaza.getPlazaId() == null) { + plazaService.suscribir(plaza); + plazaList.addItem(plaza); + } else { + plazaService.actualizacion(plaza); + plazaList.updateItem(plaza); + } + + Messagebox.show( + Labels.getLabel("editarPlazaController.MSG.suscribirOK"), + Labels.getLabel("editarPlazaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error("editarPlazaController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPlazaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarPlazaController.MSG.borrarPergunta"), + Labels.getLabel("editarPlazaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + plazaService.borrar(plaza); + + Messagebox.show( + Labels.getLabel("editarPlazaController.MSG.borrarOK"), + Labels.getLabel("editarPlazaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + plazaList.removeItem(plaza); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarProductoServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarProductoServicioController.java new file mode 100644 index 000000000..0ade535af --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarProductoServicioController.java @@ -0,0 +1,235 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.ProductoServicioService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Textarea; +import org.zkoss.zul.Button; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Radio; + +/** + * + * @author Shiro + */ +@Controller("editarProductoServicioControllerMX") +@Scope("prototype") +public class EditarProductoServicioController extends MyGenericForwardComposer { + + @Autowired + private ProductoServicioService pSerService; + @Autowired + private EmpresaService empresaService; + private ProductoServicio ps; + private MyListbox PSList; + private MyTextbox txtNome; + private Combobox cmbEmpresa; + private Button btnApagar; + private Radio rdProducto; + private Radio rdServicio; + private List lsEmpresa; + private static Logger log = Logger.getLogger(EditarProductoServicioController.class); + + public MyListbox getPSList() { + return PSList; + } + + public void setPSList(MyListbox PSList) { + this.PSList = PSList; + } + + public ProductoServicio getPs() { + return ps; + } + + public void setPs(ProductoServicio ps) { + this.ps = ps; + } + + public ProductoServicioService getpSerService() { + return pSerService; + } + + public void setpSerService(ProductoServicioService pSerService) { + this.pSerService = pSerService; + } + + public Radio getRdProducto() { + return rdProducto; + } + + public void setRdProducto(Radio rdProducto) { + this.rdProducto = rdProducto; + } + + public Radio getRdServicio() { + return rdServicio; + } + + public void setRdServicio(Radio rdServicio) { + this.rdServicio = rdServicio; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.obtenerIndTipo2(); + + super.doAfterCompose(comp); + + ps = (ProductoServicio) Executions.getCurrent().getArg().get("ps"); + PSList = (MyListbox) Executions.getCurrent().getArg().get("PSList"); + + if (ps.getProductoservicioId() != null) { + if (ps.getIndtipo().equals("S")) { + + rdServicio.setChecked(true); + } else if (ps.getIndtipo().equals("P")) { + + rdProducto.setChecked(true); + } + } else { + rdServicio.setChecked(true); + } + if (ps.getProductoservicioId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + txtNome.getValue(); + cmbEmpresa.getValue(); + + try { + + if (rdServicio.isChecked()) { + ps.setIndtipo("S"); + } else if (rdProducto.isChecked()) { + ps.setIndtipo("P"); + } + + List lsPs = pSerService.obtener(ps); + boolean podeSalvar = false; + + if (lsPs.isEmpty()) { + podeSalvar = true; + } else { + for (ProductoServicio pser : lsPs) { + if (pser.getProductoservicioId().equals(ps.getProductoservicioId())) { + podeSalvar = true; + } else { + podeSalvar = false; + } + } + } + + if (podeSalvar) { + if (ps.getProductoservicioId() == null) { + pSerService.suscribir(ps); + PSList.addItem(ps); + } else { + pSerService.actualizacion(ps); + PSList.updateItem(ps); + } + + Messagebox.show( + Labels.getLabel("editarProductoServicioController.MSG.suscribirOK"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + } + + } catch (Exception ex) { + log.error("editarProductoServicioController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarProductoServicioController.MSG.BorrarPergunta"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + pSerService.borrar(ps); + + Messagebox.show( + Labels.getLabel("editarProductoServicioController.MSG.BorrarOK"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + PSList.removeItem(ps); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPtovtaEmpresaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPtovtaEmpresaController.java new file mode 100644 index 000000000..48381051d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPtovtaEmpresaController.java @@ -0,0 +1,185 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.PtovtaEmpresaService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Rafius + */ +@Controller("editarPtovtaEmpresaController") +@Scope("prototype") +public class EditarPtovtaEmpresaController extends MyGenericForwardComposer { + + @Autowired + private PtovtaEmpresaService ptovtaEmpresaService; + @Autowired + private EmpresaService empresaService; + @Autowired + private PuntoVentaService puntoVentaService; + private List lsEmpresa; + private List lsPuntoVenta; + private PtovtaEmpresa ptovtaEmpresa; + private MyListbox ptovtaEmpresaList; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarPtovtaEmpresaController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.obtenerTodos(); + lsPuntoVenta = puntoVentaService.obtenerTodos(); + + super.doAfterCompose(comp); + + ptovtaEmpresa = (PtovtaEmpresa) Executions.getCurrent().getArg().get("ptovtaEmpresa"); + ptovtaEmpresaList = (MyListbox) Executions.getCurrent().getArg().get("ptovtaEmpresaList"); + + if (ptovtaEmpresa.getPtovtaempresaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + try { + ptovtaEmpresa.setActivo(true); + ptovtaEmpresa.setFecmodif(Calendar.getInstance().getTime()); + ptovtaEmpresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsPtoVta = ptovtaEmpresaService.buscar(ptovtaEmpresa); + + boolean podeSalvar = false; + if (lsPtoVta.isEmpty()) { + podeSalvar = true; + } else { + if (ptovtaEmpresa.getPtovtaempresaId() != null) { + for (PtovtaEmpresa c : lsPtoVta) { + if (c.getPtovtaempresaId().equals(ptovtaEmpresa.getPtovtaempresaId())) { + podeSalvar = true; + } + } + } + } + + if (podeSalvar) { + + if (ptovtaEmpresa.getPtovtaempresaId() == null) { + ptovtaEmpresa = ptovtaEmpresaService.suscribir(ptovtaEmpresa); + ptovtaEmpresaList.addItem(ptovtaEmpresa); + } else { + ptovtaEmpresa = ptovtaEmpresaService.actualizacion(ptovtaEmpresa); + ptovtaEmpresaList.updateItem(ptovtaEmpresa); + } + + Messagebox.show( + Labels.getLabel("editarPtovtaEmpresaController.MSG.suscribirOK"), + Labels.getLabel("editarPtovtaEmpresaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPtovtaEmpresaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error("editarPtovtaEmpresaController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPtovtaEmpresaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarPtovtaEmpresaController.MSG.borrarPergunta"), + Labels.getLabel("editarPtovtaEmpresaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + ptovtaEmpresaService.borrar(ptovtaEmpresa); + + Messagebox.show( + Labels.getLabel("editarPtovtaEmpresaController.MSG.borrarOK"), + Labels.getLabel("editarPtovtaEmpresaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + ptovtaEmpresaList.removeItem(ptovtaEmpresa); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public PtovtaEmpresa getPtovtaEmpresa() { + return ptovtaEmpresa; + } + + public void setPtovtaEmpresa(PtovtaEmpresa ptovtaEmpresa) { + this.ptovtaEmpresa = ptovtaEmpresa; + } + + public MyListbox getPtovtaEmpresaList() { + return ptovtaEmpresaList; + } + + public void setPtovtaEmpresaList(MyListbox ptovtaEmpresaList) { + this.ptovtaEmpresaList = ptovtaEmpresaList; + } + + public PtovtaEmpresaService getPtovtaEmpresaService() { + return ptovtaEmpresaService; + } + + public void setPtovtaEmpresaService(PtovtaEmpresaService ptovtaEmpresaService) { + this.ptovtaEmpresaService = ptovtaEmpresaService; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsPuntoVenta() { + return lsPuntoVenta; + } + + public void setLsPuntoVenta(List lsPuntoVenta) { + this.lsPuntoVenta = lsPuntoVenta; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java new file mode 100644 index 000000000..81145fc4c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarPuntoVentaController.java @@ -0,0 +1,1020 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Colonia; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.entidad.FormaPagoDet; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Nodo; +import com.rjconsultores.ventaboletos.entidad.ParamRecoleccion; +import com.rjconsultores.ventaboletos.entidad.PtoVtaUsuarioBancario; +import com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.UsuarioBancario; +import com.rjconsultores.ventaboletos.service.CiudadService; +import com.rjconsultores.ventaboletos.service.ColoniaService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.FormaPagoService; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.service.NodoService; +import com.rjconsultores.ventaboletos.service.ParamRecoleccionService; +import com.rjconsultores.ventaboletos.service.PtoVtaUsuarioBancarioService; +import com.rjconsultores.ventaboletos.service.PtovtaEmpresaService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; +import com.rjconsultores.ventaboletos.service.UsuarioBancarioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import com.rjconsultores.ventaboletos.web.utilerias.render.FormaPagoDetRender; +import com.rjconsultores.ventaboletos.web.utilerias.render.ParamRecoleccionRender; +import com.rjconsultores.ventaboletos.web.utilerias.render.PtovtaEmpresaRender; +import com.rjconsultores.ventaboletos.web.utilerias.render.PtovtaUsuarioBancarioRender; +import java.math.BigDecimal; +import java.util.ArrayList; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zkplus.databind.BindingListModel; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Doublebox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarPuntoVentaController") +@Scope("prototype") +public class EditarPuntoVentaController extends MyGenericForwardComposer { + + @Autowired + private PuntoVentaService puntoVentaService; + @Autowired + private EmpresaService empresaService; + @Autowired + private TipoPuntoVentaService tipoPuntoVentaService; + @Autowired + private MonedaService monedaService; + @Autowired + private NodoService nodoService; + @Autowired + private FormaPagoService formaPagoService; + @Autowired + private CiudadService ciudadService; + @Autowired + private ColoniaService coloniaService; + @Autowired + private PtovtaEmpresaService ptovtaEmpresaService; + @Autowired + private PtoVtaUsuarioBancarioService ptoVtaUsuarioBancarioService; + @Autowired + private UsuarioBancarioService usuarioBancarioService; + @Autowired + private ParamRecoleccionService paramRecoleccionService; + private PuntoVenta puntoVenta; + private Textbox txtCP; + private MyListbox puntoVentaList; + private MyListbox paramRecoleccionList; + private MyListbox formaPagoList; + private MyListbox ptovtaEmpresaList; + private MyListbox ptovtaUsuarioBancarioList; + private static Logger log = Logger.getLogger(EditarPuntoVentaController.class); + private List lsEmpresas; + private List lsTipoPuntoVenta; + private List lsMoneda; + private List lsColonia; + private List lsCiudad; + private List lsNodos; + private List lsFormaPago; + private List lsFormaPagoDet; + private List lsParamRecoleccion; + private List lsUsuarioBancario; + private List lsPtovtaEmpresa; + private List lsPtovtaUsuarioBancario; + private MyTextbox txtNome; + private Radio radDatosTarjetaSi; + private Radio radDatosTarjetaNo; + private Radio radAprobacionAutorizado; + private Radio radAprobacionLatente; + private Combobox cmbFormaPago; + private Combobox cmbEmpresa; + private Combobox cmbEmpresaPtoVta; + private Combobox cmbEmpresaPtoVtaUsuarioBancario; + private Combobox cmbParada; + private Combobox cmbTipoPontoVenta; + private Combobox cmbMoneda; + private Combobox cmbNodo; + private Button btnSalvarFormaPago; + private Doublebox txtCargosExtras; + private Button btnApagar; + private Combobox cmbCiudad; + private Combobox cmbColonia; + private Combobox cmbConexion; + private Combobox cmbUsuarioBancario; + private Combobox cmbUsuarioBancarioPtoVtaUsuarioBancario; + private MyTextboxDecimal importeInicial; + private MyTextboxDecimal importeAdicional; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEmpresas = empresaService.obtenerIndTipo1(); + lsMoneda = monedaService.obtenerTodos(); + lsCiudad = ciudadService.obtenerTodos(); + lsColonia = new ArrayList(); + lsNodos = nodoService.obtenerTodos(); + lsFormaPago = formaPagoService.obtenerTodos(); + lsTipoPuntoVenta = tipoPuntoVentaService.obtenerTodos(); + lsUsuarioBancario = usuarioBancarioService.obtenerTodos(); + + super.doAfterCompose(comp); + try { + txtCP.setDisabled(true); + puntoVenta = (PuntoVenta) Executions.getCurrent().getArg().get("puntoVenta"); + if (puntoVenta.getPuntoventaId() != null) { + puntoVenta = puntoVentaService.obtenerID(puntoVenta.getPuntoventaId()); + if (puntoVenta.getColonia() != null) { + cmbCiudad.setText(puntoVenta.getColonia().getCiudad().getNombciudad()); + cmbColonia.setText(puntoVenta.getColonia().getDesccolonia()); + } + } + + puntoVentaList = (MyListbox) Executions.getCurrent().getArg().get("puntoVentaList"); + + if (puntoVenta.getPuntoventaId() != null) { + if (puntoVenta.getStatusaprobacion() != null) { + if (puntoVenta.getStatusaprobacion().equals("A")) { + radAprobacionAutorizado.setChecked(true); + } else if (puntoVenta.getStatusaprobacion().equals("L")) { + radAprobacionLatente.setChecked(true); + } + } + } + + formaPagoList.setItemRenderer(new FormaPagoDetRender()); + if (puntoVenta.getLsFormaPagoDet() == null) { + puntoVenta.setLsFormaPagoDet(new ArrayList()); + } + lsFormaPagoDet = puntoVenta.getLsFormaPagoDet(); + formaPagoList.setData(lsFormaPagoDet); + + paramRecoleccionList.setItemRenderer(new ParamRecoleccionRender()); + if (puntoVenta.getLsParamRecoleccion() == null) { + puntoVenta.setLsParamRecoleccion(new ArrayList()); + } + + lsParamRecoleccion = puntoVenta.getLsParamRecoleccion(); + paramRecoleccionList.setData(lsParamRecoleccion); + + ptovtaEmpresaList.setItemRenderer(new PtovtaEmpresaRender()); + if (puntoVenta.getLsPtovtaEmpresa() == null) { + puntoVenta.setLsPtovtaEmpresa(new ArrayList()); + } + + lsPtovtaEmpresa = puntoVenta.getLsPtovtaEmpresa(); + ptovtaEmpresaList.setData(lsPtovtaEmpresa); + + ptovtaUsuarioBancarioList.setItemRenderer(new PtovtaUsuarioBancarioRender()); + if (puntoVenta.getLsPtovtaUsuarioBancario() == null) { + puntoVenta.setLsPtovtaUsuarioBancario(new ArrayList()); + } + + lsPtovtaUsuarioBancario = puntoVenta.getLsPtovtaUsuarioBancario(); + ptovtaUsuarioBancarioList.setData(lsPtovtaUsuarioBancario); + + if (puntoVenta.getPuntoventaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + if (puntoVenta.getParada() != null) { + cmbParada.setText(puntoVenta.getParada().getDescparada()); + } + } + } catch (Exception e) { + log.error("Punto de Venta: " + e); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarEmpresaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + txtNome.focus(); + } + + public void onChange$cmbCiudad(Event ev) { + if (cmbCiudad.getSelectedItem() == null) { + return; + } else { + cmbColonia.setSelectedItem(null); + Ciudad c = (Ciudad) cmbCiudad.getSelectedItem().getValue(); + List lsCol = coloniaService.buscarPorCiudad(c); + BindingListModel dictModel = new BindingListModelList(lsCol, false); + cmbColonia.setModel(dictModel); + } + } + + public void onChange$cmbColonia(Event ev) { + if (cmbColonia.getSelectedItem() == null) { + return; + } else { + Colonia col = (Colonia) cmbColonia.getSelectedItem().getValue(); + txtCP.setValue(col.getCodpostal()); + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + cmbEmpresa.getValue(); + cmbParada.getValue(); + cmbTipoPontoVenta.getValue(); + cmbMoneda.getValue(); + cmbNodo.getValue(); + cmbColonia.setConstraint("no empty"); + cmbColonia.getValue(); + cmbCiudad.getValue(); + try { + if (puntoVenta.getEmpresa() == null) { + Messagebox.show( + Labels.getLabel("editarPuntoVentaController.MSG.empresa"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (puntoVenta.getTipoPuntoVenta() == null) { + Messagebox.show( + Labels.getLabel("editarPuntoVentaController.MSG.punto"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (puntoVenta.getMoneda() == null) { + Messagebox.show( + Labels.getLabel("editarPuntoVentaController.MSG.moneda"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (puntoVenta.getNodo() == null) { + Messagebox.show( + Labels.getLabel("editarPuntoVentaController.MSG.nodo"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (lsFormaPagoDet.isEmpty()) { + Messagebox.show( + Labels.getLabel("editarPuntoVentaController.MSG.formaDePago"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + + if (cmbConexion.getValue().equals("")) { + puntoVenta.setConexionBancaria(null); + puntoVenta.setUsuarioBancario(null); + } + + if (cmbUsuarioBancario.getValue() == null) { + puntoVenta.setUsuarioBancario(null); + } + + List lsPv = puntoVentaService.buscar(puntoVenta); + + boolean podeSalvar = false; + + if (lsPv.isEmpty()) { + podeSalvar = true; + } + for (PuntoVenta pv : lsPv) { + if (pv.getPuntoventaId().equals(puntoVenta.getPuntoventaId())) { + podeSalvar = true; + } + } + + if (podeSalvar) { + if (cmbColonia.getSelectedItem() != null) { + puntoVenta.setColonia((Colonia) cmbColonia.getSelectedItem().getValue()); + } + puntoVenta.setActivo(Boolean.TRUE); + puntoVenta.setFecmodif(Calendar.getInstance().getTime()); + puntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + puntoVenta.setLsFormaPagoDet(lsFormaPagoDet); + puntoVenta.setLsParamRecoleccion(lsParamRecoleccion); + puntoVenta.setLsPtovtaEmpresa(lsPtovtaEmpresa); + puntoVenta.setLsPtovtaUsuarioBancario(lsPtovtaUsuarioBancario); + + List lsPto = new ArrayList(); + for (PtovtaEmpresa pto : lsPtovtaEmpresa) { + if (!pto.getActivo()) { + ptovtaEmpresaService.borrarFisico(pto); + } else { + pto.setPuntoVenta(puntoVenta); + lsPto.add(pto); + } + } + puntoVenta.setLsPtovtaEmpresa(lsPto); + + List lsPto2 = new ArrayList(); + for (PtoVtaUsuarioBancario pto2 : lsPtovtaUsuarioBancario) { + if (!pto2.getActivo()) { + ptoVtaUsuarioBancarioService.borrarFisico(pto2); + } else { + pto2.setPuntoVenta(puntoVenta); + lsPto2.add(pto2); + } + } + puntoVenta.setLsPtovtaUsuarioBancario(lsPto2); + + if (radAprobacionAutorizado.isChecked()) { + puntoVenta.setStatusaprobacion("A"); + } else if (radAprobacionLatente.isChecked()) { + puntoVenta.setStatusaprobacion("L"); + } + + if (puntoVenta.getPuntoventaId() == null) { + puntoVentaService.suscribir(puntoVenta); + puntoVentaList.addItem(puntoVenta); + } else { + puntoVentaService.actualizacion(puntoVenta); + puntoVentaList.updateItem(puntoVenta); + } + + Messagebox.show( + Labels.getLabel("editarPuntoVentaController.MSG.suscribirOK"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } catch (Exception ex) { + log.error("editarPuntoVentaController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarPuntoVentaController.MSG.borrarPergunta"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + puntoVentaService.borrar(puntoVenta); + + Messagebox.show( + Labels.getLabel("editarPuntoVentaController.MSG.borrarOK"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + puntoVentaList.removeItem(puntoVenta); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnSalvarFormaPago(Event ev) throws InterruptedException { + cmbFormaPago.getValue(); + txtCargosExtras.getValue(); + try { + FormaPago formaPago = new FormaPago(); + try { + formaPago = (FormaPago) cmbFormaPago.getSelectedItem().getValue(); + Boolean achou = Boolean.FALSE; + if (formaPago != null) { + for (FormaPagoDet fpd : lsFormaPagoDet) { + if (fpd.getFormaPago().getFormapagoId().equals(formaPago.getFormapagoId())) { + achou = Boolean.TRUE; + } + } + if (!achou) { + FormaPagoDet fpd = new FormaPagoDet(); + fpd.setCargosextras(new BigDecimal(txtCargosExtras.getValue())); + fpd.setFormaPago(formaPago); + fpd.setPuntoVenta(puntoVenta); + + + + fpd.setActivo(Boolean.TRUE); + fpd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + fpd.setFecmodif(Calendar.getInstance().getTime()); + + lsFormaPagoDet.add(fpd); + formaPagoList.setData(lsFormaPagoDet); + } else { + Messagebox.show( + Labels.getLabel("editarPuntoVentaController.MSG.Achou.FormaPago"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } catch (Exception e) { + Messagebox.show( + Labels.getLabel("editarPuntoVentaController.MSG.formaDePago"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagarFormaPago(Event ev) { + try { + FormaPagoDet fpd = (FormaPagoDet) formaPagoList.getSelected(); + if (fpd != null) { + fpd.setActivo(Boolean.FALSE); + fpd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + fpd.setFecmodif(Calendar.getInstance().getTime()); + + formaPagoList.removeItem(fpd); + lsFormaPagoDet.remove(fpd); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnSalvarParamRecoleccion(Event ev) throws InterruptedException { + importeInicial.getValue(); + importeAdicional.getValue(); + try { + ParamRecoleccion paramRecoleccion = new ParamRecoleccion(); + paramRecoleccion.setImporteinicial(importeInicial.getValueDecimal()); + paramRecoleccion.setImporteadicional(importeAdicional.getValueDecimal()); + + + Boolean achou = Boolean.FALSE; + + for (ParamRecoleccion fpd : lsParamRecoleccion) { + if (fpd.getImporteinicial().equals(paramRecoleccion.getImporteinicial())) { + achou = Boolean.TRUE; + } + } + if (!achou) { + + paramRecoleccion.setPuntoVenta(puntoVenta); + paramRecoleccion.setActivo(Boolean.TRUE); + paramRecoleccion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + paramRecoleccion.setFecmodif(Calendar.getInstance().getTime()); + + lsParamRecoleccion.add(paramRecoleccion); + paramRecoleccionList.setData(lsParamRecoleccion); + } else { + Messagebox.show( + Labels.getLabel("editarPuntoVentaController.MSG.Achou.ParamRecoleccion"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagarParamRecoleccion(Event ev) { + try { + ParamRecoleccion fpd = (ParamRecoleccion) paramRecoleccionList.getSelected(); + if (fpd != null) { + fpd.setActivo(Boolean.FALSE); + fpd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + fpd.setFecmodif(Calendar.getInstance().getTime()); + + paramRecoleccionList.removeItem(fpd); + lsParamRecoleccion.remove(fpd); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnSalvarPtovtaEmpresa(Event ev) throws InterruptedException { + cmbEmpresaPtoVta.getValue(); + try { + PtovtaEmpresa ptovtaEmpresa = new PtovtaEmpresa(); + + Boolean achou = Boolean.FALSE; + + ptovtaEmpresa.setEmpresa((Empresa) cmbEmpresaPtoVta.getSelectedItem().getValue()); + + for (PtovtaEmpresa fpd : lsPtovtaEmpresa) { + if (fpd.getEmpresa().equals(ptovtaEmpresa.getEmpresa()) + && fpd.getActivo()) { + achou = Boolean.TRUE; + } + } + if (!achou) { + + ptovtaEmpresa.setPuntoVenta(puntoVenta); + ptovtaEmpresa.setActivo(Boolean.TRUE); + ptovtaEmpresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + ptovtaEmpresa.setFecmodif(Calendar.getInstance().getTime()); + + lsPtovtaEmpresa.add(ptovtaEmpresa); + + List lsP = new ArrayList(); + for (PtovtaEmpresa p : lsPtovtaEmpresa) { + if (p.getActivo()) { + lsP.add(p); + } + } + ptovtaEmpresaList.setData(lsP); + //ptovtaEmpresaList.addItem(ptovtaEmpresa); + } else { + Messagebox.show( + Labels.getLabel("editarPuntoVentaController.MSG.Achou.PtovtaEmpresa"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagarPtovtaEmpresa(Event ev) { + try { + PtovtaEmpresa fpd = (PtovtaEmpresa) ptovtaEmpresaList.getSelected(); + if (fpd != null) { + lsPtovtaEmpresa.remove(fpd); + ptovtaEmpresaList.removeItem(fpd); + if (fpd.getPtovtaempresaId() != null) { + fpd.setActivo(Boolean.FALSE); + fpd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + fpd.setFecmodif(Calendar.getInstance().getTime()); + fpd.setPuntoVenta(puntoVenta); + + lsPtovtaEmpresa.add(fpd); + } + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onChange$cmbConexion(Event ev) { + habilitarCombo(); + } + + private void habilitarCombo() { + Comboitem cbi = cmbConexion.getSelectedItem(); + if (cbi != null) { + String valor = (String) cbi.getValue(); + + if (valor.equals("S")) { + cmbUsuarioBancario.setDisabled(Boolean.FALSE); + } + } + } + + public void onClick$btnSalvarPtovtaUsuarioBancario(Event ev) throws InterruptedException { + cmbEmpresaPtoVtaUsuarioBancario.getValue(); + cmbUsuarioBancarioPtoVtaUsuarioBancario.getValue(); + + try { + PtoVtaUsuarioBancario usuarioBancario = new PtoVtaUsuarioBancario(); + usuarioBancario.setEmpresa((Empresa) cmbEmpresaPtoVtaUsuarioBancario.getSelectedItem().getValue()); + usuarioBancario.setUsuarioBancario((UsuarioBancario) cmbUsuarioBancarioPtoVtaUsuarioBancario.getSelectedItem().getValue()); + + Boolean achou = Boolean.FALSE; + + for (PtoVtaUsuarioBancario fpd : lsPtovtaUsuarioBancario) { + if (fpd.getEmpresa().equals(usuarioBancario.getEmpresa())) { + achou = Boolean.TRUE; + } + } + if (!achou) { + + usuarioBancario.setPuntoVenta(puntoVenta); + usuarioBancario.setActivo(Boolean.TRUE); + usuarioBancario.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + usuarioBancario.setFecmodif(Calendar.getInstance().getTime()); + + + lsPtovtaUsuarioBancario.add(usuarioBancario); + + List lsP = new ArrayList(); + for (PtoVtaUsuarioBancario p : lsPtovtaUsuarioBancario) { + if (p.getActivo()) { + lsP.add(p); + } + } + ptovtaUsuarioBancarioList.setData(lsP); + //ptovtaEmpresaList.addItem(ptovtaEmpresa); + + } else { + Messagebox.show( + Labels.getLabel("editarPuntoVentaController.MSG.Achou.PtovtaUsuario"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagarPtovtaUsuarioBancario(Event ev) { + try { + PtoVtaUsuarioBancario fpd = (PtoVtaUsuarioBancario) ptovtaUsuarioBancarioList.getSelected(); + if (fpd != null) { + ptovtaUsuarioBancarioList.removeItem(fpd); + lsPtovtaUsuarioBancario.remove(fpd); + if (fpd.getPtovtaUsuarioBancarioID() != null) { + fpd.setActivo(Boolean.FALSE); + fpd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + fpd.setFecmodif(Calendar.getInstance().getTime()); + + lsPtovtaUsuarioBancario.add(fpd); + } + } + } catch (Exception ex) { + log.error(ex); + } + } + + public PuntoVenta getPuntoVenta() { + return puntoVenta; + } + + public void setPuntoVenta(PuntoVenta puntoVenta) { + this.puntoVenta = puntoVenta; + } + + public MyListbox getPuntoVentaList() { + return puntoVentaList; + } + + public void setPuntoVentaList(MyListbox puntoVentaList) { + this.puntoVentaList = puntoVentaList; + } + + public PuntoVentaService getPuntoVentaService() { + return puntoVentaService; + } + + public void setPuntoVentaService(PuntoVentaService puntoVentaService) { + this.puntoVentaService = puntoVentaService; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public TipoPuntoVentaService getTipoPuntoVentaService() { + return tipoPuntoVentaService; + } + + public void setTipoPuntoVentaService(TipoPuntoVentaService tipoPuntoVentaService) { + this.tipoPuntoVentaService = tipoPuntoVentaService; + } + + public List getLsEmpresas() { + return lsEmpresas; + } + + public void setLsEmpresas(List lsEmpresas) { + this.lsEmpresas = lsEmpresas; + } + + public List getLsTipoPuntoVenta() { + return lsTipoPuntoVenta; + } + + public void setLsTipoPuntoVenta(List lsTipoPuntoVenta) { + this.lsTipoPuntoVenta = lsTipoPuntoVenta; + } + + public MonedaService getMonedaService() { + return monedaService; + } + + public void setMonedaService(MonedaService monedaService) { + this.monedaService = monedaService; + } + + public List getLsMoneda() { + return lsMoneda; + } + + public void setLsMoneda(List lsMoneda) { + this.lsMoneda = lsMoneda; + } + + public Radio getRadAprobacionAutorizado() { + return radAprobacionAutorizado; + } + + public void setRadAprobacionAutorizado(Radio radAprobacionAutorizado) { + this.radAprobacionAutorizado = radAprobacionAutorizado; + } + + public Radio getRadAprobacionLatente() { + return radAprobacionLatente; + } + + public void setRadAprobacionLatente(Radio radAprobacionLatente) { + this.radAprobacionLatente = radAprobacionLatente; + } + + public Radio getRadDatosTarjetaNo() { + return radDatosTarjetaNo; + } + + public void setRadDatosTarjetaNo(Radio radDatosTarjetaNo) { + this.radDatosTarjetaNo = radDatosTarjetaNo; + } + + public Radio getRadDatosTarjetaSi() { + return radDatosTarjetaSi; + } + + public void setRadDatosTarjetaSi(Radio radDatosTarjetaSi) { + this.radDatosTarjetaSi = radDatosTarjetaSi; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public MyListbox getFormaPagoList() { + return formaPagoList; + } + + public void setFormaPagoList(MyListbox formaPagoList) { + this.formaPagoList = formaPagoList; + } + + public List getLsFormaPago() { + return lsFormaPago; + } + + public void setLsFormaPago(List lsFormaPago) { + this.lsFormaPago = lsFormaPago; + } + + public Combobox getCmbFormaPago() { + return cmbFormaPago; + } + + public void setCmbFormaPago(Combobox cmbFormaPago) { + this.cmbFormaPago = cmbFormaPago; + } + + public Doublebox getTxtCargosExtras() { + return txtCargosExtras; + } + + public void setTxtCargosExtras(Doublebox txtCargosExtras) { + this.txtCargosExtras = txtCargosExtras; + } + + public List getLsNodos() { + return lsNodos; + } + + public void setLsNodos(List lsNodos) { + this.lsNodos = lsNodos; + } + + public Button getBtnSalvarFormaPago() { + return btnSalvarFormaPago; + } + + public void setBtnSalvarFormaPago(Button btnSalvarFormaPago) { + this.btnSalvarFormaPago = btnSalvarFormaPago; + } + + public FormaPagoService getFormaPagoService() { + return formaPagoService; + } + + public void setFormaPagoService(FormaPagoService formaPagoService) { + this.formaPagoService = formaPagoService; + } + + public List getLsFormaPagoDet() { + return lsFormaPagoDet; + } + + public void setLsFormaPagoDet(List lsFormaPagoDet) { + this.lsFormaPagoDet = lsFormaPagoDet; + } + + public Combobox getCmbCiudad() { + return cmbCiudad; + } + + public void setCmbCiudad(Combobox cmbCiudad) { + this.cmbCiudad = cmbCiudad; + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public Combobox getCmbParada() { + return cmbParada; + } + + public void setCmbParada(Combobox cmbParada) { + this.cmbParada = cmbParada; + } + + public Combobox getCmbMoneda() { + return cmbMoneda; + } + + public void setCmbMoneda(Combobox cmbMoneda) { + this.cmbMoneda = cmbMoneda; + } + + public Combobox getCmbNodo() { + return cmbNodo; + } + + public void setCmbNodo(Combobox cmbNodo) { + this.cmbNodo = cmbNodo; + } + + public Combobox getCmbTipoPontoVenta() { + return cmbTipoPontoVenta; + } + + public void setCmbTipoPontoVenta(Combobox cmbTipoPontoVenta) { + this.cmbTipoPontoVenta = cmbTipoPontoVenta; + } + + /** + * @return the lsColonia + */ + public List getLsColonia() { + return lsColonia; + } + + /** + * @param lsColonia the lsColonia to set + */ + public void setLsColonia(List lsColonia) { + this.lsColonia = lsColonia; + } + + /** + * @return the lsCiudad + */ + public List getLsCiudad() { + return lsCiudad; + } + + /** + * @param lsCiudad the lsCiudad to set + */ + public void setLsCiudad(List lsCiudad) { + this.lsCiudad = lsCiudad; + } + + /** + * @return the cmbColonia + */ + public Combobox getCmbColonia() { + return cmbColonia; + } + + /** + * @param cmbColonia the cmbColonia to set + */ + public void setCmbColonia(Combobox cmbColonia) { + this.cmbColonia = cmbColonia; + } + + /** + * @return the txtCP + */ + public Textbox getTxtCP() { + return txtCP; + } + + /** + * @param txtCP the txtCP to set + */ + public void setTxtCP(Textbox txtCP) { + this.txtCP = txtCP; + } + + public List getLsUsuarioBancario() { + return lsUsuarioBancario; + } + + public void setLsUsuarioBancario(List lsUsuarioBancario) { + this.lsUsuarioBancario = lsUsuarioBancario; + } + + public List getLsParamRecoleccion() { + return lsParamRecoleccion; + } + + public void setLsParamRecoleccion(List lsParamRecoleccion) { + this.lsParamRecoleccion = lsParamRecoleccion; + } + + public MyListbox getParamRecoleccionList() { + return paramRecoleccionList; + } + + public void setParamRecoleccionList(MyListbox paramRecoleccionList) { + this.paramRecoleccionList = paramRecoleccionList; + } + + public List getLsPtovtaEmpresa() { + return lsPtovtaEmpresa; + } + + public void setLsPtovtaEmpresa(List lsPtovtaEmpresa) { + this.lsPtovtaEmpresa = lsPtovtaEmpresa; + } + + public MyListbox getPtovtaEmpresaList() { + return ptovtaEmpresaList; + } + + public void setPtovtaEmpresaList(MyListbox ptovtaEmpresaList) { + this.ptovtaEmpresaList = ptovtaEmpresaList; + } + + public List getLsPtovtaUsuarioBancario() { + return lsPtovtaUsuarioBancario; + } + + public void setLsPtovtaUsuarioBancario(List lsPtovtaUsuarioBancario) { + this.lsPtovtaUsuarioBancario = lsPtovtaUsuarioBancario; + } + + public MyListbox getPtovtaUsuarioBancarioList() { + return ptovtaUsuarioBancarioList; + } + + public void setPtovtaUsuarioBancarioList(MyListbox ptovtaUsuarioBancarioList) { + this.ptovtaUsuarioBancarioList = ptovtaUsuarioBancarioList; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoConvenioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoConvenioController.java new file mode 100644 index 000000000..4d2ea2ffd --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoConvenioController.java @@ -0,0 +1,139 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.TipoConvenio; +import com.rjconsultores.ventaboletos.service.TipoConvenioService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import java.util.Calendar; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Shiro + */ +@Controller("editarTipoConvenioController") +@Scope("prototype") +public class EditarTipoConvenioController extends MyGenericForwardComposer { + + @Autowired + private TipoConvenioService tipoConvenioService; + private TipoConvenio tc; + private MyListbox tcList; + private MyTextbox txtNome; + private static Logger log = Logger.getLogger(EditarTipoConvenioController.class); + + public TipoConvenio getTc() { + return tc; + } + + public void setTc(TipoConvenio tc) { + this.tc = tc; + } + + public MyListbox getTcList() { + return tcList; + } + + public void setTcList(MyListbox tcList) { + this.tcList = tcList; + } + + public TipoConvenioService getTipoConvenioService() { + return tipoConvenioService; + } + + public void setTipoConvenioService(TipoConvenioService tipoConvenioService) { + this.tipoConvenioService = tipoConvenioService; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tc = (TipoConvenio) Executions.getCurrent().getArg().get("tc"); + tcList = (MyListbox) Executions.getCurrent().getArg().get("tConvenioList"); + + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + txtNome.getValue(); + + try { + tc.setActivo(Boolean.TRUE); + tc.setFecmodif(Calendar.getInstance().getTime()); + tc.setUsuarioId(0); + ///tc.setDescTipo(txtNome.getValue()); + + if (tc.getTipoConvenioID() == null) { + tipoConvenioService.suscribir(tc); + tcList.addItem(tc); + } else { + tipoConvenioService.actualizacion(tc); + tcList.updateItem(tc); + } + + Messagebox.show( + Labels.getLabel("editarTipoConvenioController.MSG.suscribirOK"), + Labels.getLabel("editarTipoConvenioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } catch (Exception ex) { + log.error("editarTipoConvenioController :" + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoConvenioController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTipoConvenioController.MSG.BorrarPergunta"), + Labels.getLabel("editarTipoConvenioController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + tipoConvenioService.borrar(tc); + + Messagebox.show( + Labels.getLabel("editarTipoConvenioController.MSG.BorrarOK"), + Labels.getLabel("editarTipoConvenioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tcList.removeItem(tc); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoCorteController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoCorteController.java new file mode 100644 index 000000000..5c124bb6d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoCorteController.java @@ -0,0 +1,145 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.TipoCorte; +import com.rjconsultores.ventaboletos.service.TipoCorteService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarTipoCorteController") +@Scope("prototype") +public class EditarTipoCorteController extends MyGenericForwardComposer { + + @Autowired + private TipoCorteService tipoCorteService; + private TipoCorte tipoCorte; + private MyListbox tipoCorteList; + private Button btnApagar; + private MyTextbox txtNome; + private static Logger log = Logger.getLogger(EditarTipoCorteController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public TipoCorte getTipoCorte() { + return tipoCorte; + } + + public void setTipoCorte(TipoCorte tipoCorte) { + this.tipoCorte = tipoCorte; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tipoCorte = (TipoCorte) Executions.getCurrent().getArg().get("tipoCorte"); + tipoCorteList = (MyListbox) Executions.getCurrent().getArg().get("tipoCorteList"); + + if (tipoCorte.getTipocorteId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + + try { + tipoCorte.setActivo(Boolean.TRUE); + tipoCorte.setFecmodif(Calendar.getInstance().getTime()); + tipoCorte.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsTipoCorte = tipoCorteService.buscar(tipoCorte.getDesctipo()); + + if (!lsTipoCorte.isEmpty()) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoCorteController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (tipoCorte.getTipocorteId() == null) { + tipoCorteService.suscribir(tipoCorte); + tipoCorteList.addItem(tipoCorte); + } else { + tipoCorteService.actualizacion(tipoCorte); + tipoCorteList.updateItem(tipoCorte); + } + + Messagebox.show( + Labels.getLabel("editarTipoCorteController.MSG.suscribirOK"), + Labels.getLabel("editarTipoCorteController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error("editarTipoCorteController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoCorteController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTipoCorteController.MSG.borrarPergunta"), + Labels.getLabel("editarTipoCorteController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + tipoCorteService.borrar(tipoCorte); + + Messagebox.show( + Labels.getLabel("editarTipoCorteController.MSG.borrarOK"), + Labels.getLabel("editarTipoCorteController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tipoCorteList.removeItem(tipoCorte); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoPuntoVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoPuntoVentaController.java new file mode 100644 index 000000000..85a7aa428 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoPuntoVentaController.java @@ -0,0 +1,268 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.CategoriaTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.service.CategoriaService; +import com.rjconsultores.ventaboletos.service.CategoriaTipoPtoVtaService; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCategoriaTipoPtoVta; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Row; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarTipoPuntoVentaController") +@Scope("prototype") +public class EditarTipoPuntoVentaController extends MyGenericForwardComposer { + + @Autowired + private TipoPuntoVentaService tipoPuntoVentaService; + @Autowired + private CategoriaTipoPtoVtaService categoriaTipoPtoVtaService; + @Autowired + private CategoriaService categoriaService; + private List lsCategoriaTipoPtoVta; + private List lsCategoria; + private MyListbox categoriaTipoPtoVtaList; + private TipoPuntoVenta tipoPuntoVenta; + private MyListbox tipoPuntoVentaList; + private MyTextbox txtNome; + private static Logger log = Logger.getLogger(EditarFormaPagoController.class); + private Button btnApagar; + private Row rowEquivalencia; + private Combobox cmbCategoria; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public TipoPuntoVenta getTipoPuntoVenta() { + return tipoPuntoVenta; + } + + public void setTipoPuntoVenta(TipoPuntoVenta tipoPuntoVenta) { + this.tipoPuntoVenta = tipoPuntoVenta; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + public List getLsCategoria() { + return lsCategoria; + } + + public void setLsCategoria(List lsCategoria) { + this.lsCategoria = lsCategoria; + } + + public List getLsCategoriaTipoPtoVta() { + return lsCategoriaTipoPtoVta; + } + + public void setLsCategoriaTipoPtoVta(List lsCategoriaTipoPtoVta) { + this.lsCategoriaTipoPtoVta = lsCategoriaTipoPtoVta; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsCategoria = categoriaService.obtenerTodos(); + + super.doAfterCompose(comp); + + tipoPuntoVenta = (TipoPuntoVenta) Executions.getCurrent().getArg().get("tipoPuntoVenta"); + tipoPuntoVentaList = (MyListbox) Executions.getCurrent().getArg().get("tipoPuntoVentaList"); + + categoriaTipoPtoVtaList.setItemRenderer(new RenderCategoriaTipoPtoVta()); + lsCategoriaTipoPtoVta = new ArrayList(); + categoriaTipoPtoVtaList.setData(lsCategoriaTipoPtoVta); + + if (tipoPuntoVenta.getTipoptovtaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + lsCategoriaTipoPtoVta = categoriaTipoPtoVtaService.buscarPorPuntoVenta(tipoPuntoVenta); + categoriaTipoPtoVtaList.setData(lsCategoriaTipoPtoVta); + } + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + rowEquivalencia.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getText(); + + try { + + tipoPuntoVenta.setActivo(Boolean.TRUE); + tipoPuntoVenta.setFecmodif(Calendar.getInstance().getTime()); + tipoPuntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tipoPuntoVenta.setLsCategoriaTipoPtoVta(lsCategoriaTipoPtoVta); + + List lsTipoPunto = tipoPuntoVentaService.buscar(tipoPuntoVenta.getDesctipo()); + + if (!lsTipoPunto.isEmpty() && tipoPuntoVenta.getTipoptovtaId() == null) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (tipoPuntoVenta.getTipoptovtaId() == null) { + tipoPuntoVentaService.suscribir(tipoPuntoVenta); + tipoPuntoVentaList.addItem(tipoPuntoVenta); + } else { + tipoPuntoVentaService.actualizacion(tipoPuntoVenta); + tipoPuntoVentaList.updateItem(tipoPuntoVenta); + } + + Messagebox.show( + Labels.getLabel("editarTipoPuntoVentaController.MSG.suscribirOK"), + Labels.getLabel("editarTipoPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + + } catch (Exception ex) { + log.error("editarTipoPuntoVentaController :" + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTipoPuntoVentaController.MSG.borrarPergunta"), + Labels.getLabel("editarTipoPuntoVentaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + tipoPuntoVentaService.borrar(tipoPuntoVenta); + + Messagebox.show( + Labels.getLabel("editarTipoPuntoVentaController.MSG.borrarOK"), + Labels.getLabel("editarTipoPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tipoPuntoVentaList.removeItem(tipoPuntoVenta); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnAdicionarCategoriaTipoPtoVta(Event ev) throws InterruptedException { + cmbCategoria.getValue(); + + try { + Categoria cat = (Categoria) cmbCategoria.getSelectedItem().getValue(); + Boolean achou = Boolean.FALSE; + for (CategoriaTipoPtoVta cds : lsCategoriaTipoPtoVta) { + if (cds.getCategoria() == cat) { + achou = Boolean.TRUE; + } + } + + if (!achou) { + CategoriaTipoPtoVta cd = new CategoriaTipoPtoVta(); + cd.setActivo(Boolean.TRUE); + cd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cd.setFecmodif(Calendar.getInstance().getTime()); + cd.setCategoria(cat); + cd.setTipoPuntoVenta(tipoPuntoVenta); + + lsCategoriaTipoPtoVta.add(cd); + List lsAux = new ArrayList(); + + for (CategoriaTipoPtoVta c : lsCategoriaTipoPtoVta) { + if (c.getActivo()) { + lsAux.add(c); + } + } + categoriaTipoPtoVtaList.setData(lsAux); + + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnRemoverCategoriaTipoPtoVta(Event ev) { + CategoriaTipoPtoVta cd = (CategoriaTipoPtoVta) categoriaTipoPtoVtaList.getSelected(); + + if (cd != null) { + + cd.setActivo(Boolean.FALSE); + cd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cd.setFecmodif(Calendar.getInstance().getTime()); + cd.setTipoPuntoVenta(tipoPuntoVenta); + + if (cd.getCategoriatipoptovtaId() != null) { + categoriaTipoPtoVtaService.borrarFisico(cd); + } + + lsCategoriaTipoPtoVta.remove(cd); + categoriaTipoPtoVtaList.setData(lsCategoriaTipoPtoVta); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoServicioController.java new file mode 100644 index 000000000..d1f9fd0a8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoServicioController.java @@ -0,0 +1,161 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.TipoServicio; +import com.rjconsultores.ventaboletos.service.TipoServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarTipoServicioController") +@Scope("prototype") +public class EditarTipoServicioController extends MyGenericForwardComposer { + + @Autowired + private TipoServicioService tipoServicioService; + private TipoServicio tipoServicio; + private MyListbox tipoServicioList; + private static Logger log = Logger.getLogger(EditarTipoServicioController.class); + private MyTextbox txtNome; + private Button btnApagar; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tipoServicio = (TipoServicio) Executions.getCurrent().getArg().get("tipoServicio"); + tipoServicioList = (MyListbox) Executions.getCurrent().getArg().get("tipoServicioList"); + + if (tipoServicio.getTiposervicioId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + try { + + tipoServicio.setActivo(Boolean.TRUE); + tipoServicio.setFecmodif(Calendar.getInstance().getTime()); + tipoServicio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsTipoServicio = tipoServicioService.buscar(tipoServicio.getDescservicio()); + + if (!lsTipoServicio.isEmpty() && tipoServicio.getTiposervicioId() == null) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoServicioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (tipoServicio.getTiposervicioId() == null) { + tipoServicioService.suscribir(tipoServicio); + tipoServicioList.addItem(tipoServicio); + } else { + tipoServicioService.actualizacion(tipoServicio); + tipoServicioList.updateItem(tipoServicio); + } + + Messagebox.show( + Labels.getLabel("editarTipoServicioController.MSG.suscribirOK"), + Labels.getLabel("editarTipoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error("Exception ao suscribir TipoServicio: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoServicioController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTipoServicioController.MSG.borrarPergunta"), + Labels.getLabel("editarTipoServicioController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + tipoServicioService.borrar(tipoServicio); + + Messagebox.show( + Labels.getLabel("editarTipoServicioController.MSG.borrarOK"), + Labels.getLabel("editarTipoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tipoServicioList.removeItem(tipoServicio); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public TipoServicio getTipoServicio() { + return tipoServicio; + } + + public void setTipoServicio(TipoServicio tipoServicio) { + this.tipoServicio = tipoServicio; + } + + public MyListbox getTipoServicioList() { + return tipoServicioList; + } + + public void setTipoServicioList(MyListbox tipoServicioList) { + this.tipoServicioList = tipoServicioList; + } + + public TipoServicioService getTipoServicioService() { + return tipoServicioService; + } + + public void setTipoServicioService(TipoServicioService tipoServicioService) { + this.tipoServicioService = tipoServicioService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoVentaController.java new file mode 100644 index 000000000..180e7246e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTipoVentaController.java @@ -0,0 +1,189 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.TipoVenta; +import com.rjconsultores.ventaboletos.service.TipoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarTipoVentaController") +@Scope("prototype") +public class EditarTipoVentaController extends MyGenericForwardComposer { + + @Autowired + private TipoVentaService tipoVentaService; + private TipoVenta tipoVenta; + private MyListbox tipoVentaList; + private static Logger log = Logger.getLogger(EditarTipoVentaController.class); + private MyTextbox txtNome; + private Button btnApagar; + private Button btnSalvar; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + TipoVenta tp = (TipoVenta) Executions.getCurrent().getArg().get("tipoVenta"); + tipoVenta = (tp.getTipoventaId() == null) ? tp : tipoVentaService.obtenerID(tp.getTipoventaId()); + tipoVentaList = (MyListbox) Executions.getCurrent().getArg().get("tipoVentaList"); + + if (tipoVenta.getDesctipoventa() != null) { + txtNome.setValue(tipoVenta.getDesctipoventa()); + } + if (tipoVenta.getTipoventaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + if (tipoVenta.getTipoventaId() <= 12) { + btnApagar.setVisible(Boolean.FALSE); + btnSalvar.setVisible(Boolean.FALSE); + txtNome.setDisabled(Boolean.TRUE); + + Messagebox.show( + Labels.getLabel("MSG.noEditabled"), + Labels.getLabel("editarTipoVentaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + try { + tipoVenta.setDesctipoventa(txtNome.getValue()); + tipoVenta.setActivo(Boolean.TRUE); + tipoVenta.setFecmodif(Calendar.getInstance().getTime()); + tipoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsTipoVenta = tipoVentaService.buscar(tipoVenta.getDesctipoventa()); + + boolean podeSalvar = false; + if (lsTipoVenta.isEmpty()) { + podeSalvar = true; + } else { + for (TipoVenta m : lsTipoVenta) { + if (m.getTipoventaId().equals(tipoVenta.getTipoventaId())) { + podeSalvar = true; + } + } + } + + if (!podeSalvar) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoVentaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + + if (tipoVenta.getTipoventaId() == null) { + tipoVentaService.suscribir(tipoVenta); + tipoVentaList.addItem(tipoVenta); + } else { + tipoVentaService.actualizacion(tipoVenta); + tipoVentaList.updateItem(tipoVenta); + } + + Messagebox.show( + Labels.getLabel("editarTipoVentaController.MSG.suscribirOK"), + Labels.getLabel("editarTipoVentaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error("Suscribir TipoVenta: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoVentaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTipoVentaController.MSG.borrarPergunta"), + Labels.getLabel("editarTipoVentaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + tipoVentaService.borrar(tipoVenta); + + Messagebox.show( + Labels.getLabel("editarTipoVentaController.MSG.borrarOK"), + Labels.getLabel("editarTipoVentaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tipoVentaList.removeItem(tipoVenta); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public TipoVenta getTipoVenta() { + return tipoVenta; + } + + public void setTipoVenta(TipoVenta tipoVenta) { + this.tipoVenta = tipoVenta; + } + + public MyListbox getTipoVentaList() { + return tipoVentaList; + } + + public void setTipoVentaList(MyListbox tipoVentaList) { + this.tipoVentaList = tipoVentaList; + } + + public TipoVentaService getTipoVentaService() { + return tipoVentaService; + } + + public void setTipoVentaService(TipoVentaService tipoVentaService) { + this.tipoVentaService = tipoVentaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTurnoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTurnoController.java new file mode 100644 index 000000000..b710d2530 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/catalogos/EditarTurnoController.java @@ -0,0 +1,157 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.catalogos; + +import com.rjconsultores.ventaboletos.entidad.Turno; +import com.rjconsultores.ventaboletos.service.TurnoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarTurnoController") +@Scope("prototype") +public class EditarTurnoController extends MyGenericForwardComposer { + + @Autowired + private TurnoService turnoService; + private Turno turno; + private MyListbox turnoList; + private Button btnApagar; + private MyTextbox txtNome; + private static Logger log = Logger.getLogger(EditarTurnoController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Turno getTurno() { + return turno; + } + + public void setTurno(Turno turno) { + this.turno = turno; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + turno = (Turno) Executions.getCurrent().getArg().get("turno"); + turnoList = (MyListbox) Executions.getCurrent().getArg().get("turnoList"); + + if (turno.getTurnoId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + + try { + turno.setActivo(Boolean.TRUE); + turno.setFecmodif(Calendar.getInstance().getTime()); + turno.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsTurno = turnoService.buscar(turno.getDescturno()); + + boolean podeSalvar = false; + if (lsTurno.isEmpty()) { + podeSalvar = true; + } else { + for (Turno t : lsTurno) { + if (t.getTurnoId().equals(turno.getTurnoId())) { + podeSalvar = true; + } + } + } + + + if (!podeSalvar) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTurnoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (turno.getTurnoId() == null) { + turnoService.suscribir(turno); + turnoList.addItem(turno); + } else { + turnoService.actualizacion(turno); + turnoList.updateItem(turno); + } + + Messagebox.show( + Labels.getLabel("editarTurnoController.MSG.suscribirOK"), + Labels.getLabel("editarTurnoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error("editarTurnoController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTurnoController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTurnoController.MSG.borrarPergunta"), + Labels.getLabel("editarTurnoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + turnoService.borrar(turno); + + Messagebox.show( + Labels.getLabel("editarTurnoController.MSG.borrarOK"), + Labels.getLabel("editarTurnoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + turnoList.removeItem(turno); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaAlertaCtrlController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaAlertaCtrlController.java new file mode 100644 index 000000000..28da75307 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaAlertaCtrlController.java @@ -0,0 +1,246 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.AlertaCtrl; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderAlertaCtrl; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Radio; + +/** + * + * @author Administrador + */ +@Controller("busquedaAlertaCtrlController") +@Scope("prototype") +public class BusquedaAlertaCtrlController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwAlertaCtrl; + @Autowired + private RutaService rutaService; + @Autowired + private ClaseServicioService claseServicioService; + private List lsClaseServicio; + private MyListbox alertaCtrlList; + private Paging pagingAlertaCtrl; + private Combobox cmbRuta; + private Combobox cmbOrigem; + private Combobox cmbDestino; + private Combobox cmbClaseServicio; + private List lsRuta; + private Intbox txtIdCorrida; + private Radio rdAlta; + private Radio rdBaja; + private Radio rdAmbas; + + public MyListbox getAlertaCtrlList() { + return alertaCtrlList; + } + + public void setAlertaCtrlList(MyListbox alertaCtrlList) { + this.alertaCtrlList = alertaCtrlList; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Combobox getCmbDestino() { + return cmbDestino; + } + + public void setCmbDestino(Combobox cmbDestino) { + this.cmbDestino = cmbDestino; + } + + public Combobox getCmbOrigem() { + return cmbOrigem; + } + + public void setCmbOrigem(Combobox cmbOrigem) { + this.cmbOrigem = cmbOrigem; + } + + public Combobox getCmbRuta() { + return cmbRuta; + } + + public void setCmbRuta(Combobox cmbRuta) { + this.cmbRuta = cmbRuta; + } + + public List getLsRuta() { + return lsRuta; + } + + public void setLsRuta(List lsRuta) { + this.lsRuta = lsRuta; + } + + public Paging getPagingAlertaCtrl() { + return pagingAlertaCtrl; + } + + public void setPagingAlertaCtrl(Paging pagingAlertaCtrl) { + this.pagingAlertaCtrl = pagingAlertaCtrl; + } + + public Intbox getTxtIdCorrida() { + return txtIdCorrida; + } + + public void setTxtIdCorrida(Intbox txtIdCorrida) { + this.txtIdCorrida = txtIdCorrida; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + lsRuta = new ArrayList(); + + alertaCtrlList.setItemRenderer(new RenderAlertaCtrl()); + alertaCtrlList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + AlertaCtrl c = (AlertaCtrl) alertaCtrlList.getSelected(); + verAlertaCtrl(c); + } + }); + + refreshLista(); + + lsClaseServicio = claseServicioService.obtenerTodos(); + BindingListModelList modelClaseServicio = new BindingListModelList(lsClaseServicio, true); + cmbClaseServicio.setModel(modelClaseServicio); + + cmbClaseServicio.focus(); + } + + private void verAlertaCtrl(AlertaCtrl a) { + if (a == null) { + return; + } + + Map args = new HashMap(); + args.put("alertaCtrl", a); + args.put("alertaCtrlList", alertaCtrlList); + + openWindow("/gui/configuraciones_comerciales/editarAlertaCtrl.zul", + Labels.getLabel("busquedaAlertaCtrlController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject alertaCtrlBusqueda = + new HibernateSearchObject(AlertaCtrl.class, + pagingAlertaCtrl.getPageSize()); + alertaCtrlBusqueda.addFilterEqual("activo", Boolean.TRUE); + + Comboitem cbiRuta = cmbRuta.getSelectedItem(); + if (cbiRuta != null) { + Ruta ruta = (Ruta) cbiRuta.getValue(); + alertaCtrlBusqueda.addFilterEqual("ruta", ruta); + } + + Comboitem cbiOrigem = cmbOrigem.getSelectedItem(); + if (cbiOrigem != null) { + Parada origem = (Parada) cbiOrigem.getValue(); + alertaCtrlBusqueda.addFilterEqual("origem", origem); + } + + Comboitem cbiDestino = cmbDestino.getSelectedItem(); + if (cbiDestino != null) { + Parada destino = (Parada) cbiDestino.getValue(); + alertaCtrlBusqueda.addFilterEqual("destino", destino); + } + + Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem(); + if (cbiClaseServicio != null) { + ClaseServicio claseServicio = (ClaseServicio) cbiClaseServicio.getValue(); + alertaCtrlBusqueda.addFilterEqual("claseServicio", claseServicio); + } + + Integer idCorrida = txtIdCorrida.getValue(); + if (idCorrida != null) { + alertaCtrlBusqueda.addFilterEqual("corrida.id.corridaId", idCorrida); + } + + if (rdAlta.isChecked()) { + alertaCtrlBusqueda.addFilterNotNull("porcalta"); + alertaCtrlBusqueda.addFilterNull("porcbaja"); + } else if (rdBaja.isChecked()) { + alertaCtrlBusqueda.addFilterNotNull("porcbaja"); + alertaCtrlBusqueda.addFilterNull("porcalta"); + } + + plwAlertaCtrl.init(alertaCtrlBusqueda, alertaCtrlList, pagingAlertaCtrl); + if (alertaCtrlList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaAlertaCtrlController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verAlertaCtrl(new AlertaCtrl()); + } + + public void onChange$cmbClaseServicio(Event ev) { + Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem(); + + if (cbiClaseServicio != null) { + ClaseServicio claseServicio = (ClaseServicio) cbiClaseServicio.getValue(); + lsRuta = rutaService.buscarPorClaseServicio(claseServicio); + + cmbRuta.setSelectedItem(null); + cmbRuta.setText(null); + + BindingListModelList modelRuta = new BindingListModelList(lsRuta, true); + cmbRuta.setModel(modelRuta); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaComisionistaExternoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaComisionistaExternoController.java new file mode 100644 index 000000000..d0f7dd6ec --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaComisionistaExternoController.java @@ -0,0 +1,129 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderComisionistaExterno; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaComisionistaExternoController") +@Scope("prototype") +public class BusquedaComisionistaExternoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwComisionistaExterno; + private MyListbox comisionistaExternoList; + private Paging pagingComisionistaExterno; + private Textbox txtNombre; + + public MyListbox getComisionistaExternoList() { + return comisionistaExternoList; + } + + public void setComisionistaExternoList(MyListbox comisionistaExternoList) { + this.comisionistaExternoList = comisionistaExternoList; + } + + public Paging getPagingComisionistaExterno() { + return pagingComisionistaExterno; + } + + public void setPagingComisionistaExterno(Paging pagingComisionistaExterno) { + this.pagingComisionistaExterno = pagingComisionistaExterno; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + comisionistaExternoList.setItemRenderer(new RenderComisionistaExterno()); + comisionistaExternoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ComisionistaExterno c = (ComisionistaExterno) comisionistaExternoList.getSelected(); + verComisionistaExterno(c); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verComisionistaExterno(ComisionistaExterno c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("comisionistaExterno", c); + args.put("comisionistaExternoList", comisionistaExternoList); + + openWindow("/gui/configuraciones_comerciales/editarComisionistaExterno.zul", + Labels.getLabel("editarComisionistaExternoController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject comisionistaExternoBusqueda = + new HibernateSearchObject(ComisionistaExterno.class, pagingComisionistaExterno.getPageSize()); + + comisionistaExternoBusqueda.addFilterLike("desccomisionista", + "%" + txtNombre.getText().trim().concat("%")); + comisionistaExternoBusqueda.addFilterEqual("activo", Boolean.TRUE); + + comisionistaExternoBusqueda.addSortAsc("desccomisionista"); + + plwComisionistaExterno.init(comisionistaExternoBusqueda, comisionistaExternoList, pagingComisionistaExterno); + + if (comisionistaExternoList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaComisionistaExternoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verComisionistaExterno(new ComisionistaExterno()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionCancelacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionCancelacionController.java new file mode 100644 index 000000000..6539b043f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionCancelacionController.java @@ -0,0 +1,299 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.CancelacionCtrl; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.MotivoCancelacionService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionCancelacion; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Timebox; + +/** + * + * @author Rafius + */ +@Controller("busquedaConfiguracionCancelacionController") +@Scope("prototype") +public class BusquedaConfiguracionCancelacionController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwConfigCancelacion; + @Autowired + private PuntoVentaService puntoVentaService; + @Autowired + private MarcaService marcaService; + @Autowired + private ParadaService paradaService; + @Autowired + private MotivoCancelacionService motivoCancelacionService; + private MyListbox cancelacionCtrlList; + private Paging pagingCancelacion; + private List lsPuntoVenta; + private List lsMarca; + private List lsMotivoCancelacion; + private List lsParada; + private Combobox cmbMarca; + private Combobox cmbParadaDestino; + private Combobox cmbParadaOrigem; + private Combobox cmbPuntoVenta; + private Combobox cmbMotivoCancelacion; + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Combobox getCmbParadaDestino() { + return cmbParadaDestino; + } + + public void setCmbParadaDestino(Combobox cmbParadaDestino) { + this.cmbParadaDestino = cmbParadaDestino; + } + + public Combobox getCmbParadaOrigem() { + return cmbParadaOrigem; + } + + public void setCmbParadaOrigem(Combobox cmbParadaOrigem) { + this.cmbParadaOrigem = cmbParadaOrigem; + } + + public Combobox getCmbPuntoVenta() { + return cmbPuntoVenta; + } + + public void setCmbPuntoVenta(Combobox cmbPuntoVenta) { + this.cmbPuntoVenta = cmbPuntoVenta; + } + + public List getLsMarca() { + return lsMarca; + } + + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + public List getLsParada() { + return lsParada; + } + + public void setLsParada(List lsParada) { + this.lsParada = lsParada; + } + + public List getLsPuntoVenta() { + return lsPuntoVenta; + } + + public void setLsPuntoVenta(List lsPuntoVenta) { + this.lsPuntoVenta = lsPuntoVenta; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + lsPuntoVenta = new ArrayList(); + lsPuntoVenta.add(new PuntoVenta()); + lsPuntoVenta.addAll(puntoVentaService.obtenerTodos()); + + lsMarca = new ArrayList(); + lsMarca.add(new Marca()); + lsMarca.addAll(marcaService.obtenerTodos()); + + lsParada = new ArrayList(); + lsParada.add(new Parada()); + lsParada.addAll(paradaService.obtenerTodos()); + + lsMotivoCancelacion = new ArrayList(); + lsMotivoCancelacion.add(new MotivoCancelacion()); + lsMotivoCancelacion.addAll(motivoCancelacionService.obtenerTodosTipoMotivoB()); + + cancelacionCtrlList.setItemRenderer(new RenderConfiguracionCancelacion()); + cancelacionCtrlList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + CancelacionCtrl cc = (CancelacionCtrl) cancelacionCtrlList.getSelected(); + verConfigCancelacion(cc); + } + }); + + refreshLista(); + + + } + + private void verConfigCancelacion(CancelacionCtrl cc) { + if (cc == null) { + return; + } + + Map args = new HashMap(); + args.put("cancelacionCtrl", cc); + args.put("cancelacionCtrlList", cancelacionCtrlList); + + openWindow("/gui/configuraciones_comerciales/editarConfiguracionCancelacion.zul", + Labels.getLabel("editarConfiguracionCancelacionController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject configCancelacionBusqueda = + new HibernateSearchObject(CancelacionCtrl.class, + pagingCancelacion.getPageSize()); + + configCancelacionBusqueda.addFilterEqual("activo", Boolean.TRUE); + + Marca marca = (Marca) (cmbMarca.getSelectedItem() != null ? cmbMarca.getSelectedItem().getValue() : null); + Parada paradaDestino = (Parada) (cmbParadaDestino.getSelectedItem() != null ? cmbParadaDestino.getSelectedItem().getValue() : null); + Parada paradaOrigem = (Parada) (cmbParadaOrigem.getSelectedItem() != null ? cmbParadaOrigem.getSelectedItem().getValue() : null); + PuntoVenta puntoVenta = (PuntoVenta) (cmbPuntoVenta.getSelectedItem() != null ? cmbPuntoVenta.getSelectedItem().getValue() : null); + MotivoCancelacion motivoCancelacion = (MotivoCancelacion) (cmbMotivoCancelacion.getSelectedItem() != null ? cmbMotivoCancelacion.getSelectedItem().getValue() : null); + + if (marca != null) { + configCancelacionBusqueda.addFilterEqual("marca", marca); + } + + if (paradaDestino != null) { + configCancelacionBusqueda.addFilterEqual("paradaDestino", paradaDestino); + } + + if (paradaOrigem != null) { + configCancelacionBusqueda.addFilterEqual("paradaOrigem", paradaOrigem); + } + + if (puntoVenta != null) { + configCancelacionBusqueda.addFilterEqual("puntoVenta", puntoVenta); + } + + if (motivoCancelacion != null) { + configCancelacionBusqueda.addFilterEqual("motivoCancelacion", motivoCancelacion); + } + + plwConfigCancelacion.init(configCancelacionBusqueda, cancelacionCtrlList, pagingCancelacion); + + if (cancelacionCtrlList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaConfiguracionCancelacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verConfigCancelacion(new CancelacionCtrl()); + } + + public MyListbox getConfigCancelacionList() { + return cancelacionCtrlList; + } + + public void setConfigCancelacionList(MyListbox configCancelacionList) { + this.cancelacionCtrlList = configCancelacionList; + } + + public Paging getPagingConfigCancelacion() { + return pagingCancelacion; + } + + public void setPagingConfigCancelacion(Paging pagingConfigCancelacion) { + this.pagingCancelacion = pagingConfigCancelacion; + } + + public PagedListWrapper getPlwConfigCancelacion() { + return plwConfigCancelacion; + } + + public void setPlwConfigCancelacion(PagedListWrapper plwConfigCancelacion) { + this.plwConfigCancelacion = plwConfigCancelacion; + } + + public Combobox getCmbMotivoCancelacion() { + return cmbMotivoCancelacion; + } + + public void setCmbMotivoCancelacion(Combobox cmbMotivoCancelacion) { + this.cmbMotivoCancelacion = cmbMotivoCancelacion; + } + + public List getLsMotivoCancelacion() { + return lsMotivoCancelacion; + } + + public void setLsMotivoCancelacion(List lsMotivoCancelacion) { + this.lsMotivoCancelacion = lsMotivoCancelacion; + } + + public MarcaService getMarcaService() { + return marcaService; + } + + public void setMarcaService(MarcaService marcaService) { + this.marcaService = marcaService; + } + + public MotivoCancelacionService getMotivoCancelacionService() { + return motivoCancelacionService; + } + + public void setMotivoCancelacionService(MotivoCancelacionService motivoCancelacionService) { + this.motivoCancelacionService = motivoCancelacionService; + } + + public ParadaService getParadaService() { + return paradaService; + } + + public void setParadaService(ParadaService paradaService) { + this.paradaService = paradaService; + } + + public PuntoVentaService getPuntoVentaService() { + return puntoVentaService; + } + + public void setPuntoVentaService(PuntoVentaService puntoVentaService) { + this.puntoVentaService = puntoVentaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionCategoriaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionCategoriaController.java new file mode 100644 index 000000000..79972be98 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionCategoriaController.java @@ -0,0 +1,132 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCategoriaDescuento; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author rodrigo + */ +@Controller("busquedaConfiguracionCategoriaController") +@Scope("prototype") +public class BusquedaConfiguracionCategoriaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwpagingcategoriaCtrl; + private MyListbox categoriaCtrlList; + private Paging pagingCategoriaCtrl; + private Textbox txtNome; + + public MyListbox getConfigCategoriaList() { + return categoriaCtrlList; + } + + public void setConfigCategoriaList(MyListbox configCategoriaList) { + this.categoriaCtrlList = configCategoriaList; + } + + public Paging getPagingConfigCategoria() { + return pagingCategoriaCtrl; + } + + public void setPagingConfigCategoria(Paging pagingConfigCategoria) { + this.pagingCategoriaCtrl = pagingConfigCategoria; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + categoriaCtrlList.setItemRenderer(new RenderCategoriaDescuento()); + categoriaCtrlList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + CategoriaCtrl cc = (CategoriaCtrl) categoriaCtrlList.getSelected(); + verConfigCategoria(cc); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verConfigCategoria(CategoriaCtrl cc) { + if (cc == null) { + return; + } + + Map args = new HashMap(); + args.put("categoriaCtrl", cc); + args.put("categoriaCtrlList", categoriaCtrlList); + + openWindow("/gui/configuraciones_comerciales/editarConfiguracionCategorias.zul", + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject configCategoriaBusqueda = + new HibernateSearchObject(CategoriaCtrl.class, + pagingCategoriaCtrl.getPageSize()); + + if (!txtNome.getText().equals("")) { + configCategoriaBusqueda.addFilterLike("empresa.nombempresa", "%" + txtNome.getText().trim().concat("%")); + } + + configCategoriaBusqueda.addFilterEqual("empresa.activo", Boolean.TRUE); + configCategoriaBusqueda.addFilterEqual("activo", Boolean.TRUE); + configCategoriaBusqueda.addSortAsc("empresa.nombempresa"); + + plwpagingcategoriaCtrl.init(configCategoriaBusqueda, categoriaCtrlList, pagingCategoriaCtrl); + + if (categoriaCtrlList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verConfigCategoria(new CategoriaCtrl()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionFormaPagoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionFormaPagoController.java new file mode 100644 index 000000000..0068d0550 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionFormaPagoController.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.FormaPagoDet; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionFormasPago; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaConfiguracionFormaPagoController") +@Scope("prototype") +public class BusquedaConfiguracionFormaPagoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwConfigFormaPago; + private MyListbox configFormaPagoList; + private Paging pagingConfigFormaPago; + private Textbox txtNome; + + public MyListbox getConfigFormaPagoList() { + return configFormaPagoList; + } + + public void setConfigFormaPagoList(MyListbox configFormaPagoList) { + this.configFormaPagoList = configFormaPagoList; + } + + public Paging getPagingConfigFormaPago() { + return pagingConfigFormaPago; + } + + public void setPagingConfigFormaPago(Paging pagingConfigFormaPago) { + this.pagingConfigFormaPago = pagingConfigFormaPago; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + configFormaPagoList.setItemRenderer(new RenderConfiguracionFormasPago()); + configFormaPagoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + FormaPagoDet fpd = (FormaPagoDet) configFormaPagoList.getSelected(); + verConfigFormaPago(fpd); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verConfigFormaPago(FormaPagoDet fpd) { + if (fpd == null) { + return; + } + + Map args = new HashMap(); + args.put("formaPagoDet", fpd); + args.put("configFormaPagoList", configFormaPagoList); + + openWindow("/gui/configuraciones_comerciales/editarConfiguracionFormaPago.zul", + Labels.getLabel("editarConfiguracionFormaPagoController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject configFormaPagoBusqueda = + new HibernateSearchObject(FormaPagoDet.class, + pagingConfigFormaPago.getPageSize()); + + configFormaPagoBusqueda.addFilterLike("formaPago.descpago", + "%" + txtNome.getText().trim().concat("%")); + + configFormaPagoBusqueda.addSortAsc("formaPago.descpago"); + configFormaPagoBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwConfigFormaPago.init(configFormaPagoBusqueda, configFormaPagoList, pagingConfigFormaPago); + + if (configFormaPagoList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaConfiguracionFormaPagoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verConfigFormaPago(new FormaPagoDet()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionGeneralController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionGeneralController.java new file mode 100644 index 000000000..44fd9f9c7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionGeneralController.java @@ -0,0 +1,127 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.Constante; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionGeneral; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaConfiguracionGeneralController") +@Scope("prototype") +public class BusquedaConfiguracionGeneralController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwConstante; + private MyListbox constanteList; + private Paging pagingConstante; + private Textbox txtNombre; + + public Paging getPagingConstante() { + return pagingConstante; + } + + public void setPagingConstante(Paging pagingConstante) { + this.pagingConstante = pagingConstante; + } + + public MyListbox getConstanteList() { + return constanteList; + } + + public void setConstanteList(MyListbox constanteList) { + this.constanteList = constanteList; + } + + public PagedListWrapper getPlwConstante() { + return plwConstante; + } + + public void setPlwConstante(PagedListWrapper plwConstante) { + this.plwConstante = plwConstante; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new Constante()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + constanteList.setItemRenderer(new RenderConfiguracionGeneral()); + constanteList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Constante c = (Constante) constanteList.getSelected(); + verPeriodo(c); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verPeriodo(Constante c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("constante", c); + args.put("constanteList", constanteList); + + openWindow("/gui/configuraciones_comerciales/editarConfiguracionGeneral.zul", + Labels.getLabel("editarConfiguracionGeneralController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(Constante.class, pagingConstante.getPageSize()); + + claseServicioBusqueda.addFilterLike("descconstante", "%" + txtNombre.getText().trim().concat("%")); + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + claseServicioBusqueda.addSortAsc("nombconstante"); + + plwConstante.init(claseServicioBusqueda, constanteList, pagingConstante); + + if (constanteList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaConfiguracionGeneralController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionReservacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionReservacionController.java new file mode 100644 index 000000000..fb30a1c65 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConfiguracionReservacionController.java @@ -0,0 +1,143 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.ReservacionCtrl; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionReservacion; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Paging; + +/** + * + * @author Rafius + */ +@Controller("busquedaConfiguracionReservacionController") +@Scope("prototype") +public class BusquedaConfiguracionReservacionController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwReservacionCtrl; + private MyListbox reservacionCtrlList; + private Paging pagingReservacionCtrl; + private Datebox fecInicio; + private Datebox fecFinal; + + public Paging getPagingReservacionCtrl() { + return pagingReservacionCtrl; + } + + public void setPagingReservacionCtrl(Paging pagingReservacionCtrl) { + this.pagingReservacionCtrl = pagingReservacionCtrl; + } + + public MyListbox getReservacionCtrlList() { + return reservacionCtrlList; + } + + public void setReservacionCtrlList(MyListbox reservacionCtrlList) { + this.reservacionCtrlList = reservacionCtrlList; + } + + public PagedListWrapper getPlwReservacionCtrl() { + return plwReservacionCtrl; + } + + public void setPlwReservacionCtrl(PagedListWrapper plwReservacionCtrl) { + this.plwReservacionCtrl = plwReservacionCtrl; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + pesquisarLista(); + } + + public void onClick$btnRefresh(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new ReservacionCtrl()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + reservacionCtrlList.setItemRenderer(new RenderConfiguracionReservacion()); + reservacionCtrlList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ReservacionCtrl rc = (ReservacionCtrl) reservacionCtrlList.getSelected(); + verPeriodo(rc); + } + }); + + refreshLista(); + + fecInicio.focus(); + } + + private void verPeriodo(ReservacionCtrl rc) { + if (rc == null) { + return; + } + + Map args = new HashMap(); + args.put("reservacionCtrl", rc); + args.put("reservacionCtrlList", reservacionCtrlList); + + openWindow("/gui/configuraciones_comerciales/editarConfiguracionReservacion.zul", + Labels.getLabel("editarConfiguracionReservacionController.window.title"), args, MODAL); + } + + private void refreshLista() throws InterruptedException { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(ReservacionCtrl.class, pagingReservacionCtrl.getPageSize()); + + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + claseServicioBusqueda.addSortAsc("fecinicio"); + + plwReservacionCtrl.init(claseServicioBusqueda, reservacionCtrlList, pagingReservacionCtrl); + } + + private void pesquisarLista() throws InterruptedException { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(ReservacionCtrl.class, pagingReservacionCtrl.getPageSize()); + + if (fecInicio.getValue() != null && fecFinal.getValue() != null) { + claseServicioBusqueda.addFilterGreaterOrEqual("fecinicio", fecInicio.getValue()); + claseServicioBusqueda.addFilterLessOrEqual("fecfinal", fecFinal.getValue()); + } else { + Messagebox.show(Labels.getLabel("busquedaConfiguracionReservacionController.periodo.label"), + Labels.getLabel("busquedaConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + claseServicioBusqueda.addSortAsc("fecinicio"); + + plwReservacionCtrl.init(claseServicioBusqueda, reservacionCtrlList, pagingReservacionCtrl); + + if (reservacionCtrlList.getData().length == 0) { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConvenioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConvenioController.java new file mode 100644 index 000000000..b3f912516 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaConvenioController.java @@ -0,0 +1,111 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.Convenio; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConvenio; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaConvenioController") +@Scope("prototype") +public class BusquedaConvenioController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwConvenio; + private MyListbox convenioList; + private Paging pagingConvenio; + private Textbox txtDescconvenio; + private Textbox txtCveconvenio; + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + convenioList.setItemRenderer(new RenderConvenio()); + convenioList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Convenio c = (Convenio) convenioList.getSelected(); + verConvenio(c); + } + }); + + refreshLista(); + + txtDescconvenio.focus(); + } + + private void verConvenio(Convenio c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("convenio", c); + args.put("convenioList", convenioList); + + openWindow("/gui/configuraciones_comerciales/editarConvenio.zul", + Labels.getLabel("editarConvenioController.window.title"), + args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject convenioBusqueda = + new HibernateSearchObject(Convenio.class, + pagingConvenio.getPageSize()); + + convenioBusqueda.addFilterEqual("activo", Boolean.TRUE); + + convenioBusqueda.addFilterLike("descconvenio", + "%" + txtDescconvenio.getText().trim().concat("%")); + convenioBusqueda.addFilterLike("cveconvenio", + "%" + txtCveconvenio.getText().trim().concat("%")); + + convenioBusqueda.addSortAsc("descconvenio"); + + plwConvenio.init(convenioBusqueda, convenioList, pagingConvenio); + + if (convenioList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaConvenioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verConvenio(new Convenio()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaMotivoCancelacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaMotivoCancelacionController.java new file mode 100644 index 000000000..a63467d79 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaMotivoCancelacionController.java @@ -0,0 +1,145 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMotivoCancelacion; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaMotivoCancelacionController") +@Scope("prototype") +public class BusquedaMotivoCancelacionController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwMotivoCancelacion; + private MyListbox motivoCancelacionList; + private Paging pagingMotivoCancelacion; + private Textbox txtNombre; + private Combobox cmbTipoMotivo; + + public Combobox getCmbTipoMotivo() { + return cmbTipoMotivo; + } + + public void setCmbTipoMotivo(Combobox cmbTipoMotivo) { + this.cmbTipoMotivo = cmbTipoMotivo; + } + + public Paging getPagingMotivoCancelacion() { + return pagingMotivoCancelacion; + } + + public void setPagingMotivoCancelacion(Paging pagingMotivoCancelacion) { + this.pagingMotivoCancelacion = pagingMotivoCancelacion; + } + + public MyListbox getMotivoCancelacionList() { + return motivoCancelacionList; + } + + public void setMotivoCancelacionList(MyListbox motivoCancelacionList) { + this.motivoCancelacionList = motivoCancelacionList; + } + + public PagedListWrapper getPlwMotivoCancelacion() { + return plwMotivoCancelacion; + } + + public void setPlwMotivoCancelacion(PagedListWrapper plwMotivoCancelacion) { + this.plwMotivoCancelacion = plwMotivoCancelacion; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new MotivoCancelacion()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + motivoCancelacionList.setItemRenderer(new RenderMotivoCancelacion()); + motivoCancelacionList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + MotivoCancelacion mc = (MotivoCancelacion) motivoCancelacionList.getSelected(); + verPeriodo(mc); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verPeriodo(MotivoCancelacion mc) { + if (mc == null) { + return; + } + + Map args = new HashMap(); + args.put("motivoCancelacion", mc); + args.put("motivoCancelacionList", motivoCancelacionList); + + openWindow("/gui/configuraciones_comerciales/editarMotivoCancelacion.zul", + Labels.getLabel("editarMotivoCancelacionController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(MotivoCancelacion.class, pagingMotivoCancelacion.getPageSize()); + + Comboitem ci = cmbTipoMotivo.getSelectedItem(); + String tipoMotivo = null; + if (ci != null) { + tipoMotivo = (String) ci.getValue(); + } + + claseServicioBusqueda.addFilterLike("descmotivo", "%" + txtNombre.getText().trim().concat("%")); + claseServicioBusqueda.addFilterEqual("tipomotivo", tipoMotivo); + claseServicioBusqueda.addFilterEqual("activo", true); + claseServicioBusqueda.addSortAsc("descmotivo"); + + plwMotivoCancelacion.init(claseServicioBusqueda, motivoCancelacionList, pagingMotivoCancelacion); + + if (motivoCancelacionList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaMotivoCancelacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaMotivoReimpresionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaMotivoReimpresionController.java new file mode 100644 index 000000000..08bb09338 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaMotivoReimpresionController.java @@ -0,0 +1,128 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.MotivoReimpresion; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMotivoReimpresion; +import java.util.HashMap; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaMotivoReimpresionController") +@Scope("prototype") +public class BusquedaMotivoReimpresionController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwMotivoReimpresion; + private MyListbox motivoReimpresionList; + private Paging pagingMotivoReimpresion; + private Textbox txtNombre; + + public Paging getPagingMotivoReimpresion() { + return pagingMotivoReimpresion; + } + + public void setPagingMotivoReimpresion(Paging pagingMotivoReimpresion) { + this.pagingMotivoReimpresion = pagingMotivoReimpresion; + } + + public MyListbox getMotivoReimpresionList() { + return motivoReimpresionList; + } + + public void setMotivoReimpresionList(MyListbox motivoReimpresionList) { + this.motivoReimpresionList = motivoReimpresionList; + } + + public PagedListWrapper getPlwMotivoReimpresion() { + return plwMotivoReimpresion; + } + + public void setPlwMotivoReimpresion(PagedListWrapper plwMotivoReimpresion) { + this.plwMotivoReimpresion = plwMotivoReimpresion; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new MotivoReimpresion()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + motivoReimpresionList.setItemRenderer(new RenderMotivoReimpresion()); + motivoReimpresionList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + MotivoReimpresion mr = (MotivoReimpresion) motivoReimpresionList.getSelected(); + verPeriodo(mr); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verPeriodo(MotivoReimpresion mr) { + if (mr == null) { + return; + } + + Map args = new HashMap(); + args.put("motivoReimpresion", mr); + args.put("motivoReimpresionList", motivoReimpresionList); + + openWindow("/gui/configuraciones_comerciales/editarMotivoReimpresion.zul", + Labels.getLabel("editarMotivoReimpresionController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(MotivoReimpresion.class, pagingMotivoReimpresion.getPageSize()); + + claseServicioBusqueda.addFilterLike("descmotivo", "%" + txtNombre.getText().trim().concat("%")); + claseServicioBusqueda.addFilterEqual("activo", true); + claseServicioBusqueda.addSortAsc("descmotivo"); + + plwMotivoReimpresion.init(claseServicioBusqueda, motivoReimpresionList, pagingMotivoReimpresion); + + if (motivoReimpresionList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaMotivoReimpresionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaPeriodoVacacionalController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaPeriodoVacacionalController.java new file mode 100644 index 000000000..aa948653c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaPeriodoVacacionalController.java @@ -0,0 +1,147 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.PeriodoVacacional; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPeriodoVacacional; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; + +/** + * + * @author Rafius + */ +@Controller("busquedaPeriodoVacacionalController") +@Scope("prototype") +public class BusquedaPeriodoVacacionalController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwPeriodoVacacional; + private MyListbox periodoVacacionalList; + private Paging pagingPeriodoVacacional; + private Datebox fecInicio; + private Datebox fecFinal; + + public Paging getPagingPeriodoVacacional() { + return pagingPeriodoVacacional; + } + + public void setPagingPeriodoVacacional(Paging pagingPeriodoVacacional) { + this.pagingPeriodoVacacional = pagingPeriodoVacacional; + } + + public MyListbox getPeriodoVacacionalList() { + return periodoVacacionalList; + } + + public void setPeriodoVacacionalList(MyListbox periodoVacacionalList) { + this.periodoVacacionalList = periodoVacacionalList; + } + + public PagedListWrapper getPlwPeriodoVacacional() { + return plwPeriodoVacacional; + } + + public void setPlwPeriodoVacacional(PagedListWrapper plwPeriodoVacacional) { + this.plwPeriodoVacacional = plwPeriodoVacacional; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + if (fecInicio.getValue() != null && fecFinal.getValue() != null) { + if (fecInicio.getValue().after(fecFinal.getValue())) { + Messagebox.show( + Labels.getLabel("editarPeriodoVacacionalController.MSG.busquedaPeriodo"), + Labels.getLabel("editarPeriodoVacacionalController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else { + refreshLista(); + } + } else { + refreshLista(); + } + + refreshLista(); + + fecInicio.focus(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new PeriodoVacacional()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + periodoVacacionalList.setItemRenderer(new RenderPeriodoVacacional()); + periodoVacacionalList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PeriodoVacacional pv = (PeriodoVacacional) periodoVacacionalList.getSelected(); + verPeriodo(pv); + } + }); + + refreshLista(); + } + + private void verPeriodo(PeriodoVacacional pv) { + if (pv == null) { + return; + } + + Map args = new HashMap(); + args.put("periodoVacacional", pv); + args.put("periodoVacacionalList", periodoVacacionalList); + + openWindow("/gui/configuraciones_comerciales/editarPeriodoVacacional.zul", + Labels.getLabel("editarPeriodoVacacionalController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(PeriodoVacacional.class, pagingPeriodoVacacional.getPageSize()); + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + + if (fecInicio.getValue() != null) { + claseServicioBusqueda.addFilterGreaterOrEqual("fecinicio", fecInicio.getValue()); + } + if (fecFinal.getValue() != null) { + claseServicioBusqueda.addFilterLessOrEqual("fecfinal", fecFinal.getValue()); + } + + claseServicioBusqueda.addSortAsc("fecinicio"); + + plwPeriodoVacacional.init(claseServicioBusqueda, periodoVacacionalList, pagingPeriodoVacacional); + + if (periodoVacacionalList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaPeriodoVacacionalController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaRestriccionFormaPagoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaRestriccionFormaPagoController.java new file mode 100644 index 000000000..e21e3d142 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaRestriccionFormaPagoController.java @@ -0,0 +1,135 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRestriccionFormaPago; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaRestriccionFormaPagoController") +@Scope("prototype") +public class BusquedaRestriccionFormaPagoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwRestriccionFormaPago; + private MyListbox restriccionFormaPagoList; + private Paging pagingrestriccionFormaPago; + private Textbox txtNome; + + public Paging getPagingrestriccionFormaPago() { + return pagingrestriccionFormaPago; + } + + public void setPagingrestriccionFormaPago(Paging pagingrestriccionFormaPago) { + this.pagingrestriccionFormaPago = pagingrestriccionFormaPago; + } + + public MyListbox getRestriccionFormaPagoList() { + return restriccionFormaPagoList; + } + + public void setRestriccionFormaPagoList(MyListbox restriccionFormaPagoList) { + this.restriccionFormaPagoList = restriccionFormaPagoList; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + restriccionFormaPagoList.setItemRenderer(new RenderRestriccionFormaPago()); + restriccionFormaPagoList.addEventListener("onDoubleClick", + new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ConfigRestriccionPago c = + (ConfigRestriccionPago) restriccionFormaPagoList.getSelected(); + verConfigRestriccionPago(c); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verConfigRestriccionPago(ConfigRestriccionPago c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("configRestriccionPago", c); + args.put("configRestriccionFormaPagoList", restriccionFormaPagoList); + + openWindow("/gui/configuraciones_comerciales/editarRestriccionFormaPago.zul", + Labels.getLabel("editarRestriccionFormaPagoController.window.title"), + args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject configRestriccionPagoBusqueda = + new HibernateSearchObject( + ConfigRestriccionPago.class, + pagingrestriccionFormaPago.getPageSize()); + + configRestriccionPagoBusqueda.addFilterLike("formaPago.descpago", + "%" + txtNome.getText().trim().concat("%")); + + configRestriccionPagoBusqueda.addSortAsc("formaPago.descpago"); + configRestriccionPagoBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwRestriccionFormaPago.init(configRestriccionPagoBusqueda, + restriccionFormaPagoList, pagingrestriccionFormaPago); + + if (restriccionFormaPagoList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaRestriccionFormaPagoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verConfigRestriccionPago(new ConfigRestriccionPago()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaSecretariaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaSecretariaController.java new file mode 100644 index 000000000..5156a4da5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaSecretariaController.java @@ -0,0 +1,143 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.Secretaria; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderSecretaria; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaSecretariaController") +@Scope("prototype") +public class BusquedaSecretariaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwSecretaria; + private MyListbox secretariaList; + private Paging pagingSecretaria; + private Textbox txtDescSecretaria; + private Textbox txtCveSecretaria; + + public Paging getPagingSecretaria() { + return pagingSecretaria; + } + + public void setPagingSecretaria(Paging pagingSecretaria) { + this.pagingSecretaria = pagingSecretaria; + } + + public MyListbox getSecretariaList() { + return secretariaList; + } + + public void setSecretariaList(MyListbox secretariaList) { + this.secretariaList = secretariaList; + } + + public Textbox getTxtCveSecretaria() { + return txtCveSecretaria; + } + + public void setTxtCveSecretaria(Textbox txtCveSecretaria) { + this.txtCveSecretaria = txtCveSecretaria; + } + + public Textbox getTxtDescSecretaria() { + return txtDescSecretaria; + } + + public void setTxtDescSecretaria(Textbox txtDescSecretaria) { + this.txtDescSecretaria = txtDescSecretaria; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + secretariaList.setItemRenderer(new RenderSecretaria()); + secretariaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Secretaria c = (Secretaria) secretariaList.getSelected(); + verSecretaria(c); + } + }); + + refreshLista(); + + txtDescSecretaria.focus(); + } + + private void verSecretaria(Secretaria s) { + if (s == null) { + return; + } + + Map args = new HashMap(); + args.put("secretaria", s); + args.put("secretariaList", secretariaList); + + openWindow("/gui/configuraciones_comerciales/editarSecretaria.zul", + Labels.getLabel("busquedaSecretariaController.window.title"), + args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject secretariaBusqueda = + new HibernateSearchObject(Secretaria.class, + pagingSecretaria.getPageSize()); + + secretariaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + secretariaBusqueda.addFilterLike("descsecretaria", + "%" + txtDescSecretaria.getText().trim().concat("%")); + secretariaBusqueda.addFilterLike("cvesecretaria", + "%" + txtCveSecretaria.getText().trim().concat("%")); + + secretariaBusqueda.addSortAsc("descsecretaria"); + + plwSecretaria.init(secretariaBusqueda, secretariaList, pagingSecretaria); + + if (secretariaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaSecretariaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verSecretaria(new Secretaria()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaTipoCambioCiudadController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaTipoCambioCiudadController.java new file mode 100644 index 000000000..162ab8a8e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/BusquedaTipoCambioCiudadController.java @@ -0,0 +1,214 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.TipoCambioCtrl; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoCambioCtrl; +import java.util.HashMap; +import com.trg.search.Filter; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Decimalbox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; + +/** + * + * @author Administrador + */ +@Controller("busquedaTipoCambioCiudadController") +@Scope("prototype") +public class BusquedaTipoCambioCiudadController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTipoCambioCiudad; + @Autowired + private MonedaService monedaService; + private MyListbox tipoCambioCiudadList; + private Paging pagingTipoCambioCiudad; + private Combobox cmbMonedaOrigen; + private Combobox cmbMonedaDestino; + private Combobox cmbCiudad; + private List lsMoneda; + private Decimalbox decImportecambio; + private Datebox dtFecaplicacionAte; + private Datebox dtFecaplicacionDe; + + public Combobox getCmbMonedaDestino() { + return cmbMonedaDestino; + } + + public void setCmbMonedaDestino(Combobox cmbMonedaDestino) { + this.cmbMonedaDestino = cmbMonedaDestino; + } + + public Combobox getCmbMonedaOrigen() { + return cmbMonedaOrigen; + } + + public void setCmbMonedaOrigen(Combobox cmbMonedaOrigen) { + this.cmbMonedaOrigen = cmbMonedaOrigen; + } + + public Decimalbox getDecImportecambio() { + return decImportecambio; + } + + public void setDecImportecambio(Decimalbox decImportecambio) { + this.decImportecambio = decImportecambio; + } + + public List getLsMoneda() { + return lsMoneda; + } + + public void setLsMoneda(List lsMoneda) { + this.lsMoneda = lsMoneda; + } + + public Paging getPagingTipoCambioCiudad() { + return pagingTipoCambioCiudad; + } + + public void setPagingTipoCambioCiudad(Paging pagingTipoCambioCiudad) { + this.pagingTipoCambioCiudad = pagingTipoCambioCiudad; + } + + public MyListbox getTipoCambioCiudadList() { + return tipoCambioCiudadList; + } + + public void setTipoCambioCiudadList(MyListbox tipoCambioCiudadList) { + this.tipoCambioCiudadList = tipoCambioCiudadList; + } + + public Datebox getDtFecaplicacionAte() { + return dtFecaplicacionAte; + } + + public void setDtFecaplicacionAte(Datebox dtFecaplicacionAte) { + this.dtFecaplicacionAte = dtFecaplicacionAte; + } + + public Datebox getDtFecaplicacionDe() { + return dtFecaplicacionDe; + } + + public void setDtFecaplicacionDe(Datebox dtFecaplicacionDe) { + this.dtFecaplicacionDe = dtFecaplicacionDe; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + lsMoneda = monedaService.obtenerTodos(); + + tipoCambioCiudadList.setItemRenderer(new RenderTipoCambioCtrl()); + tipoCambioCiudadList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TipoCambioCtrl c = (TipoCambioCtrl) tipoCambioCiudadList.getSelected(); + verTipoCambioCiudad(c); + } + }); + + refreshLista(); + dtFecaplicacionDe.focus(); + } + + private void verTipoCambioCiudad(TipoCambioCtrl c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("tipoCambioCtrl", c); + args.put("tipoCambioCiudadList", tipoCambioCiudadList); + + openWindow("/gui/configuraciones_comerciales/editarTipoCambioCiudad.zul", + Labels.getLabel("busquedaTipoCambioCiudadController.window.title"), + args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject tipoCambioCidadBusqueda = + new HibernateSearchObject(TipoCambioCtrl.class, + pagingTipoCambioCiudad.getPageSize()); + + tipoCambioCidadBusqueda.addFilterEqual("importecambio", decImportecambio.getValue()); + + Comboitem itemMonedaOrigen = cmbMonedaOrigen.getSelectedItem(); + Moneda monedaOrigen; + if (itemMonedaOrigen != null) { + monedaOrigen = (Moneda) itemMonedaOrigen.getValue(); + tipoCambioCidadBusqueda.addFilterEqual("monedaOrigen", monedaOrigen); + } + + Comboitem itemMonedaDestino = cmbMonedaDestino.getSelectedItem(); + Moneda monedaDestino; + if (itemMonedaDestino != null) { + monedaDestino = (Moneda) itemMonedaDestino.getValue(); + tipoCambioCidadBusqueda.addFilterEqual("monedaDestino", monedaDestino); + } + + Comboitem itemCiudad = cmbCiudad.getSelectedItem(); + Ciudad ciudad; + if (itemCiudad != null) { + ciudad = (Ciudad) itemCiudad.getValue(); + tipoCambioCidadBusqueda.addFilterSome("tipoCambioCiudadList", + Filter.equal("ciudad.ciudadId", ciudad.getCiudadId())); + } + + tipoCambioCidadBusqueda.addFilterGreaterOrEqual("fecaplicacion", + dtFecaplicacionDe.getValue()); + tipoCambioCidadBusqueda.addFilterLessOrEqual("fecaplicacion", + dtFecaplicacionAte.getValue()); + + tipoCambioCidadBusqueda.addFilterEqual("activo", Boolean.TRUE); + tipoCambioCidadBusqueda.addSortAsc("tipoCambioCiudadList.ciudad.nombciudad"); + + plwTipoCambioCiudad.init(tipoCambioCidadBusqueda, tipoCambioCiudadList, pagingTipoCambioCiudad); + + if (tipoCambioCiudadList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTipoCambioCiudadController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTipoCambioCiudad(new TipoCambioCtrl()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarAlertaCtrlController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarAlertaCtrlController.java new file mode 100644 index 000000000..6f5983d34 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarAlertaCtrlController.java @@ -0,0 +1,669 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.AlertaCtrl; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.AlertaCtrlService; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.CorridaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Button; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Tab; + +/** + * + * @author Administrador + */ +@Controller("editarAlertaCtrlController") +@Scope("prototype") +public class EditarAlertaCtrlController extends MyGenericForwardComposer implements ListitemRenderer { + + @Autowired + private AlertaCtrlService arlertaCtrlService; + @Autowired + private RutaService rutaService; + @Autowired + private CorridaService corridaService; + @Autowired + private ClaseServicioService claseServicioService; + private List lsClaseServicio; + private List lsRuta; + private AlertaCtrl alertaCtrl; + private MyListbox alertaCtrlList; + private Button btnApagar; + private MyComboboxParada cmbOrigem; + private MyComboboxParada cmbDestino; + private MyComboboxParada cmbOrigemCorrida; + private MyComboboxParada cmbDestinoCorrida; + private MyComboboxParada cmbOrigemBusqueda; + private MyComboboxParada cmbDestinoBusqueda; + private Combobox cmbTipoServicioBusqueda; + private Combobox cmbRuta; + private Combobox cmbClaseServicio; + private Combobox cmbTipoServicio; + private Datebox horaCorrida; + private Datebox horaCorridaBusqueda; + private Intbox txtIdCorrida; + private Intbox txtTiempo; + private Intbox txtTiempoCorrida; + private MyTextboxDecimal txtPorc; + private MyTextboxDecimal txtPorcCorrida; + private Radio rdAlta; + private Radio rdAltaCorrida; + private Radio rdBaja; + private Radio rdBajaCorrida; + private Radio rdGenerica; + private Radio rdCorrida; + private Tab tabGenerico; + private Tab tabCorrida; + private Tab tabOpcion; + private Boolean isGenerico; + private Checkbox rdLun; + private Checkbox rdMar; + private Checkbox rdMie; + private Checkbox rdJue; + private Checkbox rdVie; + private Checkbox rdSab; + private Checkbox rdDom; + private static Logger log = Logger.getLogger(EditarAlertaCtrlController.class); + + public AlertaCtrl getAlertaCtrl() { + return alertaCtrl; + } + + public void setAlertaCtrl(AlertaCtrl alertaCtrl) { + this.alertaCtrl = alertaCtrl; + } + + public MyListbox getAlertaCtrlList() { + return alertaCtrlList; + } + + public void setAlertaCtrlList(MyListbox alertaCtrlList) { + this.alertaCtrlList = alertaCtrlList; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Combobox getCmbRuta() { + return cmbRuta; + } + + public void setCmbRuta(Combobox cmbRuta) { + this.cmbRuta = cmbRuta; + } + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + public List getLsRuta() { + return lsRuta; + } + + public void setLsRuta(List lsRuta) { + this.lsRuta = lsRuta; + } + + public Intbox getTxtIdCorrida() { + return txtIdCorrida; + } + + public void setTxtIdCorrida(Intbox txtIdCorrida) { + this.txtIdCorrida = txtIdCorrida; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + alertaCtrl = (AlertaCtrl) Executions.getCurrent().getArg().get("alertaCtrl"); + alertaCtrlList = (MyListbox) Executions.getCurrent().getArg().get("alertaCtrlList"); + + lsClaseServicio = claseServicioService.obtenerTodos(); + BindingListModelList modelClaseServicio = new BindingListModelList(lsClaseServicio, true); + cmbClaseServicio.setModel(modelClaseServicio); + + cmbOrigemCorrida.setDisabled(Boolean.TRUE); + cmbDestinoCorrida.setDisabled(Boolean.TRUE); + cmbTipoServicio.setDisabled(Boolean.TRUE); + + horaCorrida.setDisabled(Boolean.TRUE); + + if (alertaCtrl.getAlertactrlId() == null) { + btnApagar.setVisible(Boolean.FALSE); + tabGenerico.setVisible(Boolean.FALSE); + tabCorrida.setVisible(Boolean.FALSE); + + } else { + if (alertaCtrl.getCorrida() != null) { + List lsCorridas = new ArrayList(); + lsCorridas.add(alertaCtrl.getCorrida()); + if (alertaCtrl.getPorcalta() != null) { + rdAltaCorrida.setSelected(true); + txtPorcCorrida.setValue(alertaCtrl.getPorcalta().toString()); + txtTiempoCorrida.setValue(alertaCtrl.getTiempoalta()); + } else { + rdBajaCorrida.setSelected(true); + txtPorcCorrida.setValue(alertaCtrl.getPorcbaja().toString()); + txtTiempoCorrida.setValue(alertaCtrl.getTiempobaja()); + } + + horaCorrida.setValue(alertaCtrl.getCorrida().getFechorsalida()); + + if (alertaCtrl.getIndlunes() == Boolean.TRUE) { + rdLun.setChecked(true); + } + if (alertaCtrl.getIndmartes() == Boolean.TRUE) { + rdMar.setChecked(true); + } + if (alertaCtrl.getIndmiercoles() == Boolean.TRUE) { + rdMie.setChecked(true); + } + if (alertaCtrl.getIndjueves() == Boolean.TRUE) { + rdJue.setChecked(true); + } + if (alertaCtrl.getIndviernes() == Boolean.TRUE) { + rdVie.setChecked(true); + } + if (alertaCtrl.getIndsabado() == Boolean.TRUE) { + rdSab.setChecked(true); + } + if (alertaCtrl.getInddomingo() == Boolean.TRUE) { + rdDom.setChecked(true); + } + corrida(); + } else { + generico(); + if (alertaCtrl.getOrigem() != null) { + cmbOrigem.setText(alertaCtrl.getOrigem().getDescparada()); + } + + if (alertaCtrl.getDestino() != null) { + cmbDestino.setText(alertaCtrl.getDestino().getDescparada()); + } + + if (alertaCtrl.getClaseServicio() != null) { + cmbClaseServicio.setText(alertaCtrl.getClaseServicio().getDescclase()); + } + + if (alertaCtrl.getRuta() != null) { + cmbRuta.setText(alertaCtrl.getRuta().getDescruta()); + } + if (alertaCtrl.getPorcalta() != null) { + rdAlta.setSelected(true); + txtPorc.setValue(alertaCtrl.getPorcalta().toString()); + txtTiempo.setValue(alertaCtrl.getTiempoalta()); + } else { + rdBaja.setSelected(true); + txtPorc.setValue(alertaCtrl.getPorcbaja().toString()); + txtTiempo.setValue(alertaCtrl.getTiempobaja()); + } + } + } + } + + public void corrida() { + tabGenerico.setVisible(Boolean.FALSE); + tabOpcion.setVisible(Boolean.FALSE); + tabCorrida.setSelected(Boolean.TRUE); + isGenerico = false; + } + + public void generico() { + tabCorrida.setVisible(Boolean.FALSE); + tabOpcion.setVisible(Boolean.FALSE); + tabGenerico.setSelected(Boolean.TRUE); + isGenerico = true; + } + + public void onClick$rdGenerica(Event ev) { + generico(); + } + + public void onClick$rdCorrida(Event ev) { + corrida(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + if (isGenerico) { + cmbRuta.getValue(); + cmbClaseServicio.getValue(); + cmbOrigem.getValue(); + cmbDestino.getValue(); + txtPorc.getValue(); + txtTiempo.getValue(); + } else { + txtPorcCorrida.getValue(); + txtTiempoCorrida.getValue(); + if (alertaCtrl.getCorrida() == null) { + Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.seleccionar.corrida"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + } + if (!rdLun.isChecked() && !rdMar.isChecked() && !rdMie.isChecked() && !rdJue.isChecked() && !rdVie.isChecked() && !rdSab.isChecked() && !rdDom.isChecked()) { + Clients.alert(Labels.getLabel("editarAlertaCtrlController.MSG.obligatorioDia"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.EXCLAMATION); + + return; + } + } + try { + if (isGenerico) { + if (!rdAlta.isChecked() && !rdBaja.isChecked()) { + Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.necessitaTipo"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + return; + } else if (rdAlta.isChecked()) { + alertaCtrl.setPorcalta(txtPorc.getValueDecimal()); + alertaCtrl.setPorcbaja(null); + + alertaCtrl.setTiempoalta(txtTiempo.getValue()); + alertaCtrl.setTiempobaja(null); + } else if (rdBaja.isChecked()) { + alertaCtrl.setPorcalta(null); + alertaCtrl.setPorcbaja(txtPorc.getValueDecimal()); + + alertaCtrl.setTiempoalta(null); + alertaCtrl.setTiempobaja(txtTiempo.getValue()); + } + Parada origem = (Parada) (cmbOrigem.getSelectedItem() == null ? null : cmbOrigem.getSelectedItem().getValue()); + if (origem != null) { + alertaCtrl.setOrigem(origem); + } else { + Messagebox.show(Labels.getLabel("MSG.necesita.origen"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + Parada destino = (Parada) (cmbDestino.getSelectedItem() == null ? null : cmbDestino.getSelectedItem().getValue()); + if (destino != null) { + alertaCtrl.setDestino(destino); + } else { + Messagebox.show(Labels.getLabel("MSG.necesita.destino"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + Ruta ruta = (Ruta) (cmbRuta.getSelectedItem() == null ? null : cmbRuta.getSelectedItem().getValue()); + if (ruta != null) { + alertaCtrl.setRuta(ruta); + } + + ClaseServicio claseServicio = (ClaseServicio) (cmbClaseServicio.getSelectedItem() == null ? null : cmbClaseServicio.getSelectedItem().getValue()); + if (claseServicio != null) { + alertaCtrl.setClaseServicio(claseServicio); + } + } else { + if (!rdAltaCorrida.isChecked() && !rdBajaCorrida.isChecked()) { + Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.necessitaTipo"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + return; + } else if (rdAltaCorrida.isChecked()) { + alertaCtrl.setPorcalta(txtPorcCorrida.getValueDecimal()); + alertaCtrl.setPorcbaja(null); + + alertaCtrl.setTiempoalta(txtTiempoCorrida.getValue()); + alertaCtrl.setTiempobaja(null); + } else if (rdBajaCorrida.isChecked()) { + alertaCtrl.setPorcalta(null); + alertaCtrl.setPorcbaja(txtPorcCorrida.getValueDecimal()); + + alertaCtrl.setTiempoalta(null); + alertaCtrl.setTiempobaja(txtTiempoCorrida.getValue()); + } + alertaCtrl.setRuta(alertaCtrl.getCorrida().getRuta()); + alertaCtrl.setClaseServicio(alertaCtrl.getCorrida().getClaseServicio()); + alertaCtrl.setOrigem(alertaCtrl.getCorrida().getOrigem()); + alertaCtrl.setDestino(alertaCtrl.getCorrida().getDestino()); + } + + alertaCtrl.setActivo(Boolean.TRUE); + alertaCtrl.setFecmodif(Calendar.getInstance().getTime()); + alertaCtrl.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsAlertaCtrl = new ArrayList(); + if (isGenerico) { + Integer tiempoAlta = alertaCtrl.getTiempoalta(); + Integer tiempoBaja = alertaCtrl.getTiempobaja(); + BigDecimal percAlta = alertaCtrl.getPorcalta(); + BigDecimal percBaja = alertaCtrl.getPorcbaja(); + + lsAlertaCtrl = arlertaCtrlService.buscar(alertaCtrl.getOrigem(), alertaCtrl.getDestino(), alertaCtrl.getRuta(), alertaCtrl.getClaseServicio(), tiempoAlta, + tiempoBaja, percAlta, percBaja); + + boolean podeSalvar = false; + if (lsAlertaCtrl.isEmpty()) { + podeSalvar = true; + } else { + if (alertaCtrl.getAlertactrlId() != null) { + for (AlertaCtrl c : lsAlertaCtrl) { + if (c.getAlertactrlId().equals(alertaCtrl.getAlertactrlId())) { + podeSalvar = true; + } + } + } + } + + if (!podeSalvar) { + Messagebox.show(Labels.getLabel("MSG.Registro.Existe"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + } else { + alertaCtrl.setIndlunes(rdLun.isChecked() ? Boolean.TRUE : Boolean.FALSE); + alertaCtrl.setIndmartes(rdMar.isChecked() ? Boolean.TRUE : Boolean.FALSE); + alertaCtrl.setIndmiercoles(rdMie.isChecked() ? Boolean.TRUE : Boolean.FALSE); + alertaCtrl.setIndjueves(rdJue.isChecked() ? Boolean.TRUE : Boolean.FALSE); + alertaCtrl.setIndviernes(rdVie.isChecked() ? Boolean.TRUE : Boolean.FALSE); + alertaCtrl.setIndsabado(rdSab.isChecked() ? Boolean.TRUE : Boolean.FALSE); + alertaCtrl.setInddomingo(rdDom.isChecked() ? Boolean.TRUE : Boolean.FALSE); + + if (!noTraslapa()) { + Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.traslapa"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + return; + } + } + alertaCtrl = arlertaCtrlService.suscribirActualizar(alertaCtrl); + if (alertaCtrl.getAlertactrlId() == null) { + alertaCtrlList.addItem(alertaCtrl); + } else { + alertaCtrlList.updateItem(alertaCtrl); + } + + Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.suscribirOK"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, + Messagebox.INFORMATION); + + closeWindow(); + + } catch (BusinessException ex) { + Messagebox.show(ex.getLocalizedMessage(), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.ERROR); + } catch (Exception ex) { + log.error("editarAlertaCtrlController: " + ex, ex); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.borrarPergunta"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.YES + | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + arlertaCtrlService.borrar(alertaCtrl); + + Messagebox.show(Labels.getLabel("editarAlertaCtrlController.MSG.borrarOK"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, + Messagebox.INFORMATION); + + alertaCtrlList.removeItem(alertaCtrl); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onChange$cmbClaseServicio(Event ev) { + Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem(); + + if (cbiClaseServicio != null) { + ClaseServicio claseServicio = (ClaseServicio) cbiClaseServicio.getValue(); + lsRuta = rutaService.buscarPorClaseServicio(claseServicio); + + cmbRuta.setConstraint(""); + + cmbRuta.setSelectedItem(null); + cmbRuta.setText(null); + + BindingListModelList modelRuta = new BindingListModelList(lsRuta, true); + cmbRuta.setModel(modelRuta); + + cmbRuta.setConstraint("no empty"); + } + } + + public void onClick$btnProcurarCorrida(Event ev) throws InterruptedException { + + Integer idCorrida = txtIdCorrida.getValue(); + if (idCorrida != null) { + List lsCorrida = corridaService.buscarPorId(idCorrida); + + if (lsCorrida.isEmpty()) { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + } else { + alertaCtrl.setCorrida(lsCorrida.get(0)); + horaCorrida.setValue(alertaCtrl.getCorrida().getFechorsalida()); + cmbOrigemCorrida.setText(alertaCtrl.getCorrida().getOrigem().getDescparada()); + cmbDestinoCorrida.setText(alertaCtrl.getCorrida().getDestino().getDescparada()); + cmbTipoServicio.setText(alertaCtrl.getCorrida().getClaseServicio().getDescclase()); + } + } else { + + cmbOrigemBusqueda.getValue(); + cmbDestinoBusqueda.getValue(); + horaCorridaBusqueda.getValue(); + cmbTipoServicioBusqueda.getValue(); + + Parada ori = (Parada) cmbOrigemBusqueda.getSelectedItem().getValue(); + Parada des = (Parada) cmbDestinoBusqueda.getSelectedItem().getValue(); + Date hora = horaCorridaBusqueda.getValue(); + ClaseServicio cs = (ClaseServicio) cmbTipoServicioBusqueda.getSelectedItem().getValue(); + + List lsCorrida = corridaService.buscarFiltro(ori, des, hora, cs); + + if (lsCorrida.isEmpty()) { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), Labels.getLabel("editarAlertaCtrlController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + } else { + alertaCtrl.setCorrida(lsCorrida.get(0)); + horaCorrida.setValue(alertaCtrl.getCorrida().getFechorsalida()); + cmbOrigemCorrida.setText(alertaCtrl.getCorrida().getOrigem().getDescparada()); + cmbDestinoCorrida.setText(alertaCtrl.getCorrida().getDestino().getDescparada()); + cmbTipoServicio.setText(alertaCtrl.getCorrida().getClaseServicio().getDescclase()); + } + } + + // HibernateSearchObject corridaBusqueda = + // new HibernateSearchObject(Corrida.class, + // pagingCorrida.getPageSize()); + // corridaBusqueda.addFilterEqual("activo", Boolean.TRUE); + // + // Date dataCorrida = fecCorrida.getValue(); + // if (dataCorrida != null) { + // corridaBusqueda.addFilterEqual("id.feccorrida", dataCorrida); + // } + // + // Integer idCorrida = txtIdCorrida.getValue(); + // if (idCorrida != null) { + // corridaBusqueda.addFilterEqual("id.corridaId", idCorrida); + // } + + // plwCorrida.init(corridaBusqueda, corridaList, pagingCorrida); + // if (corridaList.getData().length == 0) { + // try { + // Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + // Labels.getLabel("editarAlertaCtrlController.window.title"), + // Messagebox.OK, Messagebox.INFORMATION); + // } catch (InterruptedException ex) { + // } + // } + } + + public boolean noTraslapa() { + List lsVT1 = arlertaCtrlService.buscarCorrida(alertaCtrl.getCorrida()); + + // Nao Traslapen + Boolean podeSalvar = false; + Boolean[] podeTodos = new Boolean[lsVT1.isEmpty() ? 1 : lsVT1.size()]; + boolean podeMesmo = true; + + // Se a lista for nula / Salva + if (lsVT1.isEmpty()) { + podeMesmo = true; + podeTodos[0] = true; + // Se a lista não for nula e for algo novo... não pode salvar + } else { + int i = 0; + for (AlertaCtrl p : lsVT1) { + if (p.getAlertactrlId().equals(alertaCtrl.getAlertactrlId())) { + podeTodos[i] = true; + continue; + } + podeSalvar = true; + if (alertaCtrl.getIndlunes()) { + if (p.getIndlunes() == alertaCtrl.getIndlunes()) { + podeSalvar = false; + } + } + if (alertaCtrl.getIndmartes()) { + if (p.getIndmartes() == alertaCtrl.getIndmartes()) { + podeSalvar = false; + } + } + if (alertaCtrl.getIndmiercoles()) { + if (p.getIndmiercoles() == alertaCtrl.getIndmiercoles()) { + podeSalvar = false; + } + } + if (alertaCtrl.getIndjueves()) { + if (p.getIndjueves() == alertaCtrl.getIndjueves()) { + podeSalvar = false; + } + } + if (alertaCtrl.getIndviernes()) { + if (p.getIndviernes() == alertaCtrl.getIndviernes()) { + podeSalvar = false; + } + } + if (alertaCtrl.getIndsabado()) { + if (p.getIndsabado() == alertaCtrl.getIndsabado()) { + podeSalvar = false; + } + } + if (alertaCtrl.getInddomingo()) { + if (p.getInddomingo() == alertaCtrl.getInddomingo()) { + podeSalvar = false; + } + } + podeTodos[i] = podeSalvar; + i++; + } + } + + for (int i = 0; i < podeTodos.length; i++) { + if (podeTodos[i] != null) { + if (!podeTodos[i]) { + podeMesmo = false; + } + } + } + return podeMesmo; + } + + public void render(Listitem lstm, Object o) throws Exception { + Corrida corrida = (Corrida) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(corrida.getId().getCorridaId().toString()); + lc.setParent(lstm); + + SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy"); + lc = new Listcell(format.format(corrida.getId().getFeccorrida())); + lc.setParent(lstm); + + if (corrida.getOrigem() != null) { + lc = new Listcell(corrida.getOrigem().getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (corrida.getDestino() != null) { + lc = new Listcell(corrida.getDestino().getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (corrida.getRuta() != null) { + lc = new Listcell(corrida.getRuta().getDescruta()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (corrida.getClaseServicio() != null) { + lc = new Listcell(corrida.getClaseServicio().getDescclase()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (alertaCtrl.getCorrida() != null) { + if (corrida != null) { + if ((alertaCtrl.getCorrida().getId().getCorridaId().equals(corrida.getId().getCorridaId())) + && (alertaCtrl.getCorrida().getId().getFeccorrida()).equals(corrida.getId().getFeccorrida())) { + String style = "color:blue;Font-weight:bold"; + lstm.setStyle(style); + lstm.setSelected(Boolean.TRUE); + } + } + } + + lstm.setAttribute("data", corrida); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarComisionistaExternoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarComisionistaExternoController.java new file mode 100644 index 000000000..5372f5d77 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarComisionistaExternoController.java @@ -0,0 +1,143 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.service.ComisionistaExternoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarComisionistaExternoController") +@Scope("prototype") +public class EditarComisionistaExternoController extends MyGenericForwardComposer { + + @Autowired + private ComisionistaExternoService comisionistaExternoService; + private ComisionistaExterno comisionistaExterno; + private MyListbox comisionistaExternoList; + private Textbox txtNome; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarComisionistaExternoController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public ComisionistaExterno getComisionistaExterno() { + return comisionistaExterno; + } + + public void setComisionistaExterno(ComisionistaExterno comisionistaExterno) { + this.comisionistaExterno = comisionistaExterno; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + comisionistaExterno = + (ComisionistaExterno) Executions.getCurrent().getArg().get("comisionistaExterno"); + comisionistaExternoList = + (MyListbox) Executions.getCurrent().getArg().get("comisionistaExternoList"); + + if (comisionistaExterno.getComisionistaexternoId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) { + txtNome.getValue(); + + try { + comisionistaExterno.setActivo(true); + comisionistaExterno.setFecmodif(Calendar.getInstance().getTime()); + comisionistaExterno.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsComisionistaExterno = + comisionistaExternoService.buscar(comisionistaExterno.getDesccomisionista()); + + if (!lsComisionistaExterno.isEmpty()) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarComisionistaExternoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (comisionistaExterno.getComisionistaexternoId() == null) { + comisionistaExternoService.suscribir(comisionistaExterno); + comisionistaExternoList.addItem(comisionistaExterno); + } else { + comisionistaExternoService.actualizacion(comisionistaExterno); + comisionistaExternoList.updateItem(comisionistaExterno); + } + + Messagebox.show( + Labels.getLabel("editarComisionistaExternoController.MSG.suscribirOK"), + Labels.getLabel("editarComisionistaExternoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarComisionistaExternoController.MSG.borrarPergunta"), + Labels.getLabel("editarComisionistaExternoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + comisionistaExternoService.borrar(comisionistaExterno); + + Messagebox.show( + Labels.getLabel("editarComisionistaExternoController.MSG.borrarOK"), + Labels.getLabel("editarComisionistaExternoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + comisionistaExternoList.removeItem(comisionistaExterno); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCancelacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCancelacionController.java new file mode 100644 index 000000000..b545e5020 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCancelacionController.java @@ -0,0 +1,628 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.CancelacionCargo; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.entidad.CancelacionCtrl; +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.CancelacionCtrlService; +import com.rjconsultores.ventaboletos.service.MotivoCancelacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCancelacionCargo; +import java.math.BigDecimal; +import java.util.ArrayList; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Tab; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarConfiguracionCancelacionController") +@Scope("prototype") +public class EditarConfiguracionCancelacionController extends MyGenericForwardComposer { + + @Autowired + private CancelacionCtrlService cancelacionCtrlService; + @Autowired + private MarcaService marcaService; + @Autowired + private ParadaService paradaService; + @Autowired + private MotivoCancelacionService motivoCancelacionService; + private CancelacionCtrl cancelacionCtrl; + private static Logger log = Logger.getLogger(EditarConfiguracionCancelacionController.class); + private List lsPuntoVenta; + private List lsMarca; + private List lsCancelacionCargo; + private List lsMotivoCancelacion; + private Combobox cmbMarca; + private Combobox cmbPuntoVenta; + private MyComboboxParada cmbParadaOrigem; + private MyComboboxParada cmbParadaDestino; + private Combobox cmbMotivoCancelacion; + private MyListbox cancelacionCtrlList; + private MyListbox cancelacionCargoList; + private Button btnApagar; + private MyTextboxDecimal txtMinimo; + private MyTextboxDecimal txtMaximo; + private Textbox porcentaje; + private Textbox importe; + private Radio radioImp; + private Tab tabCtrl; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsMarca = marcaService.obtenerTodos(); + + Integer[] motivos = {10, 13, 14, -1}; + lsMotivoCancelacion = motivoCancelacionService.obtenerTodosEspecificos(motivos); + + super.doAfterCompose(comp); + + cancelacionCtrl = (CancelacionCtrl) Executions.getCurrent().getArg().get("cancelacionCtrl"); + cancelacionCtrlList = (MyListbox) Executions.getCurrent().getArg().get("cancelacionCtrlList"); + + cancelacionCargoList.setItemRenderer(new RenderCancelacionCargo()); + lsCancelacionCargo = new ArrayList(); + + if (cancelacionCtrl.getCancelacionctrlId() == null) { + btnApagar.setVisible(Boolean.FALSE); + + radioImp.setChecked(true); + onClick$radioImp(null); + + txtMaximo.setValue("0"); + txtMaximo.setDisabled(true); + + } else { + + cancelacionCtrl = cancelacionCtrlService.obtenerID(cancelacionCtrl.getCancelacionctrlId()); + + lsCancelacionCargo = cancelacionCtrl.getCancelacionCargoList(); + cancelacionCargoList.setData(lsCancelacionCargo); + + Parada origem = cancelacionCtrl.getParadaOrigem(); + if (origem != null) { + cmbParadaOrigem.setValue(origem.getDescparada()); + } + + Parada destino = cancelacionCtrl.getParadaDestino(); + if (destino != null) { + cmbParadaDestino.setValue(destino.getDescparada()); + } + PuntoVenta puntoVenta = cancelacionCtrl.getPuntoVenta(); + if (puntoVenta != null) { + List ls = new ArrayList(); + ls.add(puntoVenta); + + cmbPuntoVenta.setModel(new BindingListModelList(ls, false)); + cmbPuntoVenta.setText(puntoVenta.getNombpuntoventa()); + } + + //Habilitar tempo conforme motivo de cancelacion. + motivosCancelacion(); + + } + + importe.setDisabled(true); + porcentaje.setDisabled(true); + + radioImp.setChecked(true); + onClick$radioImp(null); + + cmbMotivoCancelacion.focus(); + + } + + public void motivosCancelacion() { + if (cancelacionCtrl.getMotivoCancelacion() == null) { + txtMaximo.setValue(""); + txtMaximo.setDisabled(true); + txtMinimo.setDisabled(false); + txtMinimo.setConstraint("no empty"); + } else { + if (cancelacionCtrl.getMotivoCancelacion().getMotivocancelacionId().equals(13)) { + txtMinimo.setConstraint(""); + txtMinimo.setValue(""); + txtMinimo.setDisabled(true); + txtMaximo.setDisabled(false); + txtMaximo.setConstraint("no empty"); + } else { + txtMaximo.setConstraint(""); + txtMaximo.setValue(""); + txtMaximo.setDisabled(true); + txtMinimo.setDisabled(false); + txtMinimo.setConstraint("no empty"); + } + } + } + + public void onChange$cmbParadaOrigem(Event e) { + Comboitem origem = cmbParadaOrigem.getSelectedItem(); + if (origem != null) { + Parada ori = (Parada) origem.getValue(); + if (ori.getParadaId().equals(-1)) { + cmbParadaDestino.setText(ori.getDescparada()); + cmbParadaDestino.setInitialValue(ori); + cancelacionCtrl.setParadaOrigem(ori); + cancelacionCtrl.setParadaDestino(ori); + } + } + } + + public void onChange$cmbParadaDestino(Event e) { + Comboitem destino = cmbParadaDestino.getSelectedItem(); + if (destino != null) { + Parada des = (Parada) destino.getValue(); + if (des.getParadaId().equals(-1)) { + cmbParadaOrigem.setText(des.getDescparada()); + cmbParadaOrigem.setInitialValue(des); + cancelacionCtrl.setParadaOrigem(des); + cancelacionCtrl.setParadaDestino(des); + } + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + //Motivo de cancelacion pode ser branco + cmbMotivoCancelacion.getValue(); + tabCtrl.setSelected(Boolean.TRUE); + cmbPuntoVenta.getValue(); + cmbMarca.setConstraint("no empty"); + cmbMarca.getValue(); + cmbParadaOrigem.getValue(true); + cmbParadaDestino.getValue(true); + + PuntoVenta punto = (PuntoVenta) (cmbPuntoVenta.getSelectedItem() == null ? null : cmbPuntoVenta.getSelectedItem().getValue()); + if (punto != null) { + cancelacionCtrl.setPuntoVenta(punto); + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionGeneralController.MSG.punto"), + Labels.getLabel("editarConfiguracionCancelacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + Comboitem cbiMotivo = cmbMotivoCancelacion.getSelectedItem(); + MotivoCancelacion motivo = new MotivoCancelacion(); + if (cbiMotivo != null) { + motivo = (MotivoCancelacion) cbiMotivo.getValue(); + cancelacionCtrl.setMotivoCancelacion(motivo); + } else { + cancelacionCtrl.setMotivoCancelacion(null); + } + + Parada origem = cancelacionCtrl.getParadaOrigem(); + Parada destino = cancelacionCtrl.getParadaDestino(); + + try { + boolean podeIguais = false; + if (origem.getParadaId().equals(destino.getParadaId())) { + if (origem.getParadaId().equals(-1) && destino.getParadaId().equals(-1)) { + podeIguais = true; + } + } else { + if (origem.getParadaId().equals(-1) || destino.getParadaId().equals(-1)) { + Messagebox.show( + Labels.getLabel("editarConfiguracionCancelacionController.MSG.selectItemTodas"), + Labels.getLabel("editarConfiguracionCancelacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + + } else { + podeIguais = true; + } + } + + if (podeIguais) { + cancelacionCtrl.setActivo(Boolean.TRUE); + cancelacionCtrl.setFecmodif(Calendar.getInstance().getTime()); + cancelacionCtrl.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cancelacionCtrl.setMarca((Marca) cmbMarca.getSelectedItem().getValue()); + + + List lsCancelacion = cancelacionCtrlService.buscar(cancelacionCtrl.getTiempoprevsalida(), + cancelacionCtrl.getPuntoVenta(), cancelacionCtrl.getParadaOrigem(), + cancelacionCtrl.getParadaDestino(), cancelacionCtrl.getMarca()); + + boolean podeSalvar = false; + if (lsCancelacion.isEmpty()) { + podeSalvar = true; + } else { + for (CancelacionCtrl cc : lsCancelacion) { + if (cc.getCancelacionctrlId().equals(cancelacionCtrl.getCancelacionctrlId())) { + podeSalvar = true; + } + } + } + + if (podeSalvar) { + + if (cancelacionCtrl.getCancelacionctrlId() == null) { + cancelacionCtrlService.suscribir(cancelacionCtrl); + cancelacionCtrlList.addItem(cancelacionCtrl); + } else { + cancelacionCtrlService.actualizacion(cancelacionCtrl); + cancelacionCtrlList.updateItem(cancelacionCtrl); + } + + Messagebox.show( + Labels.getLabel("editarConfiguracionCancelacionController.MSG.suscribirOK"), + Labels.getLabel("editarConfiguracionCancelacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarConfiguracionGeneralController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCancelacionController.MSG.selectItemDiferente"), + Labels.getLabel("editarConfiguracionCancelacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarCategoriaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + + } + + public void onClick$btnApagar(Event ev) throws InterruptedException { + try { + int resp = Messagebox.show( + Labels.getLabel("editarConfiguracionCancelacionController.MSG.borrarPergunta"), + Labels.getLabel("editarConfiguracionCancelacionController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + cancelacionCtrlService.borrar(cancelacionCtrl); + + Messagebox.show( + Labels.getLabel("editarConfiguracionCancelacionController.MSG.borrarOK"), + Labels.getLabel("editarConfiguracionCancelacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + cancelacionCtrlList.removeItem(cancelacionCtrl); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarCategoriaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onChange$cmbMotivoCancelacion(Event ev) { + + Comboitem cbiMotivo = cmbMotivoCancelacion.getSelectedItem(); + MotivoCancelacion motivo = new MotivoCancelacion(); + if (cbiMotivo != null) { + motivo = (MotivoCancelacion) cbiMotivo.getValue(); + + cancelacionCtrl.setMotivoCancelacion(motivo); + motivosCancelacion(); + } + } + + public void onClick$radioImp(Event ev) { + importe.setConstraint(""); + porcentaje.setConstraint(""); + + importe.setText(""); + porcentaje.setText(""); + + porcentaje.setDisabled(true); + importe.setDisabled(false); + + porcentaje.setConstraint(""); + porcentaje.setValue(""); + importe.setConstraint("no empty, no negative"); + } + + public void onClick$radioPor(Event ev) { + importe.setConstraint(""); + porcentaje.setConstraint(""); + + importe.setText(""); + porcentaje.setText(""); + + importe.setDisabled(true); + porcentaje.setDisabled(false); + + importe.setConstraint(""); + importe.setValue(""); + porcentaje.setConstraint("no empty, no zero, no negative"); + } + + public void onClick$btnAdicionarCargo(Event ev) throws InterruptedException { + + txtMinimo.getValue(); + txtMaximo.getValue(); + porcentaje.getValue(); + importe.getValue(); + + try { + + boolean existe = false; + for (CancelacionCargo cc : lsCancelacionCargo) { + if (cc.getTiempomaximo() == null) { + continue; + } +// if (txtMaximo.getValueDecimal() != null) { +// if (cc.getActivo() && (cc.getTiempomaximo().compareTo(txtMaximo.getValueDecimal()) == 0)) { +// existe = true; +// } +// } else { +// if (cc.getActivo() && (cc.getTiempominimo().compareTo(txtMinimo.getValueDecimal()) == 0)) { +// existe = true; +// } +// } + } + if (!existe) { + CancelacionCargo cCargo = new CancelacionCargo(); + cCargo.setCancelacionCtrl(cancelacionCtrl); + cCargo.setActivo(Boolean.TRUE); + cCargo.setFecmodif(Calendar.getInstance().getTime()); + cCargo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + cCargo.setTiempominimo(txtMinimo.getValueDecimal()); + cCargo.setTiempomaximo(txtMaximo.getValueDecimal()); + if ((!porcentaje.getValue().equals("")) && (porcentaje.getValue() != null)) { + cCargo.setPorccargo((BigDecimal.valueOf(Double.parseDouble(porcentaje.getValue())))); + } + if ((!importe.getValue().equals("")) && (importe.getValue() != null)) { + cCargo.setImportecargo((BigDecimal.valueOf(Double.parseDouble(importe.getValue())))); + } + lsCancelacionCargo.add(cCargo); + cancelacionCtrl.setCancelacionCargoList(lsCancelacionCargo); + + txtMaximo.setConstraint(""); + txtMinimo.setConstraint(""); + + txtMinimo.setText(""); + txtMaximo.setText(""); + + importe.setDisabled(true); + porcentaje.setDisabled(true); + radioImp.setChecked(true); + + onClick$radioImp(null); + motivosCancelacion(); + + cancelacionCargoList.setData(new ArrayList()); + List lsTemp = new ArrayList(); + for (CancelacionCargo cc : lsCancelacionCargo) { + if (cc.getActivo()) { + lsTemp.add(cc); + } + } + cancelacionCargoList.setData(lsTemp); + + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarConfiguracionCancelacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } +// } + } catch (Exception ex) { + log.error("Erro adicionar cargo : " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarCategoriaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnRemoverCargo(Event ev) throws InterruptedException { + try { + CancelacionCargo cCargo = (CancelacionCargo) cancelacionCargoList.getSelected(); + if (cCargo != null) { + //removo o antigo + lsCancelacionCargo.remove(cCargo); + cCargo.setFecmodif(Calendar.getInstance().getTime()); + cCargo.setActivo(Boolean.FALSE); + cCargo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cancelacionCargoList.updateItem(cCargo); + cancelacionCargoList.removeItem(cCargo); + lsCancelacionCargo.add(cCargo); + + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionCancelacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error("Erro remover cargo: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCancelacionController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public CancelacionCtrl getCancelacionCtrl() { + return cancelacionCtrl; + } + + public void setCancelacionCtrl(CancelacionCtrl cancelacionCtrl) { + this.cancelacionCtrl = cancelacionCtrl; + } + + public CancelacionCtrlService getCancelacionCtrlService() { + return cancelacionCtrlService; + } + + public void setCancelacionCtrlService(CancelacionCtrlService cancelacionCtrlService) { + this.cancelacionCtrlService = cancelacionCtrlService; + } + + public MyListbox getCancelacionCtrlList() { + return cancelacionCtrlList; + } + + public void setCancelacionCtrlList(MyListbox cancelacionCtrlList) { + this.cancelacionCtrlList = cancelacionCtrlList; + } + + public static Logger getLog() { + return log; + } + + public static void setLog(Logger log) { + EditarConfiguracionCancelacionController.log = log; + } + + public List getLsMarca() { + return lsMarca; + } + + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + public List getLsPuntoVenta() { + return lsPuntoVenta; + } + + public void setLsPuntoVenta(List lsPuntoVenta) { + this.lsPuntoVenta = lsPuntoVenta; + } + + public MarcaService getMarcaService() { + return marcaService; + } + + public void setMarcaService(MarcaService marcaService) { + this.marcaService = marcaService; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public MyComboboxParada getCmbParadaDestino() { + return cmbParadaDestino; + } + + public void setCmbParadaDestino(MyComboboxParada cmbParadaDestino) { + this.cmbParadaDestino = cmbParadaDestino; + } + + public MyComboboxParada getCmbParadaOrigem() { + return cmbParadaOrigem; + } + + public void setCmbParadaOrigem(MyComboboxParada cmbParadaOrigem) { + this.cmbParadaOrigem = cmbParadaOrigem; + } + + public Combobox getCmbPuntoVenta() { + return cmbPuntoVenta; + } + + public void setCmbPuntoVenta(Combobox cmbPuntoVenta) { + this.cmbPuntoVenta = cmbPuntoVenta; + } + + public MyListbox getCancelacionCargoList() { + return cancelacionCargoList; + } + + public void setCancelacionCargoList(MyListbox cancelacionCargoList) { + this.cancelacionCargoList = cancelacionCargoList; + } + + public List getLsCancelacionCargo() { + return lsCancelacionCargo; + } + + public void setLsCancelacionCargo(List lsCancelacionCargo) { + this.lsCancelacionCargo = lsCancelacionCargo; + } + + public Textbox getTxtMaximo() { + return txtMaximo; + } + + public Combobox getCmbMotivoCancelacion() { + return cmbMotivoCancelacion; + } + + public void setCmbMotivoCancelacion(Combobox cmbMotivoCancelacion) { + this.cmbMotivoCancelacion = cmbMotivoCancelacion; + } + + public List getLsMotivoCancelacion() { + return lsMotivoCancelacion; + } + + public void setLsMotivoCancelacion(List lsMotivoCancelacion) { + this.lsMotivoCancelacion = lsMotivoCancelacion; + } + + public MotivoCancelacionService getMotivoCancelacionService() { + return motivoCancelacionService; + } + + public void setMotivoCancelacionService(MotivoCancelacionService motivoCancelacionService) { + this.motivoCancelacionService = motivoCancelacionService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCategoriaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCategoriaController.java new file mode 100644 index 000000000..afd1e07c5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCategoriaController.java @@ -0,0 +1,1065 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.CategoriaClase; +import com.rjconsultores.ventaboletos.entidad.CategoriaCorrida; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento; +import com.rjconsultores.ventaboletos.entidad.CategoriaMarca; +import com.rjconsultores.ventaboletos.entidad.CategoriaMercado; +import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.service.CategoriaCorridaService; +import com.rjconsultores.ventaboletos.service.CategoriaCtrlService; +import com.rjconsultores.ventaboletos.service.CategoriaDescuentoService; +import com.rjconsultores.ventaboletos.service.CategoriaPeriodoService; +import com.rjconsultores.ventaboletos.service.CategoriaService; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.CorridaCtrlService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionCategoriaClase; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionCategoriaCorrida; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionCategoriaDecuento; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionCategoriaMarca; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionCategoriaMercado; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Decimalbox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Tab; + +/** + * + * @author rodrigo < VERIFICAR TABELA CATEGORIA_CORRIDA > + */ +@Controller("editarConfiguracionCategoriaController") +@Scope("prototype") +public class EditarConfiguracionCategoriaController extends MyGenericForwardComposer { + + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private EmpresaService empresaService; + @Autowired + private CorridaCtrlService corridaCtrlService; + @Autowired + private CategoriaService categoriaService; + @Autowired + private CategoriaCorridaService categoriaCorridaService; + @Autowired + private CategoriaCtrlService categoriaCtrlService; + @Autowired + private CategoriaDescuentoService categoriaDescuentoService; + @Autowired + private CategoriaPeriodoService categoriaPeriodoService; + private List lsMarcas; + private List lsClaseServicio; + private List lsEmpresas; + private List lsCorridas; + private List lsCategorias; + private CategoriaMercado categoriaMercado; + private CategoriaMarca categoriaMarca; + private CategoriaDescuento categoriaDescuento; + private CategoriaCtrl categoriaCtrl; + private CategoriaCorrida categoriaCorrida; + private CategoriaClase categoriaClase; + private MyListbox categoriaCtrlList; + private MyListbox categoriaClaseList; + private MyListbox categoriaCorridaList; + private MyListbox categoriaDescuentoList; + private MyListbox categoriaMarcaList; + private MyListbox categoriaMercadoList; + private List lsCategoriaClase; + private List lsCategoriaDescuento; + private List lsCategoriaMarca; + private List lsCategoriaMercado; + private List lsCategoriaCorrida; + private Combobox cmbCategorias; + private Combobox cmbEmpresas; + private Combobox cmbMarca; + private Combobox cmbClase; + private Combobox cmbParadaOrigem; + private Combobox cmbParadaDestino; + private Decimalbox descuentoImporte; + private Decimalbox descuentoPorc; + private Intbox idCorrida; + private Intbox cantAutorizada; + private Button btnApagar; + private Radio radioImp; + private Tab tabEmpresa; + private Tab tabDesconto; + private Tab tabMarca; + private Tab tabMercado; + private Tab tabClasse; + private Tab tabCorrida; + private static Logger log = Logger.getLogger(EditarConfiguracionCategoriaController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsCategorias = categoriaService.obtenerTodasCategoriasVisibles(); + lsClaseServicio = claseServicioService.obtenerTodos(); + lsEmpresas = empresaService.obtenerIndTipo1(); + lsMarcas = marcaService.obtenerTodos(); + + super.doAfterCompose(comp); + + categoriaCtrlList = (MyListbox) Executions.getCurrent().getArg().get("categoriaCtrlList"); + categoriaCtrl = (CategoriaCtrl) Executions.getCurrent().getArg().get("categoriaCtrl"); + + if (categoriaCtrl == null) { + categoriaCtrl = new CategoriaCtrl(); + } + + //Desconto + categoriaDescuentoList.setItemRenderer(new RenderConfiguracionCategoriaDecuento()); + + lsCategoriaDescuento = new ArrayList(); + //Clase + categoriaClaseList.setItemRenderer(new RenderConfiguracionCategoriaClase()); + lsCategoriaClase = new ArrayList(); + //Marca + categoriaMarcaList.setItemRenderer(new RenderConfiguracionCategoriaMarca()); + lsCategoriaMarca = new ArrayList(); + //Mercado + categoriaMercadoList.setItemRenderer(new RenderConfiguracionCategoriaMercado()); + lsCategoriaMercado = new ArrayList(); + //Corrida + categoriaCorridaList.setItemRenderer(new RenderConfiguracionCategoriaCorrida()); + lsCategoriaCorrida = new ArrayList(); + + //Recarrega Listas + if (categoriaCtrl.getCategoriactrlId() != null) { + categoriaCtrl = categoriaCtrlService.obtenerID(categoriaCtrl.getCategoriactrlId()); + + lsCategoriaDescuento = categoriaCtrl.getCategoriaDescuentoVisiblesList(); + categoriaDescuentoList.setData(lsCategoriaDescuento); + + lsCategoriaClase = categoriaCtrl.getCategoriaClaseList(); + categoriaClaseList.setData(lsCategoriaClase); + + lsCategoriaMarca = categoriaCtrl.getCategoriaMarcaList(); + categoriaMarcaList.setData(lsCategoriaMarca); + + lsCategoriaMercado = categoriaCtrl.getCategoriaMercadoList(); + categoriaMercadoList.setData(lsCategoriaMercado); + + lsCategoriaCorrida = categoriaCtrl.getCategoriaCorridaList(); + categoriaCorridaList.setData(lsCategoriaCorrida); + } + descuentoImporte.setValue(BigDecimal.ZERO); + descuentoPorc.setValue(BigDecimal.ZERO); + + descuentoImporte.setDisabled(true); + descuentoPorc.setDisabled(true); + + radioImp.setChecked(true); + onClick$radioImp(null); + cmbEmpresas.focus(); + + + } + + public void onClick$btnEditarDatosCategoria(Event e) throws InterruptedException { + CategoriaDescuento cd = (CategoriaDescuento) categoriaDescuentoList.getSelected(); + if (cd == null) { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.selectDescuento"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + Map args = new HashMap(); + args.put("categoriaDescuento", cd); + args.put("categoriaDescuentoList", categoriaDescuentoList); + + openWindow("/gui/configuraciones_comerciales/editarConfiguracionCategoriasDatosCategoria.zul", + Labels.getLabel("editarConfiguracionCategoriaDatosCategoriaController.title"), args, MODAL); + } + + private void verPeriodoDesconto(CategoriaDescuento cd) throws InterruptedException { + if (cd == null) { + return; + } + + /* + Não deixa editar períodos para novos tipo de pasajero + Desa forma não traslapa os periodos. + */ + + if (categoriaCtrl.getCategoriactrlId() == null) { + Messagebox.show(Labels.getLabel("editarConfiguracionCategoriaController.MSG.editarPeriodo"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + Map args = new HashMap(); + args.put("categoriaDescuento", cd); + args.put("categoriaDescuentoList", categoriaDescuentoList); + + openWindow("/gui/configuraciones_comerciales/editarConfiguracionCategoriasPeriodo.zul", + Labels.getLabel("editarConfiguracionCategoriaControllerPeriodo.window.title"), args, MODAL); + + } + + public boolean validaObligatorios() throws InterruptedException { + if (categoriaDescuentoList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.necesitaDescuento"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + tabDesconto.setSelected(Boolean.TRUE); + return false; + } + if (categoriaMarcaList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.necesitaMarca"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + tabMarca.setSelected(Boolean.TRUE); + return false; + } + if (categoriaMercadoList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.necesitaMercado"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + tabMercado.setSelected(Boolean.TRUE); + return false; + } + if (categoriaClaseList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.necesitaClase"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + tabClasse.setSelected(Boolean.TRUE); + return false; + } + + return true; + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + tabEmpresa.setSelected(Boolean.TRUE); + cmbEmpresas.getValue(); + + if (!validaObligatorios()) { + return; + } + + boolean sinPeriodo = false; + if (categoriaCtrl.getCategoriactrlId() != null) { + for (CategoriaDescuento cd : lsCategoriaDescuento) { + if ((cd.getCategoriadescuentoId() != null) && (cd.getActivo())) { + List obtenerPorCategoriaDescuento = categoriaPeriodoService.obtenerPorCategoriaDescuento(cd); + if (obtenerPorCategoriaDescuento.isEmpty()) { + sinPeriodo = true; + } + } + } + //Deixa salvar sem Vigência para categorias novas. + if (sinPeriodo && categoriaCtrl.getCategoriactrlId() != null) { + tabDesconto.setSelected(true); + Clients.alert( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.categoriaPeriodoObligatorio"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), Messagebox.INFORMATION); + return; + } + } + try { + categoriaCtrl.setActivo(true); + categoriaCtrl.setFecmodif(Calendar.getInstance().getTime()); + categoriaCtrl.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (categoriaCtrl.getCategoriactrlId() == null) { + categoriaCtrlService.suscribir(categoriaCtrl); + categoriaCtrlList.addItem(categoriaCtrl); + + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.suscribirOK"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else { + + //Recarrega os periodos alterados + List lsCategoriaDescuentoNova = new ArrayList(); + + for (CategoriaDescuento cd : lsCategoriaDescuento) { + if (!cd.getActivo()) { + lsCategoriaDescuentoNova.add(cd); + continue; + } + cd.setCategoriaPeriodoList(new ArrayList()); + List listCategoriaPeriodo = categoriaPeriodoService.obtenerPorCategoriaDescuento(categoriaDescuento); + cd.setCategoriaPeriodoList(listCategoriaPeriodo); + lsCategoriaDescuentoNova.add(cd); + + } + categoriaCtrl.setCategoriaDescuentoList(lsCategoriaDescuentoNova); + + categoriaCtrlService.actualizacion(categoriaCtrl); + categoriaCtrlList.updateItem(categoriaCtrl); + + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.suscribirOK"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.borrarPergunta"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + categoriaCtrlService.borrar(categoriaCtrl); + categoriaCtrlList.removeItem(categoriaCtrl); + + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.borrarOK"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnAdicionarDesconto(Event ev) throws InterruptedException { + if (cmbCategorias.getSelectedItem() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + cmbCategorias.focus(); + return; + } + cmbCategorias.getValue(); + cantAutorizada.getValue(); + descuentoPorc.getValue(); + descuentoImporte.getValue(); + try { + boolean existe = false; + for (CategoriaDescuento cd : lsCategoriaDescuento) { + if (cd.getActivo() && cd.getCategoria().equals(cmbCategorias.getSelectedItem().getValue())) { + existe = true; + } + } + if (!existe) { + CategoriaDescuento cDescuento = new CategoriaDescuento(); + cDescuento.setCategoriaCtrl(categoriaCtrl); + cDescuento.setActivo(Boolean.TRUE); + cDescuento.setFecmodif(Calendar.getInstance().getTime()); + cDescuento.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cDescuento.setCategoria((Categoria) cmbCategorias.getSelectedItem().getValue()); + cDescuento.setCantautorizada(cantAutorizada.getValue()); + cDescuento.setDescuentoimporte(descuentoImporte.getValue()); + cDescuento.setDescuentoporc(descuentoPorc.getValue()); + + lsCategoriaDescuento.add(cDescuento); + categoriaDescuentoList.addItem(cDescuento); + categoriaCtrl.setCategoriaDescuentoList(lsCategoriaDescuento); + + cmbCategorias.setSelectedItem(null); + cantAutorizada.setRawValue(null); + if (radioImp.isChecked()) { + onClick$radioImp(null); + } else { + onClick$radioPor(null); + } + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnRemoverDesconto(Event ev) { + try { + CategoriaDescuento cDescuento = (CategoriaDescuento) categoriaDescuentoList.getSelected(); + if (cDescuento != null) { + if (!cDescuento.getCategoria().getCategoriaId().equals(1)) { + lsCategoriaDescuento.remove(cDescuento); + cDescuento.setFecmodif(Calendar.getInstance().getTime()); + cDescuento.setActivo(Boolean.FALSE); + cDescuento.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + categoriaDescuentoList.updateItem(cDescuento); + categoriaDescuentoList.removeItem(cDescuento); + lsCategoriaDescuento.add(cDescuento); + categoriaCtrl.setCategoriaDescuentoList(lsCategoriaDescuento); + //categoriaCtrl.setCategoriaDescuentoList(lsCategoriaDescuento); + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnAdicionarMarca(Event ev) throws InterruptedException { + if (cmbMarca.getSelectedItem() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + cmbMarca.focus(); + return; + } + + if (((Marca) cmbMarca.getSelectedItem().getValue()).getMarcaId().equals((short) -1)) { + if (categoriaMarcaList.getData().length != 0) { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.noEsPermitidoTodosMarca"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + } + if (lsCategoriaMarca != null) { + for (CategoriaMarca cm : lsCategoriaMarca) { + if (!cm.getActivo()) { + continue; + } + if (cm.getMarca().getMarcaId().equals((short) -1)) { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.noEsPermitidoMarcaTodosExiste"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + } + } + try { + boolean existe = false; + for (CategoriaMarca cm : lsCategoriaMarca) { + Marca categoriaMarcaTeste = (Marca) cmbMarca.getSelectedItem().getValue(); + if (cm.getActivo() && cm.getMarca().getMarcaId().equals(categoriaMarcaTeste.getMarcaId())) { + existe = true; + } + } + + if (!existe) { + CategoriaMarca cMarca = new CategoriaMarca(); + cMarca.setCategoriaCtrl(categoriaCtrl); + cMarca.setActivo(Boolean.TRUE); + cMarca.setMarca((Marca) cmbMarca.getSelectedItem().getValue()); + cMarca.setFecmodif(Calendar.getInstance().getTime()); + cMarca.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + lsCategoriaMarca.add(cMarca); + categoriaMarcaList.addItem(cMarca); + categoriaCtrl.setCategoriaMarcaList(lsCategoriaMarca); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnRemoverMarca(Event ev) { + try { + CategoriaMarca cMarca = (CategoriaMarca) categoriaMarcaList.getSelected(); + if (cMarca != null) { + //removo o antigo + lsCategoriaMarca.remove(cMarca); + cMarca.setFecmodif(Calendar.getInstance().getTime()); + cMarca.setActivo(Boolean.FALSE); + cMarca.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + categoriaMarcaList.updateItem(cMarca); + categoriaMarcaList.removeItem(cMarca); + lsCategoriaMarca.add(cMarca); + categoriaCtrl.setCategoriaMarcaList(lsCategoriaMarca); + + + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnAdicionarCorrida(Event ev) { + idCorrida.getValue(); + + CorridaCtrl corrida = corridaCtrlService.obtenerID(idCorrida.getValue()); + try { + if (corrida == null) { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.corrida"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + boolean existe = false; + for (CategoriaCorrida cc : lsCategoriaCorrida) { + if (cc.getActivo() && cc.getCorridaCtrl().equals(corrida)) { + existe = true; + } + } + if (!existe) { + CategoriaCorrida cc = new CategoriaCorrida(); + cc.setCategoriaCtrl(categoriaCtrl); + cc.setActivo(Boolean.TRUE); + cc.setFecmodif(Calendar.getInstance().getTime()); + cc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cc.setCorridaCtrl(corrida); + lsCategoriaCorrida.add(cc); + categoriaCorridaList.addItem(cc); + categoriaCtrl.setCategoriaCorridaList(lsCategoriaCorrida); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnRemoverCorrida(Event ev) { + try { + CategoriaCorrida cCorrida = (CategoriaCorrida) categoriaCorridaList.getSelected(); + if (cCorrida != null) { + lsCategoriaCorrida.remove(cCorrida); + cCorrida.setFecmodif(Calendar.getInstance().getTime()); + cCorrida.setActivo(Boolean.FALSE); + cCorrida.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + categoriaCorridaList.removeItem(cCorrida); + categoriaCorridaService.borrar(cCorrida); +// categoriaCtrl.setCategoriaCorridaList(lsCategoriaCorrida); + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnAdicionarMercado(Event ev) throws InterruptedException { + if (cmbParadaOrigem.getSelectedItem() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + cmbParadaOrigem.focus(); + return; + } + if (cmbParadaDestino.getSelectedItem() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + cmbParadaDestino.focus(); + return; + } + cmbParadaOrigem.getSelectedItem().getValue(); + cmbParadaDestino.getSelectedItem().getValue(); + try { + if (cmbParadaOrigem.getSelectedItem().getValue() != cmbParadaDestino.getSelectedItem().getValue()) { + + CategoriaMercado cMercado = new CategoriaMercado(); + cMercado.setCategoriaCtrl(categoriaCtrl); + cMercado.setActivo(Boolean.TRUE); + cMercado.setOrigem((Parada) cmbParadaOrigem.getSelectedItem().getValue()); + cMercado.setDestino((Parada) cmbParadaDestino.getSelectedItem().getValue()); + cMercado.setFecmodif(Calendar.getInstance().getTime()); + cMercado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + boolean existe = false; + for (CategoriaMercado cc : lsCategoriaMercado) { + if (cc.getActivo() && cc.getOrigem().equals(cMercado.getOrigem()) && cc.getDestino().equals(cMercado.getDestino())) { + existe = true; + } + } + if (!existe) { + lsCategoriaMercado.add(cMercado); + categoriaMercadoList.addItem(cMercado); + categoriaCtrl.setCategoriaMercadoList(lsCategoriaMercado); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.selectItemDiferente"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnRemoverMercado(Event ev) { + try { + CategoriaMercado cMercado = (CategoriaMercado) categoriaMercadoList.getSelected(); + if (cMercado != null) { + lsCategoriaMercado.remove(cMercado); + cMercado.setFecmodif(Calendar.getInstance().getTime()); + cMercado.setActivo(Boolean.FALSE); + cMercado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + categoriaMercadoList.updateItem(cMercado); + categoriaMercadoList.removeItem(cMercado); + lsCategoriaMercado.add(cMercado); + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnAdicionarClase(Event ev) throws InterruptedException { + if (cmbClase.getSelectedItem() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + cmbClase.focus(); + return; + } + cmbClase.getSelectedItem().getValue(); + try { + boolean existe = false; + for (CategoriaClase cc : lsCategoriaClase) { + if (cc.getActivo() && cc.getClaseServicio().equals(cmbClase.getSelectedItem().getValue())) { + existe = true; + } + } + if (!existe) { + CategoriaClase cClase = new CategoriaClase(); + cClase.setCategoriaCtrl(categoriaCtrl); + cClase.setActivo(Boolean.TRUE); + cClase.setClaseServicio((ClaseServicio) cmbClase.getSelectedItem().getValue()); + cClase.setFecmodif(Calendar.getInstance().getTime()); + cClase.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + lsCategoriaClase.add(cClase); + categoriaClaseList.addItem(cClase); + categoriaCtrl.setCategoriaClaseList(lsCategoriaClase); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnRemoverClase(Event ev) { + try { + CategoriaClase cClase = (CategoriaClase) categoriaClaseList.getSelected(); + if (cClase != null) { + lsCategoriaClase.remove(cClase); + cClase.setFecmodif(Calendar.getInstance().getTime()); + cClase.setActivo(Boolean.FALSE); + cClase.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + categoriaClaseList.updateItem(cClase); + categoriaClaseList.removeItem(cClase); + lsCategoriaClase.add(cClase); + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnAdicionarPeriodo(Event ev) { + try { + if (categoriaDescuentoList.getSelectedCount() > 0) { + CategoriaDescuento cd = (CategoriaDescuento) categoriaDescuentoList.getSelected(); + verPeriodoDesconto(cd); + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.selectDescuento"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$radioImp(Event ev) { + descuentoPorc.setDisabled(true); + descuentoImporte.setDisabled(false); + + descuentoPorc.setConstraint(""); + descuentoPorc.setValue(BigDecimal.ZERO); + descuentoImporte.setConstraint(""); + descuentoImporte.setValue(BigDecimal.ZERO); + descuentoImporte.setConstraint("no empty, no negative"); + } + + public void onClick$radioPor(Event ev) { + descuentoImporte.setDisabled(true); + descuentoPorc.setDisabled(false); + + descuentoImporte.setConstraint(""); + descuentoImporte.setValue(BigDecimal.ZERO); + descuentoPorc.setConstraint(""); + descuentoPorc.setValue(BigDecimal.ZERO); + descuentoPorc.setConstraint("no empty, no zero, no negative"); + } + + public List getLsCategorias() { + return lsCategorias; + } + + public void setLsCategorias(List lsCategorias) { + this.lsCategorias = lsCategorias; + } + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + public List getLsCorridas() { + return lsCorridas; + } + + public void setLsCorridas(List lsCorridas) { + this.lsCorridas = lsCorridas; + } + + public List getLsEmpresas() { + return lsEmpresas; + } + + public void setLsEmpresas(List lsEmpresas) { + this.lsEmpresas = lsEmpresas; + } + + public List getLsMarcas() { + return lsMarcas; + } + + public void setLsMarcas(List lsMarcas) { + this.lsMarcas = lsMarcas; + } + + public CategoriaCtrl getCategoriaCTRL() { + return categoriaCtrl; + } + + public void setCategoriaCTRL(CategoriaCtrl categoriaCTRL) { + this.categoriaCtrl = categoriaCTRL; + } + + public CategoriaClase getCategoriaClase() { + return categoriaClase; + } + + public void setCategoriaClase(CategoriaClase categoriaClase) { + this.categoriaClase = categoriaClase; + } + + public CategoriaCorrida getCategoriaCorrida() { + return categoriaCorrida; + } + + public void setCategoriaCorrida(CategoriaCorrida categoriaCorrida) { + this.categoriaCorrida = categoriaCorrida; + } + + public CategoriaCtrlService getCategoriaCtrlService() { + return categoriaCtrlService; + } + + public void setCategoriaCtrlService(CategoriaCtrlService categoriaCtrlService) { + this.categoriaCtrlService = categoriaCtrlService; + } + + public CategoriaDescuento getCategoriaDescuento() { + return categoriaDescuento; + } + + public void setCategoriaDescuento(CategoriaDescuento categoriaDescuento) { + this.categoriaDescuento = categoriaDescuento; + } + + public CategoriaMarca getCategoriaMarca() { + return categoriaMarca; + } + + public void setCategoriaMarca(CategoriaMarca categoriaMarca) { + this.categoriaMarca = categoriaMarca; + } + + public CategoriaMercado getCategoriaMercado() { + return categoriaMercado; + } + + public void setCategoriaMercado(CategoriaMercado categoriaMercado) { + this.categoriaMercado = categoriaMercado; + } + + public Combobox getCmbCategorias() { + return cmbCategorias; + } + + public void setCmbCategorias(Combobox cmbCategorias) { + this.cmbCategorias = cmbCategorias; + } + + public Combobox getCmbClaseServicio() { + return cmbClase; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClase = cmbClaseServicio; + } + + public Combobox getCmbDestino() { + return cmbParadaDestino; + } + + public void setCmbDestino(Combobox cmbDestino) { + this.cmbParadaDestino = cmbDestino; + } + + public Combobox getCmbEmpresas() { + return cmbEmpresas; + } + + public void setCmbEmpresas(Combobox cmbEmpresas) { + this.cmbEmpresas = cmbEmpresas; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Combobox getCmbOrigem() { + return cmbParadaOrigem; + } + + public void setCmbOrigem(Combobox cmbOrigem) { + this.cmbParadaOrigem = cmbOrigem; + } + + public Decimalbox getDescuentoImporte() { + return descuentoImporte; + } + + public void setDescuentoImporte(Decimalbox descuentoImporte) { + this.descuentoImporte = descuentoImporte; + } + + public Decimalbox getDescuentoPorc() { + return descuentoPorc; + } + + public void setDescuentoPorc(Decimalbox descuentoPorc) { + this.descuentoPorc = descuentoPorc; + } + + public List getLsCategoriaClase() { + return lsCategoriaClase; + } + + public void setLsCategoriaClase(List lsCategoriaClase) { + this.lsCategoriaClase = lsCategoriaClase; + } + + public List getLsCategoriaDescuento() { + return lsCategoriaDescuento; + } + + public void setLsCategoriaDescuento(List lsCategoriaDescuento) { + this.lsCategoriaDescuento = lsCategoriaDescuento; + } + + public List getLsCategoriaMarca() { + return lsCategoriaMarca; + } + + public void setLsCategoriaMarca(List lsCategoriaMarca) { + this.lsCategoriaMarca = lsCategoriaMarca; + } + + public List getLsCategoriaMercado() { + return lsCategoriaMercado; + } + + public void setLsCategoriaMercado(List lsCategoriaMercado) { + this.lsCategoriaMercado = lsCategoriaMercado; + } + + public CategoriaCtrl getCategoriaCtrl() { + return categoriaCtrl; + } + + public void setCategoriaCtrl(CategoriaCtrl categoriaCtrl) { + this.categoriaCtrl = categoriaCtrl; + } + + public MyListbox getCategoriaCtrlList() { + return categoriaCtrlList; + } + + public void setCategoriaCtrlList(MyListbox categoriaCtrlList) { + this.categoriaCtrlList = categoriaCtrlList; + } + + public List getLsCategoriaCorrida() { + return lsCategoriaCorrida; + } + + public void setLsCategoriaCorrida(List lsCategoriaCorrida) { + this.lsCategoriaCorrida = lsCategoriaCorrida; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCategoriaDatosCategoriaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCategoriaDatosCategoriaController.java new file mode 100644 index 000000000..9aeb07629 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCategoriaDatosCategoriaController.java @@ -0,0 +1,87 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.math.BigDecimal; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Textbox; + +/** + * + * @author rodrigo + */ +@Controller("editarConfiguracionCategoriaDatosCategoriaController") +@Scope("prototype") +public class EditarConfiguracionCategoriaDatosCategoriaController extends MyGenericForwardComposer { + + private static Logger log = LoggerFactory.getLogger(EditarConfiguracionCategoriaDatosCategoriaController.class); + private CategoriaDescuento categoriaDescuento; + private MyListbox categoriaDescuentoList; + private Radio radioImp; + private Radio radioPor; + private Textbox descuentoPorc; + private Textbox descuentoImporte; + + @Override + public void doAfterCompose(Component comp) throws Exception { + categoriaDescuentoList = (MyListbox) Executions.getCurrent().getArg().get("categoriaDescuentoList"); + categoriaDescuento = (CategoriaDescuento) Executions.getCurrent().getArg().get("categoriaDescuento"); + + super.doAfterCompose(comp); + + if ((categoriaDescuento.getDescuentoimporte() != null) && (!categoriaDescuento.getDescuentoimporte().equals(BigDecimal.ZERO))) { + radioImp.setSelected(true); + descuentoPorc.setDisabled(true); + } + if ((categoriaDescuento.getDescuentoporc() != null) && (!categoriaDescuento.getDescuentoporc().equals(BigDecimal.ZERO))) { + radioPor.setSelected(true); + descuentoImporte.setDisabled(true); + } + + } + + public void onClick$btnSalvar(Event ev) { + categoriaDescuentoList.updateItem(categoriaDescuento); + this.closeWindow(); + } + + public CategoriaDescuento getCategoriaDescuento() { + return categoriaDescuento; + } + + public void setCategoriaDescuento(CategoriaDescuento categoriaDescuento) { + this.categoriaDescuento = categoriaDescuento; + } + + public void onClick$radioImp(Event ev) { + descuentoPorc.setDisabled(true); + descuentoImporte.setDisabled(false); + + descuentoPorc.setConstraint(""); + descuentoPorc.setValue("0"); + categoriaDescuento.setDescuentoporc(BigDecimal.ZERO); + descuentoImporte.setConstraint("no empty, no negative"); + } + + public void onClick$radioPor(Event ev) { + descuentoImporte.setDisabled(true); + descuentoPorc.setDisabled(false); + + descuentoImporte.setConstraint(""); + descuentoImporte.setValue("0"); + categoriaDescuento.setDescuentoimporte(BigDecimal.ZERO); + descuentoPorc.setConstraint("no empty, no zero, no negative"); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCategoriaPeriodoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCategoriaPeriodoController.java new file mode 100644 index 000000000..1694c7a5e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionCategoriaPeriodoController.java @@ -0,0 +1,186 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento; +import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo; +import com.rjconsultores.ventaboletos.service.CategoriaDescuentoService; +import com.rjconsultores.ventaboletos.service.CategoriaPeriodoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionCategoriaPeriodo; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zul.Datebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Rafius + */ +@Controller("editarConfiguracionCategoriaPeriodoController") +@Scope("prototype") +public class EditarConfiguracionCategoriaPeriodoController extends MyGenericForwardComposer { + + @Autowired + private CategoriaDescuentoService categoriaDescuentoService; + @Autowired + private CategoriaPeriodoService categoriaPeriodoService; + private MyListbox categoriaDescuentoList; + private MyListbox categoriaPeriodoList; + private CategoriaDescuento categoriaDescuento; + private CategoriaPeriodo categoriaPeriodo; + private List lsCategoriaPeriodo; + private Datebox fecInicio; + private Datebox fecFinal; + private static Logger log = Logger.getLogger(EditarConfiguracionCategoriaPeriodoController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + categoriaDescuentoList = (MyListbox) Executions.getCurrent().getArg().get("categoriaDescuentoList"); + categoriaDescuento = (CategoriaDescuento) Executions.getCurrent().getArg().get("categoriaDescuento"); + + categoriaPeriodoList.setItemRenderer(new RenderConfiguracionCategoriaPeriodo()); + lsCategoriaPeriodo = new ArrayList(); + + if (categoriaDescuento.getCategoriadescuentoId() != null) { + //categoriaDescuento = categoriaDescuentoService.obtenerID(categoriaDescuento.getCategoriadescuentoId()); + + lsCategoriaPeriodo = categoriaDescuento.getCategoriaPeriodoList(); + categoriaPeriodoList.setData(lsCategoriaPeriodo); + } + } + + public void onClick$btnSalvarPeriodo(Event ev) throws InterruptedException { + + fecInicio.setConstraint("no empty, no past"); + fecFinal.setConstraint("no empty, no past"); + + fecInicio.getValue(); + fecFinal.getValue(); + + if (fecInicio.getValue().after(fecFinal.getValue())) { + try { + Messagebox.show(Labels.getLabel("editarConfiguracionCategoriaController.MSG.busquedaPeriodo"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + log.error(ex); + } + } else { + try { + + CategoriaPeriodo cPeriodo = new CategoriaPeriodo(); + cPeriodo.setFecmodif(Calendar.getInstance().getTime()); + cPeriodo.setActivo(Boolean.TRUE); + cPeriodo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cPeriodo.setCategoriaDescuento(categoriaDescuento); + + cPeriodo.setFecinicio(fecInicio.getValue()); + cPeriodo.setFecfin(fecFinal.getValue()); + + List lsVT1 = categoriaPeriodoService.buscarPeriodoIntervalo(cPeriodo); + + Boolean podeSalvar = lsVT1.isEmpty() ? true : false; + //Se for ele mesmo pode salvar. + if (lsVT1.size() == 1) { + //Somente edição + if (categoriaDescuento.getCategoriadescuentoId() != null) { + if (categoriaDescuento.getCategoriadescuentoId().equals(lsVT1.get(0).getCategoriaperiodoId())) { + podeSalvar = true; + } + } + } + + if (podeSalvar) { + + lsCategoriaPeriodo.add(cPeriodo); + categoriaPeriodoList.setData(lsCategoriaPeriodo); + + categoriaDescuento.setCategoriaPeriodoList(lsCategoriaPeriodo); + categoriaDescuentoList.updateItem(categoriaDescuento); + + categoriaPeriodoService.suscribir(cPeriodo); + + fecInicio.setConstraint(""); + fecFinal.setConstraint(""); + + fecInicio.setValue(null); + fecFinal.setValue(null); + + fecInicio.setConstraint("no empty"); + fecFinal.setConstraint("no empty"); + + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.conflitoVigencias"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + + } catch (Exception ex) { + log.error(ex); + } + } + } + + public void onClick$btnApagarPeriodo(Event ev) { + try { + CategoriaPeriodo cPeriodo = (CategoriaPeriodo) categoriaPeriodoList.getSelected(); + + if (cPeriodo != null) { + + categoriaPeriodoService.borrar(cPeriodo); + lsCategoriaPeriodo.remove(cPeriodo); + categoriaPeriodoList.setData(lsCategoriaPeriodo); + //categoriaPeriodoList.removeItem(cPeriodo); + + categoriaDescuento.setCategoriaPeriodoList(lsCategoriaPeriodo); + + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.selecionarPeriodo"), + Labels.getLabel("editarConfiguracionCategoriaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnSalvar(Event ev) { + try { + categoriaDescuento.setActivo(true); + categoriaDescuento.setFecmodif(Calendar.getInstance().getTime()); + categoriaDescuento.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + + if (categoriaDescuento.getCategoriadescuentoId() != null) { +// categoriaDescuentoService.suscribir(categoriaDescuento); +// categoriaDescuentoList.addItem(categoriaDescuento); +// } else { + categoriaDescuentoService.actualizacion(categoriaDescuento); + categoriaDescuentoList.updateItem(categoriaDescuento); + } + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionFormaPagoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionFormaPagoController.java new file mode 100644 index 000000000..f8379a44f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionFormaPagoController.java @@ -0,0 +1,193 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.entidad.FormaPagoDet; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.FormaPagoDetService; +import com.rjconsultores.ventaboletos.service.FormaPagoService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; + +/** + * + * @author Administrador + */ +@Controller("editarConfiguracionFormaPagoController") +@Scope("prototype") +public class EditarConfiguracionFormaPagoController extends MyGenericForwardComposer { + + @Autowired + private FormaPagoDetService formaPagoDetService; + @Autowired + private EmpresaService empresaService; + @Autowired + private PuntoVentaService puntoVentaService; + @Autowired + private FormaPagoService formaPagoService; + private MyListbox configFormaPagoList; + private FormaPagoDet formaPagoDet; + private List lsEmpresas; + private List lsPuntosVentas; + private List lsFormaPago; + private Combobox cmbFormaPago; + private Combobox cmbPuntoVenta; + private Combobox cmbRestriccionFormaPago; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarConfiguracionFormaPagoController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public FormaPagoDet getFormaPagoDet() { + return formaPagoDet; + } + + public void setFormaPagoDet(FormaPagoDet formaPagoDet) { + this.formaPagoDet = formaPagoDet; + } + + public List getLsEmpresas() { + return lsEmpresas; + } + + public void setLsEmpresas(List lsEmpresas) { + this.lsEmpresas = lsEmpresas; + } + + public List getLsPuntosVentas() { + return lsPuntosVentas; + } + + public void setLsPuntosVentas(List lsPuntosVentas) { + this.lsPuntosVentas = lsPuntosVentas; + } + + public List getLsFormaPago() { + return lsFormaPago; + } + + public void setLsFormaPago(List lsFormaPago) { + this.lsFormaPago = lsFormaPago; + } + + public Combobox getCmbFormaPago() { + return cmbFormaPago; + } + + public void setCmbFormaPago(Combobox cmbFormaPago) { + this.cmbFormaPago = cmbFormaPago; + } + + public Combobox getCmbPuntoVenta() { + return cmbPuntoVenta; + } + + public void setCmbPuntoVenta(Combobox cmbPuntoVenta) { + this.cmbPuntoVenta = cmbPuntoVenta; + } + + public Combobox getCmbRestriccionFormaPago() { + return cmbRestriccionFormaPago; + } + + public void setCmbRestriccionFormaPago(Combobox cmbRestriccionFormaPago) { + this.cmbRestriccionFormaPago = cmbRestriccionFormaPago; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEmpresas = empresaService.obtenerTodos(); + lsPuntosVentas = puntoVentaService.obtenerTodos(); + lsFormaPago = formaPagoService.obtenerTodos(); + + super.doAfterCompose(comp); + + formaPagoDet = (FormaPagoDet) Executions.getCurrent().getArg().get("formaPagoDet"); + configFormaPagoList = (MyListbox) Executions.getCurrent().getArg().get("configFormaPagoList"); + + if (formaPagoDet.getFormapagodetId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + cmbFormaPago.focus(); + } + + public void onClick$btnSalvar(Event ev) { + cmbFormaPago.getSelectedItem().getValue(); + cmbPuntoVenta.getSelectedItem().getValue(); + cmbRestriccionFormaPago.getSelectedItem().getValue(); + + try { + formaPagoDet.setActivo(Boolean.TRUE); + formaPagoDet.setFecmodif(Calendar.getInstance().getTime()); + formaPagoDet.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (formaPagoDet.getFormapagodetId() == null) { + formaPagoDetService.suscribir(formaPagoDet); + configFormaPagoList.addItem(formaPagoDet); + } else { + formaPagoDetService.actualizacion(formaPagoDet); + configFormaPagoList.updateItem(formaPagoDet); + } + + Messagebox.show( + Labels.getLabel("editarConfiguracionFormaPagoController.MSG.suscribirOK"), + Labels.getLabel("editarConfiguracionFormaPagoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarConfiguracionFormaPagoController.MSG.borrarPergunta"), + Labels.getLabel("editarConfiguracionFormaPagoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + formaPagoDetService.borrar(formaPagoDet); + + Messagebox.show( + Labels.getLabel("editarConfiguracionFormaPagoController.MSG.borrarOK"), + Labels.getLabel("editarConfiguracionFormaPagoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + configFormaPagoList.removeItem(formaPagoDet); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionGeneralController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionGeneralController.java new file mode 100644 index 000000000..4eea4e329 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionGeneralController.java @@ -0,0 +1,218 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.Constante; +import com.rjconsultores.ventaboletos.service.ConstanteService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarConfiguracionGeneralController") +@Scope("prototype") +public class EditarConfiguracionGeneralController extends MyGenericForwardComposer { + + @Autowired + private ConstanteService constanteService; + private Constante constante; + private MyListbox constanteList; + private static Logger log = Logger.getLogger(EditarConfiguracionGeneralController.class); + private Textbox txtNome; + private Textbox descconstante; + private Textbox valorconstante; + private Textbox indtipoconstante; + private Radio radMantenimientoUsuarioSi; + private Radio radMantenimientoUsuarioNo; + private Button btnApagar; + private Button btnSalvar; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Radio getRadMantenimientoUsuarioNo() { + return radMantenimientoUsuarioNo; + } + + public void setRadMantenimientoUsuarioNo(Radio radMantenimientoUsuarioNo) { + this.radMantenimientoUsuarioNo = radMantenimientoUsuarioNo; + } + + public Radio getRadMantenimientoUsuarioSi() { + return radMantenimientoUsuarioSi; + } + + public void setRadMantenimientoUsuarioSi(Radio radMantenimientoUsuarioSi) { + this.radMantenimientoUsuarioSi = radMantenimientoUsuarioSi; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + constante = (Constante) Executions.getCurrent().getArg().get("constante"); + constanteList = (MyListbox) Executions.getCurrent().getArg().get("constanteList"); + + radMantenimientoUsuarioSi.setChecked(true); + radMantenimientoUsuarioNo.setChecked(false); + + if (constante.getConstanteId() != null) { + if (constante.getIndmantenimientousuario() == Boolean.FALSE) { + radMantenimientoUsuarioSi.setChecked(false); + radMantenimientoUsuarioNo.setChecked(true); + + //Se mantenimiento es NO, não se pode fazer nada na tela. + valorconstante.setDisabled(Boolean.TRUE); + + radMantenimientoUsuarioSi.setDisabled(Boolean.TRUE); + radMantenimientoUsuarioNo.setDisabled(Boolean.TRUE); + + btnApagar.setVisible(Boolean.FALSE); + btnSalvar.setVisible(Boolean.FALSE); + + Messagebox.show( + Labels.getLabel("MSG.noEditabled"), + Labels.getLabel("editarConfiguracionGeneralController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + + txtNome.setDisabled(Boolean.TRUE); + descconstante.setDisabled(Boolean.TRUE); + indtipoconstante.setDisabled(Boolean.TRUE); + } + + if (constante.getConstanteId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + + } + + public void onClick$btnSalvar(Event ev) { + txtNome.getValue(); + valorconstante.getValue(); + //indtipoconstante.getValue(); + + try { + constante.setActivo(true); + constante.setFecmodif(Calendar.getInstance().getTime()); + constante.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + constante.setIndmantenimientousuario(radMantenimientoUsuarioSi.isChecked() ? Boolean.TRUE : Boolean.FALSE); + + if (constante.getConstanteId() == null) { + List lsConstante = constanteService.buscar(constante.getNombconstante()); + + if (!lsConstante.isEmpty()) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarConfiguracionGeneralController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + constanteService.suscribir(constante); + constanteList.addItem(constante); + + Messagebox.show( + Labels.getLabel("editarConfiguracionGeneralController.MSG.suscribirOK"), + Labels.getLabel("editarConfiguracionGeneralController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } else { + constanteService.actualizacion(constante); + constanteList.updateItem(constante); + + Messagebox.show( + Labels.getLabel("editarConfiguracionGeneralController.MSG.suscribirOK"), + Labels.getLabel("editarConfiguracionGeneralController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarConfiguracionGeneralController.MSG.borrarPergunta"), + Labels.getLabel("editarConfiguracionGeneralController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + constanteService.borrar(constante); + + Messagebox.show( + Labels.getLabel("editarConfiguracionGeneralController.MSG.borrarOK"), + Labels.getLabel("editarConfiguracionGeneralController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + constanteList.removeItem(constante); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public Constante getConstante() { + return constante; + } + + public void setConstante(Constante constante) { + this.constante = constante; + } + + public MyListbox getConstanteList() { + return constanteList; + } + + public void setConstanteList(MyListbox constanteList) { + this.constanteList = constanteList; + } + + public ConstanteService getConstanteService() { + return constanteService; + } + + public void setConstanteService(ConstanteService constanteService) { + this.constanteService = constanteService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionReservacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionReservacionController.java new file mode 100644 index 000000000..aab00d62d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConfiguracionReservacionController.java @@ -0,0 +1,936 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Spinner; +import org.zkoss.zul.Tab; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.entidad.ReservacionCategoria; +import com.rjconsultores.ventaboletos.entidad.ReservacionClase; +import com.rjconsultores.ventaboletos.entidad.ReservacionCtrl; +import com.rjconsultores.ventaboletos.entidad.ReservacionMarca; +import com.rjconsultores.ventaboletos.entidad.ReservacionMercado; +import com.rjconsultores.ventaboletos.entidad.ReservacionPuntoVenta; +import com.rjconsultores.ventaboletos.service.CategoriaService; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.service.ReservacionCtrlService; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionReservacionCategoria; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionReservacionClase; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionReservacionMarca; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionReservacionMercado; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionReservacionPuntoVenta; + +/** + * + * @author Rafius + */ +@Controller("editarConfiguracionReservacionController") +@Scope("prototype") +public class EditarConfiguracionReservacionController extends MyGenericForwardComposer { + + @Autowired + private ReservacionCtrlService reservacionCtrlService; + @Autowired + private CategoriaService categoriaService; + @Autowired + private PuntoVentaService puntoVentaService; + @Autowired + private ClaseServicioService claseService; + @Autowired + private MarcaService marcaService; + @Autowired + private ParadaService paradaService; + private ReservacionCtrl reservacionCtrl; + private static Logger log = Logger.getLogger(EditarConfiguracionReservacionController.class); + private Datebox fecInicio; + private Datebox fecFinal; + private Textbox txtDescripcion; + private List lsCategoria; + private List lsClase; + private List lsMarca; + private MyListbox reservacionCtrlList; + private MyListbox reservacionCategoriaList; + private MyListbox reservacionClaseList; + private MyListbox reservacionMarcaList; + private MyListbox reservacionMercadoList; + private MyListbox reservacionPuntoVentaList; + private List lsReservacionCategoria; + private List lsReservacionClase; + private List lsReservacionMarca; + private List lsReservacionMercado; + private List lsReservacionPuntoVenta; + private Combobox cmbCategoria; + private Combobox cmbClase; + private Combobox cmbMarca; + private Combobox cmbPuntoVenta; + private Combobox cmbParadaOrigem; + private Combobox cmbParadaDestino; + private Intbox NumAsientosCorrida; + private Button btnApagar; + private Tab tabControl; + private Tab tabCategoria; + private Tab tabPunto; + private Tab tabClase; + private Tab tabMercado; + private Tab tabMarca; + private Spinner spTiempoLiberacionHora; + private Spinner spTiempoLiberacionMinuto; + private Spinner spTiempoLiberacionInternetHora; + private Spinner spTiempoLiberacionInternetMinuto; + private Spinner spTiempoPrevioHora; + private Spinner spTiempoPrevioMinuto; + private Spinner spTiempoPrevioInternetHora; + private Spinner spTiempoPrevioInternetMinuto; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsCategoria = categoriaService.obtenerTodos(); + lsClase = claseService.obtenerTodos(); + lsMarca = marcaService.obtenerTodos(); + + super.doAfterCompose(comp); + + reservacionCtrl = (ReservacionCtrl) Executions.getCurrent().getArg().get("reservacionCtrl"); + reservacionCtrlList = (MyListbox) Executions.getCurrent().getArg().get("reservacionCtrlList"); + + //Categoria + reservacionCategoriaList.setItemRenderer(new RenderConfiguracionReservacionCategoria()); + lsReservacionCategoria = new ArrayList(); + //Clase + reservacionClaseList.setItemRenderer(new RenderConfiguracionReservacionClase()); + lsReservacionClase = new ArrayList(); + //Marca + reservacionMarcaList.setItemRenderer(new RenderConfiguracionReservacionMarca()); + lsReservacionMarca = new ArrayList(); + //PuntoVenta + reservacionPuntoVentaList.setItemRenderer(new RenderConfiguracionReservacionPuntoVenta()); + lsReservacionPuntoVenta = new ArrayList(); + //Mercado + reservacionMercadoList.setItemRenderer(new RenderConfiguracionReservacionMercado()); + lsReservacionMercado = new ArrayList(); + + //Recarrega Listas + if (reservacionCtrl.getReservacionctrlId() != null) { + reservacionCtrl = reservacionCtrlService.obtenerID(reservacionCtrl.getReservacionctrlId()); + + lsReservacionCategoria = reservacionCtrl.getReservacionCategoriaList(); + reservacionCategoriaList.setData(lsReservacionCategoria); + + lsReservacionClase = reservacionCtrl.getReservacionClaseList(); + reservacionClaseList.setData(lsReservacionClase); + + lsReservacionMarca = reservacionCtrl.getReservacionMarcaList(); + reservacionMarcaList.setData(lsReservacionMarca); + + lsReservacionPuntoVenta = reservacionCtrl.getReservacionPuntoVentaList(); + reservacionPuntoVentaList.setData(lsReservacionPuntoVenta); + + lsReservacionMercado = reservacionCtrl.getReservacionMercadoList(); + reservacionMercadoList.setData(lsReservacionMercado); + + //Tiempos + String[] horaMinutoTiempoliberacion = capturarHoraMinuto(reservacionCtrl.getTiempoliberacion()); + String[] horaMinutoTiempoliberacioninternet = capturarHoraMinuto(reservacionCtrl.getTiempoliberacioninternet()); + String[] horaMinutoTiempoprevio = capturarHoraMinuto(reservacionCtrl.getTiempoprevio()); + String[] horaMinutoTiempopreviointernet = capturarHoraMinuto(reservacionCtrl.getTiempopreviointernet()); + + spTiempoLiberacionHora.setText(horaMinutoTiempoliberacion[0]); + spTiempoLiberacionMinuto.setText(horaMinutoTiempoliberacion[1]); + spTiempoLiberacionInternetHora.setText(horaMinutoTiempoliberacioninternet[0]); + spTiempoLiberacionInternetMinuto.setText(horaMinutoTiempoliberacioninternet[1]); + spTiempoPrevioHora.setText(horaMinutoTiempoprevio[0]); + spTiempoPrevioMinuto.setText(horaMinutoTiempoprevio[1]); + spTiempoPrevioInternetHora.setText(horaMinutoTiempopreviointernet[0]); + spTiempoPrevioInternetMinuto.setText(horaMinutoTiempopreviointernet[1]); + + } + + if (reservacionCtrl.getReservacionctrlId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtDescripcion.focus(); + } + + public String[] capturarHoraMinuto(Date data) { + String[] horaMinuto = new String[2]; + Calendar c = Calendar.getInstance(); + c.setTime(data); + System.out.println(DateUtil.getFecInicio().getTime() + " " + c.getTime()); + Long tempo = DateUtil.getElapsedMinutos(DateUtil.getFecInicio().getTime(), c.getTime()); + long minutos = (tempo % 60); + Integer horas = (tempo.intValue() / 60); + String sMinutos = String.valueOf(minutos); + horaMinuto[0] = horas.toString(); + horaMinuto[1] = ((sMinutos.length() < 2) ? "0" + sMinutos : sMinutos); + + return horaMinuto; + } + + public void onClick$btnAdicionarCategoria(Event ev) throws InterruptedException { + if (cmbCategoria.getSelectedItem() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowMarca.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + cmbCategoria.getSelectedItem().getValue(); + try { + ReservacionCategoria rCategoria = new ReservacionCategoria(); + rCategoria.setReservacionCtrl(reservacionCtrl); + rCategoria.setActivo(Boolean.TRUE); + rCategoria.setCategoria((Categoria) cmbCategoria.getSelectedItem().getValue()); + rCategoria.setFecmodif(Calendar.getInstance().getTime()); + rCategoria.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + boolean existe = false; + for (ReservacionCategoria rc : lsReservacionCategoria) { + if (rc.getCategoria().equals(rCategoria.getCategoria()) && rc.getActivo()) { + existe = true; + } + } + if (!existe) { + lsReservacionCategoria.add(rCategoria); + + reservacionCtrl.setReservacionCategoriaList(lsReservacionCategoria); + } + List lsReservacionCategoriaAtivo = new ArrayList(); + for (ReservacionCategoria rc : lsReservacionCategoria) { + if (rc.getActivo()) { + lsReservacionCategoriaAtivo.add(rc); + } + } + reservacionCategoriaList.setData(lsReservacionCategoriaAtivo); + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnAdicionarClase(Event ev) throws InterruptedException { + if (cmbClase.getSelectedItem() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowMarca.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + cmbClase.getSelectedItem().getValue(); + try { + ReservacionClase rClase = new ReservacionClase(); + rClase.setReservacionCtrl(reservacionCtrl); + rClase.setActivo(Boolean.TRUE); + rClase.setClaseServicio((ClaseServicio) cmbClase.getSelectedItem().getValue()); + rClase.setFecmodif(Calendar.getInstance().getTime()); + rClase.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + boolean existe = false; + for (ReservacionClase rc : lsReservacionClase) { + if (rc.getClaseServicio().equals(rClase.getClaseServicio()) && rc.getActivo()) { + existe = true; + } + } + if (!existe) { + lsReservacionClase.add(rClase); + //reservacionClaseList.addItem(rClase); + reservacionCtrl.setReservacionClaseList(lsReservacionClase); + } + List lsReservacionCategoriaAtivo = new ArrayList(); + for (ReservacionClase rc : lsReservacionClase) { + if (rc.getActivo()) { + lsReservacionCategoriaAtivo.add(rc); + } + } + reservacionClaseList.setData(lsReservacionCategoriaAtivo); + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnAdicionarMarca(Event ev) throws InterruptedException { + if (cmbMarca.getSelectedItem() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowMarca.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + cmbMarca.getSelectedItem().getValue(); + try { + ReservacionMarca rMarca = new ReservacionMarca(); + rMarca.setReservacionCtrl(reservacionCtrl); + rMarca.setActivo(Boolean.TRUE); + rMarca.setMarca((Marca) cmbMarca.getSelectedItem().getValue()); + rMarca.setFecmodif(Calendar.getInstance().getTime()); + rMarca.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + boolean existe = false; + for (ReservacionMarca rm : lsReservacionMarca) { + if (rm.getMarca().equals(rMarca.getMarca()) && rm.getActivo()) { + existe = true; + } + } + if (!existe) { + lsReservacionMarca.add(rMarca); + //reservacionMarcaList.addItem(rMarca); + reservacionCtrl.setReservacionMarcaList(lsReservacionMarca); + } + List lsReservacionMarcaAtivo = new ArrayList(); + for (ReservacionMarca rc : lsReservacionMarca) { + if (rc.getActivo()) { + lsReservacionMarcaAtivo.add(rc); + } + } + reservacionMarcaList.setData(lsReservacionMarcaAtivo); + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnAdicionarPuntoVenta(Event ev) throws InterruptedException { + if (cmbPuntoVenta.getSelectedItem() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowMarca.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + cmbPuntoVenta.getSelectedItem().getValue(); + try { + ReservacionPuntoVenta rPuntoVenta = new ReservacionPuntoVenta(); + rPuntoVenta.setReservacionCtrl(reservacionCtrl); + rPuntoVenta.setActivo(Boolean.TRUE); + rPuntoVenta.setPuntoVenta((PuntoVenta) cmbPuntoVenta.getSelectedItem().getValue()); + rPuntoVenta.setFecmodif(Calendar.getInstance().getTime()); + rPuntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + boolean existe = false; + for (ReservacionPuntoVenta rpv : lsReservacionPuntoVenta) { + if (rpv.getPuntoVenta().equals(rPuntoVenta.getPuntoVenta()) && rpv.getActivo()) { + existe = true; + } + } + if (!existe) { + lsReservacionPuntoVenta.add(rPuntoVenta); + // reservacionPuntoVentaList.addItem(rPuntoVenta); + reservacionCtrl.setReservacionPuntoVentaList(lsReservacionPuntoVenta); + } + List lsReservacionPuntoVentaAtivo = new ArrayList(); + for (ReservacionPuntoVenta rc : lsReservacionPuntoVenta) { + if (rc.getActivo()) { + lsReservacionPuntoVentaAtivo.add(rc); + } + } + reservacionPuntoVentaList.setData(lsReservacionPuntoVentaAtivo); + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnAdicionarMercado(Event ev) throws InterruptedException { + if (cmbParadaOrigem.getSelectedItem() == null || cmbParadaDestino.getSelectedItem() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowMarca.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + Parada origem = (Parada) cmbParadaOrigem.getSelectedItem().getValue(); + Parada destino = (Parada) cmbParadaDestino.getSelectedItem().getValue(); + + try { + if (origem.equals(destino) + && (origem.getParadaId() != -1 && destino.getParadaId() != -1)) { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.selectItemDiferente"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + ReservacionMercado rMercado = new ReservacionMercado(); + rMercado.setReservacionCtrl(reservacionCtrl); + rMercado.setActivo(Boolean.TRUE); + rMercado.setParadaOrigem(origem); + rMercado.setParadaDestino(destino); + rMercado.setFecmodif(Calendar.getInstance().getTime()); + rMercado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + boolean existe = false; + for (ReservacionMercado rpv : lsReservacionMercado) { + if (rpv.getParadaOrigem().equals(rMercado.getParadaOrigem()) && rpv.getParadaDestino().equals(rMercado.getParadaDestino()) && rpv.getActivo()) { + existe = true; + } + } + if (!existe) { + lsReservacionMercado.add(rMercado); + //reservacionMercadoList.addItem(rMercado); + reservacionCtrl.setReservacionMercadoList(lsReservacionMercado); + } + List lsReservacionMercadoAtivo = new ArrayList(); + for (ReservacionMercado rc : lsReservacionMercado) { + if (rc.getActivo()) { + lsReservacionMercadoAtivo.add(rc); + } + } + reservacionMercadoList.setData(lsReservacionMercadoAtivo); + + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.EXCLAMATION); + } + } + + public void onClick$btnRemoverPuntoVenta(Event ev) { + try { + ReservacionPuntoVenta reservacioPuntoVenta = (ReservacionPuntoVenta) reservacionPuntoVentaList.getSelected(); + if (reservacioPuntoVenta != null) { + lsReservacionPuntoVenta.remove(reservacioPuntoVenta); + reservacioPuntoVenta.setFecmodif(Calendar.getInstance().getTime()); + reservacioPuntoVenta.setActivo(Boolean.FALSE); + reservacioPuntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + lsReservacionPuntoVenta.add(reservacioPuntoVenta); + reservacionPuntoVentaList.updateItem(reservacioPuntoVenta); + reservacionPuntoVentaList.removeItem(reservacioPuntoVenta); + reservacionCtrl.setReservacionPuntoVentaList(lsReservacionPuntoVenta); + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnRemoverCategoria(Event ev) { + try { + ReservacionCategoria reservacionCategoria = (ReservacionCategoria) reservacionCategoriaList.getSelected(); + if (reservacionCategoria != null) { + lsReservacionCategoria.remove(reservacionCategoria); + reservacionCategoria.setFecmodif(Calendar.getInstance().getTime()); + reservacionCategoria.setActivo(Boolean.FALSE); + reservacionCategoria.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + lsReservacionCategoria.add(reservacionCategoria); + reservacionCategoriaList.updateItem(reservacionCategoria); + reservacionCategoriaList.removeItem(reservacionCategoria); + reservacionCtrl.setReservacionCategoriaList(lsReservacionCategoria); + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnRemoverClase(Event ev) { + try { + ReservacionClase reservacioClase = (ReservacionClase) reservacionClaseList.getSelected(); + if (reservacioClase != null) { + lsReservacionClase.remove(reservacioClase); + reservacioClase.setFecmodif(Calendar.getInstance().getTime()); + reservacioClase.setActivo(Boolean.FALSE); + reservacioClase.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + lsReservacionClase.add(reservacioClase); + reservacionClaseList.updateItem(reservacioClase); + reservacionClaseList.removeItem(reservacioClase); + reservacionCtrl.setReservacionClaseList(lsReservacionClase); + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnRemoverMarca(Event ev) { + try { + ReservacionMarca rMarca = (ReservacionMarca) reservacionMarcaList.getSelected(); + if (rMarca != null) { + lsReservacionMarca.remove(rMarca); + rMarca.setFecmodif(Calendar.getInstance().getTime()); + rMarca.setActivo(Boolean.FALSE); + rMarca.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + lsReservacionMarca.add(rMarca); + reservacionMarcaList.updateItem(rMarca); + reservacionMarcaList.removeItem(rMarca); + reservacionCtrl.setReservacionMarcaList(lsReservacionMarca); + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnRemoverMercado(Event ev) { + try { + ReservacionMercado rMercado = (ReservacionMercado) reservacionMercadoList.getSelected(); + if (rMercado != null) { + lsReservacionMercado.remove(rMercado); + rMercado.setFecmodif(Calendar.getInstance().getTime()); + rMercado.setActivo(Boolean.FALSE); + rMercado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + lsReservacionMercado.add(rMercado); + reservacionMercadoList.updateItem(rMercado); + reservacionMercadoList.removeItem(rMercado); + reservacionCtrl.setReservacionMercadoList(lsReservacionMercado); + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + tabControl.setSelected(Boolean.TRUE); + txtDescripcion.getValue(); + fecInicio.getValue(); + fecFinal.getValue(); + + spTiempoLiberacionHora.getValue(); + spTiempoLiberacionMinuto.getValue(); + spTiempoLiberacionInternetHora.getValue(); + spTiempoLiberacionInternetMinuto.getValue(); + spTiempoPrevioHora.getValue(); + spTiempoPrevioMinuto.getValue(); + spTiempoPrevioInternetHora.getValue(); + spTiempoPrevioInternetMinuto.getValue(); + + NumAsientosCorrida.getValue(); + + + if (fecInicio.getValue().after(fecFinal.getValue())) { + try { + Messagebox.show(Labels.getLabel("editarPeriodoVacacionalController.MSG.busquedaPeriodo"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + log.error(ex); + } + } else { + try { + + List lsTraslapa = reservacionCtrlService.buscarFechaTraslapa(reservacionCtrl); + Boolean podeSalvarTraslapa = lsTraslapa.isEmpty() ? true : false; + if (lsTraslapa.size() == 1) { + //Somente edição + if (reservacionCtrl.getReservacionctrlId() != null) { + if (reservacionCtrl.getReservacionctrlId().equals(lsTraslapa.get(0).getReservacionctrlId())) { + podeSalvarTraslapa = true; + } + } + } + + //Se não pode salvar pq translapa + if (!podeSalvarTraslapa) { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.conflitoVigencias"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + if (reservacionCategoriaList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.necesitaCategoria"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + tabCategoria.setSelected(Boolean.TRUE); + return; + } + if (reservacionPuntoVentaList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.necesitaPunto"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + tabPunto.setSelected(Boolean.TRUE); + return; + } + if (reservacionClaseList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.necesitaClase"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + tabClase.setSelected(Boolean.TRUE); + return; + } + if (reservacionMercadoList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.necesitaMercado"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + tabMercado.setSelected(Boolean.TRUE); + return; + } + if (reservacionMarcaList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.necesitaMarca"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + tabMarca.setSelected(Boolean.TRUE); + return; + } + + List lsReservacion = reservacionCtrlService.buscar(reservacionCtrl); + + boolean podeSalvar = false; + if (lsReservacion.isEmpty()) { + podeSalvar = true; + } else { + for (ReservacionCtrl rc : lsReservacion) { + if (rc.getReservacionctrlId().equals(reservacionCtrl.getReservacionctrlId())) { + podeSalvar = true; + } + } + } + + if (podeSalvar) { + reservacionCtrl.setActivo(true); + reservacionCtrl.setFecmodif(Calendar.getInstance().getTime()); + reservacionCtrl.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + reservacionCtrl.setTiempoliberacion(spTiempoLiberacionHora.getValue(), spTiempoLiberacionMinuto.getValue()); + reservacionCtrl.setTiempoliberacioninternet(spTiempoLiberacionInternetHora.getValue(), spTiempoLiberacionInternetMinuto.getValue()); + reservacionCtrl.setTiempoprevio(spTiempoPrevioHora.getValue(), spTiempoPrevioMinuto.getValue()); + reservacionCtrl.setTiempopreviointernet(spTiempoPrevioInternetHora.getValue(), spTiempoPrevioInternetMinuto.getValue()); + + if (reservacionCtrl.getReservacionctrlId() == null) { + reservacionCtrlService.suscribir(reservacionCtrl); + reservacionCtrlList.addItem(reservacionCtrl); + } else { + reservacionCtrlService.actualizacion(reservacionCtrl); + reservacionCtrlList.updateItem(reservacionCtrl); + } + + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.suscribirOK"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error("Erro ao salvar Configuracion Reservacion " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.borrarPergunta"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + reservacionCtrlService.borrar(reservacionCtrl); + + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.borrarOK"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + reservacionCtrlList.removeItem(reservacionCtrl); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public ReservacionCtrl getReservacionCtrl() { + return reservacionCtrl; + } + + public void setReservacionCtrl(ReservacionCtrl reservacionCtrl) { + this.reservacionCtrl = reservacionCtrl; + } + + public MyListbox getReservacionCtrlList() { + return reservacionCtrlList; + } + + public void setReservacionCtrlList(MyListbox reservacionCtrlList) { + this.reservacionCtrlList = reservacionCtrlList; + } + + public ReservacionCtrlService getReservacionCtrlService() { + return reservacionCtrlService; + } + + public void setReservacionCtrlService(ReservacionCtrlService reservacionCtrlService) { + this.reservacionCtrlService = reservacionCtrlService; + } + + public CategoriaService getCategoriaService() { + return categoriaService; + } + + public void setCategoriaService(CategoriaService categoriaService) { + this.categoriaService = categoriaService; + } + + public ClaseServicioService getClaseService() { + return claseService; + } + + public void setClaseService(ClaseServicioService claseService) { + this.claseService = claseService; + } + + public List getLsClase() { + return lsClase; + } + + public void setLsClase(List lsClase) { + this.lsClase = lsClase; + } + + public List getLsMarca() { + return lsMarca; + } + + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + public MarcaService getMarcaService() { + return marcaService; + } + + public void setMarcaService(MarcaService marcaService) { + this.marcaService = marcaService; + } + + public PuntoVentaService getPuntoVentaService() { + return puntoVentaService; + } + + public void setPuntoVentaService(PuntoVentaService puntoVentaService) { + this.puntoVentaService = puntoVentaService; + } + + public List getLsCategoria() { + return lsCategoria; + } + + public void setLsCategoria(List lsCategoria) { + this.lsCategoria = lsCategoria; + } + + public List getLsReservacionCategoria() { + return lsReservacionCategoria; + } + + public void setLsReservacionCategoria(List lsReservacionCategoria) { + this.lsReservacionCategoria = lsReservacionCategoria; + } + + public List getLsReservacionClase() { + return lsReservacionClase; + } + + public void setLsReservacionClase(List lsReservacionClase) { + this.lsReservacionClase = lsReservacionClase; + } + + public List getLsReservacionMarca() { + return lsReservacionMarca; + } + + public void setLsReservacionMarca(List lsReservacionMarca) { + this.lsReservacionMarca = lsReservacionMarca; + } + + public List getLsReservacionMercado() { + return lsReservacionMercado; + } + + public void setLsReservacionMercado(List lsReservacionMercado) { + this.lsReservacionMercado = lsReservacionMercado; + } + + public List getLsReservacionPuntoVenta() { + return lsReservacionPuntoVenta; + } + + public void setLsReservacionPuntoVenta(List lsReservacionPuntoVenta) { + this.lsReservacionPuntoVenta = lsReservacionPuntoVenta; + } + + public MyListbox getReservacionCategoriaList() { + return reservacionCategoriaList; + } + + public void setReservacionCategoriaList(MyListbox reservacionCategoriaList) { + this.reservacionCategoriaList = reservacionCategoriaList; + } + + public MyListbox getReservacionClaseList() { + return reservacionClaseList; + } + + public void setReservacionClaseList(MyListbox reservacionClaseList) { + this.reservacionClaseList = reservacionClaseList; + } + + public MyListbox getReservacionMarcaList() { + return reservacionMarcaList; + } + + public void setReservacionMarcaList(MyListbox reservacionMarcaList) { + this.reservacionMarcaList = reservacionMarcaList; + } + + public MyListbox getReservacionMercadoList() { + return reservacionMercadoList; + } + + public void setReservacionMercadoList(MyListbox reservacionMercadoList) { + this.reservacionMercadoList = reservacionMercadoList; + } + + public MyListbox getReservacionPuntoVentaList() { + return reservacionPuntoVentaList; + } + + public void setReservacionPuntoVentaList(MyListbox reservacionPuntoVentaList) { + this.reservacionPuntoVentaList = reservacionPuntoVentaList; + } + + public Combobox getCmbCategoria() { + return cmbCategoria; + } + + public void setCmbCategoria(Combobox cmbCategoria) { + this.cmbCategoria = cmbCategoria; + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public Combobox getCmbClase() { + return cmbClase; + } + + public void setCmbClase(Combobox cmbClase) { + this.cmbClase = cmbClase; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Combobox getCmbParadaDestino() { + return cmbParadaDestino; + } + + public void setCmbParadaDestino(Combobox cmbParadaDestino) { + this.cmbParadaDestino = cmbParadaDestino; + } + + public Combobox getCmbParadaOrigem() { + return cmbParadaOrigem; + } + + public void setCmbParadaOrigem(Combobox cmbParadaOrigem) { + this.cmbParadaOrigem = cmbParadaOrigem; + } + + public Combobox getCmbPuntoVenta() { + return cmbPuntoVenta; + } + + public void setCmbPuntoVenta(Combobox cmbPuntoVenta) { + this.cmbPuntoVenta = cmbPuntoVenta; + } + + public ParadaService getParadaService() { + return paradaService; + } + + public void setParadaService(ParadaService paradaService) { + this.paradaService = paradaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConvenioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConvenioController.java new file mode 100644 index 000000000..bff027b2e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConvenioController.java @@ -0,0 +1,484 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Longbox; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.Convenio; +import com.rjconsultores.ventaboletos.entidad.ConvenioDet; +import com.rjconsultores.ventaboletos.service.ConvenioDetService; +import com.rjconsultores.ventaboletos.service.ConvenioService; +import com.rjconsultores.ventaboletos.utilerias.TraslaparUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConvenioDet; + +/** + * + * @author Administrador + */ +@Controller("editarConvenioController") +@Scope("prototype") +public class EditarConvenioController extends MyGenericForwardComposer { + + @Autowired + private ConvenioService convenioService; + private ConvenioDetService convenioDetService; + private Convenio convenio; + private List lsConvenioDets; + private MyListbox convenioList; + private MyListbox convenioDetList; + private Textbox txtDescConvenio; + private MyTextboxDecimal txtPorcdescuento; + private Longbox txtNumfolioinicio; + private Longbox txtNumfoliofinal; + private Button btnApagar; + private Button btnAdicionarConvenioDet; + private Radio rdPrecioTotal; + private Radio rdPrecioDescuento; + private Radio rdDescuento; + private Checkbox chkValidaFolio; + private static Logger log = Logger.getLogger(EditarConvenioController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Convenio getConvenio() { + return convenio; + } + + public void setConvenio(Convenio convenio) { + this.convenio = convenio; + } + + public MyListbox getConvenioDetList() { + return convenioDetList; + } + + public void setConvenioDetList(MyListbox convenioDetList) { + this.convenioDetList = convenioDetList; + } + + public MyListbox getConvenioList() { + return convenioList; + } + + public void setConvenioList(MyListbox convenioList) { + this.convenioList = convenioList; + } + + public List getLsConvenioDets() { + return lsConvenioDets; + } + + public void setLsConvenioDets(List lsConvenioDets) { + this.lsConvenioDets = lsConvenioDets; + } + + public Textbox getTxtDescConvenio() { + return txtDescConvenio; + } + + public void setTxtDescConvenio(Textbox txtDescConvenio) { + this.txtDescConvenio = txtDescConvenio; + } + + public Longbox getTxtNumfoliofinal() { + return txtNumfoliofinal; + } + + public void setTxtNumfoliofinal(Longbox txtNumfoliofinal) { + this.txtNumfoliofinal = txtNumfoliofinal; + } + + public Longbox getTxtNumfolioinicio() { + return txtNumfolioinicio; + } + + public void setTxtNumfolioinicio(Longbox txtNumfolioinicio) { + this.txtNumfolioinicio = txtNumfolioinicio; + } + + public MyTextboxDecimal getTxtPorcdescuento() { + return txtPorcdescuento; + } + + public void setTxtPorcdescuento(MyTextboxDecimal txtPorcdescuento) { + this.txtPorcdescuento = txtPorcdescuento; + } + + public Radio getRdDescuento() { + return rdDescuento; + } + + public void setRdDescuento(Radio rdDescuento) { + this.rdDescuento = rdDescuento; + } + + public Radio getRdPrecioDescuento() { + return rdPrecioDescuento; + } + + public void setRdPrecioDescuento(Radio rdPrecioDescuento) { + this.rdPrecioDescuento = rdPrecioDescuento; + } + + public Radio getRdPrecioTotal() { + return rdPrecioTotal; + } + + public void setRdPrecioTotal(Radio rdPrecioTotal) { + this.rdPrecioTotal = rdPrecioTotal; + } + + public Checkbox getChkValidaFolio() { + return chkValidaFolio; + } + + public void setChkValidaFolio(Checkbox chkValidaFolio) { + this.chkValidaFolio = chkValidaFolio; + } + + public Button getBtnAdicionarConvenioDet() { + return btnAdicionarConvenioDet; + } + + public void setBtnAdicionarConvenioDet(Button btnAdicionarConvenioDet) { + this.btnAdicionarConvenioDet = btnAdicionarConvenioDet; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + convenio = + (Convenio) Executions.getCurrent().getArg().get("convenio"); + convenioList = + (MyListbox) Executions.getCurrent().getArg().get("convenioList"); + + if (convenio.getConvenioId() == null) { + btnApagar.setVisible(Boolean.FALSE); + + lsConvenioDets = new ArrayList(); + } else { + convenio = convenioService.obtenerID(convenio.getConvenioId()); + lsConvenioDets = convenio.getConvenioDetList(); + + if (convenio.getImprimeprecio() != null) { + if (convenio.getImprimeprecio().equals(Convenio.IMPRIME_DESCONTO)) { + rdDescuento.setChecked(Boolean.TRUE); + } else if (convenio.getImprimeprecio().equals(Convenio.IMPRIME_PRECO_MENOS_DESCONTO)) { + rdPrecioDescuento.setChecked(Boolean.TRUE); + } else if (convenio.getImprimeprecio().equals(Convenio.IMPRIME_PRECO_TOTAL)) { + rdPrecioTotal.setChecked(Boolean.TRUE); + } + } + + chkValidaFolio.setChecked(convenio.getValidafolio()); + chkValidaFolio.setDisabled(Boolean.TRUE); + + onClick$chkValidaFolio(null); + +// if (!chkValidaFolio.isChecked() && lsConvenioDets.size() > 0) { +// btnAdicionarConvenioDet.setDisabled(Boolean.TRUE); +// } + } + + convenioDetList.setItemRenderer(new RenderConvenioDet()); + convenioDetList.setData(lsConvenioDets); + + txtDescConvenio.focus(); + } + + public void onClick$chkValidaFolio(Event ev) { + if (chkValidaFolio.isChecked()) { + txtNumfolioinicio.setDisabled(Boolean.FALSE); + txtNumfoliofinal.setDisabled(Boolean.FALSE); + } else { + txtNumfolioinicio.setValue(null); + txtNumfoliofinal.setValue(null); + + txtNumfolioinicio.setDisabled(Boolean.TRUE); + txtNumfoliofinal.setDisabled(Boolean.TRUE); + } + } + + public void onClick$btnSalvar(Event ev) { + txtDescConvenio.getValue(); + + try { + + if (lsConvenioDets.isEmpty()) { + Messagebox.show( + Labels.getLabel("editarConvenioController.MSG.necessaitaPorcentaje.value"), + Labels.getLabel("editarConvenioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + convenio.setActivo(true); + convenio.setFecmodif(Calendar.getInstance().getTime()); + convenio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + convenio.setConvenioDetList(lsConvenioDets); + convenio.setValidafolio(chkValidaFolio.isChecked()); + + if (rdDescuento.isChecked()) { + convenio.setImprimeprecio(Convenio.IMPRIME_DESCONTO); + } else if (rdPrecioDescuento.isChecked()) { + convenio.setImprimeprecio(Convenio.IMPRIME_PRECO_MENOS_DESCONTO); + } else if (rdPrecioTotal.isChecked()) { + convenio.setImprimeprecio(Convenio.IMPRIME_PRECO_TOTAL); + } else { + Messagebox.show( + Labels.getLabel("editarConvenioController.ImpressionSeleccione.value"), + Labels.getLabel("editarConvenioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + + List lsConvenioDet = + convenioService.buscar(convenio.getDescconvenio(), + convenio.getCveconvenio()); + + boolean podeSalvar = false; + if (lsConvenioDet.isEmpty()) { + podeSalvar = true; + } else { + if (convenio.getConvenioId() != null) { + for (Convenio c : lsConvenioDet) { + if (c.getConvenioId().equals(convenio.getConvenioId())) { + podeSalvar = true; + } + } + } + } + + if (podeSalvar) { + if (convenio.getConvenioId() == null) { + convenioService.suscribir(convenio); + convenioList.addItem(convenio); + } else { + convenioService.actualizacion(convenio); + convenioList.updateItem(convenio); + } + Messagebox.show( + Labels.getLabel("editarConvenioController.MSG.suscribirOK"), + Labels.getLabel("editarConvenioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarConvenioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarConvenioController.MSG.borrarPergunta"), + Labels.getLabel("editarConvenioController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + convenioService.borrar(convenio); + + Messagebox.show( + Labels.getLabel("editarConvenioController.MSG.borrarOK"), + Labels.getLabel("editarConvenioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + convenioList.removeItem(convenio); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + /** + * + * @return + * 0 - Esta ok + * 1 - Registro duplicado + * 2 - Registro traslapado + * @throws InterruptedException + */ + private int registroDuplicado(Long folioIni, Long folioFin) throws InterruptedException { + Collections.sort(lsConvenioDets, new Comparator() { + + public int compare(ConvenioDet o1, ConvenioDet o2) { + return o1.getNumfolioinicial().compareTo(o2.getNumfoliofinal()); + } + }); + + for (ConvenioDet pv : lsConvenioDets) { + if (!pv.getActivo()) { + continue; + } + + if (TraslaparUtil.intersectNum(pv.getNumfolioinicial().longValue(), pv.getNumfoliofinal().longValue(), + folioIni, folioFin)) { + return 2; + } + } + + return 0; + } + + public void onClick$btnAdicionarConvenioDet(Event ev) { + txtPorcdescuento.setConstraint("no empty"); + txtPorcdescuento.getValue(); + + if (txtPorcdescuento.getValueDecimal().compareTo(new BigDecimal("100")) > 0) { + Clients.wrongValue(txtPorcdescuento, Labels.getLabel("MSG.Porcentaje")); + return; + } + if (chkValidaFolio.isChecked()) { + txtNumfolioinicio.setConstraint("no empty, no negative, no zero"); + txtNumfoliofinal.setConstraint("no empty, no negative, no zero"); + + txtNumfolioinicio.getValue(); + txtNumfoliofinal.getValue(); + } + + try { + BigDecimal porcdescuento = txtPorcdescuento.getValueDecimal(); + Long numfolioinicio = txtNumfolioinicio.getValue(); + Long numfoliofinal = txtNumfoliofinal.getValue(); + + if (chkValidaFolio.isChecked() && (numfolioinicio > numfoliofinal)) { + Messagebox.show( + Labels.getLabel("MSG.Folios"), + Labels.getLabel("editarConvenioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + + Boolean achou = Boolean.FALSE; + for (ConvenioDet cds : convenio.getConvenioDetList()) { + if (cds.getNumfoliofinal() != null + && cds.getNumfolioinicial() != null) { + if (cds.getNumfoliofinal().equals(numfoliofinal) + && cds.getNumfolioinicial().equals(numfolioinicio) + && cds.getPorcdescuento().equals(porcdescuento)) { + achou = Boolean.TRUE; + } + } + } + + if (!achou) { + ConvenioDet cd = new ConvenioDet(); + cd.setActivo(Boolean.TRUE); + cd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cd.setFecmodif(Calendar.getInstance().getTime()); + cd.setPorcdescuento(porcdescuento); + cd.setNumfolioinicial(numfolioinicio); + cd.setNumfoliofinal(numfoliofinal); + + if (chkValidaFolio.isChecked()) { + int resp = registroDuplicado(numfolioinicio, numfoliofinal); + + if (resp != 0) { + Messagebox.show( + (resp == 1) ? Labels.getLabel("MSG.Registro.Existe") : Labels.getLabel("editarConvenioController.MSG.registroTraslapado"), + Labels.getLabel("editarConvenioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + } else { + if (lsConvenioDets.size() >= 1) { + Messagebox.show( + Labels.getLabel("editarConvenioController.MSG.pocentaje"), + Labels.getLabel("editarConvenioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + } + lsConvenioDets.add(cd); + convenioDetList.setData(lsConvenioDets); + convenio.setConvenioDetList(lsConvenioDets); + + chkValidaFolio.setDisabled(Boolean.TRUE); + + txtPorcdescuento.setConstraint(""); + txtNumfolioinicio.setConstraint(""); + txtNumfoliofinal.setConstraint(""); + + txtPorcdescuento.setText(""); + txtNumfolioinicio.setValue(null); + txtNumfoliofinal.setValue(null); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarConvenioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnRemoverConvenioDet(Event ev) { + ConvenioDet cd = (ConvenioDet) convenioDetList.getSelected(); + if (cd != null) { + cd.setActivo(Boolean.FALSE); + cd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cd.setFecmodif(Calendar.getInstance().getTime()); + + if (cd.getConveniodetId() != null) { + convenioDetService.borrar(cd); + } + + lsConvenioDets.remove(cd); + + if (lsConvenioDets.isEmpty()) { + btnAdicionarConvenioDet.setDisabled(Boolean.FALSE); + chkValidaFolio.setDisabled(Boolean.FALSE); + } + + convenioDetList.setData(lsConvenioDets); + convenio.setConvenioDetList(lsConvenioDets); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarMotivoCancelacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarMotivoCancelacionController.java new file mode 100644 index 000000000..57a564d8e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarMotivoCancelacionController.java @@ -0,0 +1,187 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import com.rjconsultores.ventaboletos.service.MotivoCancelacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarMotivoCancelacionController") +@Scope("prototype") +public class EditarMotivoCancelacionController extends MyGenericForwardComposer { + + @Autowired + private MotivoCancelacionService motivoCancelacionService; + private MotivoCancelacion motivoCancelacion; + private MyListbox motivoCancelacionList; + private static Logger log = Logger.getLogger(EditarMotivoCancelacionController.class); + private Textbox txtNome; + private Button btnApagar; + private Button btnSalvar; + private Combobox cmbTipoMotivo; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + motivoCancelacion = (MotivoCancelacion) Executions.getCurrent().getArg().get("motivoCancelacion"); + motivoCancelacionList = (MyListbox) Executions.getCurrent().getArg().get("motivoCancelacionList"); + + if (motivoCancelacion.getMotivocancelacionId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + if (motivoCancelacion.getMotivocancelacionId() <= 18) { + btnApagar.setVisible(false); + btnSalvar.setVisible(Boolean.FALSE); + txtNome.setDisabled(true); + + Messagebox.show( + Labels.getLabel("MSG.noEditabled"), + Labels.getLabel("editarMotivoCancelacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + cmbTipoMotivo.getValue(); + try { + motivoCancelacion.setActivo(true); + motivoCancelacion.setFecmodif(Calendar.getInstance().getTime()); + motivoCancelacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + if (motivoCancelacion.getTipomotivo() == null) { + Messagebox.show( + Labels.getLabel("editarMotivoCancelacionController.MSG.tipo"), + Labels.getLabel("editarMotivoCancelacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (motivoCancelacion.getMotivocancelacionId() == null) { + List lsMotivoCancelacion = + motivoCancelacionService.buscar(motivoCancelacion.getDescmotivo(), + motivoCancelacion.getTipomotivo()); + + if (lsMotivoCancelacion.isEmpty()) { + motivoCancelacionService.suscribir(motivoCancelacion); + motivoCancelacionList.addItem(motivoCancelacion); + + Messagebox.show( + Labels.getLabel("editarMotivoCancelacionController.MSG.suscribirOK"), + Labels.getLabel("editarMotivoCancelacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarMotivoCancelacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + motivoCancelacionService.actualizacion(motivoCancelacion); + motivoCancelacionList.updateItem(motivoCancelacion); + + Messagebox.show( + Labels.getLabel("editarMotivoCancelacionController.MSG.suscribirOK"), + Labels.getLabel("editarMotivoCancelacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + + closeWindow(); + } + } catch (Exception ex) { + log.error("editarMotivoCancelacionController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarMotivoCancelacionController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarMotivoCancelacionController.MSG.borrarPergunta"), + Labels.getLabel("editarMotivoCancelacionController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + motivoCancelacionService.borrar(motivoCancelacion); + + Messagebox.show( + Labels.getLabel("editarMotivoCancelacionController.MSG.borrarOK"), + Labels.getLabel("editarMotivoCancelacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + motivoCancelacionList.removeItem(motivoCancelacion); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public MotivoCancelacion getMotivoCancelacion() { + return motivoCancelacion; + } + + public void setMotivoCancelacion(MotivoCancelacion motivoCancelacion) { + this.motivoCancelacion = motivoCancelacion; + } + + public MyListbox getMotivoCancelacionList() { + return motivoCancelacionList; + } + + public void setMotivoCancelacionList(MyListbox motivoCancelacionList) { + this.motivoCancelacionList = motivoCancelacionList; + } + + public MotivoCancelacionService getMotivoCancelacionService() { + return motivoCancelacionService; + } + + public void setMotivoCancelacionService(MotivoCancelacionService motivoCancelacionService) { + this.motivoCancelacionService = motivoCancelacionService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarMotivoReimpresionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarMotivoReimpresionController.java new file mode 100644 index 000000000..d098b855a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarMotivoReimpresionController.java @@ -0,0 +1,179 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.MotivoReimpresion; +import com.rjconsultores.ventaboletos.service.MotivoReimpresionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; + +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarMotivoReimpresionController") +@Scope("prototype") +public class EditarMotivoReimpresionController extends MyGenericForwardComposer { + + @Autowired + private MotivoReimpresionService motivoReimpresionService; + private MotivoReimpresion motivoReimpresion; + private MyListbox motivoReimpresionList; + private static Logger log = Logger.getLogger(EditarMotivoReimpresionController.class); + private Textbox txtNome; + private Button btnApagar; + private Button btnSalvar; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + motivoReimpresion = (MotivoReimpresion) Executions.getCurrent().getArg().get("motivoReimpresion"); + motivoReimpresionList = (MyListbox) Executions.getCurrent().getArg().get("motivoReimpresionList"); + + if (motivoReimpresion.getMotivoreimpresionId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + if (motivoReimpresion.getMotivoreimpresionId() < 2) { + btnApagar.setVisible(Boolean.FALSE); + btnSalvar.setVisible(Boolean.FALSE); + txtNome.setDisabled(Boolean.TRUE); + + Messagebox.show( + Labels.getLabel("MSG.noEditabled"), + Labels.getLabel("editarMotivoReimpresionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + + try { + motivoReimpresion.setActivo(true); + motivoReimpresion.setFecmodif(Calendar.getInstance().getTime()); + motivoReimpresion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (motivoReimpresion.getMotivoreimpresionId() == null) { + List lsMotivoReimpresion = + motivoReimpresionService.buscar(motivoReimpresion.getDescmotivo()); + + if (lsMotivoReimpresion.isEmpty()) { + motivoReimpresionService.suscribir(motivoReimpresion); + motivoReimpresionList.addItem(motivoReimpresion); + + Messagebox.show( + Labels.getLabel("editarMotivoReimpresionController.MSG.suscribirOK"), + Labels.getLabel("editarMotivoReimpresionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarMotivoReimpresionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + motivoReimpresionService.actualizacion(motivoReimpresion); + motivoReimpresionList.updateItem(motivoReimpresion); + + Messagebox.show( + Labels.getLabel("editarMotivoReimpresionController.MSG.suscribirOK"), + Labels.getLabel("editarMotivoReimpresionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + + closeWindow(); + } catch (Exception ex) { + log.error("editarMotivoReimpresionController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarMotivoReimpresionController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarMotivoReimpresionController.MSG.borrarPergunta"), + Labels.getLabel("editarMotivoReimpresionController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + motivoReimpresionService.borrar(motivoReimpresion); + + Messagebox.show( + Labels.getLabel("editarMotivoReimpresionController.MSG.borrarOK"), + Labels.getLabel("editarMotivoReimpresionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + motivoReimpresionList.removeItem(motivoReimpresion); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public MotivoReimpresion getMotivoReimpresion() { + return motivoReimpresion; + } + + public void setMotivoReimpresion(MotivoReimpresion motivoReimpresion) { + this.motivoReimpresion = motivoReimpresion; + } + + public MyListbox getMotivoReimpresionList() { + return motivoReimpresionList; + } + + public void setMotivoReimpresionList(MyListbox motivoReimpresionList) { + this.motivoReimpresionList = motivoReimpresionList; + } + + public MotivoReimpresionService getMotivoReimpresionService() { + return motivoReimpresionService; + } + + public void setMotivoReimpresionService(MotivoReimpresionService motivoReimpresionService) { + this.motivoReimpresionService = motivoReimpresionService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarPeriodoVacacionalController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarPeriodoVacacionalController.java new file mode 100644 index 000000000..fc533add7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarPeriodoVacacionalController.java @@ -0,0 +1,203 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.PeriodoVacacional; +import com.rjconsultores.ventaboletos.service.PeriodoVacacionalService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Rafius + */ +@Controller("editarPeriodoVacacionalController") +@Scope("prototype") +public class EditarPeriodoVacacionalController extends MyGenericForwardComposer { + + @Autowired + private PeriodoVacacionalService periodoVacacionalService; + private PeriodoVacacional periodoVacacional; + private MyListbox periodoVacacionalList; + private static Logger log = Logger.getLogger(EditarPeriodoVacacionalController.class); + private Datebox fecInicio; + private Datebox fecFinal; + private Button btnApagar; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + periodoVacacional = (PeriodoVacacional) Executions.getCurrent().getArg().get("periodoVacacional"); + periodoVacacionalList = (MyListbox) Executions.getCurrent().getArg().get("periodoVacacionalList"); + + if (periodoVacacional.getPeriodovacacionalId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + fecInicio.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + Date dataInicio = fecInicio.getValue(); + Date dataFim = fecFinal.getValue(); + + if (fecInicio.getValue().after(fecFinal.getValue())) { + try { + Messagebox.show( + Labels.getLabel("editarPeriodoVacacionalController.MSG.busquedaPeriodo"), + Labels.getLabel("editarPeriodoVacacionalController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + log.error(ex); + } + } else { + try { + List lsPeriodoVacacional = + periodoVacacionalService.buscar(dataInicio, dataFim); + + List lsTraslapa = periodoVacacionalService.buscarFechaTraslapa(periodoVacacional); + Boolean podeSalvarTraslapa = lsTraslapa.isEmpty() ? true : false; + if (lsTraslapa.size() == 1) { + //Somente edição + if (periodoVacacional.getPeriodovacacionalId() != null) { + if (periodoVacacional.getPeriodovacacionalId().equals(lsTraslapa.get(0).getPeriodovacacionalId())) { + podeSalvarTraslapa = true; + } + } + } + //Se não pode salvar pq translapa + if (!podeSalvarTraslapa) { + Messagebox.show( + Labels.getLabel("editarPeriodoVacacionalController.MSG.conflitoVigencias"), + Labels.getLabel("editarPeriodoVacacionalController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + + if (lsPeriodoVacacional.isEmpty()) { + periodoVacacional.setActivo(Boolean.TRUE); + periodoVacacional.setFecmodif(Calendar.getInstance().getTime()); + periodoVacacional.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (periodoVacacional.getPeriodovacacionalId() == null) { + periodoVacacionalService.suscribir(periodoVacacional); + periodoVacacionalList.addItem(periodoVacacional); + } else { + periodoVacacionalService.actualizacion(periodoVacacional); + periodoVacacionalList.updateItem(periodoVacacional); + } + + Messagebox.show( + Labels.getLabel("editarPeriodoVacacionalController.MSG.suscribirOK"), + Labels.getLabel("editarPeriodoVacacionalController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPeriodoVacacionalController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error("editarPeriodoVacacionalController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPeriodoVacacionalController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarPeriodoVacacionalController.MSG.borrarPergunta"), + Labels.getLabel("editarPeriodoVacacionalController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + periodoVacacionalService.borrar(periodoVacacional); + + Messagebox.show( + Labels.getLabel("editarPeriodoVacacionalController.MSG.borrarOK"), + Labels.getLabel("editarPeriodoVacacionalController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + periodoVacacionalList.removeItem(periodoVacacional); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public PeriodoVacacional getPeriodoVacacional() { + return periodoVacacional; + } + + public void setPeriodoVacacional(PeriodoVacacional periodoVacacional) { + this.periodoVacacional = periodoVacacional; + } + + public MyListbox getPeriodoVacacionalList() { + return periodoVacacionalList; + } + + public void setPeriodoVacacionalList(MyListbox periodoVacacionalList) { + this.periodoVacacionalList = periodoVacacionalList; + } + + public PeriodoVacacionalService getPeriodoVacacionalService() { + return periodoVacacionalService; + } + + public void setPeriodoVacacionalService(PeriodoVacacionalService periodoVacacionalService) { + this.periodoVacacionalService = periodoVacacionalService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarRestriccionFormaPagoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarRestriccionFormaPagoController.java new file mode 100644 index 000000000..2e045e96b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarRestriccionFormaPagoController.java @@ -0,0 +1,221 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago; +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.entidad.RestriccionPago; +import com.rjconsultores.ventaboletos.service.ConfigRestriccionPagoService; +import com.rjconsultores.ventaboletos.service.FormaPagoService; +import com.rjconsultores.ventaboletos.service.RestriccionPagoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; + +/** + * + * @author Administrador + */ +@Controller("editarRestriccionFormaPagoController") +@Scope("prototype") +public class EditarRestriccionFormaPagoController extends MyGenericForwardComposer { + + @Autowired + private FormaPagoService formaPagoService; + @Autowired + private RestriccionPagoService restriccionPagoService; + @Autowired + private ConfigRestriccionPagoService configRestriccionPagoService; + private ConfigRestriccionPago configRestriccionPago; + private MyListbox restriccionFormaPagoList; + private List lsFormaPago; + private List lsRestriccionPago; + private Combobox cmbFormaPago; + private Combobox cmbRestriccionFormaPago; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarRestriccionFormaPagoController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public FormaPagoService getFormaPagoService() { + return formaPagoService; + } + + public void setFormaPagoService(FormaPagoService formaPagoService) { + this.formaPagoService = formaPagoService; + } + + public List getLsFormaPago() { + return lsFormaPago; + } + + public void setLsFormaPago(List lsFormaPago) { + this.lsFormaPago = lsFormaPago; + } + + public List getLsRestriccionPago() { + return lsRestriccionPago; + } + + public void setLsRestriccionPago(List lsRestriccionPago) { + this.lsRestriccionPago = lsRestriccionPago; + } + + public ConfigRestriccionPago getConfigRestriccionPago() { + return configRestriccionPago; + } + + public void setConfigRestriccionPago(ConfigRestriccionPago configRestriccionPago) { + this.configRestriccionPago = configRestriccionPago; + } + + public Combobox getCmbFormaPago() { + return cmbFormaPago; + } + + public void setCmbFormaPago(Combobox cmbFormaPago) { + this.cmbFormaPago = cmbFormaPago; + } + + public Combobox getCmbRestriccionFormaPago() { + return cmbRestriccionFormaPago; + } + + public void setCmbRestriccionFormaPago(Combobox cmbRestriccionFormaPago) { + this.cmbRestriccionFormaPago = cmbRestriccionFormaPago; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsFormaPago = formaPagoService.obtenerTodos(); + lsRestriccionPago = restriccionPagoService.obtenerTodos(); + + super.doAfterCompose(comp); + + configRestriccionPago = (ConfigRestriccionPago) Executions.getCurrent().getArg().get("configRestriccionPago"); + restriccionFormaPagoList = (MyListbox) Executions.getCurrent().getArg().get("configRestriccionFormaPagoList"); + + if (configRestriccionPago.getConfigrestriccionId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + cmbFormaPago.focus(); + } + + public void onClick$btnSalvar(Event ev) { + cmbFormaPago.getValue(); + cmbRestriccionFormaPago.getValue(); + + + try { + boolean puedoDarDeAlta = configRestriccionPagoService.puedoDarDeAlta(configRestriccionPago); + + List lsConfig = configRestriccionPagoService.buscar(configRestriccionPago.getFormaPago(), configRestriccionPago.getRestriccion()); + + boolean podeSalvar = false; + if (lsConfig.isEmpty()) { + podeSalvar = true; + } else { + for (ConfigRestriccionPago m : lsConfig) { + if (m.getConfigrestriccionId().equals(configRestriccionPago.getConfigrestriccionId())) { + podeSalvar = true; + } + } + } + + if (!puedoDarDeAlta) { + + Integer idRestricion = (configRestriccionPago.getRestriccion().getRestriccionId() == 1) + ? 4 + : (configRestriccionPago.getRestriccion().getRestriccionId() == 2) + ? 5 + : (configRestriccionPago.getRestriccion().getRestriccionId() == 3) + ? 6 : 0; + RestriccionPago restriContraria = restriccionPagoService.obtenerID(idRestricion.shortValue()); + String msg = ""; + if (restriContraria != null) { + msg = restriContraria.getDescrestriccion(); + } + + Messagebox.show( + Labels.getLabel("editarRestriccionFormaPagoController.MSG.puedoDarDeAlta", new Object[]{msg}), + Labels.getLabel("editarRestriccionFormaPagoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + if (podeSalvar) { + configRestriccionPago.setActivo(Boolean.TRUE); + configRestriccionPago.setFecmodif(Calendar.getInstance().getTime()); + configRestriccionPago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (configRestriccionPago.getConfigrestriccionId() == null) { + configRestriccionPagoService.suscribir(configRestriccionPago); + restriccionFormaPagoList.addItem(configRestriccionPago); + } else { + configRestriccionPagoService.actualizacion(configRestriccionPago); + restriccionFormaPagoList.updateItem(configRestriccionPago); + } + + Messagebox.show( + Labels.getLabel("editarRestriccionFormaPagoController.MSG.suscribirOK"), + Labels.getLabel("editarRestriccionFormaPagoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarRestriccionFormaPagoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarRestriccionFormaPagoController.MSG.borrarPergunta"), + Labels.getLabel("editarRestriccionFormaPagoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + configRestriccionPagoService.borrar(configRestriccionPago); + + Messagebox.show( + Labels.getLabel("editarRestriccionFormaPagoController.MSG.borrarOK"), + Labels.getLabel("editarRestriccionFormaPagoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + restriccionFormaPagoList.removeItem(configRestriccionPago); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarSecretariaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarSecretariaController.java new file mode 100644 index 000000000..c36e254e1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarSecretariaController.java @@ -0,0 +1,472 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Longbox; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.CuponSecretaria; +import com.rjconsultores.ventaboletos.entidad.Secretaria; +import com.rjconsultores.ventaboletos.service.CuponSecretariaService; +import com.rjconsultores.ventaboletos.service.SecretariaService; +import com.rjconsultores.ventaboletos.utilerias.TraslaparUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCuponSecretaria; + +/** + * + * @author Administrador + */ +@Controller("editarSecretariaController") +@Scope("prototype") +public class EditarSecretariaController extends MyGenericForwardComposer { + + @Autowired + private SecretariaService secretariaService; + private CuponSecretariaService cuponSecretariaService; + private Secretaria secretaria; + private List lsCuponSecretaria; + private MyListbox secretariaList; + private MyListbox cuponSecretariaList; + private Textbox txtDescSecretaria; + private Textbox txtCveSecretaria; + private MyTextboxDecimal txtPorcdescuento; + private Longbox txtNumfolioinicio; + private Longbox txtNumfoliofinal; + private Button btnApagar; + private Button btnAdicionarCuponSecretaria; + private Radio rdPrecioTotal; + private Radio rdPrecioDescuento; + private Radio rdDescuento; + private Checkbox chkValidaFolio; + private static Logger log = Logger.getLogger(EditarSecretariaController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Checkbox getChkValidaFolio() { + return chkValidaFolio; + } + + public void setChkValidaFolio(Checkbox chkValidaFolio) { + this.chkValidaFolio = chkValidaFolio; + } + + public MyListbox getCuponSecretariaList() { + return cuponSecretariaList; + } + + public void setCuponSecretariaList(MyListbox cuponSecretariaList) { + this.cuponSecretariaList = cuponSecretariaList; + } + + public Radio getRdDescuento() { + return rdDescuento; + } + + public void setRdDescuento(Radio rdDescuento) { + this.rdDescuento = rdDescuento; + } + + public Radio getRdPrecioDescuento() { + return rdPrecioDescuento; + } + + public void setRdPrecioDescuento(Radio rdPrecioDescuento) { + this.rdPrecioDescuento = rdPrecioDescuento; + } + + public Radio getRdPrecioTotal() { + return rdPrecioTotal; + } + + public void setRdPrecioTotal(Radio rdPrecioTotal) { + this.rdPrecioTotal = rdPrecioTotal; + } + + public Secretaria getSecretaria() { + return secretaria; + } + + public void setSecretaria(Secretaria secretaria) { + this.secretaria = secretaria; + } + + public Textbox getTxtCveSecretaria() { + return txtCveSecretaria; + } + + public void setTxtCveSecretaria(Textbox txtCveSecretaria) { + this.txtCveSecretaria = txtCveSecretaria; + } + + public Textbox getTxtDescSecretaria() { + return txtDescSecretaria; + } + + public void setTxtDescSecretaria(Textbox txtDescSecretaria) { + this.txtDescSecretaria = txtDescSecretaria; + } + + public Longbox getTxtNumfoliofinal() { + return txtNumfoliofinal; + } + + public void setTxtNumfoliofinal(Longbox txtNumfoliofinal) { + this.txtNumfoliofinal = txtNumfoliofinal; + } + + public Longbox getTxtNumfolioinicio() { + return txtNumfolioinicio; + } + + public void setTxtNumfolioinicio(Longbox txtNumfolioinicio) { + this.txtNumfolioinicio = txtNumfolioinicio; + } + + + public Button getBtnAdicionarCuponSecretaria() { + return btnAdicionarCuponSecretaria; + } + + public void setBtnAdicionarCuponSecretaria(Button btnAdicionarCuponSecretaria) { + this.btnAdicionarCuponSecretaria = btnAdicionarCuponSecretaria; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + secretaria = + (Secretaria) Executions.getCurrent().getArg().get("secretaria"); + secretariaList = + (MyListbox) Executions.getCurrent().getArg().get("secretariaList"); + + cuponSecretariaList.setItemRenderer(new RenderCuponSecretaria()); + lsCuponSecretaria = new ArrayList(); + cuponSecretariaList.setData(lsCuponSecretaria); + + if (secretaria.getSecretariaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + secretaria = secretariaService.obtenerID(secretaria.getSecretariaId()); + if (secretaria.getImprimeprecio().equals(Secretaria.DESCUENTO_COBRAR)) { + rdDescuento.setChecked(Boolean.TRUE); + } else if (secretaria.getImprimeprecio().equals(Secretaria.PRECIO_MENOS_DESCUENTO)) { + rdPrecioDescuento.setChecked(Boolean.TRUE); + } else if (secretaria.getImprimeprecio().equals(Secretaria.PRECIO_TOTAL)) { + rdPrecioTotal.setChecked(Boolean.TRUE); + } + + chkValidaFolio.setChecked(secretaria.getValidafolio()); + chkValidaFolio.setDisabled(Boolean.TRUE); + + onClick$chkValidaFolio(null); + + lsCuponSecretaria = secretaria.getLsCuponSecretaria(); + cuponSecretariaList.setData(lsCuponSecretaria); + + } + + txtDescSecretaria.focus(); + } + + public void onClick$chkValidaFolio(Event ev) { + if (chkValidaFolio.isChecked()) { + txtNumfolioinicio.setDisabled(Boolean.FALSE); + txtNumfoliofinal.setDisabled(Boolean.FALSE); + } else { + txtNumfolioinicio.setValue(null); + txtNumfoliofinal.setValue(null); + + txtNumfolioinicio.setDisabled(Boolean.TRUE); + txtNumfoliofinal.setDisabled(Boolean.TRUE); + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtDescSecretaria.getValue(); + txtCveSecretaria.getValue(); + + try { + + if (lsCuponSecretaria.isEmpty()) { + Messagebox.show( + Labels.getLabel("editarSecretariaController.MSG.necessaitaPorcentaje.value"), + Labels.getLabel("editarSecretariaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + secretaria.setActivo(true); + secretaria.setFecmodif(Calendar.getInstance().getTime()); + secretaria.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + secretaria.setLsCuponSecretaria(lsCuponSecretaria); + secretaria.setValidafolio(chkValidaFolio.isChecked()); + + if (rdDescuento.isChecked()) { + secretaria.setImprimeprecio(Secretaria.DESCUENTO_COBRAR); + } else if (rdPrecioDescuento.isChecked()) { + secretaria.setImprimeprecio(Secretaria.PRECIO_MENOS_DESCUENTO); + } else if (rdPrecioTotal.isChecked()) { + secretaria.setImprimeprecio(Secretaria.PRECIO_TOTAL); + } + + boolean podeSalvar = false; + List lsSecretaria = secretariaService.buscar(secretaria.getDescsecretaria()); + + if (lsSecretaria.isEmpty()) { + podeSalvar = true; + } else { + for (Secretaria s : lsSecretaria) { + if (s.getSecretariaId().equals(secretaria.getSecretariaId())) { + podeSalvar = true; + } + } + } + + if (podeSalvar) { + if (secretaria.getSecretariaId() == null) { + secretariaService.suscribir(secretaria); + secretariaList.addItem(secretaria); + } else { + secretariaService.actualizacion(secretaria); + secretariaList.updateItem(secretaria); + } + Messagebox.show( + Labels.getLabel("editarSecretariaController.MSG.suscribirOK"), + Labels.getLabel("editarSecretariaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + + } else { + + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarSecretariaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarSecretariaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + + } + } + + public void onClick$btnApagar(Event ev) throws InterruptedException { + try { + int resp = Messagebox.show( + Labels.getLabel("editarSecretariaController.MSG.borrarPergunta"), + Labels.getLabel("editarSecretariaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + secretariaService.borrar(secretaria); + + Messagebox.show( + Labels.getLabel("editarSecretariaController.MSG.borrarOK"), + Labels.getLabel("editarSecretariaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + secretariaList.removeItem(secretaria); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarSecretariaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnAdicionarCuponSecretaria(Event ev) throws InterruptedException { + txtPorcdescuento.setConstraint("no empty"); + txtPorcdescuento.getValue(); + + if (txtPorcdescuento.getValueDecimal().compareTo(new BigDecimal("100")) > 0) { + Clients.wrongValue(txtPorcdescuento, Labels.getLabel("MSG.Porcentaje")); + return; + } + if (chkValidaFolio.isChecked()) { + txtNumfolioinicio.setConstraint("no empty, no negative, no zero"); + txtNumfoliofinal.setConstraint("no empty, no negative, no zero"); + + txtNumfolioinicio.getValue(); + txtNumfoliofinal.getValue(); + } + + try { + BigDecimal porcdescuento = BigDecimal.valueOf(Double.parseDouble(txtPorcdescuento.getValue())); + Long numfolioinicio = txtNumfolioinicio.getValue(); + Long numfoliofinal = txtNumfoliofinal.getValue(); + + if (chkValidaFolio.isChecked() && (numfolioinicio > numfoliofinal)) { + Messagebox.show( + Labels.getLabel("MSG.Folios"), + Labels.getLabel("editarSecretariaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + Boolean achou = Boolean.FALSE; + for (CuponSecretaria cds : secretaria.getLsCuponSecretaria()) { + if (cds.getNumfoliofinal() != null + && cds.getNumfolioinicio() != null) { + if (cds.getNumfoliofinal().equals(numfoliofinal) + && cds.getNumfolioinicio().equals(numfolioinicio) + && cds.getPorcdescuento().equals(porcdescuento)) { + achou = Boolean.TRUE; + } + } + } + + if (!achou) { + CuponSecretaria cd = new CuponSecretaria(); + cd.setActivo(Boolean.TRUE); + cd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cd.setFecmodif(Calendar.getInstance().getTime()); + cd.setPorcdescuento(porcdescuento); + cd.setNumfolioinicio(numfolioinicio); + cd.setNumfoliofinal(numfoliofinal); + + if (chkValidaFolio.isChecked()) { + int resp = registroDuplicado(numfolioinicio, numfoliofinal); + + if (resp != 0) { + Messagebox.show( + (resp == 1) ? Labels.getLabel("MSG.Registro.Existe") : Labels.getLabel("editarSecretariaController.MSG.registroTraslapado"), + Labels.getLabel("editarSecretariaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + } else { + if (lsCuponSecretaria.size() >= 1) { + Messagebox.show( + Labels.getLabel("editarSecretariaController.MSG.pocentaje"), + Labels.getLabel("editarSecretariaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + } + + lsCuponSecretaria.add(cd); + cuponSecretariaList.setData(lsCuponSecretaria); + secretaria.setLsCuponSecretaria(lsCuponSecretaria); + + chkValidaFolio.setDisabled(Boolean.TRUE); + + txtPorcdescuento.setConstraint(""); + txtNumfolioinicio.setConstraint(""); + txtNumfoliofinal.setConstraint(""); + + txtPorcdescuento.setText(null); + txtNumfolioinicio.setValue(null); + txtNumfoliofinal.setValue(null); + + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarSecretariaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarSecretariaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + /** + * + * @return + * 0 - Esta ok + * 1 - Registro duplicado + * 2 - Registro traslapado + * @throws InterruptedException + */ + private int registroDuplicado(Long folioIni, Long folioFin) throws InterruptedException { + Collections.sort(lsCuponSecretaria, new Comparator() { + + public int compare(CuponSecretaria o1, CuponSecretaria o2) { + return o1.getNumfolioinicio().compareTo(o2.getNumfoliofinal()); + } + }); + + for (CuponSecretaria pv : lsCuponSecretaria) { + if (!pv.getActivo()) { + continue; + } + + if (TraslaparUtil.intersectNum(pv.getNumfolioinicio().longValue(), pv.getNumfoliofinal().longValue(), + folioIni, folioFin)) { + return 2; + } + } + + return 0; + } + + public void onClick$btnRemoverCuponSecretaria(Event ev) { + CuponSecretaria cd = (CuponSecretaria) cuponSecretariaList.getSelected(); + if (cd != null) { + cd.setActivo(Boolean.FALSE); + cd.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cd.setFecmodif(Calendar.getInstance().getTime()); + + if (cd.getCuponsecretariaId() != null) { + cuponSecretariaService.borrar(cd); + } + + lsCuponSecretaria.remove(cd); + + if (lsCuponSecretaria.isEmpty()) { + btnAdicionarCuponSecretaria.setDisabled(Boolean.FALSE); + chkValidaFolio.setDisabled(Boolean.FALSE); + } + + cuponSecretariaList.setData(lsCuponSecretaria); + secretaria.setLsCuponSecretaria(lsCuponSecretaria); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarTipoCambioCiudadController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarTipoCambioCiudadController.java new file mode 100644 index 000000000..cc8253d92 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarTipoCambioCiudadController.java @@ -0,0 +1,221 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.TipoCambioCiudad; +import com.rjconsultores.ventaboletos.entidad.TipoCambioCtrl; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.service.TipoCambioCiudadService; +import com.rjconsultores.ventaboletos.service.TipoCambioCtrlService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxCiudad; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Administrador + * + * Rafael: Nessa tela foi retirada a opção de adicionar varias cidades. + * Senda + */ +@Controller("editarTipoCambioCiudadController") +@Scope("prototype") +public class EditarTipoCambioCiudadController extends MyGenericForwardComposer { + + @Autowired + private TipoCambioCtrlService tipoCambioCtrlService; + @Autowired + private TipoCambioCiudadService tipoCambioCiudadService; + @Autowired + private MonedaService monedaService; + private Ciudad ciudadSeleccionada; + private MyComboboxCiudad cmbCiudad; + private TipoCambioCtrl tipoCambioCtrl; + private MyListbox tipoCambioCiudadList; + private List lsTipoCambioCiudad; + private List lsMoneda; + private Button btnApagar; + private Datebox dtFecaplicacion; + private Combobox cmbMonedaOrigen; + private Combobox cmbMonedaDestino; + private MyTextboxDecimal decImportecambio; + private static Logger log = Logger.getLogger(EditarTipoCambioCiudadController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Combobox getCmbCiudad() { + return cmbCiudad; + } + + public TipoCambioCtrl getTipoCambioCtrl() { + return tipoCambioCtrl; + } + + public void setTipoCambioCtrl(TipoCambioCtrl tipoCambioCtrl) { + this.tipoCambioCtrl = tipoCambioCtrl; + } + + public List getLsMoneda() { + return lsMoneda; + } + + public void setLsMoneda(List lsMoneda) { + this.lsMoneda = lsMoneda; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + lsTipoCambioCiudad = new ArrayList(); + lsMoneda = monedaService.obtenerTodos(); + + tipoCambioCtrl = (TipoCambioCtrl) Executions.getCurrent().getArg().get("tipoCambioCtrl"); + tipoCambioCiudadList = (MyListbox) Executions.getCurrent().getArg().get("tipoCambioCiudadList"); + + if (tipoCambioCtrl.getTipocambioctrlId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + tipoCambioCtrl = tipoCambioCtrlService.obtenerID(tipoCambioCtrl.getTipocambioctrlId()); + lsTipoCambioCiudad.addAll(tipoCambioCtrl.getTipoCambioCiudadList()); + + decImportecambio.setValue(tipoCambioCtrl.getImportecambio().setScale(2).toString()); + + if (lsTipoCambioCiudad.size() > 0) { + ciudadSeleccionada = lsTipoCambioCiudad.get(0).getCiudad(); + } + } + + dtFecaplicacion.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + dtFecaplicacion.getValue(); + cmbMonedaOrigen.getValue(); + cmbMonedaDestino.getValue(); + cmbCiudad.getValue(); + decImportecambio.getValue(); + + try { + + if (cmbCiudad.getSelectedItem() != null) { + lsTipoCambioCiudad = new ArrayList(); + TipoCambioCiudad tc = new TipoCambioCiudad(); + tc.setActivo(Boolean.TRUE); + tc.setFecmodif(Calendar.getInstance().getTime()); + tc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tc.setTipoCambioCtrl(tipoCambioCtrl); + tc.setCiudad((Ciudad) cmbCiudad.getSelectedItem().getValue()); + lsTipoCambioCiudad.add(tc); + } else { + Messagebox.show( + Labels.getLabel("editarTipoCambioCiudadController.MSG.necessitaCiudad"), + Labels.getLabel("editarTipoCambioCiudadController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return; + } + + if (lsTipoCambioCiudad.isEmpty()) { + Messagebox.show( + Labels.getLabel("editarTipoCambioCiudadController.MSG.necessitaCiudad"), + Labels.getLabel("editarTipoCambioCiudadController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return; + } + if (cmbMonedaOrigen.getValue().equals(cmbMonedaDestino.getValue())) { + Messagebox.show( + Labels.getLabel("editarTipoCambioCiudadController.MSG.diferenteMoneda"), + Labels.getLabel("editarTipoCambioCiudadController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return; + } + + tipoCambioCtrl.setActivo(Boolean.TRUE); + tipoCambioCtrl.setFecmodif(Calendar.getInstance().getTime()); + tipoCambioCtrl.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tipoCambioCtrl.setTipoCambioCiudadList(lsTipoCambioCiudad); + + if (tipoCambioCtrl.getTipocambioctrlId() == null) { + tipoCambioCtrlService.suscribir(tipoCambioCtrl); + tipoCambioCiudadList.addItem(tipoCambioCtrl); + } else { + tipoCambioCtrlService.actualizacion(tipoCambioCtrl); + tipoCambioCiudadList.updateItem(tipoCambioCtrl); + } + + Messagebox.show( + Labels.getLabel("editarTipoCambioCiudadController.MSG.suscribirOK"), + Labels.getLabel("editarTipoCambioCiudadController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } catch (Exception ex) { + log.error("editarTipoCambioCiudadController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoCambioCiudadController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTipoCambioCiudadController.MSG.borrarPergunta"), + Labels.getLabel("editarTipoCambioCiudadController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + tipoCambioCtrlService.borrar(tipoCambioCtrl); + + Messagebox.show( + Labels.getLabel("editarTipoCambioCiudadController.MSG.borrarOK"), + Labels.getLabel("editarTipoCambioCiudadController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tipoCambioCiudadList.removeItem(tipoCambioCtrl); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public Ciudad getCiudadSeleccionada() { + return ciudadSeleccionada; + } + + public void setCiudadSeleccionada(Ciudad ciudadSeleccionada) { + this.ciudadSeleccionada = ciudadSeleccionada; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/BusquedaProductoServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/BusquedaProductoServicioController.java new file mode 100644 index 000000000..e196affab --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/BusquedaProductoServicioController.java @@ -0,0 +1,198 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.cyberviaje; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +import com.rjconsultores.ventaboletos.entidad.ProdMarca; +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.ProductoServicioService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaProductoServicioController") +@Scope("prototype") +public class BusquedaProductoServicioController extends MyGenericForwardComposer + implements ListitemRenderer { + + @Autowired + private transient PagedListWrapper plwProductoServicio; + @Autowired + private ProductoServicioService productoServicioService; + @Autowired + private EmpresaService empresaService; + private MyListbox productoServicioList; + private Paging pagingProductoServicio; + private List lsProductoServicio; + private Textbox txtNome; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + super.doAfterCompose(comp); + + productoServicioList.setItemRenderer(this); + productoServicioList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ProductoServicio productoServicio = (ProductoServicio) productoServicioList.getSelected(); + verProductoServicio(productoServicio); + } + }); + + lsProductoServicio = new ArrayList(); + + refreshLista(); + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verProductoServicio(new ProductoServicio()); + } + + private void refreshLista() { + HibernateSearchObject productoServicioSearch = + new HibernateSearchObject(ProductoServicio.class, pagingProductoServicio.getPageSize()); + + if (!txtNome.getValue().equals("")) { + productoServicioSearch.addFilterILike("descproductoservicio", "%" + txtNome.getValue() + "%"); + } + + productoServicioSearch.addFilterEqual("activo", Boolean.TRUE); + + productoServicioSearch.addFilterEqual("indtipo", "S"); + + productoServicioSearch.addSortAsc("descproductoservicio"); + + plwProductoServicio.init(productoServicioSearch, productoServicioList, pagingProductoServicio); + + if (productoServicioList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaProductoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + private void verProductoServicio(ProductoServicio productoServicio) { + if (productoServicio == null) { + return; + } + + Map args = new HashMap(); + args.put("productoServicio", productoServicio); + args.put("productoServicioList", productoServicioList); + + openWindow("/gui/configuraciones_comerciales/cyberviaje/editarProductoServicio.zul", + Labels.getLabel("editarProductoServicioController.window.title"), args, MODAL); + } + + public List getLsProductoServicio() { + return lsProductoServicio; + } + + public void setLsProductoServicio(List lsProductoServicio) { + this.lsProductoServicio = lsProductoServicio; + } + + public Paging getPagingProductoServicio() { + return pagingProductoServicio; + } + + public void setPagingProductoServicio(Paging pagingProductoServicio) { + this.pagingProductoServicio = pagingProductoServicio; + } + + public PagedListWrapper getPlwProductoServicioPunto() { + return plwProductoServicio; + } + + public void setPlwProductoServicioPunto(PagedListWrapper plwProductoServicioPunto) { + this.plwProductoServicio = plwProductoServicioPunto; + } + + public MyListbox getProductoServicioList() { + return productoServicioList; + } + + public void setProductoServicioList(MyListbox productoServicioList) { + this.productoServicioList = productoServicioList; + } + + public ProductoServicioService getProductoServicioService() { + return productoServicioService; + } + + public void setProductoServicioService(ProductoServicioService productoServicioService) { + this.productoServicioService = productoServicioService; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public void render(Listitem lstm, Object o) throws Exception { + ProductoServicio p = (ProductoServicio) o; + p = productoServicioService.obtenerID(p.getProductoservicioId()); + + Listcell lc = new Listcell(); + + lc = new Listcell(p.getProductoservicioId().toString()); + lc.setParent(lstm); + + if (p.getDescproductoservicio() != null) { + lc = new Listcell(p.getDescproductoservicio()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", p); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdClaseServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdClaseServicioController.java new file mode 100644 index 000000000..764ad064a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdClaseServicioController.java @@ -0,0 +1,177 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.cyberviaje; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.ProdClaseServicio; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.ProdClaseServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Administrador + */ +@Controller("editarProdClaseServicioController") +@Scope("prototype") +public class EditarProdClaseServicioController extends MyGenericForwardComposer { + + @Autowired + private ProdClaseServicioService prodClaseServicioService; + @Autowired + private ClaseServicioService claseServicioService; + private List lsClaseServicio; + private MyListbox prodClaseServicioList; + private Combobox cmbClaseServicio; + private ProdClaseServicio prodClaseServicio; + private List lsProdClaseServicio; + private static Logger log = Logger.getLogger(EditarProdClaseServicioController.class); + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + public ProdClaseServicio getProdClaseServicio() { + return prodClaseServicio; + } + + public void setProdClaseServicio(ProdClaseServicio prodClaseServicio) { + this.prodClaseServicio = prodClaseServicio; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsClaseServicio = claseServicioService.obtenerTodos(); + lsProdClaseServicio = (List) Executions.getCurrent().getArg().get("lsProdClaseServicio"); + prodClaseServicio = (ProdClaseServicio) Executions.getCurrent().getArg().get("prodClaseServicio"); + prodClaseServicioList = (MyListbox) Executions.getCurrent().getArg().get("prodClaseServicioList"); + + super.doAfterCompose(comp); + } + + public void onClick$btnAdicionar(Event ev) throws Exception { + + cmbClaseServicio.getValue(); + + try { + + if (prodClaseServicio.getClaseServicio() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarProductoServicioController.windowProdClaseServicio.title"), + Messagebox.OK, Messagebox.ERROR); + return; + } + + if (prodClaseServicio.getProdclaseservicioId() != null) { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProductoServicioController.windowProdClaseServicio.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + prodClaseServicioService.actualizacion(prodClaseServicio); + prodClaseServicioList.updateItem(prodClaseServicio); + lsProdClaseServicio.add(prodClaseServicio); + } else { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProductoServicioController.windowProdClaseServicio.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + prodClaseServicioService.suscribir(prodClaseServicio); + prodClaseServicioList.addItem(prodClaseServicio); + lsProdClaseServicio.add(prodClaseServicio); + } + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } + + private boolean registroDuplicado() throws InterruptedException { + for (ProdClaseServicio p : lsProdClaseServicio) { + if (!p.getActivo()){ + continue; + } + if (p.getClaseServicio().getDescclase().equals(prodClaseServicio.getClaseServicio().getDescclase())) { + return true; + } + } + return false; + } + + public void onClick$btnRemover(Event ev) { + try { + Integer resp = Messagebox.show( + Labels.getLabel("editarProdClaseServicioController.MSG.borrarPergunta"), + Labels.getLabel("editarProductoServicioController.windowProdClaseServicio.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp.equals(Messagebox.YES)) { + prodClaseServicio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + prodClaseServicio.setFecmodif(Calendar.getInstance().getTime()); + prodClaseServicio.setActivo(Boolean.FALSE); + + prodClaseServicioList.removeItem(prodClaseServicio); + prodClaseServicioService.borrar(prodClaseServicio); + + Messagebox.show( + Labels.getLabel("editarProdClaseServicioController.MSG.borrarSucesso"), + Labels.getLabel("editarProductoServicioController.windowProdClaseServicio.title"), + Messagebox.YES, Messagebox.EXCLAMATION); + + closeWindow(); + } + + } catch (Exception ex) { + log.error(ex); + } + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + /** + * @return the lsProdClaseServicio + */ + public List getLsProdClaseServicio() { + return lsProdClaseServicio; + } + + /** + * @param lsProdClaseServicio the lsProdClaseServicio to set + */ + public void setLsProdClaseServicio(List lsProdClaseServicio) { + this.lsProdClaseServicio = lsProdClaseServicio; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdFormaPagoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdFormaPagoController.java new file mode 100644 index 000000000..e0c0d91ca --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdFormaPagoController.java @@ -0,0 +1,167 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.cyberviaje; + +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.entidad.ProdFormaPago; +import com.rjconsultores.ventaboletos.service.FormaPagoService; +import com.rjconsultores.ventaboletos.service.ProdFormaPagoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author Administrador + */ +@Controller("editarProdFormaPagoController") +@Scope("prototype") +public class EditarProdFormaPagoController extends MyGenericForwardComposer { + + @Autowired + private ProdFormaPagoService prodFormaPagoService; + @Autowired + private FormaPagoService formaPagoService; + private List lsFormaPago; + private MyListbox prodFormaPagoList; + private Combobox cmbProdFormaPago; + private ProdFormaPago prodFormaPago; + private List lsProdFormaPago; + private static Logger log = Logger.getLogger(EditarProdFormaPagoController.class); + + public List getLsFormaPago() { + return lsFormaPago; + } + + public void setLsFormaPago(List lsFormaPago) { + this.lsFormaPago = lsFormaPago; + } + + public ProdFormaPago getProdFormaPago() { + return prodFormaPago; + } + + public void setProdFormaPago(ProdFormaPago prodFormaPago) { + this.prodFormaPago = prodFormaPago; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsFormaPago = formaPagoService.buscarFormasPagoExceptoEspeciales(); + lsProdFormaPago = (List) Executions.getCurrent().getArg().get("lsProdFormaPago"); + prodFormaPago = (ProdFormaPago) Executions.getCurrent().getArg().get("prodFormaPago"); + prodFormaPagoList = (MyListbox) Executions.getCurrent().getArg().get("prodFormaPagoList"); + + super.doAfterCompose(comp); + } + + public void onClick$btnAdicionar(Event ev) throws Exception { + cmbProdFormaPago.getValue(); + try { + + if (prodFormaPago.getFormaPago() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarProdFormaPagoController.winEditarProdFormaPago.title"), + Messagebox.OK, Messagebox.ERROR); + return; + } + + if (prodFormaPago.getProdformapagoId() != null) { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProdFormaPagoController.winEditarProdFormaPago.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + prodFormaPagoService.actualizacion(prodFormaPago); + lsProdFormaPago.add(prodFormaPago); + prodFormaPagoList.updateItem(prodFormaPago); + } else { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProdFormaPagoController.winEditarProdFormaPago.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + prodFormaPagoService.suscribir(prodFormaPago); + lsProdFormaPago.add(prodFormaPago); + prodFormaPagoList.addItem(prodFormaPago); + } + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } + + private boolean registroDuplicado() throws InterruptedException { + for (ProdFormaPago p : lsProdFormaPago) { + if (!p.getActivo()){ + continue; + } + if (p.getFormaPago().getDescpago().equals(prodFormaPago.getFormaPago().getDescpago())) { + return true; + } + } + return false; + } + + public void onClick$btnRemover(Event ev) { + try { + Integer resp = Messagebox.show( + Labels.getLabel("editarProdFormaPagoController.MSG.borrarPergunta"), + Labels.getLabel("editarProdFormaPagoController.winEditarProdFormaPago.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp.equals(Messagebox.YES)) { + prodFormaPago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + prodFormaPago.setFecmodif(Calendar.getInstance().getTime()); + prodFormaPago.setActivo(Boolean.FALSE); + + prodFormaPagoList.removeItem(prodFormaPago); + prodFormaPagoService.borrar(prodFormaPago); + + Messagebox.show( + Labels.getLabel("editarProdFormaPagoController.MSG.borrarSucesso"), + Labels.getLabel("editarProdFormaPagoController.winEditarProdFormaPago.title"), + Messagebox.YES, Messagebox.EXCLAMATION); + + closeWindow(); + } + + } catch (Exception ex) { + log.error(ex); + } + } + + /** + * @return the lsProdFormaPago + */ + public List getLsProdFormaPago() { + return lsProdFormaPago; + } + + /** + * @param lsProdFormaPago the lsProdFormaPago to set + */ + public void setLsProdFormaPago(List lsProdFormaPago) { + this.lsProdFormaPago = lsProdFormaPago; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdMarcaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdMarcaController.java new file mode 100644 index 000000000..39afa41c2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdMarcaController.java @@ -0,0 +1,302 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.cyberviaje; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Combobox; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.ProdMarca; +import com.rjconsultores.ventaboletos.entidad.ProdPrecio; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.ProdMarcaService; +import com.rjconsultores.ventaboletos.service.ProdPrecioService; +import com.rjconsultores.ventaboletos.utilerias.TraslaparUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCyberViajeProdPrecio; + +/** + * + * @author Administrador + */ +@Controller("editarProdMarcaController") +@Scope("prototype") +public class EditarProdMarcaController extends MyGenericForwardComposer { + + @Autowired + private ProdMarcaService prodMarcaService; + @Autowired + private MarcaService marcaService; + @Autowired + private ProdPrecioService prodPrecioService; + private List lsMarca; + private MyListbox prodMarcaList; + private ProdMarca prodMarca; + private Combobox cmbProdMarca; + private List lsProdMarca; + private MyListbox prodPrecioList; + private List lsProdPrecio; + private MyTextboxDecimal txtImporteInicial; + private MyTextboxDecimal txtImporteFinal; + private MyTextboxDecimal tarifa; + private static Logger log = Logger.getLogger(EditarProdMarcaController.class); + + public List getLsMarca() { + return lsMarca; + } + + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + public ProdMarca getProdMarca() { + return prodMarca; + } + + public void setProdMarca(ProdMarca prodMarca) { + this.prodMarca = prodMarca; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsProdPrecio = new ArrayList(); + lsMarca = marcaService.obtenerTodos(); + lsProdMarca = (List) Executions.getCurrent().getArg().get("lsProdMarca"); + prodMarca = (ProdMarca) Executions.getCurrent().getArg().get("prodMarca"); + prodMarcaList = (MyListbox) Executions.getCurrent().getArg().get("prodMarcaList"); + + if (prodMarca.getProdmarcaId() != null) { + lsProdPrecio = prodPrecioService.buscar(prodMarca.getMarca(), prodMarca.getProductoServicio()); + } + super.doAfterCompose(comp); + + prodPrecioList.setItemRenderer(new RenderCyberViajeProdPrecio()); + prodPrecioList.setData(lsProdPrecio); + habilitarCombo(); + } + + private void habilitarCombo() { + cmbProdMarca.setDisabled(!lsProdPrecio.isEmpty()); + } + + public void onClick$btnApagarProdPrecio(Event ev) throws Exception { + if (prodPrecioList.getSelected() == null) { + Clients.alert(Labels.getLabel("editarProdMarcaController.MSG.seleccionarUnImporte"), Labels.getLabel("editarProdMarcaController.winEditarProdMarca.title"), Messagebox.INFORMATION); + return; + } + ProdPrecio selected = (ProdPrecio) prodPrecioList.getSelected(); + prodPrecioService.borrar(selected); + lsProdPrecio.remove(selected); + prodPrecioList.setData(lsProdPrecio); + habilitarCombo(); + + } + + public void onClick$btnNovoProdPrecio(Event ev) throws Exception { + + txtImporteInicial.setConstraint("no empty"); + txtImporteFinal.setConstraint("no empty"); + tarifa.setConstraint("no empty"); + + cmbProdMarca.getValue(); + txtImporteInicial.getValue(); + txtImporteFinal.getValue(); + tarifa.getValue(); + + + if ((txtImporteInicial.getValueDecimal() == null) || (txtImporteFinal.getValueDecimal() == null)) { + Clients.alert(Labels.getLabel("editarProdMarcaController.MSG.valoresImportes"), + Labels.getLabel("editarProdMarcaController.winEditarProdMarca.title"), + Messagebox.INFORMATION); + return; + } + + Collections.sort(lsProdPrecio, new Comparator() { + + public int compare(ProdPrecio o1, ProdPrecio o2) { + return o1.getImporteinicial().compareTo(o2.getImporteinicial()); + } + }); + + + boolean traslapa = false; + for (ProdPrecio pp : lsProdPrecio) { + if (TraslaparUtil.intersectNum(pp.getImporteinicial(), pp.getImportefinal(), txtImporteInicial.getValueDecimal(), txtImporteFinal.getValueDecimal())) { + traslapa = true; + } + } + + if (traslapa) { + Clients.alert(Labels.getLabel("editarProdMarcaController.MSG.conflitoVigencias"), + Labels.getLabel("editarProdMarcaController.winEditarProdMarca.title"), + Messagebox.INFORMATION); + return; + } + + + ProdPrecio prodPrecio = new ProdPrecio(); + prodPrecio.setMarca(prodMarca.getMarca()); + prodPrecio.setProductoservicio(prodMarca.getProductoServicio()); + prodPrecio.setImportefinal(txtImporteFinal.getValueDecimal()); + prodPrecio.setImporteinicial(txtImporteInicial.getValueDecimal()); + prodPrecio.setPrecio(tarifa.getValueDecimal()); + lsProdPrecio.add(prodPrecio); + prodPrecioList.setData(lsProdPrecio); + + txtImporteInicial.setConstraint(""); + txtImporteFinal.setConstraint(""); + tarifa.setConstraint(""); + + txtImporteInicial.setValue(null); + txtImporteFinal.setValue(null); + tarifa.setValue(null); + + habilitarCombo(); + } + + public void onClick$btnAdicionar(Event ev) throws Exception { + cmbProdMarca.getValue(); + try { + + if (prodMarca.getMarca() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarProdMarcaController.winEditarProdMarca.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + if (prodPrecioList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("editarProdMarcaController.MSG.necesitaImporte"), + Labels.getLabel("editarProdMarcaController.winEditarProdMarca.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + if (prodMarca.getProdmarcaId() != null) { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProdMarcaController.winEditarProdMarca.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + prodMarcaService.actualizacion(prodMarca, lsProdPrecio); + prodMarcaList.updateItem(prodMarca); + lsProdMarca.add(prodMarca); + } else { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProdMarcaController.winEditarProdMarca.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + prodMarcaService.suscribir(prodMarca, lsProdPrecio); + prodMarcaList.addItem(prodMarca); + lsProdMarca.add(prodMarca); + } + Messagebox.show( + Labels.getLabel("editarProdMarcaController.MSG.salvarOk"), + Labels.getLabel("editarProdMarcaController.winEditarProdMarca.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarProdMarcaController.winEditarProdMarca.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + private boolean registroDuplicado() throws InterruptedException { + for (ProdMarca p : lsProdMarca) { + if (!p.getActivo()) { + continue; + } + Boolean igualID = Boolean.FALSE; + if (prodMarca.getProdmarcaId() != null) { + igualID = prodMarca.getProdmarcaId().equals(p.getProdmarcaId()); + } + + if ((p.getMarca().getDescmarca().equals(prodMarca.getMarca().getDescmarca())) + && (!igualID)) { + + return true; + } + } + + return false; + } + + public void onClick$btnRemover(Event ev) throws InterruptedException { + try { + Integer resp = Messagebox.show( + Labels.getLabel("editarProdMarcaController.MSG.borrarPergunta"), + Labels.getLabel("editarProdMarcaController.winEditarProdMarca.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp.equals(Messagebox.YES)) { + prodMarca.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + prodMarca.setFecmodif(Calendar.getInstance().getTime()); + prodMarca.setActivo(Boolean.FALSE); + + prodMarcaList.removeItem(prodMarca); + prodMarcaService.borrar(prodMarca); + + Messagebox.show( + Labels.getLabel("editarProdMarcaController.MSG.borrarSucesso"), + Labels.getLabel("editarProdMarcaController.winEditarProdMarca.title"), + Messagebox.YES, Messagebox.EXCLAMATION); + + closeWindow(); + } + + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarProdMarcaController.winEditarProdMarca.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + /** + * @return the lsProdMarca + */ + public List getLsProdMarca() { + return lsProdMarca; + } + + /** + * @param lsProdMarca the lsProdMarca to set + */ + public void setLsProdMarca(List lsProdMarca) { + this.lsProdMarca = lsProdMarca; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdMercadoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdMercadoController.java new file mode 100644 index 000000000..3e645d718 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdMercadoController.java @@ -0,0 +1,177 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.cyberviaje; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ProdMercado; +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.ProdMercadoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author Administrador + */ +@Controller("editarProdMercadoController") +@Scope("prototype") +public class EditarProdMercadoController extends MyGenericForwardComposer { + + @Autowired + private ProdMercadoService prodMercadoService; + @Autowired + private ParadaService paradaService; + private ProductoServicio productoServicio; + private MyListbox prodMercadoList; + private Combobox cmbOrigem; + private Combobox cmbDestino; + private List lsProdMercado; + private ProdMercado prodMercado; + private static Logger log = Logger.getLogger(EditarProdMercadoController.class); + + public ProdMercado getProdMercado() { + return prodMercado; + } + + public void setProdMercado(ProdMercado prodMercado) { + this.prodMercado = prodMercado; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + prodMercado = (ProdMercado) Executions.getCurrent().getArg().get("prodMercado"); + productoServicio = (ProductoServicio) Executions.getCurrent().getArg().get("productoServicio"); + prodMercadoList = (MyListbox) Executions.getCurrent().getArg().get("prodMercadoList"); + lsProdMercado = (List) Executions.getCurrent().getArg().get("lsProdMercado"); + + super.doAfterCompose(comp); + + if (prodMercado.getProdmercadoId() != null) { + Parada origem = prodMercado.getParada1(); + if (origem != null) { + cmbOrigem.setText(origem.getDescparada()); + } + + Parada destino = prodMercado.getParada(); + if (destino != null) { + cmbDestino.setText(destino.getDescparada()); + } + } + } + + public void onClick$btnAdicionar(Event ev) throws Exception { + + cmbOrigem.getValue(); + cmbDestino.getValue(); + + try { + if (prodMercado == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarProdMercadoController.winEditarProdMercado.title"), + Messagebox.OK, Messagebox.ERROR); + return; + } + if (prodMercado.getProdmercadoId() != null) { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProdMercadoController.winEditarProdMercado.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + prodMercadoService.actualizacion(prodMercado); + prodMercadoList.updateItem(prodMercado); + lsProdMercado.add(prodMercado); + } else { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProdMercadoController.winEditarProdMercado.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + prodMercado.setProductoServicio(productoServicio); + prodMercadoService.suscribir(prodMercado); + prodMercadoList.addItem(prodMercado); + lsProdMercado.add(prodMercado); + } + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } + + private boolean registroDuplicado() throws InterruptedException { + for (ProdMercado p : lsProdMercado) { + if (!p.getActivo()){ + continue; + } + if (p.getParada().getDescparada().equals(prodMercado.getParada().getDescparada()) + && p.getParada1().getDescparada().equals(prodMercado.getParada1().getDescparada())) { + return true; + } + } + return false; + } + + public void onClick$btnRemover(Event ev) { + try { + Integer resp = Messagebox.show( + Labels.getLabel("editarProdMercadoController.MSG.borrarPergunta"), + Labels.getLabel("editarProdMercadoController.winEditarProdMercado.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp.equals(Messagebox.YES)) { + prodMercado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + prodMercado.setFecmodif(Calendar.getInstance().getTime()); + prodMercado.setActivo(Boolean.FALSE); + + prodMercadoList.removeItem(prodMercado); + prodMercadoService.borrar(prodMercado); + + Messagebox.show( + Labels.getLabel("editarProdMercadoController.MSG.borrarSucesso"), + Labels.getLabel("editarProdMercadoController.winEditarProdMercado.title"), + Messagebox.YES, Messagebox.EXCLAMATION); + + closeWindow(); + } + + } catch (Exception ex) { + log.error(ex); + } + } + + /** + * @return the lsProdMercado + */ + public List getLsProdMercado() { + return lsProdMercado; + } + + /** + * @param lsProdMercado the lsProdMercado to set + */ + public void setLsProdMercado(List lsProdMercado) { + this.lsProdMercado = lsProdMercado; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdPuntoVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdPuntoVentaController.java new file mode 100644 index 000000000..591889119 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdPuntoVentaController.java @@ -0,0 +1,172 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.cyberviaje; + +import com.rjconsultores.ventaboletos.entidad.ProdPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.ProdPuntoVentaService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; + +/** + * + * @author Administrador + */ +@Controller("editarProdPuntoVentaController") +@Scope("prototype") +public class EditarProdPuntoVentaController extends MyGenericForwardComposer { + + @Autowired + private ProdPuntoVentaService prodPuntoVentaService; + @Autowired + private PuntoVentaService puntoVentaService; + private List lsPuntoVentas; + private MyListbox prodPuntoVentaList; + private MyComboboxPuntoVenta cmbPuntoVenta; + private ProdPuntoVenta prodPuntoVenta; + private List lsProdPuntoVenta; + private static Logger log = Logger.getLogger(EditarProdPuntoVentaController.class); + + public List getLsPuntoVentas() { + return lsPuntoVentas; + } + + public void setLsPuntoVentas(List lsPuntoVentas) { + this.lsPuntoVentas = lsPuntoVentas; + } + + public ProdPuntoVenta getProdPuntoVenta() { + return prodPuntoVenta; + } + + public void setProdPuntoVenta(ProdPuntoVenta prodPuntoVenta) { + this.prodPuntoVenta = prodPuntoVenta; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsProdPuntoVenta = (List)Executions.getCurrent().getArg().get("lsProdPuntoVenta"); + prodPuntoVenta = (ProdPuntoVenta) Executions.getCurrent().getArg().get("prodPuntoVenta"); + prodPuntoVentaList = (MyListbox) Executions.getCurrent().getArg().get("prodPuntoVentaList"); + + super.doAfterCompose(comp); + if (prodPuntoVenta != null){ + cmbPuntoVenta.setInitialValue(prodPuntoVenta.getPuntoVenta()); + } + } + + public void onClick$btnAdicionar(Event ev) throws Exception { + + cmbPuntoVenta.getValue(); + + try { + + if (prodPuntoVenta.getPuntoVenta() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarProdPuntoVentaController.winEditarProdPuntoVenta.title"), + Messagebox.OK, Messagebox.ERROR); + return; + } + + if (prodPuntoVenta.getProdpuntoventaId() != null) { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProdPuntoVentaController.winEditarProdPuntoVenta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + prodPuntoVentaService.actualizacion(prodPuntoVenta); + prodPuntoVentaList.updateItem(prodPuntoVenta); + lsProdPuntoVenta.add(prodPuntoVenta); + } else { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProdPuntoVentaController.winEditarProdPuntoVenta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + prodPuntoVentaService.suscribir(prodPuntoVenta); + prodPuntoVentaList.addItem(prodPuntoVenta); + lsProdPuntoVenta.add(prodPuntoVenta); + } + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } + + private boolean registroDuplicado() throws InterruptedException { + + for (ProdPuntoVenta p : lsProdPuntoVenta) { + if (!p.getActivo()){ + continue; + } + if (p.getPuntoVenta().getNombpuntoventa().equals(prodPuntoVenta.getPuntoVenta().getNombpuntoventa())) { + return true; + } + } + return false; + } + + public void onClick$btnRemover(Event ev) { + try { + Integer resp = Messagebox.show( + Labels.getLabel("editarProdPuntoVentaController.MSG.borrarPergunta"), + Labels.getLabel("editarProdPuntoVentaController.winEditarProdPuntoVenta.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp.equals(Messagebox.YES)) { + prodPuntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + prodPuntoVenta.setFecmodif(Calendar.getInstance().getTime()); + prodPuntoVenta.setActivo(Boolean.FALSE); + + prodPuntoVentaList.removeItem(prodPuntoVenta); + prodPuntoVentaService.borrar(prodPuntoVenta); + + Messagebox.show( + Labels.getLabel("editarProdPuntoVentaController.MSG.borrarSucesso"), + Labels.getLabel("editarProdPuntoVentaController.winEditarProdPuntoVenta.title"), + Messagebox.YES, Messagebox.EXCLAMATION); + + closeWindow(); + } + + } catch (Exception ex) { + log.error(ex); + } + } + + /** + * @return the lsProdPuntoVenta + */ + public List getLsProdPuntoVenta() { + return lsProdPuntoVenta; + } + + /** + * @param lsProdPuntoVenta the lsProdPuntoVenta to set + */ + public void setLsProdPuntoVenta(List lsProdPuntoVenta) { + this.lsProdPuntoVenta = lsProdPuntoVenta; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdRutaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdRutaController.java new file mode 100644 index 000000000..8d459dadc --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdRutaController.java @@ -0,0 +1,166 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.cyberviaje; + +import com.rjconsultores.ventaboletos.entidad.ProdRuta; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.service.ProdRutaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author Administrador + */ +@Controller("editarProdRutaController") +@Scope("prototype") +public class EditarProdRutaController extends MyGenericForwardComposer { + + @Autowired + private ProdRutaService prodRutaService; + @Autowired + private RutaService rutaService; + private List lsRutas; + private MyListbox prodRutaList; + private Combobox cmbRuta; + private List lsProdRuta; + private ProdRuta prodRuta; + private static Logger log = Logger.getLogger(EditarProdPuntoVentaController.class); + + public List getLsRutas() { + return lsRutas; + } + + public void setLsRutas(List lsRutas) { + this.lsRutas = lsRutas; + } + + public ProdRuta getProdRuta() { + return prodRuta; + } + + public void setProdRuta(ProdRuta prodRuta) { + this.prodRuta = prodRuta; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsRutas = rutaService.obtenerTodos(); + lsProdRuta = (List) Executions.getCurrent().getArg().get("lsProdRuta"); + prodRuta = (ProdRuta) Executions.getCurrent().getArg().get("prodRuta"); + prodRutaList = (MyListbox) Executions.getCurrent().getArg().get("prodRutaList"); + + super.doAfterCompose(comp); + } + + public void onClick$btnAdicionar(Event ev) throws Exception { + cmbRuta.getValue(); + try { + if (prodRuta.getRuta() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarProdRutaController.winEditarProdRuta.title"), + Messagebox.OK, Messagebox.ERROR); + return; + } + + if (prodRuta.getProdrutaId() != null) { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProdRutaController.winEditarProdRuta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + prodRutaService.actualizacion(prodRuta); + prodRutaList.updateItem(prodRuta); + lsProdRuta.add(prodRuta); + } else { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProdRutaController.winEditarProdRuta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + prodRutaService.suscribir(prodRuta); + prodRutaList.addItem(prodRuta); + lsProdRuta.add(prodRuta); + } + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } + + private boolean registroDuplicado() throws InterruptedException { + for (ProdRuta p : lsProdRuta) { + if (!p.getActivo()){ + continue; + } + if (p.getRuta().getDescruta().equals(prodRuta.getRuta().getDescruta())) { + return true; + } + } + return false; + } + + public void onClick$btnRemover(Event ev) { + try { + Integer resp = Messagebox.show( + Labels.getLabel("editarProdRutaController.MSG.borrarPergunta"), + Labels.getLabel("editarProdRutaController.winEditarProdRuta.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp.equals(Messagebox.YES)) { + prodRuta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + prodRuta.setFecmodif(Calendar.getInstance().getTime()); + prodRuta.setActivo(Boolean.FALSE); + + prodRutaList.removeItem(prodRuta); + prodRutaService.borrar(prodRuta); + + Messagebox.show( + Labels.getLabel("editarProdRutaController.MSG.borrarSucesso"), + Labels.getLabel("editarProdRutaController.winEditarProdRuta.title"), + Messagebox.YES, Messagebox.EXCLAMATION); + + closeWindow(); + } + + } catch (Exception ex) { + log.error(ex); + } + } + + /** + * @return the lsProdRuta + */ + public List getLsProdRuta() { + return lsProdRuta; + } + + /** + * @param lsProdRuta the lsProdRuta to set + */ + public void setLsProdRuta(List lsProdRuta) { + this.lsProdRuta = lsProdRuta; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdTipoptovtaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdTipoptovtaController.java new file mode 100644 index 000000000..80e50406d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdTipoptovtaController.java @@ -0,0 +1,166 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.cyberviaje; + +import com.rjconsultores.ventaboletos.entidad.ProdTipoptovta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.service.ProdTipoptovtaService; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author Administrador + */ +@Controller("editarProdTipoptovtaController") +@Scope("prototype") +public class EditarProdTipoptovtaController extends MyGenericForwardComposer { + + @Autowired + private ProdTipoptovtaService prodTipoptovtaService; + @Autowired + private TipoPuntoVentaService tipoPuntoVentaService; + private List lsTipoPuntoVentas; + private MyListbox prodTipoPuntoVentaList; + private Combobox cmbTipoPuntoVenta; + private ProdTipoptovta prodTipoPuntoVenta; + private List lsProdTipoptovta; + private static Logger log = Logger.getLogger(EditarProdTipoptovtaController.class); + + public List getLsTipoPuntoVentas() { + return lsTipoPuntoVentas; + } + + public void setLsTipoPuntoVentas(List lsTipoPuntoVentas) { + this.lsTipoPuntoVentas = lsTipoPuntoVentas; + } + + public ProdTipoptovta getProdTipoPuntoVenta() { + return prodTipoPuntoVenta; + } + + public void setProdTipoPuntoVenta(ProdTipoptovta prodTipoPuntoVenta) { + this.prodTipoPuntoVenta = prodTipoPuntoVenta; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsTipoPuntoVentas = tipoPuntoVentaService.obtenerTodos(); + lsProdTipoptovta = (List) Executions.getCurrent().getArg().get("lsProdTipoptovta"); + prodTipoPuntoVenta = (ProdTipoptovta) Executions.getCurrent().getArg().get("prodTipoptovta"); + prodTipoPuntoVentaList = (MyListbox) Executions.getCurrent().getArg().get("prodTipoptovtaList"); + + super.doAfterCompose(comp); + } + + public void onClick$btnAdicionar(Event ev) throws Exception { + cmbTipoPuntoVenta.getValue(); + try { + + if (prodTipoPuntoVenta.getTipoPtovta() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarProdTipoptovtaController.winEditarProdTipoPuntoVenta.title"), + Messagebox.OK, Messagebox.ERROR); + return; + } + + if (prodTipoPuntoVenta.getProdtipoptovtaId() != null) { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProdTipoptovtaController.winEditarProdTipoPuntoVenta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + prodTipoptovtaService.actualizacion(prodTipoPuntoVenta); + prodTipoPuntoVentaList.updateItem(prodTipoPuntoVenta); + lsProdTipoptovta.add(prodTipoPuntoVenta); + } else { + if (registroDuplicado()) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaExiste"), + Labels.getLabel("editarProdTipoptovtaController.winEditarProdTipoPuntoVenta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + prodTipoptovtaService.suscribir(prodTipoPuntoVenta); + prodTipoPuntoVentaList.addItem(prodTipoPuntoVenta); + lsProdTipoptovta.add(prodTipoPuntoVenta); + } + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } + + private boolean registroDuplicado() throws InterruptedException { + for (ProdTipoptovta tv : lsProdTipoptovta) { + if (!tv.getActivo()){ + continue; + } + if (tv.getTipoPtovta().getDesctipo().equals(prodTipoPuntoVenta.getTipoPtovta().getDesctipo())) { + return true; + } + } + return false; + } + + public void onClick$btnRemover(Event ev) { + try { + Integer resp = Messagebox.show( + Labels.getLabel("editarProdTipoptovtaController.MSG.borrarPergunta"), + Labels.getLabel("editarProdTipoptovtaController.winEditarProdTipoPuntoVenta.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp.equals(Messagebox.YES)) { + prodTipoPuntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + prodTipoPuntoVenta.setFecmodif(Calendar.getInstance().getTime()); + prodTipoPuntoVenta.setActivo(Boolean.FALSE); + + prodTipoPuntoVentaList.removeItem(prodTipoPuntoVenta); + prodTipoptovtaService.borrar(prodTipoPuntoVenta); + + Messagebox.show( + Labels.getLabel("editarProdTipoptovtaController.MSG.borrarSucesso"), + Labels.getLabel("editarProdTipoptovtaController.winEditarProdTipoPuntoVenta.title"), + Messagebox.YES, Messagebox.EXCLAMATION); + + closeWindow(); + } + + } catch (Exception ex) { + log.error(ex); + } + } + + /** + * @return the lsProdTipoptovta + */ + public List getLsProdTipoptovta() { + return lsProdTipoptovta; + } + + /** + * @param lsProdTipoptovta the lsProdTipoptovta to set + */ + public void setLsProdTipoptovta(List lsProdTipoptovta) { + this.lsProdTipoptovta = lsProdTipoptovta; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdVigenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdVigenciaController.java new file mode 100644 index 000000000..00d072cf5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProdVigenciaController.java @@ -0,0 +1,202 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.cyberviaje; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Datebox; + +import com.rjconsultores.ventaboletos.entidad.ProdVigencia; +import com.rjconsultores.ventaboletos.service.ProdVigenciaService; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; + +/** + * + * @author Administrador + */ +@Controller("editarProdVigenciaController") +@Scope("prototype") +public class EditarProdVigenciaController extends MyGenericForwardComposer { + + @Autowired + private ProdVigenciaService prodVigenciaService; + private MyListbox prodVigenciaList; + private ProdVigencia prodVigencia; + private Datebox fecInicio; + private List lsProdVigencia; + private Datebox fecFinal; + private static Logger log = Logger.getLogger(EditarProdTipoptovtaController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + + prodVigencia = (ProdVigencia) Executions.getCurrent().getArg().get("prodVigencia"); + prodVigenciaList = (MyListbox) Executions.getCurrent().getArg().get("prodVigenciaList"); + lsProdVigencia = (List) Executions.getCurrent().getArg().get("lsProdVigencia"); + super.doAfterCompose(comp); + + if (prodVigencia.getProdvigenciaId() != null) { + fecInicio.setValue(prodVigencia.getFecvigenciainicio()); + fecFinal.setValue(prodVigencia.getFecvigenciafin()); + } + } + + public void onClick$btnAdicionar(Event ev) throws Exception { + + fecInicio.getValue(); + fecFinal.getValue(); + + if (fecInicio.getValue().after(fecFinal.getValue())) { + Messagebox.show(Labels.getLabel("editarProductoServicioController.MSG.fechaViaje"), Labels.getLabel("editarProdVigenciaController.winEditarProdVigencia.title"), Messagebox.OK, Messagebox.INFORMATION); + } else { + try { + if (prodVigencia.getProductoServicio() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarProdVigenciaController.winEditarProdVigencia.title"), + Messagebox.OK, Messagebox.ERROR); + return; + } + prodVigencia.setFecvigenciainicio(fecInicio.getValue()); + prodVigencia.setFecvigenciafin(fecFinal.getValue()); + + List lsVT1 = prodVigenciaService.buscarTraslapa(prodVigencia); + + + // checando se a vigencia pode ser salva. A data de inicio de uma + // nova vigencia tem q ser maior que a da fim da vigencia anterior + // para que não tenha tarifas com duas vigencias: + Boolean podeSalvar = lsVT1.isEmpty() ? true : false; + //Se for ele mesmo pode salvar. + if (lsVT1.size() == 1) { + //Somente edição + if (prodVigencia.getProdvigenciaId() != null) { + if (prodVigencia.getProdvigenciaId().equals(lsVT1.get(0).getProdvigenciaId())) { + podeSalvar = true; + } + } + } + + if (podeSalvar) { + + if (prodVigencia.getProdvigenciaId() != null) { + prodVigenciaService.actualizacion(prodVigencia); + prodVigenciaList.updateItem(prodVigencia); + lsProdVigencia.add(prodVigencia); + } else { + prodVigenciaService.suscribir(prodVigencia); + prodVigenciaList.addItem(prodVigencia); + lsProdVigencia.add(prodVigencia); + } + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("editarProdVigenciaController.MSG.registroTraslapado"), + Labels.getLabel("editarProdVigenciaController.winEditarProdVigencia.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } + } + + /** + * + * @return + * 0 - Esta ok + * 1 - Registro duplicado + * 2 - Registro traslapado + * @throws InterruptedException + */ + private int registroDuplicado() throws InterruptedException { + List lsProdVigenciaActivo = new ArrayList(); + + for (ProdVigencia pv : lsProdVigencia) { + if (pv.getActivo()) { + lsProdVigenciaActivo.add(pv); + } + } + + Collections.sort(lsProdVigenciaActivo, new Comparator() { + + public int compare(ProdVigencia o1, ProdVigencia o2) { + return o1.getFecvigenciainicio().compareTo(o2.getFecvigenciainicio()); + } + }); + + for (ProdVigencia pv : lsProdVigenciaActivo) { +// if (DateUtils.isSameDay(pv.getFecvigenciainicio(), prodVigencia.getFecvigenciainicio()) +// && DateUtils.isSameDay(pv.getFecvigenciafin(), prodVigencia.getFecvigenciafin())) { +// return 1; +// } + + + if (DateUtil.intersectDate(pv.getFecvigenciainicio(), pv.getFecvigenciafin(), prodVigencia.getFecvigenciainicio(), prodVigencia.getFecvigenciafin())) { + return 2; + } + } + + return 0; + } + + public void onClick$btnRemover(Event ev) { + try { + Integer resp = Messagebox.show( + Labels.getLabel("editarProdVigenciaController.MSG.borrarPergunta"), + Labels.getLabel("editarProdVigenciaController.winEditarProdVigencia.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp.equals(Messagebox.YES)) { + prodVigencia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + prodVigencia.setFecmodif(Calendar.getInstance().getTime()); + prodVigencia.setActivo(Boolean.FALSE); + + prodVigenciaList.removeItem(prodVigencia); + prodVigenciaService.borrar(prodVigencia); + + Messagebox.show( + Labels.getLabel("editarProdVigenciaController.MSG.borrarSucesso"), + Labels.getLabel("editarProdVigenciaController.winEditarProdVigencia.title"), + Messagebox.YES, Messagebox.EXCLAMATION); + + closeWindow(); + } + + } catch (Exception ex) { + log.error(ex); + } + } + + /** + * @return the lsProdVigencia + */ + public List getLsProdVigencia() { + return lsProdVigencia; + } + + /** + * @param lsProdVigencia the lsProdVigencia to set + */ + public void setLsProdVigencia(List lsProdVigencia) { + this.lsProdVigencia = lsProdVigencia; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProductoServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProductoServicioController.java new file mode 100644 index 000000000..9ff75b4b8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/cyberviaje/EditarProductoServicioController.java @@ -0,0 +1,925 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.configuracioneccomerciales.cyberviaje; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.ProdClaseServicio; +import com.rjconsultores.ventaboletos.entidad.ProdFormaPago; +import com.rjconsultores.ventaboletos.entidad.ProdMarca; +import com.rjconsultores.ventaboletos.entidad.ProdMercado; +import com.rjconsultores.ventaboletos.entidad.ProdPrecio; +import com.rjconsultores.ventaboletos.entidad.ProdPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.ProdRuta; +import com.rjconsultores.ventaboletos.entidad.ProdTipoptovta; +import com.rjconsultores.ventaboletos.entidad.ProdVigencia; +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.ProdPrecioService; +import com.rjconsultores.ventaboletos.service.ProductoServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCyberViajeProdClaseServicio; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCyberViajeProdFormaPago; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCyberViajeProdMarca; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCyberViajeProdMercado; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCyberViajeProdPuntoVenta; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCyberViajeProdRuta; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCyberViajeProdTipoptovta; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCyberViajeProdVigencia; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.List; +import java.util.Map; +import java.util.logging.Level; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarProductoServicioController") +@Scope("prototype") +public class EditarProductoServicioController extends MyGenericForwardComposer { + + @Autowired + private ProductoServicioService productoServicioService; + @Autowired + private MarcaService marcaService; + @Autowired + private ProdPrecioService prodPrecioService; + private ProductoServicio productoServicio; + private MyListbox productoServicioList; + private MyListbox prodClaseServicioList; + private MyListbox prodFormaPagoList; + private MyListbox prodMarcaList; + private MyListbox prodMercadoList; + private MyListbox prodPuntoVentaList; + private MyListbox prodRutaList; + private MyListbox prodTipoptovtaList; + private MyListbox prodVigenciaList; + private List lsProdClaseServicio; + private List lsProdFormaPago; + private List lsProdMarca; + private List lsProdMercado; + private List lsProdPuntoVenta; + private List lsProdPrecio; + private List lsProdRuta; + private List lsProdTipoptovta; + private List lsProdVigencia; + private List lsMarca; + private static Logger log = Logger.getLogger(EditarProductoServicioController.class); + private boolean salvo = false; + private Button btnApagar; + private Radio rdTipoPro; + private Textbox txtDescripcion; + private Combobox cmbMarca; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + productoServicio = (ProductoServicio) Executions.getCurrent().getArg().get("productoServicio"); + productoServicioList = (MyListbox) Executions.getCurrent().getArg().get("productoServicioList"); + + lsMarca = marcaService.obtenerTodos(); + + super.doAfterCompose(comp); + + //Clase Servicio + prodClaseServicioList.setItemRenderer(new RenderCyberViajeProdClaseServicio()); + lsProdClaseServicio = new ArrayList(); + productoServicio.setProdClaseServicioList(lsProdClaseServicio); + + //FormaPago + prodFormaPagoList.setItemRenderer(new RenderCyberViajeProdFormaPago()); + lsProdFormaPago = new ArrayList(); + productoServicio.setProdFormaPagoList(lsProdFormaPago); + + //Marca + prodMarcaList.setItemRenderer(new RenderCyberViajeProdMarca()); + lsProdMarca = new ArrayList(); + productoServicio.setProdMarcaList(lsProdMarca); + prodMarcaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ProdMarca prodMarca = (ProdMarca) prodMarcaList.getSelected(); + verProdMarca(prodMarca); + } + }); + + //Mercado + prodMercadoList.setItemRenderer(new RenderCyberViajeProdMercado()); + lsProdMercado = new ArrayList(); + productoServicio.setProdMercadoList(lsProdMercado); + + //Punto Venta + prodPuntoVentaList.setItemRenderer(new RenderCyberViajeProdPuntoVenta()); + lsProdPuntoVenta = new ArrayList(); + productoServicio.setProdPuntoVentaList(lsProdPuntoVenta); + + //Ruta + prodRutaList.setItemRenderer(new RenderCyberViajeProdRuta()); + lsProdRuta = new ArrayList(); + productoServicio.setProdRutaList(lsProdRuta); + + //Tipo Ponto de Venda + prodTipoptovtaList.setItemRenderer(new RenderCyberViajeProdTipoptovta()); + lsProdTipoptovta = new ArrayList(); + productoServicio.setProdTipoptovtaList(lsProdTipoptovta); + + //Vigencia + prodVigenciaList.setItemRenderer(new RenderCyberViajeProdVigencia()); + lsProdVigencia = new ArrayList(); + productoServicio.setProdVigenciaList(lsProdVigencia); + prodVigenciaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ProdVigencia prodVigencia = (ProdVigencia) prodVigenciaList.getSelected(); + verProdVigencia(prodVigencia); + } + }); + + + if (productoServicio.getProductoservicioId() != null) { + productoServicio = productoServicioService.obtenerID(productoServicio.getProductoservicioId()); + + lsProdClaseServicio = productoServicio.getProdClaseServicioList(); + prodClaseServicioList.setData(lsProdClaseServicio); + + lsProdFormaPago = productoServicio.getProdFormaPagoList(); + prodFormaPagoList.setData(lsProdFormaPago); + + lsProdMarca = productoServicio.getProdMarcaList(); + prodMarcaList.setData(lsProdMarca); + + lsProdMercado = productoServicio.getProdMercadoList(); + prodMercadoList.setData(lsProdMercado); + + lsProdPuntoVenta = productoServicio.getProdPuntoVentaList(); + prodPuntoVentaList.setData(lsProdPuntoVenta); + + lsProdRuta = productoServicio.getProdRutaList(); + prodRutaList.setData(lsProdRuta); + + lsProdTipoptovta = productoServicio.getProdTipoptovtaList(); + prodTipoptovtaList.setData(lsProdTipoptovta); + + lsProdVigencia = productoServicio.getProdVigenciaList(); + prodVigenciaList.setData(lsProdVigencia); + + if (productoServicio.getIndtipo().equals("P")) { + rdTipoPro.setChecked(true); + } + + salvo = true; + } + + if (productoServicio.getProductoservicioId() == null) { + btnApagar.setVisible(Boolean.FALSE); + productoServicio.setIndtipo("S"); + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtDescripcion.getValue(); + if (prodFormaPagoList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarProdFormaPagoController.MSG.vazio"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else if (prodTipoptovtaList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarProdTipoptovtaController.MSG.vazio"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else if (prodPuntoVentaList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarProdPuntoVentaController.MSG.vazio"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else if (prodVigenciaList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarProdVigenciaController.MSG.vazio"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + } else if (prodRutaList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarProdRutaController.MSG.vazio"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else if (prodMercadoList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarProdMercadoController.MSG.vazio"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + } else if (prodClaseServicioList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarProdClaseServicioController.MSG.vazio"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + } else if (prodMarcaList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarProdMarcaController.MSG.vazio"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else { + try { + productoServicio.setProdClaseServicioList(lsProdClaseServicio); + productoServicio.setProdFormaPagoList(lsProdFormaPago); + productoServicio.setProdMarcaList(lsProdMarca); + productoServicio.setProdMercadoList(lsProdMercado); + productoServicio.setProdPuntoVentaList(lsProdPuntoVenta); + productoServicio.setProdRutaList(lsProdRuta); + productoServicio.setProdTipoptovtaList(lsProdTipoptovta); + productoServicio.setProdVigenciaList(lsProdVigencia); + + List lsPs = productoServicioService.obtener(productoServicio); + boolean podeSalvar = false; + + if (lsPs.isEmpty()) { + podeSalvar = true; + } else { + for (ProductoServicio pser : lsPs) { + if (pser.getProductoservicioId().equals(productoServicio.getProductoservicioId())) { + podeSalvar = true; + } else { + podeSalvar = false; + } + } + } + + if (podeSalvar) { + + if (productoServicio.getProductoservicioId() == null) { + productoServicioService.suscribir(productoServicio); + productoServicioList.addItem(productoServicio); + } else { + productoServicioService.actualizacion(productoServicio); + productoServicioList.updateItem(productoServicio); + } + + Messagebox.show( + Labels.getLabel("editarProductoServicioController.MSG.suscribirOK"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + salvo = true; + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + } + } catch (Exception ex) { + log.error(ex); + } + } + } + + public void onClick$btnFechar(Event ev) { + puedeBorrar(); + closeWindow(); + } + + private void puedeBorrar() { + if (!salvo) { + if (productoServicio.getProductoservicioId() != null) { + productoServicio = productoServicioService.obtenerID(productoServicio.getProductoservicioId()); + productoServicioService.borrarFisico(productoServicio); + } + } + } + + public void onClose$winEditarProductoServicio(Event ev) { + puedeBorrar(); + closeWindow(); + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarProductoServicioController.MSG.borrarPergunta"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + productoServicioService.borrar(productoServicio); + Messagebox.show( + Labels.getLabel("editarProductoServicioController.MSG.borrarOK"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + productoServicioList.removeItem(productoServicio); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + private void verProdClaseServicio(ProdClaseServicio prodClaseServicio) { + if (productoServicio.getProductoservicioId() == null) { + productoServicioService.suscribir(productoServicio); + } + + Map args = new HashMap(); + args.put("lsProdClaseServicio", lsProdClaseServicio); + args.put("prodClaseServicio", prodClaseServicio); + args.put("prodClaseServicioList", prodClaseServicioList); + + openWindow("/gui/configuraciones_comerciales/cyberviaje/editarProdClaseServicio.zul", + Labels.getLabel("editarProductoServicioController.windowProdClaseServicio.title"), args, MODAL); + } + + public void onClick$btnNovoProdClaseServicio(Event ev) { + ProdClaseServicio pcs = new ProdClaseServicio(); + pcs.setProductoServicio(productoServicio); + verProdClaseServicio(pcs); + } + + public void onClick$btnApagarProdClaseServicio(Event ev) throws Exception { + ProdClaseServicio pClaseServicio = (ProdClaseServicio) prodClaseServicioList.getSelected(); + if (pClaseServicio != null) { + int resp = Messagebox.show( + Labels.getLabel("editarProdClaseServicioController.MSG.borrarPergunta"), + Labels.getLabel("editarProdClaseServicioController.winEditarProdClaseServicio.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsProdClaseServicio.remove(pClaseServicio); + + pClaseServicio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pClaseServicio.setFecmodif(Calendar.getInstance().getTime()); + pClaseServicio.setActivo(Boolean.FALSE); + + lsProdClaseServicio.add(pClaseServicio); + prodClaseServicioList.removeItem(pClaseServicio); + prodClaseServicioList.clearSelection(); + } + } else { + Messagebox.show(Labels.getLabel("editarProductoServicioController.MSG.selectItem"), Labels.getLabel("editarProductoServicioController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + private void verProdFormaPago(ProdFormaPago prodFormaPago) { + if (productoServicio.getProductoservicioId() == null) { + productoServicioService.suscribir(productoServicio); + } + + Map args = new HashMap(); + args.put("prodFormaPago", prodFormaPago); + args.put("prodFormaPagoList", prodFormaPagoList); + args.put("lsProdFormaPago", lsProdFormaPago); + + openWindow("/gui/configuraciones_comerciales/cyberviaje/editarProdFormaPago.zul", + Labels.getLabel("editarProductoServicioController.windowProdFormaPago.title"), args, MODAL); + } + + public void onClick$btnNovoProdFormaPago(Event ev) { + ProdFormaPago pForma = new ProdFormaPago(); + pForma.setProductoServicio(productoServicio); + verProdFormaPago(pForma); + } + + + public void onClick$btnApagarProdFormaPago(Event ev) throws Exception { + ProdFormaPago pFormaPago = (ProdFormaPago) prodFormaPagoList.getSelected(); + if (pFormaPago != null) { + int resp = Messagebox.show( + Labels.getLabel("editarProdFormaPagoController.MSG.borrarPergunta"), + Labels.getLabel("editarProdFormaPagoController.winEditarProdFormaPago.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsProdFormaPago.remove(pFormaPago); + + pFormaPago.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pFormaPago.setFecmodif(Calendar.getInstance().getTime()); + pFormaPago.setActivo(Boolean.FALSE); + + lsProdFormaPago.add(pFormaPago); + prodFormaPagoList.removeItem(pFormaPago); + prodFormaPagoList.clearSelection(); + } + } else { + Messagebox.show( + Labels.getLabel("editarProductoServicioController.MSG.selectItem"), + Labels.getLabel("editarProductoServicioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + private void verProdMarca(ProdMarca prodMarca) { + if (productoServicio.getProductoservicioId() == null) { + productoServicioService.suscribir(productoServicio); + } + + Map args = new HashMap(); + args.put("lsProdMarca", lsProdMarca); + args.put("prodMarca", prodMarca); + args.put("prodMarcaList", prodMarcaList); + + openWindow("/gui/configuraciones_comerciales/cyberviaje/editarProdMarca.zul", + Labels.getLabel("editarProductoServicioController.windowProdMarca.title"), args, MODAL); + + } + + public void onClick$btnNovoProdMarca(Event ev) { + ProdMarca pMarca = new ProdMarca(); + pMarca.setProductoServicio(productoServicio); + verProdMarca(pMarca); + } + + public void onClick$btnModificarProdMarca(Event ev) { + + ProdMarca prodMarca = (ProdMarca) prodMarcaList.getSelected(); + + if (prodMarca != null) { + verProdMarca(prodMarca); + } else { + try { + Messagebox.show(Labels.getLabel("editarProductoServicioController.MSG.selectItem"), Labels.getLabel("editarProductoServicioController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarProductoServicioController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarProdMarca(Event ev) throws Exception { + ProdMarca pMarca = (ProdMarca) prodMarcaList.getSelected(); + if (pMarca != null) { + int resp = Messagebox.show( + Labels.getLabel("editarProdMarcaController.MSG.borrarPergunta"), + Labels.getLabel("editarProdMarcaController.winEditarProdMarca.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsProdMarca.remove(pMarca); + + pMarca.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pMarca.setFecmodif(Calendar.getInstance().getTime()); + pMarca.setActivo(Boolean.FALSE); + + lsProdMarca.add(pMarca); + prodMarcaList.removeItem(pMarca); + prodMarcaList.clearSelection(); + + //Como a marca já foi removida da tela, tenho q remover tmb os precios da mesma. + //Se o usuario voltar a adicionar a marca, deve voltar a adicionar os preços + prodPrecioService.borrar(pMarca.getMarca()); + } + } else { + Messagebox.show(Labels.getLabel("editarProductoServicioController.MSG.selectItem"), Labels.getLabel("editarProductoServicioController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + private void verProdMercado(ProdMercado prodMercado) { + if (productoServicio.getProductoservicioId() == null) { + productoServicioService.suscribir(productoServicio); + } + + Map args = new HashMap(); + args.put("lsProdMercado", lsProdMercado); + args.put("prodMercado", prodMercado); + args.put("prodMercadoList", prodMercadoList); + args.put("productoServicio", productoServicio); + + openWindow("/gui/configuraciones_comerciales/cyberviaje/editarProdMercado.zul", + Labels.getLabel("editarProductoServicioController.windowProdMercado.title"), + args, MODAL); + } + + public void onClick$btnNovoProdMercado(Event ev) { + ProdMercado pMercado = new ProdMercado(); + verProdMercado(pMercado); + } + + public void onClick$btnApagarProdMercado(Event ev) throws Exception { + ProdMercado pMercado = (ProdMercado) prodMercadoList.getSelected(); + if (pMercado != null) { + int resp = Messagebox.show( + Labels.getLabel("editarProdMercadoController.MSG.borrarPergunta"), + Labels.getLabel("editarProdMercadoController.winEditarProdMercado.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsProdMercado.remove(pMercado); + + pMercado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pMercado.setFecmodif(Calendar.getInstance().getTime()); + pMercado.setActivo(Boolean.FALSE); + + lsProdMercado.add(pMercado); + prodMercadoList.removeItem(pMercado); + prodMercadoList.clearSelection(); + } + } else { + Messagebox.show(Labels.getLabel("editarProductoServicioController.MSG.selectItem"), Labels.getLabel("editarProductoServicioController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + private void verProdPuntoVenta(ProdPuntoVenta prodPuntoVenta) { + if (productoServicio.getProductoservicioId() == null) { + productoServicioService.suscribir(productoServicio); + } + + Map args = new HashMap(); + args.put("lsProdPuntoVenta", lsProdPuntoVenta); + args.put("prodPuntoVenta", prodPuntoVenta); + args.put("prodPuntoVentaList", prodPuntoVentaList); + + openWindow("/gui/configuraciones_comerciales/cyberviaje/editarProdPuntoVenta.zul", + Labels.getLabel("editarProductoServicioController.windowProdPuntoVenta.title"), args, MODAL); + + } + + public void onClick$btnNovoProdPuntoVenta(Event ev) { + ProdPuntoVenta pPuntoVenta = new ProdPuntoVenta(); + pPuntoVenta.setProductoServicio(productoServicio); + verProdPuntoVenta(pPuntoVenta); + } + + public void onClick$btnApagarProdPuntoVenta(Event ev) throws Exception { + ProdPuntoVenta pPuntoVenta = (ProdPuntoVenta) prodPuntoVentaList.getSelected(); + if (pPuntoVenta != null) { + int resp = Messagebox.show( + Labels.getLabel("editarProdPuntoVentaController.MSG.borrarPergunta"), + Labels.getLabel("editarProdPuntoVentaController.winEditarProdPuntoVenta.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsProdPuntoVenta.remove(pPuntoVenta); + + pPuntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pPuntoVenta.setFecmodif(Calendar.getInstance().getTime()); + pPuntoVenta.setActivo(Boolean.FALSE); + + lsProdPuntoVenta.add(pPuntoVenta); + prodPuntoVentaList.removeItem(pPuntoVenta); + prodPuntoVentaList.clearSelection(); + } + } else { + Messagebox.show(Labels.getLabel("editarProductoServicioController.MSG.selectItem"), Labels.getLabel("editarProductoServicioController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + private void verProdRuta(ProdRuta prodRuta) { + if (productoServicio.getProductoservicioId() == null) { + productoServicioService.suscribir(productoServicio); + } + + Map args = new HashMap(); + args.put("prodRuta", prodRuta); + args.put("lsProdRuta", lsProdRuta); + args.put("prodRutaList", prodRutaList); + + openWindow("/gui/configuraciones_comerciales/cyberviaje/editarProdRuta.zul", + Labels.getLabel("editarProductoServicioController.windowProdRuta.title"), args, MODAL); + + } + + public void onClick$btnNovoProdRuta(Event ev) { + ProdRuta pRuta = new ProdRuta(); + pRuta.setProductoServicio(productoServicio); + verProdRuta(pRuta); + } + + public void onClick$btnApagarProdRuta(Event ev) throws Exception { + ProdRuta pRuta = (ProdRuta) prodRutaList.getSelected(); + if (pRuta != null) { + int resp = Messagebox.show( + Labels.getLabel("editarProdRutaController.MSG.borrarPergunta"), + Labels.getLabel("editarProdRutaController.winEditarProdRuta.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsProdRuta.remove(pRuta); + + pRuta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pRuta.setFecmodif(Calendar.getInstance().getTime()); + pRuta.setActivo(Boolean.FALSE); + + lsProdRuta.add(pRuta); + prodRutaList.removeItem(pRuta); + prodRutaList.clearSelection(); + } + } else { + Messagebox.show(Labels.getLabel("editarProductoServicioController.MSG.selectItem"), Labels.getLabel("editarProductoServicioController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + private void verProdTipoptovta(ProdTipoptovta prodTipoptovta) { + if (productoServicio.getProductoservicioId() == null) { + productoServicioService.suscribir(productoServicio); + } + + Map args = new HashMap(); + args.put("lsProdTipoptovta", lsProdTipoptovta); + args.put("prodTipoptovta", prodTipoptovta); + args.put("prodTipoptovtaList", prodTipoptovtaList); + + openWindow("/gui/configuraciones_comerciales/cyberviaje/editarProdTipoptovta.zul", + Labels.getLabel("editarProductoServicioController.windowProdTipoptovta.title"), args, MODAL); + + } + + public void onClick$btnNovoProdTipoptovta(Event ev) { + ProdTipoptovta pTipo = new ProdTipoptovta(); + pTipo.setProductoServicio(productoServicio); + verProdTipoptovta(pTipo); + } + + public void onClick$btnApagarProdTipoptovta(Event ev) throws Exception { + ProdTipoptovta pTipoptovta = (ProdTipoptovta) prodTipoptovtaList.getSelected(); + if (pTipoptovta != null) { + int resp = Messagebox.show( + Labels.getLabel("editarProdTipoptovtaController.MSG.borrarPergunta"), + Labels.getLabel("editarProdTipoptovtaController.winEditarProdTipoptovta.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsProdTipoptovta.remove(pTipoptovta); + + pTipoptovta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pTipoptovta.setFecmodif(Calendar.getInstance().getTime()); + pTipoptovta.setActivo(Boolean.FALSE); + + lsProdTipoptovta.add(pTipoptovta); + prodTipoptovtaList.removeItem(pTipoptovta); + prodTipoptovtaList.clearSelection(); + } + } else { + Messagebox.show(Labels.getLabel("editarProductoServicioController.MSG.selectItem"), Labels.getLabel("editarProductoServicioController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + private void verProdVigencia(ProdVigencia prodVigencia) { + if (productoServicio.getProductoservicioId() == null) { + productoServicioService.suscribir(productoServicio); + } + + Map args = new HashMap(); + args.put("lsProdVigencia", lsProdVigencia); + args.put("prodVigencia", prodVigencia); + args.put("prodVigenciaList", prodVigenciaList); + + openWindow("/gui/configuraciones_comerciales/cyberviaje/editarProdVigencia.zul", + Labels.getLabel("editarProductoServicioController.windowProdVigencia.title"), args, MODAL); + + } + + public void onClick$btnNovoProdVigencia(Event ev) { + ProdVigencia pVigencia = new ProdVigencia(); + pVigencia.setProductoServicio(productoServicio); + verProdVigencia(pVigencia); + } + + public void onClick$btnModificarProdVigencia(Event ev) { + + ProdVigencia prodVigencia = (ProdVigencia) prodVigenciaList.getSelected(); + + if (prodVigencia != null) { + verProdVigencia(prodVigencia); + } else { + try { + Messagebox.show(Labels.getLabel("editarProductoServicioController.MSG.selectItem"), Labels.getLabel("editarProductoServicioController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarProductoServicioController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarProdVigencia(Event ev) throws Exception { + ProdVigencia pVigencia = (ProdVigencia) prodVigenciaList.getSelected(); + if (pVigencia != null) { + int resp = Messagebox.show( + Labels.getLabel("editarProdVigenciaController.MSG.borrarPergunta"), + Labels.getLabel("editarProdVigenciaController.winEditarProdVigencia.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsProdVigencia.remove(pVigencia); + + pVigencia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pVigencia.setFecmodif(Calendar.getInstance().getTime()); + pVigencia.setActivo(Boolean.FALSE); + + lsProdVigencia.add(pVigencia); + prodVigenciaList.removeItem(pVigencia); + prodVigenciaList.clearSelection(); + } + } else { + Messagebox.show(Labels.getLabel("editarProductoServicioController.MSG.selectItem"), Labels.getLabel("editarProductoServicioController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$rdTipoSer(Event ev) { + productoServicio.setIndtipo("S"); + } + + public void onClick$rdTipoPro(Event ev) { + productoServicio.setIndtipo("P"); + } + + public List getLsProdClaseServicio() { + return lsProdClaseServicio; + } + + public void setLsProdClaseServicio(List lsProdClaseServicio) { + this.lsProdClaseServicio = lsProdClaseServicio; + } + + public List getLsProdFormaPago() { + return lsProdFormaPago; + } + + public void setLsProdFormaPago(List lsProdFormaPago) { + this.lsProdFormaPago = lsProdFormaPago; + } + + public List getLsProdMarca() { + return lsProdMarca; + } + + public void setLsProdMarca(List lsProdMarca) { + this.lsProdMarca = lsProdMarca; + } + + public List getLsProdMercado() { + return lsProdMercado; + } + + public void setLsProdMercado(List lsProdMercado) { + this.lsProdMercado = lsProdMercado; + } + + public List getLsProdPuntoVenta() { + return lsProdPuntoVenta; + } + + public void setLsProdPuntoVenta(List lsProdPuntoVenta) { + this.lsProdPuntoVenta = lsProdPuntoVenta; + } + + public List getLsProdRuta() { + return lsProdRuta; + } + + public void setLsProdRuta(List lsProdRuta) { + this.lsProdRuta = lsProdRuta; + } + + public List getLsProdTipoptovta() { + return lsProdTipoptovta; + } + + public void setLsProdTipoptovta(List lsProdTipoptovta) { + this.lsProdTipoptovta = lsProdTipoptovta; + } + + public List getLsProdVigencia() { + return lsProdVigencia; + } + + public void setLsProdVigencia(List lsProdVigencia) { + this.lsProdVigencia = lsProdVigencia; + } + + public MyListbox getProdClaseServicioList() { + return prodClaseServicioList; + } + + public void setProdClaseServicioList(MyListbox prodClaseServicioList) { + this.prodClaseServicioList = prodClaseServicioList; + } + + public MyListbox getProdFormaPagoList() { + return prodFormaPagoList; + } + + public void setProdFormaPagoList(MyListbox prodFormaPagoList) { + this.prodFormaPagoList = prodFormaPagoList; + } + + public MyListbox getProdMarcaList() { + return prodMarcaList; + } + + public void setProdMarcaList(MyListbox prodMarcaList) { + this.prodMarcaList = prodMarcaList; + } + + public MyListbox getProdMercadoList() { + return prodMercadoList; + } + + public void setProdMercadoList(MyListbox prodMercadoList) { + this.prodMercadoList = prodMercadoList; + } + + public MyListbox getProdPuntoVentaList() { + return prodPuntoVentaList; + } + + public void setProdPuntoVentaList(MyListbox prodPuntoVentaList) { + this.prodPuntoVentaList = prodPuntoVentaList; + } + + public MyListbox getProdRutaList() { + return prodRutaList; + } + + public void setProdRutaList(MyListbox prodRutaList) { + this.prodRutaList = prodRutaList; + } + + public MyListbox getProdTipoptovtaList() { + return prodTipoptovtaList; + } + + public void setProdTipoptovtaList(MyListbox prodTipoptovtaList) { + this.prodTipoptovtaList = prodTipoptovtaList; + } + + public MyListbox getProdVigenciaList() { + return prodVigenciaList; + } + + public void setProdVigenciaList(MyListbox prodVigenciaList) { + this.prodVigenciaList = prodVigenciaList; + } + + public ProductoServicio getProductoServicio() { + return productoServicio; + } + + public void setProductoServicio(ProductoServicio productoServicio) { + this.productoServicio = productoServicio; + } + + public MyListbox getProductoServicioList() { + return productoServicioList; + } + + public void setProductoServicioList(MyListbox productoServicioList) { + this.productoServicioList = productoServicioList; + } + + public ProductoServicioService getProductoServicioService() { + return productoServicioService; + } + + public void setProductoServicioService(ProductoServicioService productoServicioService) { + this.productoServicioService = productoServicioService; + } + + public boolean isSalvo() { + return salvo; + } + + public void setSalvo(boolean salvo) { + this.salvo = salvo; + } + + public List getLsMarca() { + return lsMarca; + } + + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + public List getLsProdPrecio() { + return lsProdPrecio; + } + + public void setLsProdPrecio(List lsProdPrecio) { + this.lsProdPrecio = lsProdPrecio; + } + + public MarcaService getMarcaService() { + return marcaService; + } + + public void setMarcaService(MarcaService marcaService) { + this.marcaService = marcaService; + } + + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaAltaCortesiaRHController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaAltaCortesiaRHController.java new file mode 100644 index 000000000..e92d1c568 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaAltaCortesiaRHController.java @@ -0,0 +1,199 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.cortesias; + +import com.rjconsultores.ventaboletos.entidad.Cortesia; +import com.rjconsultores.ventaboletos.entidad.MotivoViaje; +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import com.rjconsultores.ventaboletos.service.MotivoViajeService; +import com.rjconsultores.ventaboletos.service.TipoCortesiaService; +import com.rjconsultores.ventaboletos.service.impl.CortesiaServiceImpl; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCortesia; +import com.trg.search.Filter; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Shiro + */ +@Controller("busquedaAltaCortesiaRHController") +@Scope("prototype") +public class BusquedaAltaCortesiaRHController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwCortesia; + @Autowired + private MotivoViajeService motivoViajeService; + @Autowired + private TipoCortesiaService tipoCortesiaService; + private MyListbox cortesiaList; + private Paging pagingCortesia; + private Textbox txtClave; + private List tipoCortesiaList; + private Textbox txtCortesiaId; + private Combobox cmbStatus; + private Combobox cmbMotivoViaje; + private Combobox cmbTipoCortesia; + private List motivoViajeList; + + public MyListbox getCortesiaList() { + return cortesiaList; + } + + public void setCortesiaList(MyListbox cortesiaList) { + this.cortesiaList = cortesiaList; + } + + public Paging getPagingCortesia() { + return pagingCortesia; + } + + public void setPagingCortesia(Paging pagingCortesia) { + this.pagingCortesia = pagingCortesia; + } + + public PagedListWrapper getPlwCortesia() { + return plwCortesia; + } + + public void setPlwCortesia(PagedListWrapper plwCortesia) { + this.plwCortesia = plwCortesia; + } + + public Textbox getTxtClave() { + return txtClave; + } + + public void setTxtClave(Textbox txtClave) { + this.txtClave = txtClave; + } + + public Textbox getTxtCortesiaId() { + return txtCortesiaId; + } + + public void setTxtCortesiaId(Textbox txtCortesiaId) { + this.txtCortesiaId = txtCortesiaId; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verEmpleadoCortesia(new Cortesia()); + + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + motivoViajeList = motivoViajeService.obtenerTodos(); + tipoCortesiaList = tipoCortesiaService.obtenerGrupoCortesia(3); + + super.doAfterCompose(comp); + + cortesiaList.setItemRenderer(new RenderCortesia()); + cortesiaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Cortesia cortesia = (Cortesia) cortesiaList.getSelected(); + verEmpleadoCortesia(cortesia); + } + }); + + refreshLista(); + } + + private void verEmpleadoCortesia(Cortesia cortesia) { + if (cortesia == null) { + return; + } + + Map args = new HashMap(); + args.put("cortesia", cortesia); + args.put("cortesiaList", cortesiaList); + + openWindow("/gui/cortesias/editarAltaCortesiaRH.zul", + Labels.getLabel("editarAltaCortesiaRHController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(Cortesia.class, pagingCortesia.getPageSize()); + + String intCVE = txtClave.getValue(); + if (!intCVE.equals("")) { + claseServicioBusqueda.addFilterEqual("empleado.cveEmpleado", intCVE); + } + + + if (cmbMotivoViaje.getSelectedItem() != null) { + claseServicioBusqueda.addFilterEqual("motivoViaje", (MotivoViaje) cmbMotivoViaje.getSelectedItem().getValue()); + } + + if (cmbTipoCortesia.getSelectedItem() != null) { + claseServicioBusqueda.addFilterEqual("tipoCortesia", (TipoCortesia) cmbTipoCortesia.getSelectedItem().getValue()); + } + + if (cmbStatus.getSelectedItem() != null) { + if (cmbStatus.getSelectedItem().getValue().equals(CortesiaServiceImpl.PENDIENTE)) { + claseServicioBusqueda.addFilterEqual("ndstatus", CortesiaServiceImpl.PENDIENTE); + } else { + claseServicioBusqueda.addFilterNot(Filter.equal("ndstatus", CortesiaServiceImpl.PENDIENTE)); + } + } + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwCortesia.init(claseServicioBusqueda, cortesiaList, pagingCortesia); + + if (cortesiaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public List getMotivoViajeList() { + return motivoViajeList; + } + + public void setMotivoViajeList(List motivoViajeList) { + this.motivoViajeList = motivoViajeList; + } + + public List getTipoCortesiaList() { + return tipoCortesiaList; + } + + public void setTipoCortesiaList(List tipoCortesiaList) { + this.tipoCortesiaList = tipoCortesiaList; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaCortesiaTipoDireccionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaCortesiaTipoDireccionController.java new file mode 100644 index 000000000..6f68f52c0 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaCortesiaTipoDireccionController.java @@ -0,0 +1,248 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.cortesias; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.CortesiaDireccion; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.CortesiaDireccionService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCortesiaDireccion; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; + +/** + * + * @author Shiro + */ +@Controller("busquedaCortesiaTipoDireccionController") +@Scope("prototype") +public class BusquedaCortesiaTipoDireccionController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwCortesiaDireccion; + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private CortesiaDireccionService cortesiaDireccionService; + private MyListbox cortesiaDireccionList; + private List marcaList; + private List claseServicioList; + private List cdsList; + private Paging pagingCortesiaDireccion; + private Combobox cmbMarca; + private Combobox cmbClaseSer; + private Datebox fecInicio; + private Datebox fecFinal; + + public List getCdsList() { + return cdsList; + } + + public void setCdsList(List cdsList) { + this.cdsList = cdsList; + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public CortesiaDireccionService getCortesiaDireccionService() { + return cortesiaDireccionService; + } + + public void setCortesiaDireccionService(CortesiaDireccionService cortesiaDireccionService) { + this.cortesiaDireccionService = cortesiaDireccionService; + } + + public ClaseServicioService getClaseServicioService() { + return claseServicioService; + } + + public void setClaseServicioService(ClaseServicioService claseServicioService) { + this.claseServicioService = claseServicioService; + } + + public Combobox getCmbClaseSer() { + return cmbClaseSer; + } + + public void setCmbClaseSer(Combobox cmbClaseSer) { + this.cmbClaseSer = cmbClaseSer; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public MyListbox getCortesiaDireccionList() { + return cortesiaDireccionList; + } + + public void setCortesiaDireccionList(MyListbox cortesiaDireccionList) { + this.cortesiaDireccionList = cortesiaDireccionList; + } + + public MarcaService getMarcaService() { + return marcaService; + } + + public void setMarcaService(MarcaService marcaService) { + this.marcaService = marcaService; + } + + public Paging getPagingCortesiaDireccion() { + return pagingCortesiaDireccion; + } + + public void setPagingCortesiaDireccion(Paging pagingCortesiaDireccion) { + this.pagingCortesiaDireccion = pagingCortesiaDireccion; + } + + public PagedListWrapper getPlwCortesiaDireccion() { + return plwCortesiaDireccion; + } + + public void setPlwCortesiaDireccion(PagedListWrapper plwCortesiaDireccion) { + this.plwCortesiaDireccion = plwCortesiaDireccion; + } + + public List getClaseServicioList() { + return claseServicioList; + } + + public void setClaseServicioList(List claseServicioList) { + this.claseServicioList = claseServicioList; + } + + public List getMarcaList() { + return marcaList; + } + + public void setMarcaList(List marcaList) { + this.marcaList = marcaList; + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verCortesiaDireccion(new CortesiaDireccion()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + marcaList = marcaService.buscarDescricaoIdMarca(); + claseServicioList = claseServicioService.obtenerTodos(); + super.doAfterCompose(comp); + + cortesiaDireccionList.setItemRenderer(new RenderCortesiaDireccion()); + + cortesiaDireccionList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + CortesiaDireccion cd = (CortesiaDireccion) cortesiaDireccionList.getSelected(); + verCortesiaDireccion(cd); + } + }); + + + cdsList = new ArrayList(); + refreshLista(); + + + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + private void verCortesiaDireccion(CortesiaDireccion cd) { + if (cd == null) { + return; + } + + Map args = new HashMap(); + args.put("cortesiaDireccion", cd); + args.put("cortesiaDireccionList", cortesiaDireccionList); + + openWindow("/gui/cortesias/editarCortesiaTipoDireccion.zul", + Labels.getLabel("editarCortesiaTipoDireccionController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(CortesiaDireccion.class, pagingCortesiaDireccion.getPageSize()); + + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + + claseServicioBusqueda.addFilterGreaterOrEqual("fecInicioV", fecInicio.getValue()); + claseServicioBusqueda.addFilterLessOrEqual("fecFinV", fecFinal.getValue()); + + Comboitem cbiMarca = cmbMarca.getSelectedItem(); + Marca marca = null; + if (cbiMarca != null) { + marca = (Marca) cbiMarca.getValue(); + claseServicioBusqueda.addFilterEqual("marca", marca); + } + + Comboitem cbiClaseServicio = cmbClaseSer.getSelectedItem(); + ClaseServicio claseServicio = null; + if (cbiClaseServicio != null) { + claseServicio = (ClaseServicio) cbiClaseServicio.getValue(); + claseServicioBusqueda.addFilterEqual("claseServicio", claseServicio); + } + + plwCortesiaDireccion.init(claseServicioBusqueda, cortesiaDireccionList, pagingCortesiaDireccion); + + if (cortesiaDireccionList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("editarCortesiaTipoDireccionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaGrupoCortesiasController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaGrupoCortesiasController.java new file mode 100644 index 000000000..56083c6f2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaGrupoCortesiasController.java @@ -0,0 +1,137 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.cortesias; + +import com.rjconsultores.ventaboletos.entidad.GrupoCortesia; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderGrupoCortesias; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Shiro + */ +@Controller("busquedaGrupoCortesiasController") +@Scope("prototype") +public class BusquedaGrupoCortesiasController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwGrupoCortesias; + private MyListbox grupoCortesiaList; + private Paging pagingGrupoCortesia; + private Textbox txtNombre; + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public MyListbox getGrupoCortesiaList() { + return grupoCortesiaList; + } + + public void setGrupoCortesiaList(MyListbox grupoCortesiaList) { + this.grupoCortesiaList = grupoCortesiaList; + } + + public Paging getPagingGrupoCortesia() { + return pagingGrupoCortesia; + } + + public void setPagingGrupoCortesia(Paging pagingGrupoCortesia) { + this.pagingGrupoCortesia = pagingGrupoCortesia; + } + + public PagedListWrapper getPlwGrupoCortesias() { + return plwGrupoCortesias; + } + + public void setPlwGrupoCortesias(PagedListWrapper plwGrupoCortesias) { + this.plwGrupoCortesias = plwGrupoCortesias; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verGrupoCortesia(new GrupoCortesia()); + + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + grupoCortesiaList.setItemRenderer(new RenderGrupoCortesias()); + grupoCortesiaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + GrupoCortesia gc = (GrupoCortesia) grupoCortesiaList.getSelected(); + verGrupoCortesia(gc); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verGrupoCortesia(GrupoCortesia gc) { + if (gc == null) { + return; + } + + Map args = new HashMap(); + args.put("grupoCortesia", gc); + args.put("grupoCortesiaList", grupoCortesiaList); + + openWindow("/gui/cortesias/editarGrupoCortesias.zul", + Labels.getLabel("editarGrupoCortesiasController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(GrupoCortesia.class, pagingGrupoCortesia.getPageSize()); + + claseServicioBusqueda.addFilterLike("descgrupo", "%" + txtNombre.getText().trim().concat("%")); + claseServicioBusqueda.addSortAsc("descgrupo"); + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + + + plwGrupoCortesias.init(claseServicioBusqueda, grupoCortesiaList, pagingGrupoCortesia); + + if (grupoCortesiaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaGrupoCortesiasController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaTipoCortesiaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaTipoCortesiaController.java new file mode 100644 index 000000000..e796e9f51 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaTipoCortesiaController.java @@ -0,0 +1,178 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.cortesias; + +import com.rjconsultores.ventaboletos.entidad.GrupoCortesia; +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import com.rjconsultores.ventaboletos.service.GrupoCortesiasService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoCortesia; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Shiro + */ +@Controller("busquedaTipoCortesiaController") +@Scope("prototype") +public class BusquedaTipoCortesiaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTipoCortesia; + @Autowired + private GrupoCortesiasService grupoCortesiaService; + private List grupoCortesiaList; + private MyListbox tipoCortesiaList; + private Paging pagingtipoCortesia; + private Textbox txtNome; + private Combobox cmbGrupoCortesia; + + public Paging getPagingtipoCortesia() { + return pagingtipoCortesia; + } + + public void setPagingtipoCortesia(Paging pagingtipoCortesia) { + this.pagingtipoCortesia = pagingtipoCortesia; + } + + public PagedListWrapper getPlwTipoCortesia() { + return plwTipoCortesia; + } + + public void setPlwTipoCortesia(PagedListWrapper plwTipoCortesia) { + this.plwTipoCortesia = plwTipoCortesia; + } + + public MyListbox getTipoCortesiaList() { + return tipoCortesiaList; + } + + public void setTipoCortesiaList(MyListbox tipoCortesiaList) { + this.tipoCortesiaList = tipoCortesiaList; + } + + public GrupoCortesiasService getGrupoCortesiaService() { + return grupoCortesiaService; + } + + public void setGrupoCortesiaService(GrupoCortesiasService grupoCortesiaService) { + this.grupoCortesiaService = grupoCortesiaService; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Combobox getCmbGrupoCortesia() { + return cmbGrupoCortesia; + } + + public void setCmbGrupoCortesia(Combobox cmbGrupoCortesia) { + this.cmbGrupoCortesia = cmbGrupoCortesia; + } + + public List getGrupoCortesiaList() { + return grupoCortesiaList; + } + + public void setGrupoCortesiaList(List grupoCortesiaList) { + this.grupoCortesiaList = grupoCortesiaList; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTipoCortesia(new TipoCortesia()); + + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + grupoCortesiaList = grupoCortesiaService.obtenerTodos(); + super.doAfterCompose(comp); + + tipoCortesiaList.setItemRenderer(new RenderTipoCortesia()); + tipoCortesiaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TipoCortesia tc = (TipoCortesia) tipoCortesiaList.getSelected(); + verTipoCortesia(tc); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verTipoCortesia(TipoCortesia tc) { + if (tc == null) { + return; + } + + Map args = new HashMap(); + args.put("tipoCortesia", tc); + args.put("tipoCortesiaList", tipoCortesiaList); + + openWindow("/gui/cortesias/editarTipoCortesia.zul", + Labels.getLabel("editarTipoCortesiaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(TipoCortesia.class, pagingtipoCortesia.getPageSize()); + + Comboitem cbi = cmbGrupoCortesia.getSelectedItem(); + GrupoCortesia gc = null; + if (cbi != null) { + gc = (GrupoCortesia) cbi.getValue(); + claseServicioBusqueda.addFilterEqual("grupoCortesia", gc); + } + + claseServicioBusqueda.addFilterLike("desctipo", "%" + txtNome.getText().trim().concat("%")); + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + + claseServicioBusqueda.addSortAsc("desctipo"); + + plwTipoCortesia.init(claseServicioBusqueda, tipoCortesiaList, pagingtipoCortesia); + + if (tipoCortesiaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("editarTipoCortesiaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaTipoCortesiaDController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaTipoCortesiaDController.java new file mode 100644 index 000000000..193cdec5b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/BusquedaTipoCortesiaDController.java @@ -0,0 +1,173 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.cortesias; + +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import com.rjconsultores.ventaboletos.entidad.TipoCortesiaDescuento; +import com.rjconsultores.ventaboletos.service.TipoCortesiaDescuentoService; +import com.rjconsultores.ventaboletos.service.TipoCortesiaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoCortesiaD; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Paging; + +/** + * + * @author Shiro + */ +@Controller("busquedaTipoCortesiaDController") +@Scope("prototype") +public class BusquedaTipoCortesiaDController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTipoCortesiaD; + @Autowired + private TipoCortesiaService tipoCortesiaService; + @Autowired + private TipoCortesiaDescuentoService tipoCortesiaDescuentoService; + private MyListbox tipoCortesiaDList; + private Paging pagingTipoCortesiaD; + private Combobox cmbTipoCortesia; + private List tipoCortesiaList; + + public MyListbox getTipoCortesiaDList() { + return tipoCortesiaDList; + } + + public void setTipoCortesiaDList(MyListbox tipoCortesiaDList) { + this.tipoCortesiaDList = tipoCortesiaDList; + } + + public Paging getPagingTipoCortesiaD() { + return pagingTipoCortesiaD; + } + + public void setPagingTipoCortesiaD(Paging pagingTipoCortesiaD) { + this.pagingTipoCortesiaD = pagingTipoCortesiaD; + } + + public PagedListWrapper getPlwTipoCortesiaD() { + return plwTipoCortesiaD; + } + + public void setPlwTipoCortesiaD(PagedListWrapper plwTipoCortesiaD) { + this.plwTipoCortesiaD = plwTipoCortesiaD; + } + + public Combobox getCmbTipoCortesia() { + return cmbTipoCortesia; + } + + public void setCmbTipoCortesia(Combobox cmbTipoCortesia) { + this.cmbTipoCortesia = cmbTipoCortesia; + } + + public List getTipoCortesiaList() { + return tipoCortesiaList; + } + + public void setTipoCortesiaList(List tipoCortesiaList) { + this.tipoCortesiaList = tipoCortesiaList; + } + + public TipoCortesiaService getTipoCortesiaService() { + return tipoCortesiaService; + } + + public void setTipoCortesiaService(TipoCortesiaService tipoCortesiaService) { + this.tipoCortesiaService = tipoCortesiaService; + } + + public TipoCortesiaDescuentoService getTipoCortesiaDescuentoService() { + return tipoCortesiaDescuentoService; + } + + public void setTipoCortesiaDescuentoService(TipoCortesiaDescuentoService tipoCortesiaDescuentoService) { + this.tipoCortesiaDescuentoService = tipoCortesiaDescuentoService; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTipoCortesiaD(new TipoCortesiaDescuento()); + + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + tipoCortesiaList = tipoCortesiaService.obtenerTodos(); + super.doAfterCompose(comp); + + tipoCortesiaDList.setItemRenderer(new RenderTipoCortesiaD()); + + tipoCortesiaDList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TipoCortesiaDescuento tcd = (TipoCortesiaDescuento) tipoCortesiaDList.getSelected(); + verTipoCortesiaD(tcd); + } + }); + + refreshLista(); + } + + private void verTipoCortesiaD(TipoCortesiaDescuento tcd) { + if (tcd == null) { + return; + } + + Map args = new HashMap(); + args.put("tipoCortesiaD", tcd); + args.put("tipoCortesiaDList", tipoCortesiaDList); + + openWindow("/gui/cortesias/editarTipoCortesiaD.zul", + Labels.getLabel("editarTipoCortesiaDController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(TipoCortesiaDescuento.class, pagingTipoCortesiaD.getPageSize()); + + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + TipoCortesia tipoCortesia = (TipoCortesia) (cmbTipoCortesia.getSelectedItem() != null ? cmbTipoCortesia.getSelectedItem().getValue() : null); + if (tipoCortesia != null) { + claseServicioBusqueda.addFilterEqual("tipoCortesia", tipoCortesia); + } + + claseServicioBusqueda.addSortAsc("tipoCortesia.desctipo"); + + plwTipoCortesiaD.init(claseServicioBusqueda, tipoCortesiaDList, pagingTipoCortesiaD); + + if (tipoCortesiaDList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTipoVentaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarAltaCortesiaRHController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarAltaCortesiaRHController.java new file mode 100644 index 000000000..8ccabe31f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarAltaCortesiaRHController.java @@ -0,0 +1,952 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.cortesias; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Cortesia; +import com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario; +import com.rjconsultores.ventaboletos.entidad.Empleado; +import com.rjconsultores.ventaboletos.entidad.GrupoCortesia; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.MotivoViaje; +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import com.rjconsultores.ventaboletos.entidad.TipoCortesiaDescuento; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.CortesiaBeneficiarioService; +import com.rjconsultores.ventaboletos.service.CortesiaService; +import com.rjconsultores.ventaboletos.service.EmpleadoService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.MotivoViajeService; +import com.rjconsultores.ventaboletos.service.TipoCortesiaDescuentoService; +import com.rjconsultores.ventaboletos.service.TipoCortesiaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCortesiaBeneficiario; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zkplus.databind.BindingListModel; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Tab; +import org.zkoss.zul.Textbox; + +/** + * + * @author Shiro + */ +@Controller("editarAltaCortesiaRHController") +@Scope("prototype") +public class EditarAltaCortesiaRHController extends MyGenericForwardComposer { + + @Autowired + private EmpleadoService empleadoService; + @Autowired + private TipoCortesiaService tipoCortesiaService; + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private MotivoViajeService motivoViajeService; + @Autowired + private CortesiaService cortesiaService; + @Autowired + private TipoCortesiaDescuentoService tipoCortesiaDescuentoService; + @Autowired + private CortesiaBeneficiarioService cortesiaBeneficiarioService; + private Combobox cmbTipoCortesia; + private List tipoCortesiaList; + private List marcaList; + private List claseServicioList; + private List motivoViajeList; + private List tipoCortesiaDescuentoList; + private List cortesiasList; + private List empleadoLis1; + private List cortesiaBeneficiarioList; + private Empleado empleado; + private GrupoCortesia gc; + private TipoCortesia tc; + private TipoCortesiaDescuento td; + private Cortesia cortesia; + private MyListbox empleadoList; + private MyListbox cortesiaList; + private MyListbox beneficiarioList; + private Textbox txtNome; + private Radio radioSencillo; + private Radio radioRedondo; + private Radio radioEmpleado; + private Radio radioFamiliar; + private Datebox fecinicio; + private Datebox fecfinal; + private Datebox fecIda; + private Datebox fecRegreso; + private Combobox cmbtipoC; + private Combobox cmbmarca; + private Combobox cmbclaseser; + private MyComboboxParada cmbdestino; + private MyComboboxParada cmborigen; + private Combobox cmbmotivo; + private Combobox cmbtP; + private Textbox txtNomBene; + private Textbox txtApPBene; + private Textbox txtApMBene; + private Textbox txtClaveE; + private Textbox txtCortesia; + private Textbox txtNombre; + private Textbox txtApP; + private Textbox txtApM; + private Textbox txtEmpresa; + private Textbox txtPuesto; + private Button btnSalvar; + private Button btnSalvarBeneficiario; + private Button btnPesquisa; + private Button btnApagarBeneficiario; + private static Logger log = Logger.getLogger(EditarAltaCortesiaRHController.class); + private Button btnApagar; + private Tab tabViaje; + private Tab tabBeneficiarios; + private Tab tabEmpleado; + + @Override + public void doAfterCompose(Component comp) throws Exception { + tipoCortesiaList = tipoCortesiaService.obtenerGrupoCortesia(3); + marcaList = marcaService.obtenerTodos(); + claseServicioList = claseServicioService.obtenerTodos(); + motivoViajeList = motivoViajeService.obtenerTodos(); + + super.doAfterCompose(comp); + + Cortesia cortesiaA = (Cortesia) Executions.getCurrent().getArg().get("cortesia"); + cortesia = (cortesiaA.getCortesiaId() == null) ? cortesiaA : cortesiaService.obtenerID(cortesiaA.getCortesiaId()); + cortesiaList = (MyListbox) Executions.getCurrent().getArg().get("cortesiaList"); + + empleado = cortesia.getEmpleado(); + + if (cortesia.getCortesiaId() != null) { + if (cortesia.getIndtipoviaje().equals("S")) { + radioSencillo.setChecked(true); + } else if (cortesia.getIndtipoviaje().equals("R")) { + radioRedondo.setChecked(true); + } + + btnSalvar.setDisabled(true); + btnApagarBeneficiario.setDisabled(true); + btnSalvarBeneficiario.setDisabled(true); + txtNome.setDisabled(true); + cmbTipoCortesia.setDisabled(true); + cmbmarca.setDisabled(true); + cmbclaseser.setDisabled(true); + cmborigen.setDisabled(true); + cmbdestino.setDisabled(true); + fecinicio.setDisabled(true); + fecfinal.setDisabled(true); + cmbmotivo.setDisabled(true); + btnPesquisa.setDisabled(true); + + if (cortesiaService.cortesiaUtilizada(cortesia)) { + btnApagar.setDisabled(true); + } + } + beneficiarioList.setItemRenderer(new RenderCortesiaBeneficiario()); + cortesiaBeneficiarioList = new ArrayList(); + beneficiarioList.setData(cortesiaBeneficiarioList); + + if (cortesia.getCortesiaId() == null) { + btnApagar.setVisible(false); + radioSencillo.setChecked(true); + + } else { + onClick$radioEmpleado(null); + + cortesiaBeneficiarioList = cortesia.getCortesiaBeneficiarioList(); + beneficiarioList.setData(cortesiaBeneficiarioList); + + onChange$cmbTipoCortesia(null); + + } + + radioEmpleado.setChecked(true); + activaAba(); + txtNome.focus(); + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + txtClaveE.setConstraint("no empty"); + txtClaveE.getValue(); + String empleadoClv = txtClaveE.getText().trim(); + txtClaveE.setConstraint(""); + if (empleadoClv.isEmpty()) { + empleadoClv = cortesia.getEmpleado().getCveEmpleado(); + } + List empleadoClvList = empleadoService.pesquisaClave(empleadoClv); + + if (empleadoClvList.isEmpty()) { + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.naoEmpleado"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + for (Empleado e : empleadoClvList) { + if (e.getCveEmpleado().equals(empleadoClv)) { + + txtNombre.setText(e.getNombEmpleado()); + txtApP.setText(e.getNombPaterno()); + txtApM.setText(e.getNombMaterno()); + if (e.getEmpresa() != null) { + txtEmpresa.setText(e.getEmpresa().getNombempresa()); + } + + empleado = e; + cortesia.setEmpleado(empleado); + onClick$radioEmpleado(null); + } + } + } + + } + + private void activaAba() { + boolean activaAba = true; + if ((cortesia == null) || (cortesia.getTipoCortesia() == null)) { + activaAba = false; + } + tabBeneficiarios.setDisabled(!activaAba); + tabViaje.setDisabled(!activaAba); + } + + public void onChange$cmbTipoCortesia(Event ev) { + + if (cortesia.getCortesiaId() != null) { + tipoCortesiaDescuentoList = tipoCortesiaDescuentoService.pesquisar(cortesia.getTipoCortesia()); + BindingListModel bdlm = new BindingListModelList(tipoCortesiaDescuentoList, true); + cmbtP.setModel(bdlm); + } else { + + if (cmbTipoCortesia.getSelectedItem() == null) { + return; + } + tipoCortesiaDescuentoList = tipoCortesiaDescuentoService.pesquisar((TipoCortesia) cmbTipoCortesia.getSelectedItem().getValue()); + BindingListModel bdlm = new BindingListModelList(tipoCortesiaDescuentoList, true); + cmbtP.setModel(bdlm); + } + activaAba(); + } + + public void onChange$fecinicio(Event ev) throws InterruptedException { + onClick$btnPesquisa(null); + } + + public void onChange$fecfinal(Event ev) throws InterruptedException { + onClick$btnPesquisa(null); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + if (cortesia.getEmpleado() == null) { + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.empleado"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + + cmbTipoCortesia.getValue(); + cmbmarca.getValue(); + cmbclaseser.getValue(); + cmborigen.getValue(true); + fecinicio.getValue(); + fecfinal.getValue(); + cmbdestino.getValue(true); + cmbmotivo.getValue(); + txtNome.getValue(); + + if (fecinicio.getValue().after(fecfinal.getValue())) { + try { + Messagebox.show(Labels.getLabel("editarAltaCortesiaRHController.MSG.CortesiaAlta"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + } catch (InterruptedException ex) { + log.error(ex); + } + } else { + try { + if (cortesia.getEmpleado() == null) { + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.empleado"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (cortesia.getTipoCortesia() == null) { + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.cortesia"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (cortesia.getMarca() == null) { + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.marca"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (cortesia.getClaseServicio() == null) { + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.clase"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (cortesia.getOrigem() == null) { + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.origen"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (cortesia.getDestino() == null) { + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.destino"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (cortesia.getMotivoViaje() == null) { + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.motivo"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (cortesiaBeneficiarioList.isEmpty()) { + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.beneficiario"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + + boolean podeSalvar = false; + + List lsCortesias = cortesiaService.buscarDplicidad(cortesia); + + if (lsCortesias.isEmpty()) { + podeSalvar = true; + } else { + for (Cortesia c : lsCortesias) { + if (c.getCortesiaId().equals(cortesia.getCortesiaId())) { + podeSalvar = true; + } + } + } + + if (podeSalvar) { + cortesia.setFecinicio(fecinicio.getValue()); + cortesia.setFecfinal(fecfinal.getValue()); + cortesia.setNdstatus("P"); + cortesia.setActivo(Boolean.TRUE); + cortesia.setFecmodif(Calendar.getInstance().getTime()); + cortesia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + cortesia.setCortesiaBeneficiarioList(cortesiaBeneficiarioList); + + if (radioSencillo.isChecked()) { + cortesia.setIndtipoviaje("S"); + } else if (radioRedondo.isChecked()) { + cortesia.setIndtipoviaje("R"); + } + + if (cortesia.getCortesiaId() == null) { + cortesiaService.suscribir(cortesia); + cortesiaList.addItem(cortesia); + } else { + cortesiaService.actualizacion(cortesia); + cortesiaList.updateItem(cortesia); + } + + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.suscribirOK"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + + Messagebox.show( + MessageFormat.format(Labels.getLabel("editarAltaCortesiaRHController.MSG.informacionNumeroIdGenerado"), cortesia.getCortesiaId()), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.ERROR); + } + + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.borrarPergunta"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + cortesiaService.borrar(cortesia); + + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.borrarOK"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + cortesiaList.removeItem(cortesia); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnSalvarBeneficiario(Event ev) { + + txtNomBene.getValue(); + txtApPBene.getValue(); + txtApMBene.getValue(); + cmbtP.getValue(); + + try { + TipoCortesiaDescuento tcd; + try { + tcd = (TipoCortesiaDescuento) cmbtP.getSelectedItem().getValue(); + boolean existe = false; + for (CortesiaBeneficiario cb : cortesiaBeneficiarioList) { + if (cb.getNombBenef().equals(txtNomBene.getValue())) { + existe = true; + } + } + if (!existe) { + CortesiaBeneficiario cb = new CortesiaBeneficiario(); + cb.setCortesia(cortesia); + cb.setNombBenef(txtNomBene.getValue()); + cb.setNombPaterno(txtApPBene.getValue()); + cb.setNombMaterno(txtApMBene.getValue()); + cb.setFecUtilizacionIda(null); + cb.setFecUtilizacionRegreso(null); + cb.setDescuento(tcd); + cb.setActivo(Boolean.TRUE); + cb.setFecmodif(Calendar.getInstance().getTime()); + cb.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (radioEmpleado.isChecked()) { + cb.setIndtipobenef("E"); + } else if (radioFamiliar.isChecked()) { + cb.setIndtipobenef("F"); + } + cortesiaBeneficiarioList.add(cb); + beneficiarioList.setData(cortesiaBeneficiarioList); + cortesia.setCortesiaBeneficiarioList(cortesiaBeneficiarioList); + }else{ + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.yaExisteBeneficiario"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception e) { + Messagebox.show( + Labels.getLabel("editarAltaCortesiaRHController.MSG.porcentaje"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnApagarBeneficiario(Event ev) { + try { + CortesiaBeneficiario cb = (CortesiaBeneficiario) beneficiarioList.getSelected(); + if (cb != null) { + cortesiaBeneficiarioList.remove(cb); + + beneficiarioList.removeItem(cb); + + cortesia.setCortesiaBeneficiarioList(cortesiaBeneficiarioList); + } + + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarAltaCortesiaRHController.window.title"), + Messagebox.ERROR); + } + } + + private void voltarAbaEmpleado() { +// Comboitem cbiTipoCortersia = cmbTipoCortesia.getSelectedItem(); +// if (cbiTipoCortersia == null) { +// tabEmpleado.getTabbox().setSelectedTab(tabEmpleado); +// +// try { +// Messagebox.show( +// Labels.getLabel("editarAltaCortesiaRHController.MSG.cortesia"), +// Labels.getLabel("editarAltaCortesiaRHController.window.title"), +// Messagebox.OK, Messagebox.EXCLAMATION); +// } catch (Exception ex) { +// log.error(ex); +// } +// } + } + + public void onClick$tabViaje(Event ev) { + voltarAbaEmpleado(); + } + + public void onClick$tabBeneficiarios(Event ev) { + voltarAbaEmpleado(); + } + + public TipoCortesiaDescuento getTd() { + return td; + } + + public void setTd(TipoCortesiaDescuento td) { + this.td = td; + } + + public GrupoCortesia getGc() { + return gc; + } + + public void setGc(GrupoCortesia gc) { + this.gc = gc; + } + + public TipoCortesia getTc() { + return tc; + } + + public void setTc(TipoCortesia tc) { + this.tc = tc; + } + + public Combobox getCmbtP() { + return cmbtP; + } + + public void setCmbtP(Combobox cmbtP) { + this.cmbtP = cmbtP; + } + + public Textbox getTxtApM() { + return txtApM; + } + + public void setTxtApM(Textbox txtApM) { + this.txtApM = txtApM; + } + + public Textbox getTxtApP() { + return txtApP; + } + + public void setTxtApP(Textbox txtApP) { + this.txtApP = txtApP; + } + + public Textbox getTxtEmpresa() { + return txtEmpresa; + } + + public void setTxtEmpresa(Textbox txtEmpresa) { + this.txtEmpresa = txtEmpresa; + } + + public Textbox getTxtPuesto() { + return txtPuesto; + } + + public void setTxtPuesto(Textbox txtPuesto) { + this.txtPuesto = txtPuesto; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public MyListbox getBeneficiarioList() { + return beneficiarioList; + } + + public void setBeneficiarioList(MyListbox beneficiarioList) { + this.beneficiarioList = beneficiarioList; + } + + public List getEmpleadoLis1() { + return empleadoLis1; + } + + public void setEmpleadoLis1(List empleadoLis1) { + this.empleadoLis1 = empleadoLis1; + } + + public Textbox getTxtApMBene() { + return txtApMBene; + } + + public void setTxtApMBene(Textbox txtApMBene) { + this.txtApMBene = txtApMBene; + } + + public Textbox getTxtApPBene() { + return txtApPBene; + } + + public void setTxtApPBene(Textbox txtApPBene) { + this.txtApPBene = txtApPBene; + } + + public Textbox getTxtNomBene() { + return txtNomBene; + } + + public void setTxtNomBene(Textbox txtNomBene) { + this.txtNomBene = txtNomBene; + } + + public Combobox getCmbclaseser() { + return cmbclaseser; + } + + public void setCmbclaseser(Combobox cmbclaseser) { + this.cmbclaseser = cmbclaseser; + } + + public Combobox getCmbmarca() { + return cmbmarca; + } + + public void setCmbmarca(Combobox cmbmarca) { + this.cmbmarca = cmbmarca; + } + + public Combobox getCmbmotivo() { + return cmbmotivo; + } + + public void setCmbmotivo(Combobox cmbmotivo) { + this.cmbmotivo = cmbmotivo; + } + + public Combobox getCmbtipoC() { + return cmbtipoC; + } + + public void setCmbtipoC(Combobox cmbtipoC) { + this.cmbtipoC = cmbtipoC; + } + + public Datebox getFecfinal() { + return fecfinal; + } + + public void setFecfinal(Datebox fecfinal) { + this.fecfinal = fecfinal; + } + + public Datebox getFecinicio() { + return fecinicio; + } + + public void setFecinicio(Datebox fecinicio) { + this.fecinicio = fecinicio; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Combobox getCmbTipoCortesia() { + return cmbTipoCortesia; + } + + public void setCmbTipoCortesia(Combobox cmbTipoCortesia) { + this.cmbTipoCortesia = cmbTipoCortesia; + } + + public List getTipoCortesiaList() { + return tipoCortesiaList; + } + + public void setTipoCortesiaList(List tipoCortesiaList) { + this.tipoCortesiaList = tipoCortesiaList; + } + + public TipoCortesiaService getTipoCortesiaService() { + return tipoCortesiaService; + } + + public void setTipoCortesiaService(TipoCortesiaService tipoCortesiaService) { + this.tipoCortesiaService = tipoCortesiaService; + } + + public List getClaseServicioList() { + return claseServicioList; + } + + public void setClaseServicioList(List claseServicioList) { + this.claseServicioList = claseServicioList; + } + + public List getMarcaList() { + return marcaList; + } + + public void setMarcaList(List marcaList) { + this.marcaList = marcaList; + } + + public List getMotivoViajeList() { + return motivoViajeList; + } + + public void setMotivoViajeList(List motivoViajeList) { + this.motivoViajeList = motivoViajeList; + } + + public Radio getRadioEmpleado() { + return radioEmpleado; + } + + public void setRadioEmpleado(Radio radioEmpleado) { + this.radioEmpleado = radioEmpleado; + } + + public Radio getRadioFamiliar() { + return radioFamiliar; + } + + public void setRadioFamiliar(Radio radioFamiliar) { + this.radioFamiliar = radioFamiliar; + } + + public List getTipoCortesiaDescuentoList() { + return tipoCortesiaDescuentoList; + } + + public void setTipoCortesiaDescuentoList(List tipoCortesiaDescuentoList) { + this.tipoCortesiaDescuentoList = tipoCortesiaDescuentoList; + } + + public Radio getRadioRedondo() { + return radioRedondo; + } + + public void setRadioRedondo(Radio radioRedondo) { + this.radioRedondo = radioRedondo; + } + + public Radio getRadioSencillo() { + return radioSencillo; + } + + public void setRadioSencillo(Radio radioSencillo) { + this.radioSencillo = radioSencillo; + } + + public Empleado getEmpleado() { + return empleado; + } + + public void setEmpleado(Empleado empleado) { + this.empleado = empleado; + } + + public List getCortesiasList() { + return cortesiasList; + } + + public void setCortesiasList(List cortesiasList) { + this.cortesiasList = cortesiasList; + } + + public MyListbox getEmpleadoList() { + return empleadoList; + } + + public void setEmpleadoList(MyListbox empleadoList) { + this.empleadoList = empleadoList; + } + + public Cortesia getCortesia() { + return cortesia; + } + + public void setCortesia(Cortesia cortesia) { + this.cortesia = cortesia; + } + + public Textbox getTxtClaveE() { + return txtClaveE; + } + + public void setTxtClaveE(Textbox txtClaveE) { + this.txtClaveE = txtClaveE; + } + + public List getCortesiaBeneficiarioList() { + return cortesiaBeneficiarioList; + } + + public void setCortesiaBeneficiarioList(List cortesiaBeneficiarioList) { + this.cortesiaBeneficiarioList = cortesiaBeneficiarioList; + } + + public Button getBtnSalvar() { + return btnSalvar; + } + + public void setBtnSalvar(Button btnSalvar) { + this.btnSalvar = btnSalvar; + } + + public CortesiaBeneficiarioService getCortesiaBeneficiarioService() { + return cortesiaBeneficiarioService; + } + + public void setCortesiaBeneficiarioService(CortesiaBeneficiarioService cortesiaBeneficiarioService) { + this.cortesiaBeneficiarioService = cortesiaBeneficiarioService; + } + + public Textbox getTxtCortesia() { + return txtCortesia; + } + + public void setTxtCortesia(Textbox txtCortesia) { + this.txtCortesia = txtCortesia; + } + + public MyListbox getCortesiaList() { + return cortesiaList; + } + + public void setCortesiaList(MyListbox cortesiaList) { + this.cortesiaList = cortesiaList; + } + + public Datebox getFecIda() { + return fecIda; + } + + public void setFecIda(Datebox fecIda) { + this.fecIda = fecIda; + } + + public Datebox getFecRegreso() { + return fecRegreso; + } + + public void setFecRegreso(Datebox fecRegreso) { + this.fecRegreso = fecRegreso; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Button getBtnApagarBeneficiario() { + return btnApagarBeneficiario; + } + + public void setBtnApagarBeneficiario(Button btnApagarBeneficiario) { + this.btnApagarBeneficiario = btnApagarBeneficiario; + } + + public Tab getTabBeneficiarios() { + return tabBeneficiarios; + } + + public void setTabBeneficiarios(Tab tabBeneficiarios) { + this.tabBeneficiarios = tabBeneficiarios; + } + + public Tab getTabEmpleado() { + return tabEmpleado; + } + + public void setTabEmpleado(Tab tabEmpleado) { + this.tabEmpleado = tabEmpleado; + } + + public Tab getTabViaje() { + return tabViaje; + } + + public void setTabViaje(Tab tabViaje) { + this.tabViaje = tabViaje; + } + + public void onClick$radioEmpleado(Event e) { + + txtNomBene.setText(empleado.getNombEmpleado()); + txtApPBene.setText(empleado.getNombPaterno()); + txtApMBene.setText(empleado.getNombMaterno()); + + txtNomBene.setDisabled(true); + txtApPBene.setDisabled(true); + txtApMBene.setDisabled(true); + } + + public void onClick$radioFamiliar(Event e) { + txtNomBene.setConstraint((String) null); + txtApPBene.setConstraint((String) null); + txtApMBene.setConstraint((String) null); + txtNomBene.setText(""); + txtApPBene.setText(""); + txtApMBene.setText(""); + txtNomBene.setConstraint("no empty"); + txtApPBene.setConstraint("no empty"); + txtApMBene.setConstraint("no empty"); + + txtNomBene.setDisabled(false); + txtApPBene.setDisabled(false); + txtApMBene.setDisabled(false); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarCortesiaTipoDireccionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarCortesiaTipoDireccionController.java new file mode 100644 index 000000000..018f9180c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarCortesiaTipoDireccionController.java @@ -0,0 +1,354 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.cortesias; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.CortesiaDireccion; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.TipoCortesiaDescuento; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.CortesiaDireccionService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.TipoCortesiaDescuentoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Shiro + */ +@Controller("editarCortesiaTipoDireccionController") +@Scope("prototype") +public class EditarCortesiaTipoDireccionController extends MyGenericForwardComposer { + + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private TipoCortesiaDescuentoService cortesiaDescuentoService; + @Autowired + private CortesiaDireccionService direccionService; + private CortesiaDireccion cortesiaDireccion; + private MyListbox cortesiaDireccionList; + private List marcaList; + private List claseServicioList; + private List cortesiaDescuentoList; + private Intbox folioIni; + private Intbox folioFin; + private Datebox fecIni; + private Datebox fecFin; + private Combobox cmbMarca; + private Combobox cmbClaseSer; + private Combobox cmbDesc; + private static Logger log = Logger.getLogger(EditarCortesiaTipoDireccionController.class); + private Button btnApagar; + + @Override + public void doAfterCompose(Component comp) throws Exception { + marcaList = marcaService.buscarDescricaoIdMarca(); + claseServicioList = claseServicioService.buscarTodosExceto(-1); + cortesiaDescuentoList = cortesiaDescuentoService.obtenerTipoCortesia(2); + + super.doAfterCompose(comp); + + cortesiaDireccion = (CortesiaDireccion) Executions.getCurrent().getArg().get("cortesiaDireccion"); + cortesiaDireccionList = (MyListbox) Executions.getCurrent().getArg().get("cortesiaDireccionList"); + + if (cortesiaDireccion.getCortesiaDireccionId() == null) { + btnApagar.setVisible(false); + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + folioIni.getValue(); + folioFin.getValue(); + fecIni.getValue(); + fecFin.getValue(); + cmbMarca.getValue(); + cmbClaseSer.getValue(); + cmbDesc.getValue(); + + if (fecIni.getValue().after(fecFin.getValue())) { + try { + Messagebox.show(Labels.getLabel("editarCortesiaTipoDireccionController.MSG.CortesiaDireccionAlta"), + Labels.getLabel("editarCortesiaTipoDireccionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + log.error(ex); + } + } else { + try { + if (cortesiaDireccion.getTipocortesiaDescuento() == null) { + Messagebox.show( + Labels.getLabel("editarCortesiaTipoDireccionController.MSG.descuento"), + Labels.getLabel("editarCortesiaTipoDireccionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (cortesiaDireccion.getMarca() == null) { + Messagebox.show( + Labels.getLabel("editarCortesiaTipoDireccionController.MSG.marca"), + Labels.getLabel("editarCortesiaTipoDireccionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (cortesiaDireccion.getClaseServicio() == null) { + Messagebox.show( + Labels.getLabel("editarCortesiaTipoDireccionController.MSG.clase"), + Labels.getLabel("editarCortesiaTipoDireccionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + GregorianCalendar gcIni = new GregorianCalendar(); + gcIni.setTime(cortesiaDireccion.getFecInicioV()); + gcIni.set(Calendar.HOUR, 00); + gcIni.set(Calendar.MINUTE, 00); + gcIni.set(Calendar.SECOND, 00); + + GregorianCalendar gcFin = new GregorianCalendar(); + gcFin.setTime(cortesiaDireccion.getFecFinV()); + gcFin.set(Calendar.HOUR, 00); + gcFin.set(Calendar.MINUTE, 00); + gcFin.set(Calendar.SECOND, 00); + + cortesiaDireccion.setFecFinV(gcIni.getTime()); + cortesiaDireccion.setFecFinV(gcFin.getTime()); + + List lsCD = direccionService.buscarFolio(cortesiaDireccion); + + boolean podeSalvarFolio = lsCD.isEmpty() ? true : false; + //Se for ele mesmo pode salvar. + if (lsCD.size() == 1) { + //Somente edição + if (cortesiaDireccion.getCortesiaDireccionId() != null) { + if (cortesiaDireccion.getCortesiaDireccionId().equals(lsCD.get(0).getCortesiaDireccionId())) { + podeSalvarFolio = true; + } + } + } + + //Pode salvar todos os dados identicos, desde que o FOLIO não TRASLAPE. + if (podeSalvarFolio) { + cortesiaDireccion.setActivo(Boolean.TRUE); + cortesiaDireccion.setFecmodif(Calendar.getInstance().getTime()); + cortesiaDireccion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (cortesiaDireccion.getCortesiaDireccionId() == null) { + + direccionService.suscribir(cortesiaDireccion); + cortesiaDireccionList.addItem(cortesiaDireccion); + + Messagebox.show( + Labels.getLabel("editarCortesiaTipoDireccionController.MSG.suscribirOK"), + Labels.getLabel("editarCortesiaTipoDireccionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + + } else { + direccionService.actualizacion(cortesiaDireccion); + cortesiaDireccionList.updateItem(cortesiaDireccion); + + Messagebox.show( + Labels.getLabel("editarCortesiaTipoDireccionController.MSG.suscribirOK"), + Labels.getLabel("editarCortesiaTipoDireccionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } else { + Messagebox.show(Labels.getLabel("editarCortesiaTipoDireccionController.MSG.Folio"), + Labels.getLabel("editarCortesiaTipoDireccionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarCortesiaTipoDireccionController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + } + + public void onClick$btnApagar(Event ev) throws InterruptedException { + try { + int resp = Messagebox.show( + Labels.getLabel("editarCortesiaTipoDireccionController.MSG.BorrarPergunta"), + Labels.getLabel("editarCortesiaTipoDireccionController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + direccionService.borrar(cortesiaDireccion); + + Messagebox.show( + Labels.getLabel("editarCortesiaTipoDireccionController.MSG.BorrarOK"), + Labels.getLabel("editarCortesiaTipoDireccionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + cortesiaDireccionList.removeItem(cortesiaDireccion); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarCortesiaTipoDireccionController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public Combobox getCmbClaseSer() { + return cmbClaseSer; + } + + public void setCmbClaseSer(Combobox cmbClaseSer) { + this.cmbClaseSer = cmbClaseSer; + } + + public Combobox getCmbDesc() { + return cmbDesc; + } + + public void setCmbDesc(Combobox cmbDesc) { + this.cmbDesc = cmbDesc; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Datebox getFecFin() { + return fecFin; + } + + public void setFecFin(Datebox fecFin) { + this.fecFin = fecFin; + } + + public Datebox getFecIni() { + return fecIni; + } + + public void setFecIni(Datebox fecIni) { + this.fecIni = fecIni; + } + + public List getClaseServicioList() { + return claseServicioList; + } + + public void setClaseServicioList(List claseServicioList) { + this.claseServicioList = claseServicioList; + } + + public ClaseServicioService getClaseServicioService() { + return claseServicioService; + } + + public void setClaseServicioService(ClaseServicioService claseServicioService) { + this.claseServicioService = claseServicioService; + } + + public List getCortesiaDescuentoList() { + return cortesiaDescuentoList; + } + + public void setCortesiaDescuentoList(List cortesiaDescuentoList) { + this.cortesiaDescuentoList = cortesiaDescuentoList; + } + + public TipoCortesiaDescuentoService getCortesiaDescuentoService() { + return cortesiaDescuentoService; + } + + public void setCortesiaDescuentoService(TipoCortesiaDescuentoService cortesiaDescuentoService) { + this.cortesiaDescuentoService = cortesiaDescuentoService; + } + + public CortesiaDireccion getCortesiaDireccion() { + return cortesiaDireccion; + } + + public void setCortesiaDireccion(CortesiaDireccion cortesiaDireccion) { + this.cortesiaDireccion = cortesiaDireccion; + } + + public MyListbox getCortesiaDireccionList() { + return cortesiaDireccionList; + } + + public void setCortesiaDireccionList(MyListbox cortesiaDireccionList) { + this.cortesiaDireccionList = cortesiaDireccionList; + } + + public CortesiaDireccionService getDireccionService() { + return direccionService; + } + + public void setDireccionService(CortesiaDireccionService direccionService) { + this.direccionService = direccionService; + } + + public Intbox getFolioFin() { + return folioFin; + } + + public void setFolioFin(Intbox folioFin) { + this.folioFin = folioFin; + } + + public Intbox getFolioIni() { + return folioIni; + } + + public void setFolioIni(Intbox folioIni) { + this.folioIni = folioIni; + } + + public List getMarcaList() { + return marcaList; + } + + public void setMarcaList(List marcaList) { + this.marcaList = marcaList; + } + + public MarcaService getMarcaService() { + return marcaService; + } + + public void setMarcaService(MarcaService marcaService) { + this.marcaService = marcaService; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarGrupoCortesiasController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarGrupoCortesiasController.java new file mode 100644 index 000000000..28cf85114 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarGrupoCortesiasController.java @@ -0,0 +1,174 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.cortesias; + +import com.rjconsultores.ventaboletos.entidad.GrupoCortesia; +import com.rjconsultores.ventaboletos.service.GrupoCortesiasService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Shiro + */ +@Controller("editarGrupoCortesiasController") +@Scope("prototype") +public class EditarGrupoCortesiasController extends MyGenericForwardComposer { + + @Autowired + private GrupoCortesiasService grupoCortesiasService; + private GrupoCortesia grupoCortesia; + private MyListbox grupoCortesiasList; + private Textbox txtNome; + private static Logger log = Logger.getLogger(EditarGrupoCortesiasController.class); + private Button btnApagar; + private Button btnSalvar; + + public GrupoCortesia getGrupoCortesia() { + return grupoCortesia; + } + + public void setGrupoCortesia(GrupoCortesia grupoCortesia) { + this.grupoCortesia = grupoCortesia; + } + + public MyListbox getGrupoCortesiasList() { + return grupoCortesiasList; + } + + public void setGrupoCortesiasList(MyListbox grupoCortesiasList) { + this.grupoCortesiasList = grupoCortesiasList; + } + + public GrupoCortesiasService getGrupoCortesiasService() { + return grupoCortesiasService; + } + + public void setGrupoCortesiasService(GrupoCortesiasService grupoCortesiasService) { + this.grupoCortesiasService = grupoCortesiasService; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + grupoCortesia = (GrupoCortesia) Executions.getCurrent().getArg().get("grupoCortesia"); + grupoCortesiasList = (MyListbox) Executions.getCurrent().getArg().get("grupoCortesiaList"); + + txtNome.focus(); + + if (grupoCortesia.getGrupocortesiaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + if (grupoCortesia.getGrupocortesiaId() <= 3) { + btnApagar.setVisible(Boolean.FALSE); + btnSalvar.setVisible(Boolean.FALSE); + txtNome.setDisabled(Boolean.TRUE); + + Messagebox.show( + Labels.getLabel("MSG.noEditabled"), + Labels.getLabel("editarGrupoCortesiasController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } + + + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + try { + grupoCortesia.setActivo(Boolean.TRUE); + grupoCortesia.setFecmodif(Calendar.getInstance().getTime()); + grupoCortesia.setUsuarioId(0); + + List lsGrupoCortesias = grupoCortesiasService.buscar(grupoCortesia.getDescgrupo()); + + if (!lsGrupoCortesias.isEmpty()) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarGrupoCortesiasController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (grupoCortesia.getGrupocortesiaId() == null) { + grupoCortesiasService.suscribir(grupoCortesia); + grupoCortesiasList.addItem(grupoCortesia); + } else { + grupoCortesiasService.actualizacion(grupoCortesia); + grupoCortesiasList.updateItem(grupoCortesia); + } + + Messagebox.show( + Labels.getLabel("editarGrupoCortesiasController.MSG.suscribirOK"), + Labels.getLabel("editarGrupoCortesiasController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarGrupoCortesiasController.window.title"), + Messagebox.OK, Messagebox.ERROR); + + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarGrupoCortesiasController.MSG.BorrarPergunta"), + Labels.getLabel("editarGrupoCortesiasController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + grupoCortesiasService.borrar(grupoCortesia); + + Messagebox.show( + Labels.getLabel("editarGrupoCortesiasController.MSG.BorrarOK"), + Labels.getLabel("editarGrupoCortesiasController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + grupoCortesiasList.removeItem(grupoCortesia); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarTipoCortesiaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarTipoCortesiaController.java new file mode 100644 index 000000000..4d4cf0190 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarTipoCortesiaController.java @@ -0,0 +1,200 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.cortesias; + +import com.rjconsultores.ventaboletos.entidad.GrupoCortesia; +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import com.rjconsultores.ventaboletos.service.GrupoCortesiasService; +import com.rjconsultores.ventaboletos.service.TipoCortesiaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Shiro + */ +@Controller("editarTipoCortesiaController") +@Scope("prototype") +public class EditarTipoCortesiaController extends MyGenericForwardComposer { + + @Autowired + private TipoCortesiaService tipoCortesiaService; + @Autowired + private GrupoCortesiasService grupoCortesiaService; + private TipoCortesia tipoCortesia; + private MyListbox tipoCortesiaList; + private Textbox txtNome; + private List grupoCortesiaList; + private Combobox cmbGrupoCortesia; + private static Logger log = Logger.getLogger(EditarTipoCortesiaDController.class); + private Button btnApagar; + private Button btnSalvar; + + public List getGrupoCortesiaList() { + return grupoCortesiaList; + } + + public void setGrupoCortesiaList(List grupoCortesiaList) { + this.grupoCortesiaList = grupoCortesiaList; + } + + public TipoCortesia getTipoCortesia() { + return tipoCortesia; + } + + public void setTipoCortesia(TipoCortesia tipoCortesia) { + this.tipoCortesia = tipoCortesia; + } + + public MyListbox getTipoCortesiaList() { + return tipoCortesiaList; + } + + public void setTipoCortesiaList(MyListbox tipoCortesiaList) { + this.tipoCortesiaList = tipoCortesiaList; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Combobox getCmbGrupoCortesia() { + return cmbGrupoCortesia; + } + + public void setCmbGrupoCortesia(Combobox cmbGrupoCortesia) { + this.cmbGrupoCortesia = cmbGrupoCortesia; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + grupoCortesiaList = grupoCortesiaService.obtenerTodos(); + super.doAfterCompose(comp); + + tipoCortesia = (TipoCortesia) Executions.getCurrent().getArg().get("tipoCortesia"); + tipoCortesiaList = (MyListbox) Executions.getCurrent().getArg().get("tipoCortesiaList"); + + if (tipoCortesia.getTipocortesiaId() == null) { + btnApagar.setVisible(false); + } else { + if (tipoCortesia.getTipocortesiaId() <= 5) { + btnApagar.setVisible(Boolean.FALSE); + btnSalvar.setVisible(Boolean.FALSE); + txtNome.setDisabled(Boolean.TRUE); + cmbGrupoCortesia.setDisabled(Boolean.TRUE); + + Messagebox.show( + Labels.getLabel("MSG.noEditabled"), + Labels.getLabel("editarTipoCortesiaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } + + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + cmbGrupoCortesia.getSelectedItem(); + + try { + if (tipoCortesia.getGrupoCortesia() == null) { + Messagebox.show( + Labels.getLabel("editarTipoCortesiaController.MSG.grupo"), + Labels.getLabel("editarTipoCortesiaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + + tipoCortesia.setActivo(Boolean.TRUE); + tipoCortesia.setFecmodif(Calendar.getInstance().getTime()); + tipoCortesia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsTipoCortesia = tipoCortesiaService.buscar(tipoCortesia.getDesctipo()); + + if (!lsTipoCortesia.isEmpty()) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoCortesiaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + + if (tipoCortesia.getTipocortesiaId() == null) { + tipoCortesiaService.suscribir(tipoCortesia); + tipoCortesiaList.addItem(tipoCortesia); + } else { + tipoCortesiaService.actualizacion(tipoCortesia); + tipoCortesiaList.updateItem(tipoCortesia); + } + + Messagebox.show( + Labels.getLabel("editarTipoCortesiaController.MSG.suscribirOK"), + Labels.getLabel("editarTipoCortesiaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoCortesiaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTipoCortesiaController.MSG.BorrarPergunta"), + Labels.getLabel("editarTipoCortesiaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + tipoCortesiaService.borrar(tipoCortesia); + + Messagebox.show( + Labels.getLabel("editarTipoCortesiaController.MSG.BorrarOK"), + Labels.getLabel("editarTipoCortesiaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tipoCortesiaList.removeItem(tipoCortesia); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarTipoCortesiaDController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarTipoCortesiaDController.java new file mode 100644 index 000000000..fb4823f4b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/cortesias/EditarTipoCortesiaDController.java @@ -0,0 +1,238 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.cortesias; + +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import com.rjconsultores.ventaboletos.entidad.TipoCortesiaDescuento; +import com.rjconsultores.ventaboletos.service.TipoCortesiaDescuentoService; +import com.rjconsultores.ventaboletos.service.TipoCortesiaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.ConstraintPorcentagem; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Shiro + */ +@Controller("editarTipoCortesiaDController") +@Scope("prototype") +public class EditarTipoCortesiaDController extends MyGenericForwardComposer { + + @Autowired + private TipoCortesiaDescuentoService tipoCortesiaDService; + @Autowired + private TipoCortesiaService tipoCortesiaService; + private TipoCortesiaDescuento tipoCortesiaD; + private MyListbox tipoCortesiaDList; + private MyTextboxDecimal txtPorcentaje; + private List tipoCortesiaList; + private Button btnApagar; + private Combobox cmbTipoCortesiaD; + private ConstraintPorcentagem ct; + private static Logger log = Logger.getLogger(EditarTipoCortesiaDController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + ct = new ConstraintPorcentagem(); + tipoCortesiaList = tipoCortesiaService.obtenerTodos(); + + super.doAfterCompose(comp); + + tipoCortesiaD = (TipoCortesiaDescuento) Executions.getCurrent().getArg().get("tipoCortesiaD"); + tipoCortesiaDList = (MyListbox) Executions.getCurrent().getArg().get("tipoCortesiaDList"); + + if (tipoCortesiaD.getTipocortesiadescuentoId() == null) { + btnApagar.setVisible(false); + } + + cmbTipoCortesiaD.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtPorcentaje.getValue(); + cmbTipoCortesiaD.getValue(); + + if (txtPorcentaje.getValueDecimal().compareTo(new BigDecimal("100")) > 0) { + Clients.wrongValue(txtPorcentaje, Labels.getLabel("MSG.Porcentaje")); + return; + } + + try { + if (tipoCortesiaD.getTipoCortesia() == null) { + Messagebox.show( + Labels.getLabel("editarTipoCortesiaDController.MSG.tipo"), + Labels.getLabel("editarTipoCortesiaDController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + tipoCortesiaD.setActivo(Boolean.TRUE); + tipoCortesiaD.setFecmodif(Calendar.getInstance().getTime()); + tipoCortesiaD.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + Double porcDouble = Double.parseDouble(txtPorcentaje.getValue()); + BigDecimal porcentaje = BigDecimal.valueOf(porcDouble); + + if (tipoCortesiaD.getTipocortesiadescuentoId() == null) { + List lsTipoCortesiaDescuento = + tipoCortesiaDService.buscar(porcentaje, tipoCortesiaD.getTipoCortesia()); + + if (lsTipoCortesiaDescuento.isEmpty()) { + tipoCortesiaDService.suscribir(tipoCortesiaD); + tipoCortesiaDList.addItem(tipoCortesiaD); + + Messagebox.show( + Labels.getLabel("editarTipoCortesiaDController.MSG.suscribirOK"), + Labels.getLabel("editarTipoCortesiaDController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoCortesiaDController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + List lsTipoCortesiaDescuento = + tipoCortesiaDService.buscar(porcentaje, tipoCortesiaD.getTipoCortesia()); + + if (lsTipoCortesiaDescuento.isEmpty()) { + tipoCortesiaDService.actualizacion(tipoCortesiaD); + tipoCortesiaDList.updateItem(tipoCortesiaD); + + Messagebox.show( + Labels.getLabel("editarTipoCortesiaDController.MSG.suscribirOK"), + Labels.getLabel("editarTipoCortesiaDController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoCortesiaDController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTipoCortesiaDController.MSG.BorrarPergunta"), + Labels.getLabel("editarTipoCortesiaDController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + tipoCortesiaDService.borrar(tipoCortesiaD); + + Messagebox.show( + Labels.getLabel("editarTipoCortesiaDController.MSG.BorrarOK"), + Labels.getLabel("editarTipoCortesiaDController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tipoCortesiaDList.removeItem(tipoCortesiaD); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + +// public void onChanging$txtPorcentaje(InputEvent ie) { +// String novoCaracter = ie.getValue(); +// Boolean temLetraNovoAsiento = novoCaracter.matches("^[a-zA-Z]+$"); +// if (temLetraNovoAsiento) { +// novoCaracter = novoCaracter.replace( +// novoCaracter.subSequence(novoCaracter.length() - 1, novoCaracter.length()), ""); +// txtPorcentaje.setValue(BigDecimal.ZERO); +// } +// } + public TipoCortesiaDescuento getTipoCortesiaD() { + return tipoCortesiaD; + } + + public void setTipoCortesiaD(TipoCortesiaDescuento tipoCortesiaD) { + this.tipoCortesiaD = tipoCortesiaD; + } + + public MyListbox getTipoCortesiaDList() { + return tipoCortesiaDList; + } + + public void setTipoCortesiaDList(MyListbox tipoCortesiaDList) { + this.tipoCortesiaDList = tipoCortesiaDList; + } + + public TipoCortesiaDescuentoService getTipoCortesiaDService() { + return tipoCortesiaDService; + } + + public void setTipoCortesiaDService(TipoCortesiaDescuentoService tipoCortesiaDService) { + this.tipoCortesiaDService = tipoCortesiaDService; + } + + public List getTipoCortesiaList() { + return tipoCortesiaList; + } + + public void setTipoCortesiaList(List tipoCortesiaList) { + this.tipoCortesiaList = tipoCortesiaList; + } + + public TipoCortesiaService getTipoCortesiaService() { + return tipoCortesiaService; + } + + public void setTipoCortesiaService(TipoCortesiaService tipoCortesiaService) { + this.tipoCortesiaService = tipoCortesiaService; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Combobox getCmbTipoCortesiaD() { + return cmbTipoCortesiaD; + } + + public void setCmbTipoCortesiaD(Combobox cmbTipoCortesiaD) { + this.cmbTipoCortesiaD = cmbTipoCortesiaD; + } + + public ConstraintPorcentagem getCt() { + return ct; + } + + public void setCt(ConstraintPorcentagem ct) { + this.ct = ct; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/BusqeudaClaseservicioEquivalenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/BusqeudaClaseservicioEquivalenciaController.java new file mode 100644 index 000000000..9e87782d4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/BusqeudaClaseservicioEquivalenciaController.java @@ -0,0 +1,173 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.equivalencia; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.ClaseservicioEquivalencia; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.ComisionistaExternoService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderClaseservicioEquivalencia; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busqeudaClaseservicioEquivalenciaController") +@Scope("prototype") +public class BusqeudaClaseservicioEquivalenciaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwClaseservicioEquivalencia; + @Autowired + private ComisionistaExternoService comisionistaExternoService; + @Autowired + private ClaseServicioService claseServicioService; + private MyListbox claseServicioEquivalenciaList; + private Paging pagingClaseServicioEquivalencia; + private Combobox cmbClaseServicio; + private Combobox cmbComissionestaExterno; + private Textbox txtEquivalencia; + private List lsComisionistaExterno; + private List lsClaservicio; + + public MyListbox getClaseServicioEquivalenciaList() { + return claseServicioEquivalenciaList; + } + + public void setClaseServicioEquivalenciaList(MyListbox claseServicioEquivalenciaList) { + this.claseServicioEquivalenciaList = claseServicioEquivalenciaList; + } + + public Combobox getCmbComissionestaExterno() { + return cmbComissionestaExterno; + } + + public void setCmbComissionestaExterno(Combobox cmbComissionestaExterno) { + this.cmbComissionestaExterno = cmbComissionestaExterno; + } + + public List getLsComisionistaExterno() { + return lsComisionistaExterno; + } + + public void setLsComisionistaExterno(List lsComisionistaExterno) { + this.lsComisionistaExterno = lsComisionistaExterno; + } + + public Paging getPagingClaseServicioEquivalencia() { + return pagingClaseServicioEquivalencia; + } + + public void setPagingClaseServicioEquivalencia(Paging pagingClaseServicioEquivalencia) { + this.pagingClaseServicioEquivalencia = pagingClaseServicioEquivalencia; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verClaseservicioEquivalencia(new ClaseservicioEquivalencia()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsComisionistaExterno = comisionistaExternoService.obtenerTodos(); + lsClaservicio = claseServicioService.obtenerTodos(); + + super.doAfterCompose(comp); + + claseServicioEquivalenciaList.setItemRenderer(new RenderClaseservicioEquivalencia()); + claseServicioEquivalenciaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ClaseservicioEquivalencia c = (ClaseservicioEquivalencia) claseServicioEquivalenciaList.getSelected(); + verClaseservicioEquivalencia(c); + } + }); + + cmbClaseServicio.focus(); + refreshLista(); + } + + private void verClaseservicioEquivalencia(ClaseservicioEquivalencia ce) { + if (ce == null) { + return; + } + + Map args = new HashMap(); + args.put("claseservicioEquivalencia", ce); + args.put("claseServicioEquivalenciaList", claseServicioEquivalenciaList); + + openWindow("/gui/equivalencia/editarClaseServicioEquivalencia.zul", + Labels.getLabel("editarClaseservicioEquivalenciaController.window.title"), + args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject parada = + new HibernateSearchObject(ClaseservicioEquivalencia.class, pagingClaseServicioEquivalencia.getPageSize()); + + if (cmbClaseServicio.getSelectedItem() != null) { + parada.addFilterEqual("claseservicio", (ClaseServicio) cmbClaseServicio.getSelectedItem().getValue()); + } + + Comboitem ce = cmbComissionestaExterno.getSelectedItem(); + if (ce != null) { + ComisionistaExterno c = (ComisionistaExterno) ce.getValue(); + parada.addFilterEqual("comisionistaExterno", c); + } + if (!txtEquivalencia.getValue().equals("")) { + parada.addFilterILike("equivalenciaId", txtEquivalencia.getValue()); + } + parada.addFilterEqual("activo", Boolean.TRUE); + + parada.addSortAsc("claseservicio.descclase"); + + plwClaseservicioEquivalencia.init(parada, claseServicioEquivalenciaList, pagingClaseServicioEquivalencia); + + if (claseServicioEquivalenciaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busqeudaClaseservicioEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public List getLsClaservicio() { + return lsClaservicio; + } + + public void setLsClaservicio(List lsClaservicio) { + this.lsClaservicio = lsClaservicio; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/BusquedaEmpresaEquivalenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/BusquedaEmpresaEquivalenciaController.java new file mode 100644 index 000000000..47fbaf060 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/BusquedaEmpresaEquivalenciaController.java @@ -0,0 +1,173 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.equivalencia; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EmpresaEquivalencia; +import com.rjconsultores.ventaboletos.service.ComisionistaExternoService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEmpresaEquivalencia; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaEmpresaEquivalenciaController") +@Scope("prototype") +public class BusquedaEmpresaEquivalenciaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwEmpresaEquivalencia; + @Autowired + private ComisionistaExternoService comisionistaExternoService; + @Autowired + private EmpresaService empresaService; + private MyListbox empresaEquivalenciaList; + private Paging pagingEmpresaEquivalencia; + private Combobox cmbEmpresa; + private Combobox cmbComissionestaExterno; + private Textbox txtEquivalencia; + private List lsComisionistaExterno; + private List lsEmpresa; + + public Combobox getCmbComissionestaExterno() { + return cmbComissionestaExterno; + } + + public void setCmbComissionestaExterno(Combobox cmbComissionestaExterno) { + this.cmbComissionestaExterno = cmbComissionestaExterno; + } + + public MyListbox getEmpresaEquivalenciaList() { + return empresaEquivalenciaList; + } + + public void setEmpresaEquivalenciaList(MyListbox empresaEquivalenciaList) { + this.empresaEquivalenciaList = empresaEquivalenciaList; + } + + public List getLsComisionistaExterno() { + return lsComisionistaExterno; + } + + public void setLsComisionistaExterno(List lsComisionistaExterno) { + this.lsComisionistaExterno = lsComisionistaExterno; + } + + public Paging getPagingEmpresaEquivalencia() { + return pagingEmpresaEquivalencia; + } + + public void setPagingEmpresaEquivalencia(Paging pagingEmpresaEquivalencia) { + this.pagingEmpresaEquivalencia = pagingEmpresaEquivalencia; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verEmpresaEquivalencia(new EmpresaEquivalencia()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsComisionistaExterno = comisionistaExternoService.obtenerTodos(); + lsEmpresa = empresaService.obtenerTodos(); + + super.doAfterCompose(comp); + + empresaEquivalenciaList.setItemRenderer(new RenderEmpresaEquivalencia()); + empresaEquivalenciaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + EmpresaEquivalencia c = (EmpresaEquivalencia) empresaEquivalenciaList.getSelected(); + verEmpresaEquivalencia(c); + } + }); + + cmbEmpresa.focus(); + refreshLista(); + } + + private void verEmpresaEquivalencia(EmpresaEquivalencia ee) { + if (ee == null) { + return; + } + + Map args = new HashMap(); + args.put("empresaEquivalencia", ee); + args.put("empresaEquivalenciaList", empresaEquivalenciaList); + + openWindow("/gui/equivalencia/editarEmpresaEquivalencia.zul", + Labels.getLabel("editarEmpresaEquivalenciaController.window.title"), + args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject parada = + new HibernateSearchObject(EmpresaEquivalencia.class, pagingEmpresaEquivalencia.getPageSize()); + + if (cmbEmpresa.getSelectedItem() != null) { + parada.addFilterEqual("empresa", (Empresa) cmbEmpresa.getSelectedItem().getValue()); + } + + Comboitem ce = cmbComissionestaExterno.getSelectedItem(); + if (ce != null) { + ComisionistaExterno c = (ComisionistaExterno) ce.getValue(); + parada.addFilterEqual("comisionistaExterno", c); + } + if (!txtEquivalencia.getValue().equals("")) { + parada.addFilterILike("equivalenciaId", txtEquivalencia.getValue()); + } + parada.addFilterEqual("activo", Boolean.TRUE); + + parada.addSortAsc("empresa.nombempresa"); + + plwEmpresaEquivalencia.init(parada, empresaEquivalenciaList, pagingEmpresaEquivalencia); + + if (empresaEquivalenciaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaEmpresaEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/BusquedaMotivocancelacionEquivalenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/BusquedaMotivocancelacionEquivalenciaController.java new file mode 100644 index 000000000..707fcf46e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/BusquedaMotivocancelacionEquivalenciaController.java @@ -0,0 +1,208 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.equivalencia; + +import com.rjconsultores.ventaboletos.entidad.MotivocancelacionEquivalencia; +import com.rjconsultores.ventaboletos.service.MotivoCancelacionService; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import com.rjconsultores.ventaboletos.service.ComisionistaExternoService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMotivocancelacionEquivalencia; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaMotivocancelacionEquivalenciaController") +@Scope("prototype") +public class BusquedaMotivocancelacionEquivalenciaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwMotivocancelacionEquivalencia; + @Autowired + private ComisionistaExternoService comisionistaExternoService; + @Autowired + private MotivoCancelacionService motivoCancelacionService; + private MyListbox motivoCancelacionEquivalenciaList; + private Paging pagingMotivocancelacionEquivalencia; + private Combobox cmbComissionestaExterno; + private Combobox cmbMotivoCancelacion; + private Textbox txtEquivalencia; + private List lsComisionistaExterno; + private List lsMotivoCancelacion; + + public Combobox getCmbComissionestaExterno() { + return cmbComissionestaExterno; + } + + public void setCmbComissionestaExterno(Combobox cmbComissionestaExterno) { + this.cmbComissionestaExterno = cmbComissionestaExterno; + } + + public MyListbox getMotivocancelacionEquivalenciaList() { + return motivoCancelacionEquivalenciaList; + } + + public void setMotivocancelacionEquivalenciaList(MyListbox motivoCancelacionEquivalenciaList) { + this.motivoCancelacionEquivalenciaList = motivoCancelacionEquivalenciaList; + } + + public List getLsComisionistaExterno() { + return lsComisionistaExterno; + } + + public void setLsComisionistaExterno(List lsComisionistaExterno) { + this.lsComisionistaExterno = lsComisionistaExterno; + } + + public Paging getPagingMotivocancelacionEquivalencia() { + return pagingMotivocancelacionEquivalencia; + } + + public void setPagingMotivocancelacionEquivalencia(Paging pagingMotivocancelacionEquivalencia) { + this.pagingMotivocancelacionEquivalencia = pagingMotivocancelacionEquivalencia; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verMotivocancelacionEquivalencia(new MotivocancelacionEquivalencia()); + } + + public ComisionistaExternoService getComisionistaExternoService() { + return comisionistaExternoService; + } + + public void setComisionistaExternoService(ComisionistaExternoService comisionistaExternoService) { + this.comisionistaExternoService = comisionistaExternoService; + } + + public List getLsMotivoCancelacion() { + return lsMotivoCancelacion; + } + + public void setLsMotivoCancelacion(List lsMotivoCancelacion) { + this.lsMotivoCancelacion = lsMotivoCancelacion; + } + + public MyListbox getMotivoCancelacionEquivalenciaList() { + return motivoCancelacionEquivalenciaList; + } + + public void setMotivoCancelacionEquivalenciaList(MyListbox motivoCancelacionEquivalenciaList) { + this.motivoCancelacionEquivalenciaList = motivoCancelacionEquivalenciaList; + } + + public MotivoCancelacionService getMotivoCancelacionService() { + return motivoCancelacionService; + } + + public void setMotivoCancelacionService(MotivoCancelacionService motivoCancelacionService) { + this.motivoCancelacionService = motivoCancelacionService; + } + + public PagedListWrapper getPlwMotivocancelacionEquivalencia() { + return plwMotivocancelacionEquivalencia; + } + + public void setPlwMotivocancelacionEquivalencia(PagedListWrapper plwMotivocancelacionEquivalencia) { + this.plwMotivocancelacionEquivalencia = plwMotivocancelacionEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsComisionistaExterno = comisionistaExternoService.obtenerTodos(); + lsMotivoCancelacion = motivoCancelacionService.obtenerTodos(); + + super.doAfterCompose(comp); + + motivoCancelacionEquivalenciaList.setItemRenderer(new RenderMotivocancelacionEquivalencia()); + motivoCancelacionEquivalenciaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + MotivocancelacionEquivalencia c = (MotivocancelacionEquivalencia) motivoCancelacionEquivalenciaList.getSelected(); + verMotivocancelacionEquivalencia(c); + } + }); + + cmbMotivoCancelacion.focus(); + refreshLista(); + } + + private void verMotivocancelacionEquivalencia(MotivocancelacionEquivalencia ee) { + if (ee == null) { + return; + } + + Map args = new HashMap(); + args.put("motivoCancelacionEquivalencia", ee); + args.put("motivoCancelacionEquivalenciaList", motivoCancelacionEquivalenciaList); + + openWindow("/gui/equivalencia/editarMotivocancelacionEquivalencia.zul", + Labels.getLabel("editarMotivoCancelacionEquivalenciaController.window.title"), + args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject motivoCancelacion = + new HibernateSearchObject(MotivocancelacionEquivalencia.class, pagingMotivocancelacionEquivalencia.getPageSize()); + + + Comboitem ce = cmbComissionestaExterno.getSelectedItem(); + Comboitem mc = cmbMotivoCancelacion.getSelectedItem(); + + if (ce != null) { + ComisionistaExterno comissionistaExterno = (ComisionistaExterno) ce.getValue(); + motivoCancelacion.addFilterEqual("comisionistaExterno", comissionistaExterno); + } + if (mc != null) { + MotivoCancelacion motCanc = (MotivoCancelacion) mc.getValue(); + motivoCancelacion.addFilterEqual("motivoCancelacion", motCanc); + } + if (!txtEquivalencia.getValue().equals("")) { + motivoCancelacion.addFilterILike("equivalenciaId", txtEquivalencia.getValue()); + } + motivoCancelacion.addFilterEqual("activo", Boolean.TRUE); + + motivoCancelacion.addSortAsc("motivoCancelacion.descmotivo"); + + plwMotivocancelacionEquivalencia.init(motivoCancelacion, motivoCancelacionEquivalenciaList, pagingMotivocancelacionEquivalencia); + + if (motivoCancelacionEquivalenciaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedamotivocancelacionEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/BusquedaParadaEquivalenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/BusquedaParadaEquivalenciaController.java new file mode 100644 index 000000000..98a5442be --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/BusquedaParadaEquivalenciaController.java @@ -0,0 +1,172 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.equivalencia; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParadaEquivalencia; +import com.rjconsultores.ventaboletos.service.ComisionistaExternoService; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderParadaEquivalencia; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaParadaEquivalenciaController") +@Scope("prototype") +public class BusquedaParadaEquivalenciaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwParadaEquivalencia; + @Autowired + private ComisionistaExternoService comisionistaExternoService; + private MyListbox paradaEquivalenciaList; + private Paging pagingParadaEquivalencia; + private MyComboboxParada cmbParada; + private Textbox txtCVE; + private Textbox txtEquivalencia; + private Combobox cmbComissionestaExterno; + private List lsComisionistaExterno; + + public Combobox getCmbComissionestaExterno() { + return cmbComissionestaExterno; + } + + public void setCmbComissionestaExterno(Combobox cmbComissionestaExterno) { + this.cmbComissionestaExterno = cmbComissionestaExterno; + } + + public List getLsComisionistaExterno() { + return lsComisionistaExterno; + } + + public void setLsComisionistaExterno(List lsComisionistaExterno) { + this.lsComisionistaExterno = lsComisionistaExterno; + } + + public Paging getPagingParadaEquivalencia() { + return pagingParadaEquivalencia; + } + + public void setPagingParadaEquivalencia(Paging pagingParadaEquivalencia) { + this.pagingParadaEquivalencia = pagingParadaEquivalencia; + } + + public MyListbox getParadaEquivalenciaList() { + return paradaEquivalenciaList; + } + + public void setParadaEquivalenciaList(MyListbox paradaEquivalenciaList) { + this.paradaEquivalenciaList = paradaEquivalenciaList; + } + + public Textbox getTxtCVE() { + return txtCVE; + } + + public void setTxtCVE(Textbox txtCVE) { + this.txtCVE = txtCVE; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verParadaEquivalencia(new ParadaEquivalencia()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsComisionistaExterno = comisionistaExternoService.obtenerTodos(); + + super.doAfterCompose(comp); + + paradaEquivalenciaList.setItemRenderer(new RenderParadaEquivalencia()); + paradaEquivalenciaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ParadaEquivalencia c = (ParadaEquivalencia) paradaEquivalenciaList.getSelected(); + verParadaEquivalencia(c); + } + }); + + cmbParada.focus(); + refreshLista(); + } + + private void verParadaEquivalencia(ParadaEquivalencia pe) { + if (pe == null) { + return; + } + + Map args = new HashMap(); + args.put("paradaEquivalencia", pe); + args.put("paradaEquivalenciaList", paradaEquivalenciaList); + + openWindow("/gui/equivalencia/editarParadaEquivalencia.zul", + Labels.getLabel("editarParadaEquivalenciaController.window.title"), + args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject parada = + new HibernateSearchObject(ParadaEquivalencia.class, pagingParadaEquivalencia.getPageSize()); + + if (cmbParada.getSelectedItem() != null) { + parada.addFilterEqual("parada", (Parada) cmbParada.getSelectedItem().getValue()); + } + + Comboitem ce = cmbComissionestaExterno.getSelectedItem(); + if (ce != null) { + ComisionistaExterno c = (ComisionistaExterno) ce.getValue(); + parada.addFilterEqual("comisionistaExterno", c); + } + + if (!txtEquivalencia.getValue().equals("")) { + parada.addFilterILike("equivalenciaId", txtEquivalencia.getValue()); + } + parada.addFilterEqual("activo", Boolean.TRUE); + + + parada.addSortAsc("parada.descparada"); + + plwParadaEquivalencia.init(parada, paradaEquivalenciaList, pagingParadaEquivalencia); + + if (paradaEquivalenciaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaParadaEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/EditarClaseservicioEquivalenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/EditarClaseservicioEquivalenciaController.java new file mode 100644 index 000000000..d2fe08d12 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/EditarClaseservicioEquivalenciaController.java @@ -0,0 +1,257 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.equivalencia; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.ClaseservicioEquivalencia; +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.ClaseservicioEquivalenciaService; +import com.rjconsultores.ventaboletos.service.ComisionistaExternoService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarClaseservicioEquivalenciaController") +@Scope("prototype") +public class EditarClaseservicioEquivalenciaController extends MyGenericForwardComposer { + + @Autowired + private ClaseservicioEquivalenciaService claseServicioEquivalenciaService; + @Autowired + private ComisionistaExternoService comisionistaExternoService; + @Autowired + private ClaseServicioService claseServicioService; + private ClaseservicioEquivalencia claseServicioEquivalencia; + private MyListbox claseServicioEquivalenciaList; + private static Logger log = Logger.getLogger(EditarClaseservicioEquivalenciaController.class); + private List lsComisionistaExterno; + private List lsClaseServicio; + private Combobox cmbClaseServicio; + private Combobox cmbComissionestaExterno; + private Textbox txtEquivalencia; + private Button btnApagar; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public ClaseservicioEquivalencia getClaseServicioEquivalencia() { + return claseServicioEquivalencia; + } + + public void setClaseServicioEquivalencia(ClaseservicioEquivalencia claseServicioEquivalencia) { + this.claseServicioEquivalencia = claseServicioEquivalencia; + } + + public MyListbox getClaseServicioEquivalenciaList() { + return claseServicioEquivalenciaList; + } + + public void setClaseServicioEquivalenciaList(MyListbox claseServicioEquivalenciaList) { + this.claseServicioEquivalenciaList = claseServicioEquivalenciaList; + } + + public ClaseServicioService getClaseServicioService() { + return claseServicioService; + } + + public void setClaseServicioService(ClaseServicioService claseServicioService) { + this.claseServicioService = claseServicioService; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Combobox getCmbComissionestaExterno() { + return cmbComissionestaExterno; + } + + public void setCmbComissionestaExterno(Combobox cmbComissionestaExterno) { + this.cmbComissionestaExterno = cmbComissionestaExterno; + } + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + public List getLsComisionistaExterno() { + return lsComisionistaExterno; + } + + public void setLsComisionistaExterno(List lsComisionistaExterno) { + this.lsComisionistaExterno = lsComisionistaExterno; + } + + public Textbox getTxtEquivalencia() { + return txtEquivalencia; + } + + public void setTxtEquivalencia(Textbox txtEquivalencia) { + this.txtEquivalencia = txtEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsComisionistaExterno = comisionistaExternoService.obtenerTodos(); + lsClaseServicio = claseServicioService.buscarTodosExceto(-1); + + super.doAfterCompose(comp); + + claseServicioEquivalencia = (ClaseservicioEquivalencia) Executions.getCurrent().getArg().get("claseservicioEquivalencia"); + claseServicioEquivalenciaList = (MyListbox) Executions.getCurrent().getArg().get("claseServicioEquivalenciaList"); + + if (claseServicioEquivalencia.getClaseservicioequivalenciaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + cmbClaseServicio.setDisabled(true); + cmbComissionestaExterno.setDisabled(true); + } + + cmbClaseServicio.setFocus(true); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + cmbComissionestaExterno.getSelectedItem(); + cmbClaseServicio.getSelectedItem(); + txtEquivalencia.getText(); + + try { + + ComisionistaExterno comisionistaExterno = claseServicioEquivalencia.getComisionistaExterno(); + Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem(); + ClaseServicio claseServicio = null; + if (cbiClaseServicio != null) { + claseServicio = (ClaseServicio) cbiClaseServicio.getValue(); + claseServicioEquivalencia.setClaseservicio(claseServicio); + } + + List lsClaseServicioEquivalente = + claseServicioEquivalenciaService.buscar(claseServicio, comisionistaExterno); + + + boolean podeSalvar = false; + if (lsClaseServicioEquivalente.isEmpty()) { + podeSalvar = true; + } else { + if (claseServicioEquivalencia.getClaseservicioequivalenciaId() != null) { + for (ClaseservicioEquivalencia p : lsClaseServicioEquivalente) { + if (p.getClaseservicioequivalenciaId().equals(claseServicioEquivalencia.getClaseservicioequivalenciaId())) { + podeSalvar = true; + } + } + } + } + + + List lsEquivalente = + claseServicioEquivalenciaService.buscarEquivalencia(claseServicioEquivalencia); + + boolean podeSalvarEquivalencia = false; + if (lsEquivalente.isEmpty()) { + podeSalvarEquivalencia = true; + } else { + if (claseServicioEquivalencia.getClaseservicioequivalenciaId() != null) { + for (ClaseservicioEquivalencia p : lsEquivalente) { + if (p.getClaseservicioequivalenciaId().equals(claseServicioEquivalencia.getClaseservicioequivalenciaId())) { + podeSalvarEquivalencia = true; + } + } + } + } + + if (!podeSalvarEquivalencia) { + Messagebox.show( + Labels.getLabel("MSG.Equivalencia.Existe"), + Labels.getLabel("editarClaseservicioEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + if (podeSalvar) { + + if (claseServicioEquivalencia.getClaseservicioequivalenciaId() == null) { + claseServicioEquivalenciaService.suscribir(claseServicioEquivalencia); + claseServicioEquivalenciaList.addItem(claseServicioEquivalencia); + } else { + claseServicioEquivalenciaService.actualizacion(claseServicioEquivalencia); + claseServicioEquivalenciaList.updateItem(claseServicioEquivalencia); + } + Messagebox.show( + Labels.getLabel("editarClaseservicioEquivalenciaController.MSG.suscribirOK"), + Labels.getLabel("editarClaseservicioEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarClaseservicioEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarClaseservicioEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarClaseservicioEquivalenciaController.MSG.borrarPergunta"), + Labels.getLabel("editarClaseservicioEquivalenciaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + claseServicioEquivalenciaService.borrar(claseServicioEquivalencia); + + Messagebox.show( + Labels.getLabel("editarClaseservicioEquivalenciaController.MSG.borrarOK"), + Labels.getLabel("editarClaseservicioEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + claseServicioEquivalenciaList.removeItem(claseServicioEquivalencia); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/EditarEmpresaEquivalenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/EditarEmpresaEquivalenciaController.java new file mode 100644 index 000000000..9f22eedb7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/EditarEmpresaEquivalenciaController.java @@ -0,0 +1,240 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.equivalencia; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EmpresaEquivalencia; +import com.rjconsultores.ventaboletos.service.ComisionistaExternoService; +import com.rjconsultores.ventaboletos.service.EmpresaEquivalenciaService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarEmpresaEquivalenciaController") +@Scope("prototype") +public class EditarEmpresaEquivalenciaController extends MyGenericForwardComposer { + + @Autowired + private EmpresaEquivalenciaService empresaEquivalenciaService; + @Autowired + private ComisionistaExternoService comisionistaExternoService; + @Autowired + private EmpresaService empresaService; + private EmpresaEquivalencia empresaEquivalencia; + private MyListbox empresaEquivalenciaList; + private static Logger log = Logger.getLogger(EditarEmpresaEquivalenciaController.class); + private List lsComisionistaExterno; + private List lsEmpresas; + private Combobox cmbEmpresa; + private Combobox cmbComissionestaExterno; + private Textbox txtEquivalencia; + private Button btnApagar; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Combobox getCmbComissionestaExterno() { + return cmbComissionestaExterno; + } + + public void setCmbComissionestaExterno(Combobox cmbComissionestaExterno) { + this.cmbComissionestaExterno = cmbComissionestaExterno; + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public EmpresaEquivalencia getEmpresaEquivalencia() { + return empresaEquivalencia; + } + + public void setEmpresaEquivalencia(EmpresaEquivalencia empresaEquivalencia) { + this.empresaEquivalencia = empresaEquivalencia; + } + + public List getLsComisionistaExterno() { + return lsComisionistaExterno; + } + + public void setLsComisionistaExterno(List lsComisionistaExterno) { + this.lsComisionistaExterno = lsComisionistaExterno; + } + + public List getLsEmpresas() { + return lsEmpresas; + } + + public void setLsEmpresas(List lsEmpresas) { + this.lsEmpresas = lsEmpresas; + } + + public Textbox getTxtEquivalencia() { + return txtEquivalencia; + } + + public void setTxtEquivalencia(Textbox txtEquivalencia) { + this.txtEquivalencia = txtEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsComisionistaExterno = comisionistaExternoService.obtenerTodos(); + lsEmpresas = empresaService.buscarTodosExceto(-1); + + super.doAfterCompose(comp); + + empresaEquivalencia = (EmpresaEquivalencia) Executions.getCurrent().getArg().get("empresaEquivalencia"); + empresaEquivalenciaList = (MyListbox) Executions.getCurrent().getArg().get("empresaEquivalenciaList"); + + if (empresaEquivalencia.getEmpresaequivalenciaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + cmbEmpresa.setDisabled(true); + cmbComissionestaExterno.setDisabled(true); + } + + cmbEmpresa.setFocus(true); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + cmbComissionestaExterno.getSelectedItem(); + cmbEmpresa.getSelectedItem(); + txtEquivalencia.getText(); + + try { + ComisionistaExterno comisionistaExterno = empresaEquivalencia.getComisionistaExterno(); + Comboitem cbiParada = cmbEmpresa.getSelectedItem(); + Empresa empresa = null; + if (cbiParada != null) { + empresa = (Empresa) cbiParada.getValue(); + empresaEquivalencia.setEmpresa(empresa); + } + + List lsEmpresaEquivalente = + empresaEquivalenciaService.buscar(empresa, comisionistaExterno); + + boolean podeSalvar = false; + if (lsEmpresaEquivalente.isEmpty()) { + podeSalvar = true; + } else { + if (empresaEquivalencia.getEmpresaequivalenciaId() != null) { + for (EmpresaEquivalencia p : lsEmpresaEquivalente) { + if (p.getEmpresaequivalenciaId().equals(empresaEquivalencia.getEmpresaequivalenciaId())) { + podeSalvar = true; + } + } + } + } + + List lsEquivalente = + empresaEquivalenciaService.buscarEquivalencia(empresaEquivalencia); + + boolean podeSalvarEquivalencia = false; + if (lsEquivalente.isEmpty()) { + podeSalvarEquivalencia = true; + } else { + if (empresaEquivalencia.getEmpresaequivalenciaId() != null) { + for (EmpresaEquivalencia p : lsEquivalente) { + if (p.getEmpresaequivalenciaId().equals(empresaEquivalencia.getEmpresaequivalenciaId())) { + podeSalvarEquivalencia = true; + } + } + } + } + + if (!podeSalvarEquivalencia) { + Messagebox.show( + Labels.getLabel("MSG.Equivalencia.Existe"), + Labels.getLabel("editarEmpresaEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + if (podeSalvar) { + + if (empresaEquivalencia.getEmpresaequivalenciaId() == null) { + empresaEquivalenciaService.suscribir(empresaEquivalencia); + empresaEquivalenciaList.addItem(empresaEquivalencia); + + } else { + empresaEquivalenciaService.actualizacion(empresaEquivalencia); + empresaEquivalenciaList.updateItem(empresaEquivalencia); + } + Messagebox.show( + Labels.getLabel("editarEmpresaEquivalenciaController.MSG.suscribirOK"), + Labels.getLabel("editarEmpresaEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarEmpresaEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarEmpresaEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarEmpresaEquivalenciaController.MSG.borrarPergunta"), + Labels.getLabel("editarEmpresaEquivalenciaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + empresaEquivalenciaService.borrar(empresaEquivalencia); + + Messagebox.show( + Labels.getLabel("editarEmpresaEquivalenciaController.MSG.borrarOK"), + Labels.getLabel("editarEmpresaEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + empresaEquivalenciaList.removeItem(empresaEquivalencia); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/EditarMotivoCancelacionEquivalenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/EditarMotivoCancelacionEquivalenciaController.java new file mode 100644 index 000000000..dee4e766b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/EditarMotivoCancelacionEquivalenciaController.java @@ -0,0 +1,234 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.equivalencia; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import com.rjconsultores.ventaboletos.entidad.MotivocancelacionEquivalencia; +import com.rjconsultores.ventaboletos.service.ComisionistaExternoService; +import com.rjconsultores.ventaboletos.service.MotivoCancelacionService; +import com.rjconsultores.ventaboletos.service.MotivocancelacionEquivalenciaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarMotivoCancelacionEquivalenciaController") +@Scope("prototype") +public class EditarMotivoCancelacionEquivalenciaController extends MyGenericForwardComposer { + + @Autowired + private MotivocancelacionEquivalenciaService motivoCancelacionEquivalenciaService; + @Autowired + private ComisionistaExternoService comisionistaExternoService; + @Autowired + private MotivoCancelacionService motivoCancelacionService; + private MotivocancelacionEquivalencia motivoCancelacionEquivalencia; + private MyListbox motivoCancelacionEquivalenciaList; + private static Logger log = Logger.getLogger(EditarMotivoCancelacionEquivalenciaController.class); + private List lsComisionistaExterno; + private List lsMotivoCancelacion; + private Combobox cmbMotivoCancelacion; + private Combobox cmbComissionestaExterno; + private Textbox txtEquivalencia; + private Button btnApagar; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Combobox getCmbComissionestaExterno() { + return cmbComissionestaExterno; + } + + public void setCmbComissionestaExterno(Combobox cmbComissionestaExterno) { + this.cmbComissionestaExterno = cmbComissionestaExterno; + } + + public Combobox getCmbMotivoCancelacion() { + return cmbMotivoCancelacion; + } + + public void setCmbMotivoCancelacion(Combobox cmbMotivoCancelacion) { + this.cmbMotivoCancelacion = cmbMotivoCancelacion; + } + + public List getLsComisionistaExterno() { + return lsComisionistaExterno; + } + + public void setLsComisionistaExterno(List lsComisionistaExterno) { + this.lsComisionistaExterno = lsComisionistaExterno; + } + + public List getLsMotivoCancelacion() { + return lsMotivoCancelacion; + } + + public void setLsMotivoCancelacion(List lsMotivoCancelacion) { + this.lsMotivoCancelacion = lsMotivoCancelacion; + } + + public MotivocancelacionEquivalencia getMotivoCancelacionEquivalencia() { + return motivoCancelacionEquivalencia; + } + + public void setMotivoCancelacionEquivalencia(MotivocancelacionEquivalencia motivoCancelacionEquivalencia) { + this.motivoCancelacionEquivalencia = motivoCancelacionEquivalencia; + } + + public Textbox getTxtEquivalencia() { + return txtEquivalencia; + } + + public void setTxtEquivalencia(Textbox txtEquivalencia) { + this.txtEquivalencia = txtEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsComisionistaExterno = comisionistaExternoService.obtenerTodos(); + lsMotivoCancelacion = motivoCancelacionService.obtenerTodos(); + + + super.doAfterCompose(comp); + + motivoCancelacionEquivalencia = (MotivocancelacionEquivalencia) Executions.getCurrent().getArg().get("motivoCancelacionEquivalencia"); + motivoCancelacionEquivalenciaList = (MyListbox) Executions.getCurrent().getArg().get("motivoCancelacionEquivalenciaList"); + + if (motivoCancelacionEquivalencia.getMotivoequivalenciaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + cmbComissionestaExterno.setDisabled(true); + cmbMotivoCancelacion.setDisabled(true); + } + + cmbMotivoCancelacion.setFocus(true); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + cmbComissionestaExterno.getSelectedItem(); + cmbMotivoCancelacion.getSelectedItem(); + txtEquivalencia.getText(); + + try { + ComisionistaExterno comisionistaExterno = motivoCancelacionEquivalencia.getComisionistaExterno(); + MotivoCancelacion motivoCancelacion = motivoCancelacionEquivalencia.getMotivoCancelacion(); + + List lsMotivoCancelacionEquivalente = + motivoCancelacionEquivalenciaService.buscar(comisionistaExterno, + motivoCancelacion); + + boolean podeSalvar = false; + if (lsMotivoCancelacionEquivalente.isEmpty()) { + podeSalvar = true; + } else { + if (motivoCancelacionEquivalencia.getMotivoequivalenciaId() != null) { + for (MotivocancelacionEquivalencia p : lsMotivoCancelacionEquivalente) { + if (p.getMotivoequivalenciaId().equals(motivoCancelacionEquivalencia.getMotivoequivalenciaId())) { + podeSalvar = true; + } + } + } + } + + + List lsEquivalente = + motivoCancelacionEquivalenciaService.buscarEquivalencia(motivoCancelacionEquivalencia); + + boolean podeSalvarEquivalencia = false; + if (lsEquivalente.isEmpty()) { + podeSalvarEquivalencia = true; + } else { + if (motivoCancelacionEquivalencia.getMotivoequivalenciaId() != null) { + for (MotivocancelacionEquivalencia p : lsEquivalente) { + if (p.getMotivoequivalenciaId().equals(motivoCancelacionEquivalencia.getMotivoequivalenciaId())) { + podeSalvarEquivalencia = true; + } + } + } + } + + if (!podeSalvarEquivalencia) { + Messagebox.show( + Labels.getLabel("MSG.Equivalencia.Existe"), + Labels.getLabel("editarMotivoCancelacionEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + if (podeSalvar) { + if (motivoCancelacionEquivalencia.getMotivoequivalenciaId() == null) { + motivoCancelacionEquivalenciaService.suscribir(motivoCancelacionEquivalencia); + motivoCancelacionEquivalenciaList.addItem(motivoCancelacionEquivalencia); + + } else { + motivoCancelacionEquivalenciaService.actualizacion(motivoCancelacionEquivalencia); + motivoCancelacionEquivalenciaList.updateItem(motivoCancelacionEquivalencia); + } + Messagebox.show( + Labels.getLabel("editarMotivoCancelacionEquivalenciaController.MSG.suscribirOK"), + Labels.getLabel("editarMotivoCancelacionEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarMotivoCancelacionEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarMotivoCancelacionEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarMotivoCancelacionEquivalenciaController.MSG.borrarPergunta"), + Labels.getLabel("editarMotivoCancelacionEquivalenciaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + motivoCancelacionEquivalenciaService.borrar(motivoCancelacionEquivalencia); + + Messagebox.show( + Labels.getLabel("editarMotivoCancelacionEquivalenciaController.MSG.borrarOK"), + Labels.getLabel("editarMotivoCancelacionEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + motivoCancelacionEquivalenciaList.removeItem(motivoCancelacionEquivalencia); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/EditarParadaEquivalenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/EditarParadaEquivalenciaController.java new file mode 100644 index 000000000..5a13268b0 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/equivalencia/EditarParadaEquivalenciaController.java @@ -0,0 +1,231 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.equivalencia; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParadaEquivalencia; +import com.rjconsultores.ventaboletos.service.ComisionistaExternoService; +import com.rjconsultores.ventaboletos.service.ParadaEquivalenciaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarParadaEquivalenciaController") +@Scope("prototype") +public class EditarParadaEquivalenciaController extends MyGenericForwardComposer { + + @Autowired + private ParadaEquivalenciaService paradaEquivalenciaService; + @Autowired + private ComisionistaExternoService comisionistaExternoService; + private ParadaEquivalencia paradaEquivalencia; + private MyListbox paradaEquivalenciaList; + private static Logger log = Logger.getLogger(EditarParadaEquivalenciaController.class); + private List lsComisionistaExterno; + private Combobox cmbParada; + private Combobox cmbComissionestaExterno; + private Textbox txtEquivalencia; + private Button btnApagar; + + public ParadaEquivalencia getParadaEquivalencia() { + return paradaEquivalencia; + } + + public void setParadaEquivalencia(ParadaEquivalencia paradaEquivalencia) { + this.paradaEquivalencia = paradaEquivalencia; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Combobox getCmbParada() { + return cmbParada; + } + + public void setCmbParada(Combobox cmbParada) { + this.cmbParada = cmbParada; + } + + public List getLsComisionistaExterno() { + return lsComisionistaExterno; + } + + public void setLsComisionistaExterno(List lsComisionistaExterno) { + this.lsComisionistaExterno = lsComisionistaExterno; + } + + public Combobox getCmbComissionestaExterno() { + return cmbComissionestaExterno; + } + + public void setCmbComissionestaExterno(Combobox cmbComissionestaExterno) { + this.cmbComissionestaExterno = cmbComissionestaExterno; + } + + public Textbox getTxtEquivalencia() { + return txtEquivalencia; + } + + public void setTxtEquivalencia(Textbox txtEquivalencia) { + this.txtEquivalencia = txtEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsComisionistaExterno = comisionistaExternoService.obtenerTodos(); + + super.doAfterCompose(comp); + + paradaEquivalencia = (ParadaEquivalencia) Executions.getCurrent().getArg().get("paradaEquivalencia"); + paradaEquivalenciaList = (MyListbox) Executions.getCurrent().getArg().get("paradaEquivalenciaList"); + + if (paradaEquivalencia.getParadaequivalenciaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + Parada parada = paradaEquivalencia.getParada(); + if (parada != null) { + cmbParada.setText(parada.getDescparada()); + } + cmbParada.setDisabled(true); + cmbComissionestaExterno.setDisabled(true); + } + + cmbParada.setFocus(true); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + cmbComissionestaExterno.getSelectedItem(); + cmbParada.getSelectedItem(); + txtEquivalencia.getText(); + + try { + + ComisionistaExterno comisionistaExterno = paradaEquivalencia.getComisionistaExterno(); + Comboitem cbiParada = cmbParada.getSelectedItem(); + Parada parada = null; + if (cbiParada != null) { + paradaEquivalencia.setParada((Parada) cbiParada.getValue()); + } + String equivalencia = paradaEquivalencia.getEquivalenciaId(); + + List lsParadaEquivalente = + paradaEquivalenciaService.buscar(parada, comisionistaExterno, + equivalencia); + + boolean podeSalvar = false; + if (lsParadaEquivalente.isEmpty()) { + podeSalvar = true; + } else { + if (paradaEquivalencia.getParadaequivalenciaId() != null) { + for (ParadaEquivalencia p : lsParadaEquivalente) { + if (p.getParadaequivalenciaId().equals(paradaEquivalencia.getParadaequivalenciaId())) { + podeSalvar = true; + } + } + } + } + + List lsEquivalente = + paradaEquivalenciaService.buscarEquivalencia(equivalencia); + + boolean podeSalvarEquivalencia = false; + if (lsEquivalente.isEmpty()) { + podeSalvarEquivalencia = true; + } else { + if (paradaEquivalencia.getParadaequivalenciaId() != null) { + for (ParadaEquivalencia p : lsEquivalente) { + if (p.getParadaequivalenciaId().equals(paradaEquivalencia.getParadaequivalenciaId())) { + podeSalvarEquivalencia = true; + } + } + } + } + + if (!podeSalvarEquivalencia) { + Messagebox.show( + Labels.getLabel("MSG.Equivalencia.Existe"), + Labels.getLabel("editarParadaEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + if (podeSalvar) { + + if (paradaEquivalencia.getParadaequivalenciaId() == null) { + paradaEquivalenciaService.suscribir(paradaEquivalencia); + paradaEquivalenciaList.addItem(paradaEquivalencia); + } else { + paradaEquivalenciaService.actualizacion(paradaEquivalencia); + paradaEquivalenciaList.updateItem(paradaEquivalencia); + } + Messagebox.show( + Labels.getLabel("editarParadaEquivalenciaController.MSG.suscribirOK"), + Labels.getLabel("editarParadaEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarParadaEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarParadaEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarParadaEquivalenciaController.MSG.borrarPergunta"), + Labels.getLabel("editarParadaEquivalenciaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + paradaEquivalenciaService.borrar(paradaEquivalencia); + + Messagebox.show( + Labels.getLabel("editarParadaEquivalenciaController.MSG.borrarOK"), + Labels.getLabel("editarParadaEquivalenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + paradaEquivalenciaList.removeItem(paradaEquivalencia); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaAutobusController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaAutobusController.java new file mode 100644 index 000000000..3c80f4da6 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaAutobusController.java @@ -0,0 +1,160 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.Autobus; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.service.DiagramaAutobusService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderAutobus; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaAutobusController") +@Scope("prototype") +public class BusquedaAutobusController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwAutobus; + @Autowired + private DiagramaAutobusService diagramaAutobusService; + private MyListbox autobusList; + private Paging pagingAutobus; + private List lsDiagramaAutobus; + private Textbox txtNombre; + private Combobox cmbDiagramaAutobus; + + public MyListbox getAutobusList() { + return autobusList; + } + + public void setAutobusList(MyListbox autobusList) { + this.autobusList = autobusList; + } + + public Combobox getCmbDiagramaAutobus() { + return cmbDiagramaAutobus; + } + + public void setCmbDiagramaAutobus(Combobox cmbDiagramaAutobus) { + this.cmbDiagramaAutobus = cmbDiagramaAutobus; + } + + public List getLsDiagramaAutobus() { + return lsDiagramaAutobus; + } + + public void setLsDiagramaAutobus(List lsDiagramaAutobus) { + this.lsDiagramaAutobus = lsDiagramaAutobus; + } + + public Paging getPagingAutobus() { + return pagingAutobus; + } + + public void setPagingAutobus(Paging pagingAutobus) { + this.pagingAutobus = pagingAutobus; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verAutobus(new Autobus()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsDiagramaAutobus = diagramaAutobusService.obtenerTodos(); + super.doAfterCompose(comp); + + autobusList.setItemRenderer(new RenderAutobus()); + autobusList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Autobus mr = (Autobus) autobusList.getSelected(); + verAutobus(mr); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verAutobus(Autobus ab) { + if (ab == null) { + return; + } + + Map args = new HashMap(); + args.put("autobus", ab); + args.put("autobusList", autobusList); + + openWindow("/gui/esquema_operacional/editarAutobus.zul", + Labels.getLabel("editarAutobusController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject autobusBusqueda = + new HibernateSearchObject(Autobus.class, pagingAutobus.getPageSize()); + + autobusBusqueda.addFilterEqual("activo", true); + autobusBusqueda.addFilterLike("numautobus", "%" + txtNombre.getText().trim().concat("%")); + + Comboitem cbiDiagramaAutobus = cmbDiagramaAutobus.getSelectedItem(); + if (cbiDiagramaAutobus != null) { + DiagramaAutobus dab = (DiagramaAutobus) cbiDiagramaAutobus.getValue(); + autobusBusqueda.addFilterEqual("diagramaAutobus", dab); + } + + autobusBusqueda.addSortAsc("numautobus"); + + plwAutobus.init(autobusBusqueda, autobusList, pagingAutobus); + + if (autobusList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaAutobusController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCatalogoDeParadaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCatalogoDeParadaController.java new file mode 100644 index 000000000..0297aff95 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCatalogoDeParadaController.java @@ -0,0 +1,148 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCatalogoDeParadas; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaCatalogoDeParadaController") +@Scope("prototype") +public class BusquedaCatalogoDeParadaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwParada; + private MyListbox paradaList; + private Paging pagingParada; + private Textbox txtNombre; + private Textbox txtCVE; + + public Paging getPagingParada() { + return pagingParada; + } + + public void setPagingParada(Paging pagingParada) { + this.pagingParada = pagingParada; + } + + public MyListbox getParadaList() { + return paradaList; + } + + public void setParadaList(MyListbox paradaList) { + this.paradaList = paradaList; + } + + public PagedListWrapper getPlwParada() { + return plwParada; + } + + public void setPlwParada(PagedListWrapper plwParada) { + this.plwParada = plwParada; + } + + public Textbox getTxtCVE() { + return txtCVE; + } + + public void setTxtCVE(Textbox txtCVE) { + this.txtCVE = txtCVE; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new Parada()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + paradaList.setItemRenderer(new RenderCatalogoDeParadas()); + paradaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Parada c = (Parada) paradaList.getSelected(); + verPeriodo(c); + } + }); + + txtNombre.focus(); + refreshLista(); + } + + private void verPeriodo(Parada c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("parada", c); + args.put("paradaList", paradaList); + + openWindow("/gui/esquema_operacional/editarParada.zul", + Labels.getLabel("editarCatalogoDeParadaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject parada = + new HibernateSearchObject(Parada.class, pagingParada.getPageSize()); + + parada.addFilterLike("descparada", "%" + txtNombre.getText().trim().concat("%")); + parada.addFilterLike("cveparada", "%" + txtCVE.getText().trim().concat("%")); + + parada.addFilterEqual("activo", Boolean.TRUE); + + parada.addFilterNotEqual("paradaId", -1); + + parada.addSortAsc("descparada"); + + plwParada.init(parada, paradaList, pagingParada); + + if (paradaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaCatalogoDeParadaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCatalogoDeRutaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCatalogoDeRutaController.java new file mode 100644 index 000000000..5cece94f4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCatalogoDeRutaController.java @@ -0,0 +1,184 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCatalogoDeRutas; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaCatalogoDeRutaController") +@Scope("prototype") +public class BusquedaCatalogoDeRutaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwRuta; + @Autowired + private ClaseServicioService claseServicioServicce; + private List lsClaseServicio; + private MyListbox rutaList; + private Paging pagingRuta; + private Textbox txtNombre; + private Intbox txtId; + private Combobox cmbClaseServicio; + + public Paging getPagingRuta() { + return pagingRuta; + } + + public void setPagingRuta(Paging pagingRuta) { + this.pagingRuta = pagingRuta; + } + + public MyListbox getRutaList() { + return rutaList; + } + + public void setRutaList(MyListbox rutaList) { + this.rutaList = rutaList; + } + + public PagedListWrapper getPlwRuta() { + return plwRuta; + } + + public void setPlwRuta(PagedListWrapper plwRuta) { + this.plwRuta = plwRuta; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new Ruta()); + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + public Intbox getTxtId() { + return txtId; + } + + public void setTxtId(Intbox txtId) { + this.txtId = txtId; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsClaseServicio = claseServicioServicce.obtenerTodos(); + + super.doAfterCompose(comp); + + rutaList.setItemRenderer(new RenderCatalogoDeRutas()); + rutaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Ruta c = (Ruta) rutaList.getSelected(); + verPeriodo(c); + } + }); + + refreshLista(); + + txtId.focus(); + } + + private void verPeriodo(Ruta c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("ruta", c); + args.put("rutaList", rutaList); + + openWindow("/gui/esquema_operacional/editarRuta.zul", + Labels.getLabel("editarCatalogoDeRutaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject claseServicioBusqueda = + new HibernateSearchObject(Ruta.class, pagingRuta.getPageSize()); + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + + claseServicioBusqueda.addFilterNotEqual("rutaId", -1); + if (txtId.getValue() != null) { + claseServicioBusqueda.addFilterEqual("rutaId", txtId.getValue()); + } + + claseServicioBusqueda.addFilterLike("descruta", + "%" + txtNombre.getText().trim().concat("%")); + + Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem(); + if (cbiClaseServicio != null) { + ClaseServicio claseServicio = (ClaseServicio) cbiClaseServicio.getValue(); + claseServicioBusqueda.addFilterEqual("claseServicio", claseServicio); + } + + claseServicioBusqueda.addSortAsc("descruta"); + + plwRuta.init(claseServicioBusqueda, rutaList, pagingRuta); + if (rutaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaCatalogoDeRutaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCorridaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCorridaController.java new file mode 100644 index 000000000..358d4c819 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCorridaController.java @@ -0,0 +1,329 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionCorrida; +import java.sql.Time; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Intbox; + +import org.zkoss.zul.Paging; +import org.zkoss.zul.Timebox; + +/** + * + * @author Rafius + */ +@Controller("busquedaCorridaController") +@Scope("prototype") +public class BusquedaCorridaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwEsquemaCorrida; + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseService; + @Autowired + private RutaService rutaService; + @Autowired + private EmpresaService empresaService; + private MyListbox esquemaCorridaList; + private Paging pagingEsquemaCorrida; + private Datebox fecInicio; + private Datebox fecFinal; + private Combobox cmbClase; + private Combobox cmbMarca; + private Combobox cmbRuta; + private Combobox cmbEmpresaCorrida; + private List lsEmpresa; + private List lsMarca; + private List lsClase; + private List lsRuta; + private Button btnPesquisa; + private Intbox txtID; + private Timebox hora; + + public Combobox getCmbClase() { + return cmbClase; + } + + public void setCmbClase(Combobox cmbClase) { + this.cmbClase = cmbClase; + } + + public Combobox getCmbEmpresaCorrida() { + return cmbEmpresaCorrida; + } + + public void setCmbEmpresaCorrida(Combobox cmbEmpresaCorrida) { + this.cmbEmpresaCorrida = cmbEmpresaCorrida; + } + + public Combobox getCmbRuta() { + return cmbRuta; + } + + public void setCmbRuta(Combobox cmbRuta) { + this.cmbRuta = cmbRuta; + } + + public List getLsClase() { + return lsClase; + } + + public void setLsClase(List lsClase) { + this.lsClase = lsClase; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsMarca() { + return lsMarca; + } + + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + public List getLsRuta() { + return lsRuta; + } + + public void setLsRuta(List lsRuta) { + this.lsRuta = lsRuta; + } + + public Paging getPagingEsquemaCorrida() { + return pagingEsquemaCorrida; + } + + public void setPagingEsquemaCorrida(Paging pagingEsquemaCorrida) { + this.pagingEsquemaCorrida = pagingEsquemaCorrida; + } + + public MyListbox getEsquemaCorridaList() { + return esquemaCorridaList; + } + + public void setEsquemaCorridaList(MyListbox esquemaCorridaList) { + this.esquemaCorridaList = esquemaCorridaList; + } + + public PagedListWrapper getPlwEsquemaCorrida() { + return plwEsquemaCorrida; + } + + public void setPlwEsquemaCorrida(PagedListWrapper plwEsquemaCorrida) { + this.plwEsquemaCorrida = plwEsquemaCorrida; + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public Button getBtnPesquisa() { + return btnPesquisa; + } + + public void setBtnPesquisa(Button btnPesquisa) { + this.btnPesquisa = btnPesquisa; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Intbox getTxtID() { + return txtID; + } + + public void setTxtID(Intbox txtID) { + this.txtID = txtID; + } + + public Timebox getHora() { + return hora; + } + + public void setHora(Timebox hora) { + this.hora = hora; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + lsEmpresa = empresaService.obtenerIndTipo1(); + lsMarca = marcaService.obtenerTodos(); + lsClase = claseService.obtenerTodos(); + lsRuta = rutaService.obtenerTodos(); + + esquemaCorridaList.setItemRenderer(new RenderConfiguracionCorrida()); + esquemaCorridaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + EsquemaCorrida rc = (EsquemaCorrida) esquemaCorridaList.getSelected(); + verPeriodo(rc); + } + }); + + btnPesquisa.focus(); + cmbMarca.setSelectedItem(null); + + refreshLista(); + } + + private void verPeriodo(EsquemaCorrida rc) { + if (rc == null) { + return; + } + + Map args = new HashMap(); + args.put("esquemaCorrida", rc); + args.put("esquemaCorridaList", esquemaCorridaList); + + openWindow("/gui/esquema_operacional/editarCorrida.zul", + Labels.getLabel("editarConfiguracionCorridaController.window.title"), args, MODAL); + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new EsquemaCorrida()); + } + + private void refreshLista() { + HibernateSearchObject busquedaCorrita = + new HibernateSearchObject(EsquemaCorrida.class, + pagingEsquemaCorrida.getPageSize()); + + busquedaCorrita.addFilterEqual("activo", Boolean.TRUE); + + Integer id = txtID.getValue(); + busquedaCorrita.addFilterEqual("esquemacorridaId", id); + + Date dtHora = hora.getValue(); + if (dtHora != null) { + Time time = new Time(dtHora.getTime()); + busquedaCorrita.addFilterEqual("horasalida", time); + } + + Comboitem cbiClase = cmbClase.getSelectedItem(); + ClaseServicio claseServicio = null; + if (cbiClase != null) { + claseServicio = (ClaseServicio) cbiClase.getValue(); + busquedaCorrita.addFilterEqual("claseServicio", claseServicio); + } + + Comboitem cbiMarca = cmbMarca.getSelectedItem(); + Marca marca = null; + if (cbiMarca != null) { + marca = (Marca) cbiMarca.getValue(); + busquedaCorrita.addFilterEqual("marca", marca); + } + + Comboitem cbiRuta = cmbRuta.getSelectedItem(); + Ruta ruta = null; + if (cbiRuta != null) { + ruta = (Ruta) cbiRuta.getValue(); + busquedaCorrita.addFilterEqual("ruta", ruta); + } + + Comboitem cbiEmpresa = cmbEmpresaCorrida.getSelectedItem(); + Empresa empresa = null; + if (cbiEmpresa != null) { + empresa = (Empresa) cbiEmpresa.getValue(); + busquedaCorrita.addFilterEqual("empresa", empresa); + } + + if (fecInicio.getValue() != null) { + Date ini = fecInicio.getValue(); + ini.setHours(00); + ini.setMinutes(00); + ini.setSeconds(00); + busquedaCorrita.addFilterGreaterOrEqual("esquemaOperacional.fecniciovigencia", + ini); + } + + if (fecFinal.getValue() != null) { + Date fin = fecFinal.getValue(); + fin.setHours(23); + fin.setMinutes(59); + fin.setSeconds(59); + busquedaCorrita.addFilterLessOrEqual("esquemaOperacional.fecfinvigencia", + fin); + } + busquedaCorrita.addSortDesc("esquemacorridaId"); + + plwEsquemaCorrida.init(busquedaCorrita, esquemaCorridaList, pagingEsquemaCorrida); + + if (esquemaCorridaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCorridaReboteController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCorridaReboteController.java new file mode 100644 index 000000000..c9e2cff44 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaCorridaReboteController.java @@ -0,0 +1,328 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionCorrida; +import java.sql.Time; +import java.util.Date; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Intbox; + +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; +import org.zkoss.zul.Timebox; + +/** + * + * @author Rafius + */ +@Controller("busquedaCorridaReboteController") +@Scope("prototype") +public class BusquedaCorridaReboteController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwEsquemaCorrida; + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseService; + @Autowired + private RutaService rutaService; + @Autowired + private EmpresaService empresaService; + private MyListbox esquemaCorridaList; + private EsquemaCorrida esquemaCorridaPai; + private Paging pagingEsquemaCorrida; + private Datebox fecInicio; + private Datebox fecFinal; + private Combobox cmbClase; + private Combobox cmbMarca; + private Combobox cmbRuta; + private Combobox cmbEmpresaCorrida; + private List lsEmpresa; + private List lsMarca; + private List lsClase; + private List lsRuta; + private Button btnPesquisa; + private Intbox txtID; + private Timebox hora; + private Textbox txtIdCorridaRebote; + + public Combobox getCmbClase() { + return cmbClase; + } + + public void setCmbClase(Combobox cmbClase) { + this.cmbClase = cmbClase; + } + + public Combobox getCmbEmpresaCorrida() { + return cmbEmpresaCorrida; + } + + public void setCmbEmpresaCorrida(Combobox cmbEmpresaCorrida) { + this.cmbEmpresaCorrida = cmbEmpresaCorrida; + } + + public Combobox getCmbRuta() { + return cmbRuta; + } + + public void setCmbRuta(Combobox cmbRuta) { + this.cmbRuta = cmbRuta; + } + + public List getLsClase() { + return lsClase; + } + + public void setLsClase(List lsClase) { + this.lsClase = lsClase; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsMarca() { + return lsMarca; + } + + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + public List getLsRuta() { + return lsRuta; + } + + public void setLsRuta(List lsRuta) { + this.lsRuta = lsRuta; + } + + public Paging getPagingEsquemaCorrida() { + return pagingEsquemaCorrida; + } + + public void setPagingEsquemaCorrida(Paging pagingEsquemaCorrida) { + this.pagingEsquemaCorrida = pagingEsquemaCorrida; + } + + public MyListbox getEsquemaCorridaList() { + return esquemaCorridaList; + } + + public void setEsquemaCorridaList(MyListbox esquemaCorridaList) { + this.esquemaCorridaList = esquemaCorridaList; + } + + public PagedListWrapper getPlwEsquemaCorrida() { + return plwEsquemaCorrida; + } + + public void setPlwEsquemaCorrida(PagedListWrapper plwEsquemaCorrida) { + this.plwEsquemaCorrida = plwEsquemaCorrida; + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public Button getBtnPesquisa() { + return btnPesquisa; + } + + public void setBtnPesquisa(Button btnPesquisa) { + this.btnPesquisa = btnPesquisa; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Intbox getTxtID() { + return txtID; + } + + public void setTxtID(Intbox txtID) { + this.txtID = txtID; + } + + public Timebox getHora() { + return hora; + } + + public void setHora(Timebox hora) { + this.hora = hora; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + lsEmpresa = empresaService.obtenerIndTipo1(); + lsMarca = marcaService.obtenerTodos(); + lsClase = claseService.obtenerTodos(); + lsRuta = rutaService.obtenerTodos(); + esquemaCorridaPai = (EsquemaCorrida) Executions.getCurrent().getArg().get("esquemaCorrida"); + txtIdCorridaRebote = (Textbox) Executions.getCurrent().getArg().get("txtIdCorridaRebote"); + esquemaCorridaList.setItemRenderer(new RenderConfiguracionCorrida()); + esquemaCorridaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + EsquemaCorrida rc = (EsquemaCorrida) esquemaCorridaList.getSelected(); + adicionarRebote(rc); + } + }); + + btnPesquisa.focus(); + cmbMarca.setSelectedItem(null); + + refreshLista(); + } + + private void adicionarRebote(EsquemaCorrida rc) { + if (rc == null) { + return; + } + esquemaCorridaPai.setEsquemaCorridaRebote(rc); + txtIdCorridaRebote.setValue(rc.getEsquemacorridaId().toString()); + this.closeWindow(); + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + adicionarRebote(new EsquemaCorrida()); + } + + private void refreshLista() { + HibernateSearchObject busquedaCorrita = + new HibernateSearchObject(EsquemaCorrida.class, + pagingEsquemaCorrida.getPageSize()); + + busquedaCorrita.addFilterEqual("activo", Boolean.TRUE); + + Integer id = txtID.getValue(); + busquedaCorrita.addFilterEqual("esquemacorridaId", id); + + Date dtHora = hora.getValue(); + if (dtHora != null) { + Time time = new Time(dtHora.getTime()); + busquedaCorrita.addFilterEqual("horasalida", time); + } + + Comboitem cbiClase = cmbClase.getSelectedItem(); + ClaseServicio claseServicio = null; + if (cbiClase != null) { + claseServicio = (ClaseServicio) cbiClase.getValue(); + busquedaCorrita.addFilterEqual("claseServicio", claseServicio); + } + + Comboitem cbiMarca = cmbMarca.getSelectedItem(); + Marca marca = null; + if (cbiMarca != null) { + marca = (Marca) cbiMarca.getValue(); + busquedaCorrita.addFilterEqual("marca", marca); + } + + Comboitem cbiRuta = cmbRuta.getSelectedItem(); + Ruta ruta = null; + if (cbiRuta != null) { + ruta = (Ruta) cbiRuta.getValue(); + busquedaCorrita.addFilterEqual("ruta", ruta); + } + + Comboitem cbiEmpresa = cmbEmpresaCorrida.getSelectedItem(); + Empresa empresa = null; + if (cbiEmpresa != null) { + empresa = (Empresa) cbiEmpresa.getValue(); + busquedaCorrita.addFilterEqual("empresa", empresa); + } + + if (fecInicio.getValue() != null) { + Date ini = fecInicio.getValue(); + ini.setHours(00); + ini.setMinutes(00); + ini.setSeconds(00); + busquedaCorrita.addFilterGreaterOrEqual("esquemaOperacional.fecniciovigencia", + ini); + } + + if (fecFinal.getValue() != null) { + Date fin = fecFinal.getValue(); + fin.setHours(23); + fin.setMinutes(59); + fin.setSeconds(59); + busquedaCorrita.addFilterLessOrEqual("esquemaOperacional.fecfinvigencia", + fin); + } + busquedaCorrita.addSortDesc("esquemacorridaId"); + + plwEsquemaCorrida.init(busquedaCorrita, esquemaCorridaList, pagingEsquemaCorrida); + + if (esquemaCorridaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaDiagramaAutobusController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaDiagramaAutobusController.java new file mode 100644 index 000000000..0f203a536 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaDiagramaAutobusController.java @@ -0,0 +1,147 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderDiagramaAutobus; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaDiagramaAutobusController") +@Scope("prototype") +public class BusquedaDiagramaAutobusController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwDiagramaAutobus; + private MyListbox diagramaAutobusList; + private Paging pagingDiagramaAutobus; + private Textbox txtNome; + private Intbox txtCantasientos; + + public Intbox getTxtCantasientos() { + return txtCantasientos; + } + + public void setTxtCantasientos(Intbox txtCantasientos) { + this.txtCantasientos = txtCantasientos; + } + + public MyListbox getDiagramaAutobusList() { + return diagramaAutobusList; + } + + public void setDiagramaAutobusList(MyListbox diagramaAutobusList) { + this.diagramaAutobusList = diagramaAutobusList; + } + + public Paging getPagingDiagramaAutobus() { + return pagingDiagramaAutobus; + } + + public void setPagingDiagramaAutobus(Paging pagingDiagramaAutobus) { + this.pagingDiagramaAutobus = pagingDiagramaAutobus; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + diagramaAutobusList.setItemRenderer(new RenderDiagramaAutobus()); + diagramaAutobusList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + DiagramaAutobus d = (DiagramaAutobus) diagramaAutobusList.getSelected(); + verDiagramaAutobus(d); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verDiagramaAutobus(DiagramaAutobus d) { + if (d == null) { + return; + } + + txtNome.setText(""); + txtCantasientos.setValue(null); + + Map args = new HashMap(); + args.put("diagramaAutobus", d); + args.put("diagramaAutobusList", diagramaAutobusList); + + openWindow("/gui/esquema_operacional/editarDiagramaAutobus.zul", + Labels.getLabel("editarDiagramaAutobusController.window.title"), + args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject diagramaAutobusbusqueda = + new HibernateSearchObject(DiagramaAutobus.class, + pagingDiagramaAutobus.getPageSize()); + + diagramaAutobusbusqueda.addFilterLike("descDiagrama", + "%" + txtNome.getText().trim().concat("%")); + diagramaAutobusbusqueda.addFilterEqual("cantasientos", + txtCantasientos.getValue()); + + diagramaAutobusbusqueda.addSortAsc("descDiagrama"); + diagramaAutobusbusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwDiagramaAutobus.init(diagramaAutobusbusqueda, diagramaAutobusList, + pagingDiagramaAutobus); + + if (diagramaAutobusList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaDiagramaAutobusController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verDiagramaAutobus(new DiagramaAutobus()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaRolOperativoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaRolOperativoController.java new file mode 100644 index 000000000..e1958aae7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaRolOperativoController.java @@ -0,0 +1,184 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.RolOperativo; +import com.rjconsultores.ventaboletos.service.DiagramaAutobusService; +import com.rjconsultores.ventaboletos.service.RolOperativoService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRolOperativo; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Shiro + */ +@Controller("busquedaRolOperativoController") +@Scope("prototype") +public class BusquedaRolOperativoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwRolOperativo; + @Autowired + private RolOperativoService operativoService; + @Autowired + private DiagramaAutobusService autobusService; + private MyListbox rolOperativoList; + private List rolList; + private List diagramaList; + private Paging pagingRolOperativo; + private Textbox txtDesRol; + private Combobox cmbDiagramaBus; + + public DiagramaAutobusService getAutobusService() { + return autobusService; + } + + public void setAutobusService(DiagramaAutobusService autobusService) { + this.autobusService = autobusService; + } + + public List getDiagramaList() { + return diagramaList; + } + + public void setDiagramaList(List diagramaList) { + this.diagramaList = diagramaList; + } + + public RolOperativoService getOperativoService() { + return operativoService; + } + + public void setOperativoService(RolOperativoService operativoService) { + this.operativoService = operativoService; + } + + public List getRolList() { + return rolList; + } + + public void setRolList(List rolList) { + this.rolList = rolList; + } + + public Combobox getCmbDiagramaBus() { + return cmbDiagramaBus; + } + + public void setCmbDiagramaBus(Combobox cmbDiagramaBus) { + this.cmbDiagramaBus = cmbDiagramaBus; + } + + public Textbox getTxtDesRol() { + return txtDesRol; + } + + public void setTxtDesRol(Textbox txtDesRol) { + this.txtDesRol = txtDesRol; + } + + public Paging getPagingRolOperativo() { + return pagingRolOperativo; + } + + public void setPagingRolOperativo(Paging pagingRolOperativo) { + this.pagingRolOperativo = pagingRolOperativo; + } + + public PagedListWrapper getPlwRolOperativo() { + return plwRolOperativo; + } + + public void setPlwRolOperativo(PagedListWrapper plwRolOperativo) { + this.plwRolOperativo = plwRolOperativo; + } + + public MyListbox getRolOperativoList() { + return rolOperativoList; + } + + public void setRolOperativoList(MyListbox rolOperativoList) { + this.rolOperativoList = rolOperativoList; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + diagramaList = autobusService.obtenerTodos(); + super.doAfterCompose(comp); + + rolOperativoList.setItemRenderer(new RenderRolOperativo()); + rolOperativoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + RolOperativo rol = (RolOperativo) rolOperativoList.getSelected(); + verRolOperativo(rol); + } + }); + + rolList = new ArrayList(); + + refreshLista(); + } + + private void verRolOperativo(RolOperativo r) { + if (r == null) { + return; + } + + Map args = new HashMap(); + args.put("rolOperativo", r); + args.put("rolOperativoList", rolOperativoList); + + openWindow("/gui/esquema_operacional/editarRolOperativo.zul", + Labels.getLabel("editarRolOperativoController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject RolBusqueda = + new HibernateSearchObject(RolOperativo.class, pagingRolOperativo.getPageSize()); + RolBusqueda.addFilterEqual("activo", Boolean.TRUE); + + RolBusqueda.addSortAsc("descroloperativo",true); + + plwRolOperativo.init(RolBusqueda, rolOperativoList, pagingRolOperativo); + } + + public void onClick$btnPesquisa(Event ev) { + + + DiagramaAutobus diagrama = (DiagramaAutobus) (cmbDiagramaBus.getSelectedItem() != null ? cmbDiagramaBus.getSelectedItem().getValue() : null); + rolList.clear(); + rolList.addAll(operativoService.pesquisar(diagrama, txtDesRol.getValue())); + rolOperativoList.setData(rolList); + + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verRolOperativo(new RolOperativo()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaTipoParadaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaTipoParadaController.java new file mode 100644 index 000000000..a40a543c8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaTipoParadaController.java @@ -0,0 +1,101 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.TipoParada; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoParada; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaTipoParadaController") +@Scope("prototype") +public class BusquedaTipoParadaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTipoParada; + private MyListbox tipoParadaList; + private Paging pagingTipoParada; + private Textbox txtNombre; + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTipoParada(new TipoParada()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tipoParadaList.setItemRenderer(new RenderTipoParada()); + tipoParadaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TipoParada c = (TipoParada) tipoParadaList.getSelected(); + verTipoParada(c); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verTipoParada(TipoParada c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("tipoParada", c); + args.put("tipoParadaList", tipoParadaList); + + openWindow("/gui/esquema_operacional/editarTipoParada.zul", + Labels.getLabel("busquedaTipoParadaController.window.title"), args, MODAL); + } + + private void refreshLista() throws InterruptedException { + HibernateSearchObject tipoParadaBusqueda = + new HibernateSearchObject(TipoParada.class, pagingTipoParada.getPageSize()); + + tipoParadaBusqueda.addFilterLike("desctipo", "%" + txtNombre.getText().trim().concat("%")); + tipoParadaBusqueda.addFilterEqual("activo", Boolean.TRUE); + tipoParadaBusqueda.addSortAsc("desctipo"); + + plwTipoParada.init(tipoParadaBusqueda, tipoParadaList, pagingTipoParada); + + if (tipoParadaList.getData().length == 0) { + Messagebox.show( + Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTipoParadaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaTramoKmServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaTramoKmServicioController.java new file mode 100644 index 000000000..ad61346fa --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaTramoKmServicioController.java @@ -0,0 +1,208 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoKmServicio; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.TramoService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTramoKmServicio; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Paging; + +/** + * + * @author Desenolvimento + */ +@Controller("busquedaTramoKmServicioController") +@Scope("prototype") +public class BusquedaTramoKmServicioController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTramoKmServicio; + @Autowired + private EmpresaService empresaService; + @Autowired + private TramoService tramoService; + @Autowired + private ClaseServicioService claseServicioService; + private MyListbox tramoKmServicioList; + private Paging pagingTramoKmServicio; +// private Combobox cmbTramo; + private Combobox cmbEmpresa; + private Combobox cmbClaseServicio; + private Combobox cmbParadaOrigem; + private Combobox cmbParadaDestino; + private List lsTramo; + private List lsEmpresa; + private List lsClaseServicio; + + public Paging getPagingTramoKmServicio() { + return pagingTramoKmServicio; + } + + public void setPagingTramoKmServicio(Paging pagingTramoKmServicio) { + this.pagingTramoKmServicio = pagingTramoKmServicio; + } + + public MyListbox getTramoKmServicioList() { + return tramoKmServicioList; + } + + public void setTramoKmServicioList(MyListbox tramoKmServicioList) { + this.tramoKmServicioList = tramoKmServicioList; + } + + public PagedListWrapper getPlwTramoKmServicio() { + return plwTramoKmServicio; + } + + public void setPlwTramoKmServicio(PagedListWrapper plwTramoKmServicio) { + this.plwTramoKmServicio = plwTramoKmServicio; + } + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsTramo() { + return lsTramo; + } + + public void setLsTramo(List lsTramo) { + this.lsTramo = lsTramo; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.buscarTodosExceto(-1); + lsClaseServicio = claseServicioService.buscarTodosExceto(-1); +// lsTramo = tramoService.obtenerTodos(); + + super.doAfterCompose(comp); + + tramoKmServicioList.setItemRenderer(new RenderTramoKmServicio()); + tramoKmServicioList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TramoKmServicio c = (TramoKmServicio) tramoKmServicioList.getSelected(); + verTramoKmServicio(c); + } + }); + + refreshLista(); + + } + + private void verTramoKmServicio(TramoKmServicio t) { + if (t == null) { + return; + } + + Map args = new HashMap(); + args.put("tramoKmServicio", t); + args.put("tramoKmServicioList", tramoKmServicioList); + + openWindow("/gui/esquema_operacional/editarTramoKmServicio.zul", + Labels.getLabel("editarTramoKmServicioController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject tramoBusqueda = + new HibernateSearchObject(TramoKmServicio.class, + pagingTramoKmServicio.getPageSize()); + + Comboitem cbiEmpresa = cmbEmpresa.getSelectedItem(); + if (cbiEmpresa != null) { + Empresa empresa = (Empresa) cbiEmpresa.getValue(); + tramoBusqueda.addFilterEqual("empresa", empresa); + } + + Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem(); + if (cbiClaseServicio != null) { + ClaseServicio clase = (ClaseServicio) cbiClaseServicio.getValue(); + tramoBusqueda.addFilterEqual("claseServicio", clase); + } + + Comboitem cbiOrigem = cmbParadaOrigem.getSelectedItem(); + if (cbiOrigem != null) { + Parada origem = (Parada) cbiOrigem.getValue(); + tramoBusqueda.addFilterEqual("tramo.origem", origem); + } + Comboitem cbiDestino = cmbParadaDestino.getSelectedItem(); + if (cbiDestino != null) { + + Parada destino = (Parada) cbiDestino.getValue(); + tramoBusqueda.addFilterEqual("tramo.destino", destino); + } + +// Comboitem cbiTramo = cmbTramo.getSelectedItem(); +// if (cbiTramo != null) { +// Tramo tramo = (Tramo) cbiTramo.getValue(); +// tramoBusqueda.addFilterEqual("tramo", tramo); +// } + + + tramoBusqueda.addSortAsc("tramokmservicioId"); + tramoBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwTramoKmServicio.init(tramoBusqueda, tramoKmServicioList, pagingTramoKmServicio); + + if (tramoKmServicioList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTramoKmServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTramoKmServicio(new TramoKmServicio()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaTramosController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaTramosController.java new file mode 100644 index 000000000..8f47c9a8c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaTramosController.java @@ -0,0 +1,248 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.ViaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTramo; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.event.InputEvent; +import org.zkoss.zkplus.databind.BindingListModel; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaTramosController") +@Scope("prototype") +public class BusquedaTramosController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTramos; + @Autowired + private ParadaService paradaService; + @Autowired + private ViaService viaService; + private MyListbox tramosList; + private Paging pagingTramos; + private Textbox txtNome; + private Combobox cmbParadaOrigem; + private Combobox cmbParadaDestino; + private Combobox cmbVia; + private Intbox txtKmReal; + private Intbox txtKmPagoConductor; + private List lsVias; + + public Paging getPagingTramos() { + return pagingTramos; + } + + public void setPagingTramos(Paging pagingTramos) { + this.pagingTramos = pagingTramos; + } + + public MyListbox getTramosList() { + return tramosList; + } + + public void setTramosList(MyListbox tramosList) { + this.tramosList = tramosList; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Combobox getCmbParadaDestino() { + return cmbParadaDestino; + } + + public void setCmbParadaDestino(Combobox cmbParadaDestino) { + this.cmbParadaDestino = cmbParadaDestino; + } + + public Combobox getCmbParadaOrigem() { + return cmbParadaOrigem; + } + + public void setCmbParadaOrigem(Combobox cmbParadaOrigem) { + this.cmbParadaOrigem = cmbParadaOrigem; + } + + public Combobox getCmbVia() { + return cmbVia; + } + + public void setCmbVia(Combobox cmbVia) { + this.cmbVia = cmbVia; + } + + public List getLsVias() { + return lsVias; + } + + public void setLsVias(List lsVias) { + this.lsVias = lsVias; + } + + public Intbox getTxtKmPagoConductor() { + return txtKmPagoConductor; + } + + public void setTxtKmPagoConductor(Intbox txtKmPagoConductor) { + this.txtKmPagoConductor = txtKmPagoConductor; + } + + public Intbox getTxtKmReal() { + return txtKmReal; + } + + public void setTxtKmReal(Intbox txtKmReal) { + this.txtKmReal = txtKmReal; + } + + public ParadaService getParadaService() { + return paradaService; + } + + public void setParadaService(ParadaService paradaService) { + this.paradaService = paradaService; + } + + public PagedListWrapper getPlwTramos() { + return plwTramos; + } + + public void setPlwTramos(PagedListWrapper plwTramos) { + this.plwTramos = plwTramos; + } + + public ViaService getViaService() { + return viaService; + } + + public void setViaService(ViaService viaService) { + this.viaService = viaService; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + lsVias = viaService.obtenerTodos(); + + + tramosList.setItemRenderer(new RenderTramo()); + tramosList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Tramo c = (Tramo) tramosList.getSelected(); + verTramos(c); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verTramos(Tramo t) { + if (t == null) { + return; + } + + Map args = new HashMap(); + args.put("tramo", t); + args.put("tramosList", tramosList); + + openWindow("/gui/esquema_operacional/editarTramos.zul", + Labels.getLabel("editarTramosController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject tramoBusqueda = + new HibernateSearchObject(Tramo.class, + pagingTramos.getPageSize()); + + tramoBusqueda.addFilterLike("desctramo", + "%" + txtNome.getText().trim().concat("%")); + + Comboitem cbiOrigem = cmbParadaOrigem.getSelectedItem(); + if (cbiOrigem != null) { + Parada origem = (Parada) cbiOrigem.getValue(); + tramoBusqueda.addFilterEqual("origem", origem); + } + + Comboitem cbiDestino = cmbParadaDestino.getSelectedItem(); + if (cbiDestino != null) { + Parada destino = (Parada) cbiDestino.getValue(); + tramoBusqueda.addFilterEqual("destino", destino); + } + + Comboitem cbiVia = cmbVia.getSelectedItem(); + if (cbiVia != null) { + Via via = (Via) cbiVia.getValue(); + tramoBusqueda.addFilterEqual("via", via); + } + + tramoBusqueda.addFilterEqual("kmReal", txtKmReal.getValue()); + tramoBusqueda.addFilterEqual("kmPagoConductor", txtKmPagoConductor.getValue()); + + tramoBusqueda.addSortAsc("desctramo"); + tramoBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwTramos.init(tramoBusqueda, tramosList, pagingTramos); + + if (tramosList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTramosController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTramos(new Tramo()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaViaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaViaController.java new file mode 100644 index 000000000..ce7a40806 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/BusquedaViaController.java @@ -0,0 +1,138 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderVia; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaViaController") +@Scope("prototype") +public class BusquedaViaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwVia; + private MyListbox viaList; + private Paging pagingVia; + private Textbox txtNome; + + public Paging getPagingVia() { + return pagingVia; + } + + public void setPagingVia(Paging pagingVia) { + this.pagingVia = pagingVia; + } + + public PagedListWrapper getPlwVia() { + return plwVia; + } + + public void setPlwVia(PagedListWrapper plwVia) { + this.plwVia = plwVia; + } + + public MyListbox getViaList() { + return viaList; + } + + public void setViaList(MyListbox viaList) { + this.viaList = viaList; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + viaList.setItemRenderer(new RenderVia()); + viaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Via c = (Via) viaList.getSelected(); + verVia(c); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verVia(Via v) { + if (v == null) { + return; + } + + Map args = new HashMap(); + args.put("via", v); + args.put("viaList", viaList); + + openWindow("/gui/esquema_operacional/editarVia.zul", + Labels.getLabel("editarViaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject viaBusqueda = + new HibernateSearchObject(Via.class, + pagingVia.getPageSize()); + + viaBusqueda.addFilterLike("nombvia", + "%" + txtNome.getText().trim().concat("%")); + + viaBusqueda.addSortAsc("nombvia"); + viaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwVia.init(viaBusqueda, viaList, pagingVia); + + if (viaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaViaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verVia(new Via()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarAutobusController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarAutobusController.java new file mode 100644 index 000000000..07a84a8b3 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarAutobusController.java @@ -0,0 +1,198 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.Autobus; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.service.AutobusService; +import com.rjconsultores.ventaboletos.service.CorridaService; +import com.rjconsultores.ventaboletos.service.DiagramaAutobusService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarAutobusController") +@Scope("prototype") +public class EditarAutobusController extends MyGenericForwardComposer { + + @Autowired + private AutobusService autobusService; + @Autowired + private DiagramaAutobusService diagramaAutobusService; + @Autowired + private CorridaService corridaService; + private List lsDiagramaAutobus; + private Autobus autobus; + private MyListbox autobusList; + private Textbox txtNome; + private Combobox cmbDiagramaAutobus; + private Combobox cmbDiagramaAutobusPiso; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarAutobusController.class); + + public Autobus getAutobus() { + return autobus; + } + + public void setAutobus(Autobus autobus) { + this.autobus = autobus; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public List getLsDiagramaAutobus() { + return lsDiagramaAutobus; + } + + public void setLsDiagramaAutobus(List lsDiagramaAutobus) { + this.lsDiagramaAutobus = lsDiagramaAutobus; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Combobox getCmbDiagramaAutobus() { + return cmbDiagramaAutobus; + } + + public void setCmbDiagramaAutobus(Combobox cmbDiagramaAutobus) { + this.cmbDiagramaAutobus = cmbDiagramaAutobus; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsDiagramaAutobus = diagramaAutobusService.obtenerTodos(); + super.doAfterCompose(comp); + + autobus = (Autobus) Executions.getCurrent().getArg().get("autobus"); + autobusList = (MyListbox) Executions.getCurrent().getArg().get("autobusList"); + + txtNome.focus(); + + if (autobus.getAutobusId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + cmbDiagramaAutobus.getSelectedItem(); + + try { + autobus.setActivo(Boolean.TRUE); + autobus.setFecmodif(Calendar.getInstance().getTime()); + autobus.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsAutobus = + autobusService.buscar(autobus.getNumautobus(), + autobus.getDiagramaAutobus()); + + boolean podeSalvar = false; + if (lsAutobus.isEmpty()) { + podeSalvar = true; + } else { + if (autobus.getAutobusId() != null) { + for (Autobus c : lsAutobus) { + if (c.getAutobusId().equals(autobus.getAutobusId())) { + podeSalvar = true; + } + } + } + } + if (!podeSalvar) { + + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarAutobusController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (autobus.getAutobusId() == null) { + autobusService.suscribir(autobus); + autobusList.addItem(autobus); + } else { + autobusService.actualizacion(autobus); + autobusList.updateItem(autobus); + } + + Messagebox.show( + Labels.getLabel("editarAutobusController.MSG.suscribirOK"), + Labels.getLabel("editarAutobusController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error("editarAutobusController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarAutobusController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarAutobusController.MSG.borrarPergunta"), + Labels.getLabel("editarAutobusController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + if ((corridaService.buscarPorAutobusCorridasFuturas(autobus.getDiagramaAutobus()).isEmpty()) && + (corridaService.buscarPorRolOperativoCorridasFuturas(autobus.getDiagramaAutobus()).isEmpty())) { + + autobusService.borrar(autobus); + + Messagebox.show( + Labels.getLabel("editarAutobusController.MSG.borrarOK"), + Labels.getLabel("editarAutobusController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + autobusList.removeItem(autobus); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("editarDiagramaAutobusController.MSG.Corrida.Futura"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCatalogoDeParadaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCatalogoDeParadaController.java new file mode 100644 index 000000000..d5763f51c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCatalogoDeParadaController.java @@ -0,0 +1,252 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Nodo; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.TipoParada; +import com.rjconsultores.ventaboletos.service.NodoService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.TipoParadaService; +import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarCatalogoDeParadaController") +@Scope("prototype") +public class EditarCatalogoDeParadaController extends MyGenericForwardComposer { + + @Autowired + private ParadaService paradaService; + @Autowired + private TipoParadaService tipoParadaService; + @Autowired + private NodoService nodoService; + private Parada parada; + private MyListbox paradaList; + private static Logger log = Logger.getLogger(EditarCatalogoDeParadaController.class); + private Textbox txtNome; + private Textbox cveparada; + private Combobox cmbCiudad; + private Combobox cmbTipoParada; + private Combobox cmbNodo; + private List lsTipoParadas; + private List lsNodo; + private Button btnApagar; + + public Combobox getCmbCiudad() { + return cmbCiudad; + } + + public void setCmbCiudad(Combobox cmbCiudad) { + this.cmbCiudad = cmbCiudad; + } + + public Combobox getCmbNodo() { + return cmbNodo; + } + + public void setCmbNodo(Combobox cmbNodo) { + this.cmbNodo = cmbNodo; + } + + public Combobox getCmbTipoParada() { + return cmbTipoParada; + } + + public void setCmbTipoParada(Combobox cmbTipoParada) { + this.cmbTipoParada = cmbTipoParada; + } + + public Textbox getCveparada() { + return cveparada; + } + + public void setCveparada(Textbox cveparada) { + this.cveparada = cveparada; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public List getLsNodo() { + return lsNodo; + } + + public void setLsNodo(List lsNodo) { + this.lsNodo = lsNodo; + } + + public List getLsTipoParadas() { + return lsTipoParadas; + } + + public void setLsTipoParadas(List lsTipoParadas) { + this.lsTipoParadas = lsTipoParadas; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + parada = (Parada) Executions.getCurrent().getArg().get("parada"); + paradaList = (MyListbox) Executions.getCurrent().getArg().get("paradaList"); + + lsTipoParadas = tipoParadaService.obtenerTodos(); + lsNodo = nodoService.obtenerTodos(); + + if (parada.getParadaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + Ciudad ciudad = parada.getCiudad(); + if (ciudad != null) { + cmbCiudad.setText(ciudad.getNombciudad()); + } + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + cveparada.getValue(); + cmbCiudad.getSelectedItem(); + cmbTipoParada.getSelectedItem(); + cmbNodo.getSelectedItem(); + + try { + if (parada.getParadaId() == null) { + List lsParadas = + paradaService.buscar(parada.getDescparada(), parada.getCveparada(), + parada.getCiudad(), parada.getTipoParada(), parada.getNodo()); + + lsParadas.addAll(paradaService.buscar(parada.getDescparada())); + lsParadas.addAll(paradaService.buscarCVE(parada.getCveparada())); + + if (lsParadas.isEmpty()) { + paradaService.suscribir(parada); + paradaList.addItem(parada); + + Messagebox.show( + Labels.getLabel("editarCatalogoDeParadaController.MSG.suscribirOK"), + Labels.getLabel("editarCatalogoDeParadaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarCatalogoDeParadaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + paradaService.actualizacion(parada); + paradaList.updateItem(parada); + + Messagebox.show( + Labels.getLabel("editarCatalogoDeParadaController.MSG.suscribirOK"), + Labels.getLabel("editarCatalogoDeParadaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarCatalogoDeParadaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarCatalogoDeParadaController.MSG.borrarPergunta"), + Labels.getLabel("editarCatalogoDeParadaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + paradaService.borrar(parada); + + Messagebox.show( + Labels.getLabel("editarCatalogoDeParadaController.MSG.borrarOK"), + Labels.getLabel("editarCatalogoDeParadaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + paradaList.removeItem(parada); + + closeWindow(); + } + } catch (RegistroConDependenciaException ex) { + Clients.alert( + ex.getLocalizedMessage(), + Labels.getLabel("editarCatalogoDeParadaController.window.title"), + Messagebox.INFORMATION); + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarCatalogoDeParadaController.window.title"), + Messagebox.INFORMATION); + } + } + + public Parada getParada() { + return parada; + } + + public void setParada(Parada parada) { + this.parada = parada; + } + + public MyListbox getParadaList() { + return paradaList; + } + + public void setParadaList(MyListbox paradaList) { + this.paradaList = paradaList; + } + + public ParadaService getParadaService() { + return paradaService; + } + + public void setParadaService(ParadaService paradaService) { + this.paradaService = paradaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCatalogoDeRutaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCatalogoDeRutaController.java new file mode 100644 index 000000000..a4f25b098 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCatalogoDeRutaController.java @@ -0,0 +1,969 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import java.sql.SQLException; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.ListModelList; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Spinner; +import org.zkoss.zul.Tab; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParadaSecuencia; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaCombinacion; +import com.rjconsultores.ventaboletos.entidad.RutaEmpresa; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.EsquemaCorridaService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.RutaCombinacionService; +import com.rjconsultores.ventaboletos.service.RutaEmpresaService; +import com.rjconsultores.ventaboletos.service.RutaSecuenciaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.TramoService; +import com.rjconsultores.ventaboletos.service.ViaService; +import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCatalogoDeRutasSecuencia; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRutaEmpresa; + +/** + * + * @author Rafius + */ +@Controller("editarCatalogoDeRutaController") +@Scope("prototype") +public class EditarCatalogoDeRutaController extends MyGenericForwardComposer implements ListitemRenderer { + + @Autowired + private RutaService rutaService; + @Autowired + private EsquemaCorridaService esquemaCorridaService; + @Autowired + private ClaseServicioService claseService; + @Autowired + private TramoService tramoService; + @Autowired + private RutaCombinacionService rutaCombinacionService; + @Autowired + private RutaSecuenciaService rutaSecuenciaService; + @Autowired + private ViaService viaService; + @Autowired + private ParadaService paradaService; + @Autowired + private EmpresaService empresaService; + @Autowired + private RutaEmpresaService rutaEmpresaService; + @Autowired + private transient PagedListWrapper plwRutaCombinacion; + private Ruta ruta; + private MyListbox rutaList; + private MyListbox rutaSecuenciaList; + private MyListbox rutaCombinacionList; + private MyListbox rutaEmpresaList; + private Paging pagingRutaCombinacion; + private List lsRutaSecuencia; + private List lsRutaCombinacion; + private List lsClase; + private List lsVia; + private List lsParadasSequencia; + private List lsEmpresa; + private List lsRutaEmpresa; + private Tramo tramoBandBox; + private Textbox txtNome; + private Spinner numSecuencia; + private Combobox cmbClase; + private Combobox cmbTramoCombinacion; + private Combobox cmbVia; + private Combobox cmbEmpresa; + private Combobox cmbParada; + private Radio radioVentaSi; + private Radio rdNo; + private Radio rdSi; + private Button btnApagar; + private Integer ultimaSecuencia; + private Boolean secuenciaFoiAlterada = Boolean.FALSE; + private Boolean modificado = Boolean.FALSE; + private Checkbox chkVentaOffLine; + private Tab tabCombinacion; + private static Logger log = Logger.getLogger(EditarCatalogoDeRutaController.class); + private boolean carregouCombinacao; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Checkbox getChkVentaOffLine() { + return chkVentaOffLine; + } + + public void setChkVentaOffLine(Checkbox chkVentaOffLine) { + this.chkVentaOffLine = chkVentaOffLine; + } + + public Paging getPagingRutaCombinacion() { + return pagingRutaCombinacion; + } + + public void setPagingRutaCombinacion(Paging pagingRutaCombinacion) { + this.pagingRutaCombinacion = pagingRutaCombinacion; + } + + public PagedListWrapper getPlwRutaCombinacion() { + return plwRutaCombinacion; + } + + public void setPlwRutaCombinacion( + PagedListWrapper plwRutaCombinacion) { + this.plwRutaCombinacion = plwRutaCombinacion; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsClase = claseService.buscarTodosExceto(-1); + lsVia = viaService.obtenerTodos(); + lsEmpresa = empresaService.obtenerIndTipo1(); + + ruta = (Ruta) Executions.getCurrent().getArg().get("ruta"); + rutaList = (MyListbox) Executions.getCurrent().getArg().get("rutaList"); + + super.doAfterCompose(comp); + + // Secuencia + rutaSecuenciaList.setItemRenderer(new RenderCatalogoDeRutasSecuencia()); + lsRutaSecuencia = new ArrayList(); + + // Combinacion + rutaCombinacionList.setItemRenderer(this); + lsRutaCombinacion = new ArrayList(); + + // Ruta Empresa + rutaEmpresaList.setItemRenderer(new RenderRutaEmpresa()); + lsRutaEmpresa = new ArrayList(); + + lsParadasSequencia = new ArrayList(); + + if (ruta.getRutaId() != null) { + + ruta = rutaService.obtenerID(ruta.getRutaId()); + if (ruta.getIndNombreObligatorio()) { + rdSi.setChecked(true); + } else { + rdNo.setChecked(true); + } + + lsRutaEmpresa = ruta.getLsRutaEmpresa(); + rutaEmpresaList.setData(lsRutaEmpresa); + + carregarParadaSecuencia(); + ruta.setRutaSecuenciaList(lsRutaSecuencia); + + numSecuencia.setValue(lsRutaSecuencia.size() + 2); + } else { + List combinacion = new ArrayList(); + ruta.setRutaCombinacionList(combinacion); + numSecuencia.setValue(1); + } + txtNome.focus(); + + if (ruta.getRutaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + carregouCombinacao = false; + + } + + private void paginarCombinacao() { + if (ruta.getRutaId() != null) { + HibernateSearchObject claseServicioBusqueda = new HibernateSearchObject( + RutaCombinacion.class, pagingRutaCombinacion.getPageSize()); + + claseServicioBusqueda.addFilterEqual("activo", Boolean.TRUE); + claseServicioBusqueda.addFilterEqual("ruta", ruta); + + plwRutaCombinacion.init(claseServicioBusqueda, rutaCombinacionList, + pagingRutaCombinacion); + } + } + + private void addTramoPardaSecuencia(Parada parada, Via via, + Short numsecuencia) { + ParadaSecuencia paradaSecuencia = new ParadaSecuencia(); + paradaSecuencia.setParada(parada); + paradaSecuencia.setSecuencia(numsecuencia); + paradaSecuencia.setVia(via); + lsParadasSequencia.add(paradaSecuencia); + } + + private void carregarParadaSecuencia() { + lsParadasSequencia.clear(); + lsRutaSecuencia = rutaSecuenciaService.buscarSecuenciaOrdenado(ruta); + short numSecuencia = 0; + for (int i = 0; i < lsRutaSecuencia.size(); i++) { + RutaSecuencia rs = lsRutaSecuencia.get(i); + Tramo tramo = rs.getTramo(); + Via via = tramo.getVia(); + Short numsecuencia = ++numSecuencia; + + Parada paradaOrigem = tramo.getOrigem(); + addTramoPardaSecuencia(paradaOrigem, via, numsecuencia); + if (i == lsRutaSecuencia.size() - 1) { + Parada paradaDestino = tramo.getDestino(); + Integer ultSecuencia = numsecuencia.intValue() + 1; + addTramoPardaSecuencia(paradaDestino, via, + ultSecuencia.shortValue()); + } + } + rutaSecuenciaList.setData(lsParadasSequencia); + } + + public void onClick$btModificar(Event ev) { + numSecuencia.setDisabled(Boolean.FALSE); + ultimaSecuencia = numSecuencia.getValue(); + modificado = Boolean.TRUE; + } + + public void onClick$btnAdicionarSecuencia(Event ev) + throws InterruptedException { + cmbVia.getValue(); + try { + // Para uma ruta já existente, só é possí­vel adicionar paradas + // entre a origem inicial e destino final. + if (ruta.getRutaId() != null) { + if ((numSecuencia.getValue() == 1) + || (numSecuencia.getValue() > lsParadasSequencia.size())) { + Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.cambioSecuencia"), + Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + } + cmbParada.getSelectedItem(); + Parada parada = (Parada) cmbParada.getSelectedItem().getValue(); + + Via via = (Via) cmbVia.getSelectedItem().getValue(); + boolean existe = false; + + for (ParadaSecuencia ps : lsParadasSequencia) { + if (ps.getParada().equals(parada)) { + existe = true; + } + } + + if (!existe) { + if (!modificado) { + addTramoPardaSecuencia(parada, via, numSecuencia.getValue().shortValue()); + rutaSecuenciaList.setData(lsParadasSequencia); + numSecuencia.setValue(numSecuencia.getValue() + 1); + secuenciaFoiAlterada = Boolean.TRUE; + cmbParada.focus(); + cmbParada.setText(""); + } else { + Boolean incrementar = Boolean.FALSE; + for (int i = 0; i < lsParadasSequencia.size(); i++) { + // Se numero de secuencia inserido marior que os que + // existem, não faço nada. + if (lsParadasSequencia.get(i).getSecuencia().intValue() < numSecuencia.getValue()) { + continue; + // Se existe uma sequancia igual a já digitada, incremento +1 nesse secuencia + } else if (lsParadasSequencia.get(i).getSecuencia().intValue() == numSecuencia.getValue()) { + Integer novaSecuencia = lsParadasSequencia.get(i).getSecuencia().intValue() + 1; + lsParadasSequencia.get(i).setSecuencia(new Short(novaSecuencia.toString())); + incrementar = Boolean.TRUE; + // So continuo incrementando se já houver uma secuencia igual + } else if (incrementar) { + Integer novaSecuencia = lsParadasSequencia.get(i).getSecuencia().intValue() + 1; + lsParadasSequencia.get(i).setSecuencia(new Short(novaSecuencia.toString())); + } else { + continue; + } + } + + addTramoPardaSecuencia(parada, via, numSecuencia.getValue().shortValue()); + // Em ordem crescente do numero da secuencia + Collections.sort(lsParadasSequencia, new Comparator() { + + public int compare(Object o1, Object o2) { + ParadaSecuencia p1 = (ParadaSecuencia) o1; + ParadaSecuencia p2 = (ParadaSecuencia) o2; + return p1.getSecuencia().intValue() < p2.getSecuencia().intValue() ? -1 : (p1.getSecuencia().intValue() > p2.getSecuencia().intValue() ? +1 : 0); + } + }); + + rutaSecuenciaList.setData(lsParadasSequencia); + secuenciaFoiAlterada = Boolean.TRUE; + numSecuencia.setValue(ultimaSecuencia); + numSecuencia.setDisabled(Boolean.TRUE); + cmbParada.focus(); + cmbParada.setText(""); + + } + } else { + Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.validacion.yaExisteParada"), + Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + } + } catch (Exception e) { + log.error(e); + Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.MSG.selectItem"), + Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + } + } + + public void onClick$btnRemoverSecuencia(Event ev) { + try { + ParadaSecuencia paradaSecuencia = (ParadaSecuencia) rutaSecuenciaList.getSelected(); + if (paradaSecuencia != null) { + + if (ruta.getRutaId() != null){ + List lsEsquemas = esquemaCorridaService.existe(ruta, paradaSecuencia.getParada().getParadaId()); + if (!lsEsquemas.isEmpty()){ + StringBuilder sb = new StringBuilder(""); + for(Integer esquemaCorridaId:lsEsquemas){ + sb.append(esquemaCorridaId).append(", "); + } + sb.delete(sb.length()-2, sb.length()); + + String msg = new MessageFormat(Labels.getLabel("busquedaCatalogoDeRutaController.msg.validactionRemocionParada")).format(new Object[]{paradaSecuencia.getParada().getDescparada(),sb.toString()}); + + Messagebox.show(msg,Labels.getLabel("editarCatalogoDeRutaController.window.title"),Messagebox.OK, Messagebox.ERROR); + + return; + } + } + + Short secuenciaMax = 0; + for (ParadaSecuencia ps : lsParadasSequencia) { + if (ps.getSecuencia().compareTo(secuenciaMax) > 0) { + secuenciaMax = ps.getSecuencia(); + } + } + numSecuencia.setValue(secuenciaMax + 1); + + if (paradaSecuencia.getSecuencia() == 1 + || paradaSecuencia.getSecuencia() == secuenciaMax) { + Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.MSG.removerSecuencia"), + Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + for (ParadaSecuencia ps : lsParadasSequencia) { + if (ps.getParada().equals(paradaSecuencia.getParada())) { + lsParadasSequencia.remove(ps); + rutaSecuenciaList.setData(lsParadasSequencia); + secuenciaFoiAlterada = Boolean.TRUE; + log.debug("Sequencia Removida: " + + ps.getSecuencia() + " - " + + ps.getParada().getCveparada()); + break; + } + } + } + + } + + } catch (Exception e) { + log.error("Erro ao remover secuencia da ruta" + e.getMessage()); + Clients.alert(Labels.getLabel("MSG.Error"), Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnAdicionarEmpresaRuta(Event ev) { + try { + Comboitem cbiEmpresa = cmbEmpresa.getSelectedItem(); + + if (cbiEmpresa != null) { + Empresa empresa = (Empresa) cbiEmpresa.getValue(); + + Boolean achou = Boolean.FALSE; + + for (RutaEmpresa re : lsRutaEmpresa) { + if (re.getEmpresa().getEmpresaId().equals(empresa.getEmpresaId())) { + achou = Boolean.TRUE; + } + } + + if (!achou) { + RutaEmpresa rutaEmpresa = new RutaEmpresa(); + rutaEmpresa.setActivo(Boolean.TRUE); + rutaEmpresa.setEmpresa(empresa); + rutaEmpresa.setFecmodif(Calendar.getInstance().getTime()); + rutaEmpresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + lsRutaEmpresa.add(rutaEmpresa); + ruta.setLsRutaEmpresa(lsRutaEmpresa); + + rutaEmpresaList.setData(lsRutaEmpresa); + } else { + Messagebox.show(Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } catch (Exception ex) { + log.debug(ex); + Clients.alert(Labels.getLabel("MSG.Error"), Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnRemoverEmpresaRuta(Event ev) { + RutaEmpresa rutaEmpresa = (RutaEmpresa) rutaEmpresaList.getSelected(); + if (rutaEmpresa != null) { + rutaEmpresa.setActivo(Boolean.FALSE); + rutaEmpresa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + rutaEmpresa.setFecmodif(Calendar.getInstance().getTime()); + + rutaEmpresaService.borrar(rutaEmpresa); + + lsRutaEmpresa.remove(rutaEmpresa); + rutaEmpresaList.setData(lsRutaEmpresa); + } + } + + private boolean validar() throws InterruptedException { + txtNome.getValue(); + cmbClase.getValue(); + + if (lsParadasSequencia.size() < 2) { + Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.validacion.paradas"), + Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return false; + } + if (lsRutaEmpresa.isEmpty()) { + Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.msg.validacion.empresa"), + Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return false; + } + + return true; + } + + // Quando alteramos os tramo em combinacao selecionando uma nova via + // temos q atualizar os tramos da sequencia para que seja os mesmos + // tramos em combinacao e sequencia: + private void atualizarTramosSequencia() { + List lsRutacComb = ruta.getRutaCombinacionList(); + List lsRutaSec = ruta.getRutaSecuenciaList(); + + for (RutaCombinacion rc : lsRutacComb) { + Tramo tramoRC = rc.getTramo(); + Parada origemRC = rc.getTramo().getOrigem(); + Parada destinoRC = rc.getTramo().getDestino(); + Via viaRC = rc.getTramo().getVia(); + for (RutaSecuencia rs : lsRutaSec) { + Parada origemRS = rs.getTramo().getOrigem(); + Parada destinoRS = rs.getTramo().getDestino(); + Via viaRS = rs.getTramo().getVia(); + + if ((origemRS.getParadaId().equals(origemRC.getParadaId())) + && (destinoRS.getParadaId().equals(destinoRC.getParadaId())) + && (!viaRS.getViaId().equals(viaRC.getViaId()))) { + rs.setTramo(tramoRC); + } + } + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + if ((ruta.getRutaId() != null) && secuenciaFoiAlterada) { + int resp = Messagebox.show( + Labels.getLabel("editarCatalogoDeRutaController.msg.validacionCambionEnCombinaciones"), + Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.NO) { + return; + } + } + + if (!validar()) { + return; + } + + try { + + if (lsParadasSequencia.size() == 1) { + Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.MSG.sequencia"), Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + ruta.setActivo(Boolean.TRUE); + ruta.setFecmodif(Calendar.getInstance().getTime()); + ruta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + ruta.setClaseServicio((ClaseServicio) cmbClase.getSelectedItem().getValue()); + ruta.setVentaOffLine(chkVentaOffLine.isChecked()); + + if (rdSi.isChecked()) { + ruta.setIndNombreObligatorio(Boolean.TRUE); + } else if (rdNo.isChecked()) { + ruta.setIndNombreObligatorio(Boolean.FALSE); + } + + if (ruta.getRutaId() == null) { + String nomeRuta = ruta.getDescruta(); + ClaseServicio claseServicio = ruta.getClaseServicio(); + Boolean isNomeObrigatorio = ruta.getIndNombreObligatorio(); + + List lsRutas = rutaService.buscar(nomeRuta, claseServicio, isNomeObrigatorio); + + if (lsRutas.isEmpty()) { + ruta = rutaService.suscribir(ruta, lsParadasSequencia); + + rutaList.addItem(ruta); + + Messagebox.show(Labels.getLabel( + "editarCatalogoDeRutaController.MSG.suscribirOK").concat(" ID: " + + ruta.getRutaId().toString()), + Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.OK, + Messagebox.INFORMATION); + + closeWindow(); + + } else { + Messagebox.show(Labels.getLabel("MSG.Registro.Existe"), Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + + // Gera Secuencia e Combinação Novamente se houve modificação na Secuencia. + if (secuenciaFoiAlterada) { + ruta = rutaService.actualizacion(ruta, lsParadasSequencia); + } else { + ruta = rutaService.actualizacion(ruta, null); + } + + rutaList.updateItem(ruta); + + Messagebox.show(Labels.getLabel( + "editarCatalogoDeRutaController.MSG.suscribirOK").concat(" ID: " + + ruta.getRutaId().toString()), + Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } + } catch (BusinessException ex) { + Messagebox.show(ex.getLocalizedMessage(), Labels.getLabel("editarCatalogoDeRutaController.window.title"), Messagebox.OK, Messagebox.ERROR); + } catch (Exception ex) { + log.error("Error al dar de alta ruta", ex); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("editarCatalogoDeRutaController.window.title"), Messagebox.OK, Messagebox.ERROR); + } + + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.MSG.borrarPergunta"), + Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + rutaService.borrar(ruta); + Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.MSG.borrarOK"), + Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + rutaList.removeItem(ruta); + + closeWindow(); + } + } catch (RegistroConDependenciaException ex) { + Clients.alert(ex.getLocalizedMessage(), Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.INFORMATION); + } catch (Exception ex) { + log.error(ex); + Clients.alert(Labels.getLabel("MSG.Error"), Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.INFORMATION); + } + } + + public void render(Listitem lstm, Object o) throws Exception { + try { + RutaCombinacion rutaCombinacion = (RutaCombinacion) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(); + final Combobox comboVenda = new Combobox(); + comboVenda.setMold("rounded"); + comboVenda.setWidth("90%"); + List op = new ArrayList(); + op.add("Si"); + op.add("No"); + comboVenda.setModel(new ListModelList(op)); + comboVenda.setValue(rutaCombinacion.getIndventa() == Boolean.TRUE ? "Si" + : "No"); + comboVenda.setTooltip(rutaCombinacion.getRutacombinacionId().toString()); + comboVenda.addEventListener("onChange", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + String venda = (String) comboVenda.getSelectedItem().getValue(); + String idCombinacion = comboVenda.getTooltip(); + vendeSiNo(venda, idCombinacion); + } + }); + lc.appendChild(comboVenda); + lc.setParent(lstm); + + lc = new Listcell(rutaCombinacion.getTramo().getDesctramo()); + lc.setParent(lstm); + + lc = new Listcell(); + + final Combobox comboVia = new Combobox(); + comboVia.setMold("rounded"); + comboVia.setWidth("90%"); + comboVia.setTooltip(rutaCombinacion.getRutacombinacionId().toString()); + + List lsViaCombinacion = tramoService.obtenerViasOrigemDestino( + rutaCombinacion.getTramo().getOrigem(), rutaCombinacion.getTramo().getDestino()); + + if (lsViaCombinacion.size() == 1) { + comboVia.setDisabled(Boolean.TRUE); + } + comboVia.setModel(new ListModelList(lsViaCombinacion)); + comboVia.setValue(rutaCombinacion.getTramo().getVia().getNombvia()); + comboVia.addEventListener("onChange", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Via v = (Via) comboVia.getSelectedItem().getValue(); + String idCombinacion = comboVenda.getTooltip(); + opcionVia(v, idCombinacion); + } + }); + lc.appendChild(comboVia); + lc.setParent(lstm); + + lstm.setAttribute("data", rutaCombinacion); + } catch (Exception e) { + log.error("Erro ao mudar via da ruta combinacion: " + + e.getMessage()); + Clients.alert(Labels.getLabel("MSG.Error"), Labels.getLabel("editarCatalogoDeRutaController.window.title"), + Messagebox.ERROR); + } + + } + + public void vendeSiNo(String venda, String idCombinacion) { + + RutaCombinacion rc = (RutaCombinacion) rutaCombinacionList.getSelected(); + + rc = rutaCombinacionService.obtenerID(Integer.parseInt(idCombinacion)); + // lsRutaCombinacion.remove(rc); + rc.setIndventa(venda.equals("Si") ? Boolean.TRUE : Boolean.FALSE); + rc = rutaCombinacionService.actualizacion(rc); + // lsRutaCombinacion.add(rc); + rutaCombinacionList.clearSelection(); + } + + public void opcionVia(Via v, String idCombinacion) { + + RutaCombinacion rc = rutaCombinacionService.obtenerID(Integer.parseInt(idCombinacion)); + + // lsRutaCombinacion.remove(rc); + rc.setTramo(tramoService.obtenerTramotPorOrigemDestinoVia(rc.getTramo().getOrigem(), rc.getTramo().getDestino(), v)); + rutaCombinacionService.actualizacion(rc); + // lsRutaCombinacion.add(rc); + // rutaCombinacionList.updateItem(rc); + + atualizarTramosSequencia(); + } + + public MyListbox getRutaEmpresaList() { + return rutaEmpresaList; + } + + public void setRutaEmpresaList(MyListbox rutaEmpresaList) { + this.rutaEmpresaList = rutaEmpresaList; + } + + public Ruta getRuta() { + return ruta; + } + + public void setRuta(Ruta ruta) { + this.ruta = ruta; + } + + public MyListbox getRutaList() { + return rutaList; + } + + public void setRutaList(MyListbox rutaList) { + this.rutaList = rutaList; + } + + public RutaService getRutaService() { + return rutaService; + } + + public void setRutaService(RutaService rutaService) { + this.rutaService = rutaService; + } + + public ClaseServicioService getClaseService() { + return claseService; + } + + public void setClaseService(ClaseServicioService claseService) { + this.claseService = claseService; + } + + public Combobox getCmbClase() { + return cmbClase; + } + + public void setCmbClase(Combobox cmbClase) { + this.cmbClase = cmbClase; + } + + public List getLsClase() { + return lsClase; + } + + public void setLsClase(List lsClase) { + this.lsClase = lsClase; + } + + public List getLsRutaCombinacion() { + return lsRutaCombinacion; + } + + public void setLsRutaCombinacion(List lsRutaCombinacion) { + this.lsRutaCombinacion = lsRutaCombinacion; + } + + public List getLsRutaSecuencia() { + return lsRutaSecuencia; + } + + public void setLsRutaSecuencia(List lsRutaSecuencia) { + this.lsRutaSecuencia = lsRutaSecuencia; + } + + public MyListbox getRutaSecuenciaList() { + return rutaSecuenciaList; + } + + public void setRutaSecuenciaList(MyListbox rutaSecuenciaList) { + this.rutaSecuenciaList = rutaSecuenciaList; + } + + public Combobox getCmbTramoCombinacion() { + return cmbTramoCombinacion; + } + + public void setCmbTramoCombinacion(Combobox cmbTramoCombinacion) { + this.cmbTramoCombinacion = cmbTramoCombinacion; + } + + public Spinner getNumSecuencia() { + return numSecuencia; + } + + public void setNumSecuencia(Spinner numSecuencia) { + this.numSecuencia = numSecuencia; + } + + public Radio getRadioVentaSi() { + return radioVentaSi; + } + + public void setRadioVentaSi(Radio RadioVentaSi) { + this.radioVentaSi = RadioVentaSi; + } + + public TramoService getTramoService() { + return tramoService; + } + + public void setTramoService(TramoService TramoService) { + this.tramoService = TramoService; + } + + public RutaCombinacionService getRutaCombinacionService() { + return rutaCombinacionService; + } + + public void setRutaCombinacionService( + RutaCombinacionService rutaCombinacionService) { + this.rutaCombinacionService = rutaCombinacionService; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Tramo getTramoBandBox() { + return tramoBandBox; + } + + public void setTramoBandBox(Tramo tramoBandBox) { + this.tramoBandBox = tramoBandBox; + } + + public List getLsVia() { + return lsVia; + } + + public void setLsVia(List lsVia) { + this.lsVia = lsVia; + } + + public ViaService getViaService() { + return viaService; + } + + public void setViaService(ViaService viaService) { + this.viaService = viaService; + } + + public Combobox getCmbVia() { + return cmbVia; + } + + public void setCmbVia(Combobox cmbVia) { + this.cmbVia = cmbVia; + } + + public ParadaService getParadaService() { + return paradaService; + } + + public void setParadaService(ParadaService paradaService) { + this.paradaService = paradaService; + } + + public MyListbox getRutaCombinacionList() { + return rutaCombinacionList; + } + + public void setRutaCombinacionList(MyListbox rutaCombinacionList) { + this.rutaCombinacionList = rutaCombinacionList; + } + + public Radio getRdNo() { + return rdNo; + } + + public void setRdNo(Radio rdNo) { + this.rdNo = rdNo; + } + + public Radio getRdSi() { + return rdSi; + } + + public void setRdSi(Radio rdSi) { + this.rdSi = rdSi; + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsParadasSequencia() { + return lsParadasSequencia; + } + + public void setLsParadasSequencia(List lsParadasSequencia) { + this.lsParadasSequencia = lsParadasSequencia; + } + + public List getLsRutaEmpresa() { + return lsRutaEmpresa; + } + + public void setLsRutaEmpresa(List lsRutaEmpresa) { + this.lsRutaEmpresa = lsRutaEmpresa; + } + + public Combobox getCmbParada() { + return cmbParada; + } + + public void setCmbParada(Combobox cmbParada) { + this.cmbParada = cmbParada; + } + + public void onClick$tabCombinacion(Event ev) throws SQLException { + if (!carregouCombinacao) { + Clients.showBusy("Cargando combinaciones"); + paginarCombinacao(); + Clients.clearBusy(); + } + carregouCombinacao = true; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCorridaAsientoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCorridaAsientoController.java new file mode 100644 index 000000000..6b27c8a96 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCorridaAsientoController.java @@ -0,0 +1,1914 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.service.DiagramaAutobusService; +import com.rjconsultores.ventaboletos.service.EsquemaAsientoService; +import com.rjconsultores.ventaboletos.service.EsquemaCorridaService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.RutaSecuenciaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.zkoss.zk.ui.Component; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.InputEvent; +import org.zkoss.zkplus.databind.BindingListModel; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarCorridaAsientoController") +@Scope("prototype") +public class EditarCorridaAsientoController extends MyGenericForwardComposer { + + @Autowired + private EsquemaCorridaService esquemaCorridaService; + @Autowired + private EsquemaAsientoService esquemaAsientoService; + @Autowired + private ParadaService paradaService; + @Autowired + private DiagramaAutobusService diagramaAutoBusService; + @Autowired + private RutaService rutaService; + @Autowired + private RutaSecuenciaService rutaSecuenciaService; + private EsquemaCorrida esquemaCorrida; + private List lsOrigen; + private List lsAsientos; + private DiagramaAutobus diagramaAutobus; + private Textbox txtAsiento; + private Button btnCeder; + private Button btnLiberar; + private Combobox cmbOrigen; + private Button btn_1_1; + private Button btn_1_2; + private Button btn_1_3; + private Button btn_1_4; + private Button btn_1_5; + private Button btn_1_6; + private Button btn_1_7; + private Button btn_1_8; + private Button btn_1_9; + private Button btn_1_10; + private Button btn_1_11; + private Button btn_1_12; + private Button btn_1_13; + private Button btn_3_1; + private Button btn_3_2; + private Button btn_3_3; + private Button btn_3_4; + private Button btn_3_5; + private Button btn_3_6; + private Button btn_3_7; + private Button btn_3_8; + private Button btn_3_9; + private Button btn_3_10; + private Button btn_3_11; + private Button btn_3_12; + private Button btn_3_13; + private Button btn_5_1; + private Button btn_5_2; + private Button btn_5_3; + private Button btn_5_4; + private Button btn_5_5; + private Button btn_5_6; + private Button btn_5_7; + private Button btn_5_8; + private Button btn_5_9; + private Button btn_5_10; + private Button btn_5_11; + private Button btn_5_12; + private Button btn_5_13; + private Button btn_7_1; + private Button btn_7_2; + private Button btn_7_3; + private Button btn_7_4; + private Button btn_7_5; + private Button btn_7_6; + private Button btn_7_7; + private Button btn_7_8; + private Button btn_7_9; + private Button btn_7_10; + private Button btn_7_11; + private Button btn_7_12; + private Button btn_7_13; + private static Logger log = Logger.getLogger(EditarCorridaAsientoController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + esquemaCorrida = (EsquemaCorrida) Executions.getCurrent().getArg().get("esquemaCorrida"); + + lsOrigen = new ArrayList(); + Ruta ruta = esquemaCorrida.getRuta(); + //ruta = rutaService.obtenerID(ruta.getRutaId()); + if (ruta != null) { + List lsRutaSecuencia = rutaSecuenciaService.buscarSecuenciaOrdenado(ruta); + for (RutaSecuencia rc : lsRutaSecuencia) { + Tramo tramo = rc.getTramo(); + if (tramo != null) { + Parada origem = tramo.getOrigem(); + if (!lsOrigen.contains(origem)) { + lsOrigen.add(origem); + } + + Parada destino = tramo.getDestino(); + if (!lsOrigen.contains(destino)) { + lsOrigen.add(destino); + } + } + } + if (lsOrigen.size() > 1) { + lsOrigen.remove(lsOrigen.size() - 1);//O destino final de uma ruta não pode ter asento cedido + } + } + + super.doAfterCompose(comp); + + diagramaAutobus = diagramaAutoBusService.obtenerID(esquemaCorrida.getRolOperativo().getDiagramaAutobus().getDiagramaautobusId()); + colorirAsientos(null); + + txtAsiento.setValue(""); + + for (Short fila = 1; fila <= 7; fila++) { + for (Short coluna = 1; coluna <= 13; coluna++) { + if (fila == 1 || fila == 3 || fila == 5 || fila == 7) { + Button button = getButtonAssento(fila, coluna); + if ((button.getLabel() == null) || (button.getLabel().equals(""))) { + button.setDisabled(true); + } + } + Button button = getButtonAssento(fila, coluna); + if (button != null) { + button.setDisabled(!DetDiagramaAutobus.asientoVendible(button.getLabel())); + } + } + } + } + + public void colorirAsientos(Event ev) throws InterruptedException { + lsAsientos = esquemaAsientoService.obtenerPorCorrida(esquemaCorrida); + + for (DetDiagramaAutobus dd : diagramaAutobus.getDetDiagramaAutobusList()) { + if ((dd.getNumefila() == 1) || (dd.getNumefila() == 3) || (dd.getNumefila() == 5) || (dd.getNumefila() == 7)) { + Button button = getButtonAssento(dd.getNumefila(), dd.getNumecolumna()); + button.setLabel(dd.getAsiento()); + button.setTooltiptext(dd.getAsiento()); + + dd.getVendible(); + + if ((button.getSclass().equals("myRed")) || (button.getSclass().equals("myBlue"))) { + button.setSclass("myGreen"); + } + + for (EsquemaAsiento as : lsAsientos) { + if (as.getNumasiento().equals(dd.getAsiento())) { + button.setSclass("myBlue"); + button.setLabel(as.getParada().getCveparada()); + break; + } + } + } + } + } + + public void onClick$btnCeder(Event ev) throws InterruptedException { + try { + cmbOrigen.getValue(); + + boolean salvo = true; + txtAsiento.setText((txtAsiento.getValue().endsWith(",")) ? txtAsiento.getValue() : txtAsiento.getValue().concat(",")); + + List todosAsientos = new ArrayList(); + + String asientos[] = txtAsiento.getValue().split(","); + + for (int i = 0; i < asientos.length; i++) { + if (asientos[i].contains("-")) { + String intervalo[] = asientos[i].split("-"); + Integer ini = Integer.parseInt(intervalo[0]); + Integer fim = Integer.parseInt(intervalo[1]); + + while (ini <= fim) { + todosAsientos.add(ini.toString()); + ini++; + } + } else { + todosAsientos.add(String.valueOf(Integer.parseInt(asientos[i]))); + } + } + + for (int i = 0; i < todosAsientos.size(); i++) { + + String asiento = todosAsientos.get(i); + + boolean vende = true; + + DiagramaAutobus da = diagramaAutoBusService.obtenerID(esquemaCorrida.getRolOperativo().getDiagramaAutobus().getDiagramaautobusId()); + + List listDda = da.getDetDiagramaAutobusList(); + for (DetDiagramaAutobus dd : listDda) { + if (dd.getAsiento().equals(asiento)) { + if (!dd.getVendible()) { + vende = false; + } + } + } + if (vende) { + try { + Integer.parseInt(todosAsientos.get(i)); + } catch (Exception ex) { + txtAsiento.setValue(""); + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaAsientoController.MSG.invalido"), + Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"), + Messagebox.OK, Messagebox.ERROR); + break; + } + EsquemaAsiento es = new EsquemaAsiento(); + es.setActivo(Boolean.TRUE); + es.setFecmodif(Calendar.getInstance().getTime()); + es.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + es.setNumasiento(asiento); + es.setIndvendible(Boolean.TRUE); + es.setEsquemaCorrida(esquemaCorrida); + es.setParada((Parada) cmbOrigen.getSelectedItem().getValue()); + EsquemaAsiento esquemaAsientoBusqueda = esquemaAsientoService.obtenerPorCorridaeAsiento(esquemaCorrida, asiento); + if (esquemaAsientoBusqueda.getEsquemaasientoId() == null) { + esquemaAsientoService.suscribir(es); + lsAsientos.add(es); + } else { + Messagebox.show("Asiento " + asiento + " existe en el Registro.", + Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + + } else { + salvo = false; + Messagebox.show("Asiento " + asiento + " no vendible.", + Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + if (salvo) { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaAsientoController.MSG.salvo"), + Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + + } + colorirAsientos(null); + txtAsiento.setValue(""); + //closeWindow(); + } catch (Exception ex) { + log.error("Erro asiento:" + ex); + txtAsiento.setValue(""); + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaAsientoController.MSG.invalido"), + Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"), + Messagebox.OK, Messagebox.ERROR); + + } + } + + public void onClick$btnLiberar(Event ev) throws InterruptedException { + try { + txtAsiento.setText((txtAsiento.getValue().endsWith(",")) ? txtAsiento.getValue() : txtAsiento.getValue().concat(",")); + + List todosAsientos = new ArrayList(); + String asientos[] = txtAsiento.getValue().split(","); + + for (int i = 0; i < asientos.length; i++) { + if (asientos[i].contains("-")) { + String intervalo[] = asientos[i].split("-"); + Integer ini = Integer.parseInt(intervalo[0]); + Integer fim = Integer.parseInt(intervalo[1]); + + while (ini <= fim) { + todosAsientos.add(ini.toString()); + ini++; + } + } else { + todosAsientos.add(asientos[i]); + } + } + + for (int i = 0; i < todosAsientos.size(); i++) { + + String asiento = todosAsientos.get(i); + + EsquemaAsiento esquemaAsientoBusqueda = esquemaAsientoService.obtenerPorCorridaeAsiento(esquemaCorrida, asiento); + if (esquemaAsientoBusqueda.getEsquemaasientoId() != null) { + lsAsientos.remove(esquemaAsientoBusqueda); + + esquemaAsientoBusqueda.setActivo(Boolean.FALSE); + esquemaAsientoService.borrar(esquemaAsientoBusqueda); + + lsAsientos.add(esquemaAsientoBusqueda); + } + } + + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaAsientoController.MSG.liberar"), + Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + + txtAsiento.setValue(""); + colorirAsientos(null); + //closeWindow(); + } catch (Exception ex) { + log.error("Erro asiento:" + ex); + txtAsiento.setValue(""); + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaAsientoController.MSG.invalido"), + Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"), + Messagebox.OK, Messagebox.ERROR); + + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarConfiguracionCorridaController.MSG.borrarPergunta"), + Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + + Messagebox.show( + Labels.getLabel("editarConfiguracionCorridaController.MSG.borrarOK"), + Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + private Button getButtonAssento(Short numeFila, Short numeColuna) { + Button button = null; + switch (numeFila) { + case 1: + switch (numeColuna) { + case 1: + button = btn_1_1; + break; + case 2: + button = btn_1_2; + break; + case 3: + button = btn_1_3; + break; + case 4: + button = btn_1_4; + break; + case 5: + button = btn_1_5; + break; + case 6: + button = btn_1_6; + break; + case 7: + button = btn_1_7; + break; + case 8: + button = btn_1_8; + break; + case 9: + button = btn_1_9; + break; + case 10: + button = btn_1_10; + break; + case 11: + button = btn_1_11; + break; + case 12: + button = btn_1_12; + break; + case 13: + button = btn_1_13; + break; + } + break; + + case 3: + switch (numeColuna) { + case 1: + button = btn_3_1; + break; + case 2: + button = btn_3_2; + break; + case 3: + button = btn_3_3; + break; + case 4: + button = btn_3_4; + break; + case 5: + button = btn_3_5; + break; + case 6: + button = btn_3_6; + break; + case 7: + button = btn_3_7; + break; + case 8: + button = btn_3_8; + break; + case 9: + button = btn_3_9; + break; + case 10: + button = btn_3_10; + break; + case 11: + button = btn_3_11; + break; + case 12: + button = btn_3_12; + break; + case 13: + button = btn_3_13; + break; + } + break; + + case 5: + switch (numeColuna) { + case 1: + button = btn_5_1; + break; + case 2: + button = btn_5_2; + break; + case 3: + button = btn_5_3; + break; + case 4: + button = btn_5_4; + break; + case 5: + button = btn_5_5; + break; + case 6: + button = btn_5_6; + break; + case 7: + button = btn_5_7; + break; + case 8: + button = btn_5_8; + break; + case 9: + button = btn_5_9; + break; + case 10: + button = btn_5_10; + break; + case 11: + button = btn_5_11; + break; + case 12: + button = btn_5_12; + break; + case 13: + button = btn_5_13; + break; + } + break; + + case 7: + switch (numeColuna) { + case 1: + button = btn_7_1; + break; + case 2: + button = btn_7_2; + break; + case 3: + button = btn_7_3; + break; + case 4: + button = btn_7_4; + break; + case 5: + button = btn_7_5; + break; + case 6: + button = btn_7_6; + break; + case 7: + button = btn_7_7; + break; + case 8: + button = btn_7_8; + break; + case 9: + button = btn_7_9; + break; + case 10: + button = btn_7_10; + break; + case 11: + button = btn_7_11; + break; + case 12: + button = btn_7_12; + break; + case 13: + button = btn_7_13; + break; + } + break; + } + + return button; + } + + public void onClick$btn_1_1(Event ev) { + try { + String asiento = (btn_1_1.getTooltiptext().length() < 2) ? btn_1_1.getTooltiptext() : btn_1_1.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_1_1.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_1_1.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + + } + + public void onClick$btn_1_2(Event ev) throws Exception { + try { + String asiento = (btn_1_2.getTooltiptext().length() < 2) ? btn_1_2.getTooltiptext() : btn_1_2.getTooltiptext(); + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_1_2.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_1_2.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_1_3(Event ev) throws Exception { + try { + String asiento = (btn_1_3.getTooltiptext().length() < 2) ? btn_1_3.getTooltiptext() : btn_1_3.getTooltiptext(); + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_1_3.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_1_3.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_1_4(Event ev) throws Exception { + try { + String asiento = (btn_1_4.getTooltiptext().length() < 2) ? btn_1_4.getTooltiptext() : btn_1_4.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_1_4.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_1_4.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_1_5(Event ev) throws Exception { + try { + String asiento = (btn_1_5.getTooltiptext().length() < 2) ? btn_1_5.getTooltiptext() : btn_1_5.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_1_5.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_1_5.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_1_6(Event ev) throws Exception { + try { + String asiento = (btn_1_6.getTooltiptext().length() < 2) ? btn_1_6.getTooltiptext() : btn_1_6.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_1_6.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_1_6.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_1_7(Event ev) throws Exception { + try { + String asiento = (btn_1_7.getTooltiptext().length() < 2) ? btn_1_7.getTooltiptext() : btn_1_7.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_1_7.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_1_7.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_1_8(Event ev) throws Exception { + try { + String asiento = (btn_1_8.getTooltiptext().length() < 2) ? btn_1_8.getTooltiptext() : btn_1_8.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_1_8.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_1_8.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_1_9(Event ev) throws Exception { + try { + String asiento = (btn_1_9.getTooltiptext().length() < 2) ? btn_1_9.getTooltiptext() : btn_1_9.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_1_9.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_1_9.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_1_10(Event ev) throws Exception { + try { + String asiento = (btn_1_10.getTooltiptext().length() < 2) ? btn_1_10.getTooltiptext() : btn_1_10.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_1_10.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_1_10.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_1_11(Event ev) throws Exception { + try { + String asiento = (btn_1_11.getTooltiptext().length() < 2) ? btn_1_11.getTooltiptext() : btn_1_11.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_1_11.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_1_11.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_1_12(Event ev) throws Exception { + try { + String asiento = (btn_1_12.getTooltiptext().length() < 2) ? btn_1_12.getTooltiptext() : btn_1_12.getTooltiptext(); + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_1_12.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_1_12.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_1_13(Event ev) throws Exception { + try { + String asiento = (btn_1_13.getTooltiptext().length() < 2) ? btn_1_13.getTooltiptext() : btn_1_13.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_1_13.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_1_13.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_3_1(Event ev) throws Exception { + try { + String asiento = (btn_3_1.getTooltiptext().length() < 2) ? btn_3_1.getTooltiptext() : btn_3_1.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_3_1.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_3_1.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_3_2(Event ev) throws Exception { + try { + String asiento = (btn_3_2.getTooltiptext().length() < 2) ? btn_3_2.getTooltiptext() : btn_3_2.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_3_2.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_3_2.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_3_3(Event ev) throws Exception { + try { + String asiento = (btn_3_3.getTooltiptext().length() < 2) ? btn_3_3.getTooltiptext() : btn_3_3.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_3_3.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_3_3.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_3_4(Event ev) throws Exception { + try { + String asiento = (btn_3_4.getTooltiptext().length() < 2) ? btn_3_4.getTooltiptext() : btn_3_4.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_3_4.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_3_4.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_3_5(Event ev) throws Exception { + try { + String asiento = (btn_3_5.getTooltiptext().length() < 2) ? btn_3_5.getTooltiptext() : btn_3_5.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_3_5.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_3_5.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_3_6(Event ev) throws Exception { + try { + String asiento = (btn_3_6.getTooltiptext().length() < 2) ? btn_3_6.getTooltiptext() : btn_3_6.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_3_6.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_3_6.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_3_7(Event ev) throws Exception { + try { + String asiento = (btn_3_7.getTooltiptext().length() < 2) ? btn_3_7.getTooltiptext() : btn_3_7.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_3_7.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_3_7.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_3_8(Event ev) throws Exception { + try { + String asiento = (btn_3_8.getTooltiptext().length() < 2) ? btn_3_8.getTooltiptext() : btn_3_8.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_3_8.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_3_8.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_3_9(Event ev) throws Exception { + try { + String asiento = (btn_3_9.getTooltiptext().length() < 2) ? btn_3_9.getTooltiptext() : btn_3_9.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_3_9.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_3_9.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_3_10(Event ev) throws Exception { + try { + String asiento = (btn_3_10.getTooltiptext().length() < 2) ? btn_3_10.getTooltiptext() : btn_3_10.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_3_10.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_3_10.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_3_11(Event ev) throws Exception { + try { + String asiento = (btn_3_11.getTooltiptext().length() < 2) ? btn_3_11.getTooltiptext() : btn_3_11.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_3_11.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_3_11.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_3_12(Event ev) throws Exception { + try { + String asiento = (btn_3_12.getTooltiptext().length() < 2) ? btn_3_12.getTooltiptext() : btn_3_12.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_3_12.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_3_12.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_3_13(Event ev) throws Exception { + try { + String asiento = (btn_3_13.getTooltiptext().length() < 2) ? btn_3_13.getTooltiptext() : btn_3_13.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_3_13.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_3_13.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_5_1(Event ev) throws Exception { + try { + String asiento = (btn_5_1.getTooltiptext().length() < 2) ? btn_5_1.getTooltiptext() : btn_5_1.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_5_1.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_5_1.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_5_2(Event ev) throws Exception { + try { + String asiento = (btn_5_2.getTooltiptext().length() < 2) ? btn_5_2.getTooltiptext() : btn_5_2.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_5_2.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_5_2.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_5_3(Event ev) throws Exception { + try { + String asiento = (btn_5_3.getTooltiptext().length() < 2) ? btn_5_3.getTooltiptext() : btn_5_3.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_5_3.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_5_3.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_5_4(Event ev) throws Exception { + try { + String asiento = (btn_5_4.getTooltiptext().length() < 2) ? btn_5_4.getTooltiptext() : btn_5_4.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_5_4.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_5_4.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_5_5(Event ev) throws Exception { + try { + String asiento = (btn_5_5.getTooltiptext().length() < 2) ? btn_5_5.getTooltiptext() : btn_5_5.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_5_5.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_5_5.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_5_6(Event ev) throws Exception { + try { + String asiento = (btn_5_6.getTooltiptext().length() < 2) ? btn_5_6.getTooltiptext() : btn_5_6.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_5_6.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_5_6.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_5_7(Event ev) throws Exception { + try { + String asiento = (btn_5_7.getTooltiptext().length() < 2) ? btn_5_7.getTooltiptext() : btn_5_7.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_5_7.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_5_7.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_5_8(Event ev) throws Exception { + try { + String asiento = (btn_5_8.getTooltiptext().length() < 2) ? btn_5_8.getTooltiptext() : btn_5_8.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_5_8.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_5_8.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_5_9(Event ev) throws Exception { + try { + String asiento = (btn_5_9.getTooltiptext().length() < 2) ? btn_5_9.getTooltiptext() : btn_5_9.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_5_9.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_5_9.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_5_10(Event ev) throws Exception { + try { + String asiento = (btn_5_10.getTooltiptext().length() < 2) ? btn_5_10.getTooltiptext() : btn_5_10.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_5_10.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_5_10.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_5_11(Event ev) throws Exception { + try { + String asiento = (btn_5_11.getTooltiptext().length() < 2) ? btn_5_11.getTooltiptext() : btn_5_11.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_5_11.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_5_11.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_5_12(Event ev) throws Exception { + try { + String asiento = (btn_5_12.getTooltiptext().length() < 2) ? btn_5_12.getTooltiptext() : btn_5_12.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_5_12.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_5_12.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_5_13(Event ev) throws Exception { + try { + String asiento = (btn_5_13.getTooltiptext().length() < 2) ? btn_5_13.getTooltiptext() : btn_5_13.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_5_13.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_5_13.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_7_1(Event ev) throws Exception { + try { + String asiento = (btn_7_1.getTooltiptext().length() < 2) ? btn_7_1.getTooltiptext() : btn_7_1.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_7_1.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_7_1.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_7_2(Event ev) throws Exception { + try { + String asiento = (btn_7_2.getTooltiptext().length() < 2) ? btn_7_2.getTooltiptext() : btn_7_2.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_7_2.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_7_2.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_7_3(Event ev) throws Exception { + try { + String asiento = (btn_7_3.getTooltiptext().length() < 2) ? btn_7_3.getTooltiptext() : btn_7_3.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_7_3.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_7_3.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_7_4(Event ev) throws Exception { + try { + String asiento = (btn_7_4.getTooltiptext().length() < 2) ? btn_7_4.getTooltiptext() : btn_7_4.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_7_4.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_7_4.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_7_5(Event ev) throws Exception { + try { + String asiento = (btn_7_5.getTooltiptext().length() < 2) ? btn_7_5.getTooltiptext() : btn_7_5.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_7_5.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_7_5.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_7_6(Event ev) throws Exception { + try { + String asiento = (btn_7_6.getTooltiptext().length() < 2) ? btn_7_6.getTooltiptext() : btn_7_6.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_7_6.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_7_6.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_7_7(Event ev) throws Exception { + try { + String asiento = (btn_7_7.getTooltiptext().length() < 2) ? btn_7_7.getTooltiptext() : btn_7_7.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_7_7.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_7_7.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_7_8(Event ev) throws Exception { + try { + String asiento = (btn_7_8.getTooltiptext().length() < 2) ? btn_7_8.getTooltiptext() : btn_7_8.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_7_8.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_7_8.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_7_9(Event ev) throws Exception { + try { + String asiento = (btn_7_9.getTooltiptext().length() < 2) ? btn_7_9.getTooltiptext() : btn_7_9.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_7_9.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_7_9.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_7_10(Event ev) throws Exception { + try { + String asiento = (btn_7_10.getTooltiptext().length() < 2) ? btn_7_10.getTooltiptext() : btn_7_10.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_7_10.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_7_10.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_7_11(Event ev) throws Exception { + try { + String asiento = (btn_7_11.getTooltiptext().length() < 2) ? btn_7_11.getTooltiptext() : btn_7_11.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_7_11.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_7_11.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_7_12(Event ev) { + + try { + String asiento = (btn_7_12.getTooltiptext().length() < 2) ? btn_7_12.getTooltiptext() : btn_7_12.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_7_12.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_7_12.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onClick$btn_7_13(Event ev) { + try { + String asiento = (btn_7_13.getTooltiptext().length() < 2) ? btn_7_13.getTooltiptext() : btn_7_13.getTooltiptext(); + + if (!txtAsiento.getValue().contains(asiento)) { + txtAsiento.setValue(txtAsiento.getValue().concat(asiento.concat(","))); + btn_7_13.setSclass("myRed"); + } else { + txtAsiento.setValue(txtAsiento.getValue().replace(asiento.concat(","), "")); + btn_7_13.setSclass("myGreen"); + } + } catch (Exception e) { + log.info("Asiento Inexistente"); + } + } + + public void onChanging$cmbOrigen(InputEvent ev) { + String strParada = ev.getValue().toUpperCase(); + + List lsParadas = new ArrayList(); + if (!strParada.isEmpty()) { + lsParadas = paradaService.buscaLike(strParada); + + BindingListModel listModelParada = new BindingListModelList(lsParadas, true); + cmbOrigen.setModel(listModelParada); + + cmbOrigen.open(); + } else { + lsParadas.clear(); + + BindingListModel listModelParada = new BindingListModelList(lsParadas, true); + cmbOrigen.setModel(listModelParada); + } + } + + public EsquemaCorrida getEsquemaCorrida() { + return esquemaCorrida; + } + + public void setEsquemaCorrida(EsquemaCorrida esquemaCorrida) { + this.esquemaCorrida = esquemaCorrida; + } + + public EsquemaCorridaService getEsquemaCorridaService() { + return esquemaCorridaService; + } + + public void setEsquemaCorridaService(EsquemaCorridaService esquemaCorridaService) { + this.esquemaCorridaService = esquemaCorridaService; + } + + public static Logger getLog() { + return log; + } + + public static void setLog(Logger log) { + EditarCorridaAsientoController.log = log; + } + + public List getLsOrigen() { + return lsOrigen; + } + + public void setLsOrigen(List lsOrigen) { + this.lsOrigen = lsOrigen; + } + + public ParadaService getParadaService() { + return paradaService; + } + + public void setParadaService(ParadaService paradaService) { + this.paradaService = paradaService; + } + + public Button getBtn_1_1() { + return btn_1_1; + } + + public void setBtn_1_1(Button btn_1_1) { + this.btn_1_1 = btn_1_1; + } + + public Button getBtn_1_10() { + return btn_1_10; + } + + public void setBtn_1_10(Button btn_1_10) { + this.btn_1_10 = btn_1_10; + } + + public Button getBtn_1_11() { + return btn_1_11; + } + + public void setBtn_1_11(Button btn_1_11) { + this.btn_1_11 = btn_1_11; + } + + public Button getBtn_1_12() { + return btn_1_12; + } + + public void setBtn_1_12(Button btn_1_12) { + this.btn_1_12 = btn_1_12; + } + + public Button getBtn_1_13() { + return btn_1_13; + } + + public void setBtn_1_13(Button btn_1_13) { + this.btn_1_13 = btn_1_13; + } + + public Button getBtn_1_2() { + return btn_1_2; + } + + public void setBtn_1_2(Button btn_1_2) { + this.btn_1_2 = btn_1_2; + } + + public Button getBtn_1_3() { + return btn_1_3; + } + + public void setBtn_1_3(Button btn_1_3) { + this.btn_1_3 = btn_1_3; + } + + public Button getBtn_1_4() { + return btn_1_4; + } + + public void setBtn_1_4(Button btn_1_4) { + this.btn_1_4 = btn_1_4; + } + + public Button getBtn_1_5() { + return btn_1_5; + } + + public void setBtn_1_5(Button btn_1_5) { + this.btn_1_5 = btn_1_5; + } + + public Button getBtn_1_6() { + return btn_1_6; + } + + public void setBtn_1_6(Button btn_1_6) { + this.btn_1_6 = btn_1_6; + } + + public Button getBtn_1_7() { + return btn_1_7; + } + + public void setBtn_1_7(Button btn_1_7) { + this.btn_1_7 = btn_1_7; + } + + public Button getBtn_1_8() { + return btn_1_8; + } + + public void setBtn_1_8(Button btn_1_8) { + this.btn_1_8 = btn_1_8; + } + + public Button getBtn_1_9() { + return btn_1_9; + } + + public void setBtn_1_9(Button btn_1_9) { + this.btn_1_9 = btn_1_9; + } + + public Button getBtn_3_1() { + return btn_3_1; + } + + public void setBtn_3_1(Button btn_3_1) { + this.btn_3_1 = btn_3_1; + } + + public Button getBtn_3_10() { + return btn_3_10; + } + + public void setBtn_3_10(Button btn_3_10) { + this.btn_3_10 = btn_3_10; + } + + public Button getBtn_3_11() { + return btn_3_11; + } + + public void setBtn_3_11(Button btn_3_11) { + this.btn_3_11 = btn_3_11; + } + + public Button getBtn_3_12() { + return btn_3_12; + } + + public void setBtn_3_12(Button btn_3_12) { + this.btn_3_12 = btn_3_12; + } + + public Button getBtn_3_13() { + return btn_3_13; + } + + public void setBtn_3_13(Button btn_3_13) { + this.btn_3_13 = btn_3_13; + } + + public Button getBtn_3_2() { + return btn_3_2; + } + + public void setBtn_3_2(Button btn_3_2) { + this.btn_3_2 = btn_3_2; + } + + public Button getBtn_3_3() { + return btn_3_3; + } + + public void setBtn_3_3(Button btn_3_3) { + this.btn_3_3 = btn_3_3; + } + + public Button getBtn_3_4() { + return btn_3_4; + } + + public void setBtn_3_4(Button btn_3_4) { + this.btn_3_4 = btn_3_4; + } + + public Button getBtn_3_5() { + return btn_3_5; + } + + public void setBtn_3_5(Button btn_3_5) { + this.btn_3_5 = btn_3_5; + } + + public Button getBtn_3_6() { + return btn_3_6; + } + + public void setBtn_3_6(Button btn_3_6) { + this.btn_3_6 = btn_3_6; + } + + public Button getBtn_3_7() { + return btn_3_7; + } + + public void setBtn_3_7(Button btn_3_7) { + this.btn_3_7 = btn_3_7; + } + + public Button getBtn_3_8() { + return btn_3_8; + } + + public void setBtn_3_8(Button btn_3_8) { + this.btn_3_8 = btn_3_8; + } + + public Button getBtn_3_9() { + return btn_3_9; + } + + public void setBtn_3_9(Button btn_3_9) { + this.btn_3_9 = btn_3_9; + } + + public Button getBtn_5_1() { + return btn_5_1; + } + + public void setBtn_5_1(Button btn_5_1) { + this.btn_5_1 = btn_5_1; + } + + public Button getBtn_5_10() { + return btn_5_10; + } + + public void setBtn_5_10(Button btn_5_10) { + this.btn_5_10 = btn_5_10; + } + + public Button getBtn_5_11() { + return btn_5_11; + } + + public void setBtn_5_11(Button btn_5_11) { + this.btn_5_11 = btn_5_11; + } + + public Button getBtn_5_12() { + return btn_5_12; + } + + public void setBtn_5_12(Button btn_5_12) { + this.btn_5_12 = btn_5_12; + } + + public Button getBtn_5_13() { + return btn_5_13; + } + + public void setBtn_5_13(Button btn_5_13) { + this.btn_5_13 = btn_5_13; + } + + public Button getBtn_5_2() { + return btn_5_2; + } + + public void setBtn_5_2(Button btn_5_2) { + this.btn_5_2 = btn_5_2; + } + + public Button getBtn_5_3() { + return btn_5_3; + } + + public void setBtn_5_3(Button btn_5_3) { + this.btn_5_3 = btn_5_3; + } + + public Button getBtn_5_4() { + return btn_5_4; + } + + public void setBtn_5_4(Button btn_5_4) { + this.btn_5_4 = btn_5_4; + } + + public Button getBtn_5_5() { + return btn_5_5; + } + + public void setBtn_5_5(Button btn_5_5) { + this.btn_5_5 = btn_5_5; + } + + public Button getBtn_5_6() { + return btn_5_6; + } + + public void setBtn_5_6(Button btn_5_6) { + this.btn_5_6 = btn_5_6; + } + + public Button getBtn_5_7() { + return btn_5_7; + } + + public void setBtn_5_7(Button btn_5_7) { + this.btn_5_7 = btn_5_7; + } + + public Button getBtn_5_8() { + return btn_5_8; + } + + public void setBtn_5_8(Button btn_5_8) { + this.btn_5_8 = btn_5_8; + } + + public Button getBtn_5_9() { + return btn_5_9; + } + + public void setBtn_5_9(Button btn_5_9) { + this.btn_5_9 = btn_5_9; + } + + public Button getBtn_7_1() { + return btn_7_1; + } + + public void setBtn_7_1(Button btn_7_1) { + this.btn_7_1 = btn_7_1; + } + + public Button getBtn_7_10() { + return btn_7_10; + } + + public void setBtn_7_10(Button btn_7_10) { + this.btn_7_10 = btn_7_10; + } + + public Button getBtn_7_11() { + return btn_7_11; + } + + public void setBtn_7_11(Button btn_7_11) { + this.btn_7_11 = btn_7_11; + } + + public Button getBtn_7_12() { + return btn_7_12; + } + + public void setBtn_7_12(Button btn_7_12) { + this.btn_7_12 = btn_7_12; + } + + public Button getBtn_7_13() { + return btn_7_13; + } + + public void setBtn_7_13(Button btn_7_13) { + this.btn_7_13 = btn_7_13; + } + + public Button getBtn_7_2() { + return btn_7_2; + } + + public void setBtn_7_2(Button btn_7_2) { + this.btn_7_2 = btn_7_2; + } + + public Button getBtn_7_3() { + return btn_7_3; + } + + public void setBtn_7_3(Button btn_7_3) { + this.btn_7_3 = btn_7_3; + } + + public Button getBtn_7_4() { + return btn_7_4; + } + + public void setBtn_7_4(Button btn_7_4) { + this.btn_7_4 = btn_7_4; + } + + public Button getBtn_7_5() { + return btn_7_5; + } + + public void setBtn_7_5(Button btn_7_5) { + this.btn_7_5 = btn_7_5; + } + + public Button getBtn_7_6() { + return btn_7_6; + } + + public void setBtn_7_6(Button btn_7_6) { + this.btn_7_6 = btn_7_6; + } + + public Button getBtn_7_7() { + return btn_7_7; + } + + public void setBtn_7_7(Button btn_7_7) { + this.btn_7_7 = btn_7_7; + } + + public Button getBtn_7_8() { + return btn_7_8; + } + + public void setBtn_7_8(Button btn_7_8) { + this.btn_7_8 = btn_7_8; + } + + public Button getBtn_7_9() { + return btn_7_9; + } + + public void setBtn_7_9(Button btn_7_9) { + this.btn_7_9 = btn_7_9; + } + + public DiagramaAutobus getDiagramaAutobus() { + return diagramaAutobus; + } + + public void setDiagramaAutobus(DiagramaAutobus diagramaAutobus) { + this.diagramaAutobus = diagramaAutobus; + } + + public DiagramaAutobusService getDiagramaAutoBusService() { + return diagramaAutoBusService; + } + + public void setDiagramaAutoBusService(DiagramaAutobusService diagramaAutoBusService) { + this.diagramaAutoBusService = diagramaAutoBusService; + } + + public Textbox getTxtAsineto() { + return txtAsiento; + } + + public void setTxtAsineto(Textbox txtAsineto) { + this.txtAsiento = txtAsineto; + } + + public Button getBtnCeder() { + return btnCeder; + } + + public void setBtnCeder(Button btnCeder) { + this.btnCeder = btnCeder; + } + + public Button getBtnLiberar() { + return btnLiberar; + } + + public void setBtnLiberar(Button btnLiberar) { + this.btnLiberar = btnLiberar; + } + + public Combobox getCmbOrigen() { + return cmbOrigen; + } + + public void setCmbOrigen(Combobox cmbOrigen) { + this.cmbOrigen = cmbOrigen; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCorridaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCorridaController.java new file mode 100644 index 000000000..df579be71 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarCorridaController.java @@ -0,0 +1,1538 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.commons.collections.CollectionUtils; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.event.InputEvent; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Label; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Spinner; +import org.zkoss.zul.Textbox; +import org.zkoss.zul.Timebox; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Division; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.EsquemaAsiento; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.EsquemaOperacional; +import com.rjconsultores.ventaboletos.entidad.EsquemaTramo; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParadaEsquema; +import com.rjconsultores.ventaboletos.entidad.RolOperativo; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.DivisionService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.EsquemaAsientoService; +import com.rjconsultores.ventaboletos.service.EsquemaCorridaService; +import com.rjconsultores.ventaboletos.service.EsquemaTramoService; +import com.rjconsultores.ventaboletos.service.MarcaClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.RolOperativoService; +import com.rjconsultores.ventaboletos.service.RutaCombinacionService; +import com.rjconsultores.ventaboletos.service.RutaSecuenciaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderConfiguracionCorridaTramo; +import org.zkoss.zul.Checkbox; + +/** + * + * @author Rafius + */ +@Controller("editarCorridaController") +@Scope("prototype") +public class EditarCorridaController extends MyGenericForwardComposer { + + @Autowired + private EsquemaCorridaService esquemaCorridaService; + @Autowired + private EsquemaAsientoService esquemaAsientoService; + @Autowired + private EsquemaTramoService esquemaTramoService; + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseService; + @Autowired + private RutaService rutaService; + @Autowired + private RutaCombinacionService rutaCombinacionService; + @Autowired + private RutaSecuenciaService rutaSecuenciaService; + @Autowired + private EmpresaService empresaService; + @Autowired + private MarcaClaseServicioService marcaClaseServicioService; + @Autowired + private RolOperativoService rolOperativoService; + @Autowired + private DivisionService divisionService; + private List lsDivision; + private List lsEmpresa; + private List lsMarca; + private List lsClase; + private List lsRuta; + private List lsRutaSecuencia; + private List lsEsquemaTramo; + private List lsRolOperativo; + private List lsTramosRutaEsquemaCorrida; + private List lsTramos; + private List lsParadaEsquema; + private Radio porBloq; + private Radio latente; + private Radio autorizada; + private Radio cancelada; + private Radio fletes; + private Radio viajesEspeciales; + private Radio transportePasajeros; + private Checkbox chkDoblePiso; + private EsquemaCorrida esquemaCorrida; + private MyListbox esquemaCorridaList; + private MyListbox esquemaTramoList; + private Datebox fecniciovigencia; + private Datebox fecfinvigencia; + private Combobox cmbClase; + private Combobox cmbClaseDoblePiso; + private Combobox cmbMarca; + private Combobox cmbRuta; + private Combobox cmbEmpresaCorrida; + private Combobox cmbEmpresaIngresso; + private Combobox cmbRolOperativo; + private Combobox cmbRolOperativoDoblePiso; + private Combobox cmbStatus; + private Combobox cmbVia; + private Combobox cmbTramo; + private Combobox cmbDivision; + private Button btnAsientos; + private Button btnAdicionarTramo; + private Button btnRemoverTramo; + private Timebox horasalida; + private Timebox de; + private Timebox hasta; + private Spinner minutos; + private Label horasalidaLabel; + private Label minutosLabel1; + private Label minutosLabel2; + private Label horaLabel1; + private Label horaLabel2; + private Label horaLabel21; + private Label horaLabel22; + private Label lbDivision; + private Label lbRolOperativoDoblePiso; + private Label lbClaseDoblePiso; + private Button btnApagar; + private Textbox txtIdCorridaRebote; + private static Logger log = Logger.getLogger(EditarCorridaController.class); + private Button btnAbrirEsquemaCorrida; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsParadaEsquema = new ArrayList(); + + lsEmpresa = empresaService.obtenerIndTipo1(); + lsClase = claseService.buscarTodosExceto(-1); + + lsRolOperativo = rolOperativoService.obtenerTodos(); + + esquemaCorrida = (EsquemaCorrida) Executions.getCurrent().getArg().get("esquemaCorrida"); + esquemaCorridaList = (MyListbox) Executions.getCurrent().getArg().get("esquemaCorridaList"); + + super.doAfterCompose(comp); + + if (esquemaCorrida.getEsquemacorridaId() == null) { + btnAdicionarTramo.setDisabled(true); + btnRemoverTramo.setDisabled(true); + } else { + // 01 - Não se pode mudar dados básicos da corrida. + // 02 - Segundo a Lety os campos CLASE, MARCA E EMPRESAS... + // Poderão ser editados pelo usuario. + // RUTA permanece inalterado. + cmbClase.setDisabled(Boolean.TRUE); + cmbMarca.setDisabled(Boolean.TRUE); + cmbRuta.setDisabled(Boolean.TRUE); + cmbEmpresaCorrida.setDisabled(Boolean.TRUE); + cmbEmpresaIngresso.setDisabled(Boolean.TRUE); + + if (esquemaCorrida.getPisoExtra() != null && esquemaCorrida.getPisoExtra()) { + chkDoblePiso.setChecked(true); + lbRolOperativoDoblePiso.setVisible(true); + lbClaseDoblePiso.setVisible(true); + cmbRolOperativoDoblePiso.setVisible(true); + cmbClaseDoblePiso.setVisible(true); + cmbRolOperativoDoblePiso.setConstraint("no empty"); + cmbClaseDoblePiso.setConstraint("no empty"); + } + } + + // Llena los valores de los combos + llenarRutasPorClase(); + llenarMarcaPorClaseServicio(); + + esquemaTramoList.setItemRenderer(new RenderConfiguracionCorridaTramo()); + esquemaTramoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ParadaEsquema pe = (ParadaEsquema) esquemaTramoList.getSelected(); + EsquemaTramo esquemaTramo = null; + if (pe.getNumsecuencia().equals(Short.valueOf("1"))) { + return; + } + for (EsquemaTramo et : lsEsquemaTramo) { + Short numSec = et.getNumsecuencia(); + numSec++; + if (numSec.equals(pe.getNumsecuencia())) { + esquemaTramo = et; + } + } + + verTempoEstanciaTramo(esquemaTramo, pe); + } + }); + + try { + lsEsquemaTramo = new ArrayList(); + + if (esquemaCorrida.getEsquemacorridaId() == null) { + EsquemaOperacional eo = new EsquemaOperacional(); + eo.setActivo(Boolean.TRUE); + eo.setFecmodif(Calendar.getInstance().getTime()); + eo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + esquemaCorrida.setEsquemaOperacional(eo); + + // btnAsientos.setDisabled(true); + + transportePasajeros.setChecked(Boolean.TRUE); + } else { + esquemaCorridaService.obtenerID(esquemaCorrida.getEsquemacorridaId()); + + esquemaCorrida.getEsquemaOperacional(); + // Não mostra opção na edição da corrida + porBloq.setVisible(false); + + if (esquemaCorrida.getStatusCorrida() != null) { + if (esquemaCorrida.getStatusCorrida().equals("L")) { + latente.setChecked(true); + } else if (esquemaCorrida.getStatusCorrida().equals("A")) { + autorizada.setChecked(true); + } else { + cancelada.setChecked(true); + } + + if (esquemaCorrida.getTipocorrida().equals("F")) { + fletes.setChecked(true); + } else if (esquemaCorrida.getTipocorrida().equals("S")) { + viajesEspeciales.setChecked(true); + } else { + transportePasajeros.setChecked(true); + } + + } + lsEsquemaTramo = esquemaTramoService.obtenerPorEsquemaCorridaOrderNumSec(esquemaCorrida); + carregarParadaSecuencia(lsEsquemaTramo); + selecionarRutaSequenciaForaEsqCorrida(); + } + + + fecniciovigencia.focus(); + + horasalida.setVisible(true); + horasalidaLabel.setVisible(true); + minutos.setVisible(false); + minutosLabel1.setVisible(false); + minutosLabel2.setVisible(false); + de.setVisible(false); + horaLabel1.setVisible(false); + horaLabel2.setVisible(false); + hasta.setVisible(false); + horaLabel21.setVisible(false); + horaLabel22.setVisible(false); + + if (esquemaCorrida.getEsquemacorridaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + if (esquemaCorrida.getEsquemaCorridaRebote() != null) { + txtIdCorridaRebote.setValue(esquemaCorrida.getEsquemaCorridaRebote().getEsquemacorridaId().toString()); + + } + + exibirDivision(); + + } catch (Exception ex) { + log.error("Error al editar una corrida", ex); + Messagebox.show(Labels.getLabel("MSG.Error"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + private void exibirDivision() { + if (ApplicationProperties.getInstance().exibirDivisionConfiguracionCorrida()) { + + lsDivision = divisionService.obtenerTodos(); + + lbDivision.setVisible(Boolean.TRUE); + cmbDivision.setVisible(Boolean.TRUE); + + } + } + + private void addTramoPardaEsquema(Parada parada, Short numsecuencia, + Date tiempoEstancia) { + ParadaEsquema ps = new ParadaEsquema(); + ps.setParada(parada); + ps.setNumsecuencia(numsecuencia); + ps.setTiempoEstancia(tiempoEstancia); + + lsParadaEsquema.add(ps); + } + + private void carregarParadaSecuencia(List lsEsquemaTramo) { + lsParadaEsquema.clear(); + if (!lsEsquemaTramo.isEmpty()) { + List lsEsquemaTramoTodos = new ArrayList(); + if (esquemaCorrida.getEsquemacorridaId() != null) { + lsEsquemaTramoTodos = esquemaTramoService.obtenerAtivosDesativosPorEsquemaCorrida(esquemaCorrida); + } + + Short numsecuencia = 1; + for (int i = 0; i < lsEsquemaTramo.size(); i++) { + + EsquemaTramo rs = lsEsquemaTramo.get(i); + + Tramo tramo = rs.getTramo(); + numsecuencia = rs.getNumsecuencia(); + Date tiempoEstancia = null; + + if ((i != 0) && (i != (lsEsquemaTramo.size()))) { + tiempoEstancia = lsEsquemaTramo.get(i - 1).getTiempoEstancia(); + } + + Parada paradaOrigem = tramo.getOrigem(); + // So adicionar a parada se o EsquemaTramo estiver ativo. + if (rs.getActivo()) { + addTramoPardaEsquema(paradaOrigem, numsecuencia, tiempoEstancia); + } + } + + EsquemaTramo esquemaTramoFinal = lsEsquemaTramo.get(lsEsquemaTramo.size() - 1); + + Parada paradaDestino = esquemaTramoFinal.getTramo().getDestino(); + Integer num = numsecuencia.intValue() + 1; + addTramoPardaEsquema(paradaDestino, num.shortValue(), null); + + } + + esquemaTramoList.setData(lsParadaEsquema); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + Date dataDe = fecniciovigencia.getValue(); + Date dataAte = fecfinvigencia.getValue(); + + try { + Comboitem ciRuta = cmbRuta.getSelectedItem(); + Ruta ruta = null; + if (ciRuta != null) { + ruta = (Ruta) ciRuta.getValue(); + } + + if (ruta != null) { + dataAte.setSeconds(59); + if (dataDe.before(dataAte)) { + if (!lsEsquemaTramo.isEmpty()) { + + if (esquemaCorrida.getClaseServicio() == null) { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Clase"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.EXCLAMATION); + } else if (esquemaCorrida.getMarca() == null) { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Marca"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.EXCLAMATION); + } else if (esquemaCorrida.getRuta() == null) { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Ruta"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.EXCLAMATION); + } else if (esquemaCorrida.getEmpresa() == null) { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Empresa"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.EXCLAMATION); + } else if (esquemaCorrida.getEmpresa1() == null) { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Empresa1"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.EXCLAMATION); + } else if (esquemaCorrida.getRolOperativo() == null) { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Rol"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.EXCLAMATION); + } else if (esquemaCorrida.getPisoExtra() != null && esquemaCorrida.getPisoExtra() && esquemaCorrida.getClaseServicio2() == null) { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Clase2"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.EXCLAMATION); + } else if (esquemaCorrida.getPisoExtra() != null && esquemaCorrida.getPisoExtra() && esquemaCorrida.getRolOperativo2() == null) { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.Rol2"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.EXCLAMATION); + + } else { + + if (porBloq.isChecked()) { + de.getValue(); + hasta.getValue(); + minutos.getValue(); + } else { + horasalida.getValue(); + } + + esquemaCorrida.setActivo(Boolean.TRUE); + esquemaCorrida.setFecmodif(Calendar.getInstance().getTime()); + esquemaCorrida.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + esquemaCorrida.setDiagramaAutobusId(esquemaCorrida.getRolOperativo().getDiagramaAutobus().getDiagramaautobusId().intValue()); + + if (latente.isChecked()) { + esquemaCorrida.setStatusCorrida("L"); + } else if (autorizada.isChecked()) { + esquemaCorrida.setStatusCorrida("A"); + } else { + esquemaCorrida.setStatusCorrida("C"); + } + + if (fletes.isChecked()) { + esquemaCorrida.setTipocorrida("F"); + } else if (viajesEspeciales.isChecked()) { + esquemaCorrida.setTipocorrida("S"); + } else if (transportePasajeros.isChecked()) { + esquemaCorrida.setTipocorrida("P"); + } + + // nao gravar segundos: + GregorianCalendar gHoraSalida = new GregorianCalendar(); + if (esquemaCorrida.getHorasalida() != null) { + gHoraSalida.setTime(esquemaCorrida.getHorasalida()); + gHoraSalida.set(Calendar.SECOND, 0); + gHoraSalida.set(Calendar.MILLISECOND, 0); + gHoraSalida.set(Calendar.MONTH, 01); + gHoraSalida.set(Calendar.DAY_OF_MONTH, 01); + gHoraSalida.set(Calendar.YEAR, 1970); + esquemaCorrida.setHorasalida(gHoraSalida.getTime()); + } + + // Pesquisa se existe por todos os campos, + // menos listas EsquemaAsiento e EsquemaTramo: + // List lsEC = + // esquemaCorridaService.buscar(esquemaCorrida); + List lsEC = Collections.EMPTY_LIST; + // List lsEC = new + // ArrayList(); + + if (esquemaCorrida.getEsquemacorridaId() == null) { + Date agora = new Date(); + agora.setHours(00); + agora.setMinutes(00); + agora.setSeconds(00); + dataDe.setSeconds(01); + if (dataDe.before(agora)) { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.fecha"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.EXCLAMATION); + } else { + if (lsEC.isEmpty()) { + if (porBloq.isChecked()) { + Date des = de.getValue(); + Date has = hasta.getValue(); + has.setSeconds(1); + EsquemaOperacional eo = new EsquemaOperacional(); + while (des.before(has)) { + EsquemaCorrida ec = new EsquemaCorrida(); + eo.setActivo(Boolean.TRUE); + eo.setFecmodif(Calendar.getInstance().getTime()); + eo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + Date horaSalida = new Date(); + horaSalida.setHours(des.getHours()); + horaSalida.setMinutes(des.getMinutes()); + horaSalida.setSeconds(0); + + ec.setActivo(Boolean.TRUE); + ec.setFecmodif(Calendar.getInstance().getTime()); + ec.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + ec.setClaseServicio(esquemaCorrida.getClaseServicio()); + ec.setEmpresa(esquemaCorrida.getEmpresa()); + ec.setEmpresa1(esquemaCorrida.getEmpresa1()); + + eo.setFecniciovigencia(esquemaCorrida.getEsquemaOperacional().getFecniciovigencia()); + eo.setFecfinvigencia(esquemaCorrida.getEsquemaOperacional().getFecfinvigencia()); + + ec.setEsquemaOperacional(eo); + ec.setMarca(esquemaCorrida.getMarca()); + ec.setRolOperativo(esquemaCorrida.getRolOperativo()); + ec.setDiagramaAutobusId(esquemaCorrida.getRolOperativo().getDiagramaAutobus().getDiagramaautobusId().intValue()); + ec.setRuta(esquemaCorrida.getRuta()); + ec.setInddomingo(esquemaCorrida.getInddomingo()); + ec.setIndjueves(esquemaCorrida.getIndjueves()); + ec.setIndlunes(esquemaCorrida.getIndlunes()); + ec.setIndmartes(esquemaCorrida.getIndmartes()); + ec.setIndmiercoles(esquemaCorrida.getIndmiercoles()); + ec.setIndsabado(esquemaCorrida.getIndsabado()); + ec.setIndviernes(esquemaCorrida.getIndviernes()); + ec.setStatusCorrida(esquemaCorrida.getStatusCorrida()); + ec.setTipocorrida(esquemaCorrida.getTipocorrida()); + ec.setCantparados(esquemaCorrida.getCantparados()); + ec.setHorasalida(horaSalida); + + ec.setPisoExtra(esquemaCorrida.getPisoExtra()); + ec.setRolOperativo2(esquemaCorrida.getRolOperativo2()); + ec.setClaseServicio2(esquemaCorrida.getClaseServicio2()); + + // Salva + ec = esquemaCorridaService.suscribir(ec); + esquemaCorridaService.actualizaEsquemaTramo( + lsParadaEsquema, + ec); + + // Acrescenta Minutos na Hora + des.setMinutes(des.getMinutes() + + minutos.getValue()); + } + } else { + EsquemaOperacional eo = esquemaCorrida.getEsquemaOperacional(); + eo.setFecniciovigencia(fecniciovigencia.getValue()); + eo.setFecfinvigencia(fecfinvigencia.getValue()); + esquemaCorrida.setEsquemaOperacional(eo); + esquemaCorridaService.suscribir(esquemaCorrida); + esquemaCorridaService.actualizaEsquemaTramo( + lsParadaEsquema, + esquemaCorrida); + } + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.suscribirOK"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show(Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.EXCLAMATION); + } + } + } else { + boolean podeSalvar = false; + if (lsEC.isEmpty()) { + podeSalvar = true; + } else { + for (EsquemaCorrida ec : lsEC) { + if (ec.getEsquemacorridaId().equals(esquemaCorrida.getEsquemacorridaId())) { + podeSalvar = true; + } + } + } + if (podeSalvar) { + esquemaCorridaService.actualizacion(esquemaCorrida); + esquemaCorridaService.actualizaEsquemaTramo(lsParadaEsquema,esquemaCorrida); + esquemaCorridaList.updateItem(esquemaCorrida); + } else { + Messagebox.show(Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.EXCLAMATION); + } + + // Atualiza todos os assentos se a corrida foi + // por bloque. + List lsEQ = esquemaCorridaService.buscar(esquemaCorrida); + for (EsquemaCorrida ec : lsEQ) { + + List lsEAsientoBorar = esquemaAsientoService.obtenerPorCorrida(ec); + List lsEAsientoNovo = esquemaAsientoService.obtenerPorCorrida(esquemaCorrida); + + for (EsquemaAsiento ea : lsEAsientoBorar) { + esquemaAsientoService.borrar(ea); + } + for (EsquemaAsiento ea : lsEAsientoNovo) { + EsquemaAsiento esquemaAsiento = new EsquemaAsiento(); + esquemaAsiento.setActivo(ea.getActivo()); + esquemaAsiento.setEsquemaCorrida(ec); + esquemaAsiento.setIndvendible(ea.getIndvendible()); + esquemaAsiento.setNumasiento(ea.getNumasiento()); + esquemaAsiento.setParada(ea.getParada()); + esquemaAsiento.setUsuarioId(ea.getUsuarioId()); + + esquemaAsientoService.suscribir(esquemaAsiento); + } + } + + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.suscribirOK"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.INFORMATION); + + closeWindow(); + } + } + } else { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.RutaSemTramos"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.busquedaPeriodo"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } else { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.RutaVazia"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (WrongValueException ex) { + throw (WrongValueException) ex; + } catch (Exception ex) { + log.error(ex); + Messagebox.show(Labels.getLabel("MSG.Error").concat(" - ").concat(ex.toString()), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.borrarPergunta"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + esquemaCorridaService.borrar(esquemaCorrida); + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.borrarOK"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + esquemaCorridaList.removeItem(esquemaCorrida); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnAdicionarTramo(Event ev) { + try { + if (cmbTramo.getSelectedItem() != null) { + // Ruta Secuencia + lsEsquemaTramo = adicionarParadaEsquemaTramo(lsParadaEsquema, (Parada) cmbTramo.getSelectedItem().getValue(), esquemaCorrida, (Ruta) cmbRuta.getSelectedItem().getValue()); + esquemaCorrida.setEsquemaTramoList(lsEsquemaTramo); + carregarParadaSecuencia(lsEsquemaTramo); + cmbTramo.setSelectedItem(null); + selecionarRutaSequenciaForaEsqCorrida(); + } + } catch (Exception e) { + log.error("ESQ CORRIDA - Erro ao adicionar tramo: " + e); + onClick$btnAdicionarTramo(null); + } + } + + /** + * Selecciona las paradas que no estan en la secuencia de la ruta + */ + private void selecionarRutaSequenciaForaEsqCorrida() { + if (lsTramosRutaEsquemaCorrida == null) { + lsTramosRutaEsquemaCorrida = new ArrayList(); + } + lsTramosRutaEsquemaCorrida.clear(); + + // Ruta Secuencia + Ruta ruta = esquemaCorrida.getRuta(); + ruta = rutaService.obtenerID(ruta.getRutaId()); + lsRutaSecuencia = rutaSecuenciaService.buscarSecuenciaOrdenado(ruta); + + // Selecciona solamente la secuencia de paradas de los tramos de la + // secuencia de la ruta + List lstPardasRuta = new ArrayList(); + for (RutaSecuencia rs : lsRutaSecuencia) { + Tramo tramoRS = rs.getTramo(); + lstPardasRuta.add(tramoRS.getOrigem()); + } + if (!lsRutaSecuencia.isEmpty()) { + lstPardasRuta.add(lsRutaSecuencia.get(lsRutaSecuencia.size() - 1).getTramo().getDestino()); + } + + // Selecciona solamente la secuencia de paradas de lo esquemTramo + List lstPardasTramos = new ArrayList(); + for (EsquemaTramo et : lsEsquemaTramo) { + if (et.getTramo() != null) { + Tramo tramoET = et.getTramo(); + lstPardasTramos.add(tramoET.getOrigem()); + } + } + + if (!lsEsquemaTramo.isEmpty()) { + lstPardasTramos.add(lsEsquemaTramo.get(lsEsquemaTramo.size() - 1).getTramo().getDestino()); + } + + if (lsTramos == null) { + lsTramos = new ArrayList(); + } + lsTramos.clear(); + + lsTramos.addAll(CollectionUtils.subtract(lstPardasRuta, lstPardasTramos)); + BindingListModelList listModelTramo = new BindingListModelList( + lsTramos, true); + cmbTramo.setModel(listModelTramo); + } + + private void selecionarRuta() { + // Ruta Secuencia + Comboitem ciRuta = cmbRuta.getSelectedItem(); + Ruta ruta = null; + if (ciRuta != null) { + ruta = (Ruta) ciRuta.getValue(); + } + + try { + if (ruta != null) { + ruta = rutaService.obtenerID(ruta.getRutaId()); + lsRutaSecuencia = rutaSecuenciaService.buscarSecuenciaOrdenado(ruta); + + lsEsquemaTramo = new ArrayList(); + esquemaTramoList.setData(lsParadaEsquema); + + for (RutaSecuencia rs : lsRutaSecuencia) { + EsquemaTramo et = new EsquemaTramo(); + et.setActivo(Boolean.TRUE); + et.setFecmodif(Calendar.getInstance().getTime()); + et.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + et.setNumsecuencia(rs.getNumsecuencia()); + et.setTramo(rs.getTramo()); + et.setEsquemaCorrida(esquemaCorrida); + + // Somente quando muda a seleção da Ruta. + lsEsquemaTramo.add(et); + } + + esquemaCorrida.setEsquemaTramoList(lsEsquemaTramo); + carregarParadaSecuencia(lsEsquemaTramo); + selecionarRutaSequenciaForaEsqCorrida(); + esquemaTramoList.setData(lsParadaEsquema); + } else { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.RutaVazia"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } + + private void verTempoEstanciaTramo(EsquemaTramo et, ParadaEsquema pe) { + if (et == null) { + return; + } + + Map args = new HashMap(); + args.put("esquemaTramo", et); + args.put("paradaEsquema", pe); + args.put("esquemaTramoList", esquemaTramoList); + + openWindow( + "/gui/esquema_operacional/tiempoEstanciaTramo.zul", + Labels.getLabel("editarCatalogoDeRutaController.lhTiempoEstancia"), + args, MODAL); + } + + public void onChange$cmbRuta(Event ev) { + selecionarRuta(); + } + + public void onClick$btnRemoverTramo(Event ev) { + try { + ParadaEsquema pe = new ParadaEsquema(); + try { + pe = (ParadaEsquema) esquemaTramoList.getSelected(); + } catch (Exception e) { + log.error("Erro ao aliminar ruta do esquemaTramo: " + e); + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + if (pe != null) { + boolean podeExcluir = false; + for (int i = 0; i < lsParadaEsquema.size(); i++) { + if (lsParadaEsquema.get(i).getParada().equals(pe.getParada())) { + if (i > 0 && i < lsParadaEsquema.size() - 1) {// condição para não poder remover o inicial nem o final + ParadaEsquema paradaEsquema = lsParadaEsquema.get(i); + lsParadaEsquema.remove(paradaEsquema); + + log.debug("Esquema Tramo Removida: "+ lsParadaEsquema.get(i).getNumsecuencia()+ " - "+ lsParadaEsquema.get(i).getParada().getCveparada()); + + esquemaTramoList.setData(lsParadaEsquema); + // paradaEsquema.setActivo(Boolean.FALSE); + // lsParadaEsquema.add(paradaEsquema); + + podeExcluir = true; + + break; + } else if (i == 0 || i == lsParadaEsquema.size() - 1) { + Messagebox.show(Labels.getLabel("editarCatalogoDeRutaController.MSG.removerSecuencia"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, + Messagebox.EXCLAMATION); + } + } + } + + if (podeExcluir) { + String ok = esquemaTramoCorrecto(lsParadaEsquema); + if (ok != null) { + Messagebox.show(ok, + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + } + } else { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.MSG.selectItem"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + lsEsquemaTramo = generaEsquemaTramoCorrecto(lsParadaEsquema,esquemaCorrida); + selecionarRutaSequenciaForaEsqCorrida(); + + } catch (Exception e) { + log.error("Erro ao remover secuencia da ruta " + e.getMessage()); + } + } + + /** + * Checo se el nuevo reajuste de secuencia quedo valido. O sea, checo se + * existe en tramo en la tabla ruta_combinacion + * + * @param lsParadaEsquema + * - La nueva lista de secuecia (ya con el cambio hecho) + * @return - True se esta correcto False se no esta correcto + */ + private String esquemaTramoCorrecto(List lsParadaEsquema) { + boolean hayTramo = true; + + Parada paradaOrigen = null; + Parada paradaDestino = null; + + for (int i = 0; (i < lsParadaEsquema.size() - 1) && hayTramo; i++) { + paradaOrigen = lsParadaEsquema.get(i).getParada(); + paradaDestino = lsParadaEsquema.get(i + 1).getParada(); + + Tramo t = rutaCombinacionService.busqueda((Ruta) cmbRuta.getSelectedItem().getValue(), paradaOrigen, paradaDestino); + + hayTramo = (t == null) ? false : true; + } + + return (hayTramo) ? null : "No existe el tramo: " + + paradaOrigen.getDescparada() + " - " + + paradaDestino.getDescparada(); + } + + /** + * Hago la combinacion correcta en esquemacorrida asi como esta en la lista + * de parada + * + * @param listParadaEsquema + * @param ec + */ + private List generaEsquemaTramoCorrecto( + List listParadaEsquema, EsquemaCorrida ec) { + List result = new ArrayList(); + + for (int i = 0; (i < listParadaEsquema.size() - 1); i++) { + Parada paradaOrigen = listParadaEsquema.get(i).getParada(); + Parada paradaDestino = listParadaEsquema.get(i + 1).getParada(); + + Tramo t = rutaCombinacionService.busqueda((Ruta) cmbRuta.getSelectedItem().getValue(), paradaOrigen, paradaDestino); + + EsquemaTramo et = new EsquemaTramo(); + et.setActivo(Boolean.TRUE); + et.setEsquemaCorrida(ec); + et.setFecmodif(Calendar.getInstance().getTime()); + et.setNumsecuencia((short) (i + 1)); + et.setTiempoEstancia(listParadaEsquema.get(i + 1).getTiempoEstancia()); + et.setTramo(t); + et.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + result.add(et); + } + + return result; + } + + private List adicionarParadaEsquemaTramo( + List listParadaEsquema, Parada novaParada, + EsquemaCorrida ec, Ruta ruta) { + List result = new ArrayList(); + + lsRutaSecuencia = rutaSecuenciaService.buscarSecuenciaOrdenado(ruta); + + List listParadaEsquemaComNovaParada = new ArrayList(); + + Short secuencia = 0; + boolean nuevoAgregado = false; + boolean noExisteTramoAsociado = listParadaEsquema.isEmpty();// es la + // primera + // vez + Integer indiceSecuencia = null; + for (int i = 0; i < lsRutaSecuencia.size(); i++) { + RutaSecuencia rutaSecuencia = lsRutaSecuencia.get(i); + if (rutaSecuencia.getTramo().getOrigem().equals(novaParada)) { + ParadaEsquema paradaEsquema = new ParadaEsquema(); + paradaEsquema.setActivo(Boolean.TRUE); + secuencia++; + paradaEsquema.setNumsecuencia(secuencia); + paradaEsquema.setParada(novaParada); + + listParadaEsquemaComNovaParada.add(paradaEsquema); + nuevoAgregado = true; + indiceSecuencia = i; + } else { + if (!listParadaEsquema.isEmpty()) { + if (rutaSecuencia.getTramo().getOrigem().equals(listParadaEsquema.get(0).getParada())) { + secuencia++; + listParadaEsquema.get(0).setNumsecuencia(secuencia); + listParadaEsquemaComNovaParada.add(listParadaEsquema.get(0)); + listParadaEsquema.remove(0); + + } + } + } + } + if (noExisteTramoAsociado) { + if (indiceSecuencia != null) { + if ((lsRutaSecuencia.size() - 1) > indiceSecuencia) { + RutaSecuencia rutaSecuencia = lsRutaSecuencia.get(indiceSecuencia); + ParadaEsquema paradaEsquema = new ParadaEsquema(); + paradaEsquema.setActivo(Boolean.TRUE); + secuencia++; + paradaEsquema.setNumsecuencia(secuencia); + paradaEsquema.setParada(rutaSecuencia.getTramo().getDestino()); + + listParadaEsquemaComNovaParada.add(paradaEsquema); + } + } + } + if (!nuevoAgregado) { + ParadaEsquema paradaEsquema = new ParadaEsquema(); + paradaEsquema.setActivo(Boolean.TRUE); + secuencia++; + paradaEsquema.setNumsecuencia(secuencia); + paradaEsquema.setParada(novaParada); + + listParadaEsquemaComNovaParada.add(paradaEsquema); + } + if (!listParadaEsquema.isEmpty()) { + secuencia++; + listParadaEsquema.get(0).setNumsecuencia(secuencia); + listParadaEsquemaComNovaParada.add(listParadaEsquema.get(0)); + listParadaEsquema.remove(0); + } + + for (int i = 0; (i < listParadaEsquemaComNovaParada.size() - 1); i++) { + Parada paradaOrigen = listParadaEsquemaComNovaParada.get(i).getParada(); + Parada paradaDestino = listParadaEsquemaComNovaParada.get(i + 1).getParada(); + + Tramo t = rutaCombinacionService.busqueda((Ruta) cmbRuta.getSelectedItem().getValue(), paradaOrigen, paradaDestino); + + EsquemaTramo et = new EsquemaTramo(); + et.setActivo(Boolean.TRUE); + et.setEsquemaCorrida(ec); + et.setFecmodif(Calendar.getInstance().getTime()); + et.setNumsecuencia((short) (i + 1)); + et.setTiempoEstancia(listParadaEsquemaComNovaParada.get(i + 1).getTiempoEstancia()); + et.setTramo(t); + et.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + result.add(et); + + } + + return result; + } + + public void onChange$cmbClase(InputEvent ev) { + + if (ev.isChangingBySelectBack()) { + return; + } + + llenarRutasPorClase(); + llenarMarcaPorClaseServicio(); + } + + private void llenarRutasPorClase() { + if (esquemaCorrida.getClaseServicio() == null) { + return; + } + lsRuta = rutaService.buscarPorClaseServicio(esquemaCorrida.getClaseServicio()); + BindingListModelList l = new BindingListModelList(lsRuta, true); + cmbRuta.setModel(l); + } + + private void llenarMarcaPorClaseServicio() { + if (esquemaCorrida.getClaseServicio() == null) { + return; + } + lsMarca = marcaClaseServicioService.buscar(esquemaCorrida.getClaseServicio()); + BindingListModelList l = new BindingListModelList(lsMarca, true); + cmbMarca.setModel(l); + } + + public void onClick$porBloq(Event ev) { + horasalida.setVisible(false); + horasalidaLabel.setVisible(false); + minutos.setVisible(true); + minutosLabel1.setVisible(true); + minutosLabel2.setVisible(true); + de.setVisible(true); + horaLabel1.setVisible(true); + horaLabel2.setVisible(true); + hasta.setVisible(true); + horaLabel21.setVisible(true); + horaLabel22.setVisible(true); + } + + public void onClick$porHora(Event ev) { + horasalida.setVisible(true); + horasalidaLabel.setVisible(true); + minutos.setVisible(false); + minutosLabel1.setVisible(false); + minutosLabel2.setVisible(false); + de.setVisible(false); + horaLabel1.setVisible(false); + horaLabel2.setVisible(false); + hasta.setVisible(false); + horaLabel21.setVisible(false); + horaLabel22.setVisible(false); + } + + public void onClick$btnAsientos(Event ev) { + Map args = new HashMap(); + args.put("esquemaCorrida", esquemaCorrida); + + if (esquemaCorrida.getEsquemacorridaId() == null) { + List lsEsquemaAsiento = new ArrayList(); + args.put("lsEsquemaAsiento", lsEsquemaAsiento); + } else { + esquemaCorrida = esquemaCorridaService.obtenerID(esquemaCorrida.getEsquemacorridaId()); + List lsEsquemaAsiento = esquemaCorrida.getEsquemaAsientoList(); + args.put("lsEsquemaAsiento", lsEsquemaAsiento); + } + + openWindow( + "/gui/esquema_operacional/editarCorridaAsiento.zul", + Labels.getLabel("editarConfiguracionCorridaAsientoController.window.title"), + args, MODAL); + } + + public void onClick$chkDoblePiso(Event ev) { + if (chkDoblePiso.isChecked()) { + esquemaCorrida.setPisoExtra(Boolean.TRUE); + lbRolOperativoDoblePiso.setVisible(true); + lbClaseDoblePiso.setVisible(true); + cmbRolOperativoDoblePiso.setVisible(true); + cmbClaseDoblePiso.setVisible(true); + cmbRolOperativoDoblePiso.setConstraint("no empty"); + cmbClaseDoblePiso.setConstraint("no empty"); + } else { + esquemaCorrida.setPisoExtra(Boolean.FALSE); + esquemaCorrida.setClaseServicio2(null); + esquemaCorrida.setRolOperativo2(null); + lbRolOperativoDoblePiso.setVisible(false); + lbClaseDoblePiso.setVisible(false); + cmbRolOperativoDoblePiso.setVisible(false); + cmbClaseDoblePiso.setVisible(false); + cmbRolOperativoDoblePiso.setConstraint(""); + cmbClaseDoblePiso.setConstraint(""); + } + } + + public ClaseServicioService getClaseService() { + return claseService; + } + + public void setClaseService(ClaseServicioService claseService) { + this.claseService = claseService; + } + + public EsquemaCorridaService getEsquemaCorridaService() { + return esquemaCorridaService; + } + + public void setEsquemaCorridaService( + EsquemaCorridaService esquemaCorridaService) { + this.esquemaCorridaService = esquemaCorridaService; + } + + public EsquemaCorrida getEsquemaCorrida() { + return esquemaCorrida; + } + + public void setEsquemaCorrida(EsquemaCorrida esquemaCorrida) { + this.esquemaCorrida = esquemaCorrida; + } + + public MyListbox getEsquemaCorridaList() { + return esquemaCorridaList; + } + + public void setEsquemaCorridaList(MyListbox esquemaCorridaList) { + this.esquemaCorridaList = esquemaCorridaList; + } + + public List getLsClase() { + return lsClase; + } + + public void setLsClase(List lsClase) { + this.lsClase = lsClase; + } + + public List getLsMarca() { + return lsMarca; + } + + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + public List getLsRuta() { + return lsRuta; + } + + public void setLsRuta(List lsRuta) { + this.lsRuta = lsRuta; + } + + public MarcaService getMarcaService() { + return marcaService; + } + + public void setMarcaService(MarcaService marcaService) { + this.marcaService = marcaService; + } + + public RutaService getRutaService() { + return rutaService; + } + + public void setRutaService(RutaService rutaService) { + this.rutaService = rutaService; + } + + public Combobox getCmbClase() { + return cmbClase; + } + + public void setCmbClase(Combobox cmbClase) { + this.cmbClase = cmbClase; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Combobox getCmbRuta() { + return cmbRuta; + } + + public void setCmbRuta(Combobox cmbRuta) { + this.cmbRuta = cmbRuta; + } + + public Datebox getFecfinvigencia() { + return fecfinvigencia; + } + + public void setFecfinvigencia(Datebox fecfinvigencia) { + this.fecfinvigencia = fecfinvigencia; + } + + public Datebox getFecniciovigencia() { + return fecniciovigencia; + } + + public void setFecniciovigencia(Datebox fecniciovigencia) { + this.fecniciovigencia = fecniciovigencia; + } + + public Timebox getHora() { + return de; + } + + public void setHora(Timebox hora) { + this.de = hora; + } + + public Timebox getHora2() { + return hasta; + } + + public void setHora2(Timebox hora2) { + this.hasta = hora2; + } + + public Timebox getHorasalida() { + return horasalida; + } + + public void setHorasalida(Timebox horasalida) { + this.horasalida = horasalida; + } + + public Spinner getMinutos() { + return minutos; + } + + public void setMinutos(Spinner minutos) { + this.minutos = minutos; + } + + public Combobox getCmbEmpresaCorrida() { + return cmbEmpresaCorrida; + } + + public void setCmbEmpresaCorrida(Combobox cmbEmpresaCorrida) { + this.cmbEmpresaCorrida = cmbEmpresaCorrida; + } + + public Combobox getCmbEmpresaIngresso() { + return cmbEmpresaIngresso; + } + + public void setCmbEmpresaIngresso(Combobox cmbEmpresaIngresso) { + this.cmbEmpresaIngresso = cmbEmpresaIngresso; + } + + public Combobox getCmbRolOperativo() { + return cmbRolOperativo; + } + + public void setCmbRolOperativo(Combobox cmbRolOperativo) { + this.cmbRolOperativo = cmbRolOperativo; + } + + public Combobox getCmbStatus() { + return cmbStatus; + } + + public void setCmbStatus(Combobox cmbStatus) { + this.cmbStatus = cmbStatus; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsRutaSecuencia() { + return lsRutaSecuencia; + } + + public void setLsRutaSecuencia(List lsRutaSecuencia) { + this.lsRutaSecuencia = lsRutaSecuencia; + } + + public MyListbox getRutaSecuenciaList() { + return esquemaTramoList; + } + + public void setRutaSecuenciaList(MyListbox rutaSecuenciaList) { + this.esquemaTramoList = rutaSecuenciaList; + } + + public List getLsRolOperativo() { + return lsRolOperativo; + } + + public void setLsRolOperativo(List lsRolOperativo) { + this.lsRolOperativo = lsRolOperativo; + } + + public RolOperativoService getRolOperativoService() { + return rolOperativoService; + } + + public void setRolOperativoService(RolOperativoService rolOperativoService) { + this.rolOperativoService = rolOperativoService; + } + + public Radio getAutorizada() { + return autorizada; + } + + public void setAutorizada(Radio autorizada) { + this.autorizada = autorizada; + } + + public Radio getCancelada() { + return cancelada; + } + + public void setCancelada(Radio cancelada) { + this.cancelada = cancelada; + } + + public Radio getLatente() { + return latente; + } + + public void setLatente(Radio latente) { + this.latente = latente; + } + + public Combobox getCmbVia() { + return cmbVia; + } + + public void setCmbVia(Combobox cmbVia) { + this.cmbVia = cmbVia; + } + + public Button getBtnAsientos() { + return btnAsientos; + } + + public void setBtnAsientos(Button btnAsientos) { + this.btnAsientos = btnAsientos; + } + + public Radio getFletes() { + return fletes; + } + + public void setFletes(Radio fletes) { + this.fletes = fletes; + } + + public Radio getTransportePasajeros() { + return transportePasajeros; + } + + public void setTransportePasajeros(Radio transportePasajeros) { + this.transportePasajeros = transportePasajeros; + } + + public Radio getViajesEspeciales() { + return viajesEspeciales; + } + + public void setViajesEspeciales(Radio viajesEspeciales) { + this.viajesEspeciales = viajesEspeciales; + } + + public Combobox getCmbTramo() { + return cmbTramo; + } + + public void setCmbTramo(Combobox cmbTramo) { + this.cmbTramo = cmbTramo; + } + + public Timebox getDe() { + return de; + } + + public void setDe(Timebox de) { + this.de = de; + } + + public MyListbox getEsquemaTramoList() { + return esquemaTramoList; + } + + public void setEsquemaTramoList(MyListbox esquemaTramoList) { + this.esquemaTramoList = esquemaTramoList; + } + + public EsquemaTramoService getEsquemaTramoService() { + return esquemaTramoService; + } + + public void setEsquemaTramoService(EsquemaTramoService esquemaTramoService) { + this.esquemaTramoService = esquemaTramoService; + } + + public Timebox getHasta() { + return hasta; + } + + public void setHasta(Timebox hasta) { + this.hasta = hasta; + } + + public List getLsEsquemaTramo() { + return lsEsquemaTramo; + } + + public void setLsEsquemaTramo(List lsEsquemaTramo) { + this.lsEsquemaTramo = lsEsquemaTramo; + } + + public List getLsTramos() { + return lsTramos; + } + + public void setLsTramos(List lsTramos) { + this.lsTramos = lsTramos; + } + + public List getLsDivision() { + return lsDivision; + } + + public void setLsDivision(List lsDivision) { + this.lsDivision = lsDivision; + } + + public Combobox getCmbDivision() { + return cmbDivision; + } + + public void setCmbDivision(Combobox cmbDivision) { + this.cmbDivision = cmbDivision; + } + + public Label getLbDivision() { + return lbDivision; + } + + public void setLbDivision(Label lbDivision) { + this.lbDivision = lbDivision; + } + + public List getLsTramosRutaEsquemaCorrida() { + return lsTramosRutaEsquemaCorrida; + } + + public void setLsTramosRutaEsquemaCorrida( + List lsTramosRutaEsquemaCorrida) { + this.lsTramosRutaEsquemaCorrida = lsTramosRutaEsquemaCorrida; + } + + public Radio getPorBloq() { + return porBloq; + } + + public void setPorBloq(Radio porBloq) { + this.porBloq = porBloq; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public void onClick$btnApagarRebote(Event e) throws InterruptedException { + esquemaCorrida.setEsquemaCorridaRebote(null); + txtIdCorridaRebote.setValue(""); + } + + public void onClick$btnAbrirEsquemaCorrida(Event e) + throws InterruptedException { + if (esquemaCorrida.getEsquemaCorridaRebote() == null) { + Messagebox.show(Labels.getLabel("editarConfiguracionCorridaController.btnAbrirEsquemaCorrida.error"), + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + + } + + closeWindow(); + + Map args = new HashMap(); + + args.put("esquemaCorrida", esquemaCorrida.getEsquemaCorridaRebote()); + args.put("esquemaCorridaList", esquemaCorridaList); + + openWindow( + "/gui/esquema_operacional/editarCorrida.zul", + Labels.getLabel("editarConfiguracionCorridaController.window.title"), + args, MODAL); + } + + public void onClick$btnBuscarEsquemaCorrida(Event e) { + Map argss = new HashMap(); + + argss.put("esquemaCorrida", esquemaCorrida); + argss.put("txtIdCorridaRebote", txtIdCorridaRebote); + + openWindow( + "/gui/esquema_operacional/busquedaCorridaRebote.zul", + Labels.getLabel("busquedaConfiguracionCorridaController.window.title"), + argss, MODAL); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarDiagramaAutobusController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarDiagramaAutobusController.java new file mode 100644 index 000000000..eb0f303ee --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarDiagramaAutobusController.java @@ -0,0 +1,1793 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.service.CorridaService; +import com.rjconsultores.ventaboletos.service.DiagramaAutobusService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarDiagramaAutobusController") +@Scope("prototype") +public class EditarDiagramaAutobusController extends MyGenericForwardComposer { + + @Autowired + private DiagramaAutobusService diagramaAutoBusService; + @Autowired + private CorridaService corridaService; + private Textbox txtDescDiagrama; + private Intbox txtCantasSientos; + private MyListbox diagramaAutobusList; + private DiagramaAutobus diagramaAutobus; + private Button btnApagar; + private Button btn_1_1; + private Button btn_1_2; + private Button btn_1_3; + private Button btn_1_4; + private Button btn_1_5; + private Button btn_1_6; + private Button btn_1_7; + private Button btn_1_8; + private Button btn_1_9; + private Button btn_1_10; + private Button btn_1_11; + private Button btn_1_12; + private Button btn_1_13; + private Button btn_2_1; + private Button btn_2_2; + private Button btn_2_3; + private Button btn_2_4; + private Button btn_2_5; + private Button btn_2_6; + private Button btn_2_7; + private Button btn_2_8; + private Button btn_2_9; + private Button btn_2_10; + private Button btn_2_11; + private Button btn_2_12; + private Button btn_2_13; + private Button btn_3_1; + private Button btn_3_2; + private Button btn_3_3; + private Button btn_3_4; + private Button btn_3_5; + private Button btn_3_6; + private Button btn_3_7; + private Button btn_3_8; + private Button btn_3_9; + private Button btn_3_10; + private Button btn_3_11; + private Button btn_3_12; + private Button btn_3_13; + private Button btn_4_1; + private Button btn_4_2; + private Button btn_4_3; + private Button btn_4_4; + private Button btn_4_5; + private Button btn_4_6; + private Button btn_4_7; + private Button btn_4_8; + private Button btn_4_9; + private Button btn_4_10; + private Button btn_4_11; + private Button btn_4_12; + private Button btn_4_13; + private Button btn_5_1; + private Button btn_5_2; + private Button btn_5_3; + private Button btn_5_4; + private Button btn_5_5; + private Button btn_5_6; + private Button btn_5_7; + private Button btn_5_8; + private Button btn_5_9; + private Button btn_5_10; + private Button btn_5_11; + private Button btn_5_12; + private Button btn_5_13; + private Button btn_6_1; + private Button btn_6_2; + private Button btn_6_3; + private Button btn_6_4; + private Button btn_6_5; + private Button btn_6_6; + private Button btn_6_7; + private Button btn_6_8; + private Button btn_6_9; + private Button btn_6_10; + private Button btn_6_11; + private Button btn_6_12; + private Button btn_6_13; + private Button btn_7_1; + private Button btn_7_2; + private Button btn_7_3; + private Button btn_7_4; + private Button btn_7_5; + private Button btn_7_6; + private Button btn_7_7; + private Button btn_7_8; + private Button btn_7_9; + private Button btn_7_10; + private Button btn_7_11; + private Button btn_7_12; + private Button btn_7_13; + private static Logger log = Logger.getLogger(EditarDiagramaAutobusController.class); + + public Intbox getTxtCantasSientos() { + return txtCantasSientos; + } + + public void setTxtCantasSientos(Intbox txtCantasSientos) { + this.txtCantasSientos = txtCantasSientos; + } + + public Textbox getTxtDescDiagrama() { + return txtDescDiagrama; + } + + public void setTxtDescDiagrama(Textbox txtDescDiagrama) { + this.txtDescDiagrama = txtDescDiagrama; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Button getBtn_1_1() { + return btn_1_1; + } + + public void setBtn_1_1(Button btn_1_1) { + this.btn_1_1 = btn_1_1; + } + + public Button getBtn_1_10() { + return btn_1_10; + } + + public void setBtn_1_10(Button btn_1_10) { + this.btn_1_10 = btn_1_10; + } + + public Button getBtn_1_11() { + return btn_1_11; + } + + public void setBtn_1_11(Button btn_1_11) { + this.btn_1_11 = btn_1_11; + } + + public Button getBtn_1_12() { + return btn_1_12; + } + + public void setBtn_1_12(Button btn_1_12) { + this.btn_1_12 = btn_1_12; + } + + public Button getBtn_1_13() { + return btn_1_13; + } + + public void setBtn_1_13(Button btn_1_13) { + this.btn_1_13 = btn_1_13; + } + + public Button getBtn_1_2() { + return btn_1_2; + } + + public void setBtn_1_2(Button btn_1_2) { + this.btn_1_2 = btn_1_2; + } + + public Button getBtn_1_3() { + return btn_1_3; + } + + public void setBtn_1_3(Button btn_1_3) { + this.btn_1_3 = btn_1_3; + } + + public Button getBtn_1_4() { + return btn_1_4; + } + + public void setBtn_1_4(Button btn_1_4) { + this.btn_1_4 = btn_1_4; + } + + public Button getBtn_1_5() { + return btn_1_5; + } + + public void setBtn_1_5(Button btn_1_5) { + this.btn_1_5 = btn_1_5; + } + + public Button getBtn_1_6() { + return btn_1_6; + } + + public void setBtn_1_6(Button btn_1_6) { + this.btn_1_6 = btn_1_6; + } + + public Button getBtn_1_7() { + return btn_1_7; + } + + public void setBtn_1_7(Button btn_1_7) { + this.btn_1_7 = btn_1_7; + } + + public Button getBtn_1_8() { + return btn_1_8; + } + + public void setBtn_1_8(Button btn_1_8) { + this.btn_1_8 = btn_1_8; + } + + public Button getBtn_1_9() { + return btn_1_9; + } + + public void setBtn_1_9(Button btn_1_9) { + this.btn_1_9 = btn_1_9; + } + + public Button getBtn_2_1() { + return btn_2_1; + } + + public void setBtn_2_1(Button btn_2_1) { + this.btn_2_1 = btn_2_1; + } + + public Button getBtn_2_10() { + return btn_2_10; + } + + public void setBtn_2_10(Button btn_2_10) { + this.btn_2_10 = btn_2_10; + } + + public Button getBtn_2_11() { + return btn_2_11; + } + + public void setBtn_2_11(Button btn_2_11) { + this.btn_2_11 = btn_2_11; + } + + public Button getBtn_2_12() { + return btn_2_12; + } + + public void setBtn_2_12(Button btn_2_12) { + this.btn_2_12 = btn_2_12; + } + + public Button getBtn_2_13() { + return btn_2_13; + } + + public void setBtn_2_13(Button btn_2_13) { + this.btn_2_13 = btn_2_13; + } + + public Button getBtn_2_2() { + return btn_2_2; + } + + public void setBtn_2_2(Button btn_2_2) { + this.btn_2_2 = btn_2_2; + } + + public Button getBtn_2_3() { + return btn_2_3; + } + + public void setBtn_2_3(Button btn_2_3) { + this.btn_2_3 = btn_2_3; + } + + public Button getBtn_2_4() { + return btn_2_4; + } + + public void setBtn_2_4(Button btn_2_4) { + this.btn_2_4 = btn_2_4; + } + + public Button getBtn_2_5() { + return btn_2_5; + } + + public void setBtn_2_5(Button btn_2_5) { + this.btn_2_5 = btn_2_5; + } + + public Button getBtn_2_6() { + return btn_2_6; + } + + public void setBtn_2_6(Button btn_2_6) { + this.btn_2_6 = btn_2_6; + } + + public Button getBtn_2_7() { + return btn_2_7; + } + + public void setBtn_2_7(Button btn_2_7) { + this.btn_2_7 = btn_2_7; + } + + public Button getBtn_2_8() { + return btn_2_8; + } + + public void setBtn_2_8(Button btn_2_8) { + this.btn_2_8 = btn_2_8; + } + + public Button getBtn_2_9() { + return btn_2_9; + } + + public void setBtn_2_9(Button btn_2_9) { + this.btn_2_9 = btn_2_9; + } + + public Button getBtn_3_1() { + return btn_3_1; + } + + public void setBtn_3_1(Button btn_3_1) { + this.btn_3_1 = btn_3_1; + } + + public Button getBtn_3_10() { + return btn_3_10; + } + + public void setBtn_3_10(Button btn_3_10) { + this.btn_3_10 = btn_3_10; + } + + public Button getBtn_3_11() { + return btn_3_11; + } + + public void setBtn_3_11(Button btn_3_11) { + this.btn_3_11 = btn_3_11; + } + + public Button getBtn_3_12() { + return btn_3_12; + } + + public void setBtn_3_12(Button btn_3_12) { + this.btn_3_12 = btn_3_12; + } + + public Button getBtn_3_13() { + return btn_3_13; + } + + public void setBtn_3_13(Button btn_3_13) { + this.btn_3_13 = btn_3_13; + } + + public Button getBtn_3_2() { + return btn_3_2; + } + + public void setBtn_3_2(Button btn_3_2) { + this.btn_3_2 = btn_3_2; + } + + public Button getBtn_3_3() { + return btn_3_3; + } + + public void setBtn_3_3(Button btn_3_3) { + this.btn_3_3 = btn_3_3; + } + + public Button getBtn_3_4() { + return btn_3_4; + } + + public void setBtn_3_4(Button btn_3_4) { + this.btn_3_4 = btn_3_4; + } + + public Button getBtn_3_5() { + return btn_3_5; + } + + public void setBtn_3_5(Button btn_3_5) { + this.btn_3_5 = btn_3_5; + } + + public Button getBtn_3_6() { + return btn_3_6; + } + + public void setBtn_3_6(Button btn_3_6) { + this.btn_3_6 = btn_3_6; + } + + public Button getBtn_3_7() { + return btn_3_7; + } + + public void setBtn_3_7(Button btn_3_7) { + this.btn_3_7 = btn_3_7; + } + + public Button getBtn_3_8() { + return btn_3_8; + } + + public void setBtn_3_8(Button btn_3_8) { + this.btn_3_8 = btn_3_8; + } + + public Button getBtn_3_9() { + return btn_3_9; + } + + public void setBtn_3_9(Button btn_3_9) { + this.btn_3_9 = btn_3_9; + } + + public Button getBtn_4_1() { + return btn_4_1; + } + + public void setBtn_4_1(Button btn_4_1) { + this.btn_4_1 = btn_4_1; + } + + public Button getBtn_4_10() { + return btn_4_10; + } + + public void setBtn_4_10(Button btn_4_10) { + this.btn_4_10 = btn_4_10; + } + + public Button getBtn_4_11() { + return btn_4_11; + } + + public void setBtn_4_11(Button btn_4_11) { + this.btn_4_11 = btn_4_11; + } + + public Button getBtn_4_12() { + return btn_4_12; + } + + public void setBtn_4_12(Button btn_4_12) { + this.btn_4_12 = btn_4_12; + } + + public Button getBtn_4_13() { + return btn_4_13; + } + + public void setBtn_4_13(Button btn_4_13) { + this.btn_4_13 = btn_4_13; + } + + public Button getBtn_4_2() { + return btn_4_2; + } + + public void setBtn_4_2(Button btn_4_2) { + this.btn_4_2 = btn_4_2; + } + + public Button getBtn_4_3() { + return btn_4_3; + } + + public void setBtn_4_3(Button btn_4_3) { + this.btn_4_3 = btn_4_3; + } + + public Button getBtn_4_4() { + return btn_4_4; + } + + public void setBtn_4_4(Button btn_4_4) { + this.btn_4_4 = btn_4_4; + } + + public Button getBtn_4_5() { + return btn_4_5; + } + + public void setBtn_4_5(Button btn_4_5) { + this.btn_4_5 = btn_4_5; + } + + public Button getBtn_4_6() { + return btn_4_6; + } + + public void setBtn_4_6(Button btn_4_6) { + this.btn_4_6 = btn_4_6; + } + + public Button getBtn_4_7() { + return btn_4_7; + } + + public void setBtn_4_7(Button btn_4_7) { + this.btn_4_7 = btn_4_7; + } + + public Button getBtn_4_8() { + return btn_4_8; + } + + public void setBtn_4_8(Button btn_4_8) { + this.btn_4_8 = btn_4_8; + } + + public Button getBtn_4_9() { + return btn_4_9; + } + + public void setBtn_4_9(Button btn_4_9) { + this.btn_4_9 = btn_4_9; + } + + public Button getBtn_5_1() { + return btn_5_1; + } + + public void setBtn_5_1(Button btn_5_1) { + this.btn_5_1 = btn_5_1; + } + + public Button getBtn_5_10() { + return btn_5_10; + } + + public void setBtn_5_10(Button btn_5_10) { + this.btn_5_10 = btn_5_10; + } + + public Button getBtn_5_11() { + return btn_5_11; + } + + public void setBtn_5_11(Button btn_5_11) { + this.btn_5_11 = btn_5_11; + } + + public Button getBtn_5_12() { + return btn_5_12; + } + + public void setBtn_5_12(Button btn_5_12) { + this.btn_5_12 = btn_5_12; + } + + public Button getBtn_5_13() { + return btn_5_13; + } + + public void setBtn_5_13(Button btn_5_13) { + this.btn_5_13 = btn_5_13; + } + + public Button getBtn_5_2() { + return btn_5_2; + } + + public void setBtn_5_2(Button btn_5_2) { + this.btn_5_2 = btn_5_2; + } + + public Button getBtn_5_3() { + return btn_5_3; + } + + public void setBtn_5_3(Button btn_5_3) { + this.btn_5_3 = btn_5_3; + } + + public Button getBtn_5_4() { + return btn_5_4; + } + + public void setBtn_5_4(Button btn_5_4) { + this.btn_5_4 = btn_5_4; + } + + public Button getBtn_5_5() { + return btn_5_5; + } + + public void setBtn_5_5(Button btn_5_5) { + this.btn_5_5 = btn_5_5; + } + + public Button getBtn_5_6() { + return btn_5_6; + } + + public void setBtn_5_6(Button btn_5_6) { + this.btn_5_6 = btn_5_6; + } + + public Button getBtn_5_7() { + return btn_5_7; + } + + public void setBtn_5_7(Button btn_5_7) { + this.btn_5_7 = btn_5_7; + } + + public Button getBtn_5_8() { + return btn_5_8; + } + + public void setBtn_5_8(Button btn_5_8) { + this.btn_5_8 = btn_5_8; + } + + public Button getBtn_5_9() { + return btn_5_9; + } + + public void setBtn_5_9(Button btn_5_9) { + this.btn_5_9 = btn_5_9; + } + + public Button getBtn_6_1() { + return btn_6_1; + } + + public void setBtn_6_1(Button btn_6_1) { + this.btn_6_1 = btn_6_1; + } + + public Button getBtn_6_10() { + return btn_6_10; + } + + public void setBtn_6_10(Button btn_6_10) { + this.btn_6_10 = btn_6_10; + } + + public Button getBtn_6_11() { + return btn_6_11; + } + + public void setBtn_6_11(Button btn_6_11) { + this.btn_6_11 = btn_6_11; + } + + public Button getBtn_6_12() { + return btn_6_12; + } + + public void setBtn_6_12(Button btn_6_12) { + this.btn_6_12 = btn_6_12; + } + + public Button getBtn_6_13() { + return btn_6_13; + } + + public void setBtn_6_13(Button btn_6_13) { + this.btn_6_13 = btn_6_13; + } + + public Button getBtn_6_2() { + return btn_6_2; + } + + public void setBtn_6_2(Button btn_6_2) { + this.btn_6_2 = btn_6_2; + } + + public Button getBtn_6_3() { + return btn_6_3; + } + + public void setBtn_6_3(Button btn_6_3) { + this.btn_6_3 = btn_6_3; + } + + public Button getBtn_6_4() { + return btn_6_4; + } + + public void setBtn_6_4(Button btn_6_4) { + this.btn_6_4 = btn_6_4; + } + + public Button getBtn_6_5() { + return btn_6_5; + } + + public void setBtn_6_5(Button btn_6_5) { + this.btn_6_5 = btn_6_5; + } + + public Button getBtn_6_6() { + return btn_6_6; + } + + public void setBtn_6_6(Button btn_6_6) { + this.btn_6_6 = btn_6_6; + } + + public Button getBtn_6_7() { + return btn_6_7; + } + + public void setBtn_6_7(Button btn_6_7) { + this.btn_6_7 = btn_6_7; + } + + public Button getBtn_6_8() { + return btn_6_8; + } + + public void setBtn_6_8(Button btn_6_8) { + this.btn_6_8 = btn_6_8; + } + + public Button getBtn_6_9() { + return btn_6_9; + } + + public void setBtn_6_9(Button btn_6_9) { + this.btn_6_9 = btn_6_9; + } + + public Button getBtn_7_1() { + return btn_7_1; + } + + public void setBtn_7_1(Button btn_7_1) { + this.btn_7_1 = btn_7_1; + } + + public Button getBtn_7_10() { + return btn_7_10; + } + + public void setBtn_7_10(Button btn_7_10) { + this.btn_7_10 = btn_7_10; + } + + public Button getBtn_7_11() { + return btn_7_11; + } + + public void setBtn_7_11(Button btn_7_11) { + this.btn_7_11 = btn_7_11; + } + + public Button getBtn_7_12() { + return btn_7_12; + } + + public void setBtn_7_12(Button btn_7_12) { + this.btn_7_12 = btn_7_12; + } + + public Button getBtn_7_13() { + return btn_7_13; + } + + public void setBtn_7_13(Button btn_7_13) { + this.btn_7_13 = btn_7_13; + } + + public Button getBtn_7_2() { + return btn_7_2; + } + + public void setBtn_7_2(Button btn_7_2) { + this.btn_7_2 = btn_7_2; + } + + public Button getBtn_7_3() { + return btn_7_3; + } + + public void setBtn_7_3(Button btn_7_3) { + this.btn_7_3 = btn_7_3; + } + + public Button getBtn_7_4() { + return btn_7_4; + } + + public void setBtn_7_4(Button btn_7_4) { + this.btn_7_4 = btn_7_4; + } + + public Button getBtn_7_5() { + return btn_7_5; + } + + public void setBtn_7_5(Button btn_7_5) { + this.btn_7_5 = btn_7_5; + } + + public Button getBtn_7_6() { + return btn_7_6; + } + + public void setBtn_7_6(Button btn_7_6) { + this.btn_7_6 = btn_7_6; + } + + public Button getBtn_7_7() { + return btn_7_7; + } + + public void setBtn_7_7(Button btn_7_7) { + this.btn_7_7 = btn_7_7; + } + + public Button getBtn_7_8() { + return btn_7_8; + } + + public void setBtn_7_8(Button btn_7_8) { + this.btn_7_8 = btn_7_8; + } + + public Button getBtn_7_9() { + return btn_7_9; + } + + public void setBtn_7_9(Button btn_7_9) { + this.btn_7_9 = btn_7_9; + } + + public DiagramaAutobus getDiagramaAutobus() { + return diagramaAutobus; + } + + public void setDiagramaAutobus(DiagramaAutobus diagramaAutobus) { + this.diagramaAutobus = diagramaAutobus; + } + + public DiagramaAutobusService getDiagramaAutoBusService() { + return diagramaAutoBusService; + } + + public void setDiagramaAutoBusService(DiagramaAutobusService diagramaAutoBusService) { + this.diagramaAutoBusService = diagramaAutoBusService; + } + + public MyListbox getDiagramaAutobusList() { + return diagramaAutobusList; + } + + public void setDiagramaAutobusList(MyListbox diagramaAutobusList) { + this.diagramaAutobusList = diagramaAutobusList; + } + + private Button getButtonAssento(Short numeFila, Short numeColuna) { + Button button = null; + switch (numeFila) { + case 1: + switch (numeColuna) { + case 1: + button = btn_1_1; + break; + case 2: + button = btn_1_2; + break; + case 3: + button = btn_1_3; + break; + case 4: + button = btn_1_4; + break; + case 5: + button = btn_1_5; + break; + case 6: + button = btn_1_6; + break; + case 7: + button = btn_1_7; + break; + case 8: + button = btn_1_8; + break; + case 9: + button = btn_1_9; + break; + case 10: + button = btn_1_10; + break; + case 11: + button = btn_1_11; + break; + case 12: + button = btn_1_12; + break; + case 13: + button = btn_1_13; + break; + } + break; + case 2: + switch (numeColuna) { + case 1: + button = btn_2_1; + break; + case 2: + button = btn_2_2; + break; + case 3: + button = btn_2_3; + break; + case 4: + button = btn_2_4; + break; + case 5: + button = btn_2_5; + break; + case 6: + button = btn_2_6; + break; + case 7: + button = btn_2_7; + break; + case 8: + button = btn_2_8; + break; + case 9: + button = btn_2_9; + break; + case 10: + button = btn_2_10; + break; + case 11: + button = btn_2_11; + break; + case 12: + button = btn_2_12; + break; + case 13: + button = btn_2_13; + break; + } + break; + case 3: + switch (numeColuna) { + case 1: + button = btn_3_1; + break; + case 2: + button = btn_3_2; + break; + case 3: + button = btn_3_3; + break; + case 4: + button = btn_3_4; + break; + case 5: + button = btn_3_5; + break; + case 6: + button = btn_3_6; + break; + case 7: + button = btn_3_7; + break; + case 8: + button = btn_3_8; + break; + case 9: + button = btn_3_9; + break; + case 10: + button = btn_3_10; + break; + case 11: + button = btn_3_11; + break; + case 12: + button = btn_3_12; + break; + case 13: + button = btn_3_13; + break; + } + break; + case 4: + switch (numeColuna) { + case 1: + button = btn_4_1; + break; + case 2: + button = btn_4_2; + break; + case 3: + button = btn_4_3; + break; + case 4: + button = btn_4_4; + break; + case 5: + button = btn_4_5; + break; + case 6: + button = btn_4_6; + break; + case 7: + button = btn_4_7; + break; + case 8: + button = btn_4_8; + break; + case 9: + button = btn_4_9; + break; + case 10: + button = btn_4_10; + break; + case 11: + button = btn_4_11; + break; + case 12: + button = btn_4_12; + break; + case 13: + button = btn_4_13; + break; + } + break; + case 5: + switch (numeColuna) { + case 1: + button = btn_5_1; + break; + case 2: + button = btn_5_2; + break; + case 3: + button = btn_5_3; + break; + case 4: + button = btn_5_4; + break; + case 5: + button = btn_5_5; + break; + case 6: + button = btn_5_6; + break; + case 7: + button = btn_5_7; + break; + case 8: + button = btn_5_8; + break; + case 9: + button = btn_5_9; + break; + case 10: + button = btn_5_10; + break; + case 11: + button = btn_5_11; + break; + case 12: + button = btn_5_12; + break; + case 13: + button = btn_5_13; + break; + } + break; + case 6: + switch (numeColuna) { + case 1: + button = btn_6_1; + break; + case 2: + button = btn_6_2; + break; + case 3: + button = btn_6_3; + break; + case 4: + button = btn_6_4; + break; + case 5: + button = btn_6_5; + break; + case 6: + button = btn_6_6; + break; + case 7: + button = btn_6_7; + break; + case 8: + button = btn_6_8; + break; + case 9: + button = btn_6_9; + break; + case 10: + button = btn_6_10; + break; + case 11: + button = btn_6_11; + break; + case 12: + button = btn_6_12; + break; + case 13: + button = btn_6_13; + break; + } + break; + case 7: + switch (numeColuna) { + case 1: + button = btn_7_1; + break; + case 2: + button = btn_7_2; + break; + case 3: + button = btn_7_3; + break; + case 4: + button = btn_7_4; + break; + case 5: + button = btn_7_5; + break; + case 6: + button = btn_7_6; + break; + case 7: + button = btn_7_7; + break; + case 8: + button = btn_7_8; + break; + case 9: + button = btn_7_9; + break; + case 10: + button = btn_7_10; + break; + case 11: + button = btn_7_11; + break; + case 12: + button = btn_7_12; + break; + case 13: + button = btn_7_13; + break; + } + break; + } + + return button; + } + + private void abrirDetalheDiagramaAutobus(Integer numeFila, Integer numeColuna, + Button button) { + try { + Map args = new HashMap(); + + log.debug("fila=" + numeFila + ";numeColuna=" + numeColuna +";buttonid="+button.getId()); + + DetDiagramaAutobus detDiagramaAutobus = new DetDiagramaAutobus(); + if (!button.getLabel().isEmpty()) { + String[] nomeButton = button.getId().split("_"); + String stNumeFila = nomeButton[1]; + String stNumeColuna = nomeButton[2]; + + Short nf = Short.parseShort(stNumeFila); + Short nc = Short.parseShort(stNumeColuna); + + for (DetDiagramaAutobus dd : diagramaAutobus.getDetDiagramaAutobusList()) { + if ((nf.equals(dd.getNumefila())) && (nc.equals(dd.getNumecolumna()))) { + detDiagramaAutobus = dd; + } + } + } + + args.put("detDiagramaAutobus", detDiagramaAutobus); + args.put("diagramaAutobus", diagramaAutobus); + args.put("button", button); + args.put("numefila", numeFila.shortValue()); + args.put("numecolumna", numeColuna.shortValue()); + + openWindow("/gui/esquema_operacional/editarDetDiagramaAutoBus.zul", + Labels.getLabel("editarDetDiagramaAutobusController.window.title"), + args, MODAL); + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.ERROR); + } + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + diagramaAutobus = (DiagramaAutobus) Executions.getCurrent().getArg().get("diagramaAutobus"); + if (diagramaAutobus.getDiagramaautobusId() != null) { + diagramaAutobus = diagramaAutoBusService.obtenerID(diagramaAutobus.getDiagramaautobusId()); + } + + if (diagramaAutobus.getDetDiagramaAutobusList() == null) { + diagramaAutobus.setDetDiagramaAutobusList(new ArrayList()); + } else { + for (DetDiagramaAutobus dd : diagramaAutobus.getDetDiagramaAutobusList()) { + Button button = getButtonAssento(dd.getNumefila(), dd.getNumecolumna()); + button.setLabel(dd.getAsiento()); + } + } + + if (diagramaAutobus.getDiagramaautobusId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtDescDiagrama.focus(); + + diagramaAutobusList = (MyListbox) Executions.getCurrent().getArg().get("diagramaAutobusList"); + } + + private Integer getQtdeAcientosCriados() { + List lsDetDiagramaAutobus = diagramaAutobus.getDetDiagramaAutobusList(); + Integer qtde = 0; + for (DetDiagramaAutobus dda : lsDetDiagramaAutobus) { + if (dda.getActivo()) { + String asiento = dda.getAsiento(); + if (asiento != null) { + Boolean temLetra = asiento.matches("^[a-zA-Z]+$"); + if (!temLetra) { + qtde = qtde + 1; + } + } + } + } + + return qtde; + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + try { + Integer qtdeAssentosCriados = getQtdeAcientosCriados(); + Integer qtdeAssentosInformados = txtCantasSientos.getValue(); + txtDescDiagrama.getValue(); + + if (qtdeAssentosCriados.compareTo(qtdeAssentosInformados) != 0) { + Messagebox.show( + Labels.getLabel("editarDetDiagramaAutobusController.MSG.validacionCantAsientosSalvar"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + diagramaAutobus.setActivo(Boolean.TRUE); + diagramaAutobus.setFecmodif(Calendar.getInstance().getTime()); + diagramaAutobus.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (diagramaAutobus.getDetDiagramaAutobusList().size() > 0) { + if (diagramaAutobus.getDiagramaautobusId() == null) { + List lsDiagramaAutobus = + diagramaAutoBusService.buscar(diagramaAutobus.getDescDiagrama()); + + if (lsDiagramaAutobus.isEmpty()) { + diagramaAutoBusService.suscribir(diagramaAutobus); + diagramaAutobusList.addItem(diagramaAutobus); + + Messagebox.show( + Labels.getLabel("editarDiagramaAutobusController.MSG.suscribirOK"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + diagramaAutoBusService.actualizacion(diagramaAutobus); + diagramaAutobusList.updateItem(diagramaAutobus); + + Messagebox.show( + Labels.getLabel("editarDiagramaAutobusController.MSG.suscribirOK"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("editarDiagramaAutobusController.Sem.Asiento"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + if (ex instanceof WrongValueException) { + throw (WrongValueException) ex; + } + log.error("editarDiagramaAutobusController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarDiagramaAutobusController.MSG.borrarPergunta"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + List lsCorridaAutobus = + corridaService.buscarPorAutobusCorridasFuturas(diagramaAutobus); + List lsCorridaRoloperativo = + corridaService.buscarPorRolOperativoCorridasFuturas(diagramaAutobus); + + Boolean autobus = lsCorridaAutobus.isEmpty(); + Boolean rolRoloperativo = lsCorridaRoloperativo.isEmpty(); + + if ((autobus) && (rolRoloperativo)) { + if (resp == Messagebox.YES) { + diagramaAutoBusService.borrar(diagramaAutobus); + + Messagebox.show( + Labels.getLabel("editarDiagramaAutobusController.MSG.borrarOK"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + diagramaAutobusList.removeItem(diagramaAutobus); + + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("editarDiagramaAutobusController.MSG.Corrida.Futura"), + Labels.getLabel("editarDiagramaAutobusController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$minNovoAsiento(Event ev) { + try { + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btn_1_1(Event ev) { + abrirDetalheDiagramaAutobus(1, 1, btn_1_1); + } + + public void onClick$btn_1_2(Event ev) { + abrirDetalheDiagramaAutobus(1, 2, btn_1_2); + } + + public void onClick$btn_1_3(Event ev) { + abrirDetalheDiagramaAutobus(1, 3, btn_1_3); + } + + public void onClick$btn_1_4(Event ev) { + abrirDetalheDiagramaAutobus(1, 4, btn_1_4); + } + + public void onClick$btn_1_5(Event ev) { + abrirDetalheDiagramaAutobus(1, 5, btn_1_5); + } + + public void onClick$btn_1_6(Event ev) { + abrirDetalheDiagramaAutobus(1, 6, btn_1_6); + } + + public void onClick$btn_1_7(Event ev) { + abrirDetalheDiagramaAutobus(1, 7, btn_1_7); + } + + public void onClick$btn_1_8(Event ev) { + abrirDetalheDiagramaAutobus(1, 8, btn_1_8); + } + + public void onClick$btn_1_9(Event ev) { + abrirDetalheDiagramaAutobus(1, 9, btn_1_9); + } + + public void onClick$btn_1_10(Event ev) { + abrirDetalheDiagramaAutobus(1, 10, btn_1_10); + } + + public void onClick$btn_1_11(Event ev) { + abrirDetalheDiagramaAutobus(1, 11, btn_1_11); + } + + public void onClick$btn_1_12(Event ev) { + abrirDetalheDiagramaAutobus(1, 12, btn_1_12); + } + + public void onClick$btn_1_13(Event ev) { + abrirDetalheDiagramaAutobus(1, 13, btn_1_13); + } + + public void onClick$btn_2_1(Event ev) { + abrirDetalheDiagramaAutobus(2, 1, btn_2_1); + } + + public void onClick$btn_2_2(Event ev) { + abrirDetalheDiagramaAutobus(2, 2, btn_2_2); + } + + public void onClick$btn_2_3(Event ev) { + abrirDetalheDiagramaAutobus(2, 3, btn_2_3); + } + + public void onClick$btn_2_4(Event ev) { + abrirDetalheDiagramaAutobus(2, 4, btn_2_4); + } + + public void onClick$btn_2_5(Event ev) { + abrirDetalheDiagramaAutobus(2, 5, btn_2_5); + } + + public void onClick$btn_2_6(Event ev) { + abrirDetalheDiagramaAutobus(2, 6, btn_2_6); + } + + public void onClick$btn_2_7(Event ev) { + abrirDetalheDiagramaAutobus(2, 7, btn_2_7); + } + + public void onClick$btn_2_8(Event ev) { + abrirDetalheDiagramaAutobus(2, 8, btn_2_8); + } + + public void onClick$btn_2_9(Event ev) { + abrirDetalheDiagramaAutobus(2, 9, btn_2_9); + } + + public void onClick$btn_2_10(Event ev) { + abrirDetalheDiagramaAutobus(2, 10, btn_2_10); + } + + public void onClick$btn_2_11(Event ev) { + abrirDetalheDiagramaAutobus(2, 11, btn_2_11); + } + + public void onClick$btn_2_12(Event ev) { + abrirDetalheDiagramaAutobus(2, 12, btn_2_12); + } + + public void onClick$btn_2_13(Event ev) { + abrirDetalheDiagramaAutobus(2, 13, btn_2_13); + } + + public void onClick$btn_3_1(Event ev) { + abrirDetalheDiagramaAutobus(3, 1, btn_3_1); + } + + public void onClick$btn_3_2(Event ev) { + abrirDetalheDiagramaAutobus(3, 2, btn_3_2); + } + + public void onClick$btn_3_3(Event ev) { + abrirDetalheDiagramaAutobus(3, 3, btn_3_3); + } + + public void onClick$btn_3_4(Event ev) { + abrirDetalheDiagramaAutobus(3, 4, btn_3_4); + } + + public void onClick$btn_3_5(Event ev) { + abrirDetalheDiagramaAutobus(3, 5, btn_3_5); + } + + public void onClick$btn_3_6(Event ev) { + abrirDetalheDiagramaAutobus(3, 6, btn_3_6); + } + + public void onClick$btn_3_7(Event ev) { + abrirDetalheDiagramaAutobus(3, 7, btn_3_7); + } + + public void onClick$btn_3_8(Event ev) { + abrirDetalheDiagramaAutobus(3, 8, btn_3_8); + } + + public void onClick$btn_3_9(Event ev) { + abrirDetalheDiagramaAutobus(3, 9, btn_3_9); + } + + public void onClick$btn_3_10(Event ev) { + abrirDetalheDiagramaAutobus(3, 10, btn_3_10); + } + + public void onClick$btn_3_11(Event ev) { + abrirDetalheDiagramaAutobus(3, 11, btn_3_11); + } + + public void onClick$btn_3_12(Event ev) { + abrirDetalheDiagramaAutobus(3, 12, btn_3_12); + } + + public void onClick$btn_3_13(Event ev) { + abrirDetalheDiagramaAutobus(3, 13, btn_3_13); + } + + public void onClick$btn_4_1(Event ev) { + abrirDetalheDiagramaAutobus(4, 1, btn_4_1); + } + + public void onClick$btn_4_2(Event ev) { + abrirDetalheDiagramaAutobus(4, 2, btn_4_2); + } + + public void onClick$btn_4_3(Event ev) { + abrirDetalheDiagramaAutobus(4, 3, btn_4_3); + } + + public void onClick$btn_4_4(Event ev) { + abrirDetalheDiagramaAutobus(4, 4, btn_4_4); + } + + public void onClick$btn_4_5(Event ev) { + abrirDetalheDiagramaAutobus(4, 5, btn_4_5); + } + + public void onClick$btn_4_6(Event ev) { + abrirDetalheDiagramaAutobus(4, 6, btn_4_6); + } + + public void onClick$btn_4_7(Event ev) { + abrirDetalheDiagramaAutobus(4, 7, btn_4_7); + } + + public void onClick$btn_4_8(Event ev) { + abrirDetalheDiagramaAutobus(4, 8, btn_4_8); + } + + public void onClick$btn_4_9(Event ev) { + abrirDetalheDiagramaAutobus(4, 9, btn_4_9); + } + + public void onClick$btn_4_10(Event ev) { + abrirDetalheDiagramaAutobus(4, 10, btn_4_10); + } + + public void onClick$btn_4_11(Event ev) { + abrirDetalheDiagramaAutobus(4, 11, btn_4_11); + } + + public void onClick$btn_4_12(Event ev) { + abrirDetalheDiagramaAutobus(4, 12, btn_4_12); + } + + public void onClick$btn_4_13(Event ev) { + abrirDetalheDiagramaAutobus(4, 13, btn_4_13); + } + + public void onClick$btn_5_1(Event ev) { + abrirDetalheDiagramaAutobus(5, 1, btn_5_1); + } + + public void onClick$btn_5_2(Event ev) { + abrirDetalheDiagramaAutobus(5, 2, btn_5_2); + } + + public void onClick$btn_5_3(Event ev) { + abrirDetalheDiagramaAutobus(5, 3, btn_5_3); + } + + public void onClick$btn_5_4(Event ev) { + abrirDetalheDiagramaAutobus(5, 4, btn_5_4); + } + + public void onClick$btn_5_5(Event ev) { + abrirDetalheDiagramaAutobus(5, 5, btn_5_5); + } + + public void onClick$btn_5_6(Event ev) { + abrirDetalheDiagramaAutobus(5, 6, btn_5_6); + } + + public void onClick$btn_5_7(Event ev) { + abrirDetalheDiagramaAutobus(5, 7, btn_5_7); + } + + public void onClick$btn_5_8(Event ev) { + abrirDetalheDiagramaAutobus(5, 8, btn_5_8); + } + + public void onClick$btn_5_9(Event ev) { + abrirDetalheDiagramaAutobus(5, 9, btn_5_9); + } + + public void onClick$btn_5_10(Event ev) { + abrirDetalheDiagramaAutobus(5, 10, btn_5_10); + } + + public void onClick$btn_5_11(Event ev) { + abrirDetalheDiagramaAutobus(5, 11, btn_5_11); + } + + public void onClick$btn_5_12(Event ev) { + abrirDetalheDiagramaAutobus(5, 12, btn_5_12); + } + + public void onClick$btn_5_13(Event ev) { + abrirDetalheDiagramaAutobus(5, 13, btn_5_13); + } + + public void onClick$btn_6_1(Event ev) { + abrirDetalheDiagramaAutobus(6, 1, btn_6_1); + } + + public void onClick$btn_6_2(Event ev) { + abrirDetalheDiagramaAutobus(6, 2, btn_6_2); + } + + public void onClick$btn_6_3(Event ev) { + abrirDetalheDiagramaAutobus(6, 3, btn_6_3); + } + + public void onClick$btn_6_4(Event ev) { + abrirDetalheDiagramaAutobus(6, 4, btn_6_4); + } + + public void onClick$btn_6_5(Event ev) { + abrirDetalheDiagramaAutobus(6, 5, btn_6_5); + } + + public void onClick$btn_6_6(Event ev) { + abrirDetalheDiagramaAutobus(6, 6, btn_6_6); + } + + public void onClick$btn_6_7(Event ev) { + abrirDetalheDiagramaAutobus(6, 7, btn_6_7); + } + + public void onClick$btn_6_8(Event ev) { + abrirDetalheDiagramaAutobus(6, 8, btn_6_8); + } + + public void onClick$btn_6_9(Event ev) { + abrirDetalheDiagramaAutobus(6, 9, btn_6_9); + } + + public void onClick$btn_6_10(Event ev) { + abrirDetalheDiagramaAutobus(6, 10, btn_6_10); + } + + public void onClick$btn_6_11(Event ev) { + abrirDetalheDiagramaAutobus(6, 11, btn_6_11); + } + + public void onClick$btn_6_12(Event ev) { + abrirDetalheDiagramaAutobus(6, 12, btn_6_12); + } + + public void onClick$btn_6_13(Event ev) { + abrirDetalheDiagramaAutobus(6, 13, btn_6_13); + } + + public void onClick$btn_7_1(Event ev) { + abrirDetalheDiagramaAutobus(7, 1, btn_7_1); + } + + public void onClick$btn_7_2(Event ev) { + abrirDetalheDiagramaAutobus(7, 2, btn_7_2); + } + + public void onClick$btn_7_3(Event ev) { + abrirDetalheDiagramaAutobus(7, 3, btn_7_3); + } + + public void onClick$btn_7_4(Event ev) { + abrirDetalheDiagramaAutobus(7, 4, btn_7_4); + } + + public void onClick$btn_7_5(Event ev) { + abrirDetalheDiagramaAutobus(7, 5, btn_7_5); + } + + public void onClick$btn_7_6(Event ev) { + abrirDetalheDiagramaAutobus(7, 6, btn_7_6); + } + + public void onClick$btn_7_7(Event ev) { + abrirDetalheDiagramaAutobus(7, 7, btn_7_7); + } + + public void onClick$btn_7_8(Event ev) { + abrirDetalheDiagramaAutobus(7, 8, btn_7_8); + } + + public void onClick$btn_7_9(Event ev) { + abrirDetalheDiagramaAutobus(7, 9, btn_7_9); + } + + public void onClick$btn_7_10(Event ev) { + abrirDetalheDiagramaAutobus(7, 10, btn_7_10); + } + + public void onClick$btn_7_11(Event ev) { + abrirDetalheDiagramaAutobus(7, 11, btn_7_11); + } + + public void onClick$btn_7_12(Event ev) { + abrirDetalheDiagramaAutobus(7, 12, btn_7_12); + } + + public void onClick$btn_7_13(Event ev) { + abrirDetalheDiagramaAutobus(7, 13, btn_7_13); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarRolOperativoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarRolOperativoController.java new file mode 100644 index 000000000..433274328 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarRolOperativoController.java @@ -0,0 +1,214 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import com.rjconsultores.ventaboletos.entidad.RolOperativo; +import com.rjconsultores.ventaboletos.service.DiagramaAutobusService; +import com.rjconsultores.ventaboletos.service.RolOperativoService; +import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; +import org.zkoss.zul.Timebox; + +/** + * + * @author Shiro + */ +@Controller("editarRolOperativoController") +@Scope("prototype") +public class EditarRolOperativoController extends MyGenericForwardComposer { + + @Autowired + private RolOperativoService operativoService; + @Autowired + private DiagramaAutobusService diagramaBuService; + private RolOperativo rolOperativo; + private MyListbox rolOperativoList; + private List diagramaList; + private Timebox timeprevio; + private Textbox txtDesRol; + private Combobox cmbDiagramaBus; + private static Logger log = Logger.getLogger(EditarRolOperativoController.class); + + public Combobox getCmbDiagramaBus() { + return cmbDiagramaBus; + } + + public void setCmbDiagramaBus(Combobox cmbDiagramaBus) { + this.cmbDiagramaBus = cmbDiagramaBus; + } + + public Textbox getTxtDesRol() { + return txtDesRol; + } + + public void setTxtDesRol(Textbox txtDesRol) { + this.txtDesRol = txtDesRol; + } + + public Timebox getTimeprevio() { + return timeprevio; + } + + public void setTimeprevio(Timebox timeprevio) { + this.timeprevio = timeprevio; + } + + public DiagramaAutobusService getDiagramaBuService() { + return diagramaBuService; + } + + public void setDiagramaBuService(DiagramaAutobusService diagramaBuService) { + this.diagramaBuService = diagramaBuService; + } + + public List getDiagramaList() { + return diagramaList; + } + + public void setDiagramaList(List diagramaList) { + this.diagramaList = diagramaList; + } + + public RolOperativoService getOperativoService() { + return operativoService; + } + + public void setOperativoService(RolOperativoService operativoService) { + this.operativoService = operativoService; + } + + public RolOperativo getRolOperativo() { + return rolOperativo; + } + + public void setRolOperativo(RolOperativo rolOperativo) { + this.rolOperativo = rolOperativo; + } + + public MyListbox getRolOperativoList() { + return rolOperativoList; + } + + public void setRolOperativoList(MyListbox rolOperativoList) { + this.rolOperativoList = rolOperativoList; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + diagramaList = diagramaBuService.obtenerTodos(); + super.doAfterCompose(comp); + + rolOperativo = (RolOperativo) Executions.getCurrent().getArg().get("rolOperativo"); + rolOperativoList = (MyListbox) Executions.getCurrent().getArg().get("rolOperativoList"); + } + + public void onClick$btnSalvar(Event ev) { + + try { + rolOperativo.setDescroloperativo(txtDesRol.getValue()); + rolOperativo.setTiempoprevio(timeprevio.getValue()); + rolOperativo.setDiagramaAutobus((DiagramaAutobus) cmbDiagramaBus.getSelectedItem().getValue()); + rolOperativo.setActivo(Boolean.TRUE); + rolOperativo.setFecmodif(Calendar.getInstance().getTime()); + rolOperativo.setUsuarioId(0); + + List lsRolOperativo = operativoService.buscar(rolOperativo.getDescroloperativo()); + + boolean podeSalvar = false; + if (lsRolOperativo.isEmpty()) { + podeSalvar = true; + } else { + if (rolOperativo.getRoloperativoId() != null) { + for (RolOperativo c : lsRolOperativo) { + if (c.getRoloperativoId().equals(rolOperativo.getRoloperativoId())) { + podeSalvar = true; + } + } + } + } + if (podeSalvar) { + + if (rolOperativo.getRoloperativoId() == null) { + operativoService.suscribir(rolOperativo); + rolOperativoList.addItem(rolOperativo); + } else { + operativoService.actualizacion(rolOperativo); + rolOperativoList.updateItem(rolOperativo); + } + Messagebox.show( + Labels.getLabel("editarRolOperativoController.MSG.suscribirOK"), + Labels.getLabel("editarRolOperativoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarRolOperativoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarRolOperativoController.window.title"), + Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarRolOperativoController.MSG.BorrarPergunta"), + Labels.getLabel("editarRolOperativoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + operativoService.borrar(rolOperativo); + + Messagebox.show( + Labels.getLabel("editarRolOperativoController.MSG.BorrarOK"), + Labels.getLabel("editarRolOperativoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + rolOperativoList.removeItem(rolOperativo); + + closeWindow(); + } + } catch (RegistroConDependenciaException ex) { + Clients.alert( + ex.getLocalizedMessage(), + Labels.getLabel("editarRolOperativoController.window.title"), + Messagebox.INFORMATION); + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("editarRolOperativoController.MSG.BorrarOK"), + Labels.getLabel("editarRolOperativoController.window.title"), + Messagebox.INFORMATION); + + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarTipoParadaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarTipoParadaController.java new file mode 100644 index 000000000..1cde5eeeb --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarTipoParadaController.java @@ -0,0 +1,172 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.TipoParada; +import com.rjconsultores.ventaboletos.service.TipoParadaService; +import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Row; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarTipoParadaController") +@Scope("prototype") +public class EditarTipoParadaController extends MyGenericForwardComposer { + + @Autowired + private TipoParadaService tipoParadaService; + private TipoParada tipoParada; + private MyListbox tipoParadaList; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarTipoParadaController.class); + private Textbox txtNome; + private Row rowEquivalencia; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public TipoParada getTipoParada() { + return tipoParada; + } + + public void setTipoParada(TipoParada tipoParada) { + this.tipoParada = tipoParada; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Row getRowEquivalencia() { + return rowEquivalencia; + } + + public void setRowEquivalencia(Row rowEquivalencia) { + this.rowEquivalencia = rowEquivalencia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tipoParada = (TipoParada) Executions.getCurrent().getArg().get("tipoParada"); + tipoParadaList = (MyListbox) Executions.getCurrent().getArg().get("tipoParadaList"); + + if (tipoParada.getTipoparadaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + +// Comentado pois estava dando erro no SCIA +// if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { +// rowEquivalencia.setVisible(Boolean.FALSE); +// } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + try { + tipoParada.setActivo(true); + tipoParada.setFecmodif(Calendar.getInstance().getTime()); + tipoParada.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsTipoParada = tipoParadaService.buscar(tipoParada.getDesctipo()); + + if (!lsTipoParada.isEmpty()) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoParadaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (tipoParada.getTipoparadaId() == null) { + tipoParadaService.suscribir(tipoParada); + tipoParadaList.addItem(tipoParada); + } else { + tipoParadaService.actualizacion(tipoParada); + tipoParadaList.updateItem(tipoParada); + } + + Messagebox.show( + Labels.getLabel("editarTipoParadaController.MSG.suscribirOK"), + Labels.getLabel("editarTipoParadaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error("editarTipoParadaController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoParadaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTipoParadaController.MSG.borrarPergunta"), + Labels.getLabel("editarTipoParadaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + tipoParadaService.borrar(tipoParada); + + Messagebox.show( + Labels.getLabel("editarTipoParadaController.MSG.borrarOK"), + Labels.getLabel("editarTipoParadaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tipoParadaList.removeItem(tipoParada); + + closeWindow(); + } + } catch (RegistroConDependenciaException ex) { + Clients.alert( + ex.getLocalizedMessage(), + Labels.getLabel("editarTipoParadaController.window.title"), + Messagebox.INFORMATION); + } catch (Exception ex) { + log.error(ex); + + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoParadaController.window.title"), + Messagebox.INFORMATION); + + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarTramoKmServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarTramoKmServicioController.java new file mode 100644 index 000000000..a5388edbe --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarTramoKmServicioController.java @@ -0,0 +1,279 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoKmServicio; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.TramoKmServicioService; +import com.rjconsultores.ventaboletos.service.TramoService; +import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zkplus.databind.BindingListModel; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Administrador + */ +@Controller("editarTramoKmServicioController") +@Scope("prototype") +public class EditarTramoKmServicioController extends MyGenericForwardComposer { + + @Autowired + private TramoKmServicioService tramoKmServicioService; + @Autowired + private EmpresaService empresaService; + @Autowired + private TramoService tramoService; + @Autowired + private ClaseServicioService claseServicioService; + private TramoKmServicio tramoKmServicio; + private MyListbox tramoKmServicioList; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarTramoKmServicioController.class); + private Combobox cmbTramo; + private Combobox cmbEmpresa; + private Combobox cmbClaseServicio; + private Combobox cmbParadaOrigem; + private Combobox cmbParadaDestino; + private MyTextboxDecimal kmPagoCondutor; + private List lsTramo; + private List lsEmpresa; + private List lsClaseServicio; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public TramoKmServicio getTramoKmServicio() { + return tramoKmServicio; + } + + public void setTramoKmServicio(TramoKmServicio tramoKmServicio) { + this.tramoKmServicio = tramoKmServicio; + } + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsTramo() { + return lsTramo; + } + + public void setLsTramo(List lsTramo) { + this.lsTramo = lsTramo; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.buscarTodosExceto(-1); + lsClaseServicio = claseServicioService.buscarTodosExceto(-1); + + super.doAfterCompose(comp); + + tramoKmServicio = (TramoKmServicio) Executions.getCurrent().getArg().get("tramoKmServicio"); + tramoKmServicioList = (MyListbox) Executions.getCurrent().getArg().get("tramoKmServicioList"); + + if (tramoKmServicio.getTramokmservicioId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + if (tramoKmServicio.getTramo() != null) { + lsTramo = new ArrayList(); + lsTramo.add(tramoKmServicio.getTramo()); + BindingListModel listModelParada = new BindingListModelList(lsTramo, true); + cmbTramo.setModel(listModelParada); + } + } + } + + public void onChange$cmbParadaOrigem(Event ev) { + Comboitem cbiOrigem = cmbParadaOrigem.getSelectedItem(); + if (cbiOrigem != null) { + Parada origem = (Parada) cbiOrigem.getValue(); + + Comboitem cbiDestino = cmbParadaDestino.getSelectedItem(); + if (cbiDestino != null) { + Parada destino = (Parada) cbiDestino.getValue(); + + lsTramo = tramoService.obtenerListPorOrigemDestino(origem, destino); + + if (!lsTramo.isEmpty()) { + + BindingListModel listModelParada = new BindingListModelList(lsTramo, true); + cmbTramo.setModel(listModelParada); + + cmbTramo.open(); + } + } + } + } + + public void onChange$cmbParadaDestino(Event ev) { + + Comboitem cbiDestino = cmbParadaDestino.getSelectedItem(); + if (cbiDestino != null) { + + Parada destino = (Parada) cbiDestino.getValue(); + + Comboitem cbiOrigem = cmbParadaOrigem.getSelectedItem(); + if (cbiOrigem != null) { + Parada origem = (Parada) cbiOrigem.getValue(); + + lsTramo = tramoService.obtenerListPorOrigemDestino(origem, destino); + + if (!lsTramo.isEmpty()) { + + BindingListModel listModelParada = new BindingListModelList(lsTramo, true); + cmbTramo.setModel(listModelParada); + + cmbTramo.open(); + } + } + } + } + + public void onClick$btnSalvar(Event ev) { + + cmbTramo.getValue(); + cmbEmpresa.getValue(); + cmbClaseServicio.getValue(); + kmPagoCondutor.getValue(); + + try { + tramoKmServicio.setActivo(Boolean.TRUE); + tramoKmServicio.setFecmodif(Calendar.getInstance().getTime()); + tramoKmServicio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + Comboitem cbiEmpresa = cmbEmpresa.getSelectedItem(); + if (cbiEmpresa != null) { + tramoKmServicio.setEmpresa((Empresa) cbiEmpresa.getValue()); + } + + Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem(); + if (cbiClaseServicio != null) { + tramoKmServicio.setClaseServicio((ClaseServicio) cbiClaseServicio.getValue()); + } + Comboitem cbiTramo = cmbTramo.getSelectedItem(); + if (cbiTramo != null) { + tramoKmServicio.setTramo((Tramo) cbiTramo.getValue()); + + } + + List lsTramoKmServicios = tramoKmServicioService.buscar(tramoKmServicio); + + boolean podeSalvar = false; + if (lsTramoKmServicios.isEmpty()) { + podeSalvar = true; + } else { + if (tramoKmServicio.getTramokmservicioId() != null) { + for (TramoKmServicio c : lsTramoKmServicios) { + if (c.getTramokmservicioId().equals(tramoKmServicio.getTramokmservicioId())) { + podeSalvar = true; + } + } + } + } + + if (podeSalvar) { + + if (tramoKmServicio.getTramokmservicioId() == null) { + tramoKmServicioService.suscribir(tramoKmServicio); + tramoKmServicioList.addItem(tramoKmServicio); + } else { + tramoKmServicioService.actualizacion(tramoKmServicio); + tramoKmServicioList.updateItem(tramoKmServicio); + } + + Messagebox.show( + Labels.getLabel("editarTramoKmServicioController.MSG.suscribirOK"), + Labels.getLabel("editarTramoKmServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTramoKmServicioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTramoKmServicioController.MSG.borrarPergunta"), + Labels.getLabel("editarTramoKmServicioController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + tramoKmServicioService.borrar(tramoKmServicio); + + Messagebox.show( + Labels.getLabel("editarTramoKmServicioController.MSG.borrarOK"), + Labels.getLabel("editarTramoKmServicioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tramoKmServicioList.removeItem(tramoKmServicio); + + closeWindow(); + } + } catch (RegistroConDependenciaException ex) { + Clients.alert(ex.getLocalizedMessage(), + Labels.getLabel("editarTramoKmServicioController.window.title"), + Messagebox.INFORMATION); + } catch (Exception ex) { + log.error(ex); + Clients.alert(Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTramoKmServicioController.window.title"), + Messagebox.INFORMATION); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarTramosController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarTramosController.java new file mode 100644 index 000000000..90f27e9f7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarTramosController.java @@ -0,0 +1,647 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Spinner; +import org.zkoss.zul.Tab; +import org.zkoss.zul.Textbox; +import org.zkoss.zul.Timebox; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.TramoKm; +import com.rjconsultores.ventaboletos.entidad.TramoServicio; +import com.rjconsultores.ventaboletos.entidad.TramoTiempo; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.EsquemaCorridaService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.RutaCombinacionService; +import com.rjconsultores.ventaboletos.service.TramoService; +import com.rjconsultores.ventaboletos.service.ViaService; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.ConstraintNumberBD; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTramoKm; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTramoServicio; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTramoTiempo; + +/** + * + * @author Administrador + */ +@Controller("editarTramosController") +@Scope("prototype") +public class EditarTramosController extends MyGenericForwardComposer { + + @Autowired + private TramoService tramoService; + @Autowired + private ParadaService paradaService; + @Autowired + private ViaService viaService; + @Autowired + private EmpresaService empresaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private EsquemaCorridaService esquemaCorridaService; + @Autowired + private RutaCombinacionService rutaCombinacionService; + private List lsVias; + private List lsClaseServicio; + private Tramo tramo; + private MyListbox tramosList; + private MyListbox tiempoList; + private MyListbox tramoKmEmpresaList; + private List listaTramoServicio; + private List listaTramosTiempo; + private List listaTramosKm; + private MyListbox servicioList; + private MyComboboxParada cmbParadaOrigem; + private MyComboboxParada cmbParadaDestino; + private Combobox cmbClaseServicio; + private Combobox cmbVia; + private Combobox cmbEmpresa; + private Textbox txKmReal; + private Textbox txtKmPagoConductor; + private Textbox txtNome; + private Intbox itxCantkmpagoconductor; + private Combobox cmbClaseServicioTiempo; + private Timebox horainicio; + private Timebox horafin; + private Intbox txtnumdiasemana; + private Checkbox lun; + private Checkbox mar; + private Checkbox mie; + private Checkbox jue; + private Checkbox vie; + private Checkbox sab; + private Checkbox dom; + private Spinner spHora; + private Spinner spMinuto; + private Spinner spHoraTiempo; + private Spinner spMinutoTiempo; + private Button btnApagar; + private ConstraintNumberBD constraintTarifa; + private List lsEmpresa; + private Tab tabExcepcionesKm; + private static Logger log = Logger.getLogger(EditarTramosController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsVias = viaService.obtenerTodos(); + lsEmpresa = empresaService.obtenerTodos(); + lsClaseServicio = claseServicioService.buscarTodosExceto(-1); + + super.doAfterCompose(comp); + + servicioList.setItemRenderer(new RenderTramoServicio()); + tiempoList.setItemRenderer(new RenderTramoTiempo()); + tramoKmEmpresaList.setItemRenderer(new RenderTramoKm()); + + listaTramoServicio = new ArrayList(); + listaTramosTiempo = new ArrayList(); + listaTramosKm = new ArrayList(); + + tramo = (Tramo) Executions.getCurrent().getArg().get("tramo"); + if (tramo.getTramoId() != null) { + tramo = tramoService.obtenerID(tramo.getTramoId()); + + for (TramoServicio ta : tramo.getTramoServicioList()) { + listaTramoServicio.add(ta); + } + servicioList.setData(listaTramoServicio); + + for (TramoTiempo tt : tramo.getLsTramoTiempo()) { + listaTramosTiempo.add(tt); + } + tiempoList.setData(listaTramosTiempo); + + for (TramoKm tk : tramo.getTramoKms()) { + listaTramosKm.add(tk); + } + tramoKmEmpresaList.setData(listaTramosKm); + } + tramosList = (MyListbox) Executions.getCurrent().getArg().get("tramosList"); + + if (tramo.getTramoId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + + constraintTarifa = new ConstraintNumberBD(8, 2, true); + + txKmReal.setConstraint(constraintTarifa); + txtKmPagoConductor.setConstraint(constraintTarifa); + tabExcepcionesKm.setVisible(ApplicationProperties.getInstance().exhibirExcepcionesTramoKm()); + + aplicarMascaras(); + } + + private void aplicarMascaras() { + Clients.evalJavaScript("jQuery('#" + txKmReal.getUuid() + "').format({allow_negative:false,precision: 2,decimal:'.',autofix:true});"); + Clients.evalJavaScript("jQuery('#" + txtKmPagoConductor.getUuid() + "').format({allow_negative:false,precision: 2,decimal:'.',autofix:true});"); + } + + public void onClick$btnSalvarServicio(Event ev) throws InterruptedException { + spHora.getValue(); + spMinuto.getValue(); + + if (cmbClaseServicio.getSelectedItem() == null) { + Messagebox.show(Labels.getLabel("editarTramosController.MSG.tipoServicio"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + return; + } + + try { + + ClaseServicio claseServicio = (ClaseServicio) cmbClaseServicio.getSelectedItem().getValue(); + + boolean existe = false; + for (TramoServicio tt : listaTramoServicio) { + if (tt.getClaseServicio().equals(claseServicio)) { + existe = true; + } + } + + if (!existe) { + TramoServicio ts = new TramoServicio(); + ts.setClaseServicio((ClaseServicio) cmbClaseServicio.getSelectedItem().getValue()); + ts.setTiemporecorrido(DateUtil.getFecInicio(spHora.getValue(), spMinuto.getValue()).getTime()); + ts.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + ts.setFecmodif(Calendar.getInstance().getTime()); + ts.setActivo(Boolean.TRUE); + + listaTramoServicio.add(ts); + servicioList.setData(listaTramoServicio); + + cmbClaseServicio.setSelectedItem(null); + + spHora.setText("00"); + spMinuto.setText("00"); + + } else { + Messagebox.show(Labels.getLabel("MSG.Registro.Existe"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (WrongValueException ex) { + throw (WrongValueException) ex; + } catch (Exception ex) { + log.error(ex); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnSalvarTiempo(Event ev) throws InterruptedException { + spHoraTiempo.getValue(); + spMinutoTiempo.getValue(); + + if (!lun.isChecked() && !mar.isChecked() && !mie.isChecked() && !jue.isChecked() && !vie.isChecked() && !sab.isChecked() && !dom.isChecked()) { + + Messagebox.show(Labels.getLabel("editarTramosController.MSG.obligatorioTramoTiempoDia"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, + Messagebox.INFORMATION); + + return; + } + try { + ClaseServicio claseServicio = (ClaseServicio) cmbClaseServicioTiempo.getSelectedItem().getValue(); + + boolean existe = false; + for (TramoTiempo tt : listaTramosTiempo) { + if (tt.getClaseServicio().equals(claseServicio)) { + existe = true; + } + } + + if (!existe) { + + TramoTiempo tramoTiempo = new TramoTiempo(); + tramoTiempo.setClaseServicio(claseServicio); + + tramoTiempo.setHorafin(DateUtil.getFecInicio(horafin.getValue()).getTime()); + tramoTiempo.setHorainicio(DateUtil.getFecInicio(horainicio.getValue()).getTime()); + tramoTiempo.setIndapliclun(lun.isChecked()); + tramoTiempo.setIndaplicmar(mar.isChecked()); + tramoTiempo.setIndaplicmie(mie.isChecked()); + tramoTiempo.setIndaplicjue(jue.isChecked()); + tramoTiempo.setIndaplicvie(vie.isChecked()); + tramoTiempo.setIndaplicsab(sab.isChecked()); + tramoTiempo.setIndaplicdom(dom.isChecked()); + tramoTiempo.setTiemporecorrido(DateUtil.getFecInicio(spHoraTiempo.getValue(), spMinutoTiempo.getValue()).getTime()); + + tramoTiempo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tramoTiempo.setFecmodif(Calendar.getInstance().getTime()); + tramoTiempo.setActivo(Boolean.TRUE); + + listaTramosTiempo.add(tramoTiempo); + tiempoList.setData(listaTramosTiempo); + + spHoraTiempo.setText("00"); + spMinutoTiempo.setText("00"); + } else { + Messagebox.show(Labels.getLabel("MSG.Registro.Existe"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (WrongValueException ex) { + throw (WrongValueException) ex; + } catch (Exception ex) { + log.error(ex); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnSalvarExceptioneKm(Event ev) throws InterruptedException { + itxCantkmpagoconductor.getValue(); + cmbEmpresa.getValue(); + + Empresa empresa = (Empresa) cmbEmpresa.getSelectedItem().getValue(); + + boolean existe = false; + for (TramoKm tk : listaTramosKm) { + if (tk.getEmpresa().equals(empresa)) { + existe = true; + } + } + + if (!existe) { + TramoKm tramoKm = new TramoKm(); + tramoKm.setEmpresa(empresa); + tramoKm.setCantkmpagoconductor(itxCantkmpagoconductor.getValue()); + + tramoKm.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tramoKm.setFecmodif(Calendar.getInstance().getTime()); + tramoKm.setActivo(Boolean.TRUE); + + listaTramosKm.add(tramoKm); + tramoKmEmpresaList.setData(listaTramosKm); + + } else { + Messagebox.show(Labels.getLabel("MSG.Registro.Existe"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + + } + + public void onClick$btnApagarServicio(Event ev) throws InterruptedException { + try { + TramoServicio tramoAtributo = (TramoServicio) servicioList.getSelected(); + + if (tramoAtributo != null) { + int opcao = Messagebox.show(Labels.getLabel("editarTramosController.MSG.borrarTramoServicio"), Labels.getLabel("editarTramosController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (opcao == Messagebox.YES) { + tramoAtributo.setFecmodif(Calendar.getInstance().getTime()); + tramoAtributo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tramoAtributo.setActivo(Boolean.FALSE); + + listaTramoServicio.remove(tramoAtributo); + servicioList.setData(listaTramoServicio); + } + } else { + Messagebox.show(Labels.getLabel("editarTramosController.MSG.selecioneTramoServicio"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + } + } catch (WrongValueException ex) { + throw (WrongValueException) ex; + } catch (Exception ex) { + log.error(ex); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagarTiempo(Event ev) throws InterruptedException { + try { + TramoTiempo tramoTiempo = (TramoTiempo) tiempoList.getSelected(); + + if (tramoTiempo != null) { + int opcao = Messagebox.show(Labels.getLabel("editarTramosController.MSG.borrarTramoTiempo"), Labels.getLabel("editarTramosController.window.title"), Messagebox.YES + | Messagebox.NO, Messagebox.QUESTION); + + if (opcao == Messagebox.YES) { + tramoTiempo.setFecmodif(Calendar.getInstance().getTime()); + tramoTiempo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tramoTiempo.setActivo(Boolean.FALSE); + + listaTramosTiempo.remove(tramoTiempo); + tiempoList.setData(listaTramosTiempo); + } + } else { + Messagebox.show(Labels.getLabel("editarTramosController.MSG.selecioneTramoTiempo"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + } + } catch (WrongValueException ex) { + throw (WrongValueException) ex; + } catch (Exception ex) { + log.error(ex); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagarExcepcioneKm(Event ev) throws InterruptedException { + + TramoKm tramoKm = (TramoKm) tramoKmEmpresaList.getSelected(); + + if (tramoKm != null) { + int opcao = Messagebox.show(Labels.getLabel("editarTramosController.MSG.borrarTramoKm"), Labels.getLabel("editarTramosController.window.title"), Messagebox.YES + | Messagebox.NO, Messagebox.QUESTION); + + if (opcao == Messagebox.YES) { + tramoKm.setFecmodif(Calendar.getInstance().getTime()); + tramoKm.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tramoKm.setActivo(Boolean.FALSE); + + listaTramosKm.remove(tramoKm); + tramoKmEmpresaList.setData(listaTramosKm); + } + } else { + Messagebox.show(Labels.getLabel("editarTramosController.MSG.selecioneTramoKm"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + } + + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txKmReal.getValue(); + txtKmPagoConductor.getValue(); + txtNome.getValue(); + cmbParadaOrigem.getValue(true); + cmbParadaDestino.getValue(true); + + if (listaTramoServicio.isEmpty()) { + Messagebox.show(Labels.getLabel("editarTramosController.MSG.obligatorioTramoTiempo"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, + Messagebox.INFORMATION); + + return; + } + + try { + tramo.setActivo(Boolean.TRUE); + tramo.setFecmodif(Calendar.getInstance().getTime()); + tramo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + Parada origem = tramo.getOrigem(); + Parada destino = tramo.getDestino(); + + tramo.setVia((Via) cmbVia.getSelectedItem().getValue()); + tramo.setLsTramoTiempo(listaTramosTiempo); + tramo.setTramoServicioList(listaTramoServicio); + tramo.setTramoKms(listaTramosKm); + + if (!origem.getParadaId().equals(destino.getParadaId())) { + Tramo tramoConsulta = tramoService.buscar(tramo.getOrigem(), tramo.getDestino(), tramo.getVia()); + + boolean podeSalvar = false; + if (tramoConsulta == null) { + podeSalvar = true; + } else { + if (tramoConsulta.getTramoId().equals(tramo.getTramoId())) { + podeSalvar = true; + } + } + if (podeSalvar) { + if (tramo.getTramoId() == null) { + + tramoService.suscribir(tramo); + tramosList.addItem(tramo); + + Messagebox.show(Labels.getLabel("editarTramosController.MSG.suscribirOK"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, + Messagebox.INFORMATION); + + closeWindow(); + + } else { + tramoService.actualizacion(tramo); + tramosList.updateItem(tramo); + + Messagebox.show(Labels.getLabel("editarTramosController.MSG.suscribirOK"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, + Messagebox.INFORMATION); + + closeWindow(); + } + } else { + Messagebox.show(Labels.getLabel("MSG.Registro.Existe.Origem.Destino.Via"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + } + } else { + Messagebox.show(Labels.getLabel("editarTramosController.MSG.OrigemDestinoIguais"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + + if (ex instanceof WrongValueException) { + throw (WrongValueException) ex; + } + + log.error(ex); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) throws InterruptedException { + try { + int resp = Messagebox.show(Labels.getLabel("editarTramosController.MSG.borrarPergunta"), Labels.getLabel("editarTramosController.window.title"), Messagebox.YES + | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + boolean existeCombinacion = rutaCombinacionService.buscarRutaCombinacionExisteTramo(tramo); + boolean existeEsquemaCorrida = esquemaCorridaService.buscarEsquemaCorridaExisteTramo(tramo); + if (existeCombinacion == false && existeEsquemaCorrida == false) { + tramoService.borrar(tramo); + + Messagebox.show(Labels.getLabel("editarTramosController.MSG.borrarOK"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, + Messagebox.INFORMATION); + + tramosList.removeItem(tramo); + + closeWindow(); + } else { + Messagebox.show(Labels.getLabel("editarTramosController.MSG.borrarFalse"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + + } + + } + } catch (WrongValueException ex) { + throw (WrongValueException) ex; + } catch (Exception ex) { + log.error(ex); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("editarTramosController.window.title"), Messagebox.OK, Messagebox.ERROR); + } + } + + public Intbox getTxtnumdiasemana() { + return txtnumdiasemana; + } + + public void setTxtnumdiasemana(Intbox txtnumdiasemana) { + this.txtnumdiasemana = txtnumdiasemana; + } + + public MyListbox getTiempoList() { + return tiempoList; + } + + public void setTiempoList(MyListbox tiempoList) { + this.tiempoList = tiempoList; + } + + public Tramo getTramo() { + return tramo; + } + + public Combobox getCmbClaseServicioTiempo() { + return cmbClaseServicioTiempo; + } + + public void setCmbClaseServicioTiempo(Combobox cmbClaseServicioTiempo) { + this.cmbClaseServicioTiempo = cmbClaseServicioTiempo; + } + + public void setTramo(Tramo tramo) { + this.tramo = tramo; + } + + public List getLsVias() { + return lsVias; + } + + public void setLsVias(List lsVias) { + this.lsVias = lsVias; + } + + public MyListbox getAtributoList() { + return servicioList; + } + + public void setAtributoList(MyListbox atributoList) { + this.servicioList = atributoList; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Timebox getHorafin() { + return horafin; + } + + public void setHorafin(Timebox horafin) { + this.horafin = horafin; + } + + public Timebox getHorainicio() { + return horainicio; + } + + public void setHorainicio(Timebox horainicio) { + this.horainicio = horainicio; + } + + public Checkbox getDom() { + return dom; + } + + public void setDom(Checkbox dom) { + this.dom = dom; + } + + public Checkbox getLun() { + return lun; + } + + public void setLun(Checkbox lun) { + this.lun = lun; + } + + public Checkbox getMar() { + return mar; + } + + public void setMar(Checkbox mar) { + this.mar = mar; + } + + public Checkbox getMie() { + return mie; + } + + public void setMie(Checkbox mie) { + this.mie = mie; + } + + public Checkbox getSab() { + return sab; + } + + public void setSab(Checkbox sab) { + this.sab = sab; + } + + public Checkbox getVie() { + return vie; + } + + public void setVie(Checkbox vie) { + this.vie = vie; + } + + public List getLsEmpresa() { + return lsEmpresa; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarViaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarViaController.java new file mode 100644 index 000000000..19cc915ec --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/EditarViaController.java @@ -0,0 +1,148 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.service.ViaService; +import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarViaController") +@Scope("prototype") +public class EditarViaController extends MyGenericForwardComposer { + + @Autowired + private ViaService viaService; + private Via via; + private MyListbox viaList; + private Textbox txtNome; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarViaController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Via getVia() { + return via; + } + + public void setVia(Via via) { + this.via = via; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + via = (Via) Executions.getCurrent().getArg().get("via"); + viaList = (MyListbox) Executions.getCurrent().getArg().get("viaList"); + + if (via.getViaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) { + txtNome.getValue(); + + try { + via.setActivo(Boolean.TRUE); + via.setFecmodif(Calendar.getInstance().getTime()); + via.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsVias = viaService.buscar(via.getNombvia()); + + if (!lsVias.isEmpty()) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarViaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (via.getViaId() == null) { + viaService.suscribir(via); + viaList.addItem(via); + } else { + viaService.actualizacion(via); + viaList.updateItem(via); + } + + Messagebox.show( + Labels.getLabel("editarViaController.MSG.suscribirOK"), + Labels.getLabel("editarViaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarViaController.MSG.borrarPergunta"), + Labels.getLabel("editarViaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + viaService.borrar(via); + + Messagebox.show( + Labels.getLabel("editarViaController.MSG.borrarOK"), + Labels.getLabel("editarViaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + viaList.removeItem(via); + + closeWindow(); + } + } catch (RegistroConDependenciaException ex) { + Clients.alert(ex.getLocalizedMessage(), + Labels.getLabel("editarViaController.window.title"), + Messagebox.INFORMATION); + } catch (Exception ex) { + log.error(ex); + Clients.alert(Labels.getLabel("MSG.Error"), + Labels.getLabel("editarViaController.window.title"), + Messagebox.INFORMATION); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/GeracionCorridaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/GeracionCorridaController.java new file mode 100644 index 000000000..27020f6d3 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/GeracionCorridaController.java @@ -0,0 +1,167 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.Constante; +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import com.rjconsultores.ventaboletos.entidad.EsquemaOperacional; +import com.rjconsultores.ventaboletos.service.ConstanteService; +import com.rjconsultores.ventaboletos.service.CorridaService; +import com.rjconsultores.ventaboletos.service.EsquemaCorridaService; +import com.rjconsultores.ventaboletos.service.EsquemaOperacionalService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Rafius + */ +@Controller("geracionCorridaController") +@Scope("prototype") +public class GeracionCorridaController extends MyGenericForwardComposer { + + @Autowired + private CorridaService corridaService; + @Autowired + private EsquemaOperacionalService esquemaOperacionalService; + @Autowired + private EsquemaCorridaService esquemaCorridaService; + @Autowired + private ConstanteService constanteService; + private Datebox fec; + private static Logger log = Logger.getLogger(GeracionCorridaController.class); + + public Datebox getFec() { + return fec; + } + + public void setFec(Datebox fec) { + this.fec = fec; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + Constante constante = constanteService.buscarPorNomeConstante("CANT_DIAS_GENERACION_CORRIDA"); + try { + Integer.parseInt(constante.getValorconstante()); + } catch (Exception e) { + log.error(" Generacion de corrida" + e); + Messagebox.show( + Labels.getLabel("geracionCorridaController.MSG.qtdDias", new Object[]{constante.getValorconstante()}), + Labels.getLabel("geracionCorridaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + closeWindow(); + return; + } + + SimpleDateFormat sdfData = new SimpleDateFormat("dd/MM/yyyy"); + int resp = Messagebox.show( + Labels.getLabel("geracionCorridaController.MSG.gerarPergunta", new Object[]{sdfData.format(calcularDataFinal())}), + Labels.getLabel("geracionCorridaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + generarCorridasAutomatica(); + } + closeWindow(); + + } + + public Date calcularDataFinal() throws InterruptedException { + Date dataDe = new Date(); + Constante constante = constanteService.buscarPorNomeConstante("CANT_DIAS_GENERACION_CORRIDA"); + Calendar calendarData = Calendar.getInstance(); + calendarData.setTime(dataDe); + calendarData.add(Calendar.DATE, Integer.parseInt(constante.getValorconstante())); + Date dataAte = calendarData.getTime(); + + return dataAte; + } + + public void generarCorridasAutomatica() throws InterruptedException { + + SimpleDateFormat sdfData = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); + + + Date dataDe = new Date(); +// Date dataDe = null; +// try { +// dataDe = new SimpleDateFormat("dd/MM/yyyy").parse("7/08/2012"); +// } catch (ParseException ex) { +// ex.printStackTrace(); +// } + //Date dataAte = calcularDataFinal(); + Date dataAte = calcularDataFinal(); + dataDe.setSeconds(0); + dataAte.setSeconds(0); + + log.info("** Data De: " + sdfData.format(dataDe) + " **Data Até: " + sdfData.format(dataAte)); + + Calendar calendarData = Calendar.getInstance(); + calendarData.setTime(dataAte); + calendarData.add(Calendar.DATE, 1); + dataAte = calendarData.getTime(); + try { + while (dataDe.before(dataAte)) { + + log.debug("*** Data: " + sdfData.format(dataDe)); + + List lsEsquemaOperacional = + esquemaOperacionalService.dentroVigenciaEsquemaOperacional( + dataDe); + + List lsEsquemaCorrida = new ArrayList(); + for (EsquemaOperacional eo : lsEsquemaOperacional) { + lsEsquemaCorrida.addAll(esquemaCorridaService.buscarPorEsquemaOperacional(eo)); + } + + Boolean dentroVigenciaEsquemaOperacional = !lsEsquemaCorrida.isEmpty(); + if (dentroVigenciaEsquemaOperacional) { + corridaService.generarCorrida(dataDe, lsEsquemaCorrida); + } else { + try { + Messagebox.show( + Labels.getLabel("geracionCorridaController.MSG.ForaVigencia"), + Labels.getLabel("geracionCorridaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + log.error(ex); + } + } + + calendarData.setTime(dataDe); + calendarData.add(Calendar.DATE, 1); + dataDe = calendarData.getTime(); + } + log.debug("*** Corrida gerada com sucesso: "); + + Messagebox.show( + Labels.getLabel("geracionCorridaController.MSG.ok"), + Labels.getLabel("geracionCorridaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + } catch (Exception ex) { + log.error("Erro ao gerar corridas: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error").concat(" \n\n ").concat(ex.toString()), + Labels.getLabel("editarPuntoVentaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/TiempoEstanciaEsquemaTramoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/TiempoEstanciaEsquemaTramoController.java new file mode 100644 index 000000000..29d39241f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/TiempoEstanciaEsquemaTramoController.java @@ -0,0 +1,118 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional; + +import com.rjconsultores.ventaboletos.entidad.EsquemaTramo; +import com.rjconsultores.ventaboletos.entidad.ParadaEsquema; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; + +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Label; +import org.zkoss.zul.Timebox; +import org.zkoss.zul.api.Spinner; + +/** + * + * @author Administrador + */ +@Controller("tiempoEstanciaEsquemaTramoController") +@Scope("prototype") +public class TiempoEstanciaEsquemaTramoController extends MyGenericForwardComposer { + + private MyListbox esquemaTramoList; + private EsquemaTramo esquemaTramo; + private ParadaEsquema paradaEsquema; + private Label lbTramo; + private Spinner spHora; + private Spinner spMinuto; + + public Label getLbTramo() { + return lbTramo; + } + + public void setLbTramo(Label lbTramo) { + this.lbTramo = lbTramo; + } + + public EsquemaTramo getEsquemaTramo() { + return esquemaTramo; + } + + public void setEsquemaTramo(EsquemaTramo esquemaTramo) { + this.esquemaTramo = esquemaTramo; + } + + public ParadaEsquema getParadaEsquema() { + return paradaEsquema; + } + + public void setParadaEsquema(ParadaEsquema paradaEsquema) { + this.paradaEsquema = paradaEsquema; + } + + public Spinner getSpHora() { + return spHora; + } + + public void setSpHora(Spinner spHora) { + this.spHora = spHora; + } + + public Spinner getSpMinuto() { + return spMinuto; + } + + public void setSpMinuto(Spinner spMinuto) { + this.spMinuto = spMinuto; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + esquemaTramo = (EsquemaTramo) Executions.getCurrent().getArg().get("esquemaTramo"); + paradaEsquema = (ParadaEsquema) Executions.getCurrent().getArg().get("paradaEsquema"); + esquemaTramoList = (MyListbox) Executions.getCurrent().getArg().get("esquemaTramoList"); + + String parada = paradaEsquema.getParada().getCveparada(); + String tramo = esquemaTramo.getTramo().getDesctramo(); + lbTramo.setValue(parada); + + if (esquemaTramo.getTiempoEstancia() != null) { + Calendar c = Calendar.getInstance(); + c.setTime(esquemaTramo.getTiempoEstancia()); + System.out.println(DateUtil.getFecInicio().getTime() + " " + c.getTime()); + Long tempo = DateUtil.getElapsedMinutos(DateUtil.getFecInicio().getTime(), c.getTime()); + Long minutos = (tempo % 60); + int horas = (tempo.intValue() / 60); + + spMinuto.setValue(minutos.intValue()); + spHora.setValue(horas); + } + } + + public void onClick$btnCerrar(Event ev) { + closeWindow(); + } + + public void onClick$btnSalvar(Event ev) { + spHora.getValue(); + spMinuto.getValue(); + + esquemaTramo.setTiempoEstancia(DateUtil.getFecInicio(spHora.getValue(), spMinuto.getValue()).getTime()); + paradaEsquema.setTiempoEstancia(DateUtil.getFecInicio(spHora.getValue(), spMinuto.getValue()).getTime()); + + esquemaTramoList.updateItem(paradaEsquema); + + closeWindow(); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/generaciontramosrutas/EditarCombinacionTramoRutaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/generaciontramosrutas/EditarCombinacionTramoRutaController.java new file mode 100644 index 000000000..8e26f68f5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/generaciontramosrutas/EditarCombinacionTramoRutaController.java @@ -0,0 +1,102 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional.generaciontramosrutas; + +import com.rjconsultores.ventaboletos.entidad.Ruta; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Window; + +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.TramoRutaService; +import com.rjconsultores.ventaboletos.service.ViaService; +import com.rjconsultores.ventaboletos.vo.esquemaoperacional.RutaTramoVO; +import com.rjconsultores.ventaboletos.web.gui.componente.esquemaoperacional.GridRutaTramo; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; + +/** + * + * @author Administrador + */ +@Controller("editarCombinacionTramoRutaController") +@Scope("prototype") +public class EditarCombinacionTramoRutaController extends MyGenericForwardComposer { + + @Autowired + private ViaService viaService; + @Autowired + private TramoRutaService tramoRutaService; + private RutaTramoVO rutaTramoIdaVO; + private RutaTramoVO rutaTramoRegresoVO; + private GridRutaTramo gridRutaSecuenciaIda; + private GridRutaTramo gridRutaSecuenciaVolta; + private Window winEditarTramoRuta; + + @Override + public void doAfterCompose(Component comp) throws Exception { + rutaTramoIdaVO = (RutaTramoVO) Executions.getCurrent().getArg().get("rutaTramoVO"); + winEditarTramoRuta = (Window) Executions.getCurrent().getArg().get("winEditarTramoRuta"); + super.doAfterCompose(comp); + gridRutaSecuenciaIda.setMostraPopupGrid(false); + gridRutaSecuenciaIda.setClaseServicio(rutaTramoIdaVO.getClaseServicio()); + gridRutaSecuenciaIda.setLsVias(viaService.obtenerTodos()); + gridRutaSecuenciaIda.agregarTodos(tramoRutaService.generarCombinacion(rutaTramoIdaVO)); + gridRutaSecuenciaVolta.setMostraPopupGrid(false); + gridRutaSecuenciaVolta.setClaseServicio(rutaTramoIdaVO.getClaseServicio()); + gridRutaSecuenciaVolta.setLsVias(viaService.obtenerTodos()); + } + + public void onClick$btnSalvar(Event e) throws InterruptedException { + rutaTramoIdaVO.setLsCombinacionRutaTramoVO(gridRutaSecuenciaIda.getLsSecuenciaRutaTramoVO()); + + try { + Ruta rutaIda = tramoRutaService.generarTramosRutas(rutaTramoIdaVO); + + if (rutaIda != null) { + + Messagebox.show(Labels.getLabel("editarCombinacionTramoRutaController.MSG.rutaIdaGenerada", + new Object[] { rutaIda.getRutaId() + " - " + rutaIda.getDescruta() }), + Labels.getLabel("editarCombinacionTramoRutaController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + + if (!gridRutaSecuenciaVolta.isEmpty()) { + int resp = Messagebox.show(Labels.getLabel("editarCombinacionTramoRutaController.MSG.generarRutaRegreso"), + Labels.getLabel("editarCombinacionTramoRutaController.window.title"), Messagebox.YES | Messagebox.NO, + Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + rutaTramoRegresoVO.setLsCombinacionRutaTramoVO(gridRutaSecuenciaVolta.getLsSecuenciaRutaTramoVO()); + Ruta rutaRegresso = tramoRutaService.generarTramosRutas(rutaTramoRegresoVO); + + if (rutaRegresso != null) { + Messagebox.show(Labels.getLabel("editarCombinacionTramoRutaController.MSG.rutaRegresoGenerada", + new Object[] { rutaRegresso.getRutaId() + " - " + rutaRegresso.getDescruta() }), + Labels.getLabel("editarCombinacionTramoRutaController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + } + } + } + } + + winEditarTramoRuta.detach(); + this.closeWindow(); + } catch (BusinessException e1) { + Messagebox.show(e1.getMessage(), Labels.getLabel("editarCombinacionTramoRutaController.window.title"), Messagebox.OK, + Messagebox.ERROR); + } + + } + + public void onClick$btnRutaRegreso(Event e) { + rutaTramoIdaVO.setLsCombinacionRutaTramoVO(gridRutaSecuenciaIda.getLsSecuenciaRutaTramoVO()); + rutaTramoRegresoVO = tramoRutaService.generarRutaRegreso(rutaTramoIdaVO); + + gridRutaSecuenciaVolta.agregarTodos(rutaTramoRegresoVO.getLsCombinacionRutaTramoVO()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/generaciontramosrutas/EditarTramoRutaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/generaciontramosrutas/EditarTramoRutaController.java new file mode 100644 index 000000000..88262932c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/generaciontramosrutas/EditarTramoRutaController.java @@ -0,0 +1,159 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional.generaciontramosrutas; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; +import org.zkoss.zul.Window; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.RutaEmpresa; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.TramoRutaService; +import com.rjconsultores.ventaboletos.service.ViaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.vo.esquemaoperacional.RutaTramoVO; +import com.rjconsultores.ventaboletos.web.gui.componente.esquemaoperacional.GridRutaTramo; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; + +/** + * + * @author Administrador + */ +@Controller("editarTramoRutaController") +@Scope("prototype") +public class EditarTramoRutaController extends MyGenericForwardComposer { + @Autowired + private ViaService viaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private TramoRutaService tramoRutaService; + @Autowired + private EmpresaService empresaService; + private List lsClaseServicio; + private List lsEmpresa; + private Combobox cmbClaseServicio; + private Checkbox chkVentaHandHeld; + private Checkbox chkSolicitaNombrePasajero; + private Textbox txtDscRuta; + private Window winEditarTramoRuta; + private Combobox cmbEmpresa; + private MyListbox rutaEmpresaList; + private GridRutaTramo gridRutaSecuencia; + private List lsRutaEmpresa; + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsClaseServicio = claseServicioService.obtenerTodos(); + lsEmpresa = empresaService.obtenerIndTipo1(); + lsRutaEmpresa = new ArrayList(); + super.doAfterCompose(comp); + gridRutaSecuencia.setLsVias(viaService.obtenerTodos()); + } + + public void onClick$btnCombinacion(Event e) throws InterruptedException { + + if (lsRutaEmpresa.isEmpty()) { + Messagebox.show(Labels.getLabel("editarTramoRutaController.msg.empresaObligatoria"), + Labels.getLabel("editarTramoRutaController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + + return; + } + + RutaTramoVO rutaTramoVO = new RutaTramoVO(); + rutaTramoVO.setClaseServicio((ClaseServicio) cmbClaseServicio.getSelectedItem().getValue()); + rutaTramoVO.setSolicitaNombrePasajero(chkSolicitaNombrePasajero.isChecked()); + rutaTramoVO.setVentaHandHeld(chkVentaHandHeld.isChecked()); + rutaTramoVO.setLsSecuenciaRutaTramoVO(gridRutaSecuencia.getLsSecuenciaRutaTramoVO()); + rutaTramoVO.setLsEmpresa(lsRutaEmpresa); + + Map params = new LinkedHashMap(); + params.put("rutaTramoVO", rutaTramoVO); + params.put("winEditarTramoRuta", winEditarTramoRuta); + + this.openWindow("/gui/esquema_operacional/generacion_tramo_ruta/editarCombinacionTramoRuta.zul", + Labels.getLabel("editarCombinacionTramoRutaController.window.title"), params, MODAL); + + } + + public void onClick$btnAgregarPaso(Event e) { + cmbClaseServicio.getValue(); + Map params = new LinkedHashMap(); + params.put("gridRutaSecuencia", gridRutaSecuencia); + params.put("origen", gridRutaSecuencia.getUltimaParada()); + params.put("txtDscRuta", txtDscRuta); + + this.openWindow("/gui/esquema_operacional/generacion_tramo_ruta/nuevaParada.zul", + Labels.getLabel("nuevaParadaController.window.title"), params, MODAL); + } + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void onChange$cmbClaseServicio(Event e) { + gridRutaSecuencia.setClaseServicio((ClaseServicio) cmbClaseServicio.getSelectedItem().getValue()); + } + + public void onClick$btnDebugCombinacion(Event e) { + RutaTramoVO rutaTramoVO = new RutaTramoVO(); + rutaTramoVO.setClaseServicio((ClaseServicio) cmbClaseServicio.getSelectedItem().getValue()); + rutaTramoVO.setSolicitaNombrePasajero(chkSolicitaNombrePasajero.isChecked()); + rutaTramoVO.setVentaHandHeld(chkVentaHandHeld.isChecked()); + rutaTramoVO.setLsSecuenciaRutaTramoVO(gridRutaSecuencia.getLsSecuenciaRutaTramoVO()); + + tramoRutaService.generarCombinacion(rutaTramoVO); + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void onClick$btnAdicionarEmpresaRuta(Event ev) throws InterruptedException { + + Comboitem cbiEmpresa = cmbEmpresa.getSelectedItem(); + + if (cbiEmpresa != null) { + Empresa empresa = (Empresa) cbiEmpresa.getValue(); + + if (!lsRutaEmpresa.contains(empresa)) { + lsRutaEmpresa.add(empresa); + rutaEmpresaList.setData(lsRutaEmpresa); + } else { + Messagebox.show(Labels.getLabel("MSG.Registro.Existe"), Labels.getLabel("editarTramoRutaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + } + + public void onClick$btnRemoverEmpresaRuta(Event ev) { + Empresa rutaEmpresa = (Empresa) rutaEmpresaList.getSelected(); + if (rutaEmpresa != null) { + lsRutaEmpresa.remove(rutaEmpresa); + rutaEmpresaList.setData(lsRutaEmpresa); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/generaciontramosrutas/NuevaParadaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/generaciontramosrutas/NuevaParadaController.java new file mode 100644 index 000000000..dc91f94c6 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/esquemaoperacional/generaciontramosrutas/NuevaParadaController.java @@ -0,0 +1,121 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional.generaciontramosrutas; + +import java.util.ArrayList; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.ListModelList; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.service.ViaService; +import com.rjconsultores.ventaboletos.web.gui.componente.esquemaoperacional.GridRutaTramo; +import com.rjconsultores.ventaboletos.web.gui.componente.esquemaoperacional.ParadaExisteException; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; + +/** + * + * @author Administrador + */ +@Controller("nuevaParadaController") +@Scope("prototype") +public class NuevaParadaController extends MyGenericForwardComposer { + + @Autowired + private ViaService viaService; + private GridRutaTramo gridRutaSecuencia; + private MyComboboxParada cmbParadaOrigen; + private MyComboboxParada cmbParadaDestino; + private Combobox cmbVia; + private List lsVias; + private Parada origen; + private Textbox txtDscRuta; + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsVias = viaService.obtenerTodos(); + super.doAfterCompose(comp); + gridRutaSecuencia = (GridRutaTramo) Executions.getCurrent().getArg().get("gridRutaSecuencia"); + origen = (Parada) Executions.getCurrent().getArg().get("origen"); + txtDscRuta = (Textbox) Executions.getCurrent().getArg().get("txtDscRuta"); + + if (origen != null) { + List lsOrigen = new ArrayList(); + lsOrigen.add(origen); + ListModelList listModelList = new ListModelList(lsOrigen); + listModelList.addSelection(origen); + cmbParadaOrigen.setModel(listModelList); + cmbParadaOrigen.setDisabled(true); + cmbParadaDestino.setFocus(true); + } else { + cmbParadaOrigen.setConstraint("no empty"); + cmbParadaOrigen.setFocus(true); + } + + } + + private void validar() { + if (cmbParadaOrigen.getSelectedItem() == null){ + throw new WrongValueException(cmbParadaOrigen, Labels.getLabel("MSG.necesita.origen")); + } + if (cmbParadaDestino.getSelectedItem() == null){ + throw new WrongValueException(cmbParadaDestino, Labels.getLabel("MSG.necesita.destino")); + } + if (cmbVia.getSelectedItem() == null){ + throw new WrongValueException(cmbVia, Labels.getLabel("MSG.necesita.via")); + } + } + + public void onClick$btnSalvar(Event e) throws InterruptedException { + validar(); + + try { + gridRutaSecuencia.agregarSecuencia((Parada) cmbParadaOrigen.getSelectedItem().getValue(), (Parada) cmbParadaDestino + .getSelectedItem().getValue(), (Via) cmbVia.getSelectedItem().getValue()); + + if (txtDscRuta != null) { + String dscOrigen = gridRutaSecuencia.getPrimeraParada().getCveparada(); + String dscDestino = gridRutaSecuencia.getUltimaParada().getCveparada(); + String dscClase = gridRutaSecuencia.getClaseServicio().getDescclase(); + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(dscOrigen); + stringBuilder.append(" - "); + stringBuilder.append(dscDestino); + stringBuilder.append("("); + stringBuilder.append(dscClase); + stringBuilder.append(")"); + + txtDscRuta.setText(stringBuilder.toString()); + } + + } catch (IllegalArgumentException e1) { + Messagebox.show(e1.getMessage(), Labels.getLabel("nuevaParadaController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + } catch (ParadaExisteException e1) { + Messagebox.show(e1.getMessage(), Labels.getLabel("nuevaParadaController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + } + + this.closeWindow(); + } + + public List getLsVias() { + return lsVias; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/informes/InformeCategoriaVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/informes/InformeCategoriaVentaController.java new file mode 100644 index 000000000..d92700d6e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/informes/InformeCategoriaVentaController.java @@ -0,0 +1,245 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.informes; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.InformeCategoriaVentaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import java.io.InputStream; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.media.Media; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Filedownload; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Administrador + */ +@Controller("informeCategoriaVentaController") +@Scope("prototype") +public class InformeCategoriaVentaController extends MyGenericForwardComposer { + + @Autowired + private InformeCategoriaVentaService informeCategoriaVentaService; + @Autowired + private EmpresaService empresaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private RutaService rutaService; + private List lsClaseServico; + private List lsRutas; + private List lsEmpresas; + private Intbox intServicio; + private Datebox fecInicio; + private Datebox fecFinal; + private Combobox cmbClaseServicio; + private Combobox cmbRuta; + private Combobox cmbEmpresa; + private Combobox cmbParadaOrigem; + private Combobox cmbParadaDestino; + private Combobox cmbPuntoVenta; + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public Intbox getIntServicio() { + return intServicio; + } + + public void setIntServicio(Intbox intServicio) { + this.intServicio = intServicio; + } + + public List getLsEmpresas() { + return lsEmpresas; + } + + public void setLsEmpresas(List lsEmpresas) { + this.lsEmpresas = lsEmpresas; + } + + public Combobox getCmbParadaDestino() { + return cmbParadaDestino; + } + + public void setCmbParadaDestino(Combobox cmbParadaDestino) { + this.cmbParadaDestino = cmbParadaDestino; + } + + public Combobox getCmbParadaOrigem() { + return cmbParadaOrigem; + } + + public void setCmbParadaOrigem(Combobox cmbParadaOrigem) { + this.cmbParadaOrigem = cmbParadaOrigem; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Combobox getCmbRuta() { + return cmbRuta; + } + + public void setCmbRuta(Combobox cmbRuta) { + this.cmbRuta = cmbRuta; + } + + public List getLsClaseServico() { + return lsClaseServico; + } + + public void setLsClaseServico(List lsClaseServico) { + this.lsClaseServico = lsClaseServico; + } + + public List getLsRutas() { + return lsRutas; + } + + public void setLsRutas(List lsRutas) { + this.lsRutas = lsRutas; + } + + public Combobox getCmbPuntoVenta() { + return cmbPuntoVenta; + } + + public void setCmbPuntoVenta(Combobox cmbPuntoVenta) { + this.cmbPuntoVenta = cmbPuntoVenta; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEmpresas = empresaService.buscarTodosExceto(-1); + lsClaseServico = claseServicioService.obtenerTodos(); + + super.doAfterCompose(comp); + } + + public void onClick$btnInforme(Event e) throws InterruptedException { + Empresa empresa = null; + Comboitem cbiEmpresa = cmbEmpresa.getSelectedItem(); + if (cbiEmpresa != null) { + empresa = (Empresa) cbiEmpresa.getValue(); + } + + Parada origen = null; + Comboitem cbiOrigen = cmbParadaOrigem.getSelectedItem(); + if (cbiOrigen != null) { + origen = (Parada) cbiOrigen.getValue(); + } + + Parada destino = null; + Comboitem cbiDestino = cmbParadaDestino.getSelectedItem(); + if (cbiDestino != null) { + destino = (Parada) cbiDestino.getValue(); + } + + Ruta ruta = null; + Comboitem cbiRuta = cmbRuta.getSelectedItem(); + if (cbiRuta != null) { + ruta = (Ruta) cbiRuta.getValue(); + } + + PuntoVenta puntoVenta = null; + Comboitem cbiPuntoVenta = cmbPuntoVenta.getSelectedItem(); + if (cbiPuntoVenta != null) { + puntoVenta = (PuntoVenta) cbiPuntoVenta.getValue(); + } + + Integer numServicio = intServicio.getValue(); + Date dataInicio = fecInicio.getValue(); + Date dataFinal = fecFinal.getValue(); + + Map argsInforme = new HashMap(); + argsInforme.put("puntoVenta", puntoVenta); + argsInforme.put("ruta", ruta); + argsInforme.put("numServicio", numServicio); + argsInforme.put("dataInicio", dataInicio); + argsInforme.put("dataFinal", dataFinal); + argsInforme.put("empresa", empresa); + argsInforme.put("origen", origen); + argsInforme.put("destino", destino); + + InputStream is = desktop.getWebApp().getResourceAsStream( + "/gui/informes/categoria_venta/informeCategoriaVenta.jasper"); + try { + Media m = informeCategoriaVentaService.gerarInforme(is, argsInforme); + Filedownload.save(m); + } catch (BusinessException ex) { + Messagebox.show(ex.getLocalizedMessage(), Labels.getLabel("indexController.mnInformes.label"), Messagebox.OK, Messagebox.ERROR); + } + + } + + public void onChange$cmbClaseServicio(Event ev) { + Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem(); + + if (cbiClaseServicio != null) { + ClaseServicio claseServicio = (ClaseServicio) cbiClaseServicio.getValue(); + lsRutas = rutaService.buscarPorClaseServicio(claseServicio); + + cmbRuta.setConstraint(""); + + cmbRuta.setSelectedItem(null); + cmbRuta.setText(null); + + BindingListModelList modelRuta = new BindingListModelList(lsRutas, true); + cmbRuta.setModel(modelRuta); + + cmbRuta.setDisabled(Boolean.FALSE); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/informes/InformePasajeroServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/informes/InformePasajeroServicioController.java new file mode 100644 index 000000000..538074632 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/informes/InformePasajeroServicioController.java @@ -0,0 +1,121 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.informes; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.InformePasajeroServicioService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import java.io.InputStream; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.media.Media; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Filedownload; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Administrador + */ +@Controller("informePasajeroServicioController") +@Scope("prototype") +public class InformePasajeroServicioController extends MyGenericForwardComposer { + + @Autowired + private EmpresaService empresaService; + @Autowired + private MarcaService marcaService; + @Autowired + private InformePasajeroServicioService informePasajeroServicioService; + private List lsEmpresas; + private List lsMarcas; + private Intbox intServicio; + private Datebox fecInicio; + private Datebox fecFinal; + private Combobox cmbMarca; + private Combobox cmbEmpresa; + + public List getLsEmpresas() { + return lsEmpresas; + } + + public void setLsEmpresas(List lsEmpresas) { + this.lsEmpresas = lsEmpresas; + } + + public List getLsMarcas() { + return lsMarcas; + } + + public void setLsMarcas(List lsMarcas) { + this.lsMarcas = lsMarcas; + } + + public Intbox getIntServicio() { + return intServicio; + } + + public void setIntServicio(Intbox intServicio) { + this.intServicio = intServicio; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEmpresas = empresaService.buscarTodosExceto(-1); + lsMarcas = marcaService.buscarTodosExceto(-1); + + super.doAfterCompose(comp); + } + + public void onClick$btnInforme(Event e) throws InterruptedException { + Empresa empresa = null; + Comboitem cbiEmpresa = cmbEmpresa.getSelectedItem(); + if (cbiEmpresa != null) { + empresa = (Empresa) cbiEmpresa.getValue(); + } + + Marca marca = null; + Comboitem cbiMarca = cmbMarca.getSelectedItem(); + if (cbiMarca != null) { + marca = (Marca) cbiMarca.getValue(); + } + + Integer numServicio = intServicio.getValue(); + Date dataInicio = fecInicio.getValue(); + Date dataFinal = fecFinal.getValue(); + + Map argsInforme = new HashMap(); + argsInforme.put("empresa", empresa); + argsInforme.put("marca", marca); + argsInforme.put("numServicio", numServicio); + argsInforme.put("dataInicio", dataInicio); + argsInforme.put("dataFinal", dataFinal); + + InputStream is = desktop.getWebApp().getResourceAsStream( + "/gui/informes/pasajero_servicio/informePasajeroServico.jasper"); + try { + Media m = informePasajeroServicioService.gerarInforme(is, argsInforme); + + Filedownload.save(m); + } catch (BusinessException ex) { + Messagebox.show(ex.getLocalizedMessage(), Labels.getLabel("indexController.mnInformes.label"), Messagebox.OK, Messagebox.ERROR); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/informes/InformeServicioDiarioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/informes/InformeServicioDiarioController.java new file mode 100644 index 000000000..69047cae8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/informes/InformeServicioDiarioController.java @@ -0,0 +1,123 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.informes; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.InformeServicioDiarioService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import java.io.InputStream; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.media.Media; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Filedownload; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Administrador + */ +@Controller("informeServicioDiarioController") +@Scope("prototype") +public class InformeServicioDiarioController extends MyGenericForwardComposer { + + @Autowired + private InformeServicioDiarioService informeServicioDiarioService; + @Autowired + private EmpresaService empresaService; + private List lsEmpresas; + private Intbox intServicio; + private Datebox fecInicio; + private Datebox fecFinal; + private Combobox cmbEmpresa; + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public Intbox getIntServicio() { + return intServicio; + } + + public void setIntServicio(Intbox intServicio) { + this.intServicio = intServicio; + } + + public List getLsEmpresas() { + return lsEmpresas; + } + + public void setLsEmpresas(List lsEmpresas) { + this.lsEmpresas = lsEmpresas; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEmpresas = empresaService.buscarTodosExceto(-1); + + super.doAfterCompose(comp); + } + + public void onClick$btnInforme(Event e) throws InterruptedException { + Empresa empresa = null; + Comboitem cbiEmpresa = cmbEmpresa.getSelectedItem(); + if (cbiEmpresa != null) { + empresa = (Empresa) cbiEmpresa.getValue(); + } + + Integer numServicio = intServicio.getValue(); + Date dataInicio = fecInicio.getValue(); + Date dataFinal = fecFinal.getValue(); + + Map argsInforme = new HashMap(); + argsInforme.put("numServicio", numServicio); + argsInforme.put("dataInicio", dataInicio); + argsInforme.put("dataFinal", dataFinal); + argsInforme.put("empresa", empresa); + + InputStream is = desktop.getWebApp().getResourceAsStream( + "/gui/informes/servicio_diario/informeServicioDiario.jasper"); + try { + Media m = informeServicioDiarioService.gerarInforme(is, argsInforme); + + Filedownload.save(m); + } catch (BusinessException ex) { + Messagebox.show(ex.getLocalizedMessage(), Labels.getLabel("indexController.mnInformes.label"), Messagebox.OK, Messagebox.ERROR); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/informes/InformeVentasPuntoVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/informes/InformeVentasPuntoVentaController.java new file mode 100644 index 000000000..46fd345dd --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/informes/InformeVentasPuntoVentaController.java @@ -0,0 +1,84 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.informes; + +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.InformeVentasPuntoVentaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import java.io.InputStream; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.media.Media; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Filedownload; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Administrador + */ +@Controller("informeVentasPuntoVentaController") +@Scope("prototype") +public class InformeVentasPuntoVentaController extends MyGenericForwardComposer { + + @Autowired + private InformeVentasPuntoVentaService informeVentasPuntoVentaService; + private Datebox fecInicio; + private Datebox fecFinal; + private Combobox cmbPuntoVenta; + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public void onClick$btnInforme(Event e) throws InterruptedException { + PuntoVenta puntoVenta = null; + Comboitem cbiPuntoVenta = cmbPuntoVenta.getSelectedItem(); + + if (cbiPuntoVenta != null) { + puntoVenta = (PuntoVenta) cbiPuntoVenta.getValue(); + } + + Date dataInicio = fecInicio.getValue(); + Date dataFinal = fecFinal.getValue(); + + Map argsInforme = new HashMap(); + argsInforme.put("puntoVenta", puntoVenta); + argsInforme.put("dataInicio", dataInicio); + argsInforme.put("dataFinal", dataFinal); + + InputStream is = desktop.getWebApp().getResourceAsStream("/gui/informes/ventas_puntoventa/informeVentasPuntoVenta.jasper"); + + Media m; + try { + m = informeVentasPuntoVentaService.gerarInforme(is, argsInforme); + + Filedownload.save(m); + } catch (BusinessException ex) { + Messagebox.show(ex.getLocalizedMessage(), Labels.getLabel("indexController.mnInformes.label"), Messagebox.OK, Messagebox.ERROR); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/BusquedaBancoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/BusquedaBancoController.java new file mode 100644 index 000000000..a7e1737f6 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/BusquedaBancoController.java @@ -0,0 +1,177 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.ingreso; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +import com.rjconsultores.ventaboletos.entidad.Banco; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderBanco; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; +import org.zkoss.zul.Intbox; + +/** + * + * @author Rafius + */ +@Controller("busquedaBancoController") +@Scope("prototype") +public class BusquedaBancoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwBanco; + private MyListbox bancoList; + private Paging pagingBanco; + private Intbox idBanco; + private Textbox txtNombre; + private Intbox txtNumCuenta; + private Textbox txtClaveSucursal; + + public MyListbox getBancoList() { + return bancoList; + } + + public void setBancoList(MyListbox bancoList) { + this.bancoList = bancoList; + } + + public Intbox getIdBanco() { + return idBanco; + } + + public void setIdBanco(Intbox idBanco) { + this.idBanco = idBanco; + } + + public Paging getPagingBanco() { + return pagingBanco; + } + + public void setPagingBanco(Paging pagingBanco) { + this.pagingBanco = pagingBanco; + } + + public PagedListWrapper getPlwBanco() { + return plwBanco; + } + + public void setPlwBanco(PagedListWrapper plwBanco) { + this.plwBanco = plwBanco; + } + + public Textbox getTxtClave() { + return txtClaveSucursal; + } + + public void setTxtClave(Textbox txtClave) { + this.txtClaveSucursal = txtClave; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public Intbox getTxtNumCuenta() { + return txtNumCuenta; + } + + public void setTxtNumCuenta(Intbox txtNumCuenta) { + this.txtNumCuenta = txtNumCuenta; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new Banco()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + bancoList.setItemRenderer(new RenderBanco()); + bancoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Banco emp = (Banco) bancoList.getSelected(); + verPeriodo(emp); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verPeriodo(Banco emp) { + if (emp == null) { + return; + } + + Map args = new HashMap(); + args.put("banco", emp); + args.put("bancoList", bancoList); + + openWindow("/gui/ingreso/editarBanco.zul", + Labels.getLabel("editarBancoController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject bancoBusqueda = new HibernateSearchObject(Banco.class, pagingBanco.getPageSize()); + + +// if (idBanco != null) { +// bancoBusqueda.addFilterEqual("bancoId", idBanco.getValue()); +// } +// if (!txtClaveSucursal.getText().isEmpty()) { +// bancoBusqueda.addFilterLike("numcuenta", "%" + txtClaveSucursal.getText().trim().concat("%")); +// } + + + if (txtNumCuenta != null) { + bancoBusqueda.addFilterEqual("numcuenta", txtNumCuenta.getValue()); + } + + bancoBusqueda.addFilterLike("nombbanco", "%" + txtNombre.getText().trim().concat("%")); + + + bancoBusqueda.addFilterEqual("activo", Boolean.TRUE); + bancoBusqueda.addSortAsc("nombbanco"); + + plwBanco.init(bancoBusqueda, bancoList, pagingBanco); + + if (bancoList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaBancoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/BusquedaTipoEventoExtraController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/BusquedaTipoEventoExtraController.java new file mode 100644 index 000000000..7ada103cc --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/BusquedaTipoEventoExtraController.java @@ -0,0 +1,182 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.ingreso; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoEventoExtra; + +/** + * + * @author Rafius + */ +@Controller("busquedaTipoEventoExtraController") +@Scope("prototype") +public class BusquedaTipoEventoExtraController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTipoEventoExtra; + @Autowired + private EmpresaService empresaService; + private List lsEmpresa; + private MyListbox tipoEventoExtraList; + private Paging pagingTipoEventoExtra; + // private Intbox idTipoEventoExtra; + private Textbox txtNombre; + private Combobox cmbIndOperacion; + + public Combobox getCmbIndOperacion() { + return cmbIndOperacion; + } + + public void setCmbIndOperacion(Combobox cmbIndOperacion) { + this.cmbIndOperacion = cmbIndOperacion; + } + + public MyListbox getTipoEventoExtraList() { + return tipoEventoExtraList; + } + + public void setTipoEventoExtraList(MyListbox tipoEventoExtraList) { + this.tipoEventoExtraList = tipoEventoExtraList; + } + + public Paging getPagingTipoEventoExtra() { + return pagingTipoEventoExtra; + } + + public void setPagingTipoEventoExtra(Paging pagingTipoEventoExtra) { + this.pagingTipoEventoExtra = pagingTipoEventoExtra; + } + + public PagedListWrapper getPlwTipoEventoExtra() { + return plwTipoEventoExtra; + } + + public void setPlwTipoEventoExtra( + PagedListWrapper plwTipoEventoExtra) { + this.plwTipoEventoExtra = plwTipoEventoExtra; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPeriodo(new TipoEventoExtra()); + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.buscarTodosExceto(-1); + + super.doAfterCompose(comp); + + tipoEventoExtraList.setItemRenderer(new RenderTipoEventoExtra()); + tipoEventoExtraList.addEventListener("onDoubleClick", + new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TipoEventoExtra emp = (TipoEventoExtra) tipoEventoExtraList + .getSelected(); + verPeriodo(emp); + } + }); + + refreshLista(); + + txtNombre.focus(); + } + + private void verPeriodo(TipoEventoExtra emp) { + if (emp == null) { + return; + } + + Map args = new HashMap(); + args.put("tipoEventoExtra", emp); + args.put("tipoEventoExtraList", tipoEventoExtraList); + + openWindow( + "/gui/ingreso/editarTipoEventoExtra.zul", + Labels.getLabel("editarTipoEventoExtraController.window.title"), + args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject tipoEventoExtraBusqueda = new HibernateSearchObject(TipoEventoExtra.class, pagingTipoEventoExtra.getPageSize()); + + tipoEventoExtraBusqueda.addFilterLike("descTipoEvento", "%" + txtNombre.getText().trim().concat("%")); + if (cmbIndOperacion.getSelectedItem() != null) { + tipoEventoExtraBusqueda.addFilterEqual("indoperacion", Short.parseShort(cmbIndOperacion.getSelectedItem().getValue().toString())); + } + tipoEventoExtraBusqueda.addFilterEqual("activo", Boolean.TRUE); + tipoEventoExtraBusqueda.addSortAsc("descTipoEvento"); + + + plwTipoEventoExtra.init(tipoEventoExtraBusqueda, tipoEventoExtraList, pagingTipoEventoExtra); + + if (tipoEventoExtraList.getData().length == 0) { + try { + Messagebox + .show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTipoEventoExtraController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/EditarBancoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/EditarBancoController.java new file mode 100644 index 000000000..9aeaeffdd --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/EditarBancoController.java @@ -0,0 +1,341 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.ingreso; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Doublebox; +import org.zkoss.zul.Messagebox; + +import com.rjconsultores.ventaboletos.entidad.Banco; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.BancoService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; + +/** + * + * @author Rafius + */ +@Controller("editarBancoController") +@Scope("prototype") +public class EditarBancoController extends MyGenericForwardComposer { + + @Autowired + private BancoService bancoService; + @Autowired + private EmpresaService empresaService; + @Autowired + private PuntoVentaService puntoVentaService; + @Autowired + private MonedaService monedaService; + private List lsEmpresa; + private List lsMoneda; + private List lsPuntoVenta; + private Banco banco; + private MyListbox bancoList; + private static Logger log = Logger.getLogger(EditarBancoController.class); + private MyTextbox txtNome; + private Button btnApagar; + private MyTextbox refContrato; + private MyTextbox concepto; + private MyTextbox algoritmoref; + private Doublebox numcuenta; + private Combobox cmbEmpresa; + private Combobox cmbMoneda; + private MyComboboxPuntoVenta cmbPuntoVenta; + + public Banco getBanco() { + return banco; + } + + public void setBanco(Banco banco) { + this.banco = banco; + } + + public MyTextbox getAlgoritmoref() { + return algoritmoref; + } + + public void setAlgoritmoref(MyTextbox algoritmoref) { + this.algoritmoref = algoritmoref; + } + + public MyListbox getBancoList() { + return bancoList; + } + + public void setBancoList(MyListbox bancoList) { + this.bancoList = bancoList; + } + + public BancoService getBancoService() { + return bancoService; + } + + public void setBancoService(BancoService bancoService) { + this.bancoService = bancoService; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public MyTextbox getConcepto() { + return concepto; + } + + public void setConcepto(MyTextbox concepto) { + this.concepto = concepto; + } + + public static Logger getLog() { + return log; + } + + public static void setLog(Logger log) { + EditarBancoController.log = log; + } + + public Doublebox getNumcuenta() { + return numcuenta; + } + + public void setNumcuenta(Doublebox numcuenta) { + this.numcuenta = numcuenta; + } + + public MyTextbox getRefContrato() { + return refContrato; + } + + public void setRefContrato(MyTextbox refContrato) { + this.refContrato = refContrato; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public Combobox getCmbMoneda() { + return cmbMoneda; + } + + public void setCmbMoneda(Combobox cmbMoneda) { + this.cmbMoneda = cmbMoneda; + } + + public Combobox getCmbPuntoVenta() { + return cmbPuntoVenta; + } + + public void setCmbPuntoVenta(MyComboboxPuntoVenta cmbPuntoVenta) { + this.cmbPuntoVenta = cmbPuntoVenta; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsMoneda() { + return lsMoneda; + } + + public void setLsMoneda(List lsMoneda) { + this.lsMoneda = lsMoneda; + } + + public List getLsPuntoVenta() { + return lsPuntoVenta; + } + + public void setLsPuntoVenta(List lsPuntoVenta) { + this.lsPuntoVenta = lsPuntoVenta; + } + + public MonedaService getMonedaService() { + return monedaService; + } + + public void setMonedaService(MonedaService monedaService) { + this.monedaService = monedaService; + } + + public PuntoVentaService getPuntoVentaService() { + return puntoVentaService; + } + + public void setPuntoVentaService(PuntoVentaService puntoVentaService) { + this.puntoVentaService = puntoVentaService; + } + + private void aplicarMascara() { + //Clients.evalJavaScript("jQuery('#" + numcuenta.getUuid() + "').mask('99999999999');"); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.obtenerTodos(); + lsMoneda = monedaService.obtenerTodos(); + lsPuntoVenta = new ArrayList(); + + super.doAfterCompose(comp); + + banco = (Banco) Executions.getCurrent().getArg().get("banco"); + bancoList = (MyListbox) Executions.getCurrent().getArg() + .get("bancoList"); + + if (banco.getBancoId() != null) { + numcuenta.setText(banco.getNumcuenta().toString()); + if (banco.getPuntoVenta() != null) { + cmbPuntoVenta.setText(banco.getPuntoVenta().getNombpuntoventa()); + } + + } + this.aplicarMascara(); + + txtNome.focus(); + + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + cmbPuntoVenta.getValue(); + cmbEmpresa.getValue(); + cmbMoneda.getValue(); + + txtNome.getValue(); + refContrato.getValue(); + numcuenta.getValue(); + algoritmoref.getValue(); + + try { + + banco.setActivo(Boolean.TRUE); + banco.setFecmodif(Calendar.getInstance().getTime()); + banco.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + banco.setNumcuenta(new BigDecimal(numcuenta.getValue())); + + boolean podeSalvar = true; + + List lsBanco = bancoService.buscar(banco); + + if (lsBanco != null && lsBanco.size() > 0) { + podeSalvar = false; + } + + Comboitem ci = cmbPuntoVenta.getSelectedItem(); + if (ci != null) { + banco.setPuntoVenta((PuntoVenta) cmbPuntoVenta.getSelectedItem().getValue()); + } + banco.setEmpresa((Empresa) cmbEmpresa.getSelectedItem().getValue()); + banco.setMoneda((Moneda) cmbMoneda.getSelectedItem().getValue()); + + if (podeSalvar) { + if (banco.getBancoId() == null) { + bancoService.suscribir(banco); + bancoList.addItem(banco); + } else { + bancoService.actualizacion(banco); + bancoList.updateItem(banco); + } + + Messagebox.show( + Labels.getLabel("editarBancoController.MSG.suscribirOK"), + Labels.getLabel("editarBancoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarBancoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } catch (Exception ex) { + log.error("editarBancoController: " + ex); + Messagebox.show(Labels.getLabel("MSG.Error"), + Labels.getLabel("editarBancoController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox + .show(Labels + .getLabel("editarBancoController.MSG.borrarPergunta"), + Labels.getLabel("editarBancoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + bancoService.borrar(banco); + + Messagebox.show( + Labels.getLabel("editarBancoController.MSG.borrarOK"), + Labels.getLabel("editarBancoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + bancoList.removeItem(banco); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/EditarTipoEventoExtraController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/EditarTipoEventoExtraController.java new file mode 100644 index 000000000..0a160e413 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/ingreso/EditarTipoEventoExtraController.java @@ -0,0 +1,509 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.ingreso; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zkplus.databind.BindingListModel; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Button; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Radiogroup; +import org.zkoss.zul.Row; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.Articulo; +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.entidad.ParamArticulo; +import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.ArticuloService; +import com.rjconsultores.ventaboletos.service.EventoExtraService; +import com.rjconsultores.ventaboletos.service.FormaPagoService; +import com.rjconsultores.ventaboletos.service.ParamArticuloService; +import com.rjconsultores.ventaboletos.service.TipoEventoExtraService; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox; + +/** + * + * @author Rafius + */ +@Controller("editarTipoEventoExtraController") +@Scope("prototype") +public class EditarTipoEventoExtraController extends MyGenericForwardComposer { + + @Autowired + private TipoEventoExtraService tipoEventoExtraService; + @Autowired + private ArticuloService articuloService; + @Autowired + private FormaPagoService formaPagoService; + @Autowired + private ParamArticuloService paramArticuloService; + @Autowired + private EventoExtraService eventoExtraService; + private List lsArticulo; + private List lsFormaPago; + private List lsParamArticulo; + private TipoEventoExtra tipoEventoExtra; + private MyListbox tipoEventoExtraList; + private static Logger log = Logger.getLogger(EditarTipoEventoExtraController.class); + private MyTextbox txtNome; + private Button btnApagar; + private Textbox impMax; + private Textbox porcIva; + private Radio boletoSi; + private Radio ajusteSi; + private Radio boletoNo; + private Radio ajusteNo; + private Checkbox cbValidaCorte; + private Checkbox cbValidaDocumento; + private Checkbox cbContrapartida; + private Checkbox cbOrdenServicio; + private Checkbox cbBoleto; + private Combobox cmbIndOperacion; + private Combobox cmbFormaPago2; + private Combobox cmbParamArticulo; + private Combobox cmbParamArticulo2; + private Radiogroup sv1; + private Radiogroup sv2; + private Row rowParamArticulo; + private Row rowParamArticulo2; + + public Radiogroup getSv1() { + return sv1; + } + + public void setSv1(Radiogroup sv1) { + this.sv1 = sv1; + } + + public Radiogroup getSv2() { + return sv2; + } + + public void setSv2(Radiogroup sv2) { + this.sv2 = sv2; + } + + public List getLsParamArticulo() { + return lsParamArticulo; + } + + public void setLsParamArticulo(List lsParamArticulo) { + this.lsParamArticulo = lsParamArticulo; + } + + public Combobox getCmbParamArticulo() { + return cmbParamArticulo; + } + + public void setCmbParamArticulo(Combobox cmbParamArticulo) { + this.cmbParamArticulo = cmbParamArticulo; + } + + public Combobox getCmbParamArticulo2() { + return cmbParamArticulo2; + } + + public void setCmbParamArticulo2(Combobox cmbParamArticulo2) { + this.cmbParamArticulo2 = cmbParamArticulo2; + } + + public Combobox getCmbFormaPago2() { + return cmbFormaPago2; + } + + public void setCmbFormaPago2(Combobox cmbFormaPago2) { + this.cmbFormaPago2 = cmbFormaPago2; + } + private Combobox cmbFormaPago; + + public TipoEventoExtra getTipoEventoExtra() { + return tipoEventoExtra; + } + + public void setTipoEventoExtra(TipoEventoExtra tipoEventoExtra) { + this.tipoEventoExtra = tipoEventoExtra; + } + + public MyListbox getTipoEventoExtraList() { + return tipoEventoExtraList; + } + + public void setTipoEventoExtraList(MyListbox tipoEventoExtraList) { + this.tipoEventoExtraList = tipoEventoExtraList; + } + + public TipoEventoExtraService getTipoEventoExtraService() { + return tipoEventoExtraService; + } + + public void setTipoEventoExtraService(TipoEventoExtraService tipoEventoExtraService) { + this.tipoEventoExtraService = tipoEventoExtraService; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public static Logger getLog() { + return log; + } + + public static void setLog(Logger log) { + EditarTipoEventoExtraController.log = log; + } + + public MyTextbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(MyTextbox txtNome) { + this.txtNome = txtNome; + } + + public ArticuloService getArticuloService() { + return articuloService; + } + + public void setArticuloService(ArticuloService articuloService) { + this.articuloService = articuloService; + } + + public FormaPagoService getFormaPagoService() { + return formaPagoService; + } + + public void setFormaPagoService(FormaPagoService formaPagoService) { + this.formaPagoService = formaPagoService; + } + + public List getLsArticulo() { + return lsArticulo; + } + + public void setLsArticulo(List lsArticulo) { + this.lsArticulo = lsArticulo; + } + + public List getLsFormaPago() { + return lsFormaPago; + } + + public void setLsFormaPago(List lsFormaPago) { + this.lsFormaPago = lsFormaPago; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsArticulo = articuloService.obtenerTodos(); + lsFormaPago = formaPagoService.obtenerTodos(); + lsParamArticulo = paramArticuloService.obtenerTodos(); + + super.doAfterCompose(comp); + + tipoEventoExtra = (TipoEventoExtra) Executions.getCurrent().getArg().get("tipoEventoExtra"); + tipoEventoExtraList = (MyListbox) Executions.getCurrent().getArg().get("tipoEventoExtraList"); + + if (tipoEventoExtra.getTipoeventoextraId() != null) { + cbContrapartida.setChecked(tipoEventoExtra.getIndcontrapartida()); + cbOrdenServicio.setChecked(tipoEventoExtra.getIndordenservicio()); + cbValidaCorte.setChecked(tipoEventoExtra.getIndvalidacorte()); + cbValidaDocumento.setChecked(tipoEventoExtra.getIndvalidadocumento()); + if (tipoEventoExtra.getIndboleto() == Boolean.TRUE) { + cbBoleto.setChecked(true); + } + + onChange$cmbIndOperacion(null); + + if (tipoEventoExtra.getIndtipo() != null) { + if (tipoEventoExtra.getIndtipo().equals("0")) { + sv1.setSelectedIndex(1); + } else { + sv1.setSelectedIndex(0); + } + } + + if (tipoEventoExtra.getIndtipo2() != null) { + if (tipoEventoExtra.getIndtipo2().equals("0")) { + sv2.setSelectedIndex(1); + } else { + sv2.setSelectedIndex(0); + } + } + } else { + btnApagar.setVisible(false); + } + + // Sino es para exhibir la cuenta contable, no dejo las lines visibles. + if (!exhibirCuentaContable()) { + rowParamArticulo.setVisible(false); + rowParamArticulo2.setVisible(false); + + cmbParamArticulo.setConstraint(""); + } + + txtNome.focus(); + + } + + public void onChange$cmbIndOperacion(Event ev) throws InterruptedException { + if (tipoEventoExtra.getIndoperacion() != null) { + sv1.setSelectedIndex(-1); + sv2.setSelectedIndex(-1); + if (tipoEventoExtra.getIndoperacion().equals(Short.parseShort("1"))) { + cbValidaCorte.setDisabled(true); + cbValidaCorte.setChecked(false); + + cbValidaDocumento.setDisabled(false); + + cbContrapartida.setDisabled(true); + cbContrapartida.setChecked(false); + + cbBoleto.setDisabled(false); + + cbOrdenServicio.setDisabled(true); + cbOrdenServicio.setChecked(false); + + BindingListModel listModelCiudad = new BindingListModelList(new ArrayList(), true); + cmbFormaPago2.setModel(listModelCiudad); + + cmbFormaPago2.setDisabled(true); + + cmbFormaPago2.setSelectedItem(null); + + BindingListModel listModelParmArticulo = new BindingListModelList(new ArrayList(), true); + cmbParamArticulo2.setModel(listModelParmArticulo); + + cmbParamArticulo2.setDisabled(true); + + cmbParamArticulo2.setSelectedItem(null); + + } else if (tipoEventoExtra.getIndoperacion().equals(Short.parseShort("2"))) { + + cbValidaCorte.setDisabled(true); + cbValidaCorte.setChecked(true); + + cbValidaDocumento.setDisabled(false); + + cbContrapartida.setDisabled(true); + cbContrapartida.setChecked(true); + + cbBoleto.setDisabled(true); + cbBoleto.setChecked(false); + + cbOrdenServicio.setDisabled(false); + + BindingListModel listModelCiudad = new BindingListModelList(lsFormaPago, true); + cmbFormaPago2.setModel(listModelCiudad); + cmbFormaPago2.setDisabled(false); + + BindingListModel listModelParmArticulo = new BindingListModelList(lsParamArticulo, true); + cmbParamArticulo2.setModel(listModelParmArticulo); + + cmbParamArticulo2.setDisabled(false); + + cmbParamArticulo2.setSelectedItem(null); + + } else if (tipoEventoExtra.getIndoperacion().equals(Short.parseShort("3"))) { + + cbValidaCorte.setDisabled(true); + cbValidaCorte.setChecked(false); + + cbValidaDocumento.setChecked(true); + cbValidaDocumento.setDisabled(true); + + cbContrapartida.setDisabled(true); + cbContrapartida.setChecked(true); + + cbBoleto.setDisabled(true); + cbBoleto.setChecked(false); + + cbOrdenServicio.setDisabled(true); + cbOrdenServicio.setChecked(false); + + BindingListModel listModelCiudad = new BindingListModelList(lsFormaPago, true); + cmbFormaPago2.setModel(listModelCiudad); + + cmbFormaPago2.setDisabled(false); + + BindingListModel listModelParmArticulo = new BindingListModelList(lsParamArticulo, true); + cmbParamArticulo2.setModel(listModelParmArticulo); + + cmbParamArticulo2.setDisabled(false); + + cmbParamArticulo2.setSelectedItem(null); + } + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + txtNome.getValue(); + impMax.getValue(); + cmbIndOperacion.getValue(); + porcIva.getValue(); + cmbFormaPago.getValue(); + cmbParamArticulo.getValue(); + + if (sv1.getSelectedIndex() == -1) { + Messagebox.show(Labels.getLabel("MSG.necesita.tipoEvento"), Labels.getLabel("editarTipoEventoExtraController.MSG.tipoObligatolia"), Messagebox.OK, + Messagebox.EXCLAMATION); + return; + } + + try { + + if (!cmbFormaPago2.isDisabled() && cmbFormaPago2.getSelectedItem() == null) { + Messagebox.show(Labels.getLabel("MSG.necesita.formaPago"), Labels.getLabel("editarTipoEventoExtraController.MSG.formaPagoObligatolia"), Messagebox.OK, + Messagebox.EXCLAMATION); + return; + } + + if (exhibirCuentaContable()) { + if (cmbIndOperacion.getSelectedItem() != null) { + String indOp = (String) cmbIndOperacion.getSelectedItem().getValue(); + if (!cmbParamArticulo2.isDisabled() && indOp.equals("3")) { + if (cmbParamArticulo2.getSelectedItem() == null) { + Messagebox.show(Labels.getLabel("MSG.necesita.contaContable"), Labels.getLabel("editarTarjetaViajeController.MSG.cuentaContableObligatorio"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + } + } + } + + tipoEventoExtra.setActivo(Boolean.TRUE); + tipoEventoExtra.setFecmodif(Calendar.getInstance().getTime()); + tipoEventoExtra.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsTipoEventoExtra = tipoEventoExtraService.buscar(tipoEventoExtra.getDescTipoEvento()); + boolean podeSalvar = false; + if (lsTipoEventoExtra.isEmpty()) { + podeSalvar = true; + } else { + for (TipoEventoExtra b : lsTipoEventoExtra) { + if (b.getTipoeventoextraId().equals(tipoEventoExtra.getTipoeventoextraId())) { + podeSalvar = true; + } + } + } + if (!podeSalvar) { + Messagebox.show(Labels.getLabel("MSG.Registro.Existe"), Labels.getLabel("editarTipoEventoExtraController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + return; + } else { + + if (sv1.getSelectedIndex() == 0) { + tipoEventoExtra.setIndtipo("1"); + } else { + tipoEventoExtra.setIndtipo("0"); + } + + if (sv2.getSelectedIndex() == -1) { + tipoEventoExtra.setIndtipo2(null); + } else if (sv2.getSelectedIndex() == 0) { + tipoEventoExtra.setIndtipo2("1"); + } else { + tipoEventoExtra.setIndtipo2("0"); + } + + tipoEventoExtra.setFormaPago((FormaPago) cmbFormaPago.getSelectedItem().getValue()); + + tipoEventoExtra.setIndvalidacorte(cbValidaCorte.isChecked()); + tipoEventoExtra.setIndvalidadocumento(cbValidaDocumento.isChecked()); + tipoEventoExtra.setIndcontrapartida(cbContrapartida.isChecked()); + tipoEventoExtra.setIndordenservicio(cbOrdenServicio.isChecked()); + tipoEventoExtra.setIndboleto(cbBoleto.isChecked() ? Boolean.TRUE : Boolean.FALSE); + + tipoEventoExtra.setParamArticulo(cmbParamArticulo.getSelectedItem() == null ? null : (ParamArticulo) cmbParamArticulo.getSelectedItem().getValue()); + tipoEventoExtra.setParamArticulo2(cmbParamArticulo2.getSelectedItem() == null ? null : (ParamArticulo) cmbParamArticulo2.getSelectedItem().getValue()); + + if (tipoEventoExtra.getTipoeventoextraId() == null) { + tipoEventoExtraService.suscribir(tipoEventoExtra); + tipoEventoExtraList.addItem(tipoEventoExtra); + } else { + tipoEventoExtraService.actualizacion(tipoEventoExtra); + tipoEventoExtraList.updateItem(tipoEventoExtra); + } + } + + Messagebox.show(Labels.getLabel("editarTipoEventoExtraController.MSG.suscribirOK"), Labels.getLabel("editarTipoEventoExtraController.window.title"), Messagebox.OK, + Messagebox.INFORMATION); + + closeWindow(); + + } catch (Exception ex) { + log.error("editarTipoEventoExtraController: " + ex); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("editarTipoEventoExtraController.window.title"), Messagebox.OK, Messagebox.ERROR); + } + } + + public void onCheck$sv1(Event ev) { + String indOperacion = null; + if (cmbIndOperacion.getSelectedItem() != null) { + indOperacion = (String) cmbIndOperacion.getSelectedItem().getValue(); + } else { + return; + } + if (!indOperacion.equals("1")) { + if (sv1.getSelectedIndex() == 0) { + sv2.setSelectedIndex(1); + } else { + sv2.setSelectedIndex(0); + } + } + } + + public void onClick$btnApagar(Event ev) throws InterruptedException { + try { + int resp = Messagebox.show(Labels.getLabel("editarTipoEventoExtraController.MSG.borrarPergunta"), + Labels.getLabel("editarTipoEventoExtraController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + tipoEventoExtraService.borrar(tipoEventoExtra); + + Messagebox.show(Labels.getLabel("editarTipoEventoExtraController.MSG.borrarOK"), + Labels.getLabel("editarTipoEventoExtraController.window.title"), Messagebox.OK, + Messagebox.INFORMATION); + + tipoEventoExtraList.removeItem(tipoEventoExtra); + + closeWindow(); + } + + } catch (BusinessException ex) { + Messagebox.show(ex.getLocalizedMessage(), Labels.getLabel("editarTipoEventoExtraController.window.title"), Messagebox.OK, + Messagebox.INFORMATION); + } + } + + private boolean exhibirCuentaContable() { + return ApplicationProperties.getInstance().exhibirCuentaContableTiposEventos(); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/job/GeneracionCorridaJob.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/job/GeneracionCorridaJob.java new file mode 100644 index 000000000..50364867d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/job/GeneracionCorridaJob.java @@ -0,0 +1,43 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.job; + +import org.apache.log4j.Logger; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.context.ApplicationContext; + +import com.rjconsultores.ventaboletos.service.CorridaService; +import com.rjconsultores.ventaboletos.web.utilerias.spring.AppContext; + +/** + * + * @author Rafius + */ +public class GeneracionCorridaJob implements Job { + + private static Logger log = Logger.getLogger(GeneracionCorridaJob.class); + private CorridaService corridaService; + + public CorridaService getCorridaService() { + return corridaService; + } + + public void setCorridaService(CorridaService corridaService) { + this.corridaService = corridaService; + } + + @Override + public void execute(JobExecutionContext jec) throws JobExecutionException { + log.info("Inicio do job de geração de corridas."); + + ApplicationContext appContext = AppContext.getApplicationContext(); + CorridaService cs = (CorridaService) appContext.getBean("corridaService"); + cs.generarCorridaAutomatica(); + + log.info("Fim do job de geração de corridas."); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pagoconductor/ActualizaTarjetaViajeController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pagoconductor/ActualizaTarjetaViajeController.java new file mode 100644 index 000000000..21b3a74ce --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pagoconductor/ActualizaTarjetaViajeController.java @@ -0,0 +1,52 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.pagoconductor; + + +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; + +import com.rjconsultores.ventaboletos.entidad.CorridaTramo; +import com.rjconsultores.ventaboletos.service.CorridaTramoService; +import com.rjconsultores.ventaboletos.service.TarjetaViajeService; +import com.rjconsultores.ventaboletos.web.gui.controladores.catalogos.EditarCiudadController; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; + +@Controller("actualizaTarjetaViajeController") +@Scope("prototype") +public class ActualizaTarjetaViajeController extends MyGenericForwardComposer { + + @Autowired + private CorridaTramoService corridaTramoService; + @Autowired + private TarjetaViajeService tarjetaViajeService; + private static Logger log = Logger.getLogger(ActualizaTarjetaViajeController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + } + + public void onClick$btnActualiazar(Event ev) throws InterruptedException { + try { + List lsCorridaTramo = corridaTramoService.obtenerTramoTarjetaEmitida(); + tarjetaViajeService.grabarTarjetaViaje(lsCorridaTramo); + Messagebox.show( + Labels.getLabel("editarTarjetaController.MSG.suscribirOK"), + Labels.getLabel("importaTarjetaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + log.error("actualizaTarjetaViajeController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("importaTarjetaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pagoconductor/BusquedaTarjetaViajeController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pagoconductor/BusquedaTarjetaViajeController.java new file mode 100644 index 000000000..5f9bc1df2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pagoconductor/BusquedaTarjetaViajeController.java @@ -0,0 +1,176 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.pagoconductor; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Paging; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.TarjetaViaje; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.TarjetaViajeService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTarjetaViaje; + +@Controller("busquedaTarjetaViajeController") +@Scope("prototype") +public class BusquedaTarjetaViajeController extends MyGenericForwardComposer { + + @Autowired + private TarjetaViajeService tarjetaViajeService; + private MyListbox tarjetaViajeList; + private Paging pagingTarjetaViaje; + @Autowired + private transient PagedListWrapper plwTarjetaViaje; + private Datebox fecInicio; + private Datebox fecFinal; + private Combobox cmbEmpresa; + private List lsEmpresa; + @Autowired + private EmpresaService empresaService; + private Intbox autobusIni; + private Intbox autobusFin; + private RenderTarjetaViaje render = new RenderTarjetaViaje(); + + public Intbox getAutobusIni() { + return autobusIni; + } + + public void setAutobusIni(Intbox autobusIni) { + this.autobusIni = autobusIni; + } + + public Intbox getAutobusFin() { + return autobusFin; + } + + public void setAutobusFin(Intbox autobusFin) { + this.autobusFin = autobusFin; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public void onClick$btnNovo(Event ev) { + verTarjetaViaje(new TarjetaViaje()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEmpresa = empresaService.buscarTodosExceto(0); + super.doAfterCompose(comp); + tarjetaViajeList.setItemRenderer(render); + tarjetaViajeList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TarjetaViaje tv = (TarjetaViaje) tarjetaViajeList.getSelected(); + verTarjetaViaje(tv); + } + }); + + //onClick$btnPesquisa(null); + } + + public MyListbox getTarjetaViajeList() { + return tarjetaViajeList; + } + + public void setTarjetaViajeList(MyListbox tarjetaViajeList) { + this.tarjetaViajeList = tarjetaViajeList; + } + + public Paging getPagingTarjetaViaje() { + return pagingTarjetaViaje; + } + + public void setPagingTarjetaViaje(Paging pagingTarjetaViaje) { + this.pagingTarjetaViaje = pagingTarjetaViaje; + } + + public void onClick$btnRefresh(Event ev) throws InterruptedException { + this.refreshLista(); + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + fecInicio.getValue(); + fecFinal.getValue(); + this.refreshLista(); + } + + public void refreshLista() { + List ls = null; + + ls = tarjetaViajeService.buscarTarjetaPorFiltros(autobusIni.getValue(), autobusFin.getValue(), fecInicio.getValue(), fecFinal.getValue(), cmbEmpresa.getSelectedItem()); + boolean todasTarjetas = (autobusIni.getValue() != null && autobusFin.getValue() != null) || (fecInicio.getValue() != null && fecFinal.getValue() != null) || cmbEmpresa.getSelectedItem() != null; + + tarjetaViajeService.verificaCorridaDuplicada(ls, !todasTarjetas); + + tarjetaViajeList.setData(ls); + + if (tarjetaViajeList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaMarcaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + private void verTarjetaViaje(TarjetaViaje tarjeta) { + if (tarjeta == null) { + return; + } + Map args = new HashMap(); + args.put("tarjetaViaje", tarjeta); + args.put("tarjetaViajeList", tarjetaViajeList); + args.put("buesquedaTarjetaController", this); + + openWindow("/gui/pago_conductor/editarTarjetaViaje.zul", + Labels.getLabel("busquedaTarjetaViajeController.window.title"), args, MODAL); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pagoconductor/EditarTarjetaViajeController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pagoconductor/EditarTarjetaViajeController.java new file mode 100644 index 000000000..dcf6f3616 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pagoconductor/EditarTarjetaViajeController.java @@ -0,0 +1,563 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.pagoconductor; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.Autobus; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Conductor; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.TarjetaViaje; +import com.rjconsultores.ventaboletos.service.AutobusService; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.ConductorService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.TarjetaViajeService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; + +@Controller("editarTarjetaViajeController") +@Scope("prototype") +public class EditarTarjetaViajeController extends MyGenericForwardComposer { + + private TarjetaViaje tarjetaViaje; + private MyListbox tarjetaViajeList; + @Autowired + private TarjetaViajeService tarjetaViajeService; + private static Logger log = Logger.getLogger(EditarTarjetaViajeController.class); + private List lsEmpresa; + private List lsAutobus; + private List lsParada; + private List lsClaseServicio; + private List lsConductor; + @Autowired + private EmpresaService empresaService; + @Autowired + private AutobusService autobusService; + @Autowired + private ParadaService paradaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private ConductorService conductorService; + private Intbox txtCorrida; + private Datebox fecTarjeta; + private Textbox txtOrigen; + private Textbox txtDestino; + private Combobox cmbEmpresa; + private Combobox cmbAutobus; + private Combobox cmbRuta; + private Intbox kms; + private Combobox cmbClaseServicio; + private Combobox cmbConductor; + private Combobox cmbConductor1; + private Intbox kmsOperador; + private Button btnBusquedaCorrida; + private Button btnNovo; + private Button btnSalvar; + private List lsMarca; + private BigDecimal tarjetaViajeRef; + private TarjetaViaje tarjetaViajeAux; + private Combobox cmbMarcas; + @Autowired + private MarcaService marcaService; + private Combobox cmbSecuencia; + private List lsSecuencia; + private BusquedaTarjetaViajeController busquedaTarjetaViajeController; + private Button btnApagar; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public List getLsSecuencia() { + return lsSecuencia; + } + + public void setLsSecuencia(List lsSecuencia) { + this.lsSecuencia = lsSecuencia; + } + + public Combobox getCmbSecuencia() { + return cmbSecuencia; + } + + public void setCmbSecuencia(Combobox cmbSecuencia) { + this.cmbSecuencia = cmbSecuencia; + } + + public List getLsMarca() { + return lsMarca; + } + + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + public MarcaService getMarcaService() { + return marcaService; + } + + public void setMarcaService(MarcaService marcaService) { + this.marcaService = marcaService; + } + + public Combobox getCmbMarcas() { + return cmbMarcas; + } + + public void setCmbMarcas(Combobox cmbMarcas) { + this.cmbMarcas = cmbMarcas; + } + + public Button getBtnSalvar() { + return btnSalvar; + } + + public void setBtnSalvar(Button btnSalvar) { + this.btnSalvar = btnSalvar; + } + + public BigDecimal getTarjetaViajeRef() { + return tarjetaViajeRef; + } + + public void setTarjetaViajeRef(BigDecimal tarjetaViajeRef) { + this.tarjetaViajeRef = tarjetaViajeRef; + } + + public Button getBtnNovo() { + return btnNovo; + } + + public void setBtnNovo(Button btnNovo) { + this.btnNovo = btnNovo; + } + + public Button getBtnBusquedaCorrida() { + return btnBusquedaCorrida; + } + + public void setBtnBusquedaCorrida(Button btnBusquedaCorrida) { + this.btnBusquedaCorrida = btnBusquedaCorrida; + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public Combobox getCmbAutobus() { + return cmbAutobus; + } + + public void setCmbAutobus(Combobox cmbAutobus) { + this.cmbAutobus = cmbAutobus; + } + + public Combobox getCmbRuta() { + return cmbRuta; + } + + public void setCmbRuta(Combobox cmbRuta) { + this.cmbRuta = cmbRuta; + } + + public Intbox getKms() { + return kms; + } + + public void setKms(Intbox kms) { + this.kms = kms; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Combobox getCmbConductor() { + return cmbConductor; + } + + public void setCmbConductor(Combobox cmbConductor) { + this.cmbConductor = cmbConductor; + } + + public Combobox getCmbConductor1() { + return cmbConductor1; + } + + public void setCmbConductor1(Combobox cmbConductor1) { + this.cmbConductor1 = cmbConductor1; + } + + public Intbox getKmsOperador() { + return kmsOperador; + } + + public void setKmsOperador(Intbox kmsOperador) { + this.kmsOperador = kmsOperador; + } + + public Textbox getTxtOrigen() { + return txtOrigen; + } + + public void setTxtOrigen(Textbox txtOrigen) { + this.txtOrigen = txtOrigen; + } + + public Textbox getTxtDestino() { + return txtDestino; + } + + public void setTxtDestino(Textbox txtDestino) { + this.txtDestino = txtDestino; + } + + public Intbox getTxtCorrida() { + return txtCorrida; + } + + public void setTxtCorrida(Intbox txtCorrida) { + this.txtCorrida = txtCorrida; + } + + public TarjetaViaje getTarjetaViaje() { + return tarjetaViaje; + } + + public void setTarjetaViaje(TarjetaViaje tarjeta) { + this.tarjetaViaje = tarjeta; + } + + public MyListbox getTarjetaViajeList() { + return tarjetaViajeList; + } + + public void setTarjetaViajeList(MyListbox tarjetaViajeList) { + this.tarjetaViajeList = tarjetaViajeList; + } + + public TarjetaViajeService getTarjetaViajeService() { + return tarjetaViajeService; + } + + public void setTarjetaViajeService(TarjetaViajeService tarjetaViajeService) { + this.tarjetaViajeService = tarjetaViajeService; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsAutobus() { + return lsAutobus; + } + + public void setLsAutobus(List lsAutobus) { + this.lsAutobus = lsAutobus; + } + + public List getLsParada() { + return lsParada; + } + + public void setLsParada(List lsParada) { + this.lsParada = lsParada; + } + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + public List getLsConductor() { + return lsConductor; + } + + public void setLsConductor(List lsConductor) { + this.lsConductor = lsConductor; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public AutobusService getAutobusService() { + return autobusService; + } + + public void setAutobusService(AutobusService autobusService) { + this.autobusService = autobusService; + } + + public ParadaService getParadaService() { + return paradaService; + } + + public void setParadaService(ParadaService paradaService) { + this.paradaService = paradaService; + } + + public ClaseServicioService getClaseServicioService() { + return claseServicioService; + } + + public void setClaseServicioService(ClaseServicioService claseServicioService) { + this.claseServicioService = claseServicioService; + } + + public ConductorService getConductorService() { + return conductorService; + } + + public void setConductorService(ConductorService conductorService) { + this.conductorService = conductorService; + } + + public Datebox getFecTarjeta() { + return fecTarjeta; + } + + public void setFecTarjeta(Datebox fecTarjeta) { + this.fecTarjeta = fecTarjeta; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + tarjetaViaje = (TarjetaViaje) Executions.getCurrent().getArg().get("tarjetaViaje"); + tarjetaViajeList = (MyListbox) Executions.getCurrent().getArg().get("tarjetaViajeList"); + tarjetaViajeAux = (TarjetaViaje) Executions.getCurrent().getArg().get("tarjetaViajeAux"); + busquedaTarjetaViajeController = (BusquedaTarjetaViajeController) Executions.getCurrent().getArg().get("buesquedaTarjetaController"); + if (tarjetaViaje == null) { + tarjetaViaje = tarjetaViajeAux; + } + super.doAfterCompose(comp); + if (tarjetaViaje.getTarjetaviajeId() != null) { + if ((tarjetaViaje.getIndstatustarjeta().equals("N") || tarjetaViaje.getIndstatustarjeta().equals("S")) && tarjetaViaje.getFecenvionomina() == null) { + cmbEmpresa.setDisabled(true); + kms.setDisabled(true); + cmbClaseServicio.setDisabled(true); + kmsOperador.setDisabled(true); + cmbMarcas.setDisabled(true); + cmbAutobus.setDisabled(false); + txtOrigen.setDisabled(true); + txtDestino.setDisabled(true); + txtCorrida.setDisabled(true); + fecTarjeta.setDisabled(true); + cmbSecuencia.setDisabled(true); + btnBusquedaCorrida.setVisible(false); + } else if (tarjetaViaje.getIndstatustarjeta().equals("B") || tarjetaViaje.getFecenvionomina() != null) { + if (tarjetaViaje.getFecenvionomina() != null) { + btnNovo.setDisabled(true); + } else if (tarjetaViaje.getIndstatustarjeta().equals("B")) { + btnNovo.setDisabled(false); + } + btnBusquedaCorrida.setVisible(false); + cmbSecuencia.setDisabled(true); + btnApagar.setVisible(false); + cmbMarcas.setDisabled(true); + txtOrigen.setDisabled(true); + txtDestino.setDisabled(true); + fecTarjeta.setDisabled(true); + txtCorrida.setDisabled(true); + cmbAutobus.setDisabled(true); + cmbConductor.setDisabled(true); + cmbConductor1.setDisabled(true); + cmbEmpresa.setDisabled(true); + cmbClaseServicio.setDisabled(true); + kms.setDisabled(true); + kmsOperador.setDisabled(true); + btnNovo.setVisible(true); + btnSalvar.setVisible(false); + } + if (tarjetaViaje.getFecHorSalida()!= null) { + fecTarjeta.setValue(tarjetaViaje.getFecHorSalida()); + } + } + lsSecuencia = new ArrayList(); + lsSecuencia.add(Labels.getLabel("editarTarjetaController.primaria").toUpperCase()); + lsSecuencia.add(Labels.getLabel("editarTarjetaController.secundaria").toUpperCase()); + if (tarjetaViaje.getNumsecuencia() != null) { + Comboitem item = new Comboitem(); + item.setValue(getDescSeq(tarjetaViaje.getNumsecuencia().shortValue()).toUpperCase()); + item.setLabel(getDescSeq(tarjetaViaje.getNumsecuencia().shortValue()).toUpperCase()); + item.setParent(cmbSecuencia); + cmbSecuencia.setSelectedItem(item); + } + lsMarca = marcaService.buscarDescricaoIdMarca(); + lsEmpresa = empresaService.buscarTodosExceto(-1); + lsAutobus = autobusService.obtenerTodos(); + lsParada = paradaService.obtenerTodos(); + lsClaseServicio = claseServicioService.buscarTodosExceto(-1); + lsConductor = conductorService.obtenerTodos(); + } + + private String getDescSeq(Short numSeq) { + if (numSeq == null) { + return ""; + } + + if (numSeq.shortValue() == 1) { + return Labels.getLabel("editarTarjetaController.primaria"); + } else { + return Labels.getLabel("editarTarjetaController.secundaria"); + } + } + + public void onClick$btnBusquedaCorrida(Event ev) { + Map args = new HashMap(); + args.put("tarjetaViaje", tarjetaViaje); + args.put("editarTarjetaViajeController", this); + + openWindow("/gui/pago_conductor/busquedaCorridaTarjetaViaje.zul", + Labels.getLabel("editarPricingController.windowCorrida.title"), + args, MODAL); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + cmbEmpresa.getValue(); + cmbAutobus.getValue(); + txtCorrida.getValue(); + txtOrigen.getValue(); + txtDestino.getValue(); + fecTarjeta.getValue(); + kms.getValue(); + cmbClaseServicio.getValue(); + cmbConductor.getValue(); + kmsOperador.getValue(); + try { + if (tarjetaViajeAux != null) { + if (cmbSecuencia.getSelectedItem() != null) { + String sec = (String) cmbSecuencia.getSelectedItem().getValue(); + if (sec.toUpperCase().equals(Labels.getLabel("editarTarjetaController.primaria").toUpperCase())) { + tarjetaViajeAux.setNumsecuencia(1); + } else { + tarjetaViajeAux.setNumsecuencia(2); + } + } + tarjetaViajeAux.setIndstatustarjeta("M"); + tarjetaViajeAux.setFoliotarjetaviaje(null); + tarjetaViajeAux.setFecenvionomina(null); + tarjetaViajeAux.setFecmodif(new Date()); + tarjetaViajeAux.setMarca(cmbMarcas.getSelectedItem() != null ? (Marca) cmbMarcas.getSelectedItem().getValue() : null); + tarjetaViajeAux.setEmpresa(cmbEmpresa.getSelectedItem() != null ? (Empresa) cmbEmpresa.getSelectedItem().getValue() : null); + tarjetaViajeAux.setConductor((Conductor) cmbConductor.getSelectedItem().getValue()); + if (cmbConductor1.getSelectedItem() != null) { + tarjetaViajeAux.setConductor1((Conductor) cmbConductor1.getSelectedItem().getValue()); + } else { + tarjetaViajeAux.setConductor1(null); + } + tarjetaViajeAux.setClaseServicio(cmbClaseServicio.getSelectedItem() != null ? (ClaseServicio) cmbClaseServicio.getSelectedItem().getValue() : null); + tarjetaViajeAux.setAutobus(cmbAutobus.getSelectedItem() != null ? (Autobus) cmbAutobus.getSelectedItem().getValue() : null); + tarjetaViajeAux.setKmPagoConductor(new BigDecimal(kms.getValue()).setScale(0)); + tarjetaViajeAux.setKmReal(new BigDecimal(kms.getValue()).setScale(0)); + tarjetaViajeAux.setOrigen(txtOrigen.getValue()); + tarjetaViajeAux.setDestino(txtDestino.getValue()); + tarjetaViajeAux.setNumCorrida(txtCorrida.getValue()); + tarjetaViajeAux.setFecHorSalida(fecTarjeta.getValue()); + tarjetaViajeAux.setFecInicial(fecTarjeta.getValue()); + tarjetaViajeService.suscribir(tarjetaViajeAux); + busquedaTarjetaViajeController.refreshLista(); + } else { + tarjetaViaje.setIndstatustarjeta("S"); + tarjetaViajeService.actualizacion(tarjetaViaje); + busquedaTarjetaViajeController.refreshLista(); + } + Messagebox.show(Labels.getLabel("editarTarjetaController.MSG.suscribirOK"), + Labels.getLabel("busquedaTarjetaViajeController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } catch (Exception ex) { + log.error("editarTarjetaController: " + ex); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("busquedaTarjetaViajeController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnNovo(Event e) { + if (tarjetaViaje == null) { + return; + } + Map args = new HashMap(); + TarjetaViaje t = new TarjetaViaje(); + t.setTarjetaViajeRef(new BigDecimal(tarjetaViaje.getTarjetaviajeId())); + t.setIndRebote(tarjetaViaje.getIndRebote()); + args.put("tarjetaViajeAux", t); + args.put("tarjetaViajeList", tarjetaViajeList); + args.put("buesquedaTarjetaController", busquedaTarjetaViajeController); + openWindow("/gui/pago_conductor/editarTarjetaViaje.zul", + Labels.getLabel("busquedaTarjetaViajeController.window.title"), args, MODAL); + this.closeWindow(); + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show(Labels.getLabel("editarTarjetaViajeController.MSG.borrarPergunta"), + Labels.getLabel("editarTarjetaViajeController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + tarjetaViajeService.borrar(tarjetaViaje); + + Messagebox.show(Labels.getLabel("editarTarjetaViajeController.MSG.borrarOK"), + Labels.getLabel("editarTarjetaViajeController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + tarjetaViajeList.updateItem(tarjetaViaje); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pagoconductor/EnvioNominaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pagoconductor/EnvioNominaController.java new file mode 100644 index 000000000..57710e768 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pagoconductor/EnvioNominaController.java @@ -0,0 +1,60 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.pagoconductor; + +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Datebox; + +import com.rjconsultores.ventaboletos.entidad.TarjetaViaje; +import com.rjconsultores.ventaboletos.service.TarjetaViajeService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; + +@Controller("envioTarjetaNominaController") +@Scope("prototype") +public class EnvioNominaController extends MyGenericForwardComposer { + + private Datebox fecInicio; + private Datebox fecFinal; + @Autowired + private TarjetaViajeService tarjetaViajeService; + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public void onClick$btnEnviar(Event ev) throws InterruptedException { + List ls = tarjetaViajeService.generarArchivoNomina(fecInicio.getValue(), fecFinal.getValue()); + if (ls != null && ls.size() > 0) { + tarjetaViajeService.actulizarTarjetasEnviadas(ls); + Messagebox.show(Labels.getLabel("envioNominaControllerController.MSG.enviarOK"), Labels.getLabel("busquedaTarjetaViajeController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + closeWindow(); + } else { + Messagebox.show(Labels.getLabel("envioNominaControllerController.MSG.noHayArchivosOK"), Labels.getLabel("busquedaTarjetaViajeController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/BusquedaPricingController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/BusquedaPricingController.java new file mode 100644 index 000000000..70c5896f5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/BusquedaPricingController.java @@ -0,0 +1,264 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.PricingService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricing; + +/** + * + * @author Rafius + */ +@Controller("busquedaPricingController") +@Scope("prototype") +public class BusquedaPricingController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwPricingPunto; + @Autowired + private PricingService pricingService; + @Autowired + private EmpresaService empresaService; + private MyListbox pricingList; + private Paging pagingPricing; + private List lsPricing; + private List lsEmpresa; + private Combobox cmbEmpresa; + private Textbox txtNome; + private Datebox fechaInicio; + private Datebox fechaFin; + private static Logger log = Logger + .getLogger(BusquedaPricingController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.obtenerIndTipo1(); + + super.doAfterCompose(comp); + + pricingList.setItemRenderer(new RenderPricing()); + pricingList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Pricing pricing = (Pricing) pricingList.getSelected(); + verPricing(pricing); + } + }); + + lsPricing = new ArrayList(); + + refreshLista(); + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPricing(new Pricing()); + } + + private void refreshLista() { + Empresa empresa = (Empresa) (cmbEmpresa.getSelectedItem() != null ? cmbEmpresa + .getSelectedItem().getValue() : null); + + HibernateSearchObject pricingSearch = new HibernateSearchObject( + Pricing.class, pagingPricing.getPageSize()); + + if (empresa != null) { + pricingSearch.addFilterEqual("empresa", empresa); + } + + if (!txtNome.getValue().isEmpty()) { + pricingSearch.addFilterILike("nombPricing", txtNome.getValue() + + "%"); + } + + if (fechaInicio.getValue() != null) { + pricingSearch.addFilterGreaterOrEqual( + "pricingVigenciaList.fecinicioviaje", fechaInicio.getValue()); + } + if (fechaFin.getValue() != null) { + pricingSearch.addFilterLessOrEqual( + "pricingVigenciaList.fecfinviaje", fechaFin.getValue()); + } + + pricingSearch.addFilterEqual("activo", Boolean.TRUE); + + pricingSearch.addSortAsc("nombPricing"); + + plwPricingPunto.init(pricingSearch, pricingList, pagingPricing); + + if (pricingList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), Labels + .getLabel("busquedaPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + private void verPricing(Pricing pricing) { + if (pricing == null) { + return; + } + + Map args = new HashMap(); + args.put("pricing", pricing); + args.put("gravarNovo", pricing.getPricingId() == null); + args.put("pricingList", pricingList); + + openWindow("/gui/pricing/editarPricing.zul", + Labels.getLabel("editarPricingController.window.title"), args, + MODAL); + } + + public void onClick$btnApagar(Event ev) { + try { + Pricing p = (Pricing) pricingList.getSelected(); + if (p != null) { + int resp = Messagebox + .show(Labels + .getLabel("editarPricingController.MSG.borrarPergunta"), + Labels.getLabel("busquedaPricingController.window.title"), + Messagebox.YES | Messagebox.NO, + Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingService.borrar(p); + Messagebox + .show(Labels + .getLabel("editarPricingController.MSG.borrarOK"), + Labels.getLabel("busquedaPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + pricingList.removeItem(p); + } + } else { + Messagebox + .show(Labels + .getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("busquedaPricingController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error("Erro ao eliminar Pricing: " + ex); + } + } + + public List getLsPricing() { + return lsPricing; + } + + public void setLsPricing(List lsPricing) { + this.lsPricing = lsPricing; + } + + public Paging getPagingPricing() { + return pagingPricing; + } + + public void setPagingPricing(Paging pagingPricing) { + this.pagingPricing = pagingPricing; + } + + public PagedListWrapper getPlwPricingPunto() { + return plwPricingPunto; + } + + public void setPlwPricingPunto(PagedListWrapper plwPricingPunto) { + this.plwPricingPunto = plwPricingPunto; + } + + public MyListbox getPricingList() { + return pricingList; + } + + public void setPricingList(MyListbox pricingList) { + this.pricingList = pricingList; + } + + public PricingService getPricingService() { + return pricingService; + } + + public void setPricingService(PricingService pricingService) { + this.pricingService = pricingService; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Datebox getFechaInicio() { + return fechaInicio; + } + + public void setFechaInicio(Datebox fechaInicio) { + this.fechaInicio = fechaInicio; + } + + public Datebox getFechaFin() { + return fechaFin; + } + + public void setFechaFin(Datebox fechaFin) { + this.fechaFin = fechaFin; + } + + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/BusquedaPricingEspecificoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/BusquedaPricingEspecificoController.java new file mode 100644 index 000000000..fbae41e12 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/BusquedaPricingEspecificoController.java @@ -0,0 +1,516 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.PricingEspecifico; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.service.CategoriaService; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingEspecifico; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Cássio Rocha + */ +@Controller("busquedaPricingEspecificoController") +@Scope("prototype") +public class BusquedaPricingEspecificoController extends MyGenericForwardComposer { + + @Autowired + private MarcaService marcaService; + @Autowired + private MonedaService monedaService; + @Autowired + private CategoriaService categoriaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private ParadaService paradaService; + @Autowired + private TipoPuntoVentaService puntoVentaService; + private List lsMarca; + private List lsMoneda; + private List lsCategoria; + private List lsClaseServicio; + private List lsPtovata; + private MyListbox pricingList; + private Paging pagingPricing; + @Autowired + private transient PagedListWrapper plwPricingEspecifico; + private Combobox cmbMarca; + private Combobox cmbMoneda; + private Combobox cmbTipoPassageiro; + private Combobox cmbTipoServicio; + private Combobox cmbPtovta; + private Combobox cmbOrigem; + private Combobox cmbDestino; + private Datebox fechaInicio; + private Datebox fechaFin; + private Textbox txtNombrePricing; + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsMarca = marcaService.obtenerTodos(); + lsMoneda = monedaService.obtenerTodos(); + lsCategoria = categoriaService.obtenerTodos(); + lsClaseServicio = claseServicioService.obtenerTodos(); + lsPtovata = puntoVentaService.obtenerTodos(); + + super.doAfterCompose(comp); + + pricingList.setItemRenderer(new RenderPricingEspecifico()); + pricingList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingEspecifico pricingEspecifico = (PricingEspecifico) pricingList.getSelected(); + verPricing(pricingEspecifico); + } + }); + + txtNombrePricing.focus(); + refreshLista(); + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verPricing(new PricingEspecifico()); + } + + private void refreshLista() { + HibernateSearchObject pricingSearch = + new HibernateSearchObject(PricingEspecifico.class, pagingPricing.getPageSize()); + pricingSearch.addFilterEqual("activo", Boolean.TRUE); + + Marca marca = (Marca) (cmbMarca.getSelectedItem() != null ? cmbMarca.getSelectedItem().getValue() : null); + Moneda moneda = (Moneda) (cmbMoneda.getSelectedItem() != null ? cmbMoneda.getSelectedItem().getValue() : null); + Categoria categoria = (Categoria) (cmbTipoPassageiro.getSelectedItem() != null ? cmbTipoPassageiro.getSelectedItem().getValue() : null); + ClaseServicio claseServicio = (ClaseServicio) (cmbTipoServicio.getSelectedItem() != null ? cmbTipoServicio.getSelectedItem().getValue() : null); + TipoPuntoVenta tipoPuntoVenta = (TipoPuntoVenta) (cmbPtovta.getSelectedItem() != null ? cmbPtovta.getSelectedItem().getValue() : null); + Parada parada = (Parada) (cmbOrigem.getSelectedItem() != null ? cmbOrigem.getSelectedItem().getValue() : null); + Parada parada1 = (Parada) (cmbDestino.getSelectedItem() != null ? cmbDestino.getSelectedItem().getValue() : null); + + if (fechaInicio.getValue() != null) { + pricingSearch.addFilterGreaterOrEqual("fechorinicio", fechaInicio.getValue()); + } + + if (fechaFin.getValue() != null) { + pricingSearch.addFilterLessOrEqual("fechorfin", fechaFin.getValue()); + } + + if (parada != null) { + pricingSearch.addFilterEqual("parada", parada); + } + + if (parada1 != null) { + pricingSearch.addFilterEqual("parada1", parada1); + } + + if (tipoPuntoVenta != null) { + pricingSearch.addFilterEqual("tipoPtovta", tipoPuntoVenta); + } + + if (marca != null) { + pricingSearch.addFilterEqual("marca", marca); + } + if (moneda != null) { + pricingSearch.addFilterEqual("moneda", moneda); + } + if (categoria != null) { + pricingSearch.addFilterEqual("categoria", categoria); + } + if (claseServicio != null) { + pricingSearch.addFilterEqual("claseServicio", claseServicio); + } + + String nomePricing = txtNombrePricing.getText().trim(); + if (!nomePricing.isEmpty()) { + pricingSearch.addFilterILike("nombPricing", "%" + nomePricing + "%"); + } + + pricingSearch.addSortAsc("nombPricing"); + + plwPricingEspecifico.init(pricingSearch, pricingList, pagingPricing); + + if (pricingList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + private void verPricing(PricingEspecifico pricingEspecifico) { + if (pricingEspecifico == null) { + return; + } + + Map args = new HashMap(); + args.put("pricingEspecifico", pricingEspecifico); + args.put("pricingList", pricingList); + + openWindow("/gui/pricing/editarPricingEspecifico.zul", + Labels.getLabel("busquedaPricingEspecificoController.window.title"), args, MODAL); + } + + /** + * @return the lsMarca + */ + public List getLsMarca() { + return lsMarca; + } + + /** + * @param lsMarca the lsMarca to set + */ + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + /** + * @return the lsMoneda + */ + public List getLsMoneda() { + return lsMoneda; + } + + /** + * @param lsMoneda the lsMoneda to set + */ + public void setLsMoneda(List lsMoneda) { + this.lsMoneda = lsMoneda; + } + + /** + * @return the pricingList + */ + public MyListbox getPricingList() { + return pricingList; + } + + /** + * @param pricingList the pricingList to set + */ + public void setPricingList(MyListbox pricingList) { + this.pricingList = pricingList; + } + + /** + * @return the pagingPricing + */ + public Paging getPagingPricing() { + return pagingPricing; + } + + /** + * @param pagingPricing the pagingPricing to set + */ + public void setPagingPricing(Paging pagingPricing) { + this.pagingPricing = pagingPricing; + } + + /** + * @return the marcaService + */ + public MarcaService getMarcaService() { + return marcaService; + } + + /** + * @param marcaService the marcaService to set + */ + public void setMarcaService(MarcaService marcaService) { + this.marcaService = marcaService; + } + + /** + * @return the monedaService + */ + public MonedaService getMonedaService() { + return monedaService; + } + + /** + * @param monedaService the monedaService to set + */ + public void setMonedaService(MonedaService monedaService) { + this.monedaService = monedaService; + } + + /** + * @return the plwPricingEspecifico + */ + public PagedListWrapper getPlwPricingEspecifico() { + return plwPricingEspecifico; + } + + /** + * @param plwPricingEspecifico the plwPricingEspecifico to set + */ + public void setPlwPricingEspecifico(PagedListWrapper plwPricingEspecifico) { + this.plwPricingEspecifico = plwPricingEspecifico; + } + + /** + * @return the lsCategoria + */ + public List getLsCategoria() { + return lsCategoria; + } + + /** + * @param lsCategoria the lsCategoria to set + */ + public void setLsCategoria(List lsCategoria) { + this.lsCategoria = lsCategoria; + } + + /** + * @return the lsClaseServicio + */ + public List getLsClaseServicio() { + return lsClaseServicio; + } + + /** + * @param lsClaseServicio the lsClaseServicio to set + */ + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + /** + * @return the categoriaService + */ + public CategoriaService getCategoriaService() { + return categoriaService; + } + + /** + * @param categoriaService the categoriaService to set + */ + public void setCategoriaService(CategoriaService categoriaService) { + this.categoriaService = categoriaService; + } + + /** + * @return the claseServicioService + */ + public ClaseServicioService getClaseServicioService() { + return claseServicioService; + } + + /** + * @param claseServicioService the claseServicioService to set + */ + public void setClaseServicioService(ClaseServicioService claseServicioService) { + this.claseServicioService = claseServicioService; + } + + /** + * @return the cmbMarca + */ + public Combobox getCmbMarca() { + return cmbMarca; + } + + /** + * @param cmbMarca the cmbMarca to set + */ + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + /** + * @return the cmbMoneda + */ + public Combobox getCmbMoneda() { + return cmbMoneda; + } + + /** + * @param cmbMoneda the cmbMoneda to set + */ + public void setCmbMoneda(Combobox cmbMoneda) { + this.cmbMoneda = cmbMoneda; + } + + /** + * @return the cmbTipoPassageiro + */ + public Combobox getCmbTipoPassageiro() { + return cmbTipoPassageiro; + } + + /** + * @param cmbTipoPassageiro the cmbTipoPassageiro to set + */ + public void setCmbTipoPassageiro(Combobox cmbTipoPassageiro) { + this.cmbTipoPassageiro = cmbTipoPassageiro; + } + + /** + * @return the cmbTipoServicio + */ + public Combobox getCmbTipoServicio() { + return cmbTipoServicio; + } + + /** + * @param cmbTipoServicio the cmbTipoServicio to set + */ + public void setCmbTipoServicio(Combobox cmbTipoServicio) { + this.cmbTipoServicio = cmbTipoServicio; + } + + /** + * @return the paradaService + */ + public ParadaService getParadaService() { + return paradaService; + } + + /** + * @param paradaService the paradaService to set + */ + public void setParadaService(ParadaService paradaService) { + this.paradaService = paradaService; + } + + /** + * @return the lsPtovata + */ + public List getLsPtovata() { + return lsPtovata; + } + + /** + * @param lsPtovata the lsPtovata to set + */ + public void setLsPtovata(List lsPtovata) { + this.lsPtovata = lsPtovata; + } + + /** + * @return the puntoVentaService + */ + public TipoPuntoVentaService getPuntoVentaService() { + return puntoVentaService; + } + + /** + * @param puntoVentaService the puntoVentaService to set + */ + public void setPuntoVentaService(TipoPuntoVentaService puntoVentaService) { + this.puntoVentaService = puntoVentaService; + } + + /** + * @return the cmbPtovta + */ + public Combobox getCmbPtovta() { + return cmbPtovta; + } + + /** + * @param cmbPtovta the cmbPtovta to set + */ + public void setCmbPtovta(Combobox cmbPtovta) { + this.cmbPtovta = cmbPtovta; + } + + /** + * @return the cmbOrigem + */ + public Combobox getCmbOrigem() { + return cmbOrigem; + } + + /** + * @param cmbOrigem the cmbOrigem to set + */ + public void setCmbOrigem(Combobox cmbOrigem) { + this.cmbOrigem = cmbOrigem; + } + + /** + * @return the cmbDestino + */ + public Combobox getCmbDestino() { + return cmbDestino; + } + + /** + * @param cmbDestino the cmbDestino to set + */ + public void setCmbDestino(Combobox cmbDestino) { + this.cmbDestino = cmbDestino; + } + + /** + * @return the fechaInicio + */ + public Datebox getFechaInicio() { + return fechaInicio; + } + + /** + * @param fechaInicio the fechaInicio to set + */ + public void setFechaInicio(Datebox fechaInicio) { + this.fechaInicio = fechaInicio; + } + + /** + * @return the fechaFin + */ + public Datebox getFechaFin() { + return fechaFin; + } + + /** + * @param fechaFin the fechaFin to set + */ + public void setFechaFin(Datebox fechaFin) { + this.fechaFin = fechaFin; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingAnticipacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingAnticipacionController.java new file mode 100644 index 000000000..cdc903eb8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingAnticipacionController.java @@ -0,0 +1,189 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import java.util.Calendar; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Intbox; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingAnticipacion; +import com.rjconsultores.ventaboletos.service.PricingAnticipacionService; +import com.rjconsultores.ventaboletos.utilerias.TraslaparUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.ConstraintPorcentagem; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; + +/** + * + * @author Rafius + */ +@Controller("editarPricingAnticipacionController") +@Scope("prototype") +public class EditarPricingAnticipacionController extends MyGenericForwardComposer { + + @Autowired + private PricingAnticipacionService pricingAnticipacionService; + private PricingAnticipacion pricingAnticipacion; + private MyListbox pricingAnticipacionList; + private Intbox anticipacioninicial; + private Intbox anticipacionfinal; + private MyTextboxDecimal porcentaje; + private Pricing pricing; + private ConstraintPorcentagem ct; + private static Logger log = Logger.getLogger(EditarPricingAnticipacionController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + ct = new ConstraintPorcentagem(); + pricing = (Pricing) Executions.getCurrent().getArg().get("pricing"); + pricingAnticipacion = (PricingAnticipacion) Executions.getCurrent().getArg().get("pricingAnticipacion"); + pricingAnticipacionList = (MyListbox) Executions.getCurrent().getArg().get("pricingAnticipacionList"); + + super.doAfterCompose(comp); + } + + public void onClick$btnAdicionarAnticipacion(Event ev) throws Exception { + anticipacioninicial.getValue(); + anticipacionfinal.getValue(); + porcentaje.getValue(); + + if (anticipacioninicial.getValue() > 100) { + Messagebox.show(Labels.getLabel("editarPricingController.anticipacionPorcentaje.value"), + Labels.getLabel("editarPricingController.windowAnticipacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (anticipacionfinal.getValue() > 100) { + Messagebox.show(Labels.getLabel("editarPricingController.anticipacionPorcentaje.value"), + Labels.getLabel("editarPricingController.windowAnticipacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (anticipacionfinal.getValue() < anticipacioninicial.getValue()) { + Messagebox.show(Labels.getLabel("editarPricingController.anticipacionErrada.value"), + Labels.getLabel("editarPricingController.windowAnticipacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + } else { + + Integer min = pricingAnticipacion.getCantdiasmin(); + Integer max = pricingAnticipacion.getCantdiasmax(); + // Boolean podeSalvar = pricingAnticipacionService.podeSalvar(pricing, + // min, max); + + boolean existe = true; + + List lsPricingAnticipacion = pricingAnticipacionService.obtenerPorPricing(pricingAnticipacion.getPricing()); + + if (pricingAnticipacion != null) { + lsPricingAnticipacion.remove(pricingAnticipacion); + } + for (PricingAnticipacion po : lsPricingAnticipacion) { + if (po.getActivo()) { + boolean traslapa = TraslaparUtil.intersectNum( + po.getCantdiasmin().longValue(), po.getCantdiasmax().longValue(), + min.longValue(), max.longValue()); + if (traslapa) { + existe = false; + } + } + } + + if (existe) { + if (pricingAnticipacion.getPricinganticipacionId() != null) { + pricingAnticipacionService.actualizacion(pricingAnticipacion); + pricingAnticipacionList.updateItem(pricingAnticipacion); + } else { + pricingAnticipacionService.suscribir(pricingAnticipacion); + pricingAnticipacionList.addItem(pricingAnticipacion); + } + closeWindow(); + } else { + Messagebox.show(Labels.getLabel("editarPricingController.anticipacionErrada"), + Labels.getLabel("editarPricingController.windowAnticipacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } + } + + public void onClick$btnRemoverAnticipacion(Event ev) { + try { + PricingAnticipacion pAnticipacion = (PricingAnticipacion) pricingAnticipacionList.getSelected(); + if (pAnticipacion != null) { + int resp = Messagebox.show(Labels.getLabel("editarPricingController.MSG.borrarPerguntaAnticipacion"), + Labels.getLabel("editarPricingController.windowAnticipacion.title"), + Messagebox.YES | Messagebox.NO, + Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingAnticipacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingAnticipacion.setFecmodif(Calendar.getInstance().getTime()); + pricingAnticipacion.setActivo(Boolean.FALSE); + + pricingAnticipacionList.removeItem(pricingAnticipacion); + pricingAnticipacionService.borrar(pricingAnticipacion); + closeWindow(); + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.windowAnticipacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + + } + + public PricingAnticipacion getPricingAnticipacion() { + return pricingAnticipacion; + } + + public void setPricingAnticipacion(PricingAnticipacion pricingAnticipacion) { + this.pricingAnticipacion = pricingAnticipacion; + } + + public MyListbox getPricingAnticipacionList() { + return pricingAnticipacionList; + } + + public void setPricingAnticipacionList(MyListbox pricingAnticipacionList) { + this.pricingAnticipacionList = pricingAnticipacionList; + } + + public PricingAnticipacionService getPricingAnticipacionService() { + return pricingAnticipacionService; + } + + public void setPricingAnticipacionService( + PricingAnticipacionService pricingAnticipacionService) { + this.pricingAnticipacionService = pricingAnticipacionService; + } + + /** + * @return the ct + */ + public ConstraintPorcentagem getCt() { + return ct; + } + + /** + * @param ct + * the ct to set + */ + public void setCt(ConstraintPorcentagem ct) { + this.ct = ct; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingAsientoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingAsientoController.java new file mode 100644 index 000000000..5f404586b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingAsientoController.java @@ -0,0 +1,164 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import java.util.Calendar; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Decimalbox; +import org.zkoss.zul.Intbox; + +import com.rjconsultores.ventaboletos.entidad.PricingAsiento; +import com.rjconsultores.ventaboletos.service.PricingAsientoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.ConstraintPorcentagem; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; + +/** + * + * @author Rafius + */ +@Controller("editarPricingAsientoController") +@Scope("prototype") +public class EditarPricingAsientoController extends MyGenericForwardComposer { + + @Autowired + private PricingAsientoService pricingAsientoService; + private PricingAsiento pricingAsiento; + private MyListbox pricingAsientoList; + private MyTextboxDecimal porcentaje; + private Intbox numeasiento; + private ConstraintPorcentagem ct; + private static Logger log = Logger.getLogger(EditarPricingAsientoController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + + ct = new ConstraintPorcentagem(); + pricingAsiento = (PricingAsiento) Executions.getCurrent().getArg().get("pricingAsiento"); + pricingAsientoList = (MyListbox) Executions.getCurrent().getArg().get("pricingAsientoList"); + + super.doAfterCompose(comp); + } + + public void onClick$btnAdicionarAsiento(Event ev) throws Exception { + numeasiento.getValue(); + porcentaje.getValue(); + + List lsAsientos = pricingAsientoService.obtenerPricingCategoria(pricingAsiento.getPricing(), numeasiento.getValue()); + + try { + boolean exite = true; + + if (lsAsientos.isEmpty()) { + exite = false; + } else { + for (PricingAsiento a : lsAsientos) { + if (a.getPricingasientoId().equals(pricingAsiento.getPricingasientoId())) { + exite = false; + } + } + } + + if (!exite) { + if (pricingAsiento.getPricingasientoId() != null) { + pricingAsientoService.actualizacion(pricingAsiento); + pricingAsientoList.updateItem(pricingAsiento); + } else { + pricingAsientoService.suscribir(pricingAsiento); + pricingAsientoList.addItem(pricingAsiento); + } + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.windowCategoria.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } + + + public void onClick$btnRemoverAsiento(Event ev) { + try { + PricingAsiento pAsiento = (PricingAsiento) pricingAsientoList.getSelected(); + if (pAsiento != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaAsiento"), + Labels.getLabel("editarPricingController.windowAsiento.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingAsiento.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingAsiento.setFecmodif(Calendar.getInstance().getTime()); + pricingAsiento.setActivo(Boolean.FALSE); + + pricingAsientoList.removeItem(pricingAsiento); + pricingAsientoService.borrar(pricingAsiento); + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.windowAsiento.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + + } + + public PricingAsiento getPricingAsiento() { + return pricingAsiento; + } + + public void setPricingAsiento(PricingAsiento pricingAsiento) { + this.pricingAsiento = pricingAsiento; + } + + public MyListbox getPricingAsientoList() { + return pricingAsientoList; + } + + public void setPricingAsientoList(MyListbox pricingAsientoList) { + this.pricingAsientoList = pricingAsientoList; + } + + public PricingAsientoService getPricingAsientoService() { + return pricingAsientoService; + } + + public void setPricingAsientoService(PricingAsientoService pricingAsientoService) { + this.pricingAsientoService = pricingAsientoService; + } + + /** + * @return the ct + */ + public ConstraintPorcentagem getCt() { + return ct; + } + + /** + * @param ct the ct to set + */ + public void setCt(ConstraintPorcentagem ct) { + this.ct = ct; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingCategoriaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingCategoriaController.java new file mode 100644 index 000000000..4b6e0deeb --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingCategoriaController.java @@ -0,0 +1,160 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.PricingCategoria; +import com.rjconsultores.ventaboletos.service.CategoriaService; +import com.rjconsultores.ventaboletos.service.PricingCategoriaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author Rafius + */ +@Controller("editarPricingCategoriaController") +@Scope("prototype") +public class EditarPricingCategoriaController extends MyGenericForwardComposer { + + @Autowired + private PricingCategoriaService pricingCategoriaService; + @Autowired + private CategoriaService categoriaService; + private List lsCategoria; + private PricingCategoria pricingCategoria; + private MyListbox pricingCategoriaList; + private Combobox cmbCategoria; + private static Logger log = Logger.getLogger(EditarPricingCategoriaController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsCategoria = categoriaService.obtenerTodos(); + + pricingCategoria = (PricingCategoria) Executions.getCurrent().getArg().get("pricingCategoria"); + pricingCategoriaList = (MyListbox) Executions.getCurrent().getArg().get("pricingCategoriaList"); + + super.doAfterCompose(comp); + + cmbCategoria.focus(); + + } + + public void onClick$btnAdicionarCategoria(Event ev) throws Exception { + cmbCategoria.getValue(); + try { + if (pricingCategoria.getCategoria() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowCategoria.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + Boolean existe = pricingCategoriaService.obtenerPricingCategoria(pricingCategoria.getPricing(), (Categoria) cmbCategoria.getSelectedItem().getValue()); + + if (existe) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.windowCategoria.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (pricingCategoria.getPricingcategoriaId() != null) { + pricingCategoriaService.actualizacion(pricingCategoria); + pricingCategoriaList.updateItem(pricingCategoria); + } else { + pricingCategoriaService.suscribir(pricingCategoria); + pricingCategoriaList.addItem(pricingCategoria); + } + closeWindow(); + } + } + } catch (Exception ex) { + log.error("Erro ao adicionar categoria: " + ex); + } + } + + public void onClick$btnRemoverCategoria(Event ev) { + try { + PricingCategoria pCategoria = (PricingCategoria) pricingCategoriaList.getSelected(); + if (pCategoria != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaCategoria"), + Labels.getLabel("editarPricingController.windowCategoria.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingCategoria.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingCategoria.setFecmodif(Calendar.getInstance().getTime()); + pricingCategoria.setActivo(Boolean.FALSE); + + pricingCategoriaList.removeItem(pricingCategoria); + pricingCategoriaService.borrar(pricingCategoria); + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.windowCategoria.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error("Erro ao remover categoria: " + ex); + } + + } + + public PricingCategoria getPricingCategoria() { + return pricingCategoria; + } + + public void setPricingCategoria(PricingCategoria pricingCategoria) { + this.pricingCategoria = pricingCategoria; + } + + public MyListbox getPricingCategoriaList() { + return pricingCategoriaList; + } + + public void setPricingCategoriaList(MyListbox pricingCategoriaList) { + this.pricingCategoriaList = pricingCategoriaList; + } + + public PricingCategoriaService getPricingCategoriaService() { + return pricingCategoriaService; + } + + public void setPricingCategoriaService(PricingCategoriaService pricingCategoriaService) { + this.pricingCategoriaService = pricingCategoriaService; + } + + public List getLsCategoria() { + return lsCategoria; + } + + public void setLsCategoria(List lsCategoria) { + this.lsCategoria = lsCategoria; + } + + public CategoriaService getCategoriaService() { + return categoriaService; + } + + public void setCategoriaService(CategoriaService categoriaService) { + this.categoriaService = categoriaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingClaseController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingClaseController.java new file mode 100644 index 000000000..b7d5e527d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingClaseController.java @@ -0,0 +1,170 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.PricingClase; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.PricingClaseService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author Rafius + */ +@Controller("editarPricingClaseController") +@Scope("prototype") +public class EditarPricingClaseController extends MyGenericForwardComposer { + + @Autowired + private PricingClaseService pricingClaseService; + @Autowired + private ClaseServicioService claseServicioService; + private List lsClase; + private PricingClase pricingClase; + private MyListbox pricingClaseList; + private Combobox cmbClase; + private static Logger log = Logger.getLogger(EditarPricingClaseController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsClase = claseServicioService.obtenerTodos(); + + pricingClase = (PricingClase) Executions.getCurrent().getArg().get("pricingClase"); + pricingClaseList = (MyListbox) Executions.getCurrent().getArg().get("pricingClaseList"); + + super.doAfterCompose(comp); + + + cmbClase.focus(); + } + + public void onClick$btnAdicionarClase(Event ev) throws Exception { + cmbClase.getValue(); + + try { + + if (pricingClase.getClaseServicio() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowClase.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + + Boolean existe = pricingClaseService.obtenerPricingClase(pricingClase.getPricing(), (ClaseServicio) cmbClase.getSelectedItem().getValue()); + if (existe) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.windowClase.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (pricingClase.getPricingclaseId() != null) { + pricingClaseService.actualizacion(pricingClase); + pricingClaseList.updateItem(pricingClase); + } else { + pricingClaseService.suscribir(pricingClase); + pricingClaseList.addItem(pricingClase); + } + closeWindow(); + } + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnRemoverClase(Event ev) { + try { + PricingClase pClase = (PricingClase) pricingClaseList.getSelected(); + if (pClase != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaClase"), + Labels.getLabel("editarPricingController.windowClase.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingClase.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingClase.setFecmodif(Calendar.getInstance().getTime()); + pricingClase.setActivo(Boolean.FALSE); + + pricingClaseList.removeItem(pricingClase); + pricingClaseService.borrar(pricingClase); + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.windowClase.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + + } + + public PricingClase getPricingClase() { + return pricingClase; + } + + public void setPricingClase(PricingClase pricingClase) { + this.pricingClase = pricingClase; + } + + public MyListbox getPricingClaseList() { + return pricingClaseList; + } + + public void setPricingClaseList(MyListbox pricingClaseList) { + this.pricingClaseList = pricingClaseList; + } + + public PricingClaseService getPricingClaseService() { + return pricingClaseService; + } + + public void setPricingClaseService(PricingClaseService pricingClaseService) { + this.pricingClaseService = pricingClaseService; + } + + public ClaseServicioService getClaseServicioService() { + return claseServicioService; + } + + public void setClaseServicioService(ClaseServicioService claseServicioService) { + this.claseServicioService = claseServicioService; + } + + public static Logger getLog() { + return log; + } + + public static void setLog(Logger log) { + EditarPricingClaseController.log = log; + } + + public List getLsClase() { + return lsClase; + } + + public void setLsClase(List lsClase) { + this.lsClase = lsClase; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingController.java new file mode 100644 index 000000000..90f51a607 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingController.java @@ -0,0 +1,2171 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingAnticipacion; +import com.rjconsultores.ventaboletos.entidad.PricingAsiento; +import com.rjconsultores.ventaboletos.entidad.PricingCategoria; +import com.rjconsultores.ventaboletos.entidad.PricingClase; +import com.rjconsultores.ventaboletos.entidad.PricingCorrida; +import com.rjconsultores.ventaboletos.entidad.PricingDia; +import com.rjconsultores.ventaboletos.entidad.PricingImporte; +import com.rjconsultores.ventaboletos.entidad.PricingMarca; +import com.rjconsultores.ventaboletos.entidad.PricingMercado; +import com.rjconsultores.ventaboletos.entidad.PricingOcupacion; +import com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.PricingRuta; +import com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.PricingTipoServicio; +import com.rjconsultores.ventaboletos.entidad.PricingVigencia; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.PricingAnticipacionService; +import com.rjconsultores.ventaboletos.service.PricingClaseService; +import com.rjconsultores.ventaboletos.service.PricingImporteService; +import com.rjconsultores.ventaboletos.service.PricingMarcaService; +import com.rjconsultores.ventaboletos.service.PricingMercadoService; +import com.rjconsultores.ventaboletos.service.PricingPuntoVentaService; +import com.rjconsultores.ventaboletos.service.PricingRutaService; +import com.rjconsultores.ventaboletos.service.PricingService; +import com.rjconsultores.ventaboletos.service.PricingTipoPtoVtaService; +import com.rjconsultores.ventaboletos.service.PricingTipoServicioService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingAnticipacion; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingAsiento; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingCategoria; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingClase; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingCorrida; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingDia; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingImporte; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingMarca; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingMercado; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingOcupacion; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingPuntoVenta; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingRuta; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingTipoPtoVta; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingTipoServicio; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPricingVigencia; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.logging.Level; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.List; +import java.util.Map; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +@Controller("editarPricingController") +@Scope("prototype") +public class EditarPricingController extends MyGenericForwardComposer { + + @Autowired + private PricingService pricingService; + @Autowired + private PricingMarcaService pricingMarcaService; + @Autowired + private PricingClaseService pricingClaseService; + @Autowired + private PricingPuntoVentaService pricingPuntoVentaService; + @Autowired + private PricingTipoPtoVtaService pricingTipoPtoVtaService; + @Autowired + private PricingRutaService pricingRutaService; + @Autowired + private PricingMercadoService pricingMercadoService; + @Autowired + private PricingImporteService pricingImporteService; + @Autowired + private PricingAnticipacionService pricingAnticipacionService; + @Autowired + private PricingTipoServicioService pricingTipoServicioService; + @Autowired + private EmpresaService empresaService; + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private PuntoVentaService puntoVentaService; + @Autowired + private TipoPuntoVentaService tipoPuntoVentaService; + @Autowired + private RutaService rutaService; + @Autowired + private ParadaService paradaService; + private Pricing pricing; + private MyListbox pricingList; + private MyListbox pricingVigenciaList; + private MyListbox pricingImporteList; + private MyListbox pricingMarcaList; + private MyListbox pricingClaseList; + private MyListbox pricingPuntoVentaList; + private MyListbox pricingTipoPtoVtaList; + private MyListbox pricingRutaList; + private MyListbox pricingMercadoList; + private MyListbox pricingCategoriaList; + private MyListbox pricingDiaList; + private MyListbox pricingCorridaList; + private MyListbox pricingAsientoList; + private MyListbox pricingOcupacionList; + private MyListbox pricingAnticipacionList; + private MyListbox pricingTipoServicioList; + private List lsEmpresa; + private List lsPricingVigencia; + private List lsPricingImporte; + private List lsPricingClase; + private List lsPricingTipoPtoVta; + private List lsPricingPuntoVenta; + private List lsPricingMarca; + private List lsPricingMercado; + private List lsPricingDia; + private List lsPricingCorrida; + private List lsPricingCategoria; + private List lsPricingAsiento; + private List lsPricingOcupacion; + private List lsPricingRuta; + private List lsPricingAnticipacion; + private List lsPricingTipoServicio; + private static Logger log = Logger.getLogger(EditarPricingController.class); + private Combobox cmbEmpresa; + private Radio rdTransSi; + private Radio rdTransNo; + private Radio rdCanceSi; + private Radio rdCanceNo; + private Radio rdReserSi; + private Radio rdReserNo; + private Radio radioImp; + private Radio radioPor; + private MyTextboxDecimal descuentoporcredondo; + private MyTextboxDecimal descuentoporcsen; + private Button btnNovoImporte; + private Button btnApagarImporte; + private Button btnModificarImporte; + private boolean salvo = false; + private Boolean gravarNovo = Boolean.TRUE; + private Button btnApagar; + private Textbox nombrePricing; + private Intbox itxCantboleto; + private Intbox cantdiasanticipacion; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.obtenerIndTipo1(); + lsEmpresa.add(empresaService.obtenerID(-1)); + + pricing = (Pricing) Executions.getCurrent().getArg().get("pricing"); + pricingList = (MyListbox) Executions.getCurrent().getArg().get("pricingList"); + gravarNovo = (Boolean) Executions.getCurrent().getArg().get("gravarNovo"); + + super.doAfterCompose(comp); + + // Vigencia + pricingVigenciaList.setItemRenderer(new RenderPricingVigencia()); + lsPricingVigencia = new ArrayList(); + pricingVigenciaList.setData(lsPricingVigencia); + + //Importe + pricingImporteList.setItemRenderer(new RenderPricingImporte()); + lsPricingImporte = new ArrayList(); + pricingImporteList.setData(lsPricingImporte); + + //Marca + pricingMarcaList.setItemRenderer(new RenderPricingMarca()); + lsPricingMarca = new ArrayList(); + pricingMarcaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingMarca pMarca = (PricingMarca) pricingMarcaList.getSelected(); + verPricingMarca(pMarca); + } + }); + + //Clase + pricingClaseList.setItemRenderer(new RenderPricingClase()); + lsPricingClase = new ArrayList(); + pricingClaseList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingClase pClase = (PricingClase) pricingClaseList.getSelected(); + verPricingClase(pClase); + } + }); + + //Punto Venta + pricingPuntoVentaList.setItemRenderer(new RenderPricingPuntoVenta()); + lsPricingPuntoVenta = new ArrayList(); + pricingPuntoVentaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingPuntoVenta pPuntoVenta = (PricingPuntoVenta) pricingPuntoVentaList.getSelected(); + verPricingPuntoVenta(pPuntoVenta); + } + }); + + //Canal Venta + pricingTipoPtoVtaList.setItemRenderer(new RenderPricingTipoPtoVta()); + lsPricingTipoPtoVta = new ArrayList(); + pricingTipoPtoVtaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingTipoPtoVta pTipoPtoVta = (PricingTipoPtoVta) pricingTipoPtoVtaList.getSelected(); + verPricingTipoPtoVta(pTipoPtoVta); + } + }); + + //Rutas + pricingRutaList.setItemRenderer(new RenderPricingRuta()); + lsPricingRuta = new ArrayList(); + pricingRutaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingRuta pRuta = (PricingRuta) pricingRutaList.getSelected(); + verPricingRuta(pRuta); + } + }); + + //Categoria + pricingCategoriaList.setItemRenderer(new RenderPricingCategoria()); + lsPricingCategoria = new ArrayList(); + pricingCategoriaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingCategoria pCategoria = (PricingCategoria) pricingCategoriaList.getSelected(); + verPricingCategoria(pCategoria); + } + }); + + //Mercado + pricingMercadoList.setItemRenderer(new RenderPricingMercado()); + lsPricingMercado = new ArrayList(); + pricingMercadoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingMercado pMercado = (PricingMercado) pricingMercadoList.getSelected(); + verPricingMercado(pMercado); + } + }); + + //Dia + pricingDiaList.setItemRenderer(new RenderPricingDia()); + lsPricingDia = new ArrayList(); + pricingDiaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingDia pDia = (PricingDia) pricingDiaList.getSelected(); + verPricingDia(pDia); + } + }); + + //Corrida + pricingCorridaList.setItemRenderer(new RenderPricingCorrida()); + lsPricingCorrida = new ArrayList(); + + //Asiento + pricingAsientoList.setItemRenderer(new RenderPricingAsiento()); + lsPricingAsiento = new ArrayList(); + pricingAsientoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingAsiento pAsiento = (PricingAsiento) pricingAsientoList.getSelected(); + verPricingAsiento(pAsiento); + } + }); + + //Anticipacion + pricingAnticipacionList.setItemRenderer(new RenderPricingAnticipacion()); + lsPricingAnticipacion = new ArrayList(); + pricingAnticipacionList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingAnticipacion pAnticipacion = (PricingAnticipacion) pricingAnticipacionList.getSelected(); + verPricingAnticipacion(pAnticipacion); + } + }); + + //TipoServicio + pricingTipoServicioList.setItemRenderer(new RenderPricingTipoServicio()); + lsPricingTipoServicio = new ArrayList(); + pricingTipoServicioList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingTipoServicio pTipoServicio = (PricingTipoServicio) pricingTipoServicioList.getSelected(); + verPricingTipoServicio(pTipoServicio); + } + }); + + //Ocupacion + pricingOcupacionList.setItemRenderer(new RenderPricingOcupacion()); + lsPricingOcupacion = new ArrayList(); + pricingOcupacionList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + PricingOcupacion pOcupacion = (PricingOcupacion) pricingOcupacionList.getSelected(); + verPricingOcupacion(pOcupacion); + } + }); + + if (pricing.getPricingId() != null) { + pricing = pricingService.obtenerID(pricing.getPricingId()); + + lsPricingVigencia = pricing.getPricingVigenciaList(); + pricingVigenciaList.setData(lsPricingVigencia); + if (lsPricingVigencia.size() > 0) { + pricingVigenciaList.setSelectedIndex(0); + } + + lsPricingImporte = pricing.getPricingImporteList(); + pricingImporteList.setData(lsPricingImporte); + if (lsPricingImporte.size() > 0) { + pricingImporteList.setSelectedIndex(0); + } + + lsPricingMarca = pricing.getPricingMarcaList(); + pricingMarcaList.setData(lsPricingMarca); + if (lsPricingMarca.size() > 0) { + pricingMarcaList.setSelectedIndex(0); + } + + lsPricingClase = pricing.getPricingClaseList(); + pricingClaseList.setData(lsPricingClase); + if (lsPricingClase.size() > 0) { + pricingClaseList.setSelectedIndex(0); + } + lsPricingAnticipacion = pricing.getPricingAnticipacionList(); + pricingAnticipacionList.setData(lsPricingAnticipacion); + if (lsPricingAnticipacion.size() > 0) { + pricingAnticipacionList.setSelectedIndex(0); + } + lsPricingTipoServicio = pricing.getPricingTipoServicioList(); + pricingTipoServicioList.setData(lsPricingTipoServicio); + if (lsPricingTipoServicio.size() > 0) { + pricingTipoServicioList.setSelectedIndex(0); + } + + lsPricingPuntoVenta = pricing.getPricingPuntoventaList(); + pricingPuntoVentaList.setData(lsPricingPuntoVenta); + if (lsPricingPuntoVenta.size() > 0) { + pricingPuntoVentaList.setSelectedIndex(0); + } + + lsPricingCategoria = pricing.getPricingCategoriaList(); + pricingCategoriaList.setData(lsPricingCategoria); + if (lsPricingCategoria.size() > 0) { + pricingCategoriaList.setSelectedIndex(0); + } + + lsPricingRuta = pricing.getPricingRutaList(); + pricingRutaList.setData(lsPricingRuta); + if (lsPricingRuta.size() > 0) { + pricingRutaList.setSelectedIndex(0); + } + + lsPricingMercado = pricing.getPricingMercadoList(); + pricingMercadoList.setData(lsPricingMercado); + + lsPricingTipoPtoVta = pricing.getPricingTipoptovtaList(); + pricingTipoPtoVtaList.setData(lsPricingTipoPtoVta); + if (lsPricingTipoPtoVta.size() > 0) { + pricingTipoPtoVtaList.setSelectedIndex(0); + } + + lsPricingCorrida = pricing.getPricingCorridaList(); + pricingCorridaList.setData(lsPricingCorrida); + + + lsPricingDia = pricing.getPricingDiaList(); + pricingDiaList.setData(lsPricingDia); + + lsPricingAsiento = pricing.getPricingAsientoList(); + pricingAsientoList.setData(lsPricingAsiento); + + lsPricingOcupacion = pricing.getPricingOcupacionList(); + pricingOcupacionList.setData(lsPricingOcupacion); + + lsPricingAnticipacion = pricing.getPricingAnticipacionList(); + pricingAnticipacionList.setData(lsPricingAnticipacion); + + lsPricingTipoServicio = pricing.getPricingTipoServicioList(); + pricingTipoServicioList.setData(lsPricingTipoServicio); + + if (pricing.getIndtransferible() == Boolean.FALSE) { + rdTransNo.setChecked(true); + } + if (pricing.getIndcancelable() == Boolean.FALSE) { + rdCanceNo.setChecked(true); + } + if (pricing.getIndreservable() == Boolean.FALSE) { + rdReserNo.setChecked(true); + } + if (pricing.getDescuentoporcentaje() != null) { + radioPor.setChecked(true); + } + if (lsPricingImporte.size() > 0) { + radioImp.setChecked(true); + onClick$radioImp(null); + } else { + radioPor.setChecked(true); + btnNovoImporte.setVisible(false); + btnApagarImporte.setVisible(false); + btnModificarImporte.setVisible(false); + } + + //BUG-1202 Não permitir alterar a empresa. + cmbEmpresa.setDisabled(true); + + salvo = true; + } else { + radioPor.setChecked(true); + + btnNovoImporte.setVisible(false); + btnApagarImporte.setVisible(false); + btnModificarImporte.setVisible(false); + descuentoporcredondo.setDisabled(false); + + pricingService.suscribir(pricing); + //Marca - Preenchendo com o Objeto TODOS caso exista. + Short id = -1; + PricingMarca pm = new PricingMarca(); + Marca m = marcaService.obtenerID(id); + if (m != null) { + pm.setMarca(m); + pm.setPricing(pricing); + pm.setActivo(Boolean.TRUE); + pm.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pm.setFecmodif(Calendar.getInstance().getTime()); + lsPricingMarca.add(pm); + pricingMarcaList.setData(lsPricingMarca); + pricingMarcaService.suscribir(pm); + } + + //Tipo de Servicio + PricingClase pts = new PricingClase(); + ClaseServicio cs = claseServicioService.obtenerID(id); + if (cs != null) { + pts.setClaseServicio(cs); + pts.setPricing(pricing); + pts.setActivo(Boolean.TRUE); + pts.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pts.setFecmodif(Calendar.getInstance().getTime()); + lsPricingClase.add(pts); + pricingClaseList.setData(lsPricingClase); + pricingClaseService.suscribir(pts); + } + + //Punto de Venta + PricingPuntoVenta ppv = new PricingPuntoVenta(); + PuntoVenta pv = puntoVentaService.obtenerID(-1); + if (pv != null) { + ppv.setPuntoVenta(pv); + ppv.setPricing(pricing); + ppv.setActivo(Boolean.TRUE); + ppv.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + ppv.setFecmodif(Calendar.getInstance().getTime()); + lsPricingPuntoVenta.add(ppv); + pricingPuntoVentaList.setData(lsPricingPuntoVenta); + pricingPuntoVentaService.suscribir(ppv); + } + //Punto de Venta + PricingTipoPtoVta ptpv = new PricingTipoPtoVta(); + TipoPuntoVenta tpv = tipoPuntoVentaService.obtenerID((short) -1); + if (tpv != null) { + ptpv.setTipoPtovta(tpv); + ptpv.setPricing(pricing); + ptpv.setActivo(Boolean.TRUE); + ptpv.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + ptpv.setFecmodif(Calendar.getInstance().getTime()); + lsPricingTipoPtoVta.add(ptpv); + pricingTipoPtoVtaList.setData(lsPricingTipoPtoVta); + pricingTipoPtoVtaService.suscribir(ptpv); + } + + //Ruta + PricingRuta pr = new PricingRuta(); + Ruta r = rutaService.obtenerID(-1); + if (r != null) { + pr.setRuta(r); + pr.setPricing(pricing); + pr.setActivo(Boolean.TRUE); + pr.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pr.setFecmodif(Calendar.getInstance().getTime()); + lsPricingRuta.add(pr); + pricingRutaList.setData(lsPricingRuta); + pricingRutaService.suscribir(pr); + } + //Mercado + PricingMercado pme = new PricingMercado(); + Parada p1 = paradaService.obtenerID(-1); + if (p1 != null) { + pme.setActivo(Boolean.TRUE); + pme.setPricing(pricing); + pme.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pme.setFecmodif(Calendar.getInstance().getTime()); + pme.setOrigen(p1); + pme.setDestino(p1); + + lsPricingMercado.add(pme); + pricingMercadoList.setData(lsPricingMercado); + pricingMercadoService.suscribir(pme); + } + + //Empresa + Empresa emp = empresaService.obtenerID(-1); + if (emp != null) { + pricing.setEmpresa(emp); + cmbEmpresa.setText(emp.getNombempresa()); + } + } + + if (pricing.getPricingId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + } + + public void onClick$radioImp(Event ev) { + btnNovoImporte.setVisible(true); + btnApagarImporte.setVisible(true); + btnModificarImporte.setVisible(true); + + descuentoporcsen.setConstraint(""); + descuentoporcsen.setDisabled(true); + descuentoporcsen.setValue(null); + pricing.setDescuentoporcentaje(null); + + descuentoporcredondo.setConstraint(""); + descuentoporcredondo.setValue(null); + descuentoporcredondo.setDisabled(true); + pricing.setDescuentoporcredondo(null); + + } + + public void onClick$radioPor(Event ev) { + btnNovoImporte.setVisible(false); + btnApagarImporte.setVisible(false); + btnModificarImporte.setVisible(false); + + //this.descuentoporcredondo.setConstraint("no empty"); + //this.descuentoporcsen.setConstraint("no empty"); + + descuentoporcsen.setDisabled(false); + descuentoporcredondo.setDisabled(false); + + Object[] listPImporte = pricingImporteList.getData(); + if (listPImporte != null) { + for (Object o : listPImporte) { + PricingImporte pImporte = (PricingImporte) o; + lsPricingImporte.remove(pImporte); + + pImporte.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pImporte.setFecmodif(Calendar.getInstance().getTime()); + pImporte.setActivo(Boolean.FALSE); + + lsPricingImporte.add(pImporte); + pricingImporteList.removeItem(pImporte); + } + + pricingImporteList.clearSelection(); + pricing.setPricingImporteList(lsPricingImporte); + // pricingService.actualizacion(pricing); + + } + } + + private boolean validarNome() throws InterruptedException { + try { + nombrePricing.getValue(); + } catch (WrongValueException e) { + + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.nomPricingVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + return false; + } + + return true; + } + + private boolean validarObligatorios() throws InterruptedException { + try { + nombrePricing.getValue(); + } catch (WrongValueException e) { + + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.nomPricingVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + return false; + } + + try { + if (pricing.getEmpresa() == null) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.empresaVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + return false; + } + cmbEmpresa.getValue(); + } catch (WrongValueException e) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.empresaVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + return false; + } + + try { + itxCantboleto.getValue(); + } catch (WrongValueException e) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.cantAsientosCorridasVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } + + if (radioImp.isChecked()) { + if (pricingImporteList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.cantImportePricingVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } + } else { + if ((descuentoporcsen.getValue() == null) || (descuentoporcsen.getValue().equals("")) || (descuentoporcsen.getValueDecimal().compareTo(BigDecimal.ZERO) == 0)) { + if ((pricingAsientoList.getData().length == 0) && (pricingOcupacionList.getData().length == 0)) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.porcentajeSencilloVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + + } + } + } + + + if (pricingVigenciaList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.vigenciasVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } + + try { + cantdiasanticipacion.getValue(); + } catch (WrongValueException e) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.cantDiasAntecipacionVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } + + if (pricingMarcaList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.marcaVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } + if (pricingClaseList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.claseVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } + if (pricingPuntoVentaList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.puntoVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } + if (pricingRutaList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.rutaVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } + if (pricingTipoPtoVtaList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.tipoPtoVtaVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } + + if (pricingCategoriaList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.categoriaVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } + + if (pricingMercadoList.getModel().getSize() == 0) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.mercadoVazio"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return false; + } + + + + return true; + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + if (!validarObligatorios()) { + return; + } + + BigDecimal vlrdescuentoporcsen = descuentoporcsen.getValueDecimal(); + BigDecimal vlrdescuentoporcredondo = descuentoporcredondo.getValueDecimal(); + + try { + try { + if (radioPor.isChecked()) { + + if ((vlrdescuentoporcsen != null) && (vlrdescuentoporcsen.intValue() < -100 || vlrdescuentoporcsen.intValue() >= 1000)) { + Messagebox.show( + Labels.getLabel("editarPricingController.msgSencillo.title"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return; + } + + if ((vlrdescuentoporcredondo != null) && (vlrdescuentoporcredondo.intValue() < -100 || vlrdescuentoporcredondo.intValue() >= 1000)) { + Messagebox.show( + Labels.getLabel("editarPricingController.msgRedondo.title"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + return; + + } + } + } catch (Exception ex) { + log.error("PrincigController - descuentoporcsen.getValue() // descuentoporcredondo.getValue() : " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + } + + pricing.setEmpresa((Empresa) cmbEmpresa.getSelectedItem().getValue()); + + if (rdTransSi.isChecked()) { + pricing.setIndtransferible(Boolean.TRUE); + } else { + pricing.setIndtransferible(Boolean.FALSE); + } + if (rdCanceSi.isChecked()) { + pricing.setIndcancelable(Boolean.TRUE); + } else { + pricing.setIndcancelable(Boolean.FALSE); + } + if (rdReserSi.isChecked()) { + pricing.setIndreservable(Boolean.TRUE); + } else { + pricing.setIndreservable(Boolean.FALSE); + } + + if (gravarNovo) { + + pricingService.actualizacion(pricing);//eu guardo antes para gantir que os dados que eu tenho na tela estão no banco + List lsPricing = + pricingService.buscarPorNombre(pricing.getNombPricing()); + + if (lsPricing.size() <= 1) { + pricingService.actualizacion(pricing); + pricingList.addItem(pricing); + + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.suscribirOK"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + salvo = true; + //Bugzilla 1191: Não fechar janela. + //closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + + pricingService.actualizacion(pricing); + pricingList.updateItem(pricing); + + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.suscribirOK"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + salvo = true; + //Bugzilla 1191: Não fechar janela. + //closeWindow(); + } + + //Se for por porcentage eu desativo todos os importes + if (radioPor.isChecked()) { + pricing = pricingService.obtenerID(pricing.getPricingId()); + for (PricingImporte pi : pricing.getPricingImporteList()) { + pricingImporteService.borrar(pi); + } + } + } catch (Exception ex) { + log.error("Error salvar pricing : " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } + + // O tratamento para deletar o Pricing (made by Monteiro) quando sair sem salvar foi mudado + // para o evento onClose da janela. + public void onClick$btnFechar(Event ev) { + onClose$winEditarPricing(null); + } + + public void onClose$winEditarPricing(Event ev) { + if (!salvo) { + if (pricing.getPricingId() != null) { + pricingService.borrarFisico(pricing); + } + } + closeWindow(); + } + + public void onClick$btnApagar(Event ev) throws InterruptedException { + try { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPergunta"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingService.borrar(pricing); + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarOK"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + pricingList.removeItem(pricing); + + closeWindow(); + } + } catch (Exception ex) { + log.error("Erro apagar pricing : " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnModificarVigencia(Event ev) { + PricingVigencia pVigencia = (PricingVigencia) pricingVigenciaList.getSelected(); + + if (pVigencia != null) { + verPricingVigencia(pVigencia); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.windowVigencia.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarVigencia(Event ev) throws Exception { + List listPVigencia = pricingVigenciaList.getSelectedsItens(); + if (listPVigencia != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaVigencia"), + Labels.getLabel("editarPricingController.windowVigencia.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + for (Object o : listPVigencia) { + + pricing = pricingService.obtenerID(pricing.getPricingId()); + lsPricingVigencia = pricing.getPricingVigenciaList(); + + PricingVigencia pVigencia = (PricingVigencia) o; + lsPricingVigencia.remove(pVigencia); + + pVigencia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pVigencia.setFecmodif(Calendar.getInstance().getTime()); + pVigencia.setActivo(Boolean.FALSE); + + lsPricingVigencia.add(pVigencia); + pricingVigenciaList.removeItem(pVigencia); + + pricing.setPricingVigenciaList(lsPricingVigencia); + + pricingService.actualizacion(pricing); + lsPricingVigencia.clear(); + } + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoVigencia(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingVigencia pVigencia = new PricingVigencia(); + pVigencia.setPricing(pricing); + + verPricingVigencia(pVigencia); + } + + private void verPricingVigencia(PricingVigencia pVigencia) { + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingVigencia", pVigencia); + args.put("pricing", pricing); + args.put("pricingVigenciaList", pricingVigenciaList); + + openWindow("/gui/pricing/editarPricingVigencia.zul", + Labels.getLabel("editarPricingController.vigencia.value"), args, MODAL); + } + + public void onClick$btnApagarImporte(Event ev) throws Exception { + List listPImporte = pricingImporteList.getSelectedsItens(); + if (listPImporte != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaImporte"), + Labels.getLabel("editarPricingController.windowImporte.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + for (Object o : listPImporte) { + PricingImporte pImporte = (PricingImporte) o; + lsPricingImporte.remove(pImporte); + + pImporte.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pImporte.setFecmodif(Calendar.getInstance().getTime()); + pImporte.setActivo(Boolean.FALSE); + + lsPricingImporte.add(pImporte); + pricingImporteList.removeItem(pImporte); + } + + pricingImporteList.clearSelection(); + pricing.setPricingImporteList(lsPricingImporte); + pricingService.actualizacion(pricing); + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.windowImporte.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoImporte(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingImporte pImporte = new PricingImporte(); + pImporte.setPricing(pricing); + verPricingImporte(pImporte); + } + + private void verPricingImporte(PricingImporte pImporte) { + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingImporte", pImporte); + args.put("pricingImporteList", pricingImporteList); + + openWindow("/gui/pricing/editarPricingImporte.zul", + Labels.getLabel("editarPricingController.windowImporte.title"), args, MODAL); + } + + public void onClick$btnModificarImporte(Event ev) { + PricingImporte pImporte = (PricingImporte) pricingImporteList.getSelected(); + + if (pImporte != null) { + verPricingImporte(pImporte); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.windowImporte.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + log.error(ex); + } + } + } + + public void onClick$btnApagarMarca(Event ev) throws Exception { + List listPMarca = pricingMarcaList.getSelectedsItens(); + if (listPMarca != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaMarca"), + Labels.getLabel("editarPricingController.windowMarca.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + for (Object o : listPMarca) { + PricingMarca pMarca = (PricingMarca) o; + + lsPricingMarca.remove(pMarca); + + pMarca.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pMarca.setFecmodif(Calendar.getInstance().getTime()); + pMarca.setActivo(Boolean.FALSE); + + lsPricingMarca.add(pMarca); + pricingMarcaList.removeItem(pMarca); + pricingMarcaList.clearSelection(); + + pricing.setPricingMarcaList(lsPricingMarca); + pricingService.actualizacion(pricing); + } + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoMarca(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingMarca pMarca = new PricingMarca(); + pMarca.setPricing(pricing); + verPricingMarca(pMarca); + } + + private void verPricingMarca(PricingMarca pMarca) { + + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingMarca", pMarca); + args.put("pricingMarcaList", pricingMarcaList); + + openWindow("/gui/pricing/editarPricingMarca.zul", + Labels.getLabel("editarPricingController.windowMarca.title"), args, MODAL); + } + + public void onClick$btnModificarMarca(Event ev) { + + PricingMarca pMarca = (PricingMarca) pricingMarcaList.getSelected(); + + if (pMarca != null) { + verPricingMarca(pMarca); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarClase(Event ev) throws Exception { + List listPClase = pricingClaseList.getSelectedsItens(); + + if (listPClase != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaClase"), + Labels.getLabel("editarPricingController.windowClase.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + for (Object o : listPClase) { + + PricingClase pClase = (PricingClase) o; + + lsPricingClase.remove(pClase); + + pClase.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pClase.setFecmodif(Calendar.getInstance().getTime()); + pClase.setActivo(Boolean.FALSE); + + lsPricingClase.add(pClase); + pricingClaseList.removeItem(pClase); + pricingClaseList.clearSelection(); + + pricing.setPricingClaseList(lsPricingClase); + pricingService.actualizacion(pricing); + } + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoClase(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingClase pClase = new PricingClase(); + pClase.setPricing(pricing); + verPricingClase(pClase); + } + + private void verPricingClase(PricingClase pClase) { + + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingClase", pClase); + args.put("pricingClaseList", pricingClaseList); + + openWindow("/gui/pricing/editarPricingClase.zul", + Labels.getLabel("editarPricingController.windowTipoServicio.title"), args, MODAL); + } + + public void onClick$btnModificarClase(Event ev) { + + PricingClase pClase = (PricingClase) pricingClaseList.getSelected(); + + if (pClase != null) { + verPricingClase(pClase); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarPuntoVenta(Event ev) throws Exception { + List listPuntoVenta = pricingPuntoVentaList.getSelectedsItens(); + if (listPuntoVenta != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaPuntoVenta"), + Labels.getLabel("editarPricingController.windowPuntoVenta.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + + for (Object o : listPuntoVenta) { + + PricingPuntoVenta pPuntoVenta = (PricingPuntoVenta) o; + lsPricingPuntoVenta.remove(pPuntoVenta); + + pPuntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pPuntoVenta.setFecmodif(Calendar.getInstance().getTime()); + pPuntoVenta.setActivo(Boolean.FALSE); + + lsPricingPuntoVenta.add(pPuntoVenta); + pricingPuntoVentaList.removeItem(pPuntoVenta); + pricingPuntoVentaList.clearSelection(); + + pricing.setPricingPuntoventaList(lsPricingPuntoVenta); + pricingService.actualizacion(pricing); + } + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoPuntoVenta(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingPuntoVenta pPuntoVenta = new PricingPuntoVenta(); + pPuntoVenta.setPricing(pricing); + verPricingPuntoVenta(pPuntoVenta); + } + + private void verPricingPuntoVenta(PricingPuntoVenta pPuntoVenta) { + + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingPuntoVenta", pPuntoVenta); + args.put("pricingPuntoVentaList", pricingPuntoVentaList); + + openWindow("/gui/pricing/editarPricingPuntoVenta.zul", + Labels.getLabel("editarPricingController.windowPuntoVenta.title"), args, MODAL); + } + + public void onClick$btnModificarPuntoVenta(Event ev) { + + PricingPuntoVenta pPuntoVenta = (PricingPuntoVenta) pricingPuntoVentaList.getSelected(); + + if (pPuntoVenta != null) { + verPricingPuntoVenta(pPuntoVenta); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarTipoPtoVta(Event ev) throws Exception { + List listTipoPtoVta = pricingTipoPtoVtaList.getSelectedsItens(); + if (listTipoPtoVta != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaTipoPtoVta"), + Labels.getLabel("editarPricingController.windowTipoPtoVta.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + for (Object r : listTipoPtoVta) { + PricingTipoPtoVta pTipoPtoVta = (PricingTipoPtoVta) r; + + lsPricingTipoPtoVta.remove(pTipoPtoVta); + pTipoPtoVta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pTipoPtoVta.setFecmodif(Calendar.getInstance().getTime()); + pTipoPtoVta.setActivo(Boolean.FALSE); + + lsPricingTipoPtoVta.add(pTipoPtoVta); + pricingTipoPtoVtaList.removeItem(pTipoPtoVta); + pricingTipoPtoVtaList.clearSelection(); + + pricing.setPricingTipoptovtaList(lsPricingTipoPtoVta); + pricingService.actualizacion(pricing); + } + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoTipoPtoVta(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingTipoPtoVta pTipoPtoVta = new PricingTipoPtoVta(); + pTipoPtoVta.setPricing(pricing); + verPricingTipoPtoVta(pTipoPtoVta); + } + + private void verPricingTipoPtoVta(PricingTipoPtoVta pTipoPtoVta) { + + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingTipoPtoVta", pTipoPtoVta); + args.put("pricingTipoPtoVtaList", pricingTipoPtoVtaList); + + openWindow("/gui/pricing/editarPricingTipoPtoVta.zul", + Labels.getLabel("editarPricingController.windowTipoPtoVta.title"), args, MODAL); + } + + public void onClick$btnModificarTipoPtoVta(Event ev) { + + PricingTipoPtoVta pTipoPtoVta = (PricingTipoPtoVta) pricingTipoPtoVtaList.getSelected(); + + if (pTipoPtoVta != null) { + verPricingTipoPtoVta(pTipoPtoVta); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarCategoria(Event ev) throws Exception { + List listPCategoria = pricingCategoriaList.getSelectedsItens(); + if (listPCategoria != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaCategoria"), + Labels.getLabel("editarPricingController.windowCategoria.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + for (Object o : listPCategoria) { + PricingCategoria pCategoria = (PricingCategoria) o; + lsPricingCategoria.remove(pCategoria); + + pCategoria.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pCategoria.setFecmodif(Calendar.getInstance().getTime()); + pCategoria.setActivo(Boolean.FALSE); + + lsPricingCategoria.add(pCategoria); + pricingCategoriaList.removeItem(pCategoria); + pricingCategoriaList.clearSelection(); + + pricing.setPricingCategoriaList(lsPricingCategoria); + pricingService.actualizacion(pricing); + } + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoCategoria(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingCategoria pCategoria = new PricingCategoria(); + pCategoria.setPricing(pricing); + verPricingCategoria(pCategoria); + } + + private void verPricingCategoria(PricingCategoria pCategoria) { + + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingCategoria", pCategoria); + args.put("pricingCategoriaList", pricingCategoriaList); + + openWindow("/gui/pricing/editarPricingCategoria.zul", + Labels.getLabel("editarPricingController.windowCategoria.title"), args, MODAL); + } + + public void onClick$btnModificarCategoria(Event ev) { + + PricingCategoria pCategoria = (PricingCategoria) pricingCategoriaList.getSelected(); + + if (pCategoria != null) { + verPricingCategoria(pCategoria); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarRuta(Event ev) throws Exception { + + List listRuta = pricingRutaList.getSelectedsItens(); + if (listRuta != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaRuta"), + Labels.getLabel("editarPricingController.windowRuta.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + for (Object r : listRuta) { + PricingRuta pRuta = (PricingRuta) r; + + lsPricingRuta.remove(pRuta); + + pRuta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pRuta.setFecmodif(Calendar.getInstance().getTime()); + pRuta.setActivo(Boolean.FALSE); + + lsPricingRuta.add(pRuta); + pricingRutaList.removeItem(pRuta); + + + } + pricingRutaList.clearSelection(); + pricing.setPricingRutaList(lsPricingRuta); + pricingService.actualizacion(pricing); + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoRuta(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingRuta pRuta = new PricingRuta(); + pRuta.setPricing(pricing); + verPricingRuta(pRuta); + } + + private void verPricingRuta(PricingRuta pRuta) { + + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingRuta", pRuta); + args.put("pricingRutaList", pricingRutaList); + + openWindow("/gui/pricing/editarPricingRuta.zul", + Labels.getLabel("editarPricingController.windowRuta.title"), args, MODAL); + } + + public void onClick$btnModificarRuta(Event ev) { + + PricingRuta pRuta = (PricingRuta) pricingRutaList.getSelected(); + + if (pRuta != null) { + verPricingRuta(pRuta); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarMercado(Event ev) throws Exception { + PricingMercado pMercado = (PricingMercado) pricingMercadoList.getSelected(); + if (pMercado != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaMercado"), + Labels.getLabel("editarPricingController.windowMercado.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsPricingMercado.remove(pMercado); + + pMercado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pMercado.setFecmodif(Calendar.getInstance().getTime()); + pMercado.setActivo(Boolean.FALSE); + + lsPricingMercado.add(pMercado); + pricingMercadoList.removeItem(pMercado); + pricingMercadoList.clearSelection(); + + pricing.setPricingMercadoList(lsPricingMercado); + pricingService.actualizacion(pricing); + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoMercado(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingMercado pMercado = new PricingMercado(); + pMercado.setPricing(pricing); + + verPricingMercado(pMercado); + } + + private void verPricingMercado(PricingMercado pMercado) { + + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingMercado", pMercado); + args.put("pricingMercadoList", pricingMercadoList); + + openWindowPosi("/gui/pricing/editarPricingMercado.zul", + Labels.getLabel("editarPricingController.windowMercado.title"), args, MODAL, "center,top"); + } + + public void onClick$btnModificarMercado(Event ev) { + + PricingMercado pMercado = (PricingMercado) pricingMercadoList.getSelected(); + + if (pMercado != null) { + verPricingMercado(pMercado); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarCorrida(Event ev) throws Exception { + PricingCorrida pCorrida = (PricingCorrida) pricingCorridaList.getSelected(); + if (pCorrida != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaCorrida"), + Labels.getLabel("editarPricingController.windowCorrida.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pCorrida.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pCorrida.setFecmodif(Calendar.getInstance().getTime()); + pCorrida.setActivo(Boolean.FALSE); + + pricing.setPricingCorridaList(lsPricingCorrida); + pricingService.actualizacion(pricing); + + lsPricingCorrida.remove(pCorrida); + pricingCorridaList.removeItem(pCorrida); + pricingCorridaList.clearSelection(); + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoCorrida(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + + verPricingCorrida(); + } + + private void verPricingCorrida() { + + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricing", pricing); + args.put("pricingCorridaList", pricingCorridaList); + + openWindow("/gui/pricing/editarPricingCorrida.zul", + Labels.getLabel("editarPricingController.windowCorrida.title"), args, MODAL); + } + + public void onClick$btnModificarCorrida(Event ev) { + + PricingCorrida pCorrida = (PricingCorrida) pricingCorridaList.getSelected(); + + if (pCorrida != null) { + verPricingCorrida(); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarDia(Event ev) throws Exception { + PricingDia pDia = (PricingDia) pricingDiaList.getSelected(); + if (pDia != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaDia"), + Labels.getLabel("editarPricingController.windowDia.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsPricingDia.remove(pDia); + + pDia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pDia.setFecmodif(Calendar.getInstance().getTime()); + pDia.setActivo(Boolean.FALSE); + + lsPricingDia.add(pDia); + pricingDiaList.removeItem(pDia); + pricingDiaList.clearSelection(); + + pricing.setPricingDiaList(lsPricingDia); + pricingService.actualizacion(pricing); + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoDia(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingDia pDia = new PricingDia(); + pDia.setPricing(pricing); + verPricingDia(pDia); + } + + private void verPricingDia(PricingDia pDia) { + + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingDia", pDia); + args.put("pricingDiaList", pricingDiaList); + + openWindow("/gui/pricing/editarPricingDia.zul", + Labels.getLabel("editarPricingController.windowDia.title"), args, MODAL); + } + + public void onClick$btnModificarDia(Event ev) { + + PricingDia pDia = (PricingDia) pricingDiaList.getSelected(); + + if (pDia != null) { + verPricingDia(pDia); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarOcupacion(Event ev) throws Exception { + PricingOcupacion pOcupacion = (PricingOcupacion) pricingOcupacionList.getSelected(); + if (pOcupacion != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaOcupacion"), + Labels.getLabel("editarPricingController.windowOcupacion.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsPricingOcupacion.remove(pOcupacion); + + pOcupacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pOcupacion.setFecmodif(Calendar.getInstance().getTime()); + pOcupacion.setActivo(Boolean.FALSE); + + lsPricingOcupacion.add(pOcupacion); + pricingOcupacionList.removeItem(pOcupacion); + pricingOcupacionList.clearSelection(); + + pricing.setPricingOcupacionList(lsPricingOcupacion); + pricingService.actualizacion(pricing); + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoOcupacion(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingOcupacion pOcupacion = new PricingOcupacion(); + pOcupacion.setPricing(pricing); + verPricingOcupacion(pOcupacion); + } + + private void verPricingOcupacion(PricingOcupacion pOcupacion) { + + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingOcupacion", pOcupacion); + args.put("pricing", pricing); + args.put("pricingOcupacionList", pricingOcupacionList); + + openWindow("/gui/pricing/editarPricingOcupacion.zul", + Labels.getLabel("editarPricingController.windowOcupacion.title"), args, MODAL); + } + + public void onClick$btnModificarOcupacion(Event ev) { + + PricingOcupacion pOcupacion = (PricingOcupacion) pricingOcupacionList.getSelected(); + + if (pOcupacion != null) { + verPricingOcupacion(pOcupacion); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarAsiento(Event ev) throws Exception { + PricingAsiento pAsiento = (PricingAsiento) pricingAsientoList.getSelected(); + if (pAsiento != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaAsiento"), + Labels.getLabel("editarPricingController.windowAsiento.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsPricingAsiento.remove(pAsiento); + + pAsiento.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pAsiento.setFecmodif(Calendar.getInstance().getTime()); + pAsiento.setActivo(Boolean.FALSE); + + lsPricingAsiento.add(pAsiento); + pricingAsientoList.removeItem(pAsiento); + pricingAsientoList.clearSelection(); + + pricing.setPricingAsientoList(lsPricingAsiento); + pricingService.actualizacion(pricing); + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoAsiento(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingAsiento pAsiento = new PricingAsiento(); + pAsiento.setPricing(pricing); + verPricingAsiento(pAsiento); + } + + private void verPricingAsiento(PricingAsiento pAsiento) { + + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingAsiento", pAsiento); + args.put("pricingAsientoList", pricingAsientoList); + + openWindow("/gui/pricing/editarPricingAsiento.zul", + Labels.getLabel("editarPricingController.windowAsiento.title"), args, MODAL); + } + + public void onClick$btnModificarAsiento(Event ev) { + + PricingAsiento pAsiento = (PricingAsiento) pricingAsientoList.getSelected(); + + if (pAsiento != null) { + verPricingAsiento(pAsiento); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarAnticipacion(Event ev) throws Exception { + PricingAnticipacion pAnticipacion = (PricingAnticipacion) pricingAnticipacionList.getSelected(); + if (pAnticipacion != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaAnticipacion"), + Labels.getLabel("editarPricingController.windowAnticipacion.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsPricingAnticipacion.remove(pAnticipacion); + + pAnticipacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pAnticipacion.setFecmodif(Calendar.getInstance().getTime()); + pAnticipacion.setActivo(Boolean.FALSE); + + lsPricingAnticipacion.add(pAnticipacion); + pricingAnticipacionList.removeItem(pAnticipacion); + pricingAnticipacionList.clearSelection(); + + pricing.setPricingAnticipacionList(lsPricingAnticipacion); + pricingService.actualizacion(pricing); + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoAnticipacion(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingAnticipacion pAnticipacion = new PricingAnticipacion(); + pAnticipacion.setPricing(pricing); + verPricingAnticipacion(pAnticipacion); + } + + private void verPricingAnticipacion(PricingAnticipacion pAnticipacion) { + + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingAnticipacion", pAnticipacion); + args.put("pricingAnticipacionList", pricingAnticipacionList); + + openWindow("/gui/pricing/editarPricingAnticipacion.zul", + Labels.getLabel("editarPricingController.windowAnticipacion.title"), args, MODAL); + } + + public void onClick$btnModificarAnticipacion(Event ev) { + + PricingAnticipacion pAnticipacion = (PricingAnticipacion) pricingAnticipacionList.getSelected(); + + if (pAnticipacion != null) { + verPricingAnticipacion(pAnticipacion); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public void onClick$btnApagarTipoServicio(Event ev) throws Exception { + PricingTipoServicio pTipoServicio = (PricingTipoServicio) pricingTipoServicioList.getSelected(); + if (pTipoServicio != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaTipoServicio"), + Labels.getLabel("editarPricingController.windowTipoServicio.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + if (resp == Messagebox.YES) { + lsPricingTipoServicio.remove(pTipoServicio); + + pTipoServicio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pTipoServicio.setFecmodif(Calendar.getInstance().getTime()); + pTipoServicio.setActivo(Boolean.FALSE); + + lsPricingTipoServicio.add(pTipoServicio); + pricingTipoServicioList.removeItem(pTipoServicio); + pricingTipoServicioList.clearSelection(); + + pricing.setPricingTipoServicioList(lsPricingTipoServicio); + pricingService.actualizacion(pricing); + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnNovoTipoServicio(Event ev) throws InterruptedException { + if (!validarNome()) { + return; + } + PricingTipoServicio pTipoServicio = new PricingTipoServicio(); + pTipoServicio.setPricing(pricing); + verPricingTipoServicio(pTipoServicio); + } + + private void verPricingTipoServicio(PricingTipoServicio pTipoServicio) { + + if (pricing.getPricingId() == null) { + pricingService.suscribir(pricing); + } + + Map args = new HashMap(); + args.put("pricingTipoServicio", pTipoServicio); + args.put("pricingTipoServicioList", pricingTipoServicioList); + + openWindow("/gui/pricing/editarPricingTipoServicio.zul", + Labels.getLabel("editarPricingController.windowTipoServicio.title"), args, MODAL); + } + + public void onClick$btnModificarTipoServicio(Event ev) { + + PricingTipoServicio pTipoServicio = (PricingTipoServicio) pricingTipoServicioList.getSelected(); + + if (pTipoServicio != null) { + verPricingTipoServicio(pTipoServicio); + } else { + try { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } catch (InterruptedException ex) { + java.util.logging.Logger.getLogger(EditarPricingController.class.getName()).log(Level.SEVERE, null, ex); + } + } + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public Pricing getPricing() { + return pricing; + } + + public void setPricing(Pricing pricing) { + this.pricing = pricing; + } + + public MyListbox getPricingList() { + return pricingList; + } + + public void setPricingList(MyListbox pricingList) { + this.pricingList = pricingList; + } + + public PricingService getPricingService() { + return pricingService; + } + + public void setPricingService(PricingService pricingService) { + this.pricingService = pricingService; + } + + public List getLsPricingVigencia() { + return lsPricingVigencia; + } + + public void setLsPricingVigencia(List lsPricingVigencia) { + this.lsPricingVigencia = lsPricingVigencia; + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public List getLsPricingAsiento() { + return lsPricingAsiento; + } + + public void setLsPricingAsiento(List lsPricingAsiento) { + this.lsPricingAsiento = lsPricingAsiento; + } + + public List getLsPricingCategoria() { + return lsPricingCategoria; + } + + public void setLsPricingCategoria(List lsPricingCategoria) { + this.lsPricingCategoria = lsPricingCategoria; + } + + public List getLsPricingClase() { + return lsPricingClase; + } + + public void setLsPricingClase(List lsPricingClase) { + this.lsPricingClase = lsPricingClase; + } + + public List getLsPricingDia() { + return lsPricingDia; + } + + public void setLsPricingDia(List lsPricingDia) { + this.lsPricingDia = lsPricingDia; + } + + public List getLsPricingImporte() { + return lsPricingImporte; + } + + public void setLsPricingImporte(List lsPricingImporte) { + this.lsPricingImporte = lsPricingImporte; + } + + public List getLsPricingMarca() { + return lsPricingMarca; + } + + public void setLsPricingMarca(List lsPricingMarca) { + this.lsPricingMarca = lsPricingMarca; + } + + public List getLsPricingMercado() { + return lsPricingMercado; + } + + public void setLsPricingMercado(List lsPricingMercado) { + this.lsPricingMercado = lsPricingMercado; + } + + public List getLsPricingOcupacion() { + return lsPricingOcupacion; + } + + public void setLsPricingOcupacion(List lsPricingOcupacion) { + this.lsPricingOcupacion = lsPricingOcupacion; + } + + public List getLsPricingRuta() { + return lsPricingRuta; + } + + public void setLsPricingRuta(List lsPricingRuta) { + this.lsPricingRuta = lsPricingRuta; + } + + public MyListbox getPricingImporteList() { + return pricingImporteList; + } + + public void setPricingImporteList(MyListbox pricingImporteList) { + this.pricingImporteList = pricingImporteList; + } + + public MyListbox getPricingVigenciaList() { + return pricingVigenciaList; + } + + public void setPricingVigenciaList(MyListbox pricingVigenciaList) { + this.pricingVigenciaList = pricingVigenciaList; + } + + public Radio getRdCanceNo() { + return rdCanceNo; + } + + public void setRdCanceNo(Radio rdCanceNo) { + this.rdCanceNo = rdCanceNo; + } + + public Radio getRdCanceSi() { + return rdCanceSi; + } + + public void setRdCanceSi(Radio rdCanceSi) { + this.rdCanceSi = rdCanceSi; + } + + public Radio getRdReserNo() { + return rdReserNo; + } + + public void setRdReserNo(Radio rdReserNo) { + this.rdReserNo = rdReserNo; + } + + public Radio getRdReserSi() { + return rdReserSi; + } + + public void setRdReserSi(Radio rdReserSi) { + this.rdReserSi = rdReserSi; + } + + public Radio getRdTransNo() { + return rdTransNo; + } + + public void setRdTransNo(Radio rdTransNo) { + this.rdTransNo = rdTransNo; + } + + public Radio getRdTransSi() { + return rdTransSi; + } + + public void setRdTransSi(Radio rdTransSi) { + this.rdTransSi = rdTransSi; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Button getBtnApagarImporte() { + return btnApagarImporte; + } + + public void setBtnApagarImporte(Button btnApagarImporte) { + this.btnApagarImporte = btnApagarImporte; + } + + public Button getBtnModificarImporte() { + return btnModificarImporte; + } + + public void setBtnModificarImporte(Button btnModificarImporte) { + this.btnModificarImporte = btnModificarImporte; + } + + public Button getBtnNovoImporte() { + return btnNovoImporte; + } + + public void setBtnNovoImporte(Button btnNovoImporte) { + this.btnNovoImporte = btnNovoImporte; + } + + public Radio getRadioImp() { + return radioImp; + } + + public void setRadioImp(Radio radioImp) { + this.radioImp = radioImp; + } + + public Radio getRadioPor() { + return radioPor; + } + + public void setRadioPor(Radio radioPor) { + this.radioPor = radioPor; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingCorridaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingCorridaController.java new file mode 100644 index 000000000..77222983b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingCorridaController.java @@ -0,0 +1,261 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Timebox; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.CorridaCtrl; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingCorrida; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.CorridaCtrlService; +import com.rjconsultores.ventaboletos.service.CorridaService; +import com.rjconsultores.ventaboletos.service.PricingCorridaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEditarPricingCorrida; + +/** + * + * @author Rafius + */ +@Controller("editarPricingCorridaController") +@Scope("prototype") +public class EditarPricingCorridaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwCorrida; + @Autowired + private PricingCorridaService pricingCorridaService; + @Autowired + private CorridaCtrlService corridaCtrlService; + @Autowired + private CorridaService corridaService; + @Autowired + private ClaseServicioService claseServicioService; + private List lsClaseServicio; + private Pricing pricing; + private MyListbox pricingCorridaList; + private MyListbox corridaList; + private Intbox idCorrida; + private Combobox cmbParadaOrigem; + private Combobox cmbParadaDestino; + private Combobox cmbTipoServicio; + private Timebox timeInicio; + private Timebox timeFin; + private static Logger log = Logger.getLogger(EditarPricingCorridaController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsClaseServicio = claseServicioService.buscarTodosExceto(-1); + + super.doAfterCompose(comp); + + pricing = (Pricing) Executions.getCurrent().getArg().get("pricing"); + pricingCorridaList = (MyListbox) Executions.getCurrent().getArg().get("pricingCorridaList"); + + corridaList.setItemRenderer(new RenderEditarPricingCorrida()); + } + + private void refreshLista() throws InterruptedException { + + Comboitem cbiOrigem = cmbParadaOrigem.getSelectedItem(); + Parada origem = null; + if (cbiOrigem != null) { + origem = (Parada) cbiOrigem.getValue(); + } + + Comboitem cbiDestino = cmbParadaDestino.getSelectedItem(); + Parada destino = null; + if (cbiDestino != null) { + destino = (Parada) cbiDestino.getValue(); + } + + Comboitem cbiTipoServicio = cmbTipoServicio.getSelectedItem(); + ClaseServicio claseServicio = null; + if (cbiTipoServicio != null) { + claseServicio = (ClaseServicio) cbiTipoServicio.getValue(); + } + + corridaList.setData(corridaService.buscarDistinct(origem, destino, timeInicio.getValue(), timeFin.getValue(), claseServicio, idCorrida.getValue())); + + if (corridaList.getData().length == 0) { + + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), Labels.getLabel("busquedaPricingController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + + } + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + cmbParadaOrigem.clearErrorMessage(); + cmbParadaDestino.clearErrorMessage(); + cmbTipoServicio.clearErrorMessage(); + + if (idCorrida.getValue() == null) { + cmbParadaOrigem.setConstraint("no empty"); + cmbParadaDestino.setConstraint("no empty"); + cmbTipoServicio.setConstraint("no empty"); + + cmbParadaOrigem.getValue(); + cmbParadaDestino.getValue(); + cmbTipoServicio.getValue(); + } + + refreshLista(); + } + + public void onClick$btnAdicionarCorrida(Event ev) throws Exception { + try { + List lsPricingViagem = (pricing.getPricingCorridaList() == null) ? new ArrayList() : pricing.getPricingCorridaList(); + List ls = corridaList.getSelectedsItens(); + if (!ls.isEmpty()) { + for (Object o : ls) { + Boolean achou = Boolean.FALSE; + Corrida corrida = (Corrida) o; + if (corrida.getCorridaCtrl() == null) { + CorridaCtrl cc = corridaCtrlService.obtenerID(corrida.getId().getCorridaId()); + if (cc != null) { + corrida.setCorridaCtrl(cc); + } + } + for (PricingCorrida pc : lsPricingViagem) { + if (pc.getCorridaCtrl().getCorridaId().equals(corrida.getCorridaCtrl().getCorridaId())) { + achou = Boolean.TRUE; + } + } + + if (!achou) { + PricingCorrida p = new PricingCorrida(); + p.setActivo(Boolean.TRUE); + + p.setCorridaCtrl(corrida.getCorridaCtrl()); + + p.setFecmodif(Calendar.getInstance().getTime()); + p.setPricing(pricing); + p.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + lsPricingViagem.add(p); + } + } + + pricing.setPricingCorridaList(lsPricingViagem); + pricingCorridaList.setData(lsPricingViagem); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public MyListbox getPricingCorridaList() { + return pricingCorridaList; + } + + public void setPricingCorridaList(MyListbox pricingCorridaList) { + this.pricingCorridaList = pricingCorridaList; + } + + public PricingCorridaService getPricingCorridaService() { + return pricingCorridaService; + } + + public void setPricingCorridaService(PricingCorridaService pricingCorridaService) { + this.pricingCorridaService = pricingCorridaService; + } + + public CorridaCtrlService getCorridaCtrlService() { + return corridaCtrlService; + } + + public void setCorridaCtrlService(CorridaCtrlService corridaCtrlService) { + this.corridaCtrlService = corridaCtrlService; + } + + public Intbox getIdCorrida() { + return idCorrida; + } + + public void setIdCorrida(Intbox idCorrida) { + this.idCorrida = idCorrida; + } + + public Combobox getCmbParadaDestino() { + return cmbParadaDestino; + } + + public void setCmbParadaDestino(Combobox cmbParadaDestino) { + this.cmbParadaDestino = cmbParadaDestino; + } + + public Combobox getCmbParadaOrigem() { + return cmbParadaOrigem; + } + + public void setCmbParadaOrigem(Combobox cmbParadaOrigem) { + this.cmbParadaOrigem = cmbParadaOrigem; + } + + public MyListbox getCorridaList() { + return corridaList; + } + + public void setCorridaList(MyListbox corridaList) { + this.corridaList = corridaList; + } + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + public Combobox getCmbTipoServicio() { + return cmbTipoServicio; + } + + public void setCmbTipoServicio(Combobox cmbTipoServicio) { + this.cmbTipoServicio = cmbTipoServicio; + } + + public Timebox getTimeFin() { + return timeFin; + } + + public void setTimeFin(Timebox timeFin) { + this.timeFin = timeFin; + } + + public Timebox getTimeInicio() { + return timeInicio; + } + + public void setTimeInicio(Timebox timeInicio) { + this.timeInicio = timeInicio; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingDiaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingDiaController.java new file mode 100644 index 000000000..8b4d458e5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingDiaController.java @@ -0,0 +1,272 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.PricingDia; +import com.rjconsultores.ventaboletos.service.PricingDiaService; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Timebox; + +/** + * + * @author Rafius + */ +@Controller("editarPricingDiaController") +@Scope("prototype") +public class EditarPricingDiaController extends MyGenericForwardComposer { + + @Autowired + private PricingDiaService pricingDiaService; + private PricingDia pricingDia; + private MyListbox pricingDiaList; + private static Logger log = Logger.getLogger(EditarPricingDiaController.class); + private Checkbox rdLun; + private Checkbox rdMar; + private Checkbox rdMie; + private Checkbox rdJue; + private Checkbox rdVie; + private Checkbox rdSab; + private Checkbox rdDom; + private Timebox horarioinicio; + private Timebox horariofin; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + pricingDia = (PricingDia) Executions.getCurrent().getArg().get("pricingDia"); + pricingDiaList = (MyListbox) Executions.getCurrent().getArg().get("pricingDiaList"); + + super.doAfterCompose(comp); + + if (pricingDia.getPricingdiaId() != null) { + if (pricingDia.getIndlunes() == Boolean.TRUE) { + rdLun.setChecked(true); + } + if (pricingDia.getIndmartes() == Boolean.TRUE) { + rdMar.setChecked(true); + } + if (pricingDia.getIndmiercoles() == Boolean.TRUE) { + rdMie.setChecked(true); + } + if (pricingDia.getIndjueves() == Boolean.TRUE) { + rdJue.setChecked(true); + } + if (pricingDia.getIndviernes() == Boolean.TRUE) { + rdVie.setChecked(true); + } + if (pricingDia.getIndsabado() == Boolean.TRUE) { + rdSab.setChecked(true); + } + if (pricingDia.getInddomingo() == Boolean.TRUE) { + rdDom.setChecked(true); + } + } + } + + public boolean noTraslapa() { + List lsVT1 = pricingDiaService.buscarTraslapa(pricingDia); + + // Nao Traslapen + Boolean podeSalvar = false; + Boolean[] podeTodos = new Boolean[lsVT1.isEmpty() ? 1 : lsVT1.size()]; + boolean podeMesmo = true; + + // Se a lista for nula / Salva + if (lsVT1.isEmpty()) { + podeMesmo = true; + podeTodos[0] = true; + // Se a lista não for nula e for algo novo... não pode salvar + } else { + int i = 0; + for (PricingDia p : lsVT1) { + if (p.getPricingdiaId().equals(pricingDia.getPricingdiaId())) { + podeTodos[i] = true; + continue; + } + podeSalvar = true; + if (pricingDia.getIndlunes()) { + if (p.getIndlunes() == pricingDia.getIndlunes()) { + podeSalvar = false; + } + } + if (pricingDia.getIndmartes()) { + if (p.getIndmartes() == pricingDia.getIndmartes()) { + podeSalvar = false; + } + } + if (pricingDia.getIndmiercoles()) { + if (p.getIndmiercoles() == pricingDia.getIndmiercoles()) { + podeSalvar = false; + } + } + if (pricingDia.getIndjueves()) { + if (p.getIndjueves() == pricingDia.getIndjueves()) { + podeSalvar = false; + } + } + if (pricingDia.getIndviernes()) { + if (p.getIndviernes() == pricingDia.getIndviernes()) { + podeSalvar = false; + } + } + if (pricingDia.getIndsabado()) { + if (p.getIndsabado() == pricingDia.getIndsabado()) { + podeSalvar = false; + } + } + if (pricingDia.getInddomingo()) { + if (p.getInddomingo() == pricingDia.getInddomingo()) { + podeSalvar = false; + } + } + podeTodos[i] = podeSalvar; + i++; + } + } + + for (int i = 0; i < podeTodos.length; i++) { + if (podeTodos[i] != null) { + if (!podeTodos[i]) { + podeMesmo = false; + } + } + } + return podeMesmo; + } + + public void onClick$btnAdicionarDia(Event ev) throws Exception { + + horarioinicio.getValue(); + horariofin.getValue(); + + horarioinicio.setValue(DateUtil.getFecInicio(horarioinicio.getValue()).getTime()); + horariofin.setValue(DateUtil.getFecInicio(horariofin.getValue()).getTime()); + + if (horarioinicio.getValue().after(horariofin.getValue())) { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.datas"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + + if (!rdLun.isChecked() && !rdMar.isChecked() && !rdMie.isChecked() && !rdJue.isChecked() && !rdVie.isChecked() && !rdSab.isChecked() && !rdDom.isChecked()) { + Clients.alert(Labels.getLabel("EditarPricingDiaController.MSG.obligatorioDia"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.EXCLAMATION); + + return; + } + try { + pricingDia.setIndlunes(rdLun.isChecked() ? Boolean.TRUE : Boolean.FALSE); + pricingDia.setIndmartes(rdMar.isChecked() ? Boolean.TRUE : Boolean.FALSE); + pricingDia.setIndmiercoles(rdMie.isChecked() ? Boolean.TRUE : Boolean.FALSE); + pricingDia.setIndjueves(rdJue.isChecked() ? Boolean.TRUE : Boolean.FALSE); + pricingDia.setIndviernes(rdVie.isChecked() ? Boolean.TRUE : Boolean.FALSE); + pricingDia.setIndsabado(rdSab.isChecked() ? Boolean.TRUE : Boolean.FALSE); + pricingDia.setInddomingo(rdDom.isChecked() ? Boolean.TRUE : Boolean.FALSE); + + pricingDia.setHorarioinicio(DateUtil.getFecInicio(horarioinicio.getValue()).getTime()); + pricingDia.setHorariofin(DateUtil.getFecInicio(horariofin.getValue()).getTime()); + + if (noTraslapa()) { + if (pricingDia.getPricingdiaId() != null) { + + pricingDiaService.actualizacion(pricingDia); + pricingDiaList.updateItem(pricingDia); + } else { + pricingDiaService.suscribir(pricingDia); + pricingDiaList.addItem(pricingDia); + } + closeWindow(); + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.traslapa"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert(Labels.getLabel("MSG.Error"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.ERROR); + } + + } + + public void onClick$btnRemoverDia(Event ev) { + try { + PricingDia pDia = (PricingDia) pricingDiaList.getSelected(); + if (pDia != null) { + int resp = Messagebox.show(Labels.getLabel("editarPricingController.MSG.borrarPerguntaDia"), Labels.getLabel("editarPricingController.windowDia.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingDia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingDia.setFecmodif(Calendar.getInstance().getTime()); + pricingDia.setActivo(Boolean.FALSE); + + pricingDiaList.removeItem(pricingDia); + pricingDiaService.borrar(pricingDia); + closeWindow(); + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), Labels.getLabel("editarPricingController.windowDia.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + + } + + public PricingDia getPricingDia() { + return pricingDia; + } + + public void setPricingDia(PricingDia pricingDia) { + this.pricingDia = pricingDia; + } + + public MyListbox getPricingDiaList() { + return pricingDiaList; + } + + public void setPricingDiaList(MyListbox pricingDiaList) { + this.pricingDiaList = pricingDiaList; + } + + public PricingDiaService getPricingDiaService() { + return pricingDiaService; + } + + public void setPricingDiaService(PricingDiaService pricingDiaService) { + this.pricingDiaService = pricingDiaService; + } + + public Timebox getHorariofin() { + return horariofin; + } + + public void setHorariofin(Timebox horariofin) { + this.horariofin = horariofin; + } + + public Timebox getHorarioinicio() { + return horarioinicio; + } + + public void setHorarioinicio(Timebox horarioinicio) { + this.horarioinicio = horarioinicio; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingEspecificoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingEspecificoController.java new file mode 100644 index 000000000..3ad861f74 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingEspecificoController.java @@ -0,0 +1,546 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.PricingEspecifico; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.service.CategoriaService; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.PricingEspecificoService; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Cássio Rocha + */ +@Controller("editarPricingEspecificoController") +@Scope("prototype") +public class EditarPricingEspecificoController extends MyGenericForwardComposer { + + @Autowired + private PricingEspecificoService pricingEspecificoService; + @Autowired + private TipoPuntoVentaService puntoVentaService; + @Autowired + private CategoriaService categoriaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private MarcaService marcaService; + @Autowired + private ParadaService paradaService; + @Autowired + private MonedaService monedaService; + private PricingEspecifico pricingEspecifico; + private MyListbox pricingList; + private Combobox cmbPtovta; + private Combobox cmbCategoria; + private Combobox cmbServicio; + private Combobox cmbMarca; + private Combobox cmbOrigem; + private Combobox cmbMoneda; + private Combobox cmbDestino; + private List lsPtovata; + private List lsCategoria; + private List lsclaseServicio; + private List lsMarca; + private List lsMoneda; + private Button btnApagar; + private Datebox fechaInicio; + private Datebox fechaFin; + private Textbox tarifa; + private Textbox tarifaAbierto; + private Textbox nombrePricing; + private static Logger log = Logger.getLogger(EditarPricingController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Datebox getFechaInicio() { + return fechaInicio; + } + + public void setFechaInicio(Datebox fechaInicio) { + this.fechaInicio = fechaInicio; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsCategoria = categoriaService.obtenerTodos(); + lsMarca = marcaService.obtenerTodos(); + lsMoneda = monedaService.obtenerTodos(); + lsPtovata = puntoVentaService.obtenerTodos(); + lsclaseServicio = claseServicioService.obtenerTodos(); + pricingEspecifico = (PricingEspecifico) Executions.getCurrent().getArg().get("pricingEspecifico"); + pricingList = (MyListbox) Executions.getCurrent().getArg().get("pricingList"); + + super.doAfterCompose(comp); + + if (pricingEspecifico.getPricingespecificoId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + Parada origem = pricingEspecifico.getParada(); + if (origem != null) { + cmbOrigem.setText(origem.getDescparada()); + } + + Parada destino = pricingEspecifico.getParada1(); + if (destino != null) { + cmbDestino.setText(destino.getDescparada()); + } + } + + fechaInicio.focus(); + } + + public void onClick$btnApagar(Event e) { + //Esclusão Logica + try { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPergunta"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingEspecificoService.borrar(pricingEspecifico); + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarOK"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + pricingList.removeItem(pricingEspecifico); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + nombrePricing.getValue(); + fechaInicio.getValue(); + fechaFin.getValue(); + tarifa.getValue(); + tarifaAbierto.getValue(); + + try { + if (pricingEspecifico.getTipoPtovta() == null) { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.tipoPtoVta"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (pricingEspecifico.getCategoria() == null) { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.categoria"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (pricingEspecifico.getClaseServicio() == null) { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.claseServicio"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (pricingEspecifico.getMarca() == null) { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.marca"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (pricingEspecifico.getParada() == null) { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.origen"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (pricingEspecifico.getParada1() == null) { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.destino"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (pricingEspecifico.getMoneda() == null) { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.moneda"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (pricingEspecifico.getFechorinicio().after(pricingEspecifico.getFechorfin())) { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.datasFecha"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + + List lsPricing = pricingEspecificoService.buscarPorNome(pricingEspecifico); + boolean podeSalvar = false; + if (lsPricing.isEmpty()) { + podeSalvar = true; + } else { + for (PricingEspecifico p : lsPricing) { + if (p.getPricingespecificoId().equals(pricingEspecifico.getPricingespecificoId())) { + podeSalvar = true; + } + } + } + + if (podeSalvar) { + + if (pricingEspecifico.getPricingespecificoId() == null) { + pricingEspecificoService.suscribir(pricingEspecifico); + pricingList.addItem(pricingEspecifico); + } else { + pricingEspecificoService.actualizacion(pricingEspecifico); + pricingList.updateItem(pricingEspecifico); + } + + Messagebox.show(Labels.getLabel("editarPricingController.MSG.suscribirOK"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("busquedaPricingEspecificoController.window.title"), + Messagebox.OK, Messagebox.ERROR); + + } + } + + /** + * @return the pricingEspecificoService + */ + public PricingEspecificoService getPricingEspecificoService() { + return pricingEspecificoService; + } + + /** + * @param pricingEspecificoService the pricingEspecificoService to set + */ + public void setPricingEspecificoService(PricingEspecificoService pricingEspecificoService) { + this.pricingEspecificoService = pricingEspecificoService; + } + + /** + * @return the pricingEspecifico + */ + public PricingEspecifico getPricingEspecifico() { + return pricingEspecifico; + } + + /** + * @param pricingEspecifico the pricingEspecifico to set + */ + public void setPricingEspecifico(PricingEspecifico pricingEspecifico) { + this.pricingEspecifico = pricingEspecifico; + } + + /** + * @return the pricingList + */ + public MyListbox getPricingList() { + return pricingList; + } + + /** + * @param pricingList the pricingList to set + */ + public void setPricingList(MyListbox pricingList) { + this.pricingList = pricingList; + } + + /** + * @return the cmbPtovta + */ + public Combobox getCmbPtovta() { + return cmbPtovta; + } + + /** + * @param cmbPtovta the cmbPtovta to set + */ + public void setCmbPtovta(Combobox cmbPtovta) { + this.cmbPtovta = cmbPtovta; + } + + /** + * @return the cmbCategoria + */ + public Combobox getCmbCategoria() { + return cmbCategoria; + } + + /** + * @param cmbCategoria the cmbCategoria to set + */ + public void setCmbCategoria(Combobox cmbCategoria) { + this.cmbCategoria = cmbCategoria; + } + + /** + * @return the cmbServicio + */ + public Combobox getCmbServicio() { + return cmbServicio; + } + + /** + * @param cmbServicio the cmbServicio to set + */ + public void setCmbServicio(Combobox cmbServicio) { + this.cmbServicio = cmbServicio; + } + + /** + * @return the cmbMarca + */ + public Combobox getCmbMarca() { + return cmbMarca; + } + + /** + * @param cmbMarca the cmbMarca to set + */ + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + /** + * @return the cmbOrigem + */ + public Combobox getCmbOrigem() { + return cmbOrigem; + } + + /** + * @param cmbOrigem the cmbOrigem to set + */ + public void setCmbOrigem(Combobox cmbOrigem) { + this.cmbOrigem = cmbOrigem; + } + + /** + * @return the cmbMoneda + */ + public Combobox getCmbMoneda() { + return cmbMoneda; + } + + /** + * @param cmbMoneda the cmbMoneda to set + */ + public void setCmbMoneda(Combobox cmbMoneda) { + this.cmbMoneda = cmbMoneda; + } + + /** + * @return the cmbDestino + */ + public Combobox getCmbDestino() { + return cmbDestino; + } + + /** + * @param cmbDestino the cmbDestino to set + */ + public void setCmbDestino(Combobox cmbDestino) { + this.cmbDestino = cmbDestino; + } + + /** + * @return the lsPtovata + */ + public List getLsPtovata() { + return lsPtovata; + } + + /** + * @param lsPtovata the lsPtovata to set + */ + public void setLsPtovata(List lsPtovata) { + this.lsPtovata = lsPtovata; + } + + /** + * @return the lsCategoria + */ + public List getLsCategoria() { + return lsCategoria; + } + + /** + * @param lsCategoria the lsCategoria to set + */ + public void setLsCategoria(List lsCategoria) { + this.lsCategoria = lsCategoria; + } + + /** + * @return the lsclaseServicio + */ + public List getLsclaseServicio() { + return lsclaseServicio; + } + + /** + * @param lsclaseServicio the lsclaseServicio to set + */ + public void setLsclaseServicio(List lsclaseServicio) { + this.lsclaseServicio = lsclaseServicio; + } + + /** + * @return the lsMarca + */ + public List getLsMarca() { + return lsMarca; + } + + /** + * @param lsMarca the lsMarca to set + */ + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + /** + * @return the lsMoneda + */ + public List getLsMoneda() { + return lsMoneda; + } + + /** + * @param lsMoneda the lsMoneda to set + */ + public void setLsMoneda(List lsMoneda) { + this.lsMoneda = lsMoneda; + } + + /** + * @return the puntoVentaService + */ + public TipoPuntoVentaService getPuntoVentaService() { + return puntoVentaService; + } + + /** + * @param puntoVentaService the puntoVentaService to set + */ + public void setPuntoVentaService(TipoPuntoVentaService puntoVentaService) { + this.puntoVentaService = puntoVentaService; + } + + /** + * @return the categoriaService + */ + public CategoriaService getCategoriaService() { + return categoriaService; + } + + /** + * @param categoriaService the categoriaService to set + */ + public void setCategoriaService(CategoriaService categoriaService) { + this.categoriaService = categoriaService; + } + + /** + * @return the claseServicioService + */ + public ClaseServicioService getClaseServicioService() { + return claseServicioService; + } + + /** + * @param claseServicioService the claseServicioService to set + */ + public void setClaseServicioService(ClaseServicioService claseServicioService) { + this.claseServicioService = claseServicioService; + } + + /** + * @return the marcaService + */ + public MarcaService getMarcaService() { + return marcaService; + } + + /** + * @param marcaService the marcaService to set + */ + public void setMarcaService(MarcaService marcaService) { + this.marcaService = marcaService; + } + + /** + * @return the paradaService + */ + public ParadaService getParadaService() { + return paradaService; + } + + /** + * @param paradaService the paradaService to set + */ + public void setParadaService(ParadaService paradaService) { + this.paradaService = paradaService; + } + + /** + * @return the monedaService + */ + public MonedaService getMonedaService() { + return monedaService; + } + + /** + * @param monedaService the monedaService to set + */ + public void setMonedaService(MonedaService monedaService) { + this.monedaService = monedaService; + } + + public Textbox getTarifa() { + return tarifa; + } + + public void setTarifa(Textbox tarifa) { + this.tarifa = tarifa; + } + + public Textbox getTarifaAbierto() { + return tarifaAbierto; + } + + public void setTarifaAbierto(Textbox tarifaAbierto) { + this.tarifaAbierto = tarifaAbierto; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingImporteController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingImporteController.java new file mode 100644 index 000000000..af2de03c1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingImporteController.java @@ -0,0 +1,183 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.PricingImporte; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.service.PricingImporteService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import java.util.Calendar; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Combobox; + +/** + * + * @author Rafius + */ +@Controller("editarPricingImporteController") +@Scope("prototype") +public class EditarPricingImporteController extends MyGenericForwardComposer { + + @Autowired + private PricingImporteService pricingImporteService; + @Autowired + private MonedaService monedaService; + private List lsMoneda; + private PricingImporte pricingImporte; + private MyListbox pricingImporteList; + private Combobox cmbMoneda; + private MyTextboxDecimal importe; + private static Logger log = Logger.getLogger(EditarPricingImporteController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsMoneda = monedaService.obtenerTodos(); + + pricingImporte = (PricingImporte) Executions.getCurrent().getArg().get("pricingImporte"); + pricingImporteList = (MyListbox) Executions.getCurrent().getArg().get("pricingImporteList"); + + super.doAfterCompose(comp); + } + + public void onClick$btnAdicionarImporte(Event ev) throws Exception { + importe.getValue(); + cmbMoneda.getValue(); + + try { + if (pricingImporte.getMoneda() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowImporte.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + List lsPi = pricingImporteService.buscarMoneda(pricingImporte, pricingImporte.getMoneda()); + + if (lsPi.isEmpty()) { + if (pricingImporte.getPricingimporteId() != null) { + pricingImporteService.actualizacion(pricingImporte); + pricingImporteList.updateItem(pricingImporte); + } else { + pricingImporteService.suscribir(pricingImporte); + pricingImporteList.addItem(pricingImporte); + } + + closeWindow(); + } else if (lsPi.size() == 1) { + if (lsPi.get(0).getPricingimporteId().equals(pricingImporte.getPricingimporteId())) { + pricingImporteService.actualizacion(pricingImporte); + pricingImporteList.updateItem(pricingImporte); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.windowImporte.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.windowImporte.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } catch (Exception ex) { + log.error(ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPricingController.windowImporte.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnRemoverImporte(Event ev) { + try { + PricingImporte pImporte = (PricingImporte) pricingImporteList.getSelected(); + if (pImporte != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaImporte"), + Labels.getLabel("editarPricingController.windowImporte.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingImporte.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingImporte.setFecmodif(Calendar.getInstance().getTime()); + pricingImporte.setActivo(Boolean.FALSE); + + pricingImporteList.removeItem(pricingImporte); + pricingImporteService.borrar(pricingImporte); + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.windowImporte.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPricingController.windowImporte.title"), + Messagebox.EXCLAMATION); + } + + } + + public PricingImporte getPricingImporte() { + return pricingImporte; + } + + public void setPricingImporte(PricingImporte pricingImporte) { + this.pricingImporte = pricingImporte; + } + + public MyListbox getPricingImporteList() { + return pricingImporteList; + } + + public void setPricingImporteList(MyListbox pricingImporteList) { + this.pricingImporteList = pricingImporteList; + } + + public PricingImporteService getPricingImporteService() { + return pricingImporteService; + } + + public void setPricingImporteService(PricingImporteService pricingImporteService) { + this.pricingImporteService = pricingImporteService; + } + + public List getLsMoneda() { + return lsMoneda; + } + + public void setLsMoneda(List lsMoneda) { + this.lsMoneda = lsMoneda; + } + + public MonedaService getMonedaService() { + return monedaService; + } + + public void setMonedaService(MonedaService monedaService) { + this.monedaService = monedaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingMarcaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingMarcaController.java new file mode 100644 index 000000000..edef2bd09 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingMarcaController.java @@ -0,0 +1,152 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.PricingMarca; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.PricingMarcaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author Rafius + */ +@Controller("editarPricingMarcaController") +@Scope("prototype") +public class EditarPricingMarcaController extends MyGenericForwardComposer { + + @Autowired + private PricingMarcaService pricingMarcaService; + @Autowired + private MarcaService marcaService; + private List lsMarca; + private PricingMarca pricingMarca; + private MyListbox pricingMarcaList; + private Combobox cmbMarca; + private static Logger log = Logger.getLogger(EditarPricingMarcaController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsMarca = marcaService.obtenerTodos(); + + PricingMarca pm = (PricingMarca) Executions.getCurrent().getArg().get("pricingMarca"); + pricingMarca = (pm.getUsuarioId() == null) ? pm : pricingMarcaService.obtenerID(pm.getUsuarioId()); + pricingMarcaList = (MyListbox) Executions.getCurrent().getArg().get("pricingMarcaList"); + + super.doAfterCompose(comp); + + cmbMarca.focus(); + } + + public void onClick$btnAdicionarMarca(Event ev) throws Exception { + cmbMarca.getValue(); + + try { + if (pricingMarca.getMarca() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowMarca.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + Boolean existe = pricingMarcaService.obtenerPricingMarca(pricingMarca.getPricing(), (Marca) cmbMarca.getSelectedItem().getValue()); + if (existe) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.windowMarca.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (pricingMarca.getPricingmarcaId() != null) { + pricingMarcaService.actualizacion(pricingMarca); + pricingMarcaList.updateItem(pricingMarca); + } else { + pricingMarcaService.suscribir(pricingMarca); + pricingMarcaList.addItem(pricingMarca); + } + closeWindow(); + } + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnRemoverMarca(Event ev) { + try { + + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaMarca"), + Labels.getLabel("editarPricingController.windowMarca.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingMarca.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingMarca.setFecmodif(Calendar.getInstance().getTime()); + pricingMarca.setActivo(Boolean.FALSE); + + pricingMarcaList.removeItem(pricingMarca); + pricingMarcaService.borrar(pricingMarca); + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + + } + + public PricingMarca getPricingMarca() { + return pricingMarca; + } + + public void setPricingMarca(PricingMarca pricingMarca) { + this.pricingMarca = pricingMarca; + } + + public MyListbox getPricingMarcaList() { + return pricingMarcaList; + } + + public void setPricingMarcaList(MyListbox pricingMarcaList) { + this.pricingMarcaList = pricingMarcaList; + } + + public PricingMarcaService getPricingMarcaService() { + return pricingMarcaService; + } + + public void setPricingMarcaService(PricingMarcaService pricingMarcaService) { + this.pricingMarcaService = pricingMarcaService; + } + + public List getLsMarca() { + return lsMarca; + } + + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + public MarcaService getMarcaService() { + return marcaService; + } + + public void setMarcaService(MarcaService marcaService) { + this.marcaService = marcaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingMercadoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingMercadoController.java new file mode 100644 index 000000000..6bcf6ca0d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingMercadoController.java @@ -0,0 +1,231 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.PricingMercado; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.PricingMercadoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author Rafius + */ +@Controller("editarPricingMercadoController") +@Scope("prototype") +public class EditarPricingMercadoController extends MyGenericForwardComposer { + + @Autowired + private PricingMercadoService pricingMercadoService; + @Autowired + private ParadaService paradaService; + private PricingMercado pricingMercado; + private MyListbox pricingMercadoList; + private Combobox cmbOrigen; + private Combobox cmbDestino; + private static Logger log = Logger.getLogger(EditarPricingMercadoController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + + pricingMercado = (PricingMercado) Executions.getCurrent().getArg().get("pricingMercado"); + pricingMercadoList = (MyListbox) Executions.getCurrent().getArg().get("pricingMercadoList"); + + super.doAfterCompose(comp); + + if (pricingMercado.getPricingparadaId() != null) { + Parada origem = pricingMercado.getOrigen(); + if (origem != null) { + cmbOrigen.setText(origem.getDescparada()); + } + + Parada destino = pricingMercado.getDestino(); + if (destino != null) { + cmbDestino.setText(destino.getDescparada()); + } + } + } + + public void onClick$btnAdicionarMercado(Event ev) throws Exception { + cmbOrigen.getValue(); + cmbDestino.getValue(); + + try { + Parada origen = null; + if (cmbOrigen.getSelectedItem() == null) { + List lsParadaOri = paradaService.buscar(cmbOrigen.getText().toUpperCase()); + if (!lsParadaOri.isEmpty()) { + origen = lsParadaOri.get(0); + } + } else { + origen = (Parada) cmbOrigen.getSelectedItem().getValue(); + } + Parada destino = null; + if (cmbDestino.getSelectedItem() == null) { + List lsParadaOri = paradaService.buscar(cmbDestino.getText().toUpperCase()); + if (!lsParadaOri.isEmpty()) { + destino = lsParadaOri.get(0); + } + } else { + destino = (Parada) cmbDestino.getSelectedItem().getValue(); + } + //Parada destino = (Parada) cmbDestino.getSelectedItem().getValue(); + try { + if (origen == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox.origen"), + Labels.getLabel("editarPricingController.windowMercado.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (destino == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox.destino"), + Labels.getLabel("editarPricingController.windowMercado.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + Boolean existe = + pricingMercadoService.obtenerPricingMercado(pricingMercado.getPricing(), + origen, destino); + + pricingMercado.setOrigen(origen); + pricingMercado.setDestino(destino); + + // id -1 identifica que é todas origens ou todos os destinos: + if (origen.getParadaId().equals(-1) && destino.getParadaId().equals(-1)) { + if (existe) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.windowMercado.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + + if (pricingMercado.getPricingparadaId() != null) { + pricingMercadoService.actualizacion(pricingMercado); + pricingMercadoList.updateItem(pricingMercado); + } else { + pricingMercadoService.suscribir(pricingMercado); + pricingMercadoList.addItem(pricingMercado); + } + + closeWindow(); + } + } else { + if (origen.equals(destino)) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.mercadoIguais"), + Labels.getLabel("editarPricingController.windowMercado.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (existe) { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.mercadoExiste"), + Labels.getLabel("editarPricingController.windowMercado.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (pricingMercado.getPricingparadaId() != null) { + pricingMercadoService.actualizacion(pricingMercado); + pricingMercadoList.updateItem(pricingMercado); + } else { + pricingMercadoService.suscribir(pricingMercado); + pricingMercadoList.addItem(pricingMercado); + } + + closeWindow(); + } + } + } + } + } catch (Exception ex) { + log.error("editarPricingController mercado:" + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPricingController.windowCategoria.title"), + Messagebox.OK, Messagebox.ERROR); + } + } catch (Exception ex) { + log.error("Combobox PARADA " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowMercado.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnRemoverMercado(Event ev) { + try { + PricingMercado pMercado = (PricingMercado) pricingMercadoList.getSelected(); + if (pMercado != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaMercado"), + Labels.getLabel("editarPricingController.windowMercado.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingMercado.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingMercado.setFecmodif(Calendar.getInstance().getTime()); + pricingMercado.setActivo(Boolean.FALSE); + + pricingMercadoList.removeItem(pricingMercado); + pricingMercadoService.borrar(pricingMercado); + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.windowMercado.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + + } + + public PricingMercado getPricingMercado() { + return pricingMercado; + } + + public void setPricingMercado(PricingMercado pricingMercado) { + this.pricingMercado = pricingMercado; + } + + public MyListbox getPricingMercadoList() { + return pricingMercadoList; + } + + public void setPricingMercadoList(MyListbox pricingMercadoList) { + this.pricingMercadoList = pricingMercadoList; + } + + public PricingMercadoService getPricingMercadoService() { + return pricingMercadoService; + } + + public void setPricingMercadoService(PricingMercadoService pricingMercadoService) { + this.pricingMercadoService = pricingMercadoService; + } + + public ParadaService getParadaService() { + return paradaService; + } + + public void setParadaService(ParadaService paradaService) { + this.paradaService = paradaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingOcupacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingOcupacionController.java new file mode 100644 index 000000000..53badca79 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingOcupacionController.java @@ -0,0 +1,190 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Intbox; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingOcupacion; +import com.rjconsultores.ventaboletos.service.PricingOcupacionService; +import com.rjconsultores.ventaboletos.utilerias.TraslaparUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.ConstraintPorcentagem; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; + +/** + * + * @author Rafius + */ +@Controller("editarPricingOcupacionController") +@Scope("prototype") +public class EditarPricingOcupacionController extends MyGenericForwardComposer { + + @Autowired + private PricingOcupacionService pricingOcupacionService; + private PricingOcupacion pricingOcupacion; + private MyListbox pricingOcupacionList; + private Intbox ocupacioninicial; + private Intbox ocupacionfinal; + private MyTextboxDecimal porcentaje; + private Pricing pricing; + private ConstraintPorcentagem ct; + private static Logger log = Logger.getLogger(EditarPricingOcupacionController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + ct = new ConstraintPorcentagem(); + pricing = (Pricing) Executions.getCurrent().getArg().get("pricing"); + pricingOcupacion = (PricingOcupacion) Executions.getCurrent().getArg().get("pricingOcupacion"); + pricingOcupacionList = (MyListbox) Executions.getCurrent().getArg().get("pricingOcupacionList"); + + super.doAfterCompose(comp); + } + + public void onClick$btnAdicionarOcupacion(Event ev) throws Exception { + ocupacioninicial.getValue(); + ocupacionfinal.getValue(); + porcentaje.getValue(); + + if (ocupacioninicial.getValue() > 100) { + Messagebox.show(Labels.getLabel("editarPricingController.ocupacionPorcentaje.value"), + Labels.getLabel("editarPricingController.windowOcupacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (ocupacionfinal.getValue() > 100) { + Messagebox.show(Labels.getLabel("editarPricingController.ocupacionPorcentaje.value"), + Labels.getLabel("editarPricingController.windowOcupacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (ocupacionfinal.getValue() < ocupacioninicial.getValue()) { + Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada.value"), + Labels.getLabel("editarPricingController.windowOcupacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + } else { + + BigDecimal min = pricingOcupacion.getOcupacioninicial(); + BigDecimal max = pricingOcupacion.getOcupacionfinal(); + // Boolean podeSalvar = pricingOcupacionService.podeSalvar(pricing, + // min, max); + + boolean existe = true; + + List lsPricingOcupacion = pricingOcupacionService.obtenerPorPricing(pricingOcupacion.getPricing()); + + if (pricingOcupacion != null) { + lsPricingOcupacion.remove(pricingOcupacion); + } + for (PricingOcupacion po : lsPricingOcupacion) { + if (po.getActivo()) { + boolean traslapa = TraslaparUtil.intersectNum( + po.getOcupacioninicial(), po.getOcupacionfinal(), + min, max); + if (traslapa) { + existe = false; + } + } + } + + if (existe) { + if (pricingOcupacion.getPricingocupacionId() != null) { + pricingOcupacionService.actualizacion(pricingOcupacion); + pricingOcupacionList.updateItem(pricingOcupacion); + } else { + pricingOcupacionService.suscribir(pricingOcupacion); + pricingOcupacionList.addItem(pricingOcupacion); + } + closeWindow(); + } else { + Messagebox.show(Labels.getLabel("editarPricingController.ocupacionErrada"), + Labels.getLabel("editarPricingController.windowOcupacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } + } + + public void onClick$btnRemoverOcupacion(Event ev) { + try { + PricingOcupacion pOcupacion = (PricingOcupacion) pricingOcupacionList.getSelected(); + if (pOcupacion != null) { + int resp = Messagebox.show(Labels.getLabel("editarPricingController.MSG.borrarPerguntaOcupacion"), + Labels.getLabel("editarPricingController.windowOcupacion.title"), + Messagebox.YES | Messagebox.NO, + Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingOcupacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingOcupacion.setFecmodif(Calendar.getInstance().getTime()); + pricingOcupacion.setActivo(Boolean.FALSE); + + pricingOcupacionList.removeItem(pricingOcupacion); + pricingOcupacionService.borrar(pricingOcupacion); + closeWindow(); + } + } else { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.windowOcupacion.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + + } + + public PricingOcupacion getPricingOcupacion() { + return pricingOcupacion; + } + + public void setPricingOcupacion(PricingOcupacion pricingOcupacion) { + this.pricingOcupacion = pricingOcupacion; + } + + public MyListbox getPricingOcupacionList() { + return pricingOcupacionList; + } + + public void setPricingOcupacionList(MyListbox pricingOcupacionList) { + this.pricingOcupacionList = pricingOcupacionList; + } + + public PricingOcupacionService getPricingOcupacionService() { + return pricingOcupacionService; + } + + public void setPricingOcupacionService( + PricingOcupacionService pricingOcupacionService) { + this.pricingOcupacionService = pricingOcupacionService; + } + + /** + * @return the ct + */ + public ConstraintPorcentagem getCt() { + return ct; + } + + /** + * @param ct + * the ct to set + */ + public void setCt(ConstraintPorcentagem ct) { + this.ct = ct; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingPuntoVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingPuntoVentaController.java new file mode 100644 index 000000000..69aabe6a4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingPuntoVentaController.java @@ -0,0 +1,157 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.PricingPuntoVentaService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author Rafius + */ +@Controller("editarPricingPuntoVentaController") +@Scope("prototype") +public class EditarPricingPuntoVentaController extends MyGenericForwardComposer { + + @Autowired + private PricingPuntoVentaService pricingPuntoVentaService; + @Autowired + private PuntoVentaService puntoVentaService; + private PricingPuntoVenta pricingPuntoVenta; + private MyListbox pricingPuntoVentaList; + private Combobox cmbPuntoVenta; + private static Logger log = Logger.getLogger(EditarPricingPuntoVentaController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + pricingPuntoVenta = (PricingPuntoVenta) Executions.getCurrent().getArg().get("pricingPuntoVenta"); + pricingPuntoVentaList = (MyListbox) Executions.getCurrent().getArg().get("pricingPuntoVentaList"); + + super.doAfterCompose(comp); + + if (pricingPuntoVenta.getPuntoVenta() != null) { + cmbPuntoVenta.setText(pricingPuntoVenta.getPuntoVenta().getNombpuntoventa()); + } + + cmbPuntoVenta.focus(); + } + + public void onClick$btnAdicionarPuntoVenta(Event ev) throws Exception { + cmbPuntoVenta.getValue(); + + try { + PuntoVenta pv = (PuntoVenta) cmbPuntoVenta.getSelectedItem().getValue(); + try { + Boolean existe = pricingPuntoVentaService.obtenerPricingPuntoVenta(pricingPuntoVenta.getPricing(), pv); + if (existe) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.windowPuntoVenta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + pricingPuntoVenta.setPuntoVenta(pv); + if (pricingPuntoVenta.getPricingptovtaId() != null) { + pricingPuntoVentaService.actualizacion(pricingPuntoVenta); + pricingPuntoVentaList.updateItem(pricingPuntoVenta); + } else { + pricingPuntoVentaService.suscribir(pricingPuntoVenta); + pricingPuntoVentaList.addItem(pricingPuntoVenta); + } + closeWindow(); + } + } catch (Exception ex) { + log.error("editarPricingController PuntoVenta: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarPricingController.windowPuntoVenta.title"), + Messagebox.OK, Messagebox.ERROR); + } + } catch (Exception ex) { + log.error("Combobox PuntoVenta" + ex); + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowPuntoVenta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnRemoverPuntoVenta(Event ev) { + try { + PricingPuntoVenta pPuntoVenta = (PricingPuntoVenta) pricingPuntoVentaList.getSelected(); + if (pPuntoVenta != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaPuntoVenta"), + Labels.getLabel("editarPricingController.windowPuntoVenta.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingPuntoVenta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingPuntoVenta.setFecmodif(Calendar.getInstance().getTime()); + pricingPuntoVenta.setActivo(Boolean.FALSE); + + pricingPuntoVentaList.removeItem(pricingPuntoVenta); + pricingPuntoVentaService.borrar(pricingPuntoVenta); + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.windowPuntoVenta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + + } + + public PricingPuntoVenta getPricingPuntoVenta() { + return pricingPuntoVenta; + } + + public void setPricingPuntoVenta(PricingPuntoVenta pricingPuntoVenta) { + this.pricingPuntoVenta = pricingPuntoVenta; + } + + public MyListbox getPricingPuntoVentaList() { + return pricingPuntoVentaList; + } + + public void setPricingPuntoVentaList(MyListbox pricingPuntoVentaList) { + this.pricingPuntoVentaList = pricingPuntoVentaList; + } + + public PricingPuntoVentaService getPricingPuntoVentaService() { + return pricingPuntoVentaService; + } + + public void setPricingPuntoVentaService(PricingPuntoVentaService pricingPuntoVentaService) { + this.pricingPuntoVentaService = pricingPuntoVentaService; + } + + public PuntoVentaService getPuntoVentaService() { + return puntoVentaService; + } + + public void setPuntoVentaService(PuntoVentaService puntoVentaService) { + this.puntoVentaService = puntoVentaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingRutaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingRutaController.java new file mode 100644 index 000000000..b32902528 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingRutaController.java @@ -0,0 +1,171 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.PricingRuta; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.PricingRutaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author Rafius + */ +@Controller("editarPricingRutaController") +@Scope("prototype") +public class EditarPricingRutaController extends MyGenericForwardComposer { + + @Autowired + private PricingRutaService pricingRutaService; + @Autowired + private RutaService rutaService; + private List lsRuta; + private PricingRuta pricingRuta; + private MyListbox pricingRutaList; + private Combobox cmbRuta; + private static Logger log = Logger.getLogger(EditarPricingRutaController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + + pricingRuta = (PricingRuta) Executions.getCurrent().getArg().get("pricingRuta"); + pricingRutaList = (MyListbox) Executions.getCurrent().getArg().get("pricingRutaList"); + + lsRuta = rutaService.obtenerPorEmpresa(pricingRuta.getPricing().getEmpresa()); + lsRuta.add(rutaService.obtenerID(-1)); + + super.doAfterCompose(comp); + + cmbRuta.focus(); + + } + + public void onClick$btnAdicionarRuta(Event ev) throws Exception { + cmbRuta.getValue(); + + try { + + if (pricingRuta.getRuta() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowRuta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + Boolean existe = pricingRutaService.obtenerPricingRuta(pricingRuta.getPricing(), (Ruta) cmbRuta.getSelectedItem().getValue()); + + if (existe) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.windowRuta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (pricingRuta.getPricingrutaId() != null) { + pricingRutaService.actualizacion(pricingRuta); + pricingRutaList.updateItem(pricingRuta); + } else { + pricingRutaService.suscribir(pricingRuta); + pricingRutaList.addItem(pricingRuta); + } + closeWindow(); + } + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnRemoverRuta(Event ev) { + try { + PricingRuta pRuta = (PricingRuta) pricingRutaList.getSelected(); + if (pRuta != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaRuta"), + Labels.getLabel("editarPricingController.windowRuta.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingRuta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingRuta.setFecmodif(Calendar.getInstance().getTime()); + pricingRuta.setActivo(Boolean.FALSE); + + pricingRutaList.removeItem(pricingRuta); + pricingRutaService.borrar(pricingRuta); + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.windowRuta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + + } + + public PricingRuta getPricingRuta() { + return pricingRuta; + } + + public void setPricingRuta(PricingRuta pricingRuta) { + this.pricingRuta = pricingRuta; + } + + public MyListbox getPricingRutaList() { + return pricingRutaList; + } + + public void setPricingRutaList(MyListbox pricingRutaList) { + this.pricingRutaList = pricingRutaList; + } + + public PricingRutaService getPricingRutaService() { + return pricingRutaService; + } + + public void setPricingRutaService(PricingRutaService pricingRutaService) { + this.pricingRutaService = pricingRutaService; + } + + public List getLsRuta() { + return lsRuta; + } + + public void setLsRuta(List lsRuta) { + this.lsRuta = lsRuta; + } + + public RutaService getRutaService() { + return rutaService; + } + + public void setRutaService(RutaService rutaService) { + this.rutaService = rutaService; + } + + public Combobox getCmbRuta() { + return cmbRuta; + } + + public void setCmbRuta(Combobox cmbRuta) { + this.cmbRuta = cmbRuta; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingTipoPtoVtaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingTipoPtoVtaController.java new file mode 100644 index 000000000..0f84af9fc --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingTipoPtoVtaController.java @@ -0,0 +1,161 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.service.PricingTipoPtoVtaService; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author Rafius + */ +@Controller("editarPricingTipoPtoVtaController") +@Scope("prototype") +public class EditarPricingTipoPtoVtaController extends MyGenericForwardComposer { + + @Autowired + private PricingTipoPtoVtaService pricingTipoPtoVtaService; + @Autowired + private TipoPuntoVentaService tipoPtoVtaService; + private List lsTipoPtoVta; + private PricingTipoPtoVta pricingTipoPtoVta; + private MyListbox pricingTipoPtoVtaList; + private Combobox cmbTipoPtoVta; + private static Logger log = Logger.getLogger(EditarPricingTipoPtoVtaController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsTipoPtoVta = tipoPtoVtaService.obtenerTodos(); + + pricingTipoPtoVta = (PricingTipoPtoVta) Executions.getCurrent().getArg().get("pricingTipoPtoVta"); + pricingTipoPtoVtaList = (MyListbox) Executions.getCurrent().getArg().get("pricingTipoPtoVtaList"); + + super.doAfterCompose(comp); + + cmbTipoPtoVta.focus(); + + } + + public void onClick$btnAdicionarTipoPtoVta(Event ev) throws Exception { + cmbTipoPtoVta.getValue(); + + try { + if (pricingTipoPtoVta.getTipoPtovta() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowTipoPtoVta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + Boolean existe = pricingTipoPtoVtaService.obtenerPricingTipoPuntoVenta(pricingTipoPtoVta.getPricing(), (TipoPuntoVenta) cmbTipoPtoVta.getSelectedItem().getValue()); + + if (existe) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.windowTipoPtoVta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (pricingTipoPtoVta.getPricingtipoptovtaId() != null) { + pricingTipoPtoVtaService.actualizacion(pricingTipoPtoVta); + pricingTipoPtoVtaList.updateItem(pricingTipoPtoVta); + } else { + pricingTipoPtoVtaService.suscribir(pricingTipoPtoVta); + pricingTipoPtoVtaList.addItem(pricingTipoPtoVta); + } + closeWindow(); + } + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnRemoverTipoPtoVta(Event ev) { + try { + PricingTipoPtoVta pTipoPtoVta = (PricingTipoPtoVta) pricingTipoPtoVtaList.getSelected(); + if (pTipoPtoVta != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaTipoPtoVta"), + Labels.getLabel("editarPricingController.windowTipoPtoVta.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingTipoPtoVta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingTipoPtoVta.setFecmodif(Calendar.getInstance().getTime()); + pricingTipoPtoVta.setActivo(Boolean.FALSE); + + pricingTipoPtoVtaList.removeItem(pricingTipoPtoVta); + pricingTipoPtoVtaService.borrar(pricingTipoPtoVta); + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.windowTipoPtoVta.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + + } + + public PricingTipoPtoVta getPricingTipoPtoVta() { + return pricingTipoPtoVta; + } + + public void setPricingTipoPtoVta(PricingTipoPtoVta pricingTipoPtoVta) { + this.pricingTipoPtoVta = pricingTipoPtoVta; + } + + public MyListbox getPricingTipoPtoVtaList() { + return pricingTipoPtoVtaList; + } + + public void setPricingTipoPtoVtaList(MyListbox pricingTipoPtoVtaList) { + this.pricingTipoPtoVtaList = pricingTipoPtoVtaList; + } + + public PricingTipoPtoVtaService getPricingTipoPtoVtaService() { + return pricingTipoPtoVtaService; + } + + public void setPricingTipoPtoVtaService(PricingTipoPtoVtaService pricingTipoPtoVtaService) { + this.pricingTipoPtoVtaService = pricingTipoPtoVtaService; + } + + public List getLsTipoPtoVta() { + return lsTipoPtoVta; + } + + public void setLsTipoPtoVta(List lsTipoPtoVta) { + this.lsTipoPtoVta = lsTipoPtoVta; + } + + public TipoPuntoVentaService getTipoPtoVtaService() { + return tipoPtoVtaService; + } + + public void setTipoPtoVtaService(TipoPuntoVentaService tipoPtoVtaService) { + this.tipoPtoVtaService = tipoPtoVtaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingTipoServicioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingTipoServicioController.java new file mode 100644 index 000000000..c1e56d6fb --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingTipoServicioController.java @@ -0,0 +1,170 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.TipoServicio; +import com.rjconsultores.ventaboletos.entidad.PricingTipoServicio; +import com.rjconsultores.ventaboletos.service.TipoServicioService; +import com.rjconsultores.ventaboletos.service.PricingTipoServicioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author Rafius + */ +@Controller("editarPricingTipoServicioController") +@Scope("prototype") +public class EditarPricingTipoServicioController extends MyGenericForwardComposer { + + @Autowired + private PricingTipoServicioService pricingTipoServicioService; + @Autowired + private TipoServicioService tipoServicioService; + private List lsTipoServicio; + private PricingTipoServicio pricingTipoServicio; + private MyListbox pricingTipoServicioList; + private Combobox cmbTipoServicio; + private static Logger log = Logger.getLogger(EditarPricingTipoServicioController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsTipoServicio = tipoServicioService.obtenerTodos(); + + pricingTipoServicio = (PricingTipoServicio) Executions.getCurrent().getArg().get("pricingTipoServicio"); + pricingTipoServicioList = (MyListbox) Executions.getCurrent().getArg().get("pricingTipoServicioList"); + + super.doAfterCompose(comp); + + + cmbTipoServicio.focus(); + } + + public void onClick$btnAdicionarTipoServicio(Event ev) throws Exception { + cmbTipoServicio.getValue(); + + try { + + if (pricingTipoServicio.getTipoServicio() == null) { + Messagebox.show( + Labels.getLabel("MSG.Error.combobox"), + Labels.getLabel("editarPricingController.windowTipoServicio.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + + Boolean existe = pricingTipoServicioService.obtenerPricingTipoServicio(pricingTipoServicio.getPricing(), (TipoServicio) cmbTipoServicio.getSelectedItem().getValue()); + if (existe) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.windowTipoServicio.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (pricingTipoServicio.getPricingtiposervicioId() != null) { + pricingTipoServicioService.actualizacion(pricingTipoServicio); + pricingTipoServicioList.updateItem(pricingTipoServicio); + } else { + pricingTipoServicioService.suscribir(pricingTipoServicio); + pricingTipoServicioList.addItem(pricingTipoServicio); + } + closeWindow(); + } + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnRemoverTipoServicio(Event ev) { + try { + PricingTipoServicio pTipoServicio = (PricingTipoServicio) pricingTipoServicioList.getSelected(); + if (pTipoServicio != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaTipoServicio"), + Labels.getLabel("editarPricingController.windowTipoServicio.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingTipoServicio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingTipoServicio.setFecmodif(Calendar.getInstance().getTime()); + pricingTipoServicio.setActivo(Boolean.FALSE); + + pricingTipoServicioList.removeItem(pricingTipoServicio); + pricingTipoServicioService.borrar(pricingTipoServicio); + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.windowTipoServicio.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + + } + + public PricingTipoServicio getPricingTipoServicio() { + return pricingTipoServicio; + } + + public void setPricingTipoServicio(PricingTipoServicio pricingTipoServicio) { + this.pricingTipoServicio = pricingTipoServicio; + } + + public MyListbox getPricingTipoServicioList() { + return pricingTipoServicioList; + } + + public void setPricingTipoServicioList(MyListbox pricingTipoServicioList) { + this.pricingTipoServicioList = pricingTipoServicioList; + } + + public PricingTipoServicioService getPricingTipoServicioService() { + return pricingTipoServicioService; + } + + public void setPricingTipoServicioService(PricingTipoServicioService pricingTipoServicioService) { + this.pricingTipoServicioService = pricingTipoServicioService; + } + + public TipoServicioService getTipoServicioService() { + return tipoServicioService; + } + + public void setTipoServicioService(TipoServicioService tipoServicioService) { + this.tipoServicioService = tipoServicioService; + } + + public static Logger getLog() { + return log; + } + + public static void setLog(Logger log) { + EditarPricingTipoServicioController.log = log; + } + + public List getLsTipoServicio() { + return lsTipoServicio; + } + + public void setLsTipoServicio(List lsTipoServicio) { + this.lsTipoServicio = lsTipoServicio; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingVigenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingVigenciaController.java new file mode 100644 index 000000000..0f1c151f5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/pricing/EditarPricingVigenciaController.java @@ -0,0 +1,220 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.pricing; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import com.rjconsultores.ventaboletos.entidad.PricingVigencia; +import com.rjconsultores.ventaboletos.service.PricingVigenciaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.Date; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Datebox; + +/** + * + * @author Rafius + */ +@Controller("editarPricingVigenciaController") +@Scope("prototype") +public class EditarPricingVigenciaController extends MyGenericForwardComposer { + + @Autowired + private PricingVigenciaService pricingVigenciaService; + private PricingVigencia pricingVigencia; + private MyListbox pricingVigenciaList; + private static Logger log = Logger.getLogger(EditarPricingVigenciaController.class); + private Datebox fecinicioviaje; + private Datebox fecfinviaje; + private Datebox fecinicioventa; + private Datebox fecfinventa; + private Pricing pricing; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + pricingVigencia = (PricingVigencia) Executions.getCurrent().getArg().get("pricingVigencia"); + pricing = (Pricing) Executions.getCurrent().getArg().get("pricing"); + pricingVigenciaList = (MyListbox) Executions.getCurrent().getArg().get("pricingVigenciaList"); + + super.doAfterCompose(comp); + + if (pricingVigencia.getPricingvigenciaId() != null) { + fecinicioviaje.setValue(pricingVigencia.getFecinicioviaje()); + fecfinviaje.setValue(pricingVigencia.getFecfinviaje()); + fecinicioventa.setValue(pricingVigencia.getFecinicioventa()); + fecfinventa.setValue(pricingVigencia.getFecfinventa()); + } + } + + public void onChange$fecfinviaje(Event ev) throws Exception { + fecfinventa.setValue(fecfinviaje.getValue()); + } + + public void onClick$btnAdicionarVigencia(Event ev) throws Exception { + + fecinicioviaje.getValue(); + fecfinviaje.getValue(); + fecinicioventa.getValue(); + fecfinventa.getValue(); + + if (fecinicioviaje.getValue().after(fecfinviaje.getValue())) { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.fechaViaje"), + Labels.getLabel("editarPricingController.windowVigencia.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (fecinicioventa.getValue().after(fecfinventa.getValue())) { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.fechaVenta"), + Labels.getLabel("editarPricingController.windowVigencia.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (fecinicioventa.getValue().after(fecinicioviaje.getValue())) { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.datas1"), + Labels.getLabel("editarPricingController.windowVigencia.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (fecfinventa.getValue().after(fecfinviaje.getValue())) { + Messagebox.show(Labels.getLabel("editarPricingController.MSG.datas2"), + Labels.getLabel("editarPricingController.windowVigencia.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + try { + + pricingVigencia.setFecinicioviaje(fecinicioviaje.getValue()); + pricingVigencia.setFecfinviaje(fecfinviaje.getValue()); + pricingVigencia.setFecinicioventa(fecinicioventa.getValue()); + pricingVigencia.setFecfinventa(fecfinventa.getValue()); + + pricingVigencia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingVigencia.setFecmodif(Calendar.getInstance().getTime()); + pricingVigencia.setActivo(Boolean.TRUE); + + Date inicio = pricingVigencia.getFecinicioventa(); + Date fim = pricingVigencia.getFecfinventa(); + + Boolean podeSalvar = + pricingVigenciaService.podeSalvar(pricing, pricingVigencia, + inicio, fim); + if (pricingVigencia.getPricingvigenciaId() != null) { + if (podeSalvar) { + pricingVigenciaService.actualizacion(pricingVigencia); + pricingVigenciaList.updateItem(pricingVigencia); + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPricingController.windowCategoria.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + if (podeSalvar) { + pricingVigenciaService.suscribir(pricingVigencia); + pricingVigenciaList.addItem(pricingVigencia); + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.vigenciaExiste"), + Labels.getLabel("editarPricingController.windowCategoria.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } catch (Exception ex) { + log.error("Erro ao adicionar pricing vigencia: " + ex); + } + } + } + + public void onClick$btnRemoverVigencia(Event ev) { + try { + PricingVigencia pVigencia = (PricingVigencia) pricingVigenciaList.getSelected(); + if (pVigencia != null) { + int resp = Messagebox.show( + Labels.getLabel("editarPricingController.MSG.borrarPerguntaVigencia"), + Labels.getLabel("editarPricingController.windowVigencia.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + pricingVigencia.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pricingVigencia.setFecmodif(Calendar.getInstance().getTime()); + pricingVigencia.setActivo(Boolean.FALSE); + + pricingVigenciaList.removeItem(pricingVigencia); + pricingVigenciaService.borrar(pricingVigencia); + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("editarPricingController.MSG.selectItem"), + Labels.getLabel("editarPricingController.windowVigencia.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public Datebox getFecfinventa() { + return fecfinventa; + } + + public void setFecfinventa(Datebox fecfinventa) { + this.fecfinventa = fecfinventa; + } + + public Datebox getFecfinviaje() { + return fecfinviaje; + } + + public void setFecfinviaje(Datebox fecfinviaje) { + this.fecfinviaje = fecfinviaje; + } + + public Datebox getFecinicioventa() { + return fecinicioventa; + } + + public void setFecinicioventa(Datebox fecinicioventa) { + this.fecinicioventa = fecinicioventa; + } + + public Datebox getFecinicioviaje() { + return fecinicioviaje; + } + + public void setFecinicioviaje(Datebox fecinicioviaje) { + this.fecinicioviaje = fecinicioviaje; + } + + public PricingVigencia getPricingVigencia() { + return pricingVigencia; + } + + public void setPricingVigencia(PricingVigencia pricingVigencia) { + this.pricingVigencia = pricingVigencia; + } + + public MyListbox getPricingVigenciaList() { + return pricingVigenciaList; + } + + public void setPricingVigenciaList(MyListbox pricingVigenciaList) { + this.pricingVigenciaList = pricingVigenciaList; + } + + public PricingVigenciaService getPricingVigenciaService() { + return pricingVigenciaService; + } + + public void setPricingVigenciaService(PricingVigenciaService pricingVigenciaService) { + this.pricingVigenciaService = pricingVigenciaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/AberturaTurnoRecaudacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/AberturaTurnoRecaudacionController.java new file mode 100644 index 000000000..096e92b82 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/AberturaTurnoRecaudacionController.java @@ -0,0 +1,48 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.recaudacion; + +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.zk.ui.Component; +import org.zkoss.zul.Label; + +/** + * + * @author Administrador + */ +@Controller("aberturaTurnoRecaudacionController") +@Scope("prototype") +public class AberturaTurnoRecaudacionController extends MyGenericForwardComposer { + + private Usuario usuarioLogado; + private Label lblRecaudador; + + public Label getLblRecaudador() { + return lblRecaudador; + } + + public void setLblRecaudador(Label lblRecaudador) { + this.lblRecaudador = lblRecaudador; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + usuarioLogado = UsuarioLogado.getUsuarioLogado(); + + super.doAfterCompose(comp); + + if (usuarioLogado != null) { + lblRecaudador.setValue(usuarioLogado.getName()); + } else { + alert("ERRO DE LOGIN"); + + closeWindow(); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/BusquedaCorridaTarjetaRecaudacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/BusquedaCorridaTarjetaRecaudacionController.java new file mode 100644 index 000000000..c8543cb83 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/BusquedaCorridaTarjetaRecaudacionController.java @@ -0,0 +1,246 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.recaudacion; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacion; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCorridaTarjetaRecaudacion; +import java.util.Date; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Timebox; + +/** + * + * @author Administrador + */ +@Controller("busquedaCorridaTarjetaRecaudacionController") +@Scope("prototype") +public class BusquedaCorridaTarjetaRecaudacionController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwCorrida; + @Autowired + private ClaseServicioService claseServicioService; + private List lsClaseServicio; + private MyListbox corridaList; + private Paging pagingCorrida; + private Intbox idCorrida; + private Combobox cmbParadaOrigem; + private Combobox cmbParadaDestino; + private Combobox cmbTipoServicio; + private Timebox timeInicio; + private Timebox timeFin; + private TarjetaRecaudacion tarjetaRecaudacion; + private EditarTarjetaRecaudacionController editarTarjetaRecaudacionController; + private static Logger log = Logger.getLogger(BusquedaCorridaTarjetaRecaudacionController.class); + + public Combobox getCmbParadaDestino() { + return cmbParadaDestino; + } + + public void setCmbParadaDestino(Combobox cmbParadaDestino) { + this.cmbParadaDestino = cmbParadaDestino; + } + + public Combobox getCmbParadaOrigem() { + return cmbParadaOrigem; + } + + public void setCmbParadaOrigem(Combobox cmbParadaOrigem) { + this.cmbParadaOrigem = cmbParadaOrigem; + } + + public Combobox getCmbTipoServicio() { + return cmbTipoServicio; + } + + public void setCmbTipoServicio(Combobox cmbTipoServicio) { + this.cmbTipoServicio = cmbTipoServicio; + } + + public MyListbox getCorridaList() { + return corridaList; + } + + public void setCorridaList(MyListbox corridaList) { + this.corridaList = corridaList; + } + + public Intbox getIdCorrida() { + return idCorrida; + } + + public void setIdCorrida(Intbox idCorrida) { + this.idCorrida = idCorrida; + } + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + public Paging getPagingCorrida() { + return pagingCorrida; + } + + public void setPagingCorrida(Paging pagingCorrida) { + this.pagingCorrida = pagingCorrida; + } + + public Timebox getTimeFin() { + return timeFin; + } + + public void setTimeFin(Timebox timeFin) { + this.timeFin = timeFin; + } + + public Timebox getTimeInicio() { + return timeInicio; + } + + public void setTimeInicio(Timebox timeInicio) { + this.timeInicio = timeInicio; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsClaseServicio = claseServicioService.buscarTodosExceto(-1); + + super.doAfterCompose(comp); + + tarjetaRecaudacion = + (TarjetaRecaudacion) Executions.getCurrent().getArg().get("tarjetaRecaudacion"); + editarTarjetaRecaudacionController = + (EditarTarjetaRecaudacionController) Executions.getCurrent().getArg().get("editarTarjetaRecaudacionController"); + + corridaList.setItemRenderer(new RenderCorridaTarjetaRecaudacion()); + corridaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + selecionarCorrida(); + } + }); + } + + private void refreshLista() { + HibernateSearchObject corridaSearch = + new HibernateSearchObject(Corrida.class, + pagingCorrida.getPageSize()); + + if (idCorrida.getValue() != null) { + corridaSearch.addFilterEqual("id.corridaId", idCorrida.getValue()); + } + + Comboitem cbiOrigem = cmbParadaOrigem.getSelectedItem(); + if (cbiOrigem != null) { + Parada origem = (Parada) cbiOrigem.getValue(); + corridaSearch.addFilterEqual("origem", origem); + } + + Comboitem cbiDestino = cmbParadaDestino.getSelectedItem(); + if (cbiDestino != null) { + Parada destino = (Parada) cbiDestino.getValue(); + corridaSearch.addFilterEqual("destino", destino); + } + + Comboitem cbiTipoServicio = cmbTipoServicio.getSelectedItem(); + if (cbiTipoServicio != null) { + ClaseServicio calseServicio = (ClaseServicio) cbiTipoServicio.getValue(); + corridaSearch.addFilterEqual("claseServicio", calseServicio); + } + + Date horaInicio = timeInicio.getValue(); + if (horaInicio != null) { + corridaSearch.addFilterGreaterOrEqual("corridaCtrl.horario", horaInicio); + } + + Date horaFin = timeFin.getValue(); + if (horaFin != null) { + corridaSearch.addFilterLessOrEqual("corridaCtrl.horario", horaFin); + } + + corridaSearch.addFilterEqual("activo", Boolean.TRUE); + + corridaSearch.addSortAsc("id.feccorrida"); + + plwCorrida.init(corridaSearch, corridaList, pagingCorrida); + + if (corridaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaPricingController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + private void selecionarCorrida() { + try { + Corrida corrida = (Corrida) corridaList.getSelected(); + + if (corrida != null) { + tarjetaRecaudacion.setCorrida(corrida); + + Integer corridaId = corrida.getId().getCorridaId(); + Date fecHor = corrida.getId().getFeccorrida(); + + editarTarjetaRecaudacionController.atualizarCorridaTela(fecHor, corridaId); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnPesquisa(Event ev) { + cmbParadaOrigem.clearErrorMessage(); + cmbParadaDestino.clearErrorMessage(); + cmbTipoServicio.clearErrorMessage(); + + if (idCorrida.getValue() == null) { + cmbParadaOrigem.setConstraint("no empty"); + cmbParadaDestino.setConstraint("no empty"); + cmbTipoServicio.setConstraint("no empty"); + + cmbParadaOrigem.getValue(); + cmbParadaDestino.getValue(); + cmbTipoServicio.getValue(); + } + + refreshLista(); + } + + public void onClick$btnAdicionarCorrida(Event ev) throws Exception { + selecionarCorrida(); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/BusquedaTarjetaRecaudacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/BusquedaTarjetaRecaudacionController.java new file mode 100644 index 000000000..c525a19bc --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/BusquedaTarjetaRecaudacionController.java @@ -0,0 +1,155 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.recaudacion; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacion; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTarjetaRecaudacion; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; + +/** + * + * @author Administrador + */ +@Controller("busquedaTarjetaRecaudacionController") +@Scope("prototype") +public class BusquedaTarjetaRecaudacionController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTarjetaRecaudacion; + @Autowired + private EmpresaService empresaService; + private List lsEmpresas; + private Paging pagingTarjetaRecaudacion; + private MyListbox tarjetaRecaudacionList; + private Combobox cmbEmpresas; + private Intbox txtClaveOperador; + private Integer claveConductor; + + public List getLsEmpresas() { + return lsEmpresas; + } + + public void setLsEmpresas(List lsEmpresas) { + this.lsEmpresas = lsEmpresas; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEmpresas = empresaService.buscarTodosExceto(-1); + + super.doAfterCompose(comp); + + tarjetaRecaudacionList.setItemRenderer(new RenderTarjetaRecaudacion()); + tarjetaRecaudacionList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TarjetaRecaudacion tarjetaRecaudacion = + (TarjetaRecaudacion) tarjetaRecaudacionList.getSelected(); + verTarjetaRecaudacion(tarjetaRecaudacion); + } + }); + + claveConductor = (Integer) Executions.getCurrent().getArg().get("claveConductor"); + txtClaveOperador.setValue(claveConductor); + txtClaveOperador.setDisabled(Boolean.TRUE); + } + + private void refreshList() { + Empresa empresa = (Empresa) (cmbEmpresas.getSelectedItem() != null + ? cmbEmpresas.getSelectedItem().getValue() : null); + + HibernateSearchObject tarjetasRecaudacionSearch = + new HibernateSearchObject(TarjetaRecaudacion.class, + pagingTarjetaRecaudacion.getPageSize()); + + if (empresa != null) { + tarjetasRecaudacionSearch.addFilterEqual("empresa", empresa); + } + + if (txtClaveOperador.getValue() != null) { + tarjetasRecaudacionSearch.addFilterEqual("conductorId", + txtClaveOperador.getValue()); + } + + tarjetasRecaudacionSearch.addFilterEqual("activo", Boolean.TRUE); + + tarjetasRecaudacionSearch.addSortAsc("empresa.nombempresa"); + + plwTarjetaRecaudacion.init(tarjetasRecaudacionSearch, tarjetaRecaudacionList, + pagingTarjetaRecaudacion); + + if (tarjetaRecaudacionList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTarjetaRecaudacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + private void verTarjetaRecaudacion(TarjetaRecaudacion tarjetaRecaudacion) { + if (tarjetaRecaudacion == null) { + return; + } + + Map args = new HashMap(); + args.put("tarjetaRecaudacion", tarjetaRecaudacion); + args.put("tarjetaRecaudacionList", tarjetaRecaudacionList); + args.put("claveConductor", claveConductor); + + openWindow("/gui/recaudacion/editarTarjetaRecaudacion.zul", + Labels.getLabel("editarTarjetaRecaudacionController.window.title"), args, MODAL); + } + + public void onClick$btnRefresh(Event ev) { + refreshList(); + } + + public void onClick$btnPesquisa(Event ev) { + refreshList(); + } + + public void onClick$btnNovo(Event ev) { + verTarjetaRecaudacion(new TarjetaRecaudacion()); + } + + public void onClick$btnConfirmaPago(Event ev) throws InterruptedException { + List lsTarjetaRecaudacion = tarjetaRecaudacionList.getSelectedsItens(); + + if (!lsTarjetaRecaudacion.isEmpty()) { + Map args = new HashMap(); + args.put("lsTarjetaRecaudacion", lsTarjetaRecaudacion); + + openWindow("/gui/recaudacion/pagarTarjetasViajes.zul", + Labels.getLabel("pagarTarjetasViajesController.window.title"), args, MODAL); + } else { + Messagebox.show(Labels.getLabel("busquedaTarjetaRecaudacionController.MSG.Seleccionar.Tajetas"), + Labels.getLabel("busquedaTarjetaRecaudacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/CorteTurnoRecaudacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/CorteTurnoRecaudacionController.java new file mode 100644 index 000000000..41c11069c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/CorteTurnoRecaudacionController.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.recaudacion; + +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.zul.Label; + +/** + * + * @author Administrador + */ +@Controller("corteTurnoRecaudacionController") +@Scope("prototype") +public class CorteTurnoRecaudacionController extends MyGenericForwardComposer { + + private Label lblFechaInicio; + private Label lblClvRecaudador; + private Label lblFechaFinal; + private Label lblHoraInicio; + private Label lblNombreRecaudador; + private Label lblHoraFinal; + private Label lblSaldoInicialCaja; + private Label lblTurno; + private Label lblSaldoFinalCaja; + private Label lblReposicionTurno; + private Label lblSaldoFinalTransferidoPara; + private Label lblRecolecciones; + private Label lblTotalPago; + private Label lblTotalPagadoNormal; + private Label lblTotalPagadoCapacitacion; + private Label lblTotalPagadoIncapacidades; + private Label lblTotalAbonoCartera; +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/EditarTarjetaRecaudacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/EditarTarjetaRecaudacionController.java new file mode 100644 index 000000000..159ce4b38 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/EditarTarjetaRecaudacionController.java @@ -0,0 +1,214 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.recaudacion; + +import com.rjconsultores.ventaboletos.entidad.Autobus; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacion; +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacionPK; +import com.rjconsultores.ventaboletos.service.AutobusService; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.TarjetaRecaudacionService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarTarjetaRecaudacionController") +@Scope("prototype") +public class EditarTarjetaRecaudacionController extends MyGenericForwardComposer { + + @Autowired + private TarjetaRecaudacionService tarjetaRecaudacionService; + @Autowired + private EmpresaService empresaService; + @Autowired + private RutaService rutaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private AutobusService autobusService; + private List lsEmpresas; + private List lsRutas; + private List lsClaseSsClervico; + private List lsAutobus; + private TarjetaRecaudacion tarjetaRecaudacion; + private MyListbox tarjetaRecaudacionList; + private Datebox databoxFecHor; + private Intbox intboxCorrida; + private Intbox numTarjeta; + private Checkbox chkManual; + private Checkbox chkActualizado; + private Integer claveConductor; + private Textbox clvConductor; + + public List getLsClaseSsClervico() { + return lsClaseSsClervico; + } + + public void setLsClaseSsClervico(List lsClaseSsClervico) { + this.lsClaseSsClervico = lsClaseSsClervico; + } + + public List getLsEmpresas() { + return lsEmpresas; + } + + public void setLsEmpresas(List lsEmpresas) { + this.lsEmpresas = lsEmpresas; + } + + public List getLsRutas() { + return lsRutas; + } + + public void setLsRutas(List lsRutas) { + this.lsRutas = lsRutas; + } + + public TarjetaRecaudacion getTarjetaRecaudacion() { + return tarjetaRecaudacion; + } + + public void setTarjetaRecaudacion(TarjetaRecaudacion tarjetaRecaudacion) { + this.tarjetaRecaudacion = tarjetaRecaudacion; + } + + public void atualizarCorridaTela(Date fecHor, Integer corridaId) { + intboxCorrida.setValue(corridaId); + databoxFecHor.setValue(fecHor); + } + + public Checkbox getChkActualizado() { + return chkActualizado; + } + + public void setChkActualizado(Checkbox chkActualizado) { + this.chkActualizado = chkActualizado; + } + + public Checkbox getChkManual() { + return chkManual; + } + + public void setChkManual(Checkbox chkManual) { + this.chkManual = chkManual; + } + + public Datebox getDataboxFecHor() { + return databoxFecHor; + } + + public void setDataboxFecHor(Datebox databoxFecHor) { + this.databoxFecHor = databoxFecHor; + } + + public Intbox getIntboxCorrida() { + return intboxCorrida; + } + + public void setIntboxCorrida(Intbox intboxCorrida) { + this.intboxCorrida = intboxCorrida; + } + + public Intbox getNumTarjeta() { + return numTarjeta; + } + + public void setNumTarjeta(Intbox numTarjeta) { + this.numTarjeta = numTarjeta; + } + + public List getLsAutobus() { + return lsAutobus; + } + + public void setLsAutobus(List lsAutobus) { + this.lsAutobus = lsAutobus; + } + + public Textbox getClvConductor() { + return clvConductor; + } + + public void setClvConductor(Textbox clvConductor) { + this.clvConductor = clvConductor; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEmpresas = empresaService.buscarTodosExceto(-1); + lsRutas = rutaService.buscarTodosExceto(-1); + lsClaseSsClervico = claseServicioService.buscarTodosExceto(-1); + lsAutobus = autobusService.obtenerTodos(); + + super.doAfterCompose(comp); + + claveConductor = (Integer) Executions.getCurrent().getArg().get("claveConductor"); + if (claveConductor != null) { + clvConductor.setValue(claveConductor.toString()); + } + + tarjetaRecaudacion = (TarjetaRecaudacion) Executions.getCurrent().getArg().get("tarjetaRecaudacion"); + if (tarjetaRecaudacion.getTarjetasRecaudacionPK() != null) { + tarjetaRecaudacion = tarjetaRecaudacionService.obtenerID(tarjetaRecaudacion.getTarjetasRecaudacionPK()); + } + tarjetaRecaudacionList = (MyListbox) Executions.getCurrent().getArg().get("tarjetaRecaudacionList"); + } + + public void onClick$btnPesquisarCorrida(Event ev) { + Map args = new HashMap(); + args.put("tarjetaRecaudacion", tarjetaRecaudacion); + args.put("editarTarjetaRecaudacionController", this); + + openWindow("/gui/recaudacion/busquedaCorridaTarjetaRecaudacion.zul", + Labels.getLabel("editarPricingController.windowCorrida.title"), args, MODAL); + } + + public void onClick$btnSalvar(Event ev) { + if (tarjetaRecaudacion.getTarjetasRecaudacionPK() == null) { + tarjetaRecaudacion.setConductorId(claveConductor); + tarjetaRecaudacion.setActivo(Boolean.TRUE); + tarjetaRecaudacion.setActualizar(Boolean.FALSE); + + TarjetaRecaudacionPK tarjetasRecaudacionPK = new TarjetaRecaudacionPK(); + tarjetasRecaudacionPK.setManual(chkManual.isChecked()); + tarjetasRecaudacionPK.setTarjetarecaudacionId(numTarjeta.getValue()); + + tarjetaRecaudacion.setTarjetasRecaudacionPK(tarjetasRecaudacionPK); + tarjetaRecaudacionService.suscribir(tarjetaRecaudacion); + + tarjetaRecaudacionList.addItem(tarjetaRecaudacion); + } else { + tarjetaRecaudacionService.actualizacion(tarjetaRecaudacion); + tarjetaRecaudacion.setActualizar(Boolean.TRUE); + + tarjetaRecaudacionList.updateItem(tarjetaRecaudacion); + } + + closeWindow(); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/LoginConductorController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/LoginConductorController.java new file mode 100644 index 000000000..da4f132f8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/LoginConductorController.java @@ -0,0 +1,63 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.recaudacion; + +import com.rjconsultores.ventaboletos.entidad.Conductor; +import com.rjconsultores.ventaboletos.service.ConductorService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("loginConductorController") +@Scope("prototype") +public class LoginConductorController extends MyGenericForwardComposer { + + @Autowired + private ConductorService conductorService; + private Textbox txtClaveConductor; + private Textbox txtContraSenha; + + public void onClick$btnAcessar(Event ev) throws InterruptedException { + String claveConductor = txtClaveConductor.getValue(); + String contraSenha = txtContraSenha.getValue(); + + Conductor conductor = conductorService.buscar(claveConductor, contraSenha); + + if (conductor != null) { + Integer opcao = Messagebox.show( + Labels.getLabel("winLoginConductorRecaudacion.conductor.corecto") + "\n\n" + + Labels.getLabel("winLoginConductorRecaudacion.conductor.nombre") + conductor.getNombconductor() + ", " + + Labels.getLabel("winLoginConductorRecaudacion.conductor.clave") + conductor.getConductorId(), + Labels.getLabel("winLoginConductorRecaudacion.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (opcao.equals(Messagebox.YES)) { + Map args = new HashMap(); + args.put("claveConductor", conductor.getConductorId()); + + openWindow("/gui/recaudacion/busquedaTarjetaRecaudacion.zul", + Labels.getLabel("busquedaTarjetaRecaudacionController.window.title"), args, MODAL); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("winLoginConductorRecaudacion.lblloginIncorreto"), + Labels.getLabel("winLoginConductorRecaudacion.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/PagarTarjetasViajesController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/PagarTarjetasViajesController.java new file mode 100644 index 000000000..304bcf092 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/recaudacion/PagarTarjetasViajesController.java @@ -0,0 +1,134 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.recaudacion; + +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacion; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderDeducciones; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderDescripcionViajes; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPercepciones; +import java.util.List; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Label; +import org.zkoss.zul.Messagebox; + +/** + * + * @author Administrador + */ +@Controller("pagarTarjetasViajesController") +@Scope("prototype") +public class PagarTarjetasViajesController extends MyGenericForwardComposer { + + private List lsTarjetaRecaudacion; + private MyListbox descripcionViajesList; + private MyListbox percepcionesList; + private MyListbox deduccionesList; + private Label lblNombreClaveConductor; + private Label lblTotalPercepciones1; + private Label lblTotalPercepciones2; + private Label lblTotalDeducciones1; + private Label lblTotalDeducciones2; + private Label lblNetoPagar; + + public MyListbox getDeduccionesList() { + return deduccionesList; + } + + public void setDeduccionesList(MyListbox deduccionesList) { + this.deduccionesList = deduccionesList; + } + + public MyListbox getDescripcionViajesList() { + return descripcionViajesList; + } + + public void setDescripcionViajesList(MyListbox descripcionViajesList) { + this.descripcionViajesList = descripcionViajesList; + } + + public Label getLblNetoPagar() { + return lblNetoPagar; + } + + public void setLblNetoPagar(Label lblNetoPagar) { + this.lblNetoPagar = lblNetoPagar; + } + + public Label getLblNombreClaveConductor() { + return lblNombreClaveConductor; + } + + public void setLblNombreClaveConductor(Label lblNombreClaveConductor) { + this.lblNombreClaveConductor = lblNombreClaveConductor; + } + + public Label getLblTotalDeducciones1() { + return lblTotalDeducciones1; + } + + public void setLblTotalDeducciones1(Label lblTotalDeducciones1) { + this.lblTotalDeducciones1 = lblTotalDeducciones1; + } + + public Label getLblTotalDeducciones2() { + return lblTotalDeducciones2; + } + + public void setLblTotalDeducciones2(Label lblTotalDeducciones2) { + this.lblTotalDeducciones2 = lblTotalDeducciones2; + } + + public Label getLblTotalPercepciones1() { + return lblTotalPercepciones1; + } + + public void setLblTotalPercepciones1(Label lblTotalPercepciones1) { + this.lblTotalPercepciones1 = lblTotalPercepciones1; + } + + public Label getLblTotalPercepciones2() { + return lblTotalPercepciones2; + } + + public void setLblTotalPercepciones2(Label lblTotalPercepciones2) { + this.lblTotalPercepciones2 = lblTotalPercepciones2; + } + + public MyListbox getPercepcionesList() { + return percepcionesList; + } + + public void setPercepcionesList(MyListbox percepcionesList) { + this.percepcionesList = percepcionesList; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsTarjetaRecaudacion = (List) Executions.getCurrent().getArg().get("lsTarjetaRecaudacion"); + + super.doAfterCompose(comp); + + descripcionViajesList.setItemRenderer(new RenderDescripcionViajes()); + percepcionesList.setItemRenderer(new RenderPercepciones()); + deduccionesList.setItemRenderer(new RenderDeducciones()); + + lblNombreClaveConductor.setValue("Nombre/Clave Conductor"); + lblTotalDeducciones1.setValue("$"); + lblTotalDeducciones2.setValue("$"); + lblTotalPercepciones1.setValue("$"); + lblTotalPercepciones2.setValue("$"); + lblNetoPagar.setValue("$"); + } + + public void onClick$btnConfirmaPago(Event ev) throws InterruptedException { + Messagebox.show("Imprimindo recibo.", "VTABOL", Messagebox.OK, Messagebox.INFORMATION); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaAutorizacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaAutorizacionController.java new file mode 100644 index 000000000..351a2b445 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaAutorizacionController.java @@ -0,0 +1,109 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderAutorizacion; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaAutorizacionController") +@Scope("prototype") +public class BusquedaAutorizacionController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwAutorizacion; + private MyListbox autorizacionList; + private Paging pagingAutorizacion; + private Textbox txtNombAutorizacion; + private Textbox txtDescAutorizacion; + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + autorizacionList.setItemRenderer(new RenderAutorizacion()); + autorizacionList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Autorizacion s = (Autorizacion) autorizacionList.getSelected(); + verAutorizacion(s); + } + }); + + refreshLista(); + + txtNombAutorizacion.focus(); + } + + private void verAutorizacion(Autorizacion fs) { + if (fs == null) { + return; + } + + Map args = new HashMap(); + args.put("autorizacion", fs); + args.put("autorizacionList", autorizacionList); + + openWindow("/gui/seguridad/editarAutorizacion.zul", + Labels.getLabel("editarAutorizacionController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject menuBusqueda = + new HibernateSearchObject(Autorizacion.class, + pagingAutorizacion.getPageSize()); + + menuBusqueda.addFilterLike("nombautorizacion", + "%" + txtNombAutorizacion.getText().trim().concat("%")); + menuBusqueda.addFilterLike("descautorizacion", + "%" + txtDescAutorizacion.getText().trim().concat("%")); + + menuBusqueda.addSortAsc("descautorizacion"); + menuBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwAutorizacion.init(menuBusqueda, autorizacionList, pagingAutorizacion); + + if (autorizacionList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaAutorizacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verAutorizacion(new Autorizacion()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaAutorizacionPerfilController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaAutorizacionPerfilController.java new file mode 100644 index 000000000..c0ad15dea --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaAutorizacionPerfilController.java @@ -0,0 +1,180 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import com.rjconsultores.ventaboletos.entidad.AutorizacionPerfil; +import com.rjconsultores.ventaboletos.entidad.Perfil; +import com.rjconsultores.ventaboletos.service.AutorizacionService; +import com.rjconsultores.ventaboletos.service.PerfilService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderAutorizacionPerfil; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Paging; + +/** + * + * @author Administrador + */ +@Controller("busquedaAutorizacionPerfilController") +@Scope("prototype") +public class BusquedaAutorizacionPerfilController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwAutorizacionPerfil; + @Autowired + private PerfilService perfilService; + @Autowired + private AutorizacionService autorizacionService; + private List lsAutorizacion; + private List lsPerfil; + private MyListbox autorizacionPerfilList; + private Paging pagingAutorizacionPerfil; + private Combobox cmbPerfil; + private Combobox cmbAutorizacion; + + public MyListbox getAutorizacionPerfilList() { + return autorizacionPerfilList; + } + + public void setAutorizacionPerfilList(MyListbox autorizacionPerfilList) { + this.autorizacionPerfilList = autorizacionPerfilList; + } + + public Combobox getCmbAutorizacion() { + return cmbAutorizacion; + } + + public void setCmbAutorizacion(Combobox cmbAutorizacion) { + this.cmbAutorizacion = cmbAutorizacion; + } + + public Combobox getCmbPerfil() { + return cmbPerfil; + } + + public void setCmbPerfil(Combobox cmbPerfil) { + this.cmbPerfil = cmbPerfil; + } + + public List getLsAutorizacion() { + return lsAutorizacion; + } + + public void setLsAutorizacion(List lsAutorizacion) { + this.lsAutorizacion = lsAutorizacion; + } + + public List getLsPerfil() { + return lsPerfil; + } + + public void setLsPerfil(List lsPerfil) { + this.lsPerfil = lsPerfil; + } + + public Paging getPagingAutorizacionPerfil() { + return pagingAutorizacionPerfil; + } + + public void setPagingAutorizacionPerfil(Paging pagingAutorizacionPerfil) { + this.pagingAutorizacionPerfil = pagingAutorizacionPerfil; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsAutorizacion = autorizacionService.obtenerTodos(); + lsPerfil = perfilService.obtenerTodos(); + + super.doAfterCompose(comp); + + autorizacionPerfilList.setItemRenderer(new RenderAutorizacionPerfil()); + autorizacionPerfilList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + AutorizacionPerfil s = (AutorizacionPerfil) autorizacionPerfilList.getSelected(); + verAutorizacionPerfil(s); + } + }); + + refreshLista(); + + cmbAutorizacion.focus(); + } + + private void verAutorizacionPerfil(AutorizacionPerfil fs) { + if (fs == null) { + return; + } + + Map args = new HashMap(); + args.put("autorizacionPerfil", fs); + args.put("autorizacionPerfilList", autorizacionPerfilList); + + openWindow("/gui/seguridad/editarAutorizacionPerfil.zul", + Labels.getLabel("editarAutorizacionPerfilController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject menuBusqueda = + new HibernateSearchObject(AutorizacionPerfil.class, + pagingAutorizacionPerfil.getPageSize()); + + Comboitem cbiPerfil = cmbPerfil.getSelectedItem(); + if (cbiPerfil != null) { + Perfil perfil = (Perfil) cbiPerfil.getValue(); + menuBusqueda.addFilterEqual("perfil", perfil); + } + + Comboitem cbiAutorizacion = cmbAutorizacion.getSelectedItem(); + if (cbiAutorizacion != null) { + Autorizacion autorizacion = (Autorizacion) cbiAutorizacion.getValue(); + menuBusqueda.addFilterEqual("autorizacion", autorizacion); + } + + menuBusqueda.addSortAsc("autorizacion.nombautorizacion"); + menuBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwAutorizacionPerfil.init(menuBusqueda, autorizacionPerfilList, + pagingAutorizacionPerfil); + + if (autorizacionPerfilList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaAutorizacionPerfilController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verAutorizacionPerfil(new AutorizacionPerfil()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaCompaniaBancaria.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaCompaniaBancaria.java new file mode 100644 index 000000000..6e480c520 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaCompaniaBancaria.java @@ -0,0 +1,144 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.CompaniaBancaria; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCompaniaBancaria; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaCompaniaBancaria") +@Scope("prototype") +public class BusquedaCompaniaBancaria extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwCompaniaBancaria; + private MyListbox companiaBancariaList; + private Paging pagingCompaniaBancaria; + private Textbox txtCVECompania; + private Textbox txtCVESucursal; + + public MyListbox getCompaniaBancariaList() { + return companiaBancariaList; + } + + public void setCompaniaBancariaList(MyListbox companiaBancariaList) { + this.companiaBancariaList = companiaBancariaList; + } + + public Paging getPagingCompaniaBancaria() { + return pagingCompaniaBancaria; + } + + public void setPagingCompaniaBancaria(Paging pagingCompaniaBancaria) { + this.pagingCompaniaBancaria = pagingCompaniaBancaria; + } + + public Textbox getTxtCVECompania() { + return txtCVECompania; + } + + public void setTxtCVECompania(Textbox txtCVECompania) { + this.txtCVECompania = txtCVECompania; + } + + public Textbox getTxtCVESucursal() { + return txtCVESucursal; + } + + public void setTxtCVESucursal(Textbox txtCVESucursal) { + this.txtCVESucursal = txtCVESucursal; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + companiaBancariaList.setItemRenderer(new RenderCompaniaBancaria()); + companiaBancariaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + CompaniaBancaria s = (CompaniaBancaria) companiaBancariaList.getSelected(); + verCompaniaBancaria(s); + } + }); + + refreshLista(); + + txtCVECompania.focus(); + } + + private void verCompaniaBancaria(CompaniaBancaria c) { + if (c == null) { + return; + } + + Map args = new HashMap(); + args.put("companiaBancaria", c); + args.put("companiaBancariaList", companiaBancariaList); + + openWindow("/gui/seguridad/editarCompaniaBancaria.zul", + Labels.getLabel("editarCompaniaBancariaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject companiaBancariaBusqueda = + new HibernateSearchObject(CompaniaBancaria.class, + pagingCompaniaBancaria.getPageSize()); + + if (!txtCVECompania.getValue().isEmpty()) { + companiaBancariaBusqueda.addFilterEqual("cvecompania", txtCVECompania.getValue()); + } + + if (!txtCVESucursal.getValue().isEmpty()) { + companiaBancariaBusqueda.addFilterEqual("cvesucursal", txtCVESucursal.getValue()); + } + + companiaBancariaBusqueda.addSortAsc("cvecompania"); + companiaBancariaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwCompaniaBancaria.init(companiaBancariaBusqueda, companiaBancariaList, pagingCompaniaBancaria); + + if (companiaBancariaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaCompaniaBancaria.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verCompaniaBancaria(new CompaniaBancaria()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaEstacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaEstacionController.java new file mode 100644 index 000000000..f0d62b952 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaEstacionController.java @@ -0,0 +1,136 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.Estacion; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEstacion; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Longbox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaEstacionController") +@Scope("prototype") +public class BusquedaEstacionController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwEstacion; + @Autowired + private PuntoVentaService puntoVentaService; + private List lsPuntoVenta; + private MyListbox estacionList; + private Paging pagingEstacion; + private Textbox txtDescEstacion; + //private Textbox txtDescMac; + private Combobox cmbPuntoVenta; + private Longbox txtNumCaja; + private static Logger log = Logger.getLogger(BusquedaEstacionController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsPuntoVenta = new ArrayList(); + + super.doAfterCompose(comp); + + estacionList.setItemRenderer(new RenderEstacion()); + estacionList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Estacion s = (Estacion) estacionList.getSelected(); + verEstacion(s); + } + }); + + refreshLista(); + + txtDescEstacion.focus(); + } + + private void verEstacion(Estacion e) { + if (e == null) { + return; + } + + Map args = new HashMap(); + args.put("estacion", e); + args.put("estacionList", estacionList); + + openWindow("/gui/seguridad/editarEstacion.zul", + Labels.getLabel("editarEstacionController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject estacionBusqueda = + new HibernateSearchObject(Estacion.class, + pagingEstacion.getPageSize()); + + estacionBusqueda.addFilterLike("descestacion", + "%" + txtDescEstacion.getText().trim().concat("%")); +// estacionBusqueda.addFilterLike("descmac", +// "%" + txtDescMac.getText().trim().concat("%")); + + Comboitem cbiPuntoVenta = cmbPuntoVenta.getSelectedItem(); + if (cbiPuntoVenta != null) { + PuntoVenta pv = (PuntoVenta) cbiPuntoVenta.getValue(); + estacionBusqueda.addFilterEqual("puntoVenta", pv); + } + + estacionBusqueda.addFilterEqual("numcaja", txtNumCaja.getValue()); + + estacionBusqueda.addSortAsc("descestacion"); + estacionBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwEstacion.init(estacionBusqueda, estacionList, pagingEstacion); + + if (estacionList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("editarEstacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + log.error(ex); + Clients.alert(Labels.getLabel("MSG.Error"), Labels.getLabel("editarEstacionController.window.title"), Messagebox.INFORMATION); + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verEstacion(new Estacion()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaMenuController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaMenuController.java new file mode 100644 index 000000000..0a128e0fd --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaMenuController.java @@ -0,0 +1,183 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.FuncionSistema; +import com.rjconsultores.ventaboletos.entidad.Sistema; +import com.rjconsultores.ventaboletos.service.SistemaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMenu; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author rodrigo + */ +@Controller("busquedaMenuController") +@Scope("prototype") +public class BusquedaMenuController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwMenu; + @Autowired + private SistemaService sistemaService; + private MyListbox menuList; + private Paging pagingMenu; + private Textbox txtNombFuncion; + private Textbox txtDescRuta; + private Combobox cmbSistema; + private Intbox txtID; + private List lsSistema; + + public Combobox getCmbSistema() { + return cmbSistema; + } + + public void setCmbSistema(Combobox cmbSistema) { + this.cmbSistema = cmbSistema; + } + + public MyListbox getMenuList() { + return menuList; + } + + public void setMenuList(MyListbox menuList) { + this.menuList = menuList; + } + + public Textbox getTxtDescRuta() { + return txtDescRuta; + } + + public void setTxtDescRuta(Textbox txtDescRuta) { + this.txtDescRuta = txtDescRuta; + } + + public Intbox getTxtID() { + return txtID; + } + + public void setTxtID(Intbox txtID) { + this.txtID = txtID; + } + + public Textbox getTxtNombFuncion() { + return txtNombFuncion; + } + + public void setTxtNombFuncion(Textbox txtNombFuncion) { + this.txtNombFuncion = txtNombFuncion; + } + + public List getLsSistema() { + return lsSistema; + } + + public void setLsSistema(List lsSistema) { + this.lsSistema = lsSistema; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + lsSistema = sistemaService.obtenerTodos(); + + menuList.setItemRenderer(new RenderMenu()); + menuList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + FuncionSistema s = (FuncionSistema) menuList.getSelected(); + verMenu(s); + } + }); + + refreshLista(); + + txtNombFuncion.focus(); + } + + private void verMenu(FuncionSistema fs) { + if (fs == null) { + return; + } + + Map args = new HashMap(); + args.put("menu", fs); + args.put("menuList", menuList); + + openWindow("/gui/seguridad/editarMenu.zul", + Labels.getLabel("editarMenuController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject menuBusqueda = + new HibernateSearchObject(FuncionSistema.class, + pagingMenu.getPageSize()); + + String nombFuncion = txtNombFuncion.getText(); + if (nombFuncion != null) { + menuBusqueda.addFilterLike("nombfuncion", "%" + nombFuncion.trim().concat("%")); + } + + String descRuta = txtDescRuta.getText(); + if (descRuta != null) { + menuBusqueda.addFilterLike("descruta", "%" + descRuta.trim().concat("%")); + } + + Comboitem itemSistema = cmbSistema.getSelectedItem(); + if (itemSistema != null) { + Sistema sistema = (Sistema) itemSistema.getValue(); + menuBusqueda.addFilterEqual("sistema", sistema); + } + + menuBusqueda.addFilterEqual("funcionsistemaId", txtID.getValue()); + + menuBusqueda.addSortAsc("nombfuncion"); + menuBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwMenu.init(menuBusqueda, menuList, pagingMenu); + + if (menuList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaMenuController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verMenu(new FuncionSistema()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaPerfilController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaPerfilController.java new file mode 100644 index 000000000..872162548 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaPerfilController.java @@ -0,0 +1,108 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.Perfil; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPerfil; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author rodrigo + */ +@Controller("busquedaPerfilController") +@Scope("prototype") +public class BusquedaPerfilController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwPerfil; + private MyListbox perfilList; + private Paging pagingPerfil; + private Textbox txtNome; + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + perfilList.setItemRenderer(new RenderPerfil()); + perfilList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Perfil s = (Perfil) perfilList.getSelected(); + verSistema(s); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verSistema(Perfil s) { + if (s == null) { + return; + } + + Map args = new HashMap(); + args.put("perfil", s); + args.put("perfilList", perfilList); + + openWindow("/gui/seguridad/editarPerfil.zul", + Labels.getLabel("editarPerfilController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject sistemaBusqueda = + new HibernateSearchObject(Perfil.class, + pagingPerfil.getPageSize()); + + String descPerfil = txtNome.getText(); + if (descPerfil != null) { + sistemaBusqueda.addFilterLike("descperfil", "%" + descPerfil.trim().concat("%")); + } + + sistemaBusqueda.addSortAsc("descperfil"); + sistemaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwPerfil.init(sistemaBusqueda, perfilList, pagingPerfil); + + if (perfilList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaPerfilController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verSistema(new Perfil()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaSistemaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaSistemaController.java new file mode 100644 index 000000000..34afb9fc2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaSistemaController.java @@ -0,0 +1,140 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.Sistema; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderSistema; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author rodrigo + */ +@Controller("busquedaSistemaController") +@Scope("prototype") +public class BusquedaSistemaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwFormaPago; + private MyListbox sistemaList; + private Paging pagingSistema; + private Textbox txtNome; + private Intbox txtID; + + public Paging getPagingSistema() { + return pagingSistema; + } + + public void setPagingSistema(Paging pagingSistema) { + this.pagingSistema = pagingSistema; + } + + public MyListbox getSistemaList() { + return sistemaList; + } + + public void setSistemaList(MyListbox sistemaList) { + this.sistemaList = sistemaList; + } + + public Intbox getTxtID() { + return txtID; + } + + public void setTxtID(Intbox txtID) { + this.txtID = txtID; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + sistemaList.setItemRenderer(new RenderSistema()); + sistemaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Sistema s = (Sistema) sistemaList.getSelected(); + verSistema(s); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verSistema(Sistema s) { + if (s == null) { + return; + } + + Map args = new HashMap(); + args.put("sistema", s); + args.put("sistemaList", sistemaList); + + openWindow("/gui/seguridad/editarSistema.zul", + Labels.getLabel("editarSistemaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject sistemaBusqueda = + new HibernateSearchObject(Sistema.class, + pagingSistema.getPageSize()); + + sistemaBusqueda.addFilterLike("nombsistema", "%" + txtNome.getText().trim().concat("%")); + sistemaBusqueda.addFilterEqual("sistemaId", txtID.getValue()); + + sistemaBusqueda.addSortAsc("nombsistema"); + sistemaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwFormaPago.init(sistemaBusqueda, sistemaList, pagingSistema); + + if (sistemaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaSistemaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verSistema(new Sistema()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaUsuarioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaUsuarioController.java new file mode 100644 index 000000000..23db45f72 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/BusquedaUsuarioController.java @@ -0,0 +1,231 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.Perfil; +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.service.PerfilService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderUsuario; +import com.trg.search.Filter; + +/** + * + * @author rodrigo + */ +@Controller("busquedaUsuarioController") +@Scope("prototype") +public class BusquedaUsuarioController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwFormaPago; + @Autowired + private PerfilService perfilService; + private List lsPerfil; + private MyListbox usuarioList; + private Paging pagingUsuario; + private Textbox txtNombUsuario; + private Textbox txtNombPaterno; + private Textbox txtNombMaterno; + private Textbox txtCveUsuario; + private Textbox txtCveEmpleado; + private Combobox cmbPerfil; + + public Textbox getTxtCveUsuario() { + return txtCveUsuario; + } + + public void setTxtCveUsuario(Textbox txtCveUsuario) { + this.txtCveUsuario = txtCveUsuario; + } + + public List getLsPerfil() { + return lsPerfil; + } + + public void setLsPerfil(List lsPerfil) { + this.lsPerfil = lsPerfil; + } + + public Combobox getCmbPerfil() { + return cmbPerfil; + } + + public void setCmbPerfil(Combobox cmbPerfil) { + this.cmbPerfil = cmbPerfil; + } + + public Paging getPagingUsuario() { + return pagingUsuario; + } + + public void setPagingUsuario(Paging pagingUsuario) { + this.pagingUsuario = pagingUsuario; + } + + + public Textbox getTxtNombMaterno() { + return txtNombMaterno; + } + + public void setTxtNombMaterno(Textbox txtNombMaterno) { + this.txtNombMaterno = txtNombMaterno; + } + + public Textbox getTxtNombPaterno() { + return txtNombPaterno; + } + + public void setTxtNombPaterno(Textbox txtNombPaterno) { + this.txtNombPaterno = txtNombPaterno; + } + + public Textbox getTxtNombUsuario() { + return txtNombUsuario; + } + + public void setTxtNombUsuario(Textbox txtNombUsuario) { + this.txtNombUsuario = txtNombUsuario; + } + + public MyListbox getUsuarioList() { + return usuarioList; + } + + public void setUsuarioList(MyListbox usuarioList) { + this.usuarioList = usuarioList; + } + + public Textbox getTxtCveEmpleado() { + return txtCveEmpleado; + } + + public void setTxtCveEmpleado(Textbox txtCveEmpleado) { + this.txtCveEmpleado = txtCveEmpleado; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsPerfil = perfilService.obtenerTodos(); + + super.doAfterCompose(comp); + + usuarioList.setItemRenderer(new RenderUsuario()); + usuarioList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Usuario s = (Usuario) usuarioList.getSelected(); + verUsuario(s); + } + }); + + refreshLista(); + + txtCveEmpleado.focus(); + } + + private void verUsuario(Usuario u) { + if (u == null) { + return; + } + + Map args = new HashMap(); + args.put("usuario", u); + args.put("usuarioList", usuarioList); + args.put("usrAdmin", Boolean.TRUE); + + openWindow("/gui/seguridad/editarUsuario.zul", + Labels.getLabel("editarUsuarioController.window.title"), args, MODAL); + + + } + + private void refreshLista() { + HibernateSearchObject sistemaBusqueda = + new HibernateSearchObject(Usuario.class, + pagingUsuario.getPageSize()); + + String nombUsuario = txtNombUsuario.getText(); + if (nombUsuario != null) { + sistemaBusqueda.addFilterLike("nombusuario", "%" + nombUsuario.trim().concat("%")); + } + + String nombPaterno = txtNombPaterno.getText(); + if (nombPaterno != null) { + sistemaBusqueda.addFilterLike("nombpaterno", "%" + nombPaterno.trim().concat("%")); + } + + String nombMaterno = txtNombMaterno.getText(); + if (nombMaterno != null) { + sistemaBusqueda.addFilterLike("nombmaterno", "%" + nombMaterno.trim().concat("%")); + } + + String cveUsuario = txtCveUsuario.getText(); + if (cveUsuario != null) { + sistemaBusqueda.addFilterLike("claveUsuario", "%" + cveUsuario.trim().concat("%")); + } + + String cveEmpleado = txtCveEmpleado.getText(); + if (!cveEmpleado.equals("")) { + sistemaBusqueda.addFilterEqual("empleado.cveEmpleado", cveEmpleado.trim()); + } + + Comboitem comboItem = cmbPerfil.getSelectedItem(); + if (comboItem != null) { + Perfil perfil = (Perfil) comboItem.getValue(); + + sistemaBusqueda.addFilterSome("usuarioPerfilList", + Filter.and(Filter.equal("perfil", perfil), + Filter.equal("activo", true))); + } + + sistemaBusqueda.addSortAsc("claveUsuario"); + sistemaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwFormaPago.init(sistemaBusqueda, usuarioList, pagingUsuario); + + if (usuarioList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaUsuarioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verUsuario(new Usuario()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarAutorizacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarAutorizacionController.java new file mode 100644 index 000000000..2a1dbc620 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarAutorizacionController.java @@ -0,0 +1,155 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import com.rjconsultores.ventaboletos.service.AutorizacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarAutorizacionController") +@Scope("prototype") +public class EditarAutorizacionController extends MyGenericForwardComposer { + + @Autowired + private AutorizacionService autorizacionService; + private Autorizacion autorizacion; + private MyListbox autorizacionList; + private static Logger log = Logger.getLogger(EditarAutorizacionController.class); + private Textbox txtNombAutorizacion; + private Textbox txtDescAutorizacion; + private Button btnApagar; + + public Autorizacion getAutorizacion() { + return autorizacion; + } + + public void setAutorizacion(Autorizacion autorizacion) { + this.autorizacion = autorizacion; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Textbox getTxtDescAutorizacion() { + return txtDescAutorizacion; + } + + public void setTxtDescAutorizacion(Textbox txtDescAutorizacion) { + this.txtDescAutorizacion = txtDescAutorizacion; + } + + public Textbox getTxtNombAutorizacion() { + return txtNombAutorizacion; + } + + public void setTxtNombAutorizacion(Textbox txtNombAutorizacion) { + this.txtNombAutorizacion = txtNombAutorizacion; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + autorizacion = (Autorizacion) Executions.getCurrent().getArg().get("autorizacion"); + autorizacionList = (MyListbox) Executions.getCurrent().getArg().get("autorizacionList"); + + txtNombAutorizacion.focus(); + + if (autorizacion.getAutorizacionId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNombAutorizacion.getValue(); + + try { + autorizacion.setActivo(Boolean.TRUE); + autorizacion.setFecmodif(Calendar.getInstance().getTime()); + autorizacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsAutorizacion = + autorizacionService.buscar(autorizacion.getNombautorizacion(), + autorizacion.getDescautorizacion()); + + if (!lsAutorizacion.isEmpty()) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarAutorizacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (autorizacion.getAutorizacionId() == null) { + autorizacionService.suscribir(autorizacion); + autorizacionList.addItem(autorizacion); + } else { + autorizacionService.actualizacion(autorizacion); + autorizacionList.updateItem(autorizacion); + } + + Messagebox.show( + Labels.getLabel("editarAutorizacionController.MSG.suscribirOK"), + Labels.getLabel("editarAutorizacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error("editarAutorizacionController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarAutorizacionController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarAutorizacionController.MSG.borrarPergunta"), + Labels.getLabel("editarAutorizacionController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + autorizacionService.borrar(autorizacion); + + Messagebox.show( + Labels.getLabel("editarAutorizacionController.MSG.borrarOK"), + Labels.getLabel("editarAutorizacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + autorizacionList.removeItem(autorizacion); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarAutorizacionPerfilController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarAutorizacionPerfilController.java new file mode 100644 index 000000000..2939b227c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarAutorizacionPerfilController.java @@ -0,0 +1,180 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import com.rjconsultores.ventaboletos.entidad.AutorizacionPerfil; +import com.rjconsultores.ventaboletos.entidad.Perfil; +import com.rjconsultores.ventaboletos.service.AutorizacionPerfilService; +import com.rjconsultores.ventaboletos.service.AutorizacionService; +import com.rjconsultores.ventaboletos.service.PerfilService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; + +/** + * + * @author Administrador + */ +@Controller("editarAutorizacionPerfilController") +@Scope("prototype") +public class EditarAutorizacionPerfilController extends MyGenericForwardComposer { + + @Autowired + private AutorizacionPerfilService autorizacionPerfilService; + @Autowired + private PerfilService perfilService; + @Autowired + private AutorizacionService autorizacionService; + private List lsAutorizacion; + private List lsPerfil; + private AutorizacionPerfil autorizacionPerfil; + private MyListbox autorizacionPerfilList; + private Combobox cmbPerfil; + private Combobox cmbAutorizacion; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarAutorizacionPerfilController.class); + + public AutorizacionPerfil getAutorizacionPerfil() { + return autorizacionPerfil; + } + + public void setAutorizacionPerfil(AutorizacionPerfil autorizacionPerfil) { + this.autorizacionPerfil = autorizacionPerfil; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Combobox getCmbAutorizacion() { + return cmbAutorizacion; + } + + public void setCmbAutorizacion(Combobox cmbAutorizacion) { + this.cmbAutorizacion = cmbAutorizacion; + } + + public Combobox getCmbPerfil() { + return cmbPerfil; + } + + public void setCmbPerfil(Combobox cmbPerfil) { + this.cmbPerfil = cmbPerfil; + } + + public List getLsAutorizacion() { + return lsAutorizacion; + } + + public void setLsAutorizacion(List lsAutorizacion) { + this.lsAutorizacion = lsAutorizacion; + } + + public List getLsPerfil() { + return lsPerfil; + } + + public void setLsPerfil(List lsPerfil) { + this.lsPerfil = lsPerfil; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsAutorizacion = autorizacionService.obtenerTodos(); + lsPerfil = perfilService.obtenerTodos(); + + super.doAfterCompose(comp); + + autorizacionPerfil = (AutorizacionPerfil) Executions.getCurrent().getArg().get("autorizacionPerfil"); + autorizacionPerfilList = (MyListbox) Executions.getCurrent().getArg().get("autorizacionPerfilList"); + + if (autorizacionPerfil.getAutorizacionperfilId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + cmbAutorizacion.focus(); + } + + public void onClick$btnSalvar(Event ev) { + cmbPerfil.getSelectedItem(); + cmbAutorizacion.getSelectedItem(); + + try { + autorizacionPerfil.setActivo(Boolean.TRUE); + autorizacionPerfil.setFecmodif(Calendar.getInstance().getTime()); + autorizacionPerfil.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsAutoriazacionPerfil = + autorizacionPerfilService.buscar(autorizacionPerfil.getAutorizacion(), + autorizacionPerfil.getPerfil()); + + if (!lsAutoriazacionPerfil.isEmpty()) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarAutorizacionPerfilController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (autorizacionPerfil.getAutorizacionperfilId() == null) { + autorizacionPerfilService.suscribir(autorizacionPerfil); + autorizacionPerfilList.addItem(autorizacionPerfil); + } else { + autorizacionPerfilService.actualizacion(autorizacionPerfil); + autorizacionPerfilList.updateItem(autorizacionPerfil); + } + + Messagebox.show( + Labels.getLabel("editarAutorizacionPerfilController.MSG.suscribirOK"), + Labels.getLabel("editarAutorizacionPerfilController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarAutorizacionPerfilController.MSG.borrarPergunta"), + Labels.getLabel("editarAutorizacionPerfilController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + autorizacionPerfilService.borrar(autorizacionPerfil); + + Messagebox.show( + Labels.getLabel("editarAutorizacionPerfilController.MSG.borrarOK"), + Labels.getLabel("editarAutorizacionPerfilController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + autorizacionPerfilList.removeItem(autorizacionPerfil); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarCompanhiaBancariaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarCompanhiaBancariaController.java new file mode 100644 index 000000000..d785037b5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarCompanhiaBancariaController.java @@ -0,0 +1,255 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.CompaniaBancaria; +import com.rjconsultores.ventaboletos.entidad.MerchantBancario; +import com.rjconsultores.ventaboletos.entidad.UsuarioBancario; +import com.rjconsultores.ventaboletos.service.CompaniaBancariaService; +import com.rjconsultores.ventaboletos.service.MerchantBancarioService; +import com.rjconsultores.ventaboletos.service.UsuarioBancarioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMerchantBancario; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderUsuarioBancario; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarCompaniaBancariaController") +@Scope("prototype") +public class EditarCompanhiaBancariaController extends MyGenericForwardComposer { + + @Autowired + private CompaniaBancariaService companiaBancariaService; + @Autowired + private UsuarioBancarioService usuarioBancarioService; + @Autowired + private MerchantBancarioService merchantBancarioService; + private Button btnApagar; + private CompaniaBancaria companiaBancaria; + private MyListbox companiaBancariaList; + private MyListbox usuarioBancarioList; + private MyListbox merchantBancarioList; + private Textbox txtCVECompania; + private Textbox txtCVESucursal; + private static Logger log = Logger.getLogger(EditarCompanhiaBancariaController.class); + + public CompaniaBancaria getCompaniaBancaria() { + return companiaBancaria; + } + + public void setCompaniaBancaria(CompaniaBancaria companiaBancaria) { + this.companiaBancaria = companiaBancaria; + } + + public Textbox getTxtCVECompania() { + return txtCVECompania; + } + + public void setTxtCVECompania(Textbox txtCVECompania) { + this.txtCVECompania = txtCVECompania; + } + + public Textbox getTxtCVESucursal() { + return txtCVESucursal; + } + + public void setTxtCVESucursal(Textbox txtCVESucursal) { + this.txtCVESucursal = txtCVESucursal; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + usuarioBancarioList.setItemRenderer(new RenderUsuarioBancario()); + merchantBancarioList.setItemRenderer(new RenderMerchantBancario()); + + companiaBancaria = (CompaniaBancaria) Executions.getCurrent().getArg().get("companiaBancaria"); + companiaBancariaList = (MyListbox) Executions.getCurrent().getArg().get("companiaBancariaList"); + + if (companiaBancaria.getCompaniabancariaId() != null) { + companiaBancaria = companiaBancariaService.obtenerID(companiaBancaria.getCompaniabancariaId()); + + List lsUsuarioBancario = companiaBancaria.getUsuarioBancarioList(); + List lsMerchantBancario = companiaBancaria.getMerchantBancarioList(); + + usuarioBancarioList.setData(lsUsuarioBancario); + merchantBancarioList.setData(lsMerchantBancario); + } else { + btnApagar.setVisible(Boolean.FALSE); + } + } + + public void onClick$btnAdicionarUsuarioBancario(Event ev) { + if (companiaBancaria.getUsuarioBancarioList() == null) { + companiaBancaria.setUsuarioBancarioList(new ArrayList()); + } + + Map args = new HashMap(); + args.put("companiaBancaria", companiaBancaria); + args.put("usuarioBancarioList", usuarioBancarioList); + args.put("lsUsuarioBancario", companiaBancaria.getUsuarioBancarioList()); + + openWindow("/gui/seguridad/editarUsuarioBancario.zul", + Labels.getLabel("editarUsuarioBancarioController.window.title"), args, MODAL); + } + + public void onClick$btnRemoverUsuarioBancario(Event ev) { + if (companiaBancaria.getUsuarioBancarioList() != null) { + UsuarioBancario usuarioBancario = (UsuarioBancario) usuarioBancarioList.getSelected(); + + if (usuarioBancario.getUsuariobancarioId() != null) { + usuarioBancario.setActivo(Boolean.FALSE); + usuarioBancario.setFecmodif(Calendar.getInstance().getTime()); + usuarioBancario.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + usuarioBancarioService.borrar(usuarioBancario); + } + + companiaBancaria.getUsuarioBancarioList().remove(usuarioBancario); + usuarioBancarioList.setData(companiaBancaria.getUsuarioBancarioList()); + } + } + + public void onClick$btnAdicionarMerchantBancario(Event ev) { + if (companiaBancaria.getMerchantBancarioList() == null) { + companiaBancaria.setMerchantBancarioList(new ArrayList()); + } + + Map args = new HashMap(); + args.put("companiaBancaria", companiaBancaria); + args.put("merchantBancarioList", merchantBancarioList); + args.put("lsMerchantBancario", companiaBancaria.getMerchantBancarioList()); + + openWindow("/gui/seguridad/editarMerchantBancario.zul", + Labels.getLabel("editarMerchantBancarioController.window.title"), args, MODAL); + } + + public void onClick$btnRemoverMerchantBancario(Event ev) { + if (companiaBancaria.getMerchantBancarioList() != null) { + MerchantBancario merchantBancario = (MerchantBancario) merchantBancarioList.getSelected(); + + if (merchantBancario.getMerchantbancarioId() != null) { + merchantBancario.setActivo(Boolean.FALSE); + merchantBancario.setFecmodif(Calendar.getInstance().getTime()); + merchantBancario.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + merchantBancarioService.borrar(merchantBancario); + } + + companiaBancaria.getMerchantBancarioList().remove(merchantBancario); + merchantBancarioList.setData(companiaBancaria.getMerchantBancarioList()); + } + } + + public void onClick$btnSalvar(Event ev) { + txtCVECompania.getValue(); + txtCVESucursal.getValue(); + + try { + + if (companiaBancaria.getUsuarioBancarioList().isEmpty()) { + Messagebox.show( + Labels.getLabel("editarCompaniaBancariaController.MSG.usu"), + Labels.getLabel("editarCompaniaBancariaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (companiaBancaria.getMerchantBancarioList().isEmpty()) { + Messagebox.show( + Labels.getLabel("editarCompaniaBancariaController.MSG.mer"), + Labels.getLabel("editarCompaniaBancariaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + companiaBancaria.setActivo(Boolean.TRUE); + companiaBancaria.setFecmodif(Calendar.getInstance().getTime()); + companiaBancaria.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List ciaBancaria = companiaBancariaService.buscar(companiaBancaria); + + boolean podeSalvar = false; + if (ciaBancaria.isEmpty()) { + podeSalvar = true; + } else { + if (companiaBancaria.getCompaniabancariaId() != null) { + for (CompaniaBancaria c : ciaBancaria) { + if (c.getCompaniabancariaId().equals(companiaBancaria.getCompaniabancariaId())) { + podeSalvar = true; + } + } + } + } + + if (podeSalvar) { + + + if (companiaBancaria.getCompaniabancariaId() == null) { + companiaBancaria = companiaBancariaService.suscribir(companiaBancaria); + companiaBancariaList.addItem(companiaBancaria); + } else { + companiaBancaria = companiaBancariaService.actualizacion(companiaBancaria); + companiaBancariaList.updateItem(companiaBancaria); + } + + Messagebox.show( + Labels.getLabel("editarCompaniaBancariaController.MSG.suscribirOK"), + Labels.getLabel("editarCompaniaBancariaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarCompaniaBancariaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarCompaniaBancariaController.MSG.borrarPergunta"), + Labels.getLabel("editarCompaniaBancariaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + companiaBancariaService.borrar(companiaBancaria); + + Messagebox.show( + Labels.getLabel("editarCompaniaBancariaController.MSG.borrarOK"), + Labels.getLabel("editarCompaniaBancariaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + companiaBancariaList.removeItem(companiaBancaria); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarEstacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarEstacionController.java new file mode 100644 index 000000000..a83f411af --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarEstacionController.java @@ -0,0 +1,240 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.Estacion; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.entidad.UsuarioBancario; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.EstacionService; +import com.rjconsultores.ventaboletos.service.UsuarioBancarioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Label; +import org.zkoss.zul.Longbox; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarEstacionController") +@Scope("prototype") +public class EditarEstacionController extends MyGenericForwardComposer { + + @Autowired + private EstacionService estacionService; + @Autowired + private UsuarioBancarioService usuarioBancarioService; + private MyListbox estacionList; + private Button btnApagar; + private Textbox txtDescEstacion; + private Textbox txtDescMac; + private Longbox txtNumCaja; + private Estacion estacion; + private List lsPuntoVenta; + private List lsUsuarioBancario; + private MyComboboxPuntoVenta cmbPuntoVenta; + private Combobox cmbConexion; + private Checkbox chkPinPad; + private Label lbPinPad; + private static Logger log = Logger.getLogger(EditarEstacionController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Estacion getEstacion() { + return estacion; + } + + public void setEstacion(Estacion estacion) { + this.estacion = estacion; + } + + public Textbox getTxtDescEstacion() { + return txtDescEstacion; + } + + public void setTxtDescEstacion(Textbox txtDescEstacion) { + this.txtDescEstacion = txtDescEstacion; + } + + public List getLsPuntoVenta() { + return lsPuntoVenta; + } + + public void setLsPuntoVenta(List lsPuntoVenta) { + this.lsPuntoVenta = lsPuntoVenta; + } + + public Textbox getTxtDescMac() { + return txtDescMac; + } + + public void setTxtDescMac(Textbox txtDescMac) { + this.txtDescMac = txtDescMac; + } + + public Longbox getTxtNumCaja() { + return txtNumCaja; + } + + public void setTxtNumCaja(Longbox txtNumCaja) { + this.txtNumCaja = txtNumCaja; + } + + public List getLsUsuarioBancario() { + return lsUsuarioBancario; + } + + public void setLsUsuarioBancario(List lsUsuarioBancario) { + this.lsUsuarioBancario = lsUsuarioBancario; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + lsUsuarioBancario = usuarioBancarioService.obtenerTodos(); + lsPuntoVenta = new ArrayList(); + + estacion = (Estacion) Executions.getCurrent().getArg().get("estacion"); + estacionList = (MyListbox) Executions.getCurrent().getArg().get("estacionList"); + + lbPinPad.setVisible(Boolean.FALSE); + chkPinPad.setVisible(Boolean.FALSE); + + if (estacion.getEstacionId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + // Convertendo a mascara em Hexa novamente. + if (estacion.getDescmac() != null && !estacion.getDescmac().equals("")) { + Long hx = Long.parseLong(estacion.getDescmac(), 10); + String descMac = Long.toHexString(hx); + while (descMac.length() < 12) { + descMac = "0" + descMac; + } + // AABBCCDDEEFF + // AA-BB-CC-DD-EE-FF + descMac = descMac.substring(0, 2).concat("-").concat(descMac.substring(2, 4).concat("-")).concat(descMac.substring(4, 6)).concat("-").concat(descMac.substring(6, 8)).concat("-").concat(descMac.substring(8, 10).concat("-")).concat(descMac.substring(10, 12)); + + txtDescMac.setText(descMac.toUpperCase()); + } + + if (estacion.getConexionBancaria() != null) { + if (estacion.getConexionBancaria().equals("S")) { + lbPinPad.setVisible(Boolean.TRUE); + chkPinPad.setVisible(Boolean.TRUE); + + if (estacion.getPinPadImpresoraPropia() != null) { + chkPinPad.setChecked(estacion.getPinPadImpresoraPropia()); + } + } + } + } + + txtDescEstacion.focus(); + + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + cmbPuntoVenta.getValue(true); + cmbConexion.getValue(); + + if (cmbConexion.getValue().equals("")) { + estacion.setConexionBancaria(null); + estacion.setUsuarioBancario(null); + } + + String descMac = txtDescMac.getText(); + + estacion.setActivo(Boolean.TRUE); + estacion.setFecmodif(Calendar.getInstance().getTime()); + estacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + estacion.setDescmac(estacionService.getDecimalMAC(descMac).toString()); + estacion.setPinPadImpresoraPropia(chkPinPad.isChecked()); + + try { + estacionService.suscribirActualizar(estacion); + Messagebox.show(Labels.getLabel("editarEstacionController.MSG.suscribirOK"), + Labels.getLabel("editarEstacionController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + + } catch (BusinessException e) { + Messagebox.show(e.getMessage(), Labels.getLabel("editarEstacionController.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show(Labels.getLabel("editarEstacionController.MSG.borrarPergunta"), + Labels.getLabel("editarEstacionController.window.title"), Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + estacionService.borrar(estacion); + + Messagebox.show(Labels.getLabel("editarEstacionController.MSG.borrarOK"), + Labels.getLabel("editarEstacionController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + + estacionList.removeItem(estacion); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert(Labels.getLabel("MSG.Error"), Labels.getLabel("editarEstacionController.window.title"), Messagebox.INFORMATION); + } + } + + public void onChange$cmbConexion(Event ev) { + habilitarCombo(); + if (cmbConexion.getValue().equals("")) { + estacion.setConexionBancaria(null); + estacion.setUsuarioBancario(null); + } + } + + private void habilitarCombo() { + Comboitem cbi = cmbConexion.getSelectedItem(); + if (cbi != null) { + String valor = (String) cbi.getValue(); + + if (valor.equals("S")) { + lbPinPad.setVisible(Boolean.TRUE); + chkPinPad.setVisible(Boolean.TRUE); + } else { + lbPinPad.setVisible(Boolean.FALSE); + chkPinPad.setVisible(Boolean.FALSE); + chkPinPad.setChecked(Boolean.FALSE); + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarMenuController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarMenuController.java new file mode 100644 index 000000000..a5bebca09 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarMenuController.java @@ -0,0 +1,145 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.FuncionSistema; +import com.rjconsultores.ventaboletos.entidad.Sistema; +import com.rjconsultores.ventaboletos.service.FuncionSistemaService; +import com.rjconsultores.ventaboletos.service.SistemaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Textbox; + +/** + * + * @author rodrigo + */ +@Controller("editarMenuController") +@Scope("prototype") +public class EditarMenuController extends MyGenericForwardComposer { + + @Autowired + private FuncionSistemaService funcionSistemaService; + @Autowired + private SistemaService sistemaService; + private List lsSistema; + private FuncionSistema funcionSistema; + private MyListbox menuList; + private Textbox txtNombFuncion; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarMenuController.class); + + public FuncionSistema getFuncionSistema() { + return funcionSistema; + } + + public void setFuncionSistema(FuncionSistema funcionSistema) { + this.funcionSistema = funcionSistema; + } + + public List getLsSistema() { + return lsSistema; + } + + public void setLsSistema(List lsSistema) { + this.lsSistema = lsSistema; + } + + public Textbox getTxtNombFuncion() { + return txtNombFuncion; + } + + public void setTxtNombFuncion(Textbox txtNombFuncion) { + this.txtNombFuncion = txtNombFuncion; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + lsSistema = sistemaService.obtenerTodos(); + + funcionSistema = (FuncionSistema) Executions.getCurrent().getArg().get("menu"); + menuList = (MyListbox) Executions.getCurrent().getArg().get("menuList"); + + if (funcionSistema.getFuncionsistemaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNombFuncion.focus(); + } + + public void onClick$btnSalvar(Event ev) { + txtNombFuncion.getText(); + + try { + funcionSistema.setActivo(Boolean.TRUE); + funcionSistema.setFecmodif(Calendar.getInstance().getTime()); + funcionSistema.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (funcionSistema.getFuncionsistemaId() == null) { + funcionSistemaService.suscribir(funcionSistema); + menuList.addItem(funcionSistema); + } else { + funcionSistemaService.actualizacion(funcionSistema); + menuList.updateItem(funcionSistema); + } + + Messagebox.show( + Labels.getLabel("editarMenuController.MSG.suscribirOK"), + Labels.getLabel("editarMenuController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarMenuController.MSG.borrarPergunta"), + Labels.getLabel("editarMenuController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + funcionSistemaService.borrar(funcionSistema); + + Messagebox.show( + Labels.getLabel("editarMenuController.MSG.borrarOK"), + Labels.getLabel("editarMenuController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + menuList.removeItem(funcionSistema); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarMerchantBancarioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarMerchantBancarioController.java new file mode 100644 index 000000000..f20f15cba --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarMerchantBancarioController.java @@ -0,0 +1,75 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.CompaniaBancaria; +import com.rjconsultores.ventaboletos.entidad.MerchantBancario; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; + +/** + * + * @author Administrador + */ +@Controller("editarMerchantBancarioController") +@Scope("prototype") +public class EditarMerchantBancarioController extends MyGenericForwardComposer { + + private CompaniaBancaria companiaBancaria; + private MerchantBancario merchantBancario; + private List lsMerchantBancario; + private MyListbox merchantBancarioList; + + public MerchantBancario getMerchantBancario() { + return merchantBancario; + } + + public void setMerchantBancario(MerchantBancario merchantBancario) { + this.merchantBancario = merchantBancario; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + companiaBancaria = (CompaniaBancaria) Executions.getCurrent().getArg().get("companiaBancaria"); + merchantBancarioList = (MyListbox) Executions.getCurrent().getArg().get("merchantBancarioList"); + lsMerchantBancario = (List) Executions.getCurrent().getArg().get("lsMerchantBancario"); + + merchantBancario = new MerchantBancario(); + merchantBancario.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + merchantBancario.setActivo(Boolean.TRUE); + merchantBancario.setFecmodif(Calendar.getInstance().getTime()); + merchantBancario.setCompaniaBancaria(companiaBancaria); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + for (MerchantBancario ub : lsMerchantBancario) { + if (ub.getCvemerchant().equals(merchantBancario.getCvemerchant())) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarMerchantBancarioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + } + + lsMerchantBancario.add(merchantBancario); + merchantBancarioList.setData(lsMerchantBancario); + closeWindow(); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarPerfilController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarPerfilController.java new file mode 100644 index 000000000..a06099855 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarPerfilController.java @@ -0,0 +1,325 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.FuncionSistema; +import com.rjconsultores.ventaboletos.entidad.Perfil; +import com.rjconsultores.ventaboletos.entidad.PerfilFuncion; +import com.rjconsultores.ventaboletos.service.FuncionSistemaService; +import com.rjconsultores.ventaboletos.service.PerfilFuncionService; +import com.rjconsultores.ventaboletos.service.PerfilService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPermiso; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.ComboitemRenderer; +import org.zkoss.zul.Textbox; +import org.zkoss.zul.Window; + +/** + * + * @author rodrigo + */ +@Controller("editarPerfilController") +@Scope("prototype") +public class EditarPerfilController extends MyGenericForwardComposer { + + @Autowired + private PerfilService perfilService; + @Autowired + private FuncionSistemaService funcionSistemaService; + @Autowired + private PerfilFuncionService perfilFuncionService; + private Perfil perfil; + private MyListbox perfilList; + private MyListbox permisoList; + private Textbox txtDescPerfil; + private List lsFuncionSistema; + private List lsAllFuncionPerfil; + private List lsPermiso; + private Combobox cmbFuncionSistema; + private Button btnApagar; + private Window winEditarPerfil; + private static Logger log = Logger.getLogger(EditarPerfilController.class); + + public Perfil getPerfil() { + return perfil; + } + + public void setPerfil(Perfil perfil) { + this.perfil = perfil; + } + + public Combobox getCmbFuncionSistema() { + return cmbFuncionSistema; + } + + public void setCmbFuncionSistema(Combobox cmbFuncionSistema) { + this.cmbFuncionSistema = cmbFuncionSistema; + } + + public List getLsFuncionSistema() { + return lsFuncionSistema; + } + + public void setLsFuncionSistema(List lsFuncionSistema) { + this.lsFuncionSistema = lsFuncionSistema; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsFuncionSistema = funcionSistemaService.obtenerTodos(); + lsAllFuncionPerfil = new ArrayList(); + + super.doAfterCompose(comp); + + permisoList.setItemRenderer(new RenderPermiso()); + + perfil = (Perfil) Executions.getCurrent().getArg().get("perfil"); + if (perfil.getPerfilId() != null) { + perfil = perfilService.obtenerID(perfil.getPerfilId()); + + for (FuncionSistema fas : lsFuncionSistema) { + for (PerfilFuncion pf : perfil.getPerfilFuncionList()) { + FuncionSistema fs = pf.getFuncionSistema(); + if (fas.equals(fs)) { + lsAllFuncionPerfil.add(fas); + } + } + } + } + + perfilList = (MyListbox) Executions.getCurrent().getArg().get("perfilList"); + + if (perfil.getPerfilFuncionList() == null) { + lsPermiso = new ArrayList(); + } else { + lsPermiso = perfil.getPerfilFuncionList(); + } + permisoList.setData(lsPermiso); + + if (perfil.getPerfilId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + cmbFuncionSistema.setItemRenderer(new ComboitemRenderer() { + + @Override + public void render(Comboitem cmbtm, Object o) throws Exception { + FuncionSistema fsItem = (FuncionSistema) o; + for (FuncionSistema fs : lsAllFuncionPerfil) { + if (fsItem.getFuncionsistemaId().equals(fs.getFuncionsistemaId())) { + cmbtm.setVisible(false); + } + } + cmbtm.setLabel(fsItem.getNombfuncion()); + cmbtm.setValue(fsItem); + } + }); + + winEditarPerfil.addEventListener("onClose", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + txtDescPerfil.getText(); + if (lsPermiso.isEmpty()) { + Clients.alert(Labels.getLabel("editarPerfilController.MSG.funcionObligatorio"), + Labels.getLabel("editarPerfilController.window.title"), + Messagebox.INFORMATION); + + + } + event.stopPropagation(); + + } + }); + + txtDescPerfil.focus(); + } + + private boolean duplicado() { + List listPerfil = perfilService.buscar(txtDescPerfil.getText()); + if (listPerfil.isEmpty()) { + return false; + } + boolean duplicado = true; + + if (perfil.getPerfilId() == null) { + return true; + } + + for (Perfil p : listPerfil) { + if (p.getPerfilId().equals(perfil.getPerfilId())) { + duplicado = false; + } + } + + return duplicado; + } + + public void onClick$btnSalvar(Event ev) { + txtDescPerfil.getText(); + + try { + if (lsPermiso.isEmpty()) { + Clients.alert(Labels.getLabel("editarPerfilController.MSG.funcionObligatorio"), + Labels.getLabel("editarPerfilController.window.title"), + Messagebox.INFORMATION); + + return; + } + + if (duplicado()) { + Clients.alert(Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarPerfilController.window.title"), + Messagebox.INFORMATION); + + return; + } + + perfil.setActivo(Boolean.TRUE); + perfil.setFecmodif(Calendar.getInstance().getTime()); + perfil.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + perfil.setPerfilFuncionList(lsPermiso); + + if (perfil.getPerfilId() == null) { + perfilService.suscribir(perfil); + perfilList.addItem(perfil); + } else { + perfilService.actualizacion(perfil); + perfilList.updateItem(perfil); + } + + Messagebox.show( + Labels.getLabel("editarPerfilController.MSG.suscribirOK"), + Labels.getLabel("editarPerfilController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarEstacionController.window.title"), + Messagebox.INFORMATION); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarPerfilController.MSG.borrarPergunta"), + Labels.getLabel("editarPerfilController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + for (PerfilFuncion pf : perfil.getPerfilFuncionList()) { + pf.setActivo(Boolean.FALSE); + pf.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pf.setFecmodif(Calendar.getInstance().getTime()); + } + + perfilService.borrar(perfil); + + Messagebox.show( + Labels.getLabel("editarPerfilController.MSG.borrarOK"), + Labels.getLabel("editarPerfilController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + perfilList.removeItem(perfil); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarEstacionController.window.title"), + Messagebox.INFORMATION); + } + } + + public void onClick$btnAdicionarPermiso(Event ev) { + Comboitem comboItem = cmbFuncionSistema.getSelectedItem(); + if (comboItem != null) { + FuncionSistema fs = (FuncionSistema) comboItem.getValue(); + PerfilFuncion pf = new PerfilFuncion(); + pf.setActivo(Boolean.TRUE); + pf.setFuncionSistema(fs); + pf.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pf.setFecmodif(Calendar.getInstance().getTime()); + pf.setPerfil(perfil); + + lsPermiso.add(pf); + permisoList.setData(lsPermiso); + perfil.setPerfilFuncionList(lsPermiso); + + cmbFuncionSistema.setSelectedItem(null); + cmbFuncionSistema.setValue(null); + comboItem.setVisible(false); + } + } + + public void onClick$btnRemoverPermiso(Event ev) { + PerfilFuncion pf = (PerfilFuncion) permisoList.getSelected(); + if (pf != null) { + pf.setActivo(Boolean.FALSE); + pf.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + pf.setFecmodif(Calendar.getInstance().getTime()); + + if (pf.getPerfilfuncionId() != null) { + perfilFuncionService.borrar(pf); + } + + int indice = 0; + for (int i = 0; i < lsPermiso.size(); i++) { + PerfilFuncion pfL = lsPermiso.get(i); + if (pfL.getFuncionSistema() != null) { + if (pfL.getFuncionSistema().equals(pf.getFuncionSistema())) { + indice = i; + } + } + } + + lsPermiso.remove(indice); + permisoList.setData(lsPermiso); + perfil.setPerfilFuncionList(lsPermiso); + + List children = cmbFuncionSistema.getChildren(); + for (Component c : children) { + if (c instanceof Comboitem) { + Comboitem ci = (Comboitem) c; + if ((!ci.isVisible()) && ((FuncionSistema) ci.getValue()).getFuncionsistemaId().equals(pf.getFuncionSistema().getFuncionsistemaId())) { + ci.setVisible(true); + } + } + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarSistemaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarSistemaController.java new file mode 100644 index 000000000..d484098be --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarSistemaController.java @@ -0,0 +1,129 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.Sistema; +import com.rjconsultores.ventaboletos.service.SistemaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Textbox; + +/** + * + * @author rodrigo + */ +@Controller("editarSistemaController") +@Scope("prototype") +public class EditarSistemaController extends MyGenericForwardComposer { + + @Autowired + private SistemaService sistemaService; + private Sistema sistema; + private MyListbox sistemaList; + private Textbox txtNome; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarSistemaController.class); + + public Sistema getSistema() { + return sistema; + } + + public void setSistema(Sistema sistema) { + this.sistema = sistema; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + sistema = (Sistema) Executions.getCurrent().getArg().get("sistema"); + sistemaList = (MyListbox) Executions.getCurrent().getArg().get("sistemaList"); + + if (sistema.getSistemaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) { + txtNome.getText(); + + try { + sistema.setActivo(Boolean.TRUE); + sistema.setFecmodif(Calendar.getInstance().getTime()); + sistema.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (sistema.getSistemaId() == null) { + sistemaService.suscribir(sistema); + sistemaList.addItem(sistema); + } else { + sistemaService.actualizacion(sistema); + sistemaList.updateItem(sistema); + } + + Messagebox.show( + Labels.getLabel("editarSistemaController.MSG.suscribirOK"), + Labels.getLabel("editarSistemaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarSistemaController.MSG.borrarPergunta"), + Labels.getLabel("editarSistemaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + sistemaService.borrar(sistema); + + Messagebox.show( + Labels.getLabel("editarSistemaController.MSG.borrarOK"), + Labels.getLabel("editarSistemaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + sistemaList.removeItem(sistema); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarUsuarioBancarioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarUsuarioBancarioController.java new file mode 100644 index 000000000..ca3c86438 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarUsuarioBancarioController.java @@ -0,0 +1,76 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.CompaniaBancaria; +import com.rjconsultores.ventaboletos.entidad.UsuarioBancario; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; + +/** + * + * @author Administrador + */ +@Controller("editarUsuarioBancarioController") +@Scope("prototype") +public class EditarUsuarioBancarioController extends MyGenericForwardComposer { + + private CompaniaBancaria companiaBancaria; + private UsuarioBancario usuarioBancario; + private List lsUsuarioBancario; + private MyListbox usuarioBancarioList; + + public UsuarioBancario getUsuarioBancario() { + return usuarioBancario; + } + + public void setUsuarioBancario(UsuarioBancario usuarioBancario) { + this.usuarioBancario = usuarioBancario; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + companiaBancaria = (CompaniaBancaria) Executions.getCurrent().getArg().get("companiaBancaria"); + usuarioBancarioList = (MyListbox) Executions.getCurrent().getArg().get("usuarioBancarioList"); + lsUsuarioBancario = (List) Executions.getCurrent().getArg().get("lsUsuarioBancario"); + + usuarioBancario = new UsuarioBancario(); + usuarioBancario.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + usuarioBancario.setActivo(Boolean.TRUE); + usuarioBancario.setFecmodif(Calendar.getInstance().getTime()); + usuarioBancario.setCompaniaBancaria(companiaBancaria); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + for (UsuarioBancario ub : lsUsuarioBancario) { + if (ub.getCveusuario().equals(usuarioBancario.getCveusuario())) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarUsuarioBancarioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + } + + lsUsuarioBancario.add(usuarioBancario); + usuarioBancarioList.setData(lsUsuarioBancario); + + closeWindow(); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarUsuarioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarUsuarioController.java new file mode 100644 index 000000000..85baa7be6 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/seguridad/EditarUsuarioController.java @@ -0,0 +1,615 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.seguridad; + +import com.rjconsultores.ventaboletos.entidad.Empleado; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Perfil; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.entidad.Usuario; +import com.rjconsultores.ventaboletos.entidad.UsuarioPerfil; +import com.rjconsultores.ventaboletos.entidad.UsuarioUbicacion; +import com.rjconsultores.ventaboletos.service.EmpleadoService; +import com.rjconsultores.ventaboletos.service.PerfilService; +import com.rjconsultores.ventaboletos.service.UsuarioPerfilService; +import com.rjconsultores.ventaboletos.service.UsuarioService; +import com.rjconsultores.ventaboletos.service.UsuarioUbicacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.Base64; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderUbicacion; +import java.security.MessageDigest; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Tab; +import org.zkoss.zul.Textbox; + +/** + * + * @author rodrigo + */ +@Controller("editarUsuarioController") +@Scope("prototype") +public class EditarUsuarioController extends MyGenericForwardComposer { + + @Autowired + private UsuarioService usuarioService; + @Autowired + private PerfilService perfilService; + @Autowired + private UsuarioPerfilService usuarioPerfilService; + @Autowired + private UsuarioUbicacionService usuarioUbicacionService; + @Autowired + private EmpleadoService empleadoService; + private List lsPerfil; + private Perfil perfilSeleccionada; + private List lsUsuarioUbicacion; + private Combobox cmbParada; + private Combobox cmbPuntoVenta; + private Combobox cmbPerfil; + private Usuario usuario; + private MyListbox usuarioList; + private MyListbox ubicacionList; + private Textbox txtCveEmpleado; + private Textbox txtNombUsuario; + private Textbox txtSenha; + private Textbox txtConfirmSenha; + private Textbox txtCveUsuario; + private Textbox txtNombPaterno; + private Textbox txtNombMaterno; + private Button btnAdicionarUbicacion; + private Button btnRemoverUbicacion; + private Button btnApagar; + private Button btnPesquisa; + private Boolean usrAdmin; + private Tab tabUsuario; + private Tab tabUbicacion; + private static Logger log = Logger.getLogger(EditarUsuarioController.class); + + public MyListbox getUbicacionList() { + return ubicacionList; + } + + public void setUbicacionList(MyListbox ubicacionList) { + this.ubicacionList = ubicacionList; + } + + public Combobox getCmbParada() { + return cmbParada; + } + + public void setCmbParada(Combobox cmbParada) { + this.cmbParada = cmbParada; + } + + public Combobox getCmbPuntoVenta() { + return cmbPuntoVenta; + } + + public void setCmbPuntoVenta(Combobox cmbPuntoVenta) { + this.cmbPuntoVenta = cmbPuntoVenta; + } + + public Textbox getTxtConfirmSenha() { + return txtConfirmSenha; + } + + public void setTxtConfirmSenha(Textbox txtConfirmSenha) { + this.txtConfirmSenha = txtConfirmSenha; + } + + public Textbox getTxtSenha() { + return txtSenha; + } + + public void setTxtSenha(Textbox txtSenha) { + this.txtSenha = txtSenha; + } + + public List getLsPerfil() { + return lsPerfil; + } + + public void setLsPerfil(List lsPerfil) { + this.lsPerfil = lsPerfil; + } + + public Textbox getTxtNombUsuario() { + return txtNombUsuario; + } + + public void setTxtNombUsuario(Textbox txtNombUsuario) { + this.txtNombUsuario = txtNombUsuario; + } + + public Usuario getUsuario() { + return usuario; + } + + public void setUsuario(Usuario usuario) { + this.usuario = usuario; + } + + public Button getBtnAdicionarUbicacion() { + return btnAdicionarUbicacion; + } + + public void setBtnAdicionarUbicacion(Button btnAdicionarUbicacion) { + this.btnAdicionarUbicacion = btnAdicionarUbicacion; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Combobox getCmbPerfil() { + return cmbPerfil; + } + + public void setCmbPerfil(Combobox cmbPerfil) { + this.cmbPerfil = cmbPerfil; + } + + public List getLsUsuarioUbicacion() { + return lsUsuarioUbicacion; + } + + public void setLsUsuarioUbicacion(List lsUsuarioUbicacion) { + this.lsUsuarioUbicacion = lsUsuarioUbicacion; + } + + public Textbox getTxtCveUsuario() { + return txtCveUsuario; + } + + public void setTxtCveUsuario(Textbox txtCveUsuario) { + this.txtCveUsuario = txtCveUsuario; + } + + public Button getBtnRemoverUbicacion() { + return btnRemoverUbicacion; + } + + public void setBtnRemoverUbicacion(Button btnRemoverUbicacion) { + this.btnRemoverUbicacion = btnRemoverUbicacion; + } + + public PerfilService getPerfilService() { + return perfilService; + } + + public void setPerfilService(PerfilService perfilService) { + this.perfilService = perfilService; + } + + public Textbox getTxtNombMaterno() { + return txtNombMaterno; + } + + public void setTxtNombMaterno(Textbox txtNombMaterno) { + this.txtNombMaterno = txtNombMaterno; + } + + public Textbox getTxtNombPaterno() { + return txtNombPaterno; + } + + public void setTxtNombPaterno(Textbox txtNombPaterno) { + this.txtNombPaterno = txtNombPaterno; + } + + public Textbox getTxtCveEmpleado() { + return txtCveEmpleado; + } + + public void setTxtCveEmpleado(Textbox txtCveEmpleado) { + this.txtCveEmpleado = txtCveEmpleado; + } + + public Button getBtnPesquisa() { + return btnPesquisa; + } + + public void setBtnPesquisa(Button btnPesquisa) { + this.btnPesquisa = btnPesquisa; + } + + public Tab getTabUsuario() { + return tabUsuario; + } + + public void setTabUsuario(Tab tabUsuario) { + this.tabUsuario = tabUsuario; + } + + public Tab getTabUbicacion() { + return tabUbicacion; + } + + public void setTabUbicacion(Tab tabUbicacion) { + this.tabUbicacion = tabUbicacion; + } + + public Perfil getPerfilSeleccionada() { + return perfilSeleccionada; + } + + public void setPerfilSeleccionada(Perfil perfilSeleccionada) { + this.perfilSeleccionada = perfilSeleccionada; + } + + private void enableAddUbicacion() { + if (lsUsuarioUbicacion.size() > 0) { + btnAdicionarUbicacion.setDisabled(true); + } else { + btnAdicionarUbicacion.setDisabled(false); + } + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsPerfil = perfilService.obtenerTodos(); + + super.doAfterCompose(comp); + + Usuario usuarioS = (Usuario) Executions.getCurrent().getArg().get("usuario"); + usuario = (usuarioS.getUsuarioId() == null) ? usuarioS : usuarioService.obtenerID(usuarioS.getUsuarioId()); + usuarioList = (MyListbox) Executions.getCurrent().getArg().get("usuarioList"); + usrAdmin = (Boolean) Executions.getCurrent().getArg().get("usrAdmin"); + + lsUsuarioUbicacion = new ArrayList(); + if (usuario.getUsuarioId() != null) { + lsUsuarioUbicacion.addAll(usuarioUbicacionService.buscarPorUsuario(usuario)); + } + + enableAddUbicacion(); + + ubicacionList.setItemRenderer(new RenderUbicacion()); + ubicacionList.setData(lsUsuarioUbicacion); + + txtCveEmpleado.focus(); + + if (usuario.getUsuarioId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + txtCveUsuario.setDisabled(Boolean.TRUE); + if (usuario.getEmpleado() != null) { + usuario = usuarioService.obtenerID(usuario.getUsuarioId()); + cmbPerfil.focus(); + txtCveEmpleado.setText(usuario.getEmpleado().getCveEmpleado()); + txtCveEmpleado.setDisabled(true); + txtNombUsuario.setDisabled(true); + txtNombPaterno.setDisabled(true); + txtNombMaterno.setDisabled(true); + btnPesquisa.setVisible(false); + + + } + List lsUsuarioPerfil = usuarioPerfilService.obtenerPorUsuario(usuario); + if (!lsUsuarioPerfil.isEmpty()) { + perfilSeleccionada = lsUsuarioPerfil.get(0).getPerfil(); + } + + txtSenha.setText("**********"); + txtConfirmSenha.setText("**********"); + } + + if (!usrAdmin) { + cmbPerfil.setDisabled(Boolean.TRUE); + txtCveUsuario.setDisabled(Boolean.TRUE); + btnApagar.setVisible(Boolean.FALSE); + + btnAdicionarUbicacion.setVisible(Boolean.FALSE); + btnRemoverUbicacion.setVisible(Boolean.FALSE); + cmbParada.setDisabled(Boolean.TRUE); + cmbPuntoVenta.setDisabled(Boolean.TRUE); + } + + + } + + public void onFocus$txtSenha(Event ev) { + if (txtSenha.getValue().equals("**********")) { + txtSenha.setConstraint(""); + txtSenha.setText(""); + txtSenha.setConstraint("no empty"); + + txtConfirmSenha.setConstraint(""); + txtConfirmSenha.setText(""); + txtConfirmSenha.setConstraint("no empty"); + } + + } + + public void onFocus$txtConfirmSenha(Event ev) { + if (txtConfirmSenha.getValue().equals("**********")) { + txtSenha.setConstraint(""); + txtSenha.setText(""); + txtSenha.setConstraint("no empty"); + + txtConfirmSenha.setConstraint(""); + txtConfirmSenha.setText(""); + txtConfirmSenha.setConstraint("no empty"); + } + } + + public void onClick$btnPesquisa(Event ev) { + txtCveEmpleado.setConstraint("no empty"); + txtCveEmpleado.getValue(); + txtCveEmpleado.setConstraint(""); + try { + + txtNombUsuario.setConstraint(""); + txtNombPaterno.setConstraint(""); + txtNombMaterno.setConstraint(""); + + txtNombUsuario.setValue(""); + txtNombPaterno.setValue(""); + txtNombMaterno.setValue(""); + + txtNombUsuario.setConstraint("no empty"); + txtNombPaterno.setConstraint("no empty"); + txtNombMaterno.setConstraint("no empty"); + + List emp = empleadoService.pesquisaClave(txtCveEmpleado.getValue()); + txtCveUsuario.focus(); + + if (emp.isEmpty()) { + txtNombUsuario.setDisabled(false); + txtNombPaterno.setDisabled(false); + txtNombMaterno.setDisabled(false); + + Messagebox.show( + Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("editarUsuarioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + + List listUsuario = usuarioService.buscarPorEmpleado(emp.get(0)); + + if (listUsuario.isEmpty()) { + + txtNombUsuario.setDisabled(true); + txtNombPaterno.setDisabled(true); + txtNombMaterno.setDisabled(true); + + txtNombUsuario.setValue(emp.get(0).getNombEmpleado()); + txtNombPaterno.setValue(emp.get(0).getNombPaterno()); + txtNombMaterno.setValue(emp.get(0).getNombMaterno()); + + usuario.setNombusuario(emp.get(0).getNombEmpleado()); + usuario.setNombpaterno(emp.get(0).getNombPaterno()); + usuario.setNombmaterno(emp.get(0).getNombMaterno()); + + usuario.setEmpleado(emp.get(0)); + + + } else { + txtNombUsuario.setDisabled(false); + txtNombPaterno.setDisabled(false); + txtNombMaterno.setDisabled(false); + Messagebox.show( + Labels.getLabel("editarUsuarioController.MSG.existeEmpleado", new Object[]{txtCveEmpleado.getValue()}), + Labels.getLabel("editarUsuarioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnSalvar(Event ev) { + + txtSenha.setConstraint("no empty"); + txtConfirmSenha.setConstraint("no empty"); + + tabUsuario.setSelected(Boolean.TRUE); + + txtNombUsuario.getText(); + txtCveUsuario.getText(); + txtNombPaterno.getText(); + txtNombMaterno.getText(); + txtSenha.getText(); + txtConfirmSenha.getText(); + + cmbPerfil.getValue(); + + String senha = ""; + String confirmSenha = ""; + + if (!txtSenha.getValue().equals("**********")) { + senha = txtSenha.getText(); + confirmSenha = txtConfirmSenha.getText(); + } + + try { + if (senha.equals(confirmSenha)) { + usuario.setActivo(Boolean.TRUE); + usuario.setFecmodif(Calendar.getInstance().getTime()); + usuario.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsUsuario = usuarioService.buscarPelaCveUsuario(usuario.getClaveUsuario()); + + boolean podeSalvar = false; + if (lsUsuario.isEmpty()) { + podeSalvar = true; + } else { + for (Usuario u : lsUsuario) { + if (u.getUsuarioId().equals(usuario.getUsuarioId())) { + podeSalvar = true; + } + } + } + + if (podeSalvar) { + + if (!senha.trim().equals("")) { + MessageDigest md = MessageDigest.getInstance("MD5"); + byte[] pass = md.digest(senha.getBytes()); + senha = Base64.byteArrayToBase64(pass); + + usuario.setSenha(senha); + } + + Perfil perfil = (Perfil) cmbPerfil.getSelectedItem().getValue(); + UsuarioPerfil up = new UsuarioPerfil(); + up.setUsuario(usuario); + up.setPerfil(perfil); + up.setActivo(Boolean.TRUE); + up.setFecmodif(Calendar.getInstance().getTime()); + up.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (usuario.getUsuarioId() != null) { + List lsUsuarioPerfil = usuarioPerfilService.obtenerPorUsuario(usuario); + for (UsuarioPerfil up2 : lsUsuarioPerfil) { + usuarioPerfilService.borrar(up2); + } + } + List lsUp = new ArrayList(); + lsUp.add(up); + usuario.setUsuarioPerfilList(lsUp); + + if (!lsUsuarioUbicacion.isEmpty()) { + if (usuario.getUsuarioId() == null) { + usuario = usuarioService.suscribir(usuario); + if (usrAdmin) { + usuarioList.addItem(usuario); + } + } else { + usuario = usuarioService.actualizacion(usuario); + if (usrAdmin) { + usuarioList.updateItem(usuario); + } + } + + for (UsuarioUbicacion uu : lsUsuarioUbicacion) { + if (uu.getUsuarioubicacionId() == null) { + uu.setUsuario(usuario); + usuarioUbicacionService.suscribir(uu); + } + } + + Messagebox.show( + Labels.getLabel("editarUsuarioController.MSG.suscribirOK"), + Labels.getLabel("editarUsuarioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + tabUbicacion.setSelected(Boolean.TRUE); + Messagebox.show( + Labels.getLabel("editarUsuarioController.MSG.necessitaUbicacion"), + Labels.getLabel("editarUsuarioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarUsuarioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + Messagebox.show( + Labels.getLabel("editarUsuarioController.MSG.configmSenha"), + Labels.getLabel("editarUsuarioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } + } catch (Exception ex) { + Clients.alert( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarUsuarioController.window.title"), Messagebox.ERROR); + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarUsuarioController.MSG.borrarPergunta"), + Labels.getLabel("editarUsuarioController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + usuarioService.borrar(usuario); + + Messagebox.show( + Labels.getLabel("editarUsuarioController.MSG.borrarOK"), + Labels.getLabel("editarUsuarioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + if (usrAdmin) { + usuarioList.removeItem(usuario); + } + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnAdicionarUbicacion(Event ev) { + Comboitem cbiParada = cmbParada.getSelectedItem(); + Comboitem cbiPuntoVenta = cmbPuntoVenta.getSelectedItem(); + + if ((cbiParada != null) && (cbiPuntoVenta != null)) { + Parada parada = (Parada) cbiParada.getValue(); + PuntoVenta puntoVenta = (PuntoVenta) cbiPuntoVenta.getValue(); + + UsuarioUbicacion uu = new UsuarioUbicacion(); + uu.setActivo(Boolean.TRUE); + uu.setFecmodif(Calendar.getInstance().getTime()); + uu.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + uu.setParada(parada); + uu.setPuntoVenta(puntoVenta); + uu.setUsuario(usuario); + + lsUsuarioUbicacion.add(uu); + ubicacionList.setData(lsUsuarioUbicacion); + + enableAddUbicacion(); + } + } + + public void onClick$btnRemoverUbicacion(Event ev) { + UsuarioUbicacion uu = (UsuarioUbicacion) ubicacionList.getSelected(); + if (uu != null) { + uu.setActivo(Boolean.FALSE); + uu.setFecmodif(Calendar.getInstance().getTime()); + uu.setUsuariomodifId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + lsUsuarioUbicacion.remove(uu); + ubicacionList.setData(lsUsuarioUbicacion); + + if (uu.getUsuarioubicacionId() != null) { + usuarioUbicacionService.borrar(uu); + } + } + + enableAddUbicacion(); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaAcumulacionPorVentaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaAcumulacionPorVentaController.java new file mode 100644 index 000000000..fb2c698b9 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaAcumulacionPorVentaController.java @@ -0,0 +1,144 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaPunto; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.service.ParamAcumulaPuntoService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderSendaAmigoParamAcumulaPunto; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Paging; + +/** + * + * @author Rafius //ParamAcumulaPunto + */ +@Controller("busquedaAcumulacionPorVentaController") +@Scope("prototype") +public class BusquedaAcumulacionPorVentaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwParamAcumulaPunto; + @Autowired + private ParamAcumulaPuntoService paramAcumulaPuntoService; + @Autowired + private ParadaService paradaService; + private List lsParamAcumulaPunto; + private Combobox cmbOrigem; + private Combobox cmbDestino; + private Datebox fecInicio; + private Datebox fecFinal; + private MyListbox paramAcumulaPuntoList; + private Paging pagingParamAcumulaPunto; + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + paramAcumulaPuntoList.setItemRenderer(new RenderSendaAmigoParamAcumulaPunto()); + paramAcumulaPuntoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ParamAcumulaPunto pa = (ParamAcumulaPunto) paramAcumulaPuntoList.getSelected(); + verParamAcumulaPunto(pa); + } + }); + + lsParamAcumulaPunto = new ArrayList(); + + refreshLista(); + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + + Parada origem = (Parada) (cmbOrigem.getSelectedItem() != null ? cmbOrigem.getSelectedItem().getValue() : null); + Parada destino = (Parada) (cmbDestino.getSelectedItem() != null ? cmbDestino.getSelectedItem().getValue() : null); + + lsParamAcumulaPunto.clear(); + lsParamAcumulaPunto.addAll(paramAcumulaPuntoService.buscar(origem, destino, fecInicio.getValue(), fecFinal.getValue())); + paramAcumulaPuntoList.setData(lsParamAcumulaPunto); + + if (paramAcumulaPuntoList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("editarParamAcumulaPuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verParamAcumulaPunto(new ParamAcumulaPunto()); + } + + private void verParamAcumulaPunto(ParamAcumulaPunto pa) { + if (pa == null) { + return; + } + + Map args = new HashMap(); + args.put("paramAcumulaPunto", pa); + args.put("paramAcumulaPuntoList", paramAcumulaPuntoList); + + openWindow("/gui/senda_amigo/editarParamAcumulaPunto.zul", + Labels.getLabel("editarParamAcumulaPuntoController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject tarifaBusqueda = + new HibernateSearchObject(ParamAcumulaPunto.class, pagingParamAcumulaPunto.getPageSize()); + tarifaBusqueda.addFilterEqual("activo", Boolean.TRUE); + tarifaBusqueda.addSortAsc("feciniciovigencia"); + plwParamAcumulaPunto.init(tarifaBusqueda, paramAcumulaPuntoList, pagingParamAcumulaPunto); + } + + public Paging getPagingParamAcumulaPunto() { + return pagingParamAcumulaPunto; + } + + public void setPagingParamAcumulaPunto(Paging pagingParamAcumulaPunto) { + this.pagingParamAcumulaPunto = pagingParamAcumulaPunto; + } + + public Combobox getCmbDestino() { + return cmbDestino; + } + + public void setCmbDestino(Combobox cmbDestino) { + this.cmbDestino = cmbDestino; + } + + public Combobox getCmbOrigem() { + return cmbOrigem; + } + + public void setCmbOrigem(Combobox cmbOrigem) { + this.cmbOrigem = cmbOrigem; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaGeneracionTarjetaSAController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaGeneracionTarjetaSAController.java new file mode 100644 index 000000000..035b5ad70 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaGeneracionTarjetaSAController.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderSendaAmigoParamAcumulaMasivo; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTarjetaFidelidad; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Shiro + */ +@Controller("busquedaGeneracionTarjetaSAController") +@Scope("prototype") +public class BusquedaGeneracionTarjetaSAController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTarjetaFidelidad; + private MyListbox tarjetaFidelidadList; + private Paging pagingTarjetaFidelidad; + private Textbox txtNombre; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + super.doAfterCompose(comp); + + tarjetaFidelidadList.setItemRenderer(new RenderTarjetaFidelidad()); + tarjetaFidelidadList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TarjetaFidelidad pa = (TarjetaFidelidad) tarjetaFidelidadList.getSelected(); + verGeneracionTarjetaSA(pa); + } + }); + + + refreshLista(); + + txtNombre.focus(); + } + + private void verGeneracionTarjetaSA(TarjetaFidelidad tf) { + if (tf == null) { + return; + } + + Map args = new HashMap(); + args.put("tarjetaFidelidad", tf); + args.put("tarjetaFidelidadList", tarjetaFidelidadList); + + openWindow("/gui/senda_amigo/editarGeneracionTarjetaSA.zul", + Labels.getLabel("editarGeneracionTarjetaSAController.window.title"), args, MODAL); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verGeneracionTarjetaSA(new TarjetaFidelidad()); + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + private void refreshLista() { + + HibernateSearchObject tarifaBusqueda = + new HibernateSearchObject(TarjetaFidelidad.class, pagingTarjetaFidelidad.getPageSize()); + + tarifaBusqueda.addFilterEqual("activo", Boolean.TRUE); + tarifaBusqueda.addFilterLike("descGeneracion", + "%" + txtNombre.getText().trim().concat("%")); + tarifaBusqueda.addSortAsc("descGeneracion"); + + plwTarjetaFidelidad.init(tarifaBusqueda, tarjetaFidelidadList, pagingTarjetaFidelidad); + } + + public Paging getPagingTarjetaFidelidad() { + return pagingTarjetaFidelidad; + } + + public void setPagingTarjetaFidelidad(Paging pagingTarjetaFidelidad) { + this.pagingTarjetaFidelidad = pagingTarjetaFidelidad; + } + + public PagedListWrapper getPlwTarjetaFidelidad() { + return plwTarjetaFidelidad; + } + + public void setPlwTarjetaFidelidad(PagedListWrapper plwTarjetaFidelidad) { + this.plwTarjetaFidelidad = plwTarjetaFidelidad; + } + + public MyListbox getTarjetaFidelidadList() { + return tarjetaFidelidadList; + } + + public void setTarjetaFidelidadList(MyListbox tarjetaFidelidadList) { + this.tarjetaFidelidadList = tarjetaFidelidadList; + } + + public Textbox getTxtNombre() { + return txtNombre; + } + + public void setTxtNombre(Textbox txtNombre) { + this.txtNombre = txtNombre; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaParamAcumulaMasivoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaParamAcumulaMasivoController.java new file mode 100644 index 000000000..1baa77b47 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaParamAcumulaMasivoController.java @@ -0,0 +1,238 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaMasivo; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.ParamAcumulaMasivoService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderSendaAmigoParamAcumulaMasivo; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Spinner; + +/** + * + * @author Rafius //ParamAcumulaMasivo + */ +@Controller("busquedaParamAcumulaMasivoController") +@Scope("prototype") +public class BusquedaParamAcumulaMasivoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwParamAcumulaMasivo; + @Autowired + private ParamAcumulaMasivoService paramAcumulaMasivoService; + @Autowired + private EmpresaService empresaService; + private List lsEmpresa; + private List lsParamAcumulaMasivo; + private Combobox cmbEmpresa; + private Spinner max; + private Spinner min; + private Datebox fecInicio; + private Datebox fecFinal; + private MyListbox paramAcumulaMasivoList; + private Paging pagingParamAcumulaMasivo; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.obtenerTodos(); + + super.doAfterCompose(comp); + + paramAcumulaMasivoList.setItemRenderer(new RenderSendaAmigoParamAcumulaMasivo()); + paramAcumulaMasivoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ParamAcumulaMasivo pa = (ParamAcumulaMasivo) paramAcumulaMasivoList.getSelected(); + verParamAcumulaMasivo(pa); + } + }); + + lsParamAcumulaMasivo = new ArrayList(); + + refreshLista(); + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + Comboitem cbiEmpresa = cmbEmpresa.getSelectedItem(); + Empresa empresa = null; + if (cbiEmpresa != null) { + empresa = (Empresa) cbiEmpresa.getValue(); + } + + lsParamAcumulaMasivo.clear(); + lsParamAcumulaMasivo.addAll( + paramAcumulaMasivoService.buscar(empresa, min.getValue(), + max.getValue(), fecInicio.getValue(), fecFinal.getValue())); + paramAcumulaMasivoList.setData(lsParamAcumulaMasivo); + + if (paramAcumulaMasivoList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaParamAcumulacionMasivoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verParamAcumulaMasivo(new ParamAcumulaMasivo()); + } + + private void verParamAcumulaMasivo(ParamAcumulaMasivo pa) { + if (pa == null) { + return; + } + + Map args = new HashMap(); + args.put("paramAcumulaMasivo", pa); + args.put("paramAcumulaMasivoList", paramAcumulaMasivoList); + + openWindow("/gui/senda_amigo/editarParamAcumulaMasivo.zul", + Labels.getLabel("editarParamAcumulaMasivoController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject tarifaBusqueda = + new HibernateSearchObject(ParamAcumulaMasivo.class, pagingParamAcumulaMasivo.getPageSize()); + tarifaBusqueda.addFilterEqual("activo", Boolean.TRUE); + tarifaBusqueda.addSortAsc("empresa"); + + plwParamAcumulaMasivo.init(tarifaBusqueda, paramAcumulaMasivoList, pagingParamAcumulaMasivo); + + + } + + public Paging getPagingParamAcumulaMasivo() { + return pagingParamAcumulaMasivo; + } + + public void setPagingParamAcumulaMasivo(Paging pagingParamAcumulaMasivo) { + this.pagingParamAcumulaMasivo = pagingParamAcumulaMasivo; + } + + public Combobox getCmbPunto() { + return cmbEmpresa; + } + + public void setCmbPunto(Combobox cmbPunto) { + this.cmbEmpresa = cmbPunto; + } + + public List getLsParamAcumulaMasivo() { + return lsParamAcumulaMasivo; + } + + public void setLsParamAcumulaMasivo(List lsParamAcumulaMasivo) { + this.lsParamAcumulaMasivo = lsParamAcumulaMasivo; + } + + public MyListbox getParamAcumulaMasivoList() { + return paramAcumulaMasivoList; + } + + public void setParamAcumulaMasivoList(MyListbox paramAcumulaMasivoList) { + this.paramAcumulaMasivoList = paramAcumulaMasivoList; + } + + public ParamAcumulaMasivoService getParamAcumulaMasivoService() { + return paramAcumulaMasivoService; + } + + public void setParamAcumulaMasivoService(ParamAcumulaMasivoService paramAcumulaMasivoService) { + this.paramAcumulaMasivoService = paramAcumulaMasivoService; + } + + public PagedListWrapper getPlwParamAcumulaMasivo() { + return plwParamAcumulaMasivo; + } + + public void setPlwParamAcumulaMasivo(PagedListWrapper plwParamAcumulaMasivo) { + this.plwParamAcumulaMasivo = plwParamAcumulaMasivo; + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public Spinner getMax() { + return max; + } + + public void setMax(Spinner max) { + this.max = max; + } + + public Spinner getMin() { + return min; + } + + public void setMin(Spinner min) { + this.min = min; + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaParamCanjePuntoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaParamCanjePuntoController.java new file mode 100644 index 000000000..a110e45e2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaParamCanjePuntoController.java @@ -0,0 +1,148 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.ParamCanjePunto; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.service.ParamCanjePuntoService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderSendaAmigoParamCanjePunto; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Paging; + +/** + * + * @author Rafius //ParamCanjePunto + */ +@Controller("busquedaParamCanjePuntoController") +@Scope("prototype") +public class BusquedaParamCanjePuntoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwParamCanjePunto; + @Autowired + private ParamCanjePuntoService paramCanjePuntoService; + @Autowired + private ParadaService paradaService; + private List lsParamCanjePunto; + private Combobox cmbOrigem; + private Combobox cmbDestino; + private Datebox fecInicio; + private Datebox fecFinal; + private MyListbox paramCanjePuntoList; + private Paging pagingParamCanjePunto; + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + paramCanjePuntoList.setItemRenderer(new RenderSendaAmigoParamCanjePunto()); + paramCanjePuntoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ParamCanjePunto pa = (ParamCanjePunto) paramCanjePuntoList.getSelected(); + verParamCanjePunto(pa); + } + }); + + lsParamCanjePunto = new ArrayList(); + + refreshLista(); + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + + Parada origem = (Parada) (cmbOrigem.getSelectedItem() != null ? cmbOrigem.getSelectedItem().getValue() : null); + Parada destino = (Parada) (cmbDestino.getSelectedItem() != null ? cmbDestino.getSelectedItem().getValue() : null); + + lsParamCanjePunto.clear(); + lsParamCanjePunto.addAll(paramCanjePuntoService.buscar(origem, destino, fecInicio.getValue(), fecFinal.getValue())); + paramCanjePuntoList.setData(lsParamCanjePunto); + + if (paramCanjePuntoList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaParamCanjePuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verParamCanjePunto(new ParamCanjePunto()); + } + + private void verParamCanjePunto(ParamCanjePunto pa) { + if (pa == null) { + return; + } + + Map args = new HashMap(); + args.put("paramCanjePunto", pa); + args.put("paramCanjePuntoList", paramCanjePuntoList); + + openWindow("/gui/senda_amigo/editarParamCanjePunto.zul", + Labels.getLabel("editarParamCanjePuntoController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject tarifaBusqueda = + new HibernateSearchObject(ParamCanjePunto.class, pagingParamCanjePunto.getPageSize()); + tarifaBusqueda.addFilterEqual("activo", Boolean.TRUE); + tarifaBusqueda.addSortAsc("feciniciovigencia"); + + + plwParamCanjePunto.init(tarifaBusqueda, paramCanjePuntoList, pagingParamCanjePunto); + } + + + + public Paging getPagingParamCanjePunto() { + return pagingParamCanjePunto; + } + + public void setPagingParamCanjePunto(Paging pagingParamCanjePunto) { + this.pagingParamCanjePunto = pagingParamCanjePunto; + } + + public Combobox getCmbDestino() { + return cmbDestino; + } + + public void setCmbDestino(Combobox cmbDestino) { + this.cmbDestino = cmbDestino; + } + + public Combobox getCmbOrigem() { + return cmbOrigem; + } + + public void setCmbOrigem(Combobox cmbOrigem) { + this.cmbOrigem = cmbOrigem; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaParamCompraPuntoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaParamCompraPuntoController.java new file mode 100644 index 000000000..e176ad2d0 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaParamCompraPuntoController.java @@ -0,0 +1,168 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.ParamCompraPunto; +import com.rjconsultores.ventaboletos.service.ParamCompraPuntoService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderSendaAmigoParamCompraPunto; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Paging; + +/** + * + * @author Rafius //ParamCompraPunto + */ +@Controller("busquedaParamCompraPuntoController") +@Scope("prototype") +public class BusquedaParamCompraPuntoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwParamCompraPunto; + @Autowired + private ParamCompraPuntoService paramCompraPuntoService; + private List lsParamCompraPunto; + private Datebox ini; + private Datebox fim; + private MyListbox paramCompraPuntoList; + private Paging pagingParamCompraPunto; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + super.doAfterCompose(comp); + + paramCompraPuntoList.setItemRenderer(new RenderSendaAmigoParamCompraPunto()); + paramCompraPuntoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ParamCompraPunto pa = (ParamCompraPunto) paramCompraPuntoList.getSelected(); + verParamCompraPunto(pa); + } + }); + + lsParamCompraPunto = new ArrayList(); + + refreshLista(); + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + + lsParamCompraPunto.clear(); + lsParamCompraPunto.addAll(paramCompraPuntoService.buscar(ini.getValue(), fim.getValue())); + paramCompraPuntoList.setData(lsParamCompraPunto); + + if (paramCompraPuntoList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaParamCompraPuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verParamCompraPunto(new ParamCompraPunto()); + } + + private void verParamCompraPunto(ParamCompraPunto pa) { + if (pa == null) { + return; + } + + Map args = new HashMap(); + args.put("busquedaParamCompraPuntoController", this); + args.put("paramCompraPunto", pa); + args.put("paramCompraPuntoList", paramCompraPuntoList); + + openWindow("/gui/senda_amigo/editarParamCompraPunto.zul", + Labels.getLabel("busquedaParamCompraPuntoController.window.title"), args, MODAL); + } + + public void refreshLista() { + HibernateSearchObject tarifaBusqueda = + new HibernateSearchObject(ParamCompraPunto.class, pagingParamCompraPunto.getPageSize()); + tarifaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwParamCompraPunto.init(tarifaBusqueda, paramCompraPuntoList, pagingParamCompraPunto); + } + + public Paging getPagingParamCompraPunto() { + return pagingParamCompraPunto; + } + + public void setPagingParamCompraPunto(Paging pagingParamCompraPunto) { + this.pagingParamCompraPunto = pagingParamCompraPunto; + } + + public List getLsParamCompraPunto() { + return lsParamCompraPunto; + } + + public void setLsParamCompraPunto(List lsParamCompraPunto) { + this.lsParamCompraPunto = lsParamCompraPunto; + } + + public MyListbox getParamCompraPuntoList() { + return paramCompraPuntoList; + } + + public void setParamCompraPuntoList(MyListbox paramCompraPuntoList) { + this.paramCompraPuntoList = paramCompraPuntoList; + } + + public ParamCompraPuntoService getParamCompraPuntoService() { + return paramCompraPuntoService; + } + + public void setParamCompraPuntoService(ParamCompraPuntoService paramCompraPuntoService) { + this.paramCompraPuntoService = paramCompraPuntoService; + } + + public PagedListWrapper getPlwParamCompraPunto() { + return plwParamCompraPunto; + } + + public void setPlwParamCompraPunto(PagedListWrapper plwParamCompraPunto) { + this.plwParamCompraPunto = plwParamCompraPunto; + } + + public Datebox getFim() { + return fim; + } + + public void setFim(Datebox fim) { + this.fim = fim; + } + + public Datebox getIni() { + return ini; + } + + public void setIni(Datebox ini) { + this.ini = ini; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaParamCostoTarjetaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaParamCostoTarjetaController.java new file mode 100644 index 000000000..d4cf289c9 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaParamCostoTarjetaController.java @@ -0,0 +1,184 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.ParamCostoTarjeta; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.ParamCostoTarjetaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderSendaAmigoParamCostoTarjeta; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Paging; + +/** + * + * @author Rafius //ParamCostoTarjeta + */ +@Controller("busquedaParamCostoTarjetaController") +@Scope("prototype") +public class BusquedaParamCostoTarjetaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwParamCostoTarjeta; + @Autowired + private ParamCostoTarjetaService paramCostoTarjetaService; + @Autowired + private EmpresaService empresaService; + private List lsEmpresa; + private List lsParamCostoTarjeta; + private Combobox cmbEmpresa; + private MyListbox paramCostoTarjetaList; + private Paging pagingParamCostoTarjeta; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.obtenerTodos(); + + super.doAfterCompose(comp); + + paramCostoTarjetaList.setItemRenderer(new RenderSendaAmigoParamCostoTarjeta()); + paramCostoTarjetaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ParamCostoTarjeta pa = (ParamCostoTarjeta) paramCostoTarjetaList.getSelected(); + verParamCostoTarjeta(pa); + } + }); + + lsParamCostoTarjeta = new ArrayList(); + + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verParamCostoTarjeta(new ParamCostoTarjeta()); + } + + private void verParamCostoTarjeta(ParamCostoTarjeta pa) { + if (pa == null) { + return; + } + + Map args = new HashMap(); + args.put("BusquedaParamCostoTarjetaController", this); + args.put("paramCostoTarjeta", pa); + args.put("paramCostoTarjetaList", paramCostoTarjetaList); + + openWindow("/gui/senda_amigo/editarParamCostoTarjeta.zul", + Labels.getLabel("busquedaParamCostoTarjetaController.window.title"), args, MODAL); + } + + public void refreshLista() { + HibernateSearchObject tarifaBusqueda = + new HibernateSearchObject(ParamCostoTarjeta.class, pagingParamCostoTarjeta.getPageSize()); + tarifaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + Comboitem cbiEmpresa = cmbEmpresa.getSelectedItem(); + if (cbiEmpresa != null) { + Empresa empresa = (Empresa) cbiEmpresa.getValue(); + tarifaBusqueda.addFilterEqual("empresa", empresa); + } + + tarifaBusqueda.addSortAsc("empresa"); + + plwParamCostoTarjeta.init(tarifaBusqueda, paramCostoTarjetaList, pagingParamCostoTarjeta); + + if (paramCostoTarjetaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaParamCostoTarjetaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public Paging getPagingParamCostoTarjeta() { + return pagingParamCostoTarjeta; + } + + public void setPagingParamCostoTarjeta(Paging pagingParamCostoTarjeta) { + this.pagingParamCostoTarjeta = pagingParamCostoTarjeta; + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsParamCostoTarjeta() { + return lsParamCostoTarjeta; + } + + public void setLsParamCostoTarjeta(List lsParamCostoTarjeta) { + this.lsParamCostoTarjeta = lsParamCostoTarjeta; + } + + public MyListbox getParamCostoTarjetaList() { + return paramCostoTarjetaList; + } + + public void setParamCostoTarjetaList(MyListbox paramCostoTarjetaList) { + this.paramCostoTarjetaList = paramCostoTarjetaList; + } + + public ParamCostoTarjetaService getParamCostoTarjetaService() { + return paramCostoTarjetaService; + } + + public void setParamCostoTarjetaService(ParamCostoTarjetaService paramCostoTarjetaService) { + this.paramCostoTarjetaService = paramCostoTarjetaService; + } + + public PagedListWrapper getPlwParamCostoTarjeta() { + return plwParamCostoTarjeta; + } + + public void setPlwParamCostoTarjeta(PagedListWrapper plwParamCostoTarjeta) { + this.plwParamCostoTarjeta = plwParamCostoTarjeta; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaTipoDomicilioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaTipoDomicilioController.java new file mode 100644 index 000000000..aec63f02c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaTipoDomicilioController.java @@ -0,0 +1,146 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.TipoDomicilio; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoDomicilio; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaTipoDomicilioController") +@Scope("prototype") +public class BusquedaTipoDomicilioController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTipoDomicilio; + private MyListbox tipoDomicilioList; + private Paging pagingTipoDomicilio; + private Textbox txtNome; + private Textbox txtCve; + + public Paging getPagingTipoDomicilio() { + return pagingTipoDomicilio; + } + + public void setPagingTipoDomicilio(Paging pagingTipoDomicilio) { + this.pagingTipoDomicilio = pagingTipoDomicilio; + } + + public MyListbox getTipoDomicilioList() { + return tipoDomicilioList; + } + + public void setTipoDomicilioList(MyListbox tipoDomicilioList) { + this.tipoDomicilioList = tipoDomicilioList; + } + + public Textbox getTxtCve() { + return txtCve; + } + + public void setTxtCve(Textbox txtCve) { + this.txtCve = txtCve; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tipoDomicilioList.setItemRenderer(new RenderTipoDomicilio()); + tipoDomicilioList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TipoDomicilio a = (TipoDomicilio) tipoDomicilioList.getSelected(); + verTipoDomicilio(a); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verTipoDomicilio(TipoDomicilio a) { + if (a == null) { + return; + } + + Map args = new HashMap(); + args.put("busquedaTipoDomicilioController", this); + args.put("tipoDomicilio", a); + args.put("tipoDomicilioList", tipoDomicilioList); + + openWindow("/gui/senda_amigo/editarTipoDomicilio.zul", + Labels.getLabel("busquedaTipoDomicilioController.window.title"), args, MODAL); + } + + public void refreshLista() { + HibernateSearchObject tipoDomicilioBusqueda = + new HibernateSearchObject(TipoDomicilio.class, + pagingTipoDomicilio.getPageSize()); + + if (!txtNome.getText().isEmpty()) { + tipoDomicilioBusqueda.addFilterLike("desctipo", + "%" + txtNome.getText().trim().concat("%")); + } + + if (!txtCve.getText().isEmpty()) { + tipoDomicilioBusqueda.addFilterEqual("cvetipodomicilio", txtCve.getText()); + } + + tipoDomicilioBusqueda.addSortAsc("desctipo"); + tipoDomicilioBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwTipoDomicilio.init(tipoDomicilioBusqueda, tipoDomicilioList, pagingTipoDomicilio); + + if (tipoDomicilioList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTipoDomicilioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTipoDomicilio(new TipoDomicilio()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaTipoMovimientoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaTipoMovimientoController.java new file mode 100644 index 000000000..cf2bf2ba1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaTipoMovimientoController.java @@ -0,0 +1,131 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.TipoMovimiento; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoMovimiento; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaTipoMovimientoController") +@Scope("prototype") +public class BusquedaTipoMovimientoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTipoMovimiento; + private MyListbox tipoMovimientoList; + private Paging pagingTipoMovimiento; + private Textbox txtNome; + + public Paging getPagingTipoMovimiento() { + return pagingTipoMovimiento; + } + + public void setPagingTipoMovimiento(Paging pagingTipoMovimiento) { + this.pagingTipoMovimiento = pagingTipoMovimiento; + } + + public MyListbox getTipoMovimientoList() { + return tipoMovimientoList; + } + + public void setTipoMovimientoList(MyListbox tipoMovimientoList) { + this.tipoMovimientoList = tipoMovimientoList; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tipoMovimientoList.setItemRenderer(new RenderTipoMovimiento()); + tipoMovimientoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TipoMovimiento a = (TipoMovimiento) tipoMovimientoList.getSelected(); + verTipoMovimiento(a); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verTipoMovimiento(TipoMovimiento a) { + if (a == null) { + return; + } + + Map args = new HashMap(); + args.put("busquedaTipoMovimientoController", this); + args.put("tipoMovimiento", a); + args.put("tipoMovimientoList", tipoMovimientoList); + + openWindow("/gui/senda_amigo/editarTipoMovimiento.zul", + Labels.getLabel("editarTipoMovimientoController.window.title"), args, MODAL); + } + + public void refreshLista() { + HibernateSearchObject tipoMovimientoBusqueda = + new HibernateSearchObject(TipoMovimiento.class, + pagingTipoMovimiento.getPageSize()); + + tipoMovimientoBusqueda.addFilterLike("descmovimiento", + "%" + txtNome.getText().trim().concat("%")); + + tipoMovimientoBusqueda.addSortAsc("descmovimiento"); + tipoMovimientoBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwTipoMovimiento.init(tipoMovimientoBusqueda, tipoMovimientoList, pagingTipoMovimiento); + + if (tipoMovimientoList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTipoMovimientoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTipoMovimiento(new TipoMovimiento()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaTipoOcupacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaTipoOcupacionController.java new file mode 100644 index 000000000..537a72a1e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/BusquedaTipoOcupacionController.java @@ -0,0 +1,146 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.TipoOcupacion; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoOcupacion; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("busquedaTipoOcupacionController") +@Scope("prototype") +public class BusquedaTipoOcupacionController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTipoOcupacion; + private MyListbox tipoOcupacionList; + private Paging pagingTipoOcupacion; + private Textbox txtNome; + private Textbox txtCve; + + public Paging getPagingTipoOcupacion() { + return pagingTipoOcupacion; + } + + public void setPagingTipoOcupacion(Paging pagingTipoOcupacion) { + this.pagingTipoOcupacion = pagingTipoOcupacion; + } + + public MyListbox getTipoOcupacionList() { + return tipoOcupacionList; + } + + public void setTipoOcupacionList(MyListbox tipoOcupacionList) { + this.tipoOcupacionList = tipoOcupacionList; + } + + public Textbox getTxtCve() { + return txtCve; + } + + public void setTxtCve(Textbox txtCve) { + this.txtCve = txtCve; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tipoOcupacionList.setItemRenderer(new RenderTipoOcupacion()); + tipoOcupacionList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TipoOcupacion a = (TipoOcupacion) tipoOcupacionList.getSelected(); + verTipoOcupacion(a); + } + }); + + refreshLista(); + + txtNome.focus(); + } + + private void verTipoOcupacion(TipoOcupacion a) { + if (a == null) { + return; + } + + Map args = new HashMap(); + args.put("busquedaTipoOcupacionController", this); + args.put("tipoOcupacion", a); + args.put("tipoOcupacionList", tipoOcupacionList); + + openWindow("/gui/senda_amigo/editarTipoOcupacion.zul", + Labels.getLabel("editarTipoOcupacionController.window.title"), args, MODAL); + } + + public void refreshLista() { + HibernateSearchObject tipoOcupacionBusqueda = + new HibernateSearchObject(TipoOcupacion.class, + pagingTipoOcupacion.getPageSize()); + + if (!txtNome.getText().isEmpty()) { + tipoOcupacionBusqueda.addFilterLike("desctipo", + "%" + txtNome.getText().trim().concat("%")); + } + + if (!txtCve.getText().isEmpty()) { + tipoOcupacionBusqueda.addFilterEqual("cvetipoocupacion", txtCve.getText()); + } + + tipoOcupacionBusqueda.addSortAsc("desctipo"); + tipoOcupacionBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwTipoOcupacion.init(tipoOcupacionBusqueda, tipoOcupacionList, pagingTipoOcupacion); + + if (tipoOcupacionList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTipoOcupacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTipoOcupacion(new TipoOcupacion()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarGeneracionTarjetaSAController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarGeneracionTarjetaSAController.java new file mode 100644 index 000000000..c0c1909b6 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarGeneracionTarjetaSAController.java @@ -0,0 +1,262 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad; +import com.rjconsultores.ventaboletos.service.TarjetaFidelidadService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTarjetaFidelidadClaves; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import java.util.Random; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Intbox; +import org.zkoss.zul.Label; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Textbox; + +/** + * + * @author Shiro + */ +@Controller("editarGeneracionTarjetaSAController") +@Scope("prototype") +public class EditarGeneracionTarjetaSAController extends MyGenericForwardComposer { + + @Autowired + private TarjetaFidelidadService fidelidadService; + private TarjetaFidelidad tarjetaFidelidad; + private MyListbox tarjetaFidelidadList; + private MyListbox editarTarjetaFidelidadList; + private Paging pagingFidelidad; + private List listTf; + private Textbox txtNomPaquete; + private Intbox folios; + private int x2; + private Random aleatorio = new Random(); + private Button btnApagarGeneracion; + private Button btnGenerar; + private Label qtdFolios; + private static Logger log = Logger.getLogger(EditarGeneracionTarjetaSAController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tarjetaFidelidad = (TarjetaFidelidad) Executions.getCurrent().getArg().get("tarjetaFidelidad"); + tarjetaFidelidadList = (MyListbox) Executions.getCurrent().getArg().get("tarjetaFidelidadList"); + + editarTarjetaFidelidadList.setItemRenderer(new RenderTarjetaFidelidadClaves()); + + if (tarjetaFidelidad.getTarjetaFidelidadId() != null) { + btnApagarGeneracion.setDisabled(true); + btnGenerar.setDisabled(true); + + qtdFolios.setValue(Labels.getLabel("editarGeneracionTarjetaSAController.folios.value")); + } else { + qtdFolios.setValue(Labels.getLabel("editarGeneracionTarjetaSAController.qtdFolios.value")); + } + + //desabilitado remoção da ListBox + btnApagarGeneracion.setVisible(false); + txtNomPaquete.focus(); + + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + try { + + if (editarTarjetaFidelidadList.getModel().getSize() == 0) { + Messagebox.show(Labels.getLabel("editarGeneracionTarjetaSAController.MSG.necessitaTarjeta"), + Labels.getLabel("editarGeneracionTarjetaSAController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + + + if (tarjetaFidelidad.getTarjetaFidelidadId() == null) { + for (int i = 0; i < editarTarjetaFidelidadList.getData().length; i++) { + fidelidadService.suscribir((TarjetaFidelidad) (editarTarjetaFidelidadList.getData())[i]); + tarjetaFidelidadList.addItem((TarjetaFidelidad) (editarTarjetaFidelidadList.getData())[i]); + } + } else { + fidelidadService.actualizacion(tarjetaFidelidad); + tarjetaFidelidadList.updateItem(tarjetaFidelidad); + } + + Messagebox.show(Labels.getLabel("editarGeneracionTarjetaSAController.MSG.suscribirOK"), + Labels.getLabel("editarGeneracionTarjetaSAController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + + } catch (Exception ex) { + log.error(ex); + } + } + + public int dameEntero() { + generar(); + return x2; + } + + public static void salida(String cadena) { + System.out.println(cadena); + } + + private void generar() { + x2 = aleatorio.nextInt(1000000000); + } + + public void onClick$btnGenerar(Event ev) { + ArrayList uno = new ArrayList(); + try { + double x = folios.getValue(); + //x2 = aleatorio.nextInt(); + + while (x > 0) { + x--; + dameEntero(); + //salida("Entero aleatorio: " + dameEntero()+ "Nombre = " + txtNomPaquete.getValue()); + uno.add(x2); + } + + ArrayList tfl = new ArrayList(); + for (Integer f : uno) { + TarjetaFidelidad tf = new TarjetaFidelidad(); + tf.setActivo(Boolean.TRUE); + tf.setFecmodif(Calendar.getInstance().getTime()); + tf.setUsuarioId(0); + tf.setDescGeneracion(txtNomPaquete.getValue()); + tf.setNumTarjeta(f.toString()); + System.out.println("Numero tarjeta de codigo = " + tf.getNumTarjeta()); + + tfl.add(tf); + } + + editarTarjetaFidelidadList.setData(tfl); + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagarGeneracion(Event ev) { + try { + TarjetaFidelidad tf = (TarjetaFidelidad) editarTarjetaFidelidadList.getSelected(); + + if (tf != null) { + for (int i = 0; i < editarTarjetaFidelidadList.getData().length; i++) { + TarjetaFidelidad tfFor = (TarjetaFidelidad) (editarTarjetaFidelidadList.getData())[i]; + if (tfFor.getNumTarjeta().equals(tf.getNumTarjeta())) { + editarTarjetaFidelidadList.removeItem(tfFor); + } + } + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarGeneracionTarjetaSAController.MSG.BorrarPergunta"), + Labels.getLabel("editarGeneracionTarjetaSAController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + fidelidadService.borrar(tarjetaFidelidad); + + Messagebox.show( + Labels.getLabel("editarGeneracionTarjetaSAController.MSG.BorrarOK"), + Labels.getLabel("editarGeneracionTarjetaSAController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tarjetaFidelidadList.removeItem(tarjetaFidelidad); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public Random getAleatorio() { + return aleatorio; + } + + public void setAleatorio(Random aleatorio) { + this.aleatorio = aleatorio; + } + + public TarjetaFidelidadService getFidelidadService() { + return fidelidadService; + } + + public void setFidelidadService(TarjetaFidelidadService fidelidadService) { + this.fidelidadService = fidelidadService; + } + + public MyListbox getTarjetaFidelidadList() { + return tarjetaFidelidadList; + } + + public void setTarjetaFidelidadList(MyListbox tarjetaFidelidadList) { + this.tarjetaFidelidadList = tarjetaFidelidadList; + } + + public List getListTf() { + return listTf; + } + + public void setListTf(List listTf) { + this.listTf = listTf; + } + + public Paging getPagingFidelidad() { + return pagingFidelidad; + } + + public void setPagingFidelidad(Paging pagingFidelidad) { + this.pagingFidelidad = pagingFidelidad; + } + + public TarjetaFidelidad getTarjetaFidelidad() { + return tarjetaFidelidad; + } + + public void setTarjetaFidelidad(TarjetaFidelidad tarjetaFidelidad) { + this.tarjetaFidelidad = tarjetaFidelidad; + } + + public Textbox getTxtNomPaquete() { + return txtNomPaquete; + } + + public void setTxtNomPaquete(Textbox txtNomPaquete) { + this.txtNomPaquete = txtNomPaquete; + } + + public MyListbox getEditarTarjetaFidelidadList() { + return editarTarjetaFidelidadList; + } + + public void setEditarTarjetaFidelidadList(MyListbox editarTarjetaFidelidadList) { + this.editarTarjetaFidelidadList = editarTarjetaFidelidadList; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamAcumulaMasivoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamAcumulaMasivoController.java new file mode 100644 index 000000000..f409eba6f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamAcumulaMasivoController.java @@ -0,0 +1,246 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaMasivo; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.ParamAcumulaMasivoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.zkoss.zk.ui.Component; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Spinner; + +/** + * + * @author Rafius + */ +@Controller("editarParamAcumulaMasivoController") +@Scope("prototype") +public class EditarParamAcumulaMasivoController extends MyGenericForwardComposer { + + @Autowired + private ParamAcumulaMasivoService paramAcumulaMasivoService; + @Autowired + private EmpresaService empresaService; + private List lsEmpresa; + private ParamAcumulaMasivo paramAcumulaMasivo; + private MyListbox paramAcumulaMasivoList; + private static Logger log = Logger.getLogger(EditarParamAcumulaMasivoController.class); + private Combobox cmbEmpresa; + private Datebox fecInicio; + private Datebox fecFinal; + private Spinner min; + private Spinner max; + private Button btnApagar; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.obtenerTodos(); + + super.doAfterCompose(comp); + + paramAcumulaMasivo = (ParamAcumulaMasivo) Executions.getCurrent().getArg().get("paramAcumulaMasivo"); + paramAcumulaMasivoList = (MyListbox) Executions.getCurrent().getArg().get("paramAcumulaMasivoList"); + + if (paramAcumulaMasivo.getParamacumulamasivo() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + cmbEmpresa.focus(); + } + + public void onClick$btnSalvar(Event ev) { + + cmbEmpresa.getSelectedItem().getValue(); + fecInicio.getValue(); + fecFinal.getValue(); + min.getValue(); + max.getValue(); + + if (fecInicio.getValue().after(fecFinal.getValue())) { + try { + Messagebox.show( + Labels.getLabel("editarParamCanjePuntoController.MSG.busquedaPeriodo"), + Labels.getLabel("editarParamCanjePuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + log.error(ex); + } + } else { + try { + + List lsParamAcumula = paramAcumulaMasivoService.buscar(paramAcumulaMasivo); + + boolean podeSalvar = false; + if (lsParamAcumula.isEmpty()) { + podeSalvar = true; + } else { + if (paramAcumulaMasivo.getParamacumulamasivo()!= null) { + for (ParamAcumulaMasivo p : lsParamAcumula) { + if (p.getParamacumulamasivo().equals(paramAcumulaMasivo.getParamacumulamasivo())) { + podeSalvar = true; + } + } + } + } + + if (!podeSalvar) { + Messagebox.show( + Labels.getLabel("editarParamAcumulaMasivoController.MSG.conflitoVigencias"), + Labels.getLabel("editarParamAcumulaMasivoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + + paramAcumulaMasivo.setActivo(true); + paramAcumulaMasivo.setFecmodif(Calendar.getInstance().getTime()); + paramAcumulaMasivo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (paramAcumulaMasivo.getParamacumulamasivo() == null) { + paramAcumulaMasivoService.suscribir(paramAcumulaMasivo); + paramAcumulaMasivoList.addItem(paramAcumulaMasivo); + } else { + paramAcumulaMasivoService.actualizacion(paramAcumulaMasivo); + paramAcumulaMasivoList.updateItem(paramAcumulaMasivo); + } + + Messagebox.show( + Labels.getLabel("editarParamAcumulaMasivoController.MSG.suscribirOK"), + Labels.getLabel("editarParamAcumulaMasivoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarParamAcumulaMasivoController.MSG.borrarPergunta"), + Labels.getLabel("editarParamAcumulaMasivoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + paramAcumulaMasivoService.borrar(paramAcumulaMasivo); + + Messagebox.show( + Labels.getLabel("editarParamAcumulaMasivoController.MSG.borrarOK"), + Labels.getLabel("editarParamAcumulaMasivoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + paramAcumulaMasivoList.removeItem(paramAcumulaMasivo); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public ParamAcumulaMasivo getParamAcumulaMasivo() { + return paramAcumulaMasivo; + } + + public void setParamAcumulaMasivo(ParamAcumulaMasivo paramAcumulaMasivo) { + this.paramAcumulaMasivo = paramAcumulaMasivo; + } + + public MyListbox getParamAcumulaMasivoList() { + return paramAcumulaMasivoList; + } + + public void setParamAcumulaMasivoList(MyListbox paramAcumulaMasivoList) { + this.paramAcumulaMasivoList = paramAcumulaMasivoList; + } + + public ParamAcumulaMasivoService getParamAcumulaMasivoService() { + return paramAcumulaMasivoService; + } + + public void setParamAcumulaMasivoService(ParamAcumulaMasivoService paramAcumulaMasivoService) { + this.paramAcumulaMasivoService = paramAcumulaMasivoService; + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public Spinner getMax() { + return max; + } + + public void setMax(Spinner max) { + this.max = max; + } + + public Spinner getMin() { + return min; + } + + public void setMin(Spinner min) { + this.min = min; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamAcumulaPuntoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamAcumulaPuntoController.java new file mode 100644 index 000000000..4498ae94e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamAcumulaPuntoController.java @@ -0,0 +1,414 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaPunto; +import com.rjconsultores.ventaboletos.service.CategoriaService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.FormaPagoService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.ParamAcumulaPuntoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.zkoss.zk.ui.Component; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Spinner; + +/** + * + * @author Rafius + */ +@Controller("editarParamAcumulaPuntoController") +@Scope("prototype") +public class EditarParamAcumulaPuntoController extends MyGenericForwardComposer { + + @Autowired + private ParamAcumulaPuntoService paramAcumulaPuntoService; + @Autowired + private ParadaService paradaService; + @Autowired + private EmpresaService empresaService; + @Autowired + private CategoriaService categoriaService; + @Autowired + private FormaPagoService formaPagoService; + private List lsEmpresa; + private List lsCategoria; + private List lsFormaPago; + private ParamAcumulaPunto paramAcumulaPunto; + private MyListbox paramAcumulaPuntoList; + private static Logger log = Logger.getLogger(EditarParamAcumulaPuntoController.class); + private Combobox cmbOrigem; + private Combobox cmbDestino; + private Combobox cmbEmpresa; + private Combobox cmbFormaPago; + private Combobox cmbCategoria; + private Datebox fecInicio; + private Datebox fecFinal; + private MyTextboxDecimal porcCliente; + private MyTextboxDecimal porcEmpresa; + private Spinner cantoperaciondia; + private Spinner cantboletooperacion; + private Button btnApagar; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public Combobox getCmbFormaPago() { + return cmbFormaPago; + } + + public void setCmbFormaPago(Combobox cmbFormaPago) { + this.cmbFormaPago = cmbFormaPago; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEmpresa = empresaService.obtenerTodos(); + lsCategoria = categoriaService.obtenerTodos(); + lsFormaPago = formaPagoService.obtenerTodos(); + + super.doAfterCompose(comp); + + paramAcumulaPunto = (ParamAcumulaPunto) Executions.getCurrent().getArg().get("paramAcumulaPunto"); + paramAcumulaPuntoList = (MyListbox) Executions.getCurrent().getArg().get("paramAcumulaPuntoList"); + + BindingListModelList modelCategoria = new BindingListModelList(lsCategoria, true); + cmbCategoria.setModel(modelCategoria); + + if (paramAcumulaPunto.getParamacumulapuntoId() != null) { + cmbOrigem.setValue(paramAcumulaPunto.getOrigem() == null ? "" : paramAcumulaPunto.getOrigem().getDescparada()); + cmbDestino.setValue(paramAcumulaPunto.getDestino() == null ? "" : paramAcumulaPunto.getDestino().getDescparada()); + cmbCategoria.setValue(paramAcumulaPunto.getCategoria() == null ? " " : paramAcumulaPunto.getCategoria().getDesccategoria()); + } + + if (paramAcumulaPunto.getParamacumulapuntoId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + Parada origem = paramAcumulaPunto.getOrigem(); + if (origem != null) { + cmbOrigem.setText(origem.getDescparada()); + } + + Parada destino = paramAcumulaPunto.getDestino(); + if (destino != null) { + cmbDestino.setText(destino.getDescparada()); + } + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + cantboletooperacion.getValue(); + cantoperaciondia.getValue(); + cmbOrigem.getValue(); + cmbCategoria.getValue(); + cmbDestino.getValue(); + cmbFormaPago.getValue(); + fecInicio.getValue(); + fecFinal.getValue(); + porcCliente.getValue(); + cmbEmpresa.getValue(); + porcEmpresa.getValue(); + + Comboitem cbiOrigem = cmbOrigem.getSelectedItem(); + Parada origem = paramAcumulaPunto.getOrigem(); + if (cbiOrigem != null) { + origem = (Parada) cbiOrigem.getValue(); + } + + Comboitem cbiDestino = cmbDestino.getSelectedItem(); + Parada destino = paramAcumulaPunto.getDestino(); + if (cbiDestino != null) { + destino = (Parada) cbiDestino.getValue(); + } + + if (destino.equals(origem) && !destino.getParadaId().equals(-1)) { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.selectItemDiferente"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + boolean validacion = true; + + try { + if (fecInicio.getValue() != null && fecFinal.getValue() != null) { + if (fecInicio.getValue() == null || fecFinal.getValue() == null) { + Messagebox.show(Labels.getLabel("editarParamAcumulaPuntoController.MSG.fecha"), + Labels.getLabel("editarParamCanjePuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + validacion = false; + } else if (fecInicio.getValue().after(fecFinal.getValue())) { + Messagebox.show(Labels.getLabel("editarParamCanjePuntoController.MSG.busquedaPeriodo"), + Labels.getLabel("editarParamCanjePuntoController.window.title"), Messagebox.OK, + Messagebox.INFORMATION); + validacion = false; + } + } else if (fecInicio.getValue() == null || fecFinal.getValue() == null) { + if (fecInicio.getValue() != null || fecFinal.getValue() != null) { + Messagebox.show(Labels.getLabel("editarParamAcumulaPuntoController.MSG.fecha"), + Labels.getLabel("editarParamCanjePuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + validacion = false; + } + } + if (cantoperaciondia.getValue() != null && cantboletooperacion.getValue() != null) { + if (cantoperaciondia.getValue() == 0 || cantboletooperacion.getValue() == 0) { + Messagebox.show(Labels.getLabel("editarParamAcumulaPuntoController.MSG.boleto"), + Labels.getLabel("editarParamCanjePuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + validacion = false; + } + } else if (cantoperaciondia.getValue() == null || cantboletooperacion.getValue() == null) { + if (cantoperaciondia.getValue() != null || cantboletooperacion.getValue() != null) { + Messagebox.show(Labels.getLabel("editarParamAcumulaPuntoController.MSG.boleto"), + Labels.getLabel("editarParamCanjePuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + validacion = false; + } + } + if (origem == null || destino == null) { + Messagebox.show(Labels.getLabel("editarParamAcumulaPuntoController.MSG.parada"), + Labels.getLabel("editarParamCanjePuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + validacion = false; + } + + if (validacion) { + try { + paramAcumulaPunto.setActivo(true); + paramAcumulaPunto.setFecmodif(Calendar.getInstance().getTime()); + paramAcumulaPunto.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + paramAcumulaPunto.setOrigem(origem); + paramAcumulaPunto.setDestino(destino); + + if (paramAcumulaPunto.getParamacumulapuntoId() == null) { + paramAcumulaPuntoService.suscribir(paramAcumulaPunto); + paramAcumulaPuntoList.addItem(paramAcumulaPunto); + } else { + paramAcumulaPuntoService.actualizacion(paramAcumulaPunto); + paramAcumulaPuntoList.updateItem(paramAcumulaPunto); + } + + Messagebox.show( + Labels.getLabel("editarParamAcumulaPuntoController.MSG.suscribirOK"), + Labels.getLabel("editarParamAcumulaPuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } + + } catch (InterruptedException ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarParamAcumulaPuntoController.MSG.borrarPergunta"), + Labels.getLabel("editarParamAcumulaPuntoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + paramAcumulaPuntoService.borrar(paramAcumulaPunto); + + Messagebox.show( + Labels.getLabel("editarParamAcumulaPuntoController.MSG.borrarOK"), + Labels.getLabel("editarParamAcumulaPuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + paramAcumulaPuntoList.removeItem(paramAcumulaPunto); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public Combobox getCmbDestino() { + return cmbDestino; + } + + public void setCmbDestino(Combobox cmbDestino) { + this.cmbDestino = cmbDestino; + } + + public Combobox getCmbOrigem() { + return cmbOrigem; + } + + public void setCmbOrigem(Combobox cmbOrigem) { + this.cmbOrigem = cmbOrigem; + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public ParadaService getParadaService() { + return paradaService; + } + + public void setParadaService(ParadaService paradaService) { + this.paradaService = paradaService; + } + + public ParamAcumulaPunto getParamAcumulaPunto() { + return paramAcumulaPunto; + } + + public void setParamAcumulaPunto(ParamAcumulaPunto paramAcumulaPunto) { + this.paramAcumulaPunto = paramAcumulaPunto; + } + + public MyListbox getParamAcumulaPuntoList() { + return paramAcumulaPuntoList; + } + + public void setParamAcumulaPuntoList(MyListbox paramAcumulaPuntoList) { + this.paramAcumulaPuntoList = paramAcumulaPuntoList; + } + + public ParamAcumulaPuntoService getParamAcumulaPuntoService() { + return paramAcumulaPuntoService; + } + + public void setParamAcumulaPuntoService(ParamAcumulaPuntoService paramAcumulaPuntoService) { + this.paramAcumulaPuntoService = paramAcumulaPuntoService; + } + + public CategoriaService getCategoriaService() { + return categoriaService; + } + + public void setCategoriaService(CategoriaService categoriaService) { + this.categoriaService = categoriaService; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public FormaPagoService getFormaPagoService() { + return formaPagoService; + } + + public void setFormaPagoService(FormaPagoService formaPagoService) { + this.formaPagoService = formaPagoService; + } + + public List getLsCategoria() { + return lsCategoria; + } + + public void setLsCategoria(List lsCategoria) { + this.lsCategoria = lsCategoria; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsFormaPago() { + return lsFormaPago; + } + + public void setLsFormaPago(List lsFormaPago) { + this.lsFormaPago = lsFormaPago; + } + + public MyTextboxDecimal getPorcCliente() { + return porcCliente; + } + + public void setPorcCliente(MyTextboxDecimal porcCliente) { + this.porcCliente = porcCliente; + } + + public MyTextboxDecimal getPorcEmpresa() { + return porcEmpresa; + } + + public void setPorcEmpresa(MyTextboxDecimal porcEmpresa) { + this.porcEmpresa = porcEmpresa; + } + + public Spinner getCantboletooperacion() { + return cantboletooperacion; + } + + public void setCantboletooperacion(Spinner cantboletooperacion) { + this.cantboletooperacion = cantboletooperacion; + } + + public Spinner getCantoperaciondia() { + return cantoperaciondia; + } + + public void setCantoperaciondia(Spinner cantoperaciondia) { + this.cantoperaciondia = cantoperaciondia; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamCanjePuntoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamCanjePuntoController.java new file mode 100644 index 000000000..793ce35fd --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamCanjePuntoController.java @@ -0,0 +1,204 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParamCanjePunto; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.ParamCanjePuntoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import java.util.Calendar; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.zkoss.zk.ui.Component; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Button; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Doublebox; + +/** + * + * @author Rafius + */ +@Controller("editarParamCanjePuntoController") +@Scope("prototype") +public class EditarParamCanjePuntoController extends MyGenericForwardComposer { + + @Autowired + private ParamCanjePuntoService paramCanjePuntoService; + @Autowired + private ParadaService paradaService; + private MyTextboxDecimal porcentaje; + private ParamCanjePunto paramCanjePunto; + private MyListbox paramCanjePuntoList; + private static Logger log = Logger.getLogger(EditarParamCanjePuntoController.class); + private MyComboboxParada cmbOrigem; + private MyComboboxParada cmbDestino; + private Datebox fecInicio; + private Datebox fecFinal; + private Button btnApagar; + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + paramCanjePunto = (ParamCanjePunto) Executions.getCurrent().getArg().get("paramCanjePunto"); + paramCanjePuntoList = (MyListbox) Executions.getCurrent().getArg().get("paramCanjePuntoList"); + + if (paramCanjePunto.getParamcanjepuntoId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + Parada origem = paramCanjePunto.getOrigem(); + if (origem != null) { + cmbOrigem.setText(origem.getDescparada()); + } + + Parada destino = paramCanjePunto.getDestino(); + if (destino != null) { + cmbDestino.setText(destino.getDescparada()); + } + } + + fecInicio.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + fecInicio.getValue(); + fecFinal.getValue(); + cmbOrigem.getValue(); + cmbDestino.getValue(); + porcentaje.getValue(); +// if (porcentaje.getValue().compareTo(new Double("100")) > 0) { +// Clients.wrongValue(porcentaje, Labels.getLabel("MSG.Porcentaje")); +// return; +// } + Parada origen = (Parada) cmbOrigem.getSelectedItem().getValue(); + Parada destino = (Parada) cmbDestino.getSelectedItem().getValue(); + if (origen.equals(destino) && !origen.getParadaId().equals(-1)) { + Messagebox.show( + Labels.getLabel("editarConfiguracionReservacionController.MSG.selectItemDiferente"), + Labels.getLabel("editarConfiguracionReservacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + if (fecInicio.getValue().after(fecFinal.getValue())) { + try { + Messagebox.show(Labels.getLabel("editarParamCanjePuntoController.MSG.busquedaPeriodo"), Labels.getLabel("editarParamCanjePuntoController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + log.error(ex); + } + } else { + try { + paramCanjePunto.setActivo(true); + paramCanjePunto.setFecmodif(Calendar.getInstance().getTime()); + paramCanjePunto.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + paramCanjePunto.setOrigem((Parada) cmbOrigem.getSelectedItem().getValue()); + paramCanjePunto.setDestino((Parada) cmbDestino.getSelectedItem().getValue()); + + if (paramCanjePunto.getParamcanjepuntoId() == null) { + paramCanjePuntoService.suscribir(paramCanjePunto); + paramCanjePuntoList.addItem(paramCanjePunto); + } else { + paramCanjePuntoService.actualizacion(paramCanjePunto); + paramCanjePuntoList.updateItem(paramCanjePunto); + } + + Messagebox.show( + Labels.getLabel("editarParamCanjePuntoController.MSG.suscribirOK"), + Labels.getLabel("editarParamCanjePuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarParamCanjePuntoController.MSG.borrarPergunta"), + Labels.getLabel("editarParamCanjePuntoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + paramCanjePuntoService.borrar(paramCanjePunto); + + Messagebox.show( + Labels.getLabel("editarParamCanjePuntoController.MSG.borrarOK"), + Labels.getLabel("editarParamCanjePuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + paramCanjePuntoList.removeItem(paramCanjePunto); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public MyComboboxParada getCmbDestino() { + return cmbDestino; + } + + public void setCmbDestino(MyComboboxParada cmbDestino) { + this.cmbDestino = cmbDestino; + } + + public MyComboboxParada getCmbOrigem() { + return cmbOrigem; + } + + public void setCmbOrigem(MyComboboxParada cmbOrigem) { + this.cmbOrigem = cmbOrigem; + } + + public ParadaService getParadaService() { + return paradaService; + } + + public void setParadaService(ParadaService paradaService) { + this.paradaService = paradaService; + } + + public ParamCanjePunto getParamCanjePunto() { + return paramCanjePunto; + } + + public void setParamCanjePunto(ParamCanjePunto paramCanjePunto) { + this.paramCanjePunto = paramCanjePunto; + } + + public MyListbox getParamCanjePuntoList() { + return paramCanjePuntoList; + } + + public void setParamCanjePuntoList(MyListbox paramCanjePuntoList) { + this.paramCanjePuntoList = paramCanjePuntoList; + } + + public ParamCanjePuntoService getParamCanjePuntoService() { + return paramCanjePuntoService; + } + + public void setParamCanjePuntoService(ParamCanjePuntoService paramCanjePuntoService) { + this.paramCanjePuntoService = paramCanjePuntoService; + } + + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamCompraPuntoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamCompraPuntoController.java new file mode 100644 index 000000000..bf2b3f003 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamCompraPuntoController.java @@ -0,0 +1,199 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.ParamCompraPunto; +import com.rjconsultores.ventaboletos.service.ParamCompraPuntoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.zkoss.zk.ui.Component; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Doublebox; + +/** + * + * @author Rafius + */ +@Controller("editarParamCompraPuntoController") +@Scope("prototype") +public class EditarParamCompraPuntoController extends MyGenericForwardComposer { + + @Autowired + private ParamCompraPuntoService paramCompraPuntoService; + private ParamCompraPunto paramCompraPunto; + private MyListbox paramCompraPuntoList; + private static Logger log = Logger.getLogger(EditarParamCompraPuntoController.class); + private Datebox fecInicio; + private BusquedaParamCompraPuntoController busquedaParamCompraPuntoController; + private Datebox fecFinal; + private Button btnApagar; + private MyTextboxDecimal valorCosto; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + busquedaParamCompraPuntoController = (BusquedaParamCompraPuntoController) Executions.getCurrent().getArg().get("busquedaParamCompraPuntoController"); + paramCompraPunto = (ParamCompraPunto) Executions.getCurrent().getArg().get("paramCompraPunto"); + paramCompraPuntoList = (MyListbox) Executions.getCurrent().getArg().get("paramCompraPuntoList"); + + if (paramCompraPunto.getParamcomprapuntoId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + fecInicio.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + fecInicio.getValue(); + fecFinal.getValue(); + valorCosto.getValue(); + + List lsParam = paramCompraPuntoService.buscar(paramCompraPunto.getFeciniciovigencia(), + paramCompraPunto.getFecfinvigencia(), null, null); + + boolean podeSalvar = false; + + if (lsParam.isEmpty()) { + podeSalvar = true; + } else { + if (paramCompraPunto.getParamcomprapuntoId() != null) { + for (ParamCompraPunto p : lsParam) { + if (p.getParamcomprapuntoId().equals(paramCompraPunto.getParamcomprapuntoId())) { + podeSalvar = true; + } + } + } + } + + if (podeSalvar) { + if (fecInicio.getValue().after(fecFinal.getValue())) { + try { + Messagebox.show( + Labels.getLabel("editarParamCompraPuntoController.MSG.busquedaPeriodo"), + Labels.getLabel("editarParamCompraPuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + log.error(ex); + } + } else { + try { + paramCompraPunto.setActivo(true); + paramCompraPunto.setFecmodif(Calendar.getInstance().getTime()); + paramCompraPunto.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (paramCompraPunto.getParamcomprapuntoId() == null) { + paramCompraPuntoService.suscribir(paramCompraPunto); + paramCompraPuntoList.addItem(paramCompraPunto); + } else { + paramCompraPuntoService.actualizacion(paramCompraPunto); + paramCompraPuntoList.updateItem(paramCompraPunto); + } + + Messagebox.show( + Labels.getLabel("editarParamCompraPuntoController.MSG.suscribirOK"), + Labels.getLabel("editarParamCompraPuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + busquedaParamCompraPuntoController.refreshLista(); + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarParamCostoTarjetaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarParamCompraPuntoController.MSG.borrarPergunta"), + Labels.getLabel("editarParamCompraPuntoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + paramCompraPuntoService.borrar(paramCompraPunto); + + Messagebox.show( + Labels.getLabel("editarParamCompraPuntoController.MSG.borrarOK"), + Labels.getLabel("editarParamCompraPuntoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + paramCompraPuntoList.removeItem(paramCompraPunto); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public ParamCompraPunto getParamCompraPunto() { + return paramCompraPunto; + } + + public void setParamCompraPunto(ParamCompraPunto paramCompraPunto) { + this.paramCompraPunto = paramCompraPunto; + } + + public MyListbox getParamCompraPuntoList() { + return paramCompraPuntoList; + } + + public void setParamCompraPuntoList(MyListbox paramCompraPuntoList) { + this.paramCompraPuntoList = paramCompraPuntoList; + } + + public ParamCompraPuntoService getParamCompraPuntoService() { + return paramCompraPuntoService; + } + + public void setParamCompraPuntoService(ParamCompraPuntoService paramCompraPuntoService) { + this.paramCompraPuntoService = paramCompraPuntoService; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamCostoTarjetaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamCostoTarjetaController.java new file mode 100644 index 000000000..647237856 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarParamCostoTarjetaController.java @@ -0,0 +1,198 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.ParamCostoTarjeta; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.ParamCostoTarjetaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.zkoss.zk.ui.Component; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; + +/** + * + * @author Rafius + */ +@Controller("editarParamCostoTarjetaController") +@Scope("prototype") +public class EditarParamCostoTarjetaController extends MyGenericForwardComposer { + + @Autowired + private ParamCostoTarjetaService paramCostoTarjetaService; + @Autowired + private EmpresaService empresaService; + private List lsEmpresa; + private BusquedaParamCostoTarjetaController busquedaParamCostoTarjetaController; + private ParamCostoTarjeta paramCostoTarjeta; + private MyListbox paramCostoTarjetaList; + private static Logger log = Logger.getLogger(EditarParamCostoTarjetaController.class); + private Combobox cmbEmpresa; + private MyTextboxDecimal vlrInicial; + private Button btnApagar; + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.obtenerTodos(); + + super.doAfterCompose(comp); + busquedaParamCostoTarjetaController = (BusquedaParamCostoTarjetaController) Executions.getCurrent().getArg().get("BusquedaParamCostoTarjetaController"); + paramCostoTarjeta = (ParamCostoTarjeta) Executions.getCurrent().getArg().get("paramCostoTarjeta"); + paramCostoTarjetaList = (MyListbox) Executions.getCurrent().getArg().get("paramCostoTarjetaList"); + + if (paramCostoTarjeta.getParamcostotarjetaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + cmbEmpresa.focus(); + } + + public void onClick$btnSalvar(Event ev) { + + cmbEmpresa.getSelectedItem().getValue(); + vlrInicial.getValue(); + + try { + paramCostoTarjeta.setActivo(true); + paramCostoTarjeta.setFecmodif(Calendar.getInstance().getTime()); + paramCostoTarjeta.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsParam = paramCostoTarjetaService.buscar(paramCostoTarjeta); + + boolean podeSalvar = false; + if (lsParam.isEmpty()) { + podeSalvar = true; + } else { + if (paramCostoTarjeta.getParamcostotarjetaId() != null) { + for (ParamCostoTarjeta p : lsParam) { + if (p.getParamcostotarjetaId().equals(paramCostoTarjeta.getParamcostotarjetaId())) { + podeSalvar = true; + } + } + } + } + + if (podeSalvar) { + if (paramCostoTarjeta.getParamcostotarjetaId() == null) { + paramCostoTarjetaService.suscribir(paramCostoTarjeta); + paramCostoTarjetaList.addItem(paramCostoTarjeta); + } else { + paramCostoTarjetaService.actualizacion(paramCostoTarjeta); + paramCostoTarjetaList.updateItem(paramCostoTarjeta); + } + + Messagebox.show( + Labels.getLabel("editarParamCostoTarjetaController.MSG.suscribirOK"), + Labels.getLabel("editarParamCostoTarjetaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarParamCostoTarjetaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarParamCostoTarjetaController.MSG.borrarPergunta"), + Labels.getLabel("editarParamCostoTarjetaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + paramCostoTarjetaService.borrar(paramCostoTarjeta); + + Messagebox.show( + Labels.getLabel("editarParamCostoTarjetaController.MSG.borrarOK"), + Labels.getLabel("editarParamCostoTarjetaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + paramCostoTarjetaList.removeItem(paramCostoTarjeta); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public EmpresaService getEmpresaService() { + return empresaService; + } + + public void setEmpresaService(EmpresaService empresaService) { + this.empresaService = empresaService; + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public ParamCostoTarjeta getParamCostoTarjeta() { + return paramCostoTarjeta; + } + + public void setParamCostoTarjeta(ParamCostoTarjeta paramCostoTarjeta) { + this.paramCostoTarjeta = paramCostoTarjeta; + } + + public MyListbox getParamCostoTarjetaList() { + return paramCostoTarjetaList; + } + + public void setParamCostoTarjetaList(MyListbox paramCostoTarjetaList) { + this.paramCostoTarjetaList = paramCostoTarjetaList; + } + + public ParamCostoTarjetaService getParamCostoTarjetaService() { + return paramCostoTarjetaService; + } + + public void setParamCostoTarjetaService(ParamCostoTarjetaService paramCostoTarjetaService) { + this.paramCostoTarjetaService = paramCostoTarjetaService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarTipoDomicilioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarTipoDomicilioController.java new file mode 100644 index 000000000..b0baefd5d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarTipoDomicilioController.java @@ -0,0 +1,196 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.TipoDomicilio; +import com.rjconsultores.ventaboletos.service.TipoDomicilioService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarTipoDomicilioController") +@Scope("prototype") +public class EditarTipoDomicilioController extends MyGenericForwardComposer { + + @Autowired + private TipoDomicilioService tipoDomicilioService; + private TipoDomicilio tipoDomicilio; + private MyListbox tipoDomicilioList; + private Button btnApagar; + private Textbox txtNome; + BusquedaTipoDomicilioController busquedaTipoDomicilioController; + private Textbox txtCve; + private static Logger log = Logger.getLogger(EditarTipoDomicilioController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public TipoDomicilio getTipoDomicilio() { + return tipoDomicilio; + } + + public void setTipoDomicilio(TipoDomicilio tipoDomicilio) { + this.tipoDomicilio = tipoDomicilio; + } + + public Textbox getTxtCve() { + return txtCve; + } + + public void setTxtCve(Textbox txtCve) { + this.txtCve = txtCve; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + busquedaTipoDomicilioController = (BusquedaTipoDomicilioController) Executions.getCurrent().getArg().get("busquedaTipoDomicilioController"); + tipoDomicilio = (TipoDomicilio) Executions.getCurrent().getArg().get("tipoDomicilio"); + tipoDomicilioList = (MyListbox) Executions.getCurrent().getArg().get("tipoDomicilioList"); + + + if (tipoDomicilio.getTipodomicilioId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + txtCve.getValue(); + + try { + tipoDomicilio.setActivo(Boolean.TRUE); + tipoDomicilio.setFecmodif(Calendar.getInstance().getTime()); + tipoDomicilio.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + + List lsTipoDomiciolio = + tipoDomicilioService.buscar(tipoDomicilio.getDesctipo(), + tipoDomicilio.getCvetipodomicilio()); + + boolean podeSalvar = false; + if (lsTipoDomiciolio.isEmpty()) { + podeSalvar = true; + } else { + if (tipoDomicilio.getTipodomicilioId() != null) { + for (TipoDomicilio p : lsTipoDomiciolio) { + if (p.getTipodomicilioId().equals(tipoDomicilio.getTipodomicilioId())) { + podeSalvar = true; + } + } + } + } + + List lsTipoDomiciolioClave = + tipoDomicilioService.buscarClave(tipoDomicilio.getCvetipodomicilio()); + + boolean podeSalvarClave = false; + if (lsTipoDomiciolioClave.isEmpty()) { + podeSalvarClave = true; + } else { + if (tipoDomicilio.getTipodomicilioId() != null) { + for (TipoDomicilio p : lsTipoDomiciolioClave) { + if (p.getTipodomicilioId().equals(tipoDomicilio.getTipodomicilioId())) { + podeSalvarClave = true; + } + } + } + } + + if (!podeSalvarClave) { + Messagebox.show( + Labels.getLabel("editarTipoDomicilioController.MSG.clave"), + Labels.getLabel("editarTipoDomicilioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + if (!podeSalvar) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoDomicilioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (tipoDomicilio.getTipodomicilioId() == null) { + tipoDomicilioService.suscribir(tipoDomicilio); + tipoDomicilioList.addItem(tipoDomicilio); + } else { + tipoDomicilioService.actualizacion(tipoDomicilio); + tipoDomicilioList.updateItem(tipoDomicilio); + } + + Messagebox.show( + Labels.getLabel("editarTipoDomicilioController.MSG.suscribirOK"), + Labels.getLabel("editarTipoDomicilioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + busquedaTipoDomicilioController.refreshLista(); + closeWindow(); + } + } catch (Exception ex) { + log.error("editarTipoDomicilioController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoDomicilioController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTipoDomicilioController.MSG.borrarPergunta"), + Labels.getLabel("editarTipoDomicilioController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + tipoDomicilioService.borrar(tipoDomicilio); + + Messagebox.show( + Labels.getLabel("editarTipoDomicilioController.MSG.borrarOK"), + Labels.getLabel("editarTipoDomicilioController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tipoDomicilioList.removeItem(tipoDomicilio); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarTipoMovimientoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarTipoMovimientoController.java new file mode 100644 index 000000000..5a8822d32 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarTipoMovimientoController.java @@ -0,0 +1,160 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.TipoMovimiento; +import com.rjconsultores.ventaboletos.service.TipoMovimientoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarTipoMovimientoController") +@Scope("prototype") +public class EditarTipoMovimientoController extends MyGenericForwardComposer { + + @Autowired + private TipoMovimientoService tipoMovimientoService; + private TipoMovimiento tipoMovimiento; + private MyListbox tipoMovimientoList; + private Button btnApagar; + private Textbox txtNome; + private BusquedaTipoMovimientoController busquedaTipoMovimientoController; + private static Logger log = Logger.getLogger(EditarTipoMovimientoController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public TipoMovimiento getTipoMovimiento() { + return tipoMovimiento; + } + + public void setTipoMovimiento(TipoMovimiento tipoMovimiento) { + this.tipoMovimiento = tipoMovimiento; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + busquedaTipoMovimientoController = (BusquedaTipoMovimientoController) Executions.getCurrent().getArg().get("busquedaTipoMovimientoController"); + tipoMovimiento = (TipoMovimiento) Executions.getCurrent().getArg().get("tipoMovimiento"); + tipoMovimientoList = (MyListbox) Executions.getCurrent().getArg().get("tipoMovimientoList"); + + if (tipoMovimiento.getTipomovimientoId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + + try { + tipoMovimiento.setActivo(Boolean.TRUE); + tipoMovimiento.setFecmodif(Calendar.getInstance().getTime()); + tipoMovimiento.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsTipoMovimiento = + tipoMovimientoService.buscar(tipoMovimiento.getDescmovimiento()); + + boolean podeSalvar = false; + if (lsTipoMovimiento.isEmpty()) { + podeSalvar = true; + } else { + if (tipoMovimiento.getTipomovimientoId() != null) { + for (TipoMovimiento p : lsTipoMovimiento) { + if (p.getTipomovimientoId().equals(tipoMovimiento.getTipomovimientoId())) { + podeSalvar = true; + } + } + } + } + + if (!podeSalvar) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoMovimientoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (tipoMovimiento.getTipomovimientoId() == null) { + tipoMovimientoService.suscribir(tipoMovimiento); + tipoMovimientoList.addItem(tipoMovimiento); + } else { + tipoMovimientoService.actualizacion(tipoMovimiento); + tipoMovimientoList.updateItem(tipoMovimiento); + } + + Messagebox.show( + Labels.getLabel("editarTipoMovimientoController.MSG.suscribirOK"), + Labels.getLabel("editarTipoMovimientoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + busquedaTipoMovimientoController.refreshLista(); + closeWindow(); + } + } catch (Exception ex) { + log.error("editarTipoMovimientoController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoMovimientoController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTipoMovimientoController.MSG.borrarPergunta"), + Labels.getLabel("editarTipoMovimientoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + tipoMovimientoService.borrar(tipoMovimiento); + + Messagebox.show( + Labels.getLabel("editarTipoMovimientoController.MSG.borrarOK"), + Labels.getLabel("editarTipoMovimientoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tipoMovimientoList.removeItem(tipoMovimiento); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarTipoOcupacionController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarTipoOcupacionController.java new file mode 100644 index 000000000..a989b361d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/sendaAmigo/EditarTipoOcupacionController.java @@ -0,0 +1,192 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.sendaAmigo; + +import com.rjconsultores.ventaboletos.entidad.TipoOcupacion; +import com.rjconsultores.ventaboletos.service.TipoOcupacionService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +@Controller("editarTipoOcupacionController") +@Scope("prototype") +public class EditarTipoOcupacionController extends MyGenericForwardComposer { + + @Autowired + private TipoOcupacionService tipoOcupacionService; + private TipoOcupacion tipoOcupacion; + private MyListbox tipoOcupacionList; + private Button btnApagar; + private Textbox txtNome; + private Textbox txtCve; + private BusquedaTipoOcupacionController busquedaTipoOcupacionController; + private static Logger log = Logger.getLogger(EditarTipoOcupacionController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public TipoOcupacion getTipoOcupacion() { + return tipoOcupacion; + } + + public void setTipoOcupacion(TipoOcupacion tipoOcupacion) { + this.tipoOcupacion = tipoOcupacion; + } + + public Textbox getTxtCve() { + return txtCve; + } + + public void setTxtCve(Textbox txtCve) { + this.txtCve = txtCve; + } + + public Textbox getTxtNome() { + return txtNome; + } + + public void setTxtNome(Textbox txtNome) { + this.txtNome = txtNome; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + busquedaTipoOcupacionController = (BusquedaTipoOcupacionController) Executions.getCurrent().getArg().get("busquedaTipoOcupacionController"); + tipoOcupacion = (TipoOcupacion) Executions.getCurrent().getArg().get("tipoOcupacion"); + tipoOcupacionList = (MyListbox) Executions.getCurrent().getArg().get("tipoOcupacionList"); + + if (tipoOcupacion.getTipoocupacionId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + txtNome.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + txtNome.getValue(); + txtCve.getValue(); + + try { + tipoOcupacion.setActivo(Boolean.TRUE); + tipoOcupacion.setFecmodif(Calendar.getInstance().getTime()); + tipoOcupacion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + List lsTipoOcupacion = + tipoOcupacionService.buscar(tipoOcupacion.getDesctipo(), + tipoOcupacion.getCvetipoocupacion()); + + boolean podeSalvar = false; + if (lsTipoOcupacion.isEmpty()) { + podeSalvar = true; + } else { + if (tipoOcupacion.getTipoocupacionId() != null) { + for (TipoOcupacion p : lsTipoOcupacion) { + if (p.getTipoocupacionId().equals(tipoOcupacion.getTipoocupacionId())) { + podeSalvar = true; + } + } + } + } + List lsTipoOcuapacionClave = + tipoOcupacionService.buscarClave(tipoOcupacion.getCvetipoocupacion()); + + boolean podeSalvarClave = false; + if (lsTipoOcuapacionClave.isEmpty()) { + podeSalvarClave = true; + } else { + if (tipoOcupacion.getTipoocupacionId() != null) { + for (TipoOcupacion p : lsTipoOcuapacionClave) { + if (p.getTipoocupacionId().equals(tipoOcupacion.getTipoocupacionId())) { + podeSalvarClave = true; + } + } + } + } + + if (!podeSalvarClave) { + Messagebox.show( + Labels.getLabel("editarTipoDomicilioController.MSG.clave"), + Labels.getLabel("editarTipoDomicilioController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + if (!podeSalvar) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTipoOcupacionController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (tipoOcupacion.getTipoocupacionId() == null) { + tipoOcupacionService.suscribir(tipoOcupacion); + tipoOcupacionList.addItem(tipoOcupacion); + } else { + tipoOcupacionService.actualizacion(tipoOcupacion); + tipoOcupacionList.updateItem(tipoOcupacion); + } + + Messagebox.show( + Labels.getLabel("editarTipoOcupacionController.MSG.suscribirOK"), + Labels.getLabel("editarTipoOcupacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + busquedaTipoOcupacionController.refreshLista(); + closeWindow(); + } + } catch (Exception ex) { + log.error("editarTipoOcupacionController: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTipoOcupacionController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + try { + int resp = Messagebox.show( + Labels.getLabel("editarTipoOcupacionController.MSG.borrarPergunta"), + Labels.getLabel("editarTipoOcupacionController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + + tipoOcupacionService.borrar(tipoOcupacion); + + Messagebox.show( + Labels.getLabel("editarTipoOcupacionController.MSG.borrarOK"), + Labels.getLabel("editarTipoOcupacionController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + tipoOcupacionList.removeItem(tipoOcupacion); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaExcepcionRedondoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaExcepcionRedondoController.java new file mode 100644 index 000000000..09c85865a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaExcepcionRedondoController.java @@ -0,0 +1,157 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.ExcepcionRedondo; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderExcepcionRedondo; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Paging; +import org.zkoss.zul.Radio; + +/** + * + * @author Administrador + */ +@Controller("busquedaExceptionRedondoController") +@Scope("prototype") +public class BusquedaExcepcionRedondoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwExcepcionRedondo; + @Autowired + private ParadaService paradaService; + private Combobox cmbOrigem; + private Combobox cmbDestino; + private String txtIndtipo = ""; + private MyListbox excepcionRedondoList; + private Paging pagingExcepcionRedondo; + private Radio radioA; + private Radio radioC; + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verExceptionRedondo(new ExcepcionRedondo()); + } + + public Radio getRadioA() { + return radioA; + } + + public void setRadioA(Radio radioA) { + this.radioA = radioA; + } + + public Radio getRadioC() { + return radioC; + } + + public void setRadioC(Radio radioC) { + this.radioC = radioC; + } + + public String getTxtIndtipo() { + return txtIndtipo; + } + + public void setTxtIndtipo(String txtIndtipo) { + this.txtIndtipo = txtIndtipo; + } + + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + excepcionRedondoList.setItemRenderer(new RenderExcepcionRedondo()); + excepcionRedondoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + ExcepcionRedondo mc = (ExcepcionRedondo) excepcionRedondoList.getSelected(); + verExceptionRedondo(mc); + } + }); + + refreshLista(); + + radioA.setChecked(true); + txtIndtipo = "A"; + } + + private void verExceptionRedondo(ExcepcionRedondo er) { + if (er == null) { + return; + } + + Map args = new HashMap(); + args.put("excepcionRedondo", er); + args.put("excepcionRedondoList", excepcionRedondoList); + + openWindow("/gui/tarifas/editarExceptionRedondo.zul", + Labels.getLabel("editarExceptionRedondoController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject excepcionRedondoBusqueda = + new HibernateSearchObject(ExcepcionRedondo.class, pagingExcepcionRedondo.getPageSize()); + excepcionRedondoBusqueda.addFilterEqual("activo", Boolean.TRUE); + + Parada origem = (Parada) (cmbOrigem.getSelectedItem() != null ? cmbOrigem.getSelectedItem().getValue() : null); + Parada destino = (Parada) (cmbDestino.getSelectedItem() != null ? cmbDestino.getSelectedItem().getValue() : null); + + excepcionRedondoBusqueda.addFilterEqual("origem", origem); + excepcionRedondoBusqueda.addFilterEqual("destino", destino); + + String indTipo = txtIndtipo; + if (indTipo.isEmpty()) { + excepcionRedondoBusqueda.addFilterEqual("indtipo", null); + } else { + excepcionRedondoBusqueda.addFilterEqual("indtipo", indTipo); + } + + excepcionRedondoBusqueda.addSortAsc("indtipo"); + plwExcepcionRedondo.init(excepcionRedondoBusqueda, excepcionRedondoList, pagingExcepcionRedondo); + + if (excepcionRedondoList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaExceptionRedondoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$radioA(Event ev) { + txtIndtipo = "A"; + } + + public void onClick$radioC(Event ev) { + txtIndtipo = "C"; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaMercadoCompetidoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaMercadoCompetidoController.java new file mode 100644 index 000000000..936a093e7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaMercadoCompetidoController.java @@ -0,0 +1,172 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.MercadoCompetido; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMercadoCompetido; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Paging; + +/** + * + * @author rodrigo + */ +@Controller("busquedaMercadoCompetidoController") +@Scope("prototype") +public class BusquedaMercadoCompetidoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwMercadoCompetido; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private ParadaService paradaService; + private List lsClaseServicio; + private Combobox cmbClaseServicio; + private Combobox cmbOrigem; + private Combobox cmbDestino; + private MyListbox mercadoCompetidoList; + private Paging pagingMercadoCompetido; + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + public Paging getPagingMercadoCompetido() { + return pagingMercadoCompetido; + } + + public void setPagingMercadoCompetido(Paging pagingMercadoCompetido) { + this.pagingMercadoCompetido = pagingMercadoCompetido; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Combobox getCmbDestino() { + return cmbDestino; + } + + public void setCmbDestino(Combobox cmbDestino) { + this.cmbDestino = cmbDestino; + } + + public Combobox getCmbOrigem() { + return cmbOrigem; + } + + public void setCmbOrigem(Combobox cmbOrigem) { + this.cmbOrigem = cmbOrigem; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verMercadoCompetido(new MercadoCompetido()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + mercadoCompetidoList.setItemRenderer(new RenderMercadoCompetido()); + mercadoCompetidoList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + MercadoCompetido mc = (MercadoCompetido) mercadoCompetidoList.getSelected(); + verMercadoCompetido(mc); + } + }); + + lsClaseServicio = claseServicioService.obtenerTodos(); + + //Leticia- Nao pode ter opção TODOS + Short menosUm = -1; + ClaseServicio cs = claseServicioService.obtenerID(menosUm); + if (cs != null) { + lsClaseServicio.remove(cs); + } + + + refreshLista(); + } + + private void verMercadoCompetido(MercadoCompetido mc) { + if (mc == null) { + return; + } + + Map args = new HashMap(); + args.put("mercadoCompetido", mc); + args.put("mercadoCompetidoList", mercadoCompetidoList); + + openWindow("/gui/tarifas/editarMercadoCompetido.zul", + Labels.getLabel("editarMercadoCompetidoController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject tarifaBusqueda = + new HibernateSearchObject(MercadoCompetido.class, pagingMercadoCompetido.getPageSize()); + tarifaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + ClaseServicio claseServicio = (ClaseServicio) (cmbClaseServicio.getSelectedItem() != null ? cmbClaseServicio.getSelectedItem().getValue() : null); + Parada origem = (Parada) (cmbOrigem.getSelectedItem() != null ? cmbOrigem.getSelectedItem().getValue() : null); + Parada destino = (Parada) (cmbDestino.getSelectedItem() != null ? cmbDestino.getSelectedItem().getValue() : null); + + tarifaBusqueda.addFilterEqual("origem", origem); + tarifaBusqueda.addFilterEqual("destino", destino); + tarifaBusqueda.addFilterEqual("claseServicio", claseServicio); + + tarifaBusqueda.addSortAsc("claseServicio.descclase"); + + plwMercadoCompetido.init(tarifaBusqueda, mercadoCompetidoList, pagingMercadoCompetido); + + if (mercadoCompetidoList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaMercadoCompetidoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaRedondeoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaRedondeoController.java new file mode 100644 index 000000000..f31c7ece0 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaRedondeoController.java @@ -0,0 +1,196 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.RedondeoCtrl; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRedondeoCtrl; +import com.trg.search.Filter; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Paging; + +/** + * + * @author Administrador + */ +@Controller("busquedaRedondeoController") +@Scope("prototype") +public class BusquedaRedondeoController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwRedondeo; + @Autowired + private MarcaService marcaService; + private MyListbox redondeoCtrlList; + private Paging pagingCtrlRedondeo; + private MyTextboxDecimal txtValorinicial; + private MyTextboxDecimal txtValorfinal; + private MyTextboxDecimal txtValorredondeo; + private Checkbox chkIndaplicadescuento; + private Checkbox chkIndaplicapricing; + private Combobox cmbMarca; + private List lsMarca; + + public Checkbox getChkIndaplicadescuento() { + return chkIndaplicadescuento; + } + + public void setChkIndaplicadescuento(Checkbox chkIndaplicadescuento) { + this.chkIndaplicadescuento = chkIndaplicadescuento; + } + + public Checkbox getChkIndaplicapricing() { + return chkIndaplicapricing; + } + + public void setChkIndaplicapricing(Checkbox chkIndaplicapricing) { + this.chkIndaplicapricing = chkIndaplicapricing; + } + + public Paging getPagingRedondeo() { + return pagingCtrlRedondeo; + } + + public void setPagingRedondeo(Paging pagingRedondeo) { + this.pagingCtrlRedondeo = pagingRedondeo; + } + + public MyListbox getRedondeoList() { + return redondeoCtrlList; + } + + public void setRedondeoList(MyListbox redondeoList) { + this.redondeoCtrlList = redondeoList; + } + + public List getLsMarca() { + return lsMarca; + } + + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsMarca = marcaService.buscarTodosExceto(-1); + + super.doAfterCompose(comp); + + redondeoCtrlList.setItemRenderer(new RenderRedondeoCtrl()); + redondeoCtrlList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + RedondeoCtrl rc = (RedondeoCtrl) redondeoCtrlList.getSelected(); + verRedondo(rc); + } + }); + + refreshLista(); + } + + private void verRedondo(RedondeoCtrl r) { + if (r == null) { + return; + } + + Map args = new HashMap(); + args.put("redondeoCtrl", r); + args.put("redondeoCtrlList", redondeoCtrlList); + + openWindow("/gui/tarifas/editarRedondeo.zul", + Labels.getLabel("editarRedondeoController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject excepcionRedondoBusqueda = + new HibernateSearchObject(RedondeoCtrl.class, pagingCtrlRedondeo.getPageSize()); + + excepcionRedondoBusqueda.addFilterEqual("activo", Boolean.TRUE); + + plwRedondeo.init(excepcionRedondoBusqueda, redondeoCtrlList, pagingCtrlRedondeo); + + if (redondeoCtrlList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + private void refreshListaPesquisa() { + HibernateSearchObject excepcionRedondoBusqueda = + new HibernateSearchObject(RedondeoCtrl.class, pagingCtrlRedondeo.getPageSize()); + + excepcionRedondoBusqueda.addFilterEqual("activo", Boolean.TRUE); + +// excepcionRedondoBusqueda.addFilterEqual("indaplicadescuento", chkIndaplicadescuento.isChecked()); +// excepcionRedondoBusqueda.addFilterEqual("indaplicapricing", chkIndaplicapricing.isChecked()); + + BigDecimal vlrIni = txtValorinicial.getValueDecimal(); + BigDecimal vlrFin = txtValorfinal.getValueDecimal(); + BigDecimal vlrRed = txtValorredondeo.getValueDecimal(); + + if (vlrIni != null) { + excepcionRedondoBusqueda.addFilterSome("redondeoList", Filter.equal("valorinicial", vlrIni)); + } + if (vlrFin != null) { + excepcionRedondoBusqueda.addFilterSome("redondeoList", Filter.equal("valorfinal", vlrFin)); + } + if (vlrRed != null) { + excepcionRedondoBusqueda.addFilterSome("redondeoList", Filter.equal("valorredondeo", vlrRed)); + } + Marca marca = (Marca) (cmbMarca.getSelectedItem() != null ? cmbMarca.getSelectedItem().getValue() : null); + if (marca != null) { + excepcionRedondoBusqueda.addFilterSome("redondeoMarcaList", Filter.equal("marca", marca)); + } + + plwRedondeo.init(excepcionRedondoBusqueda, redondeoCtrlList, pagingCtrlRedondeo); + + if (redondeoCtrlList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshListaPesquisa(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verRedondo(new RedondeoCtrl()); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTarifaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTarifaController.java new file mode 100644 index 000000000..4011ef6e5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTarifaController.java @@ -0,0 +1,406 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tarifa; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.service.CategoriaService; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; +import com.rjconsultores.ventaboletos.service.VigenciaTarifaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTarifa; +import com.trg.search.Filter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Paging; + +/** + * + * @author rodrigo + */ +@Controller("busquedaTarifaController") +@Scope("prototype") +public class BusquedaTarifaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTarifa; + private Paging pagingTarifa; + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private MonedaService monedaService; + @Autowired + private VigenciaTarifaService vigenciaTarifaService; + @Autowired + private CategoriaService categoriaService; + @Autowired + private TipoPuntoVentaService tipoPuntoVentaService; + @Autowired + private ParadaService paradaService; + private List lsMarcas; + private List lsClaseServico; + private List lsTramos; + private List lsMonedas; + private List lsVigencias; + private List lsCategoria; + private List lsTipoPontoVenta; + private MyListbox tarifaList; + private Combobox cmbMarca; + private Combobox cmbOrigem; + private Combobox cmbDestino; + private Combobox cmbMoneda; + private Combobox cmbClaseServicio; + private Combobox cmbVigenciaTarifa; + private Combobox cmbCategoria; + private Combobox cmbTipoPontoVenta; + private static final Logger log = Logger.getLogger(BusquedaTarifaController.class); + + public List getLsVigencias() { + return lsVigencias; + } + + public void setLsVigencias(List lsVigencias) { + this.lsVigencias = lsVigencias; + } + + public Combobox getCmbVigenciaTarifa() { + return cmbVigenciaTarifa; + } + + public void setCmbVigenciaTarifa(Combobox cmbVigenciaTarifa) { + this.cmbVigenciaTarifa = cmbVigenciaTarifa; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Combobox getCmbMoneda() { + return cmbMoneda; + } + + public void setCmbMoneda(Combobox cmbMoneda) { + this.cmbMoneda = cmbMoneda; + } + + public List getLsClaseServico() { + return lsClaseServico; + } + + public void setLsClaseServico(List lsClaseServico) { + this.lsClaseServico = lsClaseServico; + } + + public List getLsMarcas() { + return lsMarcas; + } + + public void setLsMarcas(List lsMarcas) { + this.lsMarcas = lsMarcas; + } + + public List getLsMonedas() { + return lsMonedas; + } + + public void setLsMonedas(List lsMonedas) { + this.lsMonedas = lsMonedas; + } + + public List getLsTramos() { + return lsTramos; + } + + public void setLsTramos(List lsTramos) { + this.lsTramos = lsTramos; + } + + public MyListbox getTarifaList() { + return tarifaList; + } + + public void setTarifaList(MyListbox tarifaList) { + this.tarifaList = tarifaList; + } + + public List getLsCategoria() { + return lsCategoria; + } + + public void setLsCategoria(List lsCategoria) { + this.lsCategoria = lsCategoria; + } + + public List getLsTipoPontoVenta() { + return lsTipoPontoVenta; + } + + public void setLsTipoPontoVenta(List lsTipoPontoVenta) { + this.lsTipoPontoVenta = lsTipoPontoVenta; + } + + public Combobox getCmbCategoria() { + return cmbCategoria; + } + + public void setCmbCategoria(Combobox cmbCategoria) { + this.cmbCategoria = cmbCategoria; + } + + public Combobox getCmbTipoPontoVenta() { + return cmbTipoPontoVenta; + } + + public void setCmbTipoPontoVenta(Combobox cmbTipoPontoVenta) { + this.cmbTipoPontoVenta = cmbTipoPontoVenta; + } + + public void onClick$btnPesquisa(Event ev) { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTarifa(new Tarifa()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tarifaList.setItemRenderer(new RenderTarifa()); + tarifaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Tarifa t = (Tarifa) tarifaList.getSelected(); + verTarifa(t); + } + }); + + lsMarcas = new ArrayList(); + lsMarcas.add(null); + lsMarcas.addAll(marcaService.obtenerTodos()); + + lsClaseServico = new ArrayList(); + lsClaseServico.add(null); + lsClaseServico.addAll(claseServicioService.obtenerTodos()); + + lsMonedas = new ArrayList(); + lsMonedas.add(null); + lsMonedas.addAll(monedaService.obtenerTodos()); + + lsVigencias = new ArrayList(); + lsVigencias.add(null); + lsVigencias.addAll(vigenciaTarifaService.obtenerTodos()); + + lsCategoria = new ArrayList(); + lsCategoria.add(null); + lsCategoria.addAll(categoriaService.obtenerTodos()); + + lsTipoPontoVenta = new ArrayList(); + lsTipoPontoVenta.add(null); + lsTipoPontoVenta.addAll(tipoPuntoVentaService.obtenerTodos()); + + refreshLista(); + } + + private void verTarifa(Tarifa t) { + if (t == null) { + return; + } + + Map args = new HashMap(); + args.put("tarifa", t); + args.put("tarifaList", tarifaList); + + openWindow("/gui/tarifas/editarTarifas.zul", + Labels.getLabel("editarTarifaController.window.title"), args, MODAL); + } + + private void refreshLista() { + Moneda moneda = (Moneda) (cmbMoneda.getSelectedItem() != null ? cmbMoneda.getSelectedItem().getValue() : null); + Marca marca = (Marca) (cmbMarca.getSelectedItem() != null ? cmbMarca.getSelectedItem().getValue() : null); + ClaseServicio claseServicio = (ClaseServicio) (cmbClaseServicio.getSelectedItem() != null ? cmbClaseServicio.getSelectedItem().getValue() : null); + VigenciaTarifa vigenciaTarifa = (VigenciaTarifa) (cmbVigenciaTarifa.getSelectedItem() != null ? cmbVigenciaTarifa.getSelectedItem().getValue() : null); + Categoria categoria = (Categoria) (cmbCategoria.getSelectedItem() != null ? cmbCategoria.getSelectedItem().getValue() : null); + TipoPuntoVenta tipoPuntoVenta = (TipoPuntoVenta) (cmbTipoPontoVenta.getSelectedItem() != null ? cmbTipoPontoVenta.getSelectedItem().getValue() : null); + Parada origem = (Parada) (cmbOrigem.getSelectedItem() != null ? cmbOrigem.getSelectedItem().getValue() : null); + Parada destino = (Parada) (cmbDestino.getSelectedItem() != null ? cmbDestino.getSelectedItem().getValue() : null); + + if ((moneda == null) && (!cmbMoneda.getText().isEmpty())) { + try { + Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Moneda.", + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } catch (Exception ex) { + log.error(ex); + } + } + + if ((marca == null) && (!cmbMarca.getText().isEmpty())) { + try { + Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Marca.", + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } catch (Exception ex) { + log.error(ex); + } + } + + if ((claseServicio == null) && (!cmbClaseServicio.getText().isEmpty())) { + try { + Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Clase servicio.", + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } catch (Exception ex) { + log.error(ex); + } + } + + if ((vigenciaTarifa == null) && (!cmbVigenciaTarifa.getText().isEmpty())) { + try { + Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Vigencia Tarifa.", + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } catch (Exception ex) { + log.error(ex); + } + } + + if ((origem == null) && (!cmbOrigem.getText().isEmpty())) { + try { + Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Origen.", + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } catch (Exception ex) { + log.error(ex); + } + } + + if ((destino == null) && (!cmbDestino.getText().isEmpty())) { + try { + Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Destino.", + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } catch (Exception ex) { + log.error(ex); + } + } + + if ((tipoPuntoVenta == null) && (!cmbTipoPontoVenta.getText().isEmpty())) { + try { + Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Tipo Punto de Venta.", + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } catch (Exception ex) { + log.error(ex); + } + } + + if ((categoria == null) && (!cmbCategoria.getText().isEmpty())) { + try { + Messagebox.show(Labels.getLabel("MSG.SELECCIONE.VALOR.CORRECTO") + " Tipo de Pasajero.", + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } catch (Exception ex) { + log.error(ex); + } + } + + HibernateSearchObject tarifaBusqueda = + new HibernateSearchObject(Tarifa.class, pagingTarifa.getPageSize()); + tarifaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + tarifaBusqueda.addFilterEqual("moneda", moneda); + tarifaBusqueda.addFilterEqual("marca", marca); + tarifaBusqueda.addFilterEqual("claseServicio", claseServicio); + tarifaBusqueda.addFilterEqual("vigenciaTarifa", vigenciaTarifa); + tarifaBusqueda.addFilterEqual("tramo.origem", origem); + tarifaBusqueda.addFilterEqual("tramo.destino", destino); + + if (categoria != null) { + tarifaBusqueda.addFilterSome("lsTarifaCategoria", + Filter.equal("categoria.categoriaId", categoria.getCategoriaId())); + } + + if (tipoPuntoVenta != null) { + tarifaBusqueda.addFilterSome("lsTarifaTipoptovta", + Filter.equal("tipoPuntoVenta.tipoptovtaId", + tipoPuntoVenta.getTipoptovtaId())); + } + + plwTarifa.init(tarifaBusqueda, tarifaList, pagingTarifa); + if (tarifaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTarifasMinimasController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTarifasMinimasController.java new file mode 100644 index 000000000..20cfa16cc --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaTarifasMinimasController.java @@ -0,0 +1,236 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.entidad.TarifaMinima; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.PlazaService; +import com.rjconsultores.ventaboletos.service.TarifaMinimaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTarifaMinima; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Paging; + +/** + * + * @author rodrigo + */ +@Controller("busquedaTarifasMinimasController") +@Scope("prototype") +public class BusquedaTarifasMinimasController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwTarifaMinima; + @Autowired + private MarcaService marcaService; + @Autowired + private ParadaService paradaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private TarifaMinimaService tarifaMinimaService; + @Autowired + private PlazaService plazaService; + private List lsMarcas; + private List lsClaseServico; + private List lsPlaza; + private MyListbox tarifaMinimaList; + private Paging pagingTarifaMinima; + private Combobox cmbMarca; + private Combobox cmbOrigem; + private Combobox cmbDestino; + private Combobox cmbClaseServicio; + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Combobox getCmbDestino() { + return cmbDestino; + } + + public void setCmbDestino(Combobox cmbDestino) { + this.cmbDestino = cmbDestino; + } + + public List getLsPlaza() { + return lsPlaza; + } + + public void setLsPlaza(List lsPlaza) { + this.lsPlaza = lsPlaza; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Combobox getCmbOrigem() { + return cmbOrigem; + } + + public void setCmbOrigem(Combobox cmbOrigem) { + this.cmbOrigem = cmbOrigem; + } + + public Paging getPagingTarifaMinima() { + return pagingTarifaMinima; + } + + public void setPagingTarifaMinima(Paging pagingTarifaMinima) { + this.pagingTarifaMinima = pagingTarifaMinima; + } + + public PagedListWrapper getPlwTarifaMinima() { + return plwTarifaMinima; + } + + public void setPlwTarifaMinima(PagedListWrapper plwTarifaMinima) { + this.plwTarifaMinima = plwTarifaMinima; + } + + public MyListbox getTarifaMinimaList() { + return tarifaMinimaList; + } + + public void setTarifaMinimaList(MyListbox tarifaMinimaList) { + this.tarifaMinimaList = tarifaMinimaList; + } + + public List getLsClaseServico() { + return lsClaseServico; + } + + public void setLsClaseServico(List lsClaseServico) { + this.lsClaseServico = lsClaseServico; + } + + public List getLsMarcas() { + return lsMarcas; + } + + public void setLsMarcas(List lsMarcas) { + this.lsMarcas = lsMarcas; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verTarifaMinima(new TarifaMinima()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tarifaMinimaList.setItemRenderer(new RenderTarifaMinima()); + tarifaMinimaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + TarifaMinima tf = (TarifaMinima) tarifaMinimaList.getSelected(); + verTarifaMinima(tf); + } + }); + + lsMarcas = new ArrayList(); + lsMarcas.add(null); + lsMarcas.addAll(marcaService.obtenerTodos()); + + lsClaseServico = new ArrayList(); + lsClaseServico.add(null); + lsClaseServico.addAll(claseServicioService.obtenerTodos()); + + lsPlaza = new ArrayList(); + lsPlaza.add(null); + lsPlaza.addAll(plazaService.obtenerTodos()); + + refreshLista(); + } + + private void verTarifaMinima(TarifaMinima tf) { + if (tf == null) { + return; + } + + Map args = new HashMap(); + args.put("tarifaMinima", tf); + args.put("tarifaMinimaList", tarifaMinimaList); + + openWindow("/gui/tarifas/editarTarifasMinimas.zul", + Labels.getLabel("editarTarifaMinimaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject tarifaMinimaBusqueda = + new HibernateSearchObject(TarifaMinima.class, pagingTarifaMinima.getPageSize()); + tarifaMinimaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + Parada origem = (Parada) (cmbOrigem.getSelectedItem() != null ? cmbOrigem.getSelectedItem().getValue() : null); + if (origem != null) { + tarifaMinimaBusqueda.addFilterEqual("origem", origem); + } + Parada destino = (Parada) (cmbDestino.getSelectedItem() != null ? cmbDestino.getSelectedItem().getValue() : null); + if (destino != null) { + tarifaMinimaBusqueda.addFilterEqual("destino", destino); + } + Marca marca = (Marca) (cmbMarca.getSelectedItem() != null ? cmbMarca.getSelectedItem().getValue() : null); + if (marca != null) { + tarifaMinimaBusqueda.addFilterEqual("marca", marca); + } + ClaseServicio claseServicio = (ClaseServicio) (cmbClaseServicio.getSelectedItem() != null ? cmbClaseServicio.getSelectedItem().getValue() : null); + if (claseServicio != null) { + tarifaMinimaBusqueda.addFilterEqual("claseServicio", claseServicio); + } + + plwTarifaMinima.init(tarifaMinimaBusqueda, tarifaMinimaList, pagingTarifaMinima); + + if (tarifaMinimaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaTarifasMinimasController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } + + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaVigenciaTarifaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaVigenciaTarifaController.java new file mode 100644 index 000000000..d68a9b8a5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/BusquedaVigenciaTarifaController.java @@ -0,0 +1,139 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.service.VigenciaTarifaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderVigenciaTarifa; +import java.util.HashMap; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Datebox; +import org.zkoss.zul.Paging; + +/** + * + * @author rodrigo + */ +@Controller("busquedaVigenciaTarifaController") +@Scope("prototype") +public class BusquedaVigenciaTarifaController extends MyGenericForwardComposer { + + @Autowired + private transient PagedListWrapper plwVigenciaTarifa; + @Autowired + private VigenciaTarifaService vigenciaTarifaService; + private MyListbox vigenciaList; + private Paging pagingVigencia; + private Datebox fecInicio; + private Datebox fecFinal; + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public Paging getPagingVigencia() { + return pagingVigencia; + } + + public void setPagingVigencia(Paging pagingVigencia) { + this.pagingVigencia = pagingVigencia; + } + + public MyListbox getVigenciaList() { + return vigenciaList; + } + + public void setVigenciaList(MyListbox vigenciaList) { + this.vigenciaList = vigenciaList; + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + refreshLista(); + } + + public void onClick$btnRefresh(Event ev) { + refreshLista(); + } + + public void onClick$btnNovo(Event ev) { + verVigencia(new VigenciaTarifa()); + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + vigenciaList.setItemRenderer(new RenderVigenciaTarifa()); + vigenciaList.addEventListener("onDoubleClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + VigenciaTarifa vt = (VigenciaTarifa) vigenciaList.getSelected(); + verVigencia(vt); + } + }); + + refreshLista(); + } + + private void verVigencia(VigenciaTarifa vt) { + if (vt == null) { + return; + } + + Map args = new HashMap(); + args.put("vigenciaTarifa", vt); + args.put("vigenciaList", vigenciaList); + + openWindow("/gui/tarifas/editarVigenciaTarifa.zul", + Labels.getLabel("editarVigenciaTarifaController.window.title"), args, MODAL); + } + + private void refreshLista() { + HibernateSearchObject vigenciaTarifaBusqueda = + new HibernateSearchObject(VigenciaTarifa.class, pagingVigencia.getPageSize()); + vigenciaTarifaBusqueda.addFilterEqual("activo", Boolean.TRUE); + + vigenciaTarifaBusqueda.addFilterGreaterOrEqual("feciniciovigencia", fecInicio.getValue()); + vigenciaTarifaBusqueda.addFilterLessOrEqual("fecfinvigencia", fecFinal.getValue()); + + vigenciaTarifaBusqueda.addSortAsc("feciniciovigencia"); + + plwVigenciaTarifa.init(vigenciaTarifaBusqueda, vigenciaList, pagingVigencia); + + if (vigenciaList.getData().length == 0) { + try { + Messagebox.show(Labels.getLabel("MSG.ningunRegistro"), + Labels.getLabel("busquedaVigenciaTarifaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } catch (InterruptedException ex) { + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/CambioVigenciaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/CambioVigenciaController.java new file mode 100644 index 000000000..b14baa356 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/CambioVigenciaController.java @@ -0,0 +1,119 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Tarifa; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.service.TarifaService; +import com.rjconsultores.ventaboletos.service.VigenciaTarifaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author rodrigo + */ +@Controller("cambioVigenciaController") +@Scope("prototype") +public class CambioVigenciaController extends MyGenericForwardComposer { + + @Autowired + private TarifaService tarifaService; + @Autowired + private VigenciaTarifaService vigenciaTarifaService; + private List lsVigenciaTarifa; + private Combobox cmbVigencia; + private Combobox cmbNovaVigencia; + private static Logger log = Logger.getLogger(CambioVigenciaController.class); + + public Combobox getCmbNovaVigencia() { + return cmbNovaVigencia; + } + + public void setCmbNovaVigencia(Combobox cmbNovaVigencia) { + this.cmbNovaVigencia = cmbNovaVigencia; + } + + public Combobox getCmbVigencia() { + return cmbVigencia; + } + + public void setCmbVigencia(Combobox cmbVigencia) { + this.cmbVigencia = cmbVigencia; + } + + public List getLsVigenciaTarifa() { + return lsVigenciaTarifa; + } + + public void setLsVigenciaTarifa(List lsVigenciaTarifa) { + this.lsVigenciaTarifa = lsVigenciaTarifa; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsVigenciaTarifa = vigenciaTarifaService.obtenerTodos(); + + super.doAfterCompose(comp); + } + + public void onClick$btnCambiarVigencia(Event ev) { + cmbVigencia.getSelectedItem(); + cmbNovaVigencia.getSelectedItem(); + + try { + VigenciaTarifa vigencia = (VigenciaTarifa) (cmbVigencia.getSelectedItem() != null ? cmbVigencia.getSelectedItem().getValue() : null); + VigenciaTarifa novaVigencia = (VigenciaTarifa) (cmbNovaVigencia.getSelectedItem() != null ? cmbNovaVigencia.getSelectedItem().getValue() : null); + List lsTarifas = tarifaService.buscarPorVigencia(vigencia); + + String msg = lsTarifas.size() + " tarifas. Vigencia " + + vigencia + " -> " + novaVigencia; + Integer opcao = Messagebox.show(msg + ". " + + Labels.getLabel("cambioVigenciaController.MSGCambiarVigencias"), + Labels.getLabel("cambioVigenciaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (opcao.equals(Messagebox.YES)) { + for (Tarifa tf : lsTarifas) { + tf.setVigenciaTarifa(novaVigencia); + Marca marca = tf.getMarca(); + Tramo tramo = tf.getTramo(); + Moneda moneda = tf.getMoneda(); + ClaseServicio claseServicio = tf.getClaseServicio(); + VigenciaTarifa vigenciaTarifa = tf.getVigenciaTarifa(); + + List lsExisteTarifa = + tarifaService.pesquisar(marca, tramo, moneda, + claseServicio, vigenciaTarifa); + if (lsExisteTarifa.isEmpty()) { + tarifaService.actualizacion(tf); + } + } + } + + Messagebox.show( + Labels.getLabel("cambioVigenciaController.MSGCambiarSucesso"), + Labels.getLabel("cambioVigenciaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarExceptionRedondoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarExceptionRedondoController.java new file mode 100644 index 000000000..c343a8281 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarExceptionRedondoController.java @@ -0,0 +1,185 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.ExcepcionRedondo; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.exception.BusinessException; +import com.rjconsultores.ventaboletos.service.ExcepcionRedondoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Radio; + +/** + * + * @author Administrador + */ +@Controller("editarExceptionRedondoController") +@Scope("prototype") +public class EditarExceptionRedondoController extends MyGenericForwardComposer { + + @Autowired + private ExcepcionRedondoService excepcionRedondoService; + private ExcepcionRedondo excepcionRedondo; + private MyListbox excepcionRedondoList; + private Button btnApagar; + private MyComboboxParada cmbOrigem; + private MyComboboxParada cmbDestino; + private Radio radioA; + private Radio radioC; + private static Logger log = Logger.getLogger(EditarExceptionRedondoController.class); + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public MyComboboxParada getCmbDestino() { + return cmbDestino; + } + + public void setCmbDestino(MyComboboxParada cmbDestino) { + this.cmbDestino = cmbDestino; + } + + public MyComboboxParada getCmbOrigem() { + return cmbOrigem; + } + + public void setCmbOrigem(MyComboboxParada cmbOrigem) { + this.cmbOrigem = cmbOrigem; + } + + public ExcepcionRedondo getExcepcionRedondo() { + return excepcionRedondo; + } + + public void setExcepcionRedondo(ExcepcionRedondo excepcionRedondo) { + this.excepcionRedondo = excepcionRedondo; + } + + public Radio getRadioA() { + return radioA; + } + + public void setRadioA(Radio radioA) { + this.radioA = radioA; + } + + public Radio getRadioC() { + return radioC; + } + + public void setRadioC(Radio radioC) { + this.radioC = radioC; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + excepcionRedondo = (ExcepcionRedondo) Executions.getCurrent().getArg().get("excepcionRedondo"); + excepcionRedondoList = (MyListbox) Executions.getCurrent().getArg().get("excepcionRedondoList"); + + if (excepcionRedondo.getExcepcionredondoId() == null) { + btnApagar.setVisible(Boolean.FALSE); + radioA.setChecked(true); + excepcionRedondo.setIndtipo("A"); + } else { + Parada origem = excepcionRedondo.getOrigem(); + if (origem != null) { + cmbOrigem.setText(origem.getDescparada()); + } + + Parada destino = excepcionRedondo.getDestino(); + if (destino != null) { + cmbDestino.setText(destino.getDescparada()); + } + + if (excepcionRedondo.getIndtipo().equals("A")) { + radioA.setChecked(true); + } else { + radioC.setChecked(true); + } + } + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + excepcionRedondo.setFecmodif(Calendar.getInstance().getTime()); + excepcionRedondo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + excepcionRedondo.setActivo(Boolean.TRUE); + + cmbOrigem.getValue(true); + cmbDestino.getValue(true); + + try { + + + if (excepcionRedondo.getExcepcionredondoId() == null) { + excepcionRedondo = excepcionRedondoService.suscribirActualizar(excepcionRedondo); + excepcionRedondoList.addItem(excepcionRedondo); + } else { + excepcionRedondo = excepcionRedondoService.suscribirActualizar(excepcionRedondo); + excepcionRedondoList.updateItem(excepcionRedondo); + } + Messagebox.show(Labels.getLabel("editarExceptionRedondoController.btnFechar.MSG.SuscbrirOK"), + Labels.getLabel("editarExceptionRedondoController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + + } catch (BusinessException ex) { + Messagebox.show(ex.getMessage(), Labels.getLabel("editarExceptionRedondoController.window.title"), Messagebox.OK, + Messagebox.EXCLAMATION); + } + } + + public void onClick$btnApagar(Event ev) { + excepcionRedondo.setFecmodif(Calendar.getInstance().getTime()); + excepcionRedondo.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + excepcionRedondo.setActivo(Boolean.TRUE); + + try { + int opcao = Messagebox.show(Labels.getLabel("editarExceptionRedondoController.btnFechar.MSG.Deseja.Borrar"), + Labels.getLabel("editarExceptionRedondoController.window.title"), Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (opcao == Messagebox.YES) { + excepcionRedondoService.borrar(excepcionRedondo); + excepcionRedondoList.removeItem(excepcionRedondo); + + Messagebox.show(Labels.getLabel("editarExceptionRedondoController.btnFechar.MSG.BorrarOK"), + Labels.getLabel("editarExceptionRedondoController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$radioA(Event ev) { + excepcionRedondo.setIndtipo("A"); + } + + public void onClick$radioC(Event ev) { + excepcionRedondo.setIndtipo("C"); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarMercadoCompetidoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarMercadoCompetidoController.java new file mode 100644 index 000000000..07cf8a057 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarMercadoCompetidoController.java @@ -0,0 +1,242 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.MercadoCompetido; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.MercadoCompetidoService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; + +/** + * + * @author rodrigo + */ +@Controller("editarMercadoCompetidoController") +@Scope("prototype") +public class EditarMercadoCompetidoController extends MyGenericForwardComposer { + + @Autowired + private MercadoCompetidoService mercadoCompetidoService; + @Autowired + private ClaseServicioService claseServicioService; + private List lsClaseServicio; + private MercadoCompetido mercadoCompetido; + private MyListbox mercadoCompetidoList; + private Button btnApagar; + private Combobox cmbClaseServicio; + private MyComboboxParada cmbOrigem; + private MyComboboxParada cmbDestino; + private static Logger log = Logger.getLogger(EditarMercadoCompetidoController.class); + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public List getLsClaseServicio() { + return lsClaseServicio; + } + + public void setLsClaseServicio(List lsClaseServicio) { + this.lsClaseServicio = lsClaseServicio; + } + + public MercadoCompetido getMercadoCompetido() { + return mercadoCompetido; + } + + public void setMercadoCompetido(MercadoCompetido mercadoCompetido) { + this.mercadoCompetido = mercadoCompetido; + } + + public MyComboboxParada getCmbDestino() { + return cmbDestino; + } + + public void setCmbDestino(MyComboboxParada cmbDestino) { + this.cmbDestino = cmbDestino; + } + + public MyComboboxParada getCmbOrigem() { + return cmbOrigem; + } + + public void setCmbOrigem(MyComboboxParada cmbOrigem) { + this.cmbOrigem = cmbOrigem; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + MercadoCompetido mercadoCompetidoS = (MercadoCompetido) Executions.getCurrent().getArg().get("mercadoCompetido"); + mercadoCompetido = (mercadoCompetidoS.getMercadocompetidoId() == null) ? mercadoCompetidoS : mercadoCompetidoService.obtenerID(mercadoCompetidoS.getMercadocompetidoId()); + mercadoCompetidoList = (MyListbox) Executions.getCurrent().getArg().get("mercadoCompetidoList"); + + lsClaseServicio = claseServicioService.obtenerTodos(); + // Leticia- Nao pode ter opção TODOS + Short menosUm = -1; + ClaseServicio cs = claseServicioService.obtenerID(menosUm); + if (cs != null) { + lsClaseServicio.remove(cs); + } + + if (mercadoCompetido.getMercadocompetidoId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + Parada origem = mercadoCompetido.getOrigem(); + if (origem != null) { + cmbOrigem.setInitialValue(origem); + cmbOrigem.setText(origem.getDescparada()); + } + + Parada destino = mercadoCompetido.getDestino(); + if (destino != null) { + cmbDestino.setInitialValue(destino); + cmbDestino.setText(destino.getDescparada()); + } + } + + cmbClaseServicio.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + cmbClaseServicio.getValue(); + cmbOrigem.getValue(true); + cmbDestino.getValue(true); + + mercadoCompetido.setFecmodif(Calendar.getInstance().getTime()); + mercadoCompetido.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + mercadoCompetido.setActivo(Boolean.TRUE); + + Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem(); + ClaseServicio claseServicio = null; + if (cbiClaseServicio != null) { + claseServicio = (ClaseServicio) cbiClaseServicio.getValue(); + } + + Parada origem = (Parada) (cmbOrigem.getSelectedItem() == null ? null : cmbOrigem.getSelectedItem().getValue()); + // if (origem != null) { + // mercadoCompetido.setOrigem(origem); + // } else { + // Messagebox.show( + // Labels.getLabel("MSG.necesita.origen"), + // Labels.getLabel(".window.title"), + // Messagebox.OK, Messagebox.EXCLAMATION); + // return; + // } + // + Parada destino = (Parada) (cmbDestino.getSelectedItem() == null ? null : cmbDestino.getSelectedItem().getValue()); + // if (destino != null) { + // mercadoCompetido.setDestino(destino); + // } else { + // Messagebox.show( + // Labels.getLabel("MSG.necesita.destino"), + // Labels.getLabel(".window.title"), + // Messagebox.OK, Messagebox.EXCLAMATION); + // return; + // } + + try { + if (!origem.getParadaId().equals(destino.getParadaId())) { + if (mercadoCompetido.getMercadocompetidoId() == null) { + boolean existeMercadoCompetido = mercadoCompetidoService.existe(claseServicio, origem, destino); + + if (!existeMercadoCompetido) { + mercadoCompetidoService.suscribir(mercadoCompetido); + mercadoCompetidoList.updateItem(mercadoCompetido); + + Messagebox.show( + Labels.getLabel("editarMercadoCompetidoController.btnFechar.MSG.SuscbrirOK"), + Labels.getLabel("editarMercadoCompetidoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarMercadoCompetidoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + mercadoCompetidoService.actualizacion(mercadoCompetido); + mercadoCompetidoList.addItem(mercadoCompetido); + + Messagebox.show( + Labels.getLabel("editarMercadoCompetidoController.btnFechar.MSG.SuscbrirOK"), + Labels.getLabel("editarMercadoCompetidoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } else { + Messagebox.show( + Labels.getLabel("MSG.Origem.Igual.Destino"), + Labels.getLabel("editarMercadoCompetidoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + mercadoCompetido.setFecmodif(Calendar.getInstance().getTime()); + mercadoCompetido.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + mercadoCompetido.setActivo(Boolean.TRUE); + + try { + int opcao = Messagebox.show( + Labels.getLabel("editarMercadoCompetidoController.btnFechar.MSG.Deseja.Borrar"), + Labels.getLabel("editarMercadoCompetidoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (opcao == Messagebox.YES) { + mercadoCompetidoService.borrar(mercadoCompetido); + mercadoCompetidoList.removeItem(mercadoCompetido); + + Messagebox.show( + Labels.getLabel("editarMercadoCompetidoController.btnFechar.MSG.BorrarOK"), + Labels.getLabel("editarMercadoCompetidoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarRedondeoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarRedondeoController.java new file mode 100644 index 000000000..9cce7dbb3 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarRedondeoController.java @@ -0,0 +1,563 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Tab; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Redondeo; +import com.rjconsultores.ventaboletos.entidad.RedondeoCtrl; +import com.rjconsultores.ventaboletos.entidad.RedondeoMarca; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.RedondeoCtrlService; +import com.rjconsultores.ventaboletos.service.RedondeoMarcaService; +import com.rjconsultores.ventaboletos.service.RedondeoService; +import com.rjconsultores.ventaboletos.utilerias.TraslaparUtil; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRedondeo; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRedondeoMarca; + +/** + * + * @author Administrador + */ +@Controller("editarRedondeoController") +@Scope("prototype") +public class EditarRedondeoController extends MyGenericForwardComposer { + + @Autowired + private RedondeoService redondeoService; + @Autowired + private RedondeoCtrlService redondeoCtrlService; + @Autowired + private RedondeoMarcaService redondeoMarcaService; + @Autowired + private MarcaService marcaService; + private Redondeo redondeo; + private RedondeoCtrl redondeoCtrl; + private MyListbox redondeoCtrlList; + private MyListbox redondeoList; + private MyListbox redondeoMarcaList; + private Button btnApagar; + private List lsMarca; + private List lsRedondeo; + private List lsRedondeoMarca; + private Textbox txtValorinicial; + private Textbox txtValorfinal; + private Textbox txtValorredondeo; + private Tab tabGeneral; + private Tab tabMarca; + private Combobox cmbMarca; + private Checkbox chkIndaplicadescuento; + private Checkbox chkIndaplicapricing; + private static Logger log = Logger.getLogger(EditarRedondeoController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsMarca = marcaService.obtenerTodos(); + + super.doAfterCompose(comp); + + redondeoCtrl = (RedondeoCtrl) Executions.getCurrent().getArg().get("redondeoCtrl"); + redondeoCtrlList = (MyListbox) Executions.getCurrent().getArg().get("redondeoCtrlList"); + + + redondeoList.setItemRenderer(new RenderRedondeo()); + lsRedondeo = new ArrayList(); + + redondeoMarcaList.setItemRenderer(new RenderRedondeoMarca()); + lsRedondeoMarca = new ArrayList(); + + if (redondeoCtrl.getRedondeoctrlId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + chkIndaplicadescuento.setChecked(redondeoCtrl.getIndaplicadescuento()); + chkIndaplicapricing.setChecked(redondeoCtrl.getIndaplicapricing()); + + redondeoCtrl = redondeoCtrlService.obtenerID(redondeoCtrl.getRedondeoctrlId()); + + lsRedondeo = redondeoCtrl.getRedondeoList(); + redondeoList.setData(lsRedondeo); + + lsRedondeoMarca = redondeoCtrl.getRedondeoMarcaList(); + redondeoMarcaList.setData(lsRedondeoMarca); + } + + txtValorinicial.focus(); + } + + public void onClick$btnSalvar(Event ev) { + redondeoCtrl.setFecmodif(Calendar.getInstance().getTime()); + redondeoCtrl.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + redondeoCtrl.setActivo(Boolean.TRUE); + + Boolean aplicaDescuento = chkIndaplicadescuento.isChecked(); + Boolean aplicaPricing = chkIndaplicapricing.isChecked(); + try { + + if (redondeoList.getData().length == 0) { + tabGeneral.setSelected(Boolean.TRUE); + Messagebox.show( + Labels.getLabel("editarRedondeoController.MSG.necesitaDescuento"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + if (redondeoMarcaList.getData().length == 0) { + tabMarca.setSelected(Boolean.TRUE); + Messagebox.show( + Labels.getLabel("editarRedondeoController.MSG.necesitaMarca"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + redondeoCtrl.setIndaplicadescuento(aplicaDescuento); + redondeoCtrl.setIndaplicapricing(aplicaPricing); + + if (podeSalvar()) { + redondeoCtrl.setIndaplicadescuento(aplicaDescuento); + redondeoCtrl.setIndaplicapricing(aplicaPricing); + + redondeoCtrl.setActivo(Boolean.TRUE); + redondeoCtrl.setFecmodif(Calendar.getInstance().getTime()); + redondeoCtrl.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (redondeoCtrl.getRedondeoctrlId() == null) { + redondeoCtrlService.suscribir(redondeoCtrl); + redondeoCtrlList.addItem(redondeoCtrl); + } else { + redondeoCtrlService.actualizacion(redondeoCtrl); + redondeoCtrlList.updateItem(redondeoCtrl); + } + + Messagebox.show( + Labels.getLabel("editarRedondeoController.MSG.SuscbrirOK"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } catch (Exception ex) { + log.error(ex); + } + } + + public boolean podeSalvar() { + + List lsRedondeoNuevos = redondeoCtrl.getRedondeoList(); + List lsRedondeoMarcaNuevos = redondeoCtrl.getRedondeoMarcaList(); + + Short[] iDMarcas = new Short[lsRedondeoMarcaNuevos.size()]; + for (int i = 0; i < lsRedondeoMarcaNuevos.size(); i++) { + iDMarcas[i] = lsRedondeoMarcaNuevos.get(i).getMarca().getMarcaId().shortValue(); + } + + boolean podeSalvar = true; + + //Traslapa Redondeo + for (Redondeo r : lsRedondeoNuevos) { + List lsCtrl = redondeoCtrlService.buscarTraslapa(iDMarcas, r.getValorinicial(), r.getValorfinal(), redondeoCtrl.getIndaplicadescuento(), redondeoCtrl.getIndaplicapricing()); + if (!lsCtrl.isEmpty()) { + if (redondeoCtrl.getRedondeoctrlId() != null) { + for (RedondeoCtrl rc : lsCtrl) { + if (!rc.getRedondeoctrlId().equals(redondeoCtrl.getRedondeoctrlId())) { + podeSalvar = false; + log.debug("Não pode salvar!"); + } + } + } else { + podeSalvar = false; + } + } + } + + return podeSalvar; + } + + public void onClick$btnApagar(Event ev) { + try { + int opcao = Messagebox.show( + Labels.getLabel("editarRedondeoController.MSG.Deseja.Borrar"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (opcao == Messagebox.YES) { + redondeoCtrl.setFecmodif(Calendar.getInstance().getTime()); + redondeoCtrl.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + redondeoCtrl.setActivo(Boolean.TRUE); + + redondeoCtrlService.borrar(redondeoCtrl); + redondeoCtrlList.removeItem(redondeoCtrl); + + Messagebox.show( + Labels.getLabel("editarRedondeoController.MSG.BorrarOK"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnAdicionarRedondeo(Event ev) throws InterruptedException { + + txtValorinicial.getValue(); + txtValorfinal.getValue(); + txtValorredondeo.getValue(); + + try { + + BigDecimal valorInicial = BigDecimal.valueOf(Double.parseDouble(txtValorinicial.getValue())); + BigDecimal valorFinal = BigDecimal.valueOf(Double.parseDouble(txtValorfinal.getValue())); + + if (valorInicial.doubleValue() > valorFinal.doubleValue()) { + Messagebox.show( + Labels.getLabel("editarRedondeoController.MSG.valores"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + return; + } + + BigDecimal valorRedondeo = new BigDecimal(BigInteger.ZERO); + if (!txtValorredondeo.getValue().equals("")) { + valorRedondeo = BigDecimal.valueOf(Double.parseDouble(txtValorredondeo.getValue())); + } + + boolean existe = true; + + for (Redondeo r : lsRedondeo) { + if (r.getActivo()) { + boolean traslapa = TraslaparUtil.intersectNum(r.getValorinicial(), r.getValorfinal(), valorInicial, valorFinal); + if (traslapa) { + existe = false; + } + } + } + if (existe) { + + Redondeo r = new Redondeo(); + + r.setActivo(Boolean.TRUE); + r.setFecmodif(Calendar.getInstance().getTime()); + r.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + r.setValorinicial(valorInicial); + r.setValorfinal(valorFinal); + r.setValorredondeo(valorRedondeo); + r.setRedondeoCtrl(redondeoCtrl); + + + lsRedondeo.add(r); + redondeoCtrl.setRedondeoList(lsRedondeo); + + redondeoList.setData(new ArrayList()); + List lsTemp = new ArrayList(); + for (Redondeo cc : lsRedondeo) { + if (cc.getActivo()) { + lsTemp.add(cc); + } + } + redondeoList.setData(lsTemp); + + txtValorinicial.setConstraint(""); + txtValorfinal.setConstraint(""); + txtValorredondeo.setConstraint(""); + + txtValorinicial.setText(""); + txtValorfinal.setText(""); + txtValorredondeo.setText(""); + + txtValorinicial.setConstraint("no empty, no zero"); + txtValorfinal.setConstraint("no empty, no zero"); + //txtValorredondeo.setConstraint("no empty"); + } else { + Messagebox.show( + Labels.getLabel("editarRedondeoController.MSG.valoresTraslapa"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } catch (Exception ex) { + log.error("Erro adicionar redondeo : " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagarRedondeo(Event ev) throws InterruptedException { + try { + Redondeo r = (Redondeo) redondeoList.getSelected(); + if (r != null) { + //removo o antigo + lsRedondeo.remove(r); + r.setFecmodif(Calendar.getInstance().getTime()); + r.setActivo(Boolean.FALSE); + r.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + redondeoList.updateItem(r); + redondeoList.removeItem(r); + lsRedondeo.add(r); + + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.selectItem"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error("Erro remover redondeo: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnAdicionarMarca(Event ev) throws InterruptedException { + + cmbMarca.getValue(); + try { + boolean existe = false; + Marca m = (Marca) cmbMarca.getSelectedItem().getValue(); + for (RedondeoMarca rm : lsRedondeoMarca) { + if (rm.getActivo() && rm.getMarca().equals(m)) { + existe = true; + } + } + if (!existe) { + RedondeoMarca rm = new RedondeoMarca(); + + rm.setActivo(Boolean.TRUE); + rm.setFecmodif(Calendar.getInstance().getTime()); + rm.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + rm.setMarca(m); + rm.setRedondeoCtrl(redondeoCtrl); + + lsRedondeoMarca.add(rm); + redondeoCtrl.setRedondeoMarcaList(lsRedondeoMarca); + + redondeoMarcaList.setData(new ArrayList()); + List lsTemp = new ArrayList(); + for (RedondeoMarca cc : lsRedondeoMarca) { + if (cc.getActivo()) { + lsTemp.add(cc); + } + } + redondeoMarcaList.setData(lsTemp); + + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } catch (Exception ex) { + log.error("Erro adicionar redondeo marca : " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagarMarca(Event ev) throws InterruptedException { + try { + RedondeoMarca rm = (RedondeoMarca) redondeoMarcaList.getSelected(); + if (rm != null) { + //removo o antigo +// for (int i = 0; i < lsRedondeoMarca.size(); i++) { +// if (lsRedondeoMarca.get(i).getMarca().equals(rm.getMarca())) { + lsRedondeoMarca.remove(rm); +// } +// } + rm.setFecmodif(Calendar.getInstance().getTime()); + rm.setActivo(Boolean.FALSE); + rm.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + redondeoMarcaList.removeItem(rm); + lsRedondeoMarca.add(rm); + + } else { + Messagebox.show( + Labels.getLabel("editarConfiguracionCategoriaController.MSG.selectItem"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error("Erro remover redondeo Marca: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarRedondeoController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Checkbox getChkIndaplicadescuento() { + return chkIndaplicadescuento; + } + + public void setChkIndaplicadescuento(Checkbox chkIndaplicadescuento) { + this.chkIndaplicadescuento = chkIndaplicadescuento; + } + + public Checkbox getChkIndaplicapricing() { + return chkIndaplicapricing; + } + + public void setChkIndaplicapricing(Checkbox chkIndaplicapricing) { + this.chkIndaplicapricing = chkIndaplicapricing; + } + + public Redondeo getRedondeo() { + return redondeo; + } + + public void setRedondeo(Redondeo redondeo) { + this.redondeo = redondeo; + } + + public Textbox getTxtValorfinal() { + return txtValorfinal; + } + + public void setTxtValorfinal(Textbox txtValorfinal) { + this.txtValorfinal = txtValorfinal; + } + + public Textbox getTxtValorinicial() { + return txtValorinicial; + } + + public void setTxtValorinicial(Textbox txtValorinicial) { + this.txtValorinicial = txtValorinicial; + } + + public Textbox getTxtValorredondeo() { + return txtValorredondeo; + } + + public void setTxtValorredondeo(Textbox txtValorredondeo) { + this.txtValorredondeo = txtValorredondeo; + } + + public List getLsMarca() { + return lsMarca; + } + + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + public List getLsRedondeo() { + return lsRedondeo; + } + + public void setLsRedondeo(List lsRedondeo) { + this.lsRedondeo = lsRedondeo; + } + + public List getLsRedondeoMarca() { + return lsRedondeoMarca; + } + + public void setLsRedondeoMarca(List lsRedondeoMarca) { + this.lsRedondeoMarca = lsRedondeoMarca; + } + + public MarcaService getMarcaService() { + return marcaService; + } + + public void setMarcaService(MarcaService marcaService) { + this.marcaService = marcaService; + } + + public RedondeoCtrl getRedondeoCtrl() { + return redondeoCtrl; + } + + public void setRedondeoCtrl(RedondeoCtrl redondeoCtrl) { + this.redondeoCtrl = redondeoCtrl; + } + + public MyListbox getRedondeoCtrlList() { + return redondeoCtrlList; + } + + public void setRedondeoCtrlList(MyListbox redondeoCtrlList) { + this.redondeoCtrlList = redondeoCtrlList; + } + + public RedondeoCtrlService getRedondeoCtrlService() { + return redondeoCtrlService; + } + + public void setRedondeoCtrlService(RedondeoCtrlService redondeoCtrlService) { + this.redondeoCtrlService = redondeoCtrlService; + } + + public MyListbox getRedondeoList() { + return redondeoList; + } + + public void setRedondeoList(MyListbox redondeoList) { + this.redondeoList = redondeoList; + } + + public MyListbox getRedondeoMarcaList() { + return redondeoMarcaList; + } + + public void setRedondeoMarcaList(MyListbox redondeoMarcaList) { + this.redondeoMarcaList = redondeoMarcaList; + } + + public RedondeoService getRedondeoService() { + return redondeoService; + } + + public void setRedondeoService(RedondeoService redondeoService) { + this.redondeoService = redondeoService; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTarifaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTarifaController.java new file mode 100644 index 000000000..e2a6d1c92 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTarifaController.java @@ -0,0 +1,613 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.MercadoCompetido; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.entidad.Tarifa; +import com.rjconsultores.ventaboletos.entidad.TarifaCategoria; +import com.rjconsultores.ventaboletos.entidad.TarifaTipoptovta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.service.CategoriaService; +import com.rjconsultores.ventaboletos.service.CiudadService; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.MercadoCompetidoService; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.service.TarifaCategoriaService; +import com.rjconsultores.ventaboletos.service.TarifaService; +import com.rjconsultores.ventaboletos.service.TarifaTipoptovtaService; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; +import com.rjconsultores.ventaboletos.service.TramoService; +import com.rjconsultores.ventaboletos.service.VigenciaTarifaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTarifaCategoria; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTarifaTipoPuntoVenta; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Textbox; + +/** + * + * @author rodrigo + */ +@Controller("editarTarifaController") +@Scope("prototype") +public class EditarTarifaController extends MyGenericForwardComposer { + + @Autowired + private TarifaService tarifaService; + @Autowired + private CiudadService ciudadService; + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private TramoService tramoService; + @Autowired + private MonedaService monedaService; + @Autowired + private VigenciaTarifaService vigenciaTarifaService; + @Autowired + private CategoriaService categoriaService; + @Autowired + private TipoPuntoVentaService tipoPuntoVentaService; + @Autowired + private TarifaCategoriaService tarifaCategoriaService; + @Autowired + private TarifaTipoptovtaService tarifaTipoptovtaService; + @Autowired + private MercadoCompetidoService mercadoCompetidoService; + private Tarifa tarifa; + private MyListbox tarifaList; + private MyListbox tarifaCategoriaList; + private MyListbox tarifaTipoPontoVentaList; + private Combobox cmbTramo; + private Combobox cmbClaseServicio; + private Combobox cmbMarca; + private Combobox cmbCategoria; + private Combobox cmbTipoPontoVenta; + private Combobox cmbVigencia; + private MyTextboxDecimal dbPrecioAbiertoTarifaCategoria; + private MyTextboxDecimal dbPrecioTarifaCategoria; + private MyTextboxDecimal dbPrecioTipoPuntoVenta; + private MyTextboxDecimal dbPrecioAbiertoTipoPuntoVenta; + private MyTextboxDecimal txtPrecio; + private MyTextboxDecimal txtPrecioOriginal; + private MyTextboxDecimal txtPrecioRedAbierto; + private Textbox txtDescripcionTramo; + private List lsMarcas; + private List lsClaseServico; + private List lsTramos; + private List lsMonedas; + private List lsVigenciaTarifa; + private List lsCategoria; + private List lsTarifaCategoria; + private List lsTarifaTipoPontoVenta; + private List lsTipoPontoVenta; + private Button btnApagar; + private static Logger log = Logger.getLogger(EditarTarifaController.class); + + public Combobox getCmbVigencia() { + return cmbVigencia; + } + + public void setCmbVigencia(Combobox cmbVigencia) { + this.cmbVigencia = cmbVigencia; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Combobox getCmbCategoria() { + return cmbCategoria; + } + + public void setCmbCategoria(Combobox cmbCategoria) { + this.cmbCategoria = cmbCategoria; + } + + public MyListbox getTarifaCategoriaList() { + return tarifaCategoriaList; + } + + public void setTarifaCategoriaList(MyListbox tarifaCategoriaList) { + this.tarifaCategoriaList = tarifaCategoriaList; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Combobox getCmbTramo() { + return cmbTramo; + } + + public void setCmbTramo(Combobox cmbTramo) { + this.cmbTramo = cmbTramo; + } + + public List getLsVigenciaTarifa() { + return lsVigenciaTarifa; + } + + public void setLsVigenciaTarifa(List lsVigenciaTarifa) { + this.lsVigenciaTarifa = lsVigenciaTarifa; + } + + public List getLsClaseServico() { + return lsClaseServico; + } + + public void setLsClaseServico(List lsClaseServico) { + this.lsClaseServico = lsClaseServico; + } + + public List getLsMarcas() { + return lsMarcas; + } + + public void setLsMarcas(List lsMarcas) { + this.lsMarcas = lsMarcas; + } + + public List getLsMonedas() { + return lsMonedas; + } + + public void setLsMonedas(List lsMonedas) { + this.lsMonedas = lsMonedas; + } + + public List getLsTramos() { + return lsTramos; + } + + public void setLsTramos(List lsTramos) { + this.lsTramos = lsTramos; + } + + public Tarifa getTarifa() { + return tarifa; + } + + public void setTarifa(Tarifa tarifa) { + this.tarifa = tarifa; + } + + public List getLsCategoria() { + return lsCategoria; + } + + public void setLsCategoria(List lsCategoria) { + this.lsCategoria = lsCategoria; + } + + public List getLsTipoPontoVenta() { + return lsTipoPontoVenta; + } + + public void setLsTipoPontoVenta(List lsTipoPontoVenta) { + this.lsTipoPontoVenta = lsTipoPontoVenta; + } + + public Combobox getCmbTipoPontoVenta() { + return cmbTipoPontoVenta; + } + + public void setCmbTipoPontoVenta(Combobox cmbTipoPontoVenta) { + this.cmbTipoPontoVenta = cmbTipoPontoVenta; + } + + public MyListbox getTarifaTipoPontoVentaList() { + return tarifaTipoPontoVentaList; + } + + public void setTarifaTipoPontoVentaList(MyListbox tarifaTipoPontoVentaList) { + this.tarifaTipoPontoVentaList = tarifaTipoPontoVentaList; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + lsTarifaCategoria = new ArrayList(); + tarifaCategoriaList.setItemRenderer(new RenderTarifaCategoria()); + + lsTarifaTipoPontoVenta = new ArrayList(); + tarifaTipoPontoVentaList.setItemRenderer(new RenderTarifaTipoPuntoVenta()); + + tarifaList = (MyListbox) Executions.getCurrent().getArg().get("tarifaList"); + tarifa = (Tarifa) Executions.getCurrent().getArg().get("tarifa"); + + tarifa = tarifaService.obtenerID(tarifa.getTarifaId()); + + if (tarifa.getLsTarifaCategoria() != null) { + lsTarifaCategoria.addAll(tarifa.getLsTarifaCategoria()); + } + tarifaCategoriaList.setData(lsTarifaCategoria); + + if (tarifa.getLsTarifaTipoptovta() != null) { + lsTarifaTipoPontoVenta.addAll(tarifa.getLsTarifaTipoptovta()); + } + tarifaTipoPontoVentaList.setData(lsTarifaTipoPontoVenta); + + lsMarcas = new ArrayList(); + lsMarcas.add(null); + lsMarcas.addAll(marcaService.obtenerTodos()); + + lsClaseServico = new ArrayList(); + lsClaseServico.add(null); + lsClaseServico.addAll(claseServicioService.obtenerTodos()); + + lsMonedas = new ArrayList(); + lsMonedas.add(null); + lsMonedas.addAll(monedaService.obtenerTodos()); + + lsTramos = new ArrayList(); + lsTramos.add(null); + lsTramos.addAll(tramoService.obtenerTodos()); + + lsVigenciaTarifa = new ArrayList(); + lsVigenciaTarifa.add(null); + lsVigenciaTarifa.addAll(vigenciaTarifaService.obtenerTodos()); + + lsCategoria = new ArrayList(); + lsCategoria.add(null); + lsCategoria.addAll(categoriaService.obtenerTodos()); + + lsTipoPontoVenta = new ArrayList(); + lsTipoPontoVenta.add(null); + lsTipoPontoVenta.addAll(tipoPuntoVentaService.obtenerTodos()); + lsTipoPontoVenta.remove(tipoPuntoVentaService.obtenerID((short) -1)); + + if (tarifa.getTarifaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } else { + StringBuilder sb = new StringBuilder(""); + sb.append(tarifa.getTramo().getOrigem()).append(" - ").append(tarifa.getTramo().getDestino()).append(" | ").append(tarifa.getTramo().getVia().getNombvia()); + txtDescripcionTramo.setText(sb.toString()); + + tarifa.setPreciooriginal(tarifa.getPrecio()); + } + } + + private void validarObligatorio() { + //dbPrecioTarifaCategoria.getValue(); + txtPrecio.getValue(); + txtPrecioRedAbierto.getValue(); + //dbPrecioTipoPuntoVenta.getValue(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + validarObligatorio(); + + tarifa.setFecmodif(Calendar.getInstance().getTime()); + tarifa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tarifa.setActivo(Boolean.TRUE); + tarifa.setLsTarifaCategoria(lsTarifaCategoria); + tarifa.setLsTarifaTipoptovta(lsTarifaTipoPontoVenta); + + Comboitem cbiVigenciaTarifa = cmbVigencia.getSelectedItem(); + VigenciaTarifa vigenciaTarifa = null; + if (cbiVigenciaTarifa != null) { + vigenciaTarifa = (VigenciaTarifa) cbiVigenciaTarifa.getValue(); + } + tarifa.setVigenciaTarifa(vigenciaTarifa); + + try { + + try { + if (tarifa.getTarifaId() == null) { + tarifaService.suscribir(tarifa); + tarifaList.addItem(tarifa); + + Messagebox.show( + Labels.getLabel("editarTarifaController.btnFechar.MSG.SuscbrirOK"), + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + } else { + Marca marca = (Marca) (cmbMarca.getSelectedItem() != null ? cmbMarca.getSelectedItem().getValue() : null); + ClaseServicio claseServicio = (ClaseServicio) (cmbClaseServicio.getSelectedItem() != null ? cmbClaseServicio.getSelectedItem().getValue() : null); + Parada origem = tarifa.getTramo().getOrigem(); + Parada destino = tarifa.getTramo().getDestino(); + Moneda moneda = tarifa.getMoneda(); + Ciudad cidadeOrigem = null; + Plaza plaza = null; + if (origem.getCiudad() != null) { + cidadeOrigem = ciudadService.obtenerID(origem.getCiudad().getCiudadId()); + plaza = cidadeOrigem.getPlaza(); + } + + // checando se opode alterar o valor da tarifa de acordo com o catalogo de tarifas minimas: + Boolean podeAlterarTarifaMinima = + tarifaService.podeAlterarTarifaMinima(tarifa, marca, + origem, destino, claseServicio, plaza, moneda); + + // buscando por Mercado Competido. + boolean existeMercadoCompetido = mercadoCompetidoService.existe(claseServicio, origem, destino); + + if (podeAlterarTarifaMinima) { + List lsTarifas = tarifaService.pesquisar(marca, tarifa.getTramo(), + tarifa.getMoneda(), claseServicio, tarifa.getVigenciaTarifa()); + + if (lsTarifas.size() >= 2) { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + if (!existeMercadoCompetido) { + tarifaService.actualizacion(tarifa); + tarifaList.updateItem(tarifa); + + Messagebox.show( + Labels.getLabel("editarTarifaController.btnFechar.MSG.SuscbrirOK"), + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Integer opcao = Messagebox.show( + Labels.getLabel("editarTarifaController.MSG.MercadoCompetido"), + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (opcao.equals(Messagebox.YES)) { + tarifaService.actualizacion(tarifa); + tarifaList.updateItem(tarifa); + + Messagebox.show( + Labels.getLabel("editarTarifaController.btnFechar.MSG.SuscbrirOK"), + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } + } + } else { + String stTarifa = tarifa.getTramo() + " - " + + tarifa.getPrecio().setScale(2).toString(); + + Integer opcao = Messagebox.show(stTarifa + ". " + + Labels.getLabel("editarTarifaController.MSG.TarifaMinima"), + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (opcao.equals(Messagebox.YES)) { + tarifaService.actualizacion(tarifa); + tarifaList.updateItem(tarifa); + + Messagebox.show( + Labels.getLabel("editarTarifaController.btnFechar.MSG.SuscbrirOK"), + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } + } + } catch (NumberFormatException ex) { + log.error("TARIFA - NumberFormatException: " + ex); + } + } catch (Exception ex) { + log.error("Erro ao salvar tarifa: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + + public void onClick$btnApagar(Event ev) { + tarifa.setFecmodif(Calendar.getInstance().getTime()); + tarifa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tarifa.setActivo(Boolean.TRUE); + + try { + int opcao = Messagebox.show( + Labels.getLabel("editarTarifaController.btnFechar.MSG.Deseja.Borrar"), + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (opcao == Messagebox.YES) { + tarifaService.borrar(tarifa); + tarifaList.removeItem(tarifa); + + Messagebox.show( + Labels.getLabel("editarTarifaController.btnFechar.MSG.BorrarOK"), + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnAddTarifaCategoria(Event ev) throws InterruptedException { + cmbCategoria.setConstraint("no empty"); + cmbCategoria.getValue(); + + dbPrecioTarifaCategoria.setConstraint("no empty, no zero"); + dbPrecioTarifaCategoria.getValue(); + +// dbPrecioAbiertoTarifaCategoria.setConstraint("no empty, no zero"); +// dbPrecioAbiertoTarifaCategoria.getValue(); + + Comboitem ciCategoria = cmbCategoria.getSelectedItem(); + Categoria categoria = null; + if (ciCategoria != null) { + categoria = (Categoria) ciCategoria.getValue(); + + + TarifaCategoria tc = new TarifaCategoria(); + tc.setCategoria(categoria); + tc.setPrecio((dbPrecioTarifaCategoria.getValueDecimal() == null) ? new BigDecimal(BigInteger.ZERO) : dbPrecioTarifaCategoria.getValueDecimal()); + tc.setPrecioredabierto((dbPrecioAbiertoTarifaCategoria.getValueDecimal() == null) ? new BigDecimal(BigInteger.ZERO) : dbPrecioAbiertoTarifaCategoria.getValueDecimal()); + tc.setActivo(Boolean.TRUE); + tc.setFecmodif(Calendar.getInstance().getTime()); + tc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + boolean existe = false; + for (TarifaCategoria tCategoria : lsTarifaCategoria) { + if (tCategoria.getCategoria().equals(tc.getCategoria())) { + existe = true; + } + } + if (!existe) { + lsTarifaCategoria.add(tc); + tarifaCategoriaList.setData(lsTarifaCategoria); + dbPrecioTarifaCategoria.setConstraint(""); + dbPrecioAbiertoTarifaCategoria.setConstraint(""); + + dbPrecioTarifaCategoria.setText("0"); + dbPrecioAbiertoTarifaCategoria.setText("0"); + + cmbCategoria.setConstraint(""); + cmbCategoria.setSelectedItem(null); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + + } + } + + public void onClick$btnAddTarifaTipoPontoVenta(Event ev) throws InterruptedException { + cmbTipoPontoVenta.setConstraint("no empty"); + cmbTipoPontoVenta.getValue(); + + dbPrecioTipoPuntoVenta.setConstraint("no empty, no zero"); + dbPrecioTipoPuntoVenta.getValue(); + +// dbPrecioAbiertoTipoPuntoVenta.setConstraint("no empty, no zero"); +// dbPrecioAbiertoTipoPuntoVenta.getValue(); + + Comboitem ciTipoPontoVenta = cmbTipoPontoVenta.getSelectedItem(); + TipoPuntoVenta tipoPuntoVenta = null; + if (ciTipoPontoVenta != null) { + tipoPuntoVenta = (TipoPuntoVenta) ciTipoPontoVenta.getValue(); + + + TarifaTipoptovta tt = new TarifaTipoptovta(); + tt.setTipoPuntoVenta(tipoPuntoVenta); + tt.setPrecio((dbPrecioTipoPuntoVenta.getValueDecimal() == null) ? new BigDecimal(BigInteger.ZERO) : dbPrecioTipoPuntoVenta.getValueDecimal()); + tt.setPrecioredabierto((dbPrecioAbiertoTipoPuntoVenta.getValueDecimal() == null) ? new BigDecimal(BigInteger.ZERO) : dbPrecioAbiertoTipoPuntoVenta.getValueDecimal()); + + tt.setActivo(Boolean.TRUE); + tt.setFecmodif(Calendar.getInstance().getTime()); + tt.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + boolean existe = false; + for (TarifaTipoptovta tCategoria : lsTarifaTipoPontoVenta) { + if (tCategoria.getTipoPuntoVenta().equals(tt.getTipoPuntoVenta())) { + existe = true; + } + } + if (!existe) { + lsTarifaTipoPontoVenta.add(tt); + tarifaTipoPontoVentaList.setData(lsTarifaTipoPontoVenta); + + dbPrecioTipoPuntoVenta.setConstraint(""); + dbPrecioAbiertoTipoPuntoVenta.setConstraint(""); + + dbPrecioTipoPuntoVenta.setText("0"); + dbPrecioAbiertoTipoPuntoVenta.setText("0"); + + cmbTipoPontoVenta.setConstraint(""); + cmbTipoPontoVenta.setSelectedItem(null); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } + + public void onClick$btnRmvTarifaCategoria(Event ev) { + TarifaCategoria tc = (TarifaCategoria) tarifaCategoriaList.getSelected(); + + if (tc != null) { + if (tc.getTarifacategoriaId() != null) { + tc.setActivo(Boolean.FALSE); + tc.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tc.setFecmodif(Calendar.getInstance().getTime()); + + tarifaCategoriaService.borrar(tc); + } + + lsTarifaCategoria.remove(tc); + tarifaCategoriaList.setData(lsTarifaCategoria); + } + } + + public void onClick$btnRmvTarifaTipoPontoVenta(Event ev) { + TarifaTipoptovta tt = (TarifaTipoptovta) tarifaTipoPontoVentaList.getSelected(); + + if (tt != null) { + if (tt.getTarifatipoptovtaId() != null) { + tt.setActivo(Boolean.FALSE); + tt.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tt.setFecmodif(Calendar.getInstance().getTime()); + + tarifaTipoptovtaService.borrar(tt); + } + + lsTarifaTipoPontoVenta.remove(tt); + tarifaTipoPontoVentaList.setData(lsTarifaTipoPontoVenta); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTarifaMinimaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTarifaMinimaController.java new file mode 100644 index 000000000..900e6249a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarTarifaMinimaController.java @@ -0,0 +1,335 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.entidad.TarifaMinima; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.service.ParadaService; +import com.rjconsultores.ventaboletos.service.PlazaService; +import com.rjconsultores.ventaboletos.service.TarifaMinimaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.MyTextboxDecimal; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; + +/** + * + * @author rodrigo + */ +@Controller("editarTarifaMinimaController") +@Scope("prototype") +public class EditarTarifaMinimaController extends MyGenericForwardComposer { + + @Autowired + private TarifaMinimaService tarifaMinimaService; + @Autowired + private MarcaService marcaService; + @Autowired + private ParadaService paradaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private PlazaService plazaService; + @Autowired + private MonedaService monedaService; + private List lsMoneda; + private List lsMarcas; + private List lsClaseServico; + private List lsPlaza; + private MyListbox tarifaMinimaList; + private Combobox cmbMarca; + private MyComboboxParada cmbOrigem; + private MyComboboxParada cmbDestino; + private Combobox cmbClaseServicio; + private Combobox cmbMoneda; + private Combobox cmbPlaza; + private TarifaMinima tarifaMinima; + private Button btnApagar; + private MyTextboxDecimal txtImportancia; + private static Logger log = Logger.getLogger(EditarTarifaMinimaController.class); + + public List getLsMoneda() { + return lsMoneda; + } + + public void setLsMoneda(List lsMoneda) { + this.lsMoneda = lsMoneda; + } + + public List getLsPlaza() { + return lsPlaza; + } + + public void setLsPlaza(List lsPlaza) { + this.lsPlaza = lsPlaza; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Combobox getCmbOrigem() { + return cmbOrigem; + } + + public MyComboboxParada getCmbDestino() { + return cmbDestino; + } + + public void setCmbDestino(MyComboboxParada cmbDestino) { + this.cmbDestino = cmbDestino; + } + + public void setCmbOrigem(MyComboboxParada cmbOrigem) { + this.cmbOrigem = cmbOrigem; + } + + public List getLsClaseServico() { + return lsClaseServico; + } + + public void setLsClaseServico(List lsClaseServico) { + this.lsClaseServico = lsClaseServico; + } + + public List getLsMarcas() { + return lsMarcas; + } + + public void setLsMarcas(List lsMarcas) { + this.lsMarcas = lsMarcas; + } + + public TarifaMinima getTarifaMinima() { + return tarifaMinima; + } + + public void setTarifaMinima(TarifaMinima tarifaMinima) { + this.tarifaMinima = tarifaMinima; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Combobox getCmbMoneda() { + return cmbMoneda; + } + + public void setCmbMoneda(Combobox cmbMoneda) { + this.cmbMoneda = cmbMoneda; + } + + public Combobox getCmbPlaza() { + return cmbPlaza; + } + + public void setCmbPlaza(Combobox cmbPlaza) { + this.cmbPlaza = cmbPlaza; + } + + public MyListbox getTarifaMinimaList() { + return tarifaMinimaList; + } + + public void setTarifaMinimaList(MyListbox tarifaMinimaList) { + this.tarifaMinimaList = tarifaMinimaList; + } + + public TarifaMinimaService getTarifaMinimaService() { + return tarifaMinimaService; + } + + public void setTarifaMinimaService(TarifaMinimaService tarifaMinimaService) { + this.tarifaMinimaService = tarifaMinimaService; + } + + public MyTextboxDecimal getTxtImportancia() { + return txtImportancia; + } + + public void setTxtImportancia(MyTextboxDecimal txtImportancia) { + this.txtImportancia = txtImportancia; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + tarifaMinima = (TarifaMinima) Executions.getCurrent().getArg().get("tarifaMinima"); + tarifaMinimaList = (MyListbox) Executions.getCurrent().getArg().get("tarifaMinimaList"); + + lsMoneda = monedaService.obtenerTodos(); + lsMarcas = marcaService.obtenerTodos(); + lsClaseServico = claseServicioService.obtenerTodos(); + lsPlaza = plazaService.obtenerTodos(); + + if (tarifaMinima.getTarifaminimaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + txtImportancia.focus(); + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + txtImportancia.getValue(); + cmbMoneda.getValue(); + cmbPlaza.getValue(); + cmbMarca.getValue(); + cmbOrigem.getValue(true); + cmbDestino.getValue(true); + cmbClaseServicio.getValue(); + + tarifaMinima.setFecmodif(Calendar.getInstance().getTime()); + tarifaMinima.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tarifaMinima.setActivo(Boolean.TRUE); + + try { + if (tarifaMinima.getMoneda() == null) { + Messagebox.show( + Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.moneda"), + Labels.getLabel("editarTarifaMinimaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (tarifaMinima.getPlaza() == null) { + Messagebox.show( + Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.plaza"), + Labels.getLabel("editarTarifaMinimaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (tarifaMinima.getMarca() == null) { + Messagebox.show( + Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.marca"), + Labels.getLabel("editarTarifaMinimaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (tarifaMinima.getOrigem() == null) { + Messagebox.show( + Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.origen"), + Labels.getLabel("editarTarifaMinimaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (tarifaMinima.getDestino() == null) { + Messagebox.show( + Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.destino"), + Labels.getLabel("editarTarifaMinimaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (tarifaMinima.getClaseServicio() == null) { + Messagebox.show( + Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.tipo"), + Labels.getLabel("editarTarifaMinimaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else if (tarifaMinima.getOrigem().getParadaId().equals(tarifaMinima.getDestino().getParadaId()) + && (!tarifaMinima.getOrigem().getParadaId().equals(-1) && !tarifaMinima.getDestino().getParadaId().equals(-1))) { + Messagebox.show( + Labels.getLabel("MSG.Origem.Igual.Destino"), + Labels.getLabel("editarTarifaMinimaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + } else { + if (tarifaMinima.getTarifaminimaId() == null) { + List lsTM = tarifaMinimaService.pesquisar(txtImportancia.getValueDecimal(), + tarifaMinima.getMoneda(), tarifaMinima.getPlaza(), tarifaMinima.getMarca(), + tarifaMinima.getOrigem(), tarifaMinima.getDestino(), tarifaMinima.getClaseServicio()); + + if (lsTM.isEmpty()) { + tarifaMinimaService.suscribir(tarifaMinima); + tarifaMinimaList.addItem(tarifaMinima); + + Messagebox.show( + Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.SuscbrirOK"), + Labels.getLabel("editarTarifaMinimaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarTarifaMinimaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + tarifaMinimaService.actualizacion(tarifaMinima); + tarifaMinimaList.updateItem(tarifaMinima); + + Messagebox.show( + Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.SuscbrirOK"), + Labels.getLabel("editarTarifaMinimaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } + + } catch (Exception ex) { + log.error("Editar tarida minimas: " + ex); + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("editarTarifaMinimaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + + } + + public void onClick$btnApagar(Event ev) { + tarifaMinima.setFecmodif(Calendar.getInstance().getTime()); + tarifaMinima.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tarifaMinima.setActivo(Boolean.FALSE); + + try { + int opcao = Messagebox.show( + Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.Deseja.Borrar"), + Labels.getLabel("editarTarifaMinimaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (opcao == Messagebox.YES) { + tarifaMinimaService.borrar(tarifaMinima); + tarifaMinimaList.removeItem(tarifaMinima); + + Messagebox.show( + Labels.getLabel("editarTarifaMinimaController.btnFechar.MSG.borrarOK"), + Labels.getLabel("editarTarifaMinimaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarVigenciaTarifaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarVigenciaTarifaController.java new file mode 100644 index 000000000..4586efb34 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/EditarVigenciaTarifaController.java @@ -0,0 +1,225 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.Tarifa; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.service.TarifaService; +import com.rjconsultores.ventaboletos.service.VigenciaTarifaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.Calendar; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Datebox; + +/** + * + * @author rodrigo + */ +@Controller("editarVigenciaTarifaController") +@Scope("prototype") +public class EditarVigenciaTarifaController extends MyGenericForwardComposer { + + @Autowired + private VigenciaTarifaService vigenciaTarifaService; + @Autowired + private TarifaService tarifaService; + private VigenciaTarifa vigenciaTarifa; + private MyListbox vigenciaList; + private Button btnApagar; + private Datebox fecInicio; + private Datebox fecFinal; + private Datebox fecVenta; + private Logger log = Logger.getLogger(EditarVigenciaTarifaController.class); + + public MyListbox getVigenciaList() { + return vigenciaList; + } + + public void setVigenciaList(MyListbox vigenciaList) { + this.vigenciaList = vigenciaList; + } + + public VigenciaTarifa getVigenciaTarifa() { + return vigenciaTarifa; + } + + public void setVigenciaTarifa(VigenciaTarifa vigenciaTarifa) { + this.vigenciaTarifa = vigenciaTarifa; + } + + public Button getBtnApagar() { + return btnApagar; + } + + public void setBtnApagar(Button btnApagar) { + this.btnApagar = btnApagar; + } + + public Datebox getFecInicio() { + return fecInicio; + } + + public void setFecInicio(Datebox fecInicio) { + this.fecInicio = fecInicio; + } + + public Datebox getFecFinal() { + return fecFinal; + } + + public void setFecFinal(Datebox fecFinal) { + this.fecFinal = fecFinal; + } + + public Datebox getFecVenta() { + return fecVenta; + } + + public void setFecVenta(Datebox fecVenta) { + this.fecVenta = fecVenta; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + vigenciaTarifa = (VigenciaTarifa) Executions.getCurrent().getArg().get("vigenciaTarifa"); + vigenciaList = (MyListbox) Executions.getCurrent().getArg().get("vigenciaList"); + + if (vigenciaTarifa.getVigenciatarifaId() == null) { + btnApagar.setVisible(Boolean.FALSE); + } + + fecInicio.focus(); + } + + public void onClick$btnSalvar(Event ev) { + fecInicio.getValue(); + fecFinal.getValue(); + //fecVenta.getValue(); + try { + java.util.Date inicio = vigenciaTarifa.getFeciniciovigencia(); + java.util.Date fim = vigenciaTarifa.getFecfinvigencia(); + + inicio.setSeconds(0); + fim.setSeconds(0); + + List lsVT1 = + vigenciaTarifaService.buscarVigenciasIntervalo(vigenciaTarifa); + + // checando se o fim da vigencia eh menor que o inicio: + if (!fim.before(inicio)) { + // checando se a vigencia pode ser salva. A data de inicio de uma + // nova vigencia tem q ser maior que a da fim da vigencia anterior + // para que não tenha tarifas com duas vigencias: + + Boolean podeSalvar = lsVT1.isEmpty() ? true : false; + //Se for ele mesmo pode salvar. + if (lsVT1.size() == 1) { + //Somente edição + if (vigenciaTarifa.getVigenciatarifaId() != null) { + if (vigenciaTarifa.getVigenciatarifaId().equals(lsVT1.get(0).getVigenciatarifaId())) { + podeSalvar = true; + } + } + } + + if (podeSalvar) { + if (vigenciaTarifa.getVigenciatarifaId() == null) { + if (lsVT1.isEmpty()) { + vigenciaTarifaService.suscribir(vigenciaTarifa); + vigenciaList.addItem(vigenciaTarifa); + + Messagebox.show( + Labels.getLabel("editarVigenciaTarifaController.btnFechar.MSG.SuscbrirOK"), + Labels.getLabel("editarVigenciaTarifaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } else { + Messagebox.show( + Labels.getLabel("MSG.Registro.Existe"), + Labels.getLabel("editarVigenciaTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + vigenciaTarifaService.actualizacion(vigenciaTarifa); + vigenciaList.updateItem(vigenciaTarifa); + + Messagebox.show( + Labels.getLabel("editarVigenciaTarifaController.btnFechar.MSG.SuscbrirOK"), + Labels.getLabel("editarVigenciaTarifaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + + + } else { + Messagebox.show( + Labels.getLabel("editarVigenciaTarifaController.MSG.conflitoVigencias"), + Labels.getLabel("editarVigenciaTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } else { + Messagebox.show( + Labels.getLabel("editarVigenciaTarifaController.MSG.FimMenorInicio"), + Labels.getLabel("editarVigenciaTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + log.error(ex); + } + } + + public void onClick$btnApagar(Event ev) { + vigenciaTarifa.setFecmodif(Calendar.getInstance().getTime()); + vigenciaTarifa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + vigenciaTarifa.setActivo(Boolean.FALSE); + + try { + int opcao = Messagebox.show( + Labels.getLabel("editarVigenciaTarifaController.btnFechar.MSG.Deseja.Borrar"), + Labels.getLabel("editarVigenciaTarifaController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (opcao == Messagebox.YES) { + + //Não posso eliminar uma vigencia se existir tarifa!!! + List tarifa = tarifaService.buscarExisteVigencia(vigenciaTarifa); + if (!tarifa.isEmpty()) { + Messagebox.show( + Labels.getLabel("editarVigenciaTarifaController.MSG.podeApagar"), + Labels.getLabel("editarVigenciaTarifaController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + } else { + vigenciaTarifaService.borrar(vigenciaTarifa); + vigenciaList.removeItem(vigenciaTarifa); + + Messagebox.show( + Labels.getLabel("editarVigenciaTarifaController.btnFechar.MSG.borrarOK"), + Labels.getLabel("editarVigenciaTarifaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + closeWindow(); + } + } + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/GenerarTarifaController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/GenerarTarifaController.java new file mode 100644 index 000000000..f7c36955f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/GenerarTarifaController.java @@ -0,0 +1,101 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.TarifaService; +import com.rjconsultores.ventaboletos.service.VigenciaTarifaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import java.util.List; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; + +/** + * + * @author Rafius + */ +@Controller("generarTarifaController") +@Scope("prototype") +public class GenerarTarifaController extends MyGenericForwardComposer { + + @Autowired + private MarcaService marcaService; + @Autowired + private VigenciaTarifaService vigenciaTarifaService; + @Autowired + private TarifaService tarifaService; + private List lsVigenciaTarifa; + private List lsMarca; + private Combobox cmbVigencia; + private Combobox cmbMarca; + private static Logger log = Logger.getLogger(GenerarTarifaController.class); + + public Combobox getCmbVigencia() { + return cmbVigencia; + } + + public void setCmbVigencia(Combobox cmbVigencia) { + this.cmbVigencia = cmbVigencia; + } + + public List getLsVigenciaTarifa() { + return lsVigenciaTarifa; + } + + public void setLsVigenciaTarifa(List lsVigenciaTarifa) { + this.lsVigenciaTarifa = lsVigenciaTarifa; + } + + public List getLsMarca() { + return lsMarca; + } + + public void setLsMarca(List lsMarca) { + this.lsMarca = lsMarca; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsVigenciaTarifa = vigenciaTarifaService.obtenerTodos(); + lsMarca = marcaService.buscarTodosExceto(-1); + + super.doAfterCompose(comp); + } + + public void onClick$btnCambiarVigencia(Event ev) { + cmbVigencia.getValue(); + cmbMarca.getValue(); + + try { + VigenciaTarifa vigencia = (VigenciaTarifa) (cmbVigencia.getSelectedItem() != null ? cmbVigencia.getSelectedItem().getValue() : null); + Marca marca = (Marca) (cmbMarca.getSelectedItem() != null ? cmbMarca.getSelectedItem().getValue() : null); + + Boolean gerou = tarifaService.generarTarifas(vigencia, marca); + + if (gerou) { + Messagebox.show("Generación se registró exitosamente", + Labels.getLabel("generarTarifaController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + } else { + Messagebox.show( + Labels.getLabel("MSG.Error"), + Labels.getLabel("generarTarifaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + closeWindow(); + } catch (Exception ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasController.java new file mode 100644 index 000000000..4a4c7f8a8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasController.java @@ -0,0 +1,791 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.media.Media; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Filedownload; +import org.zkoss.zhtml.Fileupload; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Button; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Tab; +import org.zkoss.zul.Textbox; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.Tarifa; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.service.CategoriaService; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.MercadoCompetidoService; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.TarifaCategoriaService; +import com.rjconsultores.ventaboletos.service.TarifaService; +import com.rjconsultores.ventaboletos.service.TarifaTipoptovtaService; +import com.rjconsultores.ventaboletos.service.TipoPuntoVentaService; +import com.rjconsultores.ventaboletos.service.VigenciaTarifaService; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCatalogoDeRutas; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderCategoria; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderClaseServicio; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderEmpresaModificacionMassivaTarifa; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMarca; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderMoneda; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderTipoPuntoVenta; +import com.rjconsultores.ventaboletos.web.utilerias.render.RenderVigenciaTarifaModificacionMassivaTarifa; + +/** + * + * @author rodrigo + */ +@Controller("modificacionMasivaTarifasController") +@Scope("prototype") +public class ModificacionMasivaTarifasController extends MyGenericForwardComposer { + + private final Integer CELL_ID_TARIFA = 0; + private final Integer CELL_NOVO_PRECIO = 8; + private final Integer CELL_ID_CATEGORIA = 10; + private final Integer CELL_NOVO_PRECIO_CATEGORIA = 12; + private final Integer CELL_ID_TIPO_PUNTO = 14; + private final Integer CELL_NOVO_PRECIO_TIPO_PUNTO = 16; + @Autowired + private TarifaService tarifaService; + @Autowired + private TarifaCategoriaService tarifaCategoriaService; + @Autowired + private TarifaTipoptovtaService tarifaTipoptovtaService; + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private MonedaService monedaService; + @Autowired + private MercadoCompetidoService mercadoCompetidoService; + @Autowired + private EmpresaService empresaService; + @Autowired + private RutaService rutaService; + @Autowired + private TipoPuntoVentaService tipoPuntoVentaService; + @Autowired + private CategoriaService categoriaService; + @Autowired + private VigenciaTarifaService vigenciaTarifaService; + private List lsMarcas; + private List lsClaseServico; + private List lsMonedas; + private List lsEmpresas; + private List lsRutas; + private List lsTipoPuntoVenta; + private List lsCategoria; + private List lsVigenciaTarifa; + private List lsAddRmvMarcas; + private List lsAddRmvClaseServico; + private List lsAddRmvMonedas; + private List lsAddRmvEmpresas; + private List lsAddRmvRutas; + private List lsAddRmvTipoPuntoVenta; + private List lsAddRmvCategoria; + private List lsAddRmvVigenciaTarifa; + private Combobox cmbMarca; + private Combobox cmbMoneda; + private Combobox cmbClaseServicio; + private Combobox cmbEmpresa; + private Combobox cmbRuta; + private Combobox cmbTipoPuntoVenta; + private Combobox cmbCategoria; + private Combobox cmbVigenciaTarifa; + private MyListbox claseServicioList; + private MyListbox marcaList; + private MyListbox monedaList; + private MyListbox empresaList; + private MyListbox rutaList; + private MyListbox tipoPuntoVentaList; + private MyListbox categoriaList; + private MyListbox vigenciaTarifaList; + private Textbox txtPorcentagem; + private Radio radIncremento; + private Radio radDecremento; + private Button btnGerarTarifas; + private Tab tabTipoPuntoVenta; + private Tab tabCategoria; + private static Logger log = Logger.getLogger(ModificacionMasivaTarifasController.class); + + public List getLsClaseServico() { + return lsClaseServico; + } + + public void setLsClaseServico(List lsClaseServico) { + this.lsClaseServico = lsClaseServico; + } + + public List getLsMarcas() { + return lsMarcas; + } + + public void setLsMarcas(List lsMarcas) { + this.lsMarcas = lsMarcas; + } + + public List getLsMonedas() { + return lsMonedas; + } + + public void setLsMonedas(List lsMonedas) { + this.lsMonedas = lsMonedas; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Combobox getCmbMoneda() { + return cmbMoneda; + } + + public void setCmbMoneda(Combobox cmbMoneda) { + this.cmbMoneda = cmbMoneda; + } + + public Textbox getTxtPorcentagem() { + return txtPorcentagem; + } + + public void setTxtPorcentagem(Textbox txtPorcentagem) { + this.txtPorcentagem = txtPorcentagem; + } + + public Radio getRadDecremento() { + return radDecremento; + } + + public void setRadDecremento(Radio radDecremento) { + this.radDecremento = radDecremento; + } + + public Radio getRadIncremento() { + return radIncremento; + } + + public void setRadIncremento(Radio radIncremento) { + this.radIncremento = radIncremento; + } + + public Combobox getCmbEmpresa() { + return cmbEmpresa; + } + + public void setCmbEmpresa(Combobox cmbEmpresa) { + this.cmbEmpresa = cmbEmpresa; + } + + public List getLsEmpresas() { + return lsEmpresas; + } + + public void setLsEmpresas(List lsEmpresas) { + this.lsEmpresas = lsEmpresas; + } + + public Combobox getCmbRuta() { + return cmbRuta; + } + + public void setCmbRuta(Combobox cmbRuta) { + this.cmbRuta = cmbRuta; + } + + public List getLsRutas() { + return lsRutas; + } + + public void setLsRutas(List lsRutas) { + this.lsRutas = lsRutas; + } + + public Combobox getCmbCategoria() { + return cmbCategoria; + } + + public void setCmbCategoria(Combobox cmbCategoria) { + this.cmbCategoria = cmbCategoria; + } + + public Combobox getCmbTipoPuntoVenta() { + return cmbTipoPuntoVenta; + } + + public void setCmbTipoPuntoVenta(Combobox cmbTipoPuntoVenta) { + this.cmbTipoPuntoVenta = cmbTipoPuntoVenta; + } + + public List getLsCategoria() { + return lsCategoria; + } + + public void setLsCategoria(List lsCategoria) { + this.lsCategoria = lsCategoria; + } + + public List getLsTipoPuntoVenta() { + return lsTipoPuntoVenta; + } + + public void setLsTipoPuntoVenta(List lsTipoPuntoVenta) { + this.lsTipoPuntoVenta = lsTipoPuntoVenta; + } + + public Combobox getCmbVigenciaTarifa() { + return cmbVigenciaTarifa; + } + + public void setCmbVigenciaTarifa(Combobox cmbVigenciaTarifa) { + this.cmbVigenciaTarifa = cmbVigenciaTarifa; + } + + public List getLsVigenciaTarifa() { + return lsVigenciaTarifa; + } + + public void setLsVigenciaTarifa(List lsVigenciaTarifa) { + this.lsVigenciaTarifa = lsVigenciaTarifa; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + + super.doAfterCompose(comp); + + lsMarcas = marcaService.obtenerTodos(); + lsClaseServico = claseServicioService.obtenerTodos(); + lsMonedas = monedaService.obtenerTodos(); + lsEmpresas = empresaService.obtenerIndTipo1(); + lsRutas = rutaService.obtenerTodos(); + lsTipoPuntoVenta = tipoPuntoVentaService.obtenerTodos(); + lsCategoria = categoriaService.obtenerTodos(); + lsVigenciaTarifa = vigenciaTarifaService.obtenerTodos(); + + claseServicioList.setItemRenderer(new RenderClaseServicio()); + marcaList.setItemRenderer(new RenderMarca()); + monedaList.setItemRenderer(new RenderMoneda()); + empresaList.setItemRenderer(new RenderEmpresaModificacionMassivaTarifa()); + rutaList.setItemRenderer(new RenderCatalogoDeRutas()); + tipoPuntoVentaList.setItemRenderer(new RenderTipoPuntoVenta()); + categoriaList.setItemRenderer(new RenderCategoria()); + vigenciaTarifaList.setItemRenderer(new RenderVigenciaTarifaModificacionMassivaTarifa()); + + lsAddRmvMarcas = new ArrayList(); + lsAddRmvClaseServico = new ArrayList(); + lsAddRmvMonedas = new ArrayList(); + lsAddRmvEmpresas = new ArrayList(); + lsAddRmvRutas = new ArrayList(); + lsAddRmvTipoPuntoVenta = new ArrayList(); + lsAddRmvCategoria = new ArrayList(); + lsAddRmvVigenciaTarifa = new ArrayList(); + + // eliminando a opcao TODOS de tipo servicio: + Short shortMinus1 = -1; + ClaseServicio claseServicioTodos = claseServicioService.obtenerID(shortMinus1); + if (claseServicioTodos != null) { + lsClaseServico.remove(claseServicioTodos); + } + + //Exibir botão para gerar tarifas automaticas + btnGerarTarifas.setVisible(ApplicationProperties.getInstance().generarTarifasAutomatica()); + + //Abas desativadas no SCIA + tabCategoria.setVisible(Boolean.FALSE); + tabTipoPuntoVenta.setVisible(Boolean.FALSE); + + } + + private void validarTodos() { + Short shortMinus1 = -1; + + ClaseServicio claseServicioTodos = claseServicioService.obtenerID(shortMinus1); + if (claseServicioTodos != null) { + if (lsClaseServico.contains(claseServicioTodos)) { + lsClaseServico = claseServicioService.obtenerTodos(); + } + } + + Marca marcaTodos = marcaService.obtenerID(shortMinus1); + if (marcaTodos != null) { + if (lsMarcas.contains(marcaTodos)) { + lsMarcas = marcaService.obtenerTodos(); + } + } + + TipoPuntoVenta tpvTodos = tipoPuntoVentaService.obtenerID(shortMinus1); + if (tpvTodos != null) { + if (lsTipoPuntoVenta.contains(tpvTodos)) { + lsTipoPuntoVenta = tipoPuntoVentaService.obtenerTodos(); + } + } + + Categoria categoriaTodos = categoriaService.obtenerID(-1); + if (categoriaTodos != null) { + if (lsCategoria.contains(categoriaTodos)) { + lsCategoria = categoriaService.obtenerTodos(); + } + } + + VigenciaTarifa vigenciaTarifaTodos = vigenciaTarifaService.obtenerID(-1); + if (vigenciaTarifaTodos != null) { + if (lsVigenciaTarifa.contains(vigenciaTarifaTodos)) { + lsVigenciaTarifa = vigenciaTarifaService.obtenerTodos(); + } + } + + Moneda monedaTodos = monedaService.obtenerID(-1); + if (monedaTodos != null) { + if (lsMonedas.contains(monedaTodos)) { + lsMonedas = monedaService.obtenerTodos(); + } + } + + Empresa empresaTodos = empresaService.obtenerID(-1); + if (empresaTodos != null) { + if (lsEmpresas.contains(empresaTodos)) { + lsEmpresas = empresaService.obtenerTodos(); + } + } + + Ruta rutaTodos = rutaService.obtenerID(-1); + if (rutaTodos != null) { + if (lsRutas.contains(rutaTodos)) { + lsRutas = rutaService.obtenerTodos(); + } + } + } + + public void onClick$btnGerarExcel(Event ev) { + txtPorcentagem.getValue(); + + try { + if (lsAddRmvVigenciaTarifa.isEmpty()) { + Messagebox.show( + Labels.getLabel("modificacionMasivaTarifasController.MSG.SemVigencia"), + Labels.getLabel("modificacionMasivaTarifasController.window.title"), + Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + + BigDecimal coeficiente = new BigDecimal(BigInteger.ZERO); + try { + if (txtPorcentagem.getValue() != null) { + + BigDecimal porcentage = BigDecimal.valueOf(Double.parseDouble(txtPorcentagem.getValue())); + + coeficiente = porcentage.divide(new BigDecimal(100)); + if (radIncremento.isChecked()) { + coeficiente = coeficiente.add(BigDecimal.ONE); + } else { + coeficiente = BigDecimal.ONE.subtract(coeficiente); + } + } + } catch (Exception e) { + log.debug("Porcentagem Zero"); + } + + if (coeficiente == null) { + return; + } + + //TESTE: + //List lsTarifa = tarifaService.obtenerTodos(); + validarTodos(); + List lsTarifa = tarifaService.pesquisar(lsAddRmvMonedas, lsAddRmvMarcas, + lsAddRmvClaseServico, lsAddRmvCategoria, lsAddRmvEmpresas, lsAddRmvRutas, + lsAddRmvTipoPuntoVenta, lsAddRmvVigenciaTarifa); + + Workbook wb = new SXSSFWorkbook(500); + + // fonte em negrito: + Font fonte = wb.createFont(); + fonte.setBoldweight(Font.BOLDWEIGHT_BOLD); + CellStyle estilo = wb.createCellStyle(); + estilo.setFont(fonte); + + Sheet sheet1 = wb.createSheet( + Labels.getLabel("modificacionMasivaTarifasController.window.title")); + + Row rowCabecalho = sheet1.createRow(0); + + Cell cell = rowCabecalho.createCell(0); + cell.setCellValue( + Labels.getLabel("busquedaTarifaController.lhId.label")); + cell.setCellStyle(estilo); + + Cell cell0 = rowCabecalho.createCell(1); + cell0.setCellValue( + Labels.getLabel("busquedaTarifaController.lhTramo.label")); + cell0.setCellStyle(estilo); + + Cell cell1 = rowCabecalho.createCell(2); + cell1.setCellValue( + Labels.getLabel("busquedaTarifaController.lhMarca.label")); + cell1.setCellStyle(estilo); + + Cell cell2 = rowCabecalho.createCell(3); + cell2.setCellValue( + Labels.getLabel("busquedaTarifaController.lhClaseServicio.label")); + cell2.setCellStyle(estilo); + + Cell cell3 = rowCabecalho.createCell(4); + cell3.setCellValue( + Labels.getLabel("busquedaTarifaController.lhFeciniciovigencia.label")); + cell3.setCellStyle(estilo); + + Cell cell4 = rowCabecalho.createCell(5); + cell4.setCellValue( + Labels.getLabel("busquedaTarifaController.lhMoneda.label")); + cell4.setCellStyle(estilo); + + //Preco original I - 6 + Cell cell5 = rowCabecalho.createCell(6); + cell5.setCellValue( + Labels.getLabel("busquedaTarifaController.lhPrecioOriginal.label")); + cell5.setCellStyle(estilo); + + // j - 6 + Cell cell6 = rowCabecalho.createCell(7); + cell6.setCellValue( + Labels.getLabel("busquedaTarifaController.lhPrecioExcel.label")); + cell6.setCellStyle(estilo); + + //I - 8 + Cell cell7 = rowCabecalho.createCell(8); + cell7.setCellValue( + Labels.getLabel("busquedaTarifaController.lhPrecioNuevo.label")); + cell7.setCellStyle(estilo); + + + for (int i = 0; i < lsTarifa.size(); i++) { + + Tarifa tarifa = lsTarifa.get(i); + + Row row = sheet1.createRow(i + 1); + + row.createCell(0).setCellValue(tarifa.getTarifaId()); + row.createCell(1).setCellValue(tarifa.getTramo().getDesctramo()); + row.createCell(2).setCellValue(tarifa.getMarca().getDescmarca()); + row.createCell(3).setCellValue(tarifa.getClaseServicio().getDescclase()); + row.createCell(4).setCellValue(tarifa.getVigenciaTarifa().toString()); + row.createCell(5).setCellValue(tarifa.getMoneda().getDescmoneda()); + row.createCell(6).setCellValue(tarifa.getPreciooriginal().setScale(2).doubleValue()); + row.createCell(7).setCellValue(tarifa.getPrecio().setScale(2).doubleValue()); + + // novo preco: + BigDecimal novoPrecio = tarifa.getPrecio(); + novoPrecio = novoPrecio.multiply(coeficiente).setScale(2, RoundingMode.HALF_UP); + + Cell cellNovoPrecio = row.createCell(8); + cellNovoPrecio.setCellValue(novoPrecio.setScale(2).doubleValue()); + cellNovoPrecio.setCellStyle(estilo); + + //Tipo de Pasajero + row.createCell(9).setCellValue(""); + row.createCell(10).setCellValue(""); + row.createCell(11).setCellValue(""); + row.createCell(12).setCellValue(""); + + // novo preco CANAL VENTA: + row.createCell(13).setCellValue(""); + row.createCell(14).setCellValue(""); + row.createCell(15).setCellValue(""); + row.createCell(16).setCellValue(""); + } +// } + + String nomeArquivo = + UsuarioLogado.getUsuarioLogado().getNombusuario() + + "_" + Calendar.getInstance().getTime().getTime() + + "_" + "modMassivaT.xlsx"; + + FileOutputStream stream = new FileOutputStream(nomeArquivo); + stream.flush(); + wb.write(stream); + stream.close(); + + InputStream is = null; + is = new FileInputStream(nomeArquivo); + Filedownload.save(is, "application/xlsx", "modificacionMasivaTarifa.xlsx"); + + boolean success = (new File(nomeArquivo)).delete(); + } catch (Exception ex) { + log.error(ex); + } + } + + public VigenciaTarifa vigenciaTarifa(Media mExcel) throws IOException { + InputStream isMExcel = mExcel.getStreamData(); + Workbook wb = new XSSFWorkbook(isMExcel); + + VigenciaTarifa v = new VigenciaTarifa(); + + for (int k = 0; k < wb.getNumberOfSheets(); k++) { + Sheet sheet = wb.getSheetAt(k); + int rows = sheet.getPhysicalNumberOfRows(); + + // pula o row 0 pq eh o cabecalho: + for (int r = 1; r < rows; r++) { + Row row = sheet.getRow(r); + if (row == null) { + continue; + } + + Cell cellIdTarifa = row.getCell(CELL_ID_TARIFA); + BigDecimal bdId = new BigDecimal(cellIdTarifa.getNumericCellValue()); + Integer idTarifa = bdId.intValue(); + + Tarifa tarifa = tarifaService.obtenerID(idTarifa); + + v = tarifa.getVigenciaTarifa(); + + break; + } + } + return v; + } + + public void onClick$btnUpLoadExcel(Event ev) throws InterruptedException, + IOException { + Media mExcel = Fileupload.get(); + + if (mExcel != null) { + Map args = new HashMap(); + args.put("mExcel", mExcel); + + openWindow("/gui/tarifas/modificacionMasivaTarifasUpload.zul", + Labels.getLabel("modificacionMasivaTarifasController.window.title"), args, MODAL); + + } + } + + public void onClick$btnGerarTarifas(Event ev) { + + Map args = new HashMap(); + + openWindow("/gui/tarifas/generarTarifa.zul", + Labels.getLabel("modificacionMasivaTarifasController.window.title"), args, MODAL); + } + + public void onClick$btnAdicionarClaseServicio(Event ev) { + Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem(); + if (cbiClaseServicio != null) { + ClaseServicio claseServicio = (ClaseServicio) cbiClaseServicio.getValue(); + + lsAddRmvClaseServico.add(claseServicio); + claseServicioList.setData(lsAddRmvClaseServico); + + cmbClaseServicio.setSelectedItem(null); + } + } + + public void onClick$btnRemoverClaseServicio(Event ev) { + ClaseServicio claseServicio = (ClaseServicio) claseServicioList.getSelected(); + if (claseServicio != null) { + lsAddRmvClaseServico.remove(claseServicio); + claseServicioList.setData(lsAddRmvClaseServico); + } + } + + public void onClick$btnAdicionarMarca(Event ev) { + Comboitem cbimarca = cmbMarca.getSelectedItem(); + if (cbimarca != null) { + Marca marca = (Marca) cbimarca.getValue(); + + lsAddRmvMarcas.add(marca); + marcaList.setData(lsAddRmvMarcas); + + cmbMarca.setSelectedItem(null); + } + } + + public void onClick$btnRemoverMarca(Event ev) { + Marca marca = (Marca) marcaList.getSelected(); + if (marca != null) { + lsAddRmvMarcas.remove(marca); + marcaList.setData(lsAddRmvMarcas); + } + } + + public void onClick$btnAdicionarMoneda(Event ev) { + Comboitem cbiMoneda = cmbMoneda.getSelectedItem(); + if (cbiMoneda != null) { + Moneda moneda = (Moneda) cbiMoneda.getValue(); + + lsAddRmvMonedas.add(moneda); + monedaList.setData(lsAddRmvMonedas); + + cmbMoneda.setSelectedItem(null); + } + } + + public void onClick$btnRemoverMoneda(Event ev) { + Moneda moneda = (Moneda) monedaList.getSelected(); + if (moneda != null) { + lsAddRmvMonedas.remove(moneda); + monedaList.setData(lsAddRmvMonedas); + } + } + + public void onClick$btnAdicionarEmpresa(Event ev) { + Comboitem cbiEmpresa = cmbEmpresa.getSelectedItem(); + if (cbiEmpresa != null) { + Empresa empresa = (Empresa) cbiEmpresa.getValue(); + + lsAddRmvEmpresas.add(empresa); + empresaList.setData(lsAddRmvEmpresas); + + cmbEmpresa.setSelectedItem(null); + } + } + + public void onClick$btnRemoverEmpresa(Event ev) { + Empresa empresa = (Empresa) empresaList.getSelected(); + if (empresa != null) { + lsAddRmvEmpresas.remove(empresa); + empresaList.setData(lsAddRmvEmpresas); + } + } + + public void onClick$btnAdicionarRuta(Event ev) { + Comboitem cbiRuta = cmbRuta.getSelectedItem(); + if (cbiRuta != null) { + Ruta ruta = (Ruta) cbiRuta.getValue(); + + lsAddRmvRutas.add(ruta); + rutaList.setData(lsAddRmvRutas); + + cmbRuta.setSelectedItem(null); + } + } + + public void onClick$btnRemoverRuta(Event ev) { + Ruta ruta = (Ruta) rutaList.getSelected(); + if (ruta != null) { + lsAddRmvRutas.remove(ruta); + rutaList.setData(lsAddRmvRutas); + } + } + + public void onClick$btnAdicionarTipoPuntoVenta(Event ev) { + Comboitem cbiTipoPuntoVenta = cmbTipoPuntoVenta.getSelectedItem(); + if (cbiTipoPuntoVenta != null) { + TipoPuntoVenta tipoPuntoVenta = (TipoPuntoVenta) cbiTipoPuntoVenta.getValue(); + + lsAddRmvTipoPuntoVenta.add(tipoPuntoVenta); + tipoPuntoVentaList.setData(lsAddRmvTipoPuntoVenta); + + cmbTipoPuntoVenta.setSelectedItem(null); + } + } + + public void onClick$btnRemoverTipoPuntoVenta(Event ev) { + TipoPuntoVenta tipoPuntoVenta = (TipoPuntoVenta) tipoPuntoVentaList.getSelected(); + if (tipoPuntoVenta != null) { + lsAddRmvTipoPuntoVenta.remove(tipoPuntoVenta); + tipoPuntoVentaList.setData(lsAddRmvTipoPuntoVenta); + } + } + + public void onClick$btnAdicionarCategoria(Event ev) { + Comboitem cbiCategoria = cmbCategoria.getSelectedItem(); + if (cbiCategoria != null) { + Categoria categoria = (Categoria) cbiCategoria.getValue(); + + lsAddRmvCategoria.add(categoria); + categoriaList.setData(lsAddRmvCategoria); + + cmbCategoria.setSelectedItem(null); + } + } + + public void onClick$btnRemoverCategoria(Event ev) { + Categoria categoria = (Categoria) categoriaList.getSelected(); + if (categoria != null) { + lsAddRmvCategoria.remove(categoria); + categoriaList.setData(lsAddRmvCategoria); + } + } + + public void onClick$btnAdicionarVigenciaTarifa(Event ev) { + Comboitem cbiVigenciaTarifa = cmbVigenciaTarifa.getSelectedItem(); + if (cbiVigenciaTarifa != null) { + VigenciaTarifa vigenciaTarifa = (VigenciaTarifa) cbiVigenciaTarifa.getValue(); + + lsAddRmvVigenciaTarifa.add(vigenciaTarifa); + vigenciaTarifaList.setData(lsAddRmvVigenciaTarifa); + + cmbVigenciaTarifa.setSelectedItem(null); + } + } + + public void onClick$btnRemoverVigenciaTarifa(Event ev) { + VigenciaTarifa vigenciaTarifa = (VigenciaTarifa) vigenciaTarifaList.getSelected(); + if (vigenciaTarifa != null) { + lsAddRmvVigenciaTarifa.remove(vigenciaTarifa); + vigenciaTarifaList.setData(lsAddRmvVigenciaTarifa); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasUploadController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasUploadController.java new file mode 100644 index 000000000..d669f866f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/ModificacionMasivaTarifasUploadController.java @@ -0,0 +1,465 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.List; + +import org.apache.log4j.Logger; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.media.Media; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Filedownload; +import org.zkoss.zul.Label; +import org.zkoss.zul.Messagebox; +import org.zkoss.zul.Radio; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.MercadoCompetido; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.entidad.Tarifa; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.service.MercadoCompetidoService; +import com.rjconsultores.ventaboletos.service.TarifaCategoriaService; +import com.rjconsultores.ventaboletos.service.TarifaService; +import com.rjconsultores.ventaboletos.service.TarifaTipoptovtaService; +import com.rjconsultores.ventaboletos.service.VigenciaTarifaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; + +/** + * + * @author Rafius + */ +@Controller("modificacionMasivaTarifasUploadController") +@Scope("prototype") +public class ModificacionMasivaTarifasUploadController extends MyGenericForwardComposer { + + private final Integer CELL_ID_TARIFA = 0; + private final Integer CELL_NOVO_PRECIO = 8; + private final Integer CELL_ID_CATEGORIA = 10; + private final Integer CELL_NOVO_PRECIO_CATEGORIA = 12; + private final Integer CELL_ID_TIPO_PUNTO = 14; + private final Integer CELL_NOVO_PRECIO_TIPO_PUNTO = 16; + @Autowired + private TarifaService tarifaService; + @Autowired + private VigenciaTarifaService vigenciaTarifaService; + @Autowired + private MercadoCompetidoService mercadoCompetidoService; + @Autowired + private TarifaCategoriaService tarifaCategoriaService; + @Autowired + private TarifaTipoptovtaService tarifaTipoptovtaService; + private List lsVigenciaTarifa; + private VigenciaTarifa vigenciaTarifa; + private Media mExcel; + private Radio rdVigenciaAtual; + private Radio rdVigenciaNueva; + private Combobox cmbVigenciaTarifa; + private Label lbVigencia; + private static Logger log = Logger.getLogger(ModificacionMasivaTarifasUploadController.class); + + @Override + public void doAfterCompose(Component comp) throws Exception { + + super.doAfterCompose(comp); + + mExcel = (Media) Executions.getCurrent().getArg().get("mExcel"); + + lsVigenciaTarifa = vigenciaTarifaService.obtenerTodos(); + lbVigencia.setVisible(Boolean.FALSE); + cmbVigenciaTarifa.setVisible(Boolean.FALSE); + + vigenciaTarifa(); + + } + + public void onClick$rdVigenciaNueva(Event ev) { + lbVigencia.setVisible(Boolean.TRUE); + cmbVigenciaTarifa.setVisible(Boolean.TRUE); + cmbVigenciaTarifa.setConstraint("no empty"); + } + + public void onClick$rdVigenciaAtual(Event ev) { + lbVigencia.setVisible(Boolean.FALSE); + cmbVigenciaTarifa.setVisible(Boolean.FALSE); + cmbVigenciaTarifa.setConstraint(""); + } + + public void onClick$btnSalvar(Event ev) throws IOException, InterruptedException { + if (rdVigenciaAtual.isChecked()) { + salvarNuevos(false); + } else { + cmbVigenciaTarifa.getValue(); + salvarNuevos(true); + } + + } + + public void salvarNuevos(Boolean salvarNuevos) throws IOException, InterruptedException { + + String strErrorTarifa = ""; + String strMercadoCompetido = ""; + String strTarifaMinima = ""; + String strDuplicidade = ""; + + Integer contador = 0; + + Integer opcao = Messagebox.show( + Labels.getLabel("modificacionMasivaTarifasController.MSGAplicar"), + Labels.getLabel("modificacionMasivaTarifasController.window.title"), + Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (opcao.equals(Messagebox.YES)) { + InputStream isMExcel = mExcel.getStreamData(); + Workbook wb = new XSSFWorkbook(isMExcel); + + for (int k = 0; k < wb.getNumberOfSheets(); k++) { + Sheet sheet = wb.getSheetAt(k); + int rows = sheet.getPhysicalNumberOfRows(); + + // pula o row 0 pq eh o cabecalho: + for (int r = 1; r < rows; r++) { + Row row = sheet.getRow(r); + if (row == null) { + continue; + } + + Cell cellIdTarifa = row.getCell(CELL_ID_TARIFA); + BigDecimal bdId = new BigDecimal(cellIdTarifa.getNumericCellValue()); + Integer idTarifa = bdId.intValue(); + + Tarifa tarifa = tarifaService.obtenerID(idTarifa); + + if (tarifa != null) { + Tramo tramo = tarifa.getTramo(); + if (tramo != null) { + Parada origem = tarifa.getTramo().getOrigem(); + Ciudad ciudad = origem.getCiudad(); + Plaza plaza = null; + if (ciudad != null) { + plaza = ciudad.getPlaza(); + } + Parada destino = tarifa.getTramo().getDestino(); + ClaseServicio claseServicio = tarifa.getClaseServicio(); + Moneda moneda = tarifa.getMoneda(); + Via via = tramo.getVia(); + + // verificando se a tarifa eh de um mercado competido: + boolean existeMercadoCompetido = mercadoCompetidoService.existe(claseServicio, origem, destino); + if (!existeMercadoCompetido) { + try { + Cell cellNovoPrecio = row.getCell(CELL_NOVO_PRECIO); + BigDecimal novoPrecio = new BigDecimal(cellNovoPrecio.getNumericCellValue()); + novoPrecio = novoPrecio.setScale(2, RoundingMode.HALF_UP); + + + Boolean podeSalvarTarifaMinima = + tarifaService.podeAlterarTarifaMinima(tarifa, tarifa.getMarca(), + origem, destino, claseServicio, plaza, moneda); + + if (podeSalvarTarifaMinima) { + if (salvarNuevos) { + Tarifa tarifaNueva = new Tarifa(); + + tarifaNueva.setClaseServicio(tarifa.getClaseServicio()); + tarifaNueva.setMarca(tarifa.getMarca()); + tarifaNueva.setMoneda(tarifa.getMoneda()); + tarifaNueva.setPrecio(novoPrecio); + tarifaNueva.setPreciooriginal(tarifa.getPreciooriginal()); + tarifaNueva.setPrecioredabierto(tarifa.getPrecioredabierto()); + tarifaNueva.setStatustarifa("A"); + tarifaNueva.setTramo(tarifa.getTramo()); + + Comboitem cbiVt = cmbVigenciaTarifa.getSelectedItem(); + VigenciaTarifa nuevaVigencia = (VigenciaTarifa) cbiVt.getValue(); + tarifaNueva.setVigenciaTarifa(nuevaVigencia); + + boolean existeTarifa = tarifaService.existe(tarifaNueva.getMarca(), tarifaNueva.getTramo(), tarifaNueva.getMoneda(), + tarifaNueva.getClaseServicio(), nuevaVigencia); + if (!existeTarifa) { + strDuplicidade = strDuplicidade + "Tarifa ya existente (" + tarifa.getTarifaId() + "). \n"; + } else { + tarifa = tarifaService.suscribir(tarifaNueva); + } + + } else { + tarifa.setPrecio(novoPrecio); + + tarifa.setStatustarifa("A"); + + tarifa = tarifaService.actualizacion(tarifa); + } + + contador = contador + 1; + } else { + String strTmpTarifaMinima = "TARIFA MINIMA: \n" + + "Tarifa: " + tarifa.getTarifaId() + "; \n" + + "Tramo: " + tramo.getDesctramo() + "; \n" + + "Via: " + tramo.getVia() + "; \n" + + "Clase Servicio: " + claseServicio + "; \n" + + "Precio: " + tarifa.getPrecio().setScale(2).toString() + "\n"; + + log.info(strTmpTarifaMinima); + + strTarifaMinima = strTarifaMinima + strTmpTarifaMinima; + } + } catch (IllegalStateException ex) { + String strTmpErrorTarifa = "ERROR: formato nuevo precio." + ex + "\n" + + "Tarifa: " + tarifa.getTarifaId() + "; \n" + + "Tramo: " + tramo.getDesctramo() + "; \n" + + "Via: " + tramo.getVia() + "; \n" + + "Clase Servicio: " + claseServicio + "; \n" + + "Precio: " + tarifa.getPrecio().setScale(2).toString() + "\n"; + + log.error(strTmpErrorTarifa); + + strErrorTarifa = strErrorTarifa + strTmpErrorTarifa; + } + } else { + String strTmpMercadoCompetido = "MERCADO COMPETIDO: \n" + + "Tarifa: " + tarifa.getTarifaId() + "; \n" + + "Tramo: " + tramo.getDesctramo() + "; \n" + + "Via: " + tramo.getVia() + "; \n" + + "Clase Servicio: " + claseServicio + "; \n" + + "Precio: " + tarifa.getPrecio().setScale(2).toString() + "\n"; + + log.info(strTmpMercadoCompetido); + + strMercadoCompetido = strMercadoCompetido + strTmpMercadoCompetido; + } + + + + } + } + + //COLUNAS RETIRADAS DO EXCEL +// //CATEGORIA +// HSSFCell cellIdTarifaCategoria = row.getCell(CELL_ID_CATEGORIA); +// if (!cellIdTarifaCategoria.toString().equals("")) { +// BigDecimal bdIdCategoria = new BigDecimal(cellIdTarifaCategoria.getNumericCellValue()); +// Integer idTarifaCategoria = bdIdCategoria.intValue(); +// +// log.debug("ID - Categoria: " + idTarifaCategoria); +// TarifaCategoria tarifaCategoria = tarifaCategoriaService.obtenerID(idTarifaCategoria); +// +// if (tarifaCategoria != null) { +// HSSFCell cellNovoPrecioCategoria = row.getCell(CELL_NOVO_PRECIO_CATEGORIA); +// BigDecimal novoPrecioCategoria = new BigDecimal(cellNovoPrecioCategoria.getNumericCellValue()); +// tarifaCategoria.setPrecio(novoPrecioCategoria.setScale(2, RoundingMode.HALF_UP)); +// if (salvarNuevos) { +// tarifaCategoriaService.suscribir(tarifaCategoria); +// } else { +// tarifaCategoriaService.actualizacion(tarifaCategoria); +// } +// } +// } +// //PUNTO DE VENTA +// HSSFCell cellIdTarifaTipopuntovta = row.getCell(CELL_ID_TIPO_PUNTO); +// if (!cellIdTarifaTipopuntovta.toString().equals("")) { +// BigDecimal bdIdTipopuntovta = new BigDecimal(cellIdTarifaTipopuntovta.getNumericCellValue()); +// Integer idTarifaTipopuntovta = bdIdTipopuntovta.intValue(); +// +// log.debug("ID - TIPO PUNTO DE VENTA: " + idTarifaTipopuntovta); +// TarifaTipoptovta tarifaTipopuntovta = tarifaTipoptovtaService.obtenerID(idTarifaTipopuntovta); +// +// if (tarifaTipopuntovta != null) { +// HSSFCell cellNovoPrecioTipopuntovta = row.getCell(CELL_NOVO_PRECIO_TIPO_PUNTO); +// BigDecimal novoPrecioTipopuntovta = new BigDecimal(cellNovoPrecioTipopuntovta.getNumericCellValue()); +// tarifaTipopuntovta.setPrecio(novoPrecioTipopuntovta.setScale(2, RoundingMode.HALF_UP)); +// if (salvarNuevos) { +// tarifaTipoptovtaService.suscribir(tarifaTipopuntovta); +// } else { +// tarifaTipoptovtaService.actualizacion(tarifaTipopuntovta); +// } +// } +// } + } + } + } + + if (opcao.equals(Messagebox.YES)) { + Messagebox.show( + Labels.getLabel("modificacionMasivaTarifasController.MSGAplicadoSucesso"), + Labels.getLabel("modificacionMasivaTarifasController.window.title"), + Messagebox.OK, Messagebox.INFORMATION); + + String nomeArquivo = + UsuarioLogado.getUsuarioLogado().getNombusuario() + + "_" + Calendar.getInstance().getTime().getTime() + + "_" + "retorno.txt"; + + // Gravando no arquivo de retorno + File arquivo = new File(nomeArquivo); + FileOutputStream fos = new FileOutputStream(arquivo); + + String texto = "" + contador + " " + + Labels.getLabel("modificacionMasivaTarifasController.MSG.RegistroSalvos") + "\n"; + + if (!strTarifaMinima.isEmpty()) { + texto = texto + + "---------- TARIFAS MINIMAS ----------\n" + + strTarifaMinima + + "\n-------------------------------------\n"; + } + + if (!strMercadoCompetido.isEmpty()) { + texto = texto + + "--------- MERCADO COMPETIDO -----------\n" + + strMercadoCompetido + + "\n---------------------------------------\n"; + } + + if (!strErrorTarifa.isEmpty()) { + texto = texto + + "--------------- ERRORS ----------------\n" + + strErrorTarifa + + "\n---------------------------------------"; + } + if (!strDuplicidade.toString().isEmpty()) { + log.debug(strDuplicidade); + texto = texto + + "--------------- DUPLICADO ----------------\n" + + strDuplicidade + + "\n---------------------------------------"; + } + + fos.write(texto.getBytes()); + fos.close(); + + InputStream is = null; + is = new FileInputStream(nomeArquivo); + Filedownload.save(is, "application/txt", "RetornoModMasivaTarifa.txt"); + + boolean success = (new File(nomeArquivo)).delete(); + + closeWindow(); + } + + } + + public void vigenciaTarifa() throws IOException, InterruptedException { + try { + InputStream isMExcel = mExcel.getStreamData(); + Workbook wb = new XSSFWorkbook(isMExcel); + + for (int k = 0; k < wb.getNumberOfSheets(); k++) { + Sheet sheet = wb.getSheetAt(k); + int rows = sheet.getPhysicalNumberOfRows(); + + // pula o row 0 pq eh o cabecalho: + for (int r = 1; r < rows; r++) { + Row row = sheet.getRow(r); + if (row == null) { + continue; + } + + Cell cellIdTarifa = row.getCell(CELL_ID_TARIFA); + BigDecimal bdId = new BigDecimal(cellIdTarifa.getNumericCellValue()); + Integer idTarifa = bdId.intValue(); + + Tarifa tarifa = tarifaService.obtenerID(idTarifa); + + if (tarifa != null) { + + VigenciaTarifa v = tarifa.getVigenciaTarifa(); + vigenciaTarifa = tarifa.getVigenciaTarifa(); + lsVigenciaTarifa.remove(vigenciaTarifa); + + SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + + log.debug("Vigencia De: " + sf.format(v.getFeciniciovigencia()) + " até: " + sf.format(v.getFecfinvigencia())); + + rdVigenciaAtual.setLabel(Labels.getLabel("modificacionMasivaTarifasUploadController.MSG.radioUno", + new Object[]{sf.format(v.getFeciniciovigencia()).concat(" ").concat(sf.format(v.getFecfinvigencia()))})); + } + break; + } + } + } catch (Exception e) { + log.error("Error ao inportar tarifas Excell",e); + Messagebox.show( + Labels.getLabel("modificacionMasivaTarifasUploadController.MSG.excel"), + Labels.getLabel("modificacionMasivaTarifasController.window.title"), + Messagebox.OK, Messagebox.ERROR); + closeWindow(); + } + } + + public List getLsVigenciaTarifa() { + return lsVigenciaTarifa; + } + + public void setLsVigenciaTarifa(List lsVigenciaTarifa) { + this.lsVigenciaTarifa = lsVigenciaTarifa; + } + + public Media getmExcel() { + return mExcel; + } + + public void setmExcel(Media mExcel) { + this.mExcel = mExcel; + } + + public Radio getRdVigenciaAtual() { + return rdVigenciaAtual; + } + + public void setRdVigenciaAtual(Radio rdVigenciaAtual) { + this.rdVigenciaAtual = rdVigenciaAtual; + } + + public Radio getRdVigenciaNueva() { + return rdVigenciaNueva; + } + + public void setRdVigenciaNueva(Radio rdVigenciaNueva) { + this.rdVigenciaNueva = rdVigenciaNueva; + } + + public Combobox getCmbVigenciaTarifa() { + return cmbVigenciaTarifa; + } + + public void setCmbVigenciaTarifa(Combobox cmbVigenciaTarifa) { + this.cmbVigenciaTarifa = cmbVigenciaTarifa; + } + + public Label getLbVigencia() { + return lbVigencia; + } + + public void setLbVigencia(Label lbVigencia) { + this.lbVigencia = lbVigencia; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/TarifaEscalaContorller.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/TarifaEscalaContorller.java new file mode 100644 index 000000000..f3b8ceea7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/tarifas/TarifaEscalaContorller.java @@ -0,0 +1,948 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.MercadoCompetido; +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Plaza; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaCombinacion; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import com.rjconsultores.ventaboletos.entidad.Tarifa; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import com.rjconsultores.ventaboletos.service.CiudadService; +import com.rjconsultores.ventaboletos.service.ClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaClaseServicioService; +import com.rjconsultores.ventaboletos.service.MarcaService; +import com.rjconsultores.ventaboletos.service.MercadoCompetidoService; +import com.rjconsultores.ventaboletos.service.MonedaService; +import com.rjconsultores.ventaboletos.service.RutaCombinacionService; +import com.rjconsultores.ventaboletos.service.RutaSecuenciaService; +import com.rjconsultores.ventaboletos.service.RutaService; +import com.rjconsultores.ventaboletos.service.TarifaMinimaService; +import com.rjconsultores.ventaboletos.service.TarifaService; +import com.rjconsultores.ventaboletos.service.TramoService; +import com.rjconsultores.ventaboletos.service.VigenciaTarifaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.log4j.Logger; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFRow; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zhtml.Filedownload; +import org.zkoss.zhtml.Messagebox; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Executions; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zul.Button; +import org.zkoss.zul.Columns; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.Decimalbox; +import org.zkoss.zul.Grid; +import org.zkoss.zul.Label; +import org.zkoss.zul.ListModelList; +import org.zkoss.zul.Row; +import org.zkoss.zul.RowRenderer; + +/** + * + * @author rodrigo + */ +@Controller("tarifaEscalaContorller") +@Scope("prototype") +public class TarifaEscalaContorller extends MyGenericForwardComposer { + + @Autowired + private TarifaService tarifaService; + @Autowired + private MarcaService marcaService; + @Autowired + private ClaseServicioService claseServicioService; + @Autowired + private MonedaService monedaService; + @Autowired + private VigenciaTarifaService vigenciaTarifaService; + @Autowired + private RutaService rutaService; + @Autowired + private TarifaMinimaService tarifaMinimaService; + @Autowired + private MercadoCompetidoService mercadoCompetidoService; + @Autowired + private TramoService tramoService; + @Autowired + private RutaSecuenciaService rutaSecuenciaService; + @Autowired + private RutaCombinacionService rutaCombinacionService; + @Autowired + private CiudadService ciudadService; + @Autowired + private MarcaClaseServicioService marcaClaseServicioService; + private List lsMarcas; + private List lsClaseServico; + private List lsMonedas; + private List lsVigenciaTarifa; + private List lsRutas; + private List lsRutaCombinacion; + private List lsRutaSecuencia; + private Combobox cmbRuta; + private Combobox cmbVigencia; + private Combobox cmbMarca; + private Combobox cmbMoneda; + private Combobox cmbClaseServicio; + private Grid grid; + private Label msgRojo; + private Button btnExportarExcel; + private Button btnAutorizarEscala; + private ListModelList lmList; + private Map mapTramoTarifa; + private Map mapTramoTarifaNovo; + private Map mapTarifaTextbox; + private List lsGridRender; + private static Logger log = Logger.getLogger(TarifaEscalaContorller.class); + + public List getLsClaseServico() { + return lsClaseServico; + } + + public void setLsClaseServico(List lsClaseServico) { + this.lsClaseServico = lsClaseServico; + } + + public List getLsMarcas() { + return lsMarcas; + } + + public void setLsMarcas(List lsMarcas) { + this.lsMarcas = lsMarcas; + } + + public List getLsMonedas() { + return lsMonedas; + } + + public void setLsMonedas(List lsMonedas) { + this.lsMonedas = lsMonedas; + } + + public List getLsRutas() { + return lsRutas; + } + + public void setLsRutas(List lsRutas) { + this.lsRutas = lsRutas; + } + + public List getLsVigenciaTarifa() { + return lsVigenciaTarifa; + } + + public void setLsVigenciaTarifa(List lsVigenciaTarifa) { + this.lsVigenciaTarifa = lsVigenciaTarifa; + } + + public Combobox getCmbRuta() { + return cmbRuta; + } + + public void setCmbRuta(Combobox cmbRuta) { + this.cmbRuta = cmbRuta; + } + + public Combobox getCmbClaseServicio() { + return cmbClaseServicio; + } + + public void setCmbClaseServicio(Combobox cmbClaseServicio) { + this.cmbClaseServicio = cmbClaseServicio; + } + + public Combobox getCmbMarca() { + return cmbMarca; + } + + public void setCmbMarca(Combobox cmbMarca) { + this.cmbMarca = cmbMarca; + } + + public Combobox getCmbMoneda() { + return cmbMoneda; + } + + public void setCmbMoneda(Combobox cmbMoneda) { + this.cmbMoneda = cmbMoneda; + } + + public Combobox getCmbVigencia() { + return cmbVigencia; + } + + public void setCmbVigencia(Combobox cmbVigencia) { + this.cmbVigencia = cmbVigencia; + } + + public Grid getGrid() { + return grid; + } + + public void setGrid(Grid grid) { + this.grid = grid; + } + + public TarifaService getTarifaService() { + return tarifaService; + } + + public void setTarifaService(TarifaService tarifaService) { + this.tarifaService = tarifaService; + } + + public Label getMsgRojo() { + return msgRojo; + } + + public void setMsgRojo(Label msgRojo) { + this.msgRojo = msgRojo; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + + btnExportarExcel.setDisabled(Boolean.TRUE); + btnAutorizarEscala.setDisabled(Boolean.TRUE); + + lsMonedas = monedaService.obtenerTodos(); + lsClaseServico = claseServicioService.obtenerTodos(); + lsVigenciaTarifa = vigenciaTarifaService.obtenerTodos(); + + msgRojo.setStyle("color:red;"); + + ClaseServicio claseServicioTodos = claseServicioService.obtenerID(new Short("-1")); + if (claseServicioTodos != null) { + lsClaseServico.remove(claseServicioTodos); + } + + grid.setRowRenderer(new RowRenderer() { + + @Override + public void render(Row row, Object data) throws Exception { + if (data == null) { + return; + } + + String styleLatente = "color:red;"; + + List list = (List) data; + + Columns columns = row.getGrid().getColumns(); + if (columns.getChildren() == null) { + return; + } + + for (Object st : list) { + if (st instanceof Tarifa) { + Tarifa tmp = (Tarifa) st; + Decimalbox decimalBox = null; + if (tmp.getPrecio() != null) { + decimalBox = new Decimalbox(tmp.getPrecio().setScale(2)); + } else { + decimalBox = new Decimalbox(new BigDecimal(0)); + } + decimalBox.setInplace(true); + + if (tmp.getStatustarifa() == null) { + decimalBox.setStyle(styleLatente); + } else if (tmp.getStatustarifa().equals("L")) { + decimalBox.setStyle(styleLatente); + } + + mapTarifaTextbox.put(tmp.getTramo(), decimalBox); + if (tmp.getTramo() != null) { + decimalBox.setTooltiptext(tmp.getTramo().getDesctramo()); + } + + row.appendChild(decimalBox); + } else if (st instanceof Parada) { + Parada parada = (Parada) st; + Label label = new Label(parada.getCveparada()); + label.setWidth("80px"); + row.appendChild(label); + + } else { + Label label = new Label(st.toString()); + label.setWidth("80px"); + row.appendChild(label); + } + row.setWidth("80px"); + } + } + }); + + lmList = new ListModelList(); + + grid.setModel(lmList); + grid.setAutopaging(true); + + int tamanho = lmList.size(); + + mapTarifaTextbox = new HashMap(); + + cmbRuta.setDisabled(Boolean.TRUE); + } + + private List createStringList(String tipo) { + List resultItems = new ArrayList(); + + for (RutaCombinacion rc : lsRutaCombinacion) { + String origem = rc.getTramo().getOrigem().toString(); + if (!resultItems.contains(origem)) { + resultItems.add(origem); + } + + String destino = rc.getTramo().getDestino().toString(); + if (!resultItems.contains(destino)) { + resultItems.add(destino); + } + } + + // deixando as colunas em branco: + if (tipo.equals("columns")) { + List resultColumns = new ArrayList(); + for (int i = 0; i < resultItems.size(); i++) { + resultColumns.add(""); + } + + return resultColumns; + } else if (tipo.equals("items")) { + return resultItems; + } else { + return new ArrayList(); + } + } + + private Via encontrarViaTramoNaoEstaSecuencia(String idOrigem, String idDestino) { + + Set keys = mapTramoTarifaNovo.keySet(); + Tramo tr = null; + for (Iterator iterator = keys.iterator(); iterator.hasNext();) { + String tramo = iterator.next(); + String tramoCveOrigenDestino[] = tramo.split("\\|"); + if ((tramoCveOrigenDestino[0].equals(idOrigem)) && (tramoCveOrigenDestino[1].equals(idDestino))) { + List lsTr = tramoService.buscarCveParada(tramoCveOrigenDestino[0], tramoCveOrigenDestino[1],tramoCveOrigenDestino[2]); + + if (!lsTr.isEmpty()) { + tr = lsTr.get(0); + } + } + } + if (tr != null) { + return tr.getVia(); + } else { + log.info("no fue encontrado en mpTramoTarifaNovo: Origen="+idOrigem+",Destino="+idDestino); + return null; + } + + } + + public void onClick$btnPesquisa(Event ev) throws InterruptedException { + cmbClaseServicio.getValue(); + cmbRuta.getValue(); + cmbVigencia.getValue(); + cmbMarca.getValue(); + cmbMoneda.getValue(); + + try { + Marca marca = (Marca) (cmbMarca.getSelectedItem() != null ? cmbMarca.getSelectedItem().getValue() : null); + ClaseServicio claseServicio = (ClaseServicio) (cmbClaseServicio.getSelectedItem() != null ? cmbClaseServicio.getSelectedItem().getValue() : null); + VigenciaTarifa vigenciaTarifa = (VigenciaTarifa) (cmbVigencia.getSelectedItem() != null ? cmbVigencia.getSelectedItem().getValue() : null); + Moneda moneda = (Moneda) (cmbMoneda.getSelectedItem() != null ? cmbMoneda.getSelectedItem().getValue() : null); + + Ruta ruta = (Ruta) (cmbRuta.getSelectedItem() != null ? cmbRuta.getSelectedItem().getValue() : null); + ruta = rutaService.obtenerID(ruta.getRutaId()); + + if ((lsRutaCombinacion != null) && (!lsRutaCombinacion.isEmpty())) { + lsRutaCombinacion.clear(); + } + lsRutaCombinacion = ruta.getRutaCombinacionList(); + lsRutaSecuencia = rutaSecuenciaService.buscarSecuenciaOrdenado(ruta); + + mapTramoTarifa = new HashMap(); + mapTramoTarifaNovo = new HashMap(); + + log.debug("Inicio carga de combiaciones"); + for (RutaCombinacion rc : lsRutaCombinacion) { + Tramo tramo = rc.getTramo(); + Tarifa tarifa = tarifaService.buscar(tramo, marca, claseServicio, vigenciaTarifa, moneda); + + if (tarifa == null) { + tarifa = new Tarifa(); + tarifa.setPrecio(BigDecimal.ZERO); + tarifa.setPreciooriginal(BigDecimal.ZERO); + tarifa.setTramo(tramo); + tarifa.setStatustarifa("L"); + } + + mapTramoTarifa.put(tramo, tarifa); + mapTramoTarifaNovo.put( + tramo.getOrigem().getParadaId().toString().concat("|").concat(tramo.getDestino().getParadaId().toString()).concat("|").concat(tramo.getVia().getViaId().toString()), tarifa); + } + log.debug("Fin carga de combiaciones"); + List lsGridMatriz = new ArrayList(); + for (int i = 0; i < lsRutaSecuencia.size(); i++) { + List tmp = new ArrayList(); + + for (int y = 0; y < lsRutaSecuencia.size(); y++) { + // colocando nome da parada na diagonal: + + if (i == y) { + Parada origem = lsRutaSecuencia.get(i).getTramo().getOrigem(); + tmp.add(origem); + } else if (y > i) { + Tarifa tarifa = null; + + if (y >= 1 && y < lsRutaSecuencia.size() - 1) { + Via v = encontrarViaTramoNaoEstaSecuencia(lsRutaSecuencia.get(i).getTramo().getOrigem().getParadaId().toString(), lsRutaSecuencia.get(y).getTramo().getOrigem().getParadaId().toString()); + if (v != null) { + tarifa = mapTramoTarifaNovo.get(lsRutaSecuencia.get(i).getTramo().getOrigem().getParadaId().toString().concat("|").concat(lsRutaSecuencia.get(y).getTramo().getOrigem().getParadaId().toString()).concat("|").concat(v.getViaId().toString())); + } + } else if (y == lsRutaSecuencia.size()) { + Via v = encontrarViaTramoNaoEstaSecuencia(lsRutaSecuencia.get(i).getTramo().getOrigem().getParadaId().toString(), lsRutaSecuencia.get(y).getTramo().getDestino().getParadaId().toString()); + if (v != null) { + tarifa = mapTramoTarifaNovo.get(lsRutaSecuencia.get(i).getTramo().getOrigem().getParadaId().toString().concat("|").concat(lsRutaSecuencia.get(y).getTramo().getDestino().getParadaId().toString()).concat("|").concat(v.getViaId().toString())); + } + } else { + Via v = encontrarViaTramoNaoEstaSecuencia(lsRutaSecuencia.get(i).getTramo().getOrigem().getParadaId().toString(), lsRutaSecuencia.get(y).getTramo().getOrigem().getParadaId().toString()); + if (v != null) { + tarifa = mapTramoTarifaNovo.get(lsRutaSecuencia.get(i).getTramo().getOrigem().getParadaId().toString().concat("|").concat(lsRutaSecuencia.get(y).getTramo().getOrigem().getParadaId().toString()).concat("|").concat(v.getViaId().toString())); + } + } + if (tarifa == null) { + // Tramo tt = + // tramoService.obtenerTramotPorOrigemDestinoVia(lsRutaSecuencia.get(i).getTramo().getOrigem(), + // lsRutaSecuencia.get(y).getTramo().getOrigem(), + // lsRutaSecuencia.get(y).getTramo().getVia()); + RutaCombinacion rc = rutaCombinacionService.busquedaTramoRutaOrigemDestino(lsRutaSecuencia.get(i).getRuta(), + lsRutaSecuencia.get(i).getTramo().getOrigem(), lsRutaSecuencia.get(y).getTramo().getOrigem()); + // Se nao existe a rutaCombinacion na ruta... + if (rc == null) { + tmp.add(""); + } else { + tarifa = new Tarifa(); + tarifa.setPrecio(BigDecimal.ZERO); + tarifa.setPreciooriginal(BigDecimal.ZERO); + tarifa.setTramo(lsRutaSecuencia.get(i).getTramo()); + tarifa.setStatustarifa("L"); + tmp.add(tarifa); + } + } else { + tmp.add(tarifa); + } + } else { + tmp.add(""); + } + } + lsGridMatriz.add(tmp); + } + log.debug("Fin carga de las secuencias"); + + lsGridRender = new ArrayList(); + for (int i = 0; i < lsGridMatriz.size(); i++) { + List tmpRender = new ArrayList(); + + for (int y = 0; y < lsGridMatriz.size(); y++) { + List tmp = lsGridMatriz.get(y); + tmpRender.add(tmp.get(i)); + } + + tmpRender.add(""); + lsGridRender.add(tmpRender); + } + log.debug("Colocando ultimo tramo"); + // colocando ultimo tramo: + // /------------------------------------------------------------> + if (!lsRutaSecuencia.isEmpty()) { + + Parada destino = lsRutaSecuencia.get(lsRutaSecuencia.size() - 1).getTramo().getDestino(); + List tmpDestino = new ArrayList(); + for (int i = 0; i < lsRutaSecuencia.size(); i++) { + log.info("Secuencia="+lsRutaSecuencia.get(i).getRutasecuenciaId()); + + // Pegar a Origem do Inicio com o Final da Ultima secuencia. + RutaSecuencia rcIni = lsRutaSecuencia.get(i); + RutaSecuencia rcFim = lsRutaSecuencia.get(lsRutaSecuencia.size() - 1); + // Via v = lsRutaSecuencia.get(lsRutaSecuencia.size() - + // 1).getTramo().getVia(); + + String idOrigem = rcIni.getTramo().getOrigem().getParadaId().toString(); + String idDestino = rcFim.getTramo().getDestino().getParadaId().toString(); + Via v = encontrarViaTramoNaoEstaSecuencia(idOrigem, idDestino); + + if (v == null){ + log.info("No fue encontrado la via para el origen y destino: " + idOrigem + ","+idDestino); + } + + Tramo tramo = rcIni.getTramo(); + Tarifa tarifa = mapTramoTarifaNovo.get(rcIni.getTramo().getOrigem().getParadaId().toString().concat("|").concat(rcFim.getTramo().getDestino().getParadaId().toString()).concat("|").concat(v.getViaId().toString())); + + if (tarifa == null) { + tarifa = new Tarifa(); + tarifa.setPrecio(BigDecimal.ZERO); + tarifa.setPreciooriginal(BigDecimal.ZERO); + tarifa.setTramo(tramo); + } + + tmpDestino.add(tarifa); + } + + // <-------------------------------------------------- + + tmpDestino.add(destino); + lsGridRender.add(tmpDestino); + } + + // criando colunas em branco: + if ((lsRutaCombinacion != null) && (!lsRutaCombinacion.isEmpty())) { + Columns columns = grid.getColumns(); + if (columns.getChildren() == null) { + return; + } + columns.detach(); + + Map params = new HashMap(); + params.put("columns", createStringList("columns")); + + grid.appendChild(Executions.createComponents("/gui/tarifas/tarifa_escala/columns.zul", grid, params)); + + lmList.clear(); + lmList.addAll(lsGridRender); + + if (lsGridRender.size() > 10 && lsGridRender.size() <= 20) { + grid.setWidth("1250px"); + } else if (lsGridRender.size() > 20 && lsGridRender.size() <= 30) { + grid.setWidth("1500px"); + } else if (lsGridRender.size() > 30 && lsGridRender.size() <= 40) { + grid.setWidth("1750px"); + } else if (lsGridRender.size() > 40 && lsGridRender.size() <= 50) { + grid.setWidth("2000px"); + } else if (lsGridRender.size() > 50 && lsGridRender.size() <= 60) { + grid.setWidth("2500px"); + } else if (lsGridRender.size() > 60 && lsGridRender.size() <= 70) { + grid.setWidth("2750px"); + } else if (lsGridRender.size() > 70 && lsGridRender.size() <= 80) { + grid.setWidth("3000px"); + } else if (lsGridRender.size() > 80 && lsGridRender.size() <= 90) { + grid.setWidth("3250px"); + } else if (lsGridRender.size() > 90 && lsGridRender.size() <= 100) { + grid.setWidth("3500px"); + } else if (lsGridRender.size() > 100 && lsGridRender.size() <= 199) { + grid.setWidth("5000px"); + } else if (lsGridRender.size() > 200) { + grid.setWidth("8000px"); + } + } + + btnExportarExcel.setDisabled(Boolean.FALSE); + btnAutorizarEscala.setDisabled(Boolean.FALSE); + + } catch (Exception e) { + e.printStackTrace(); + log.error("** Erro ao montar escala de tarifa: " + e, e); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("tarifaEscalaContorller.window.title"), Messagebox.OK, + Messagebox.ERROR); + } + } + + public void onClick$btnAutorizarEscala(Event ev) throws InterruptedException { + validacion(); + try { + Integer opcao = Messagebox.show(Labels.getLabel("tarifaEscalaContorller.MSGAutoriazarEscala"), + Labels.getLabel("tarifaEscalaContorller.window.title"), Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (opcao.equals(Messagebox.YES)) { + // Autoriza e salvar junto, essa medida requer salvar e + // recarregar as tarifas. + onClick$btnSalvar(null); + // Apos salvar tem que recarregar as tarifas + onClick$btnPesquisa(null); + + if (mapTramoTarifa != null) { + Set keys = mapTramoTarifa.keySet(); + for (Iterator iterator = keys.iterator(); iterator.hasNext();) { + Tramo key = iterator.next(); + if (key != null) { + Tarifa tarifa = mapTramoTarifa.get(key); + tarifa.setStatustarifa("A"); + + tarifa.setFecmodif(Calendar.getInstance().getTime()); + tarifa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + + if (tarifa.getMarca() == null + || tarifa.getClaseServicio() == null + || tarifa.getMoneda() == null + || tarifa.getVigenciaTarifa() == null) { + log.debug("Tarifa sem Marca ou Classe ou Moeda Tarifa ID: " + tarifa.getTarifaId()); + continue; + } + tarifaService.actualizacion(tarifa); + } + } + + onClick$btnPesquisa(null); + + Messagebox.show(Labels.getLabel("tarifaEscalaContorller.MSGEscalaAutoriazada"), + Labels.getLabel("tarifaEscalaContorller.window.title"), Messagebox.OK, Messagebox.INFORMATION); + } else { + Messagebox.show(Labels.getLabel("tarifaEscalaContorller.MSGSelecioneEscala"), + Labels.getLabel("tarifaEscalaContorller.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } + } catch (Exception ex) { + log.info("** Erro ao autorizar escala de tarifa: " + ex,ex); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("tarifaEscalaContorller.window.title"), Messagebox.OK, + Messagebox.ERROR); + } + } + + public void validacion() { + cmbClaseServicio.getValue(); + cmbRuta.getValue(); + cmbVigencia.getValue(); + cmbMarca.getValue(); + cmbMoneda.getValue(); + + } + + public void onClick$btnSalvar(Event ev) throws InterruptedException { + + validacion(); + + try { + Marca marca = (Marca) (cmbMarca.getSelectedItem() != null ? cmbMarca.getSelectedItem().getValue() : null); + ClaseServicio claseServicio = (ClaseServicio) (cmbClaseServicio.getSelectedItem() != null ? cmbClaseServicio.getSelectedItem().getValue() : null); + VigenciaTarifa vigenciaTarifa = (VigenciaTarifa) (cmbVigencia.getSelectedItem() != null ? cmbVigencia.getSelectedItem().getValue() : null); + Moneda moneda = (Moneda) (cmbMoneda.getSelectedItem() != null ? cmbMoneda.getSelectedItem().getValue() : null); + Ruta ruta = (Ruta) (cmbRuta.getSelectedItem() != null ? cmbRuta.getSelectedItem().getValue() : null); + ruta = rutaService.obtenerID(ruta.getRutaId()); + + if (marca == null) { + Messagebox.show(Labels.getLabel("tarifaEscalaContorller.MSGSelMarca"), + Labels.getLabel("tarifaEscalaContorller.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + + if (claseServicio == null) { + Messagebox.show(Labels.getLabel("tarifaEscalaContorller.MSGSelClaseServicio"), + Labels.getLabel("tarifaEscalaContorller.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + + return; + } + + StringBuilder stTarifaMinima = new StringBuilder(""); + Set keys = mapTramoTarifaNovo.keySet(); + for (Iterator iterator = keys.iterator(); iterator.hasNext();) { + String tramo = iterator.next(); + Tarifa tarifa = mapTramoTarifaNovo.get(tramo); + if (tarifa != null) { + tarifa.setMarca(marca); + tarifa.setMoneda(moneda); + tarifa.setClaseServicio(claseServicio); + tarifa.setVigenciaTarifa(vigenciaTarifa); + + Parada origem = tarifa.getTramo().getOrigem(); + Parada destino = tarifa.getTramo().getDestino(); + Ciudad cidadeOrigem = null; + Plaza plaza = null; + if (origem.getCiudad() != null) { + cidadeOrigem = ciudadService.obtenerID(origem.getCiudad().getCiudadId()); + plaza = cidadeOrigem.getPlaza(); + } + + String tramoCveOrigenDestino[] = tramo.split("\\|"); + + List lsTr = tramoService.buscarCveParada(tramoCveOrigenDestino[0], tramoCveOrigenDestino[1], + tramoCveOrigenDestino[2]); + + if (!lsTr.isEmpty()) { + Tramo tr = lsTr.get(0); + // mapTramoTarifaNovo.get(tr.getOrigem().getCveparada().concat("|").concat(tr.getDestino().getCveparada().concat("|")).concat(tr.getVia().getNombvia())); + + //Indica se o mapTarifaTextbox foi renderizado. Ele só é renderizado se a pagina do tramo foi "paginada"/"acessada" + //Quando o mapTarifaTextbox não foi carregado, não é exibido a mesg de tarifaMinima + boolean mapTarifaTexboxRedenrizado = true; + + Decimalbox decimalBox = mapTarifaTextbox.get(tr); + if (decimalBox == null) { + mapTarifaTexboxRedenrizado = false; + tarifa.setPrecio(BigDecimal.ZERO); + tarifa.setPreciooriginal(BigDecimal.ZERO); + } else { + if (tarifa.getPrecio().compareTo(decimalBox.getValue()) == 0) { + continue; + } + + tarifa.setPreciooriginal(tarifa.getPrecio()); + tarifa.setPrecio(decimalBox.getValue()); + } + tarifa.setFecmodif(Calendar.getInstance().getTime()); + tarifa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tarifa.setActivo(Boolean.TRUE); + + // checando se opode alterar o valor da tarifa de acordo + // com o catalogo de tarifas minimas: + Boolean podeAlterar = tarifaService.podeAlterarTarifaMinima(tarifa, marca, origem, destino, claseServicio, plaza, + moneda); + + if (podeAlterar) { + boolean existeMercadoCompetido = mercadoCompetidoService.existe(claseServicio, origem, destino); + + // caso encontre um mercado competido perguntar se + // deseja alterar a tarifa mesmo assim: + if (existeMercadoCompetido) { + String stMercadoCompetido = tarifa.getTramo() + " - " + tarifa.getPrecio().setScale(2).toString(); + Integer opcao = Messagebox.show( + stMercadoCompetido + ". " + + Labels.getLabel("tarifaEscalaContorller.MSGAlterarTarifaMercadoCompetido"), + Labels.getLabel("tarifaEscalaContorller.window.title"), Messagebox.YES | Messagebox.NO, + Messagebox.QUESTION); + + if (opcao.equals(Messagebox.YES)) { + tarifa.setFecmodif(Calendar.getInstance().getTime()); + tarifa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tarifa.setActivo(Boolean.TRUE); + tarifa.setStatustarifa("L"); + + tarifaService.actualizacion(tarifa); + } + } else { + tarifa.setFecmodif(Calendar.getInstance().getTime()); + tarifa.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId()); + tarifa.setActivo(Boolean.TRUE); + tarifa.setStatustarifa("L"); + + if (tarifa.getTarifaId() == null) { + tarifa = tarifaService.suscribir(tarifa); + } else { + tarifa = tarifaService.actualizacion(tarifa); + } + } + } else { + if (mapTarifaTexboxRedenrizado) { + stTarifaMinima.append(tarifa.getTramo()).append(" - ").append(tarifa.getPrecio().setScale(2).toString()); + stTarifaMinima.append("\n"); + } + } + } + } + } + + onClick$btnPesquisa(null); + + if (stTarifaMinima.toString().equals("")) { + if (ev != null) { + Messagebox.show(Labels.getLabel("tarifaEscalaContorller.MSGTarifasAtualizadas"), + Labels.getLabel("tarifaEscalaContorller.window.title"), Messagebox.OK, Messagebox.INFORMATION); + } + } else { + Messagebox.show(Labels.getLabel("tarifaEscalaContorller.MSGNOPodeAlterarTarifaMinima") + "\n" + stTarifaMinima.toString() + + ". ", Labels.getLabel("tarifaEscalaContorller.window.title"), Messagebox.OK, Messagebox.EXCLAMATION); + } + } catch (Exception ex) { + + log.info("** Erro ao salvar escala de tarifa: " + ex); + log.error("** Erro ao salvar escala de tarifa: " + ex); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("tarifaEscalaContorller.window.title"), Messagebox.OK, + Messagebox.ERROR); + + } + } + + public void onClick$btnExportarExcel(Event ev) throws InterruptedException { + validacion(); + try { + HSSFWorkbook wb = new HSSFWorkbook(); + + // fonte em negrito: + HSSFFont fonte = wb.createFont(); + fonte.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); + HSSFCellStyle estilo = wb.createCellStyle(); + estilo.setFont(fonte); + + HSSFSheet sheet1 = wb.createSheet(Labels.getLabel("tarifaEscalaContorller.window.title")); + + // cabeçalho: + VigenciaTarifa vt = (VigenciaTarifa) (cmbVigencia.getSelectedItem() != null ? cmbVigencia.getSelectedItem().getValue() : null); + if (vt != null) { + HSSFRow rowVigencia = sheet1.createRow(0); + rowVigencia.createCell(0).setCellValue( + Labels.getLabel("tarifaEscalaContorller.lhFeciniciovigencia.label") + ": " + vt.toString()); + } else { + HSSFRow rowVigencia = sheet1.createRow(0); + rowVigencia.createCell(0).setCellValue(Labels.getLabel("tarifaEscalaContorller.lhFeciniciovigencia.label") + ": "); + } + + Moneda moneda = (Moneda) (cmbMoneda.getSelectedItem() != null ? cmbMoneda.getSelectedItem().getValue() : null); + if (moneda != null) { + HSSFRow rowMoneda = sheet1.createRow(1); + rowMoneda.createCell(0).setCellValue(Labels.getLabel("tarifaEscalaContorller.lhMoneda.label") + ": " + moneda.toString()); + } else { + HSSFRow rowMoneda = sheet1.createRow(1); + rowMoneda.createCell(0).setCellValue(Labels.getLabel("tarifaEscalaContorller.lhMoneda.label") + ": "); + } + + Ruta ruta = (Ruta) (cmbRuta.getSelectedItem() != null ? cmbRuta.getSelectedItem().getValue() : null); + if (ruta != null) { + HSSFRow rowRuta = sheet1.createRow(2); + rowRuta.createCell(0).setCellValue(Labels.getLabel("tarifaEscalaContorller.lhRuta.label") + ": " + ruta.toString()); + } else { + HSSFRow rowRuta = sheet1.createRow(2); + rowRuta.createCell(0).setCellValue(Labels.getLabel("tarifaEscalaContorller.lhRuta.label") + ": "); + } + + Marca marca = (Marca) (cmbMarca.getSelectedItem() != null ? cmbMarca.getSelectedItem().getValue() : null); + if (marca != null) { + HSSFRow rowMarca = sheet1.createRow(3); + rowMarca.createCell(0).setCellValue(Labels.getLabel("tarifaEscalaContorller.lhMarca.label") + ": " + marca.toString()); + } else { + HSSFRow rowMarca = sheet1.createRow(3); + rowMarca.createCell(0).setCellValue(Labels.getLabel("tarifaEscalaContorller.lhMarca.label") + ": "); + } + + ClaseServicio claseService = (ClaseServicio) (cmbClaseServicio.getSelectedItem() != null ? cmbClaseServicio.getSelectedItem().getValue() : null); + if (claseService != null) { + HSSFRow rowClaseService = sheet1.createRow(4); + rowClaseService.createCell(0).setCellValue( + Labels.getLabel("tarifaEscalaContorller.lhClaseServicio.label") + ": " + claseService.toString()); + } else { + HSSFRow rowClaseService = sheet1.createRow(4); + rowClaseService.createCell(0).setCellValue(Labels.getLabel("tarifaEscalaContorller.lhClaseServicio.label") + ": "); + } + + // linha vazia entre o cabeçalho e escala: + HSSFRow rowEspaco = sheet1.createRow(5); + rowEspaco.createCell(0).setCellValue(""); + + for (int i = 0; i < lsGridRender.size(); i++) { + List list = lsGridRender.get(i); + + HSSFRow row = sheet1.createRow(i + 6); + for (int j = 0; j < list.size(); j++) { + Object st = list.get(j); + + if (st instanceof Tarifa) { + Tarifa tmp = (Tarifa) st; + + row.createCell(j).setCellValue(tmp.getPrecio().setScale(2).toString()); + } else if (st instanceof Parada) { + Parada parada = (Parada) st; + + HSSFCell cell = row.createCell(j); + cell.setCellStyle(estilo); + + cell.setCellValue(parada.getCveparada()); + } else { + row.createCell(j).setCellValue(st.toString()); + } + } + } + + String nomeArquivo = UsuarioLogado.getUsuarioLogado().getNombusuario() + "_" + Calendar.getInstance().getTime().getTime() + "_" + + "escala.xls"; + + FileOutputStream stream = new FileOutputStream(nomeArquivo); + stream.flush(); + wb.write(stream); + stream.close(); + + InputStream is = null; + is = new FileInputStream(nomeArquivo); + Filedownload.save(is, "application/xls", "escala.xls"); + + boolean success = (new File(nomeArquivo)).delete(); + } catch (Exception ex) { + + log.info("** Erro ao exportar escala de tarifa: " + ex); + log.error("** Erro ao exportar escala de tarifa: " + ex); + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("tarifaEscalaContorller.window.title"), Messagebox.OK, + Messagebox.ERROR); + + } + } + + public void onChange$cmbClaseServicio(Event ev) { + Comboitem cbiClaseServicio = cmbClaseServicio.getSelectedItem(); + + if (cbiClaseServicio != null) { + ClaseServicio claseServicio = (ClaseServicio) cbiClaseServicio.getValue(); + lsRutas = rutaService.buscarPorClaseServicio(claseServicio); + cmbRuta.setConstraint(""); + cmbRuta.setSelectedItem(null); + cmbRuta.setText(null); + BindingListModelList modelRuta = new BindingListModelList(lsRutas, true); + cmbRuta.setModel(modelRuta); + cmbRuta.setConstraint("no empty"); + cmbRuta.setDisabled(Boolean.FALSE); + + lsMarcas = marcaClaseServicioService.buscar(claseServicio); + cmbMarca.setConstraint(""); + cmbMarca.setSelectedItem(null); + cmbMarca.setText(null); + BindingListModelList modelMarcas = new BindingListModelList(lsMarcas, true); + cmbMarca.setModel(modelMarcas); + cmbMarca.setConstraint("no empty"); + + } + btnExportarExcel.setDisabled(Boolean.TRUE); + btnAutorizarEscala.setDisabled(Boolean.TRUE); + } + + public void onChange$cmbRuta(Event ev) { + btnExportarExcel.setDisabled(Boolean.TRUE); + btnAutorizarEscala.setDisabled(Boolean.TRUE); + } + + public void onChange$cmbVigencia(Event ev) { + btnExportarExcel.setDisabled(Boolean.TRUE); + btnAutorizarEscala.setDisabled(Boolean.TRUE); + } + + public void onChange$cmbMarca(Event ev) { + btnExportarExcel.setDisabled(Boolean.TRUE); + btnAutorizarEscala.setDisabled(Boolean.TRUE); + } + + public void onChange$cmbMoneda(Event ev) { + btnExportarExcel.setDisabled(Boolean.TRUE); + btnAutorizarEscala.setDisabled(Boolean.TRUE); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/Base64.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/Base64.java new file mode 100644 index 000000000..b30f7600a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/Base64.java @@ -0,0 +1,247 @@ +/* + * @(#)Base64.java 1.3 01/12/03 + * + * Copyright 2002 Sun Microsystems, Inc. All rights reserved. + * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +/** + * Static methods for translating Base64 encoded strings to byte arrays + * and vice-versa. + * + * @author Josh Bloch + * @version 1.3, 12/03/01 + * @see Preferences + * @since 1.4 + */ +public class Base64 { + + /** + * Translates the specified byte array into a Base64 string as per + * Preferences.put(byte[]). + */ + public static String byteArrayToBase64(byte[] a) { + return byteArrayToBase64(a, false); + } + + /** + * Translates the specified byte array into an "aternate representation" + * Base64 string. This non-standard variant uses an alphabet that does + * not contain the uppercase alphabetic characters, which makes it + * suitable for use in situations where case-folding occurs. + */ + public static String byteArrayToAltBase64(byte[] a) { + return byteArrayToBase64(a, true); + } + + private static String byteArrayToBase64(byte[] a, boolean alternate) { + int aLen = a.length; + int numFullGroups = aLen / 3; + int numBytesInPartialGroup = aLen - 3 * numFullGroups; + int resultLen = 4 * ((aLen + 2) / 3); + StringBuffer result = new StringBuffer(resultLen); + char[] intToAlpha = (alternate ? intToAltBase64 : intToBase64); + + // Translate all full groups from byte array elements to Base64 + int inCursor = 0; + for (int i = 0; i < numFullGroups; i++) { + int byte0 = a[inCursor++] & 0xff; + int byte1 = a[inCursor++] & 0xff; + int byte2 = a[inCursor++] & 0xff; + result.append(intToAlpha[byte0 >> 2]); + result.append(intToAlpha[(byte0 << 4) & 0x3f | (byte1 >> 4)]); + result.append(intToAlpha[(byte1 << 2) & 0x3f | (byte2 >> 6)]); + result.append(intToAlpha[byte2 & 0x3f]); + } + + // Translate partial group if present + if (numBytesInPartialGroup != 0) { + int byte0 = a[inCursor++] & 0xff; + result.append(intToAlpha[byte0 >> 2]); + if (numBytesInPartialGroup == 1) { + result.append(intToAlpha[(byte0 << 4) & 0x3f]); + result.append("=="); + } else { + // assert numBytesInPartialGroup == 2; + int byte1 = a[inCursor++] & 0xff; + result.append(intToAlpha[(byte0 << 4) & 0x3f | (byte1 >> 4)]); + result.append(intToAlpha[(byte1 << 2) & 0x3f]); + result.append('='); + } + } + // assert inCursor == a.length; + // assert result.length() == resultLen; + return result.toString(); + } + /** + * This array is a lookup table that translates 6-bit positive integer + * index values into their "Base64 Alphabet" equivalents as specified + * in Table 1 of RFC 2045. + */ + private static final char intToBase64[] = { + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' + }; + /** + * This array is a lookup table that translates 6-bit positive integer + * index values into their "Alternate Base64 Alphabet" equivalents. + * This is NOT the real Base64 Alphabet as per in Table 1 of RFC 2045. + * This alternate alphabet does not use the capital letters. It is + * designed for use in environments where "case folding" occurs. + */ + private static final char intToAltBase64[] = { + '!', '"', '#', '$', '%', '&', '\'', '(', ')', ',', '-', '.', ':', + ';', '<', '>', '@', '[', ']', '^', '`', '_', '{', '|', '}', '~', + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '?' + }; + + /** + * Translates the specified Base64 string (as per Preferences.get(byte[])) + * into a byte array. + * + * @throw IllegalArgumentException if s is not a valid Base64 + * string. + */ + public static byte[] base64ToByteArray(String s) { + return base64ToByteArray(s, false); + } + + /** + * Translates the specified "aternate representation" Base64 string + * into a byte array. + * + * @throw IllegalArgumentException or ArrayOutOfBoundsException + * if s is not a valid alternate representation + * Base64 string. + */ + public static byte[] altBase64ToByteArray(String s) { + return base64ToByteArray(s, true); + } + + private static byte[] base64ToByteArray(String s, boolean alternate) { + byte[] alphaToInt = (alternate ? altBase64ToInt : base64ToInt); + int sLen = s.length(); + int numGroups = sLen / 4; + if (4 * numGroups != sLen) { + throw new IllegalArgumentException( + "String length must be a multiple of four."); + } + int missingBytesInLastGroup = 0; + int numFullGroups = numGroups; + if (sLen != 0) { + if (s.charAt(sLen - 1) == '=') { + missingBytesInLastGroup++; + numFullGroups--; + } + if (s.charAt(sLen - 2) == '=') { + missingBytesInLastGroup++; + } + } + byte[] result = new byte[3 * numGroups - missingBytesInLastGroup]; + + // Translate all full groups from base64 to byte array elements + int inCursor = 0, outCursor = 0; + for (int i = 0; i < numFullGroups; i++) { + int ch0 = base64toInt(s.charAt(inCursor++), alphaToInt); + int ch1 = base64toInt(s.charAt(inCursor++), alphaToInt); + int ch2 = base64toInt(s.charAt(inCursor++), alphaToInt); + int ch3 = base64toInt(s.charAt(inCursor++), alphaToInt); + result[outCursor++] = (byte) ((ch0 << 2) | (ch1 >> 4)); + result[outCursor++] = (byte) ((ch1 << 4) | (ch2 >> 2)); + result[outCursor++] = (byte) ((ch2 << 6) | ch3); + } + + // Translate partial group, if present + if (missingBytesInLastGroup != 0) { + int ch0 = base64toInt(s.charAt(inCursor++), alphaToInt); + int ch1 = base64toInt(s.charAt(inCursor++), alphaToInt); + result[outCursor++] = (byte) ((ch0 << 2) | (ch1 >> 4)); + + if (missingBytesInLastGroup == 1) { + int ch2 = base64toInt(s.charAt(inCursor++), alphaToInt); + result[outCursor++] = (byte) ((ch1 << 4) | (ch2 >> 2)); + } + } + // assert inCursor == s.length()-missingBytesInLastGroup; + // assert outCursor == result.length; + return result; + } + + /** + * Translates the specified character, which is assumed to be in the + * "Base 64 Alphabet" into its equivalent 6-bit positive integer. + * + * @throw IllegalArgumentException or ArrayOutOfBoundsException if + * c is not in the Base64 Alphabet. + */ + private static int base64toInt(char c, byte[] alphaToInt) { + int result = alphaToInt[c]; + if (result < 0) { + throw new IllegalArgumentException("Illegal character " + c); + } + return result; + } + /** + * This array is a lookup table that translates unicode characters + * drawn from the "Base64 Alphabet" (as specified in Table 1 of RFC 2045) + * into their 6-bit positive integer equivalents. Characters that + * are not in the Base64 alphabet but fall within the bounds of the + * array are translated to -1. + */ + private static final byte base64ToInt[] = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 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, -1, -1, -1, -1, -1, -1, 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 + }; + /** + * This array is the analogue of base64ToInt, but for the nonstandard + * variant that avoids the use of uppercase alphabetic characters. + */ + private static final byte altBase64ToInt[] = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, + 2, 3, 4, 5, 6, 7, 8, -1, 62, 9, 10, 11, -1, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 12, 13, 14, -1, 15, 63, 16, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 17, -1, 18, 19, 21, 20, 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, 22, 23, 24, 25 + }; + + public static void main(String args[]) { +// int numRuns = Integer.parseInt(args[0]); +// int numBytes = Integer.parseInt(args[1]); +// java.util.Random rnd = new java.util.Random(); +// for (int i=0; i 9999999 + || ((BigDecimal) value).doubleValue() <= 0) { + + throw new WrongValueException(comp, + Labels.getLabel("MSG.CONSTRAINT.DECIMALBOX")); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/ConstraintDoubleBox.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/ConstraintDoubleBox.java new file mode 100644 index 000000000..e75920b6d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/ConstraintDoubleBox.java @@ -0,0 +1,24 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.web.utilerias; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zul.Constraint; +/** + * + * @author Rafius + */ +public class ConstraintDoubleBox implements Constraint { + + public void validate(Component comp, Object value) throws WrongValueException { + if (value == null || ((Double) value) > 9999999 + || ((Double) value) <= 0) { + throw new WrongValueException(comp, + Labels.getLabel("MSG.CONSTRAINT.DECIMALBOX")); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/ConstraintEmailOrEmpty.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/ConstraintEmailOrEmpty.java new file mode 100644 index 000000000..c79d0f6cd --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/ConstraintEmailOrEmpty.java @@ -0,0 +1,28 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zul.Constraint; +import org.zkoss.zul.SimpleConstraint; + +/** + * + * @author Rafius + */ +public class ConstraintEmailOrEmpty implements Constraint { + + public void validate(Component comp, Object value) throws WrongValueException { + if ((value != null) && (!value.toString().equals(""))) { + try { + new SimpleConstraint("/.+@.+\\.[A-Z]+/").validate(comp, value); + } catch (WrongValueException e) { + throw new WrongValueException(comp, Labels.getLabel("MSG.emailValido")); + } + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/ConstraintNumberBD.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/ConstraintNumberBD.java new file mode 100644 index 000000000..19858d640 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/ConstraintNumberBD.java @@ -0,0 +1,75 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import java.math.BigDecimal; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zul.Constraint; + +/** + * + * @author Gleimar + */ +public class ConstraintNumberBD implements Constraint { + + private Integer precision; + private Integer scale; + private Boolean obligatorio = false; + + /** + * Ex.: (precision,scale) == (3,2) Va a aceptar numero menores que 9.99 + * @param preicion - La precision del numero + * @param scale - La escala + */ + public ConstraintNumberBD(Integer preicion, Integer scale) { + this(preicion, scale, false); + } + + public ConstraintNumberBD(Integer preicion, Integer scale, Boolean obligatorio) { + if ((preicion == null) || (scale == null)) { + throw new IllegalArgumentException("Deve de ser informado el valor de la precicion y scale"); + } + this.precision = preicion; + this.scale = scale; + this.obligatorio = obligatorio; + } + + public void validate(Component comp, Object value) throws WrongValueException { + + if ((precision != null) && (scale != null)) { + + + if ((value != null) && (value instanceof String)) { + value = (((String) value).trim().equals("")) ? null : value; + } + if (obligatorio && (value == null)) { + throw new WrongValueException(comp, + Labels.getLabel("MSG.CONSTRAINT.CONSTRAINTNUMBERBDOBLIGATORIO")); + } + + if (value == null) { + return; + } + + BigDecimal valor = getBigDecimal(value); + + if ((valor.precision() > precision) || (valor.scale() > scale)) { + throw new WrongValueException(comp, + Labels.getLabel("MSG.CONSTRAINT.CONSTRAINTNUMBERBD", new Object[]{precision - 2, scale})); + } + } + } + + private BigDecimal getBigDecimal(Object value) { + + if (value instanceof BigDecimal) { + return (BigDecimal) value; + } + + return new BigDecimal((String) value); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/ConstraintPorcentagem.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/ConstraintPorcentagem.java new file mode 100644 index 000000000..1ef5fc8ae --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/ConstraintPorcentagem.java @@ -0,0 +1,31 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import java.math.BigDecimal; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zul.Constraint; + +/** + * + * @author Administrador + */ +public class ConstraintPorcentagem implements Constraint { + + public void validate(Component comp, Object value) throws WrongValueException { + if (value == null) { + throw new WrongValueException(comp, + Labels.getLabel("MSG.CONSTRAINT.PORCENTAGEM")); + } else if (((BigDecimal) value).doubleValue() > 100) { + throw new WrongValueException(comp, + Labels.getLabel("MSG.CONSTRAINT.PORCENTAGEM")); + } else if (((BigDecimal) value).doubleValue() < 0) { + throw new WrongValueException(comp, + Labels.getLabel("MSG.CONSTRAINT.PORCENTAGEM")); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/GenericSpringComposer.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/GenericSpringComposer.java new file mode 100644 index 000000000..f54671bba --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/GenericSpringComposer.java @@ -0,0 +1,61 @@ +package com.rjconsultores.ventaboletos.web.utilerias; + +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +import java.lang.reflect.Field; + +import javax.annotation.Resource; +import javax.servlet.ServletContext; + +import org.springframework.context.ApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.util.GenericForwardComposer; +/* + * + * link http://zkforge.svn.sourceforge.net/viewvc/zkforge/trunk/zktodo2/src/main/java/org/zkforge/zktodo2/GenericSpringComposer.java?revision=926&view=markup + */ + +public class GenericSpringComposer extends GenericForwardComposer { + + private static final long serialVersionUID = -8554216461300908912L; + private ServletContext servletContext = null; + + @Override + public void doAfterCompose(Component comp) throws Exception { + super.doAfterCompose(comp); + this.servletContext = (ServletContext) comp.getDesktop().getWebApp().getNativeContext(); + this.wireBeans(); + } + + @Override + public void didActivate(Component component) { + System.out.println("jfjfjfjfjfjf"); + super.didActivate(component); + try { + this.wireBeans(); + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + + private void wireBeans() throws IllegalArgumentException, IllegalAccessException { + System.out.println("dffff wireBeans"); + ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(this.servletContext); + Field[] fields = this.getClass().getDeclaredFields(); + for (Field f : fields) { + System.out.println("asdfasdfa " + f.getName()); + Resource annotation = f.getAnnotation(Resource.class); + if (annotation != null) { + f.setAccessible(true); // Make private fields accessible. + Object bean = ctx.getBean(annotation.name()); + f.set(this, bean); + } + + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MACConstraint.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MACConstraint.java new file mode 100644 index 000000000..83c086c04 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MACConstraint.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zul.Constraint; + +/** + * + * @author gleimar + */ +public class MACConstraint implements Constraint { + + @Override + public void validate(Component cmpnt, Object o) throws WrongValueException { + if (o == null) { + throw new WrongValueException(cmpnt, Labels.getLabel("MSG.CONSTRAINT.MACConstraint")); + } + + String strMAC = o.toString(); + + strMAC = strMAC.replaceAll("-", ""); + + if (strMAC.length() != 12) { + throw new WrongValueException(cmpnt, Labels.getLabel("MSG.CONSTRAINT.MACConstraint")); + } + + try { + Long.parseLong(strMAC, 16); + } catch (Throwable t) { + throw new WrongValueException(cmpnt, Labels.getLabel("MSG.CONSTRAINT.MACConstraint")); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MultiLineMessageBox.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MultiLineMessageBox.java new file mode 100644 index 000000000..83f530b15 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MultiLineMessageBox.java @@ -0,0 +1,137 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Messagebox; + +/** + * Extended messagebox that can show multi-lined messages.
+ * Lines can be breaked with the \n .
+ *
+ * + * @author Stephan Gerth / Forsthaus Datentechnik + * @email sge(at)forsthaus(dot)de + * @changes 04.07.2009/sge extended for showing the icons
+ * 05.07.2009/sge added an empty line before and after the message.
+ * 08.07.2009/sge added for the EventListener + * + */ +public class MultiLineMessageBox extends Messagebox { + + private static final long serialVersionUID = 1L; + // path of the messagebox zul-template + private static String _templ = "/component/multiLineMessageBox.zul"; + + public MultiLineMessageBox() { + } + + public static void doSetTemplate() { + setTemplate(_templ); + } + + /** + * Shows a message box and returns what button is pressed. A shortcut to + * show(message, null, OK, INFORMATION).
+ *
+ * Simple MessageBox with customizable message and title.
+ * + * @param message + * The message to display. + * @param title + * The title to display. + * @param icon + * The icon to display.
+ * QUESTION = "z-msgbox z-msgbox-question";
+ * EXCLAMATION = "z-msgbox z-msgbox-exclamation";
+ * INFORMATION = "z-msgbox z-msgbox-imformation";
+ * ERROR = "z-msgbox z-msgbox-error";
+ * @param buttons + * MultiLineMessageBox.CANCEL
+ * MultiLineMessageBox.YES
+ * MultiLineMessageBox.NO
+ * MultiLineMessageBox.ABORT
+ * MultiLineMessageBox.RETRY
+ * MultiLineMessageBox.IGNORE
+ * @param padding + * true = Added an empty line before and after the message.
+ * + * + * @return + * @throws InterruptedException + */ + public static final int show(String message, String title, int buttons, String icon, boolean padding) throws InterruptedException { + + String msg = message; + + if (padding) { + msg = "\n" + message + "\n\n"; + } + + if (icon.equals("QUESTION")) { + icon = "z-msgbox z-msgbox-question"; + } else if (icon.equals("EXCLAMATION")) { + icon = "z-msgbox z-msgbox-exclamation"; + } else if (icon.equals("INFORMATION")) { + icon = "z-msgbox z-msgbox-imformation"; + } else if (icon.equals("ERROR")) { + icon = "z-msgbox z-msgbox-error"; + } + + return show(msg, title, buttons, icon, 0, null); + } + + /** + * Shows a message box and returns what button is pressed. A shortcut to + * show(message, null, OK, INFORMATION).
+ *
+ * Simple MessageBox with customizable message and title.
+ * + * @param message + * The message to display. + * @param title + * The title to display. + * @param icon + * The icon to display.
+ * QUESTION = "z-msgbox z-msgbox-question";
+ * EXCLAMATION = "z-msgbox z-msgbox-exclamation";
+ * INFORMATION = "z-msgbox z-msgbox-imformation";
+ * ERROR = "z-msgbox z-msgbox-error";
+ * @param buttons + * MultiLineMessageBox.CANCEL
+ * MultiLineMessageBox.YES
+ * MultiLineMessageBox.NO
+ * MultiLineMessageBox.ABORT
+ * MultiLineMessageBox.RETRY
+ * MultiLineMessageBox.IGNORE
+ * @param padding + * true = Added an empty line before and after the message.
+ * + * + * @return + * @throws InterruptedException + */ + public static final int show(String message, String title, int buttons, String icon, boolean padding, EventListener listener) + throws InterruptedException { + + String msg = message; + + if (padding) { + msg = "\n" + message + "\n\n"; + } + + if (icon.equals("QUESTION")) { + icon = "z-msgbox z-msgbox-question"; + } else if (icon.equals("EXCLAMATION")) { + icon = "z-msgbox z-msgbox-exclamation"; + } else if (icon.equals("INFORMATION")) { + icon = "z-msgbox z-msgbox-imformation"; + } else if (icon.equals("ERROR")) { + icon = "z-msgbox z-msgbox-error"; + } + + return show(msg, title, buttons, icon, 0, listener); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyAppInit.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyAppInit.java new file mode 100644 index 000000000..6dfb8c392 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyAppInit.java @@ -0,0 +1,139 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import com.rjconsultores.ventaboletos.entidad.Constante; +import com.rjconsultores.ventaboletos.service.ConstanteService; +import com.rjconsultores.ventaboletos.web.gui.controladores.job.GeneracionCorridaJob; +import com.rjconsultores.ventaboletos.web.utilerias.spring.AppContext; +import javax.servlet.ServletContext; +import org.apache.log4j.Logger; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.WebApp; +import org.quartz.JobDetail; +import org.quartz.Scheduler; +import org.quartz.SchedulerException; +import org.quartz.SchedulerFactory; +import org.quartz.Trigger; +import org.quartz.TriggerUtils; +import org.quartz.impl.StdSchedulerFactory; +import org.springframework.beans.factory.BeanFactory; +import org.springframework.context.ApplicationContext; + +/** + * + * @author gleimar + */ +public class MyAppInit implements org.zkoss.zk.ui.util.WebAppInit { + + private static Logger log = Logger.getLogger(MyAppInit.class); + SchedulerFactory schedFact = new StdSchedulerFactory(); + Scheduler sched; + + public Scheduler getSched() { + return sched; + } + + public void setSched(Scheduler sched) { + this.sched = sched; + } + + public SchedulerFactory getSchedFact() { + return schedFact; + } + + public void setSchedFact(SchedulerFactory schedFact) { + this.schedFact = schedFact; + } + + @Override + public void init(WebApp wapp) throws Exception { + Labels.register(new MyLabelLocatorGeneral((ServletContext) wapp.getNativeContext())); + Labels.register(new MyLabelLocatorCliente((ServletContext) wapp.getNativeContext())); + + //Generacion Automatica de Corridas + jobGeneracionCorridas(); + } + + private Integer[] horaExecucion() { + + ApplicationContext appContext = AppContext.getApplicationContext(); + + BeanFactory factory = (BeanFactory) appContext; + ConstanteService cs = (ConstanteService) factory.getBean("constanteService"); + + Constante constante = cs.buscarPorNomeConstante("HORA_GENERACION_CORRIDA"); + + Integer[] arrayHoraMinuto = new Integer[2]; + arrayHoraMinuto[0] = 1; + arrayHoraMinuto[1] = 0; + + if (constante == null) { + return arrayHoraMinuto; + } + + int hora = 1; + int minuto = 0; + try { + String[] vlrContante = constante.getValorconstante().split(":"); + + hora = Integer.parseInt(vlrContante[0]); + minuto = Integer.parseInt(vlrContante[1]); + if (hora < 0 || hora > 23) { + hora = 1; + } + if (minuto < 0 || minuto > 59) { + minuto = 0; + } + + arrayHoraMinuto[0] = hora; + arrayHoraMinuto[1] = minuto; + + } catch (Exception e) { + log.error("Param hora geracion corrida inválido : " + constante.getValorconstante()); + arrayHoraMinuto[0] = 1; + arrayHoraMinuto[1] = 0; + } + + return arrayHoraMinuto; + + } + + private void jobGeneracionCorridas() { + try { + sched = schedFact.getScheduler(); + + JobDetail jobDetail = new JobDetail("GeneracionCorridas", null, GeneracionCorridaJob.class); + + Integer[] hora = horaExecucion(); + + log.debug("Horario de geracao de corrida : " + hora[0] + ":" + hora[1]); + + Trigger trigger = TriggerUtils.makeDailyTrigger("generacionCorridasTrigger", hora[0], hora[1]); + + //TESTE TRIGGER + //Trigger trigger = TriggerUtils.makeImmediateTrigger("generacionCorridasTrigger", 1, 1000); + + trigger.setName("generacionCorridasTrigger"); + + JobDetail job = sched.getJobDetail(jobDetail.getName(), jobDetail.getGroup()); + + log.info("Job="+jobDetail.getName() +"." +jobDetail.getGroup()); + + if (job != null) { + log.info("Job ya existia"); + boolean deleted= sched.deleteJob(job.getName(), Scheduler.DEFAULT_GROUP); + log.info("Deleted="+deleted); + } + + sched.scheduleJob(jobDetail, trigger); + + sched.start(); + + } catch (SchedulerException ex) { + log.error(ex); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxCiudad.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxCiudad.java new file mode 100644 index 000000000..037febe74 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxCiudad.java @@ -0,0 +1,100 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.service.CiudadService; +import java.util.ArrayList; +import java.util.List; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.event.InputEvent; +import org.zkoss.zkplus.databind.BindingListModel; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zkplus.spring.SpringUtil; +import org.zkoss.zul.Combobox; + +/** + * + * @author rodrigo + */ +public class MyComboboxCiudad extends Combobox { + + private CiudadService ciudadService; + private List lsCiudad; + private Ciudad initialValue; + private Integer indiceSelected = null; + + public MyComboboxCiudad() { + + super(); + + ciudadService = (CiudadService) SpringUtil.getBean("ciudadService"); + lsCiudad = new ArrayList(); + + this.setAutodrop(false); + this.setAutocomplete(false); + + + this.addEventListener("onOK", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + String strCiudad = MyComboboxCiudad.this.getText().toUpperCase(); + + if (strCiudad.length() < MyComboboxParada.minLength) { + return; + } + if (!strCiudad.isEmpty()) { + lsCiudad = ciudadService.buscaLike(strCiudad); + + BindingListModel listModelCiudad = new BindingListModelList(lsCiudad, true); + MyComboboxCiudad.this.setModel(listModelCiudad); + indiceSelected = null; + if (!lsCiudad.isEmpty()) { + indiceSelected = 0; + } + + MyComboboxCiudad.this.open(); + } else { + lsCiudad.clear(); + + BindingListModel listModelCiudad = new BindingListModelList(lsCiudad, true); + MyComboboxCiudad.this.setModel(listModelCiudad); + } + } + }); + + this.addEventListener("onChanging", new EventListener() { + + public void onEvent(Event event) throws Exception { + InputEvent ev = (InputEvent) event; + String strCiudad = ev.getValue(); + if (strCiudad.length() < 2) { + lsCiudad.clear(); + + BindingListModel listModelCiudad = new BindingListModelList(lsCiudad, true); + MyComboboxCiudad.this.setModel(listModelCiudad); + + MyComboboxCiudad.this.close(); + } + } + }); + } + + public Ciudad getInitialValue() { + return initialValue; + } + + public void setInitialValue(Ciudad initialValue) { + if (initialValue == null) { + return; + } + List ls = new ArrayList(); + ls.add(initialValue); + + this.setModel(new BindingListModelList(ls, false)); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxEstandar.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxEstandar.java new file mode 100644 index 000000000..a26642583 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxEstandar.java @@ -0,0 +1,34 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; + +/** + * + * @author gleimar + */ +public class MyComboboxEstandar extends Combobox { + + public MyComboboxEstandar() { + super(); + + this.setAutodrop(true); + this.setAutocomplete(true); + this.setReadonly(true); + this.setCtrlKeys("#del"); + + this.addEventListener("onCtrlKey", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + MyComboboxEstandar.this.setSelectedItem(null); + MyComboboxEstandar.this.close(); + } + }); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParada.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParada.java new file mode 100644 index 000000000..2fe87d0b1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxParada.java @@ -0,0 +1,132 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.service.ParadaService; +import java.util.ArrayList; +import java.util.List; +import org.apache.log4j.Logger; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.event.InputEvent; +import org.zkoss.zkplus.databind.BindingListModel; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zkplus.spring.SpringUtil; +import org.zkoss.zul.Combobox; + +/** + * + * @author Administrador + */ +public class MyComboboxParada extends Combobox { + + private static Logger log = Logger.getLogger(MyComboboxParada.class); + public final static int minLength = 2; + private ParadaService paradaService; + private List lsParadas; + private Parada initialValue; + private Integer indiceSelected = null; + private boolean sinTodos = false; + private Integer ID_TODOS = -1; + + public MyComboboxParada() { + super(); + + paradaService = (ParadaService) SpringUtil.getBean("paradaService"); + lsParadas = new ArrayList(); + + this.setAutodrop(false); + this.setAutocomplete(false); + + this.addEventListener("onOK", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + System.out.println("onOK"); + String strParada = MyComboboxParada.this.getText().toUpperCase(); + if (strParada.length() < MyComboboxParada.minLength) { + return; + } + if (!strParada.isEmpty()) { + lsParadas = paradaService.buscaLike(strParada); + + if (sinTodos) { + log.debug("Sin todos"); + Parada p = paradaService.obtenerID(ID_TODOS); + lsParadas.remove(p); + } + + BindingListModel listModelParada = new BindingListModelList(lsParadas, true); + MyComboboxParada.this.setModel(listModelParada); + indiceSelected = null; + if (!lsParadas.isEmpty()) { + indiceSelected = 0; + } + + MyComboboxParada.this.open(); + } else { + lsParadas.clear(); + + BindingListModel listModelParada = new BindingListModelList(lsParadas, true); + MyComboboxParada.this.setModel(listModelParada); + } + } + }); + + this.addEventListener("onChanging", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + System.out.println("onChanging"); + InputEvent ev = (InputEvent) event; + String strParada = ev.getValue(); + if (strParada.length() < 2) { + lsParadas.clear(); + + BindingListModel listModelParada = new BindingListModelList(lsParadas, true); + MyComboboxParada.this.setModel(listModelParada); + + MyComboboxParada.this.close(); + } + } + }); + } + + public Parada getInitialValue() { + return initialValue; + } + + public void setInitialValue(Parada initialValue) { + if (initialValue == null) { + return; + } + List ls = new ArrayList(); + ls.add(initialValue); + + this.setModel(new BindingListModelList(ls, false)); + this.setText(initialValue.getDescparada()); + } + + public void getValue(boolean checaBusqueda) throws WrongValueException { + if (checaBusqueda) { + if (this.getSelectedItem() == null) { + throw new WrongValueException(this, Labels.getLabel("MSG.Error.combobox.hacerBusqueda")); + } + } else { + super.getValue(); + } + } + + public boolean isSinTodos() { + return sinTodos; + } + + public void setSinTodos(boolean sinTodos) { + this.sinTodos = sinTodos; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxPuntoVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxPuntoVenta.java new file mode 100644 index 000000000..0b9cb5070 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyComboboxPuntoVenta.java @@ -0,0 +1,112 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import java.util.ArrayList; +import java.util.List; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.event.InputEvent; +import org.zkoss.zkplus.databind.BindingListModel; +import org.zkoss.zkplus.databind.BindingListModelList; +import org.zkoss.zkplus.spring.SpringUtil; +import org.zkoss.zul.Combobox; + +/** + * + * @author Administrador + */ +public class MyComboboxPuntoVenta extends Combobox { + + private PuntoVentaService puntoVentaService; + private List lsPuntoVenta; + private PuntoVenta initialValue; + private Integer indiceSelected = null; + + public MyComboboxPuntoVenta() { + super(); + + puntoVentaService = (PuntoVentaService) SpringUtil.getBean("puntoVentaService"); + lsPuntoVenta = new ArrayList(); + + this.setAutodrop(false); + this.setAutocomplete(false); + + + this.addEventListener("onOK", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + String strPuntoVenta = MyComboboxPuntoVenta.this.getText().toUpperCase(); + if (strPuntoVenta.length() < MyComboboxParada.minLength) { + return; + } + if (!strPuntoVenta.isEmpty()) { + lsPuntoVenta = puntoVentaService.buscaLike(strPuntoVenta); + + BindingListModel listModelPuntoVenta = new BindingListModelList(lsPuntoVenta, true); + MyComboboxPuntoVenta.this.setModel(listModelPuntoVenta); + indiceSelected = null; + if (!lsPuntoVenta.isEmpty()) { + indiceSelected = 0; + } + MyComboboxPuntoVenta.this.open(); + } else { + lsPuntoVenta.clear(); + + BindingListModel listModelPuntoVenta = new BindingListModelList(lsPuntoVenta, true); + MyComboboxPuntoVenta.this.setModel(listModelPuntoVenta); + } + } + }); + + this.addEventListener("onChanging", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + InputEvent ev = (InputEvent) event; + String strPuntoVenta = ev.getValue(); + if (strPuntoVenta.length() < 2) { + lsPuntoVenta.clear(); + + BindingListModel listModelPuntoVenta = new BindingListModelList(lsPuntoVenta, true); + MyComboboxPuntoVenta.this.setModel(listModelPuntoVenta); + + MyComboboxPuntoVenta.this.close(); + } + } + }); + } + + public PuntoVenta getInitialValue() { + return initialValue; + } + + public void setInitialValue(PuntoVenta initialValue) { + if (initialValue == null) { + return; + } + List ls = new ArrayList(); + ls.add(initialValue); + + this.setModel(new BindingListModelList(ls, false)); + } + + public void getValue(boolean checaBusqueda) throws WrongValueException { + if (checaBusqueda) { + PuntoVenta p = (PuntoVenta) (this.getSelectedItem() == null ? null : this.getSelectedItem().getValue()); + + if (p == null) { + throw new WrongValueException(this, Labels.getLabel("MSG.Error.combobox.hacerBusqueda")); + } + } else { + super.getValue(); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyDatebox.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyDatebox.java new file mode 100644 index 000000000..911fd160e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyDatebox.java @@ -0,0 +1,43 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.event.Events; +import org.zkoss.zul.Datebox; + +/** + * + * @author Administrador + */ +public class MyDatebox extends Datebox { + + public MyDatebox() { + setLenient(Boolean.FALSE); + + this.addEventListener(Events.ON_CHANGING, new EventListener() { + + String vazia = " "; + char[] charVazio = vazia.toCharArray(); + char c = charVazio[0]; + + @Override + public void onEvent(Event event) throws Exception { + // tentativa de atualizar o Datebox e retornar o caracter que + // acabou de se digitado: + MyDatebox.this.getValue(); + + String digitado = MyDatebox.this.getText(); + Boolean temLetraDigitado = digitado.matches("^[a-zA-Z]+$"); + + if (temLetraDigitado) { + digitado = digitado.replace(digitado.charAt(digitado.length() - 1), c); + MyDatebox.this.setText(digitado); + } + } + }); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyGenericForwardComposer.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyGenericForwardComposer.java new file mode 100644 index 000000000..2043ebe6c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyGenericForwardComposer.java @@ -0,0 +1,68 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import java.util.Map; +import org.apache.log4j.Logger; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Path; +import org.zkoss.zk.ui.UiException; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zk.ui.util.GenericForwardComposer; +import org.zkoss.zul.Window; + +/** + * + * @author gleimar + */ +public class MyGenericForwardComposer extends GenericForwardComposer { + + public static int OVERLAPPED = PantallaUtileria.OVERLAPPED; + public static int MODAL = PantallaUtileria.MODAL; + private static Logger log = Logger.getLogger(MyGenericForwardComposer.class); + + public void openWindow(String component, String title, Map args) { + PantallaUtileria.openWindow(component, title, args, OVERLAPPED, desktop); + } + + public void openWindowPosi(String component, String title, Map args, int type, String pos) { + PantallaUtileria.openWindowPosi(component, title, args, type, pos, desktop); + } + + public void openWindow(String component, String title, Map args, int type, Boolean closabled) { + PantallaUtileria.openWindow(component, title, args, type, closabled, desktop); + } + + public void openWindow(String component, String title, Map args, int type) { + PantallaUtileria.openWindow(component, title, args, type, desktop); + } + + public void openWindowPosi(String component, String title, Map args, String pos) { + PantallaUtileria.openWindowPosi(component, title, args, OVERLAPPED, pos, desktop); + } + + public void closeWindow() { + if (this.self instanceof Window) { + ((Window) this.self).detach(); + } + } + + @Override + public boolean doCatch(Throwable ex) throws Exception { + + if (ex instanceof WrongValueException){ + throw (WrongValueException)ex; + } + + log.error("Erro ao abrir a janela", ex); + + alert(Labels.getLabel("MSG.Error.Open.Windows")); + + this.closeWindow(); + + return true; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyLabelLocatorCliente.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyLabelLocatorCliente.java new file mode 100644 index 000000000..9f5613813 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyLabelLocatorCliente.java @@ -0,0 +1,68 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Locale; + +import javax.servlet.ServletContext; + +import org.apache.log4j.Logger; +import org.springframework.core.io.ClassPathResource; + +/** + * + * @author gleimar + */ +public class MyLabelLocatorCliente implements org.zkoss.util.resource.LabelLocator { + + private static Logger log = Logger.getLogger(MyLabelLocatorCliente.class); + private ServletContext _svlctx; + private static final String pathTraduccionCliente = "/com/rjconsultores/ventaboletos/web/cliente/traduccion/"; + + public MyLabelLocatorCliente(ServletContext svlctx) { + if (svlctx == null) { + throw new IllegalArgumentException("null"); + } + + _svlctx = svlctx; + } + + public URL locate(Locale locale) { + URL resource = null; + try { + + resource = new ClassPathResource(pathTraduccionCliente + getI3LabelName(locale)).getURL(); + + if (resource == null) { + resource = new ClassPathResource(pathTraduccionCliente + getI3LabelDefault()).getURL(); + } + + } catch (IOException ex) { + log.error("Error al cargar locale:" + locale); + try { + resource = new ClassPathResource(pathTraduccionCliente + getI3LabelDefault()).getURL(); + + } catch (MalformedURLException ex1) { + log.error("Error al cargar la traduccion estandard.", ex1); + } catch (IOException e) { + log.error("No fue posible cargar el archivo de traduccion del cliente"); + } + } + + return resource; + + } + + private static final String getI3LabelName(Locale locale) { + return "i3-label_" + locale + ".label"; + } + + private static final String getI3LabelDefault() { + return "i3-label_es_MX.label"; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyLabelLocatorGeneral.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyLabelLocatorGeneral.java new file mode 100644 index 000000000..96917b585 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyLabelLocatorGeneral.java @@ -0,0 +1,58 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Locale; +import java.util.logging.Level; +import javax.servlet.ServletContext; +import org.apache.log4j.Logger; + +/** + * + * @author gleimar + */ +public class MyLabelLocatorGeneral implements org.zkoss.util.resource.LabelLocator { + + private static Logger log = Logger.getLogger(MyLabelLocatorGeneral.class); + private ServletContext _svlctx; + + public MyLabelLocatorGeneral(ServletContext svlctx) { + if (svlctx == null) { + throw new IllegalArgumentException("null"); + } + + _svlctx = svlctx; + } + + public URL locate(Locale locale) { + URL resource = null; + try { + resource =_svlctx.getResource("/WEB-INF/" + getI3LabelName(locale)); + if (resource == null){ + resource= _svlctx.getResource("/WEB-INF/" + getI3LabelDefault()); + } + } catch (MalformedURLException ex) { + log.error("Error al cargar locale:"+locale,ex); + try { + resource= _svlctx.getResource("/WEB-INF/" + getI3LabelDefault()); + } catch (MalformedURLException ex1) { + log.error("Error al cargar la traduccion estandard.",ex1); + throw new RuntimeException(ex1); + } + } + return resource; + + } + + private static final String getI3LabelName(Locale locale) { + return "i3-label_" + locale + ".label"; + } + private static final String getI3LabelDefault() { + return "i3-label_es_MX.label"; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyListbox.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyListbox.java new file mode 100644 index 000000000..9e962bdb4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyListbox.java @@ -0,0 +1,101 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import org.zkoss.zul.ListModelList; +import org.zkoss.zul.Listbox; + +/** + * + * @author gleimar + */ +public class MyListbox extends Listbox { + + private Object selected = null; + private ListModelList modelList = new ListModelList(); + + public void setData(List data) { + + this.modelList.clear(); + this.modelList.addAll(data); + + super.setModel(modelList); + } + + public MyListbox() { + super.setModel(modelList); + setVflex(Boolean.TRUE); + } + + /** + * Adiciona um item na lista caso ele não esteja presente na lista + * @param item + * @return - True se o item foi adicionado + */ + public boolean addItem(Object item) { + boolean ok = false; + if (!this.modelList.contains(item)) { + ok = this.modelList.add(item); + } + + return ok; + } + + /** + * Atualiza se o item está presente na lista. Caso não esteja presente, o item é adicionado. + * @param item + */ + public void updateItem(Object item) { + if (this.modelList.contains(item)) { + this.modelList.set(modelList.indexOf(item), item); + } else { + this.addItem(item); + } + } + + public void removeItem(Object item) { + this.modelList.remove(item); + } + + public Object getSelected() { + int index = this.getSelectedIndex(); + selected = null; + if (index != -1) { + selected = this.modelList.get(index); + } + + return this.selected; + } + + public List getSelectedsItens() { +// List selecteds = new ArrayList(); +// Set set = getSelectedItems(); +// Object[] os = set.toArray(); +// selecteds.addAll(Arrays.asList(os)); + + int index = this.getSelectedIndex(); + int qtd = this.getSelectedCount(); + List selecteds = new ArrayList(); + if (index != -1) { + for (int i = 0; i < qtd; i++) { + selecteds.add(this.modelList.get(index + i)); + } + } + + return selecteds; + } + + public int getSize() { + return (modelList == null) ? 0 : modelList.getSize(); + } + + public Object[] getData() { + return this.modelList.toArray(); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyPaging.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyPaging.java new file mode 100644 index 000000000..7c5fee08e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyPaging.java @@ -0,0 +1,24 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import org.zkoss.zul.Paging; + +/** + * + * @author gleimar + */ +public class MyPaging extends Paging { + + public static final int PAGE_SIZE_DEFAULT = 15; + + public MyPaging(int totalsz, int pagesz) { + super(totalsz, PAGE_SIZE_DEFAULT); + } + + public MyPaging() { + this.setPageSize(PAGE_SIZE_DEFAULT); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyTextbox.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyTextbox.java new file mode 100644 index 000000000..0e24bc840 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyTextbox.java @@ -0,0 +1,48 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import org.zkoss.zk.ui.WrongValueException; + +import org.zkoss.zul.Textbox; + +/** + * + * @author Administrador + */ +public class MyTextbox extends Textbox { + + public MyTextbox() { + this.setStyle("text-transform:uppercase;"); + } + + @Override + public String getValue() throws WrongValueException { + return super.getValue().toUpperCase().trim(); + } + + @Override + public void setValue(String value) throws WrongValueException { + if (value == null) { + super.setValue(value); + } else { + super.setValue(value.toUpperCase().trim()); + } + } + + @Override + public String getText() throws WrongValueException { + return super.getText().toUpperCase().trim(); + } + + @Override + public void setText(String value) throws WrongValueException { + if (value == null) { + super.setText(value); + } else { + super.setText(value.toUpperCase().trim()); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyTextboxDecimal.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyTextboxDecimal.java new file mode 100644 index 000000000..7b86de8d9 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/MyTextboxDecimal.java @@ -0,0 +1,237 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import java.math.BigDecimal; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.WrongValueException; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.event.InputEvent; +import org.zkoss.zk.ui.ext.AfterCompose; +import org.zkoss.zk.ui.util.Clients; +import org.zkoss.zul.Constraint; +import org.zkoss.zul.Textbox; + +/** + * Textbox con validaciones de valores numericos. + * + * Validaciones extras: + * maxValue - Indica cuál es el valor máximo permitido en el campo + * precision - Cuál es la precision de número + * scale - Cuál es la scala + * obligatorio - Indica se es obligatorio. El valo inicial es false. + * allowZero - Indica si es permitido valor cero + * allowNegative -Indica si es permitido valores negativos + * defaultZero - Indica se el valor inicial es cero + * + * + * Además de las validaciones extras, si puede ocupar las validaciones del ZK (no emptu, etc) + * + * @author gleimar + */ +public class MyTextboxDecimal extends Textbox implements AfterCompose { + + private String maxValue; + private Integer precision; + private Integer scale; + private Boolean obligatorio = false; + private Boolean allowZero = false; + private Boolean allowNegative = false; + private Boolean defaultZero = false; + private Constraint myConstraint; + private Constraint constraintTag;// variable con las constraints informadas + // en constraint="no empty" + + public MyTextboxDecimal(String value) throws WrongValueException { + super(value); + this.registrarEventos(); + } + + public MyTextboxDecimal() { + this.registrarEventos(); + } + + private void registrarEventos() { + + this.addEventListener("onChanging", new EventListener() { + + public void onEvent(Event event) throws Exception { + if (event instanceof InputEvent) { + + InputEvent ev = (InputEvent) event; + String val = ev.getValue(); + myConstraint.validate(MyTextboxDecimal.this, val); + } + } + }); + } + + private BigDecimal getBigDecimal(String val) { + + if ((val == null) || (val.trim().equals(""))) { + return (BigDecimal) null; + } + val = val.trim(); + + boolean negativo = val.startsWith("-"); + if (negativo) { + val = val.replace("-", "").replaceAll(",", ""); + return (val.isEmpty() ? (BigDecimal) null : new BigDecimal(val) + .negate()); + + } else { + return new BigDecimal(val.replaceAll(",", "")); + } + } + + private void aplicarMascara() { + Clients.evalJavaScript("jQuery('#" + this.getUuid() + + "').maskMoney({allowZero:" + allowZero + ", allowNegative:" + + allowNegative + ", defaultZero:" + defaultZero + + ",thousands:',', decimal:'.'})"); + } + + public String getMaxValue() { + return maxValue; + } + + public void setMaxValue(String maxValue) { + this.maxValue = maxValue; + } + + public Boolean getObligatorio() { + return obligatorio; + } + + public void setObligatorio(Boolean obligatorio) { + this.obligatorio = obligatorio; + } + + public Integer getPrecision() { + return precision; + } + + public void setPrecision(Integer precision) { + this.precision = precision; + } + + public Integer getScale() { + return scale; + } + + public void setScale(Integer scale) { + this.scale = scale; + } + + public BigDecimal getValueDecimal() { + return this.getBigDecimal(this.getValue()); + } + + public Boolean getAllowZero() { + return allowZero; + } + + public void setAllowZero(Boolean allowZero) { + this.allowZero = allowZero; + } + + public Boolean getDefaultZero() { + return defaultZero; + } + + public void setDefaultZero(Boolean defaultZero) { + this.defaultZero = defaultZero; + } + + public void afterCompose() { + aplicarMascara(); + + myConstraint = new MyTextboxDecimalConstraint(); + + super.setConstraint(myConstraint); + } + + /** + * Agrega la constraint a las validaciones que ya existen + * + * @param Constraint - La constraint que se va a agregar + */ + @Override + public void setConstraint(Constraint c) { + if ( (c instanceof MyTextboxDecimalConstraint) || (c == null)){ + super.setConstraint(c); + }else{ + this.constraintTag = c; + } + } + + public Boolean getAllowNegative() { + return allowNegative; + } + + public void setAllowNegative(Boolean allowNegative) { + this.allowNegative = allowNegative; + } + + class MyTextboxDecimalConstraint implements Constraint { + @Override + public void validate(Component comp, Object oVal) + throws WrongValueException { + + //Si fue informado alguna constraint, esa es validada primer + if (constraintTag != null) { + constraintTag.validate(comp, oVal); + } + + String val = oVal.toString(); + if (obligatorio && ((val == null) || (val.trim().equals("")))) { + throw new WrongValueException( + comp, + Labels.getLabel("MSG.CONSTRAINT.CONSTRAINTNUMBERBDOBLIGATORIO")); + } else if (maxValue != null) { + + BigDecimal bd = getBigDecimal(val); + + if (bd == null) { + return; + } + BigDecimal bdMaxValue = new BigDecimal(maxValue); + + if (bd.compareTo(bdMaxValue) > 0) { + MyTextboxDecimal.this.setRawValue((String) null); + Constraint c = getConstraint(); + setConstraint((String) null); + MyTextboxDecimal.this.setText((String) null); + setConstraint(c); + throw new WrongValueException(comp, + "El valor maximo permitido es " + maxValue); + } + + } else if ((precision != null) && (scale != null)) { + BigDecimal valor = getBigDecimal(val); + + if (valor == null) { + return; + } + + if ((valor.precision() > precision) || (valor.scale() > scale)) { + MyTextboxDecimal.this.setRawValue((String) null); + Constraint c = getConstraint(); + setConstraint((String) null); + MyTextboxDecimal.this.setText((String) null); + setConstraint(c); + throw new WrongValueException(comp, Labels.getLabel( + "MSG.CONSTRAINT.CONSTRAINTNUMBERBD", new Object[] { + precision - 2, scale })); + } + } + + } + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/PantallaUtileria.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/PantallaUtileria.java new file mode 100644 index 000000000..9338c0987 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/PantallaUtileria.java @@ -0,0 +1,124 @@ +package com.rjconsultores.ventaboletos.web.utilerias; + +import java.util.Map; + +import org.apache.log4j.Logger; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.Desktop; +import org.zkoss.zk.ui.Path; +import org.zkoss.zk.ui.UiException; +import org.zkoss.zul.Window; + +public class PantallaUtileria { + + public static int OVERLAPPED = 1; + public static int MODAL = 2; + private static Logger log = Logger.getLogger(MyGenericForwardComposer.class); + + public static void openWindow(String component, String title, Map args, Desktop desktop) { + PantallaUtileria.openWindow(component, title, args, OVERLAPPED, desktop); + } + + public static void openWindowPosi(String component, String title, Map args, String pos, Desktop desktop) { + PantallaUtileria.openWindowPosi(component, title, args, OVERLAPPED, pos, desktop); + } + + public static void openWindowPosi(String component, String title, Map args, int type, String pos, Desktop desktop) { + Window win1 = null; + + try { + win1 = (Window) desktop.getExecution().createComponents(component, null, args); + + Component c = Path.getComponent("/win/" + win1.getId()); + if (c != null) { + c.detach(); + } + + win1.setTitle(title); + win1.setClosable(true); + win1.setMaximizable(false); + if (OVERLAPPED == type) { + win1.doOverlapped(); + } else { + win1.doHighlighted(); + } + + win1.setPosition(pos); + win1.setPage(desktop.getPage("mainWin")); + win1.setParent(desktop.getPage("mainWin").getFellow("win")); + } catch (Exception e) { + log.error(e); + if (win1 != null) { + win1.detach(); + } + + throw UiException.Aide.wrap(e); + } + } + + public static void openWindow(String component, String title, Map args, int type, Desktop desktop) { + Window win1 = null; + + try { + win1 = (Window) desktop.getExecution().createComponents(component, null, args); + + Component c = Path.getComponent("/win/" + win1.getId()); + if (c != null) { + c.detach(); + } + + win1.setTitle(title); + win1.setClosable(true); + win1.setMaximizable(false); + if (OVERLAPPED == type) { + win1.doOverlapped(); + } else { + win1.doHighlighted(); + } + + win1.setPosition("center"); + win1.setPage(desktop.getPage("mainWin")); + win1.setParent(desktop.getPage("mainWin").getFellow("win")); + } catch (Exception e) { + log.error(e); + if (win1 != null) { + win1.detach(); + } + + throw UiException.Aide.wrap(e); + } + } + + public static void openWindow(String component, String title, Map args, int type, Boolean closabled, Desktop desktop) { + Window win1 = null; + + try { + win1 = (Window) desktop.getExecution().createComponents(component, null, args); + + Component c = Path.getComponent("/win/" + win1.getId()); + if (c != null) { + c.detach(); + } + + win1.setTitle(title); + win1.setClosable(closabled); + win1.setMaximizable(false); + if (OVERLAPPED == type) { + win1.doOverlapped(); + } else { + win1.doHighlighted(); + } + + win1.setPosition("center"); + win1.setPage(desktop.getPage("mainWin")); + win1.setParent(desktop.getPage("mainWin").getFellow("win")); + } catch (Exception e) { + log.error(e); + if (win1 != null) { + win1.detach(); + } + + throw UiException.Aide.wrap(e); + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/StringDecimalToDecimalConverter.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/StringDecimalToDecimalConverter.java new file mode 100644 index 000000000..6c2dd8f4d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/StringDecimalToDecimalConverter.java @@ -0,0 +1,43 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import java.math.BigDecimal; +import java.text.DecimalFormat; +import org.zkoss.zk.ui.Component; +import org.zkoss.zkplus.databind.TypeConverter; + +/** + * + * @author Administrador + */ +public class StringDecimalToDecimalConverter implements TypeConverter { + + private static final String FORMAT = "###,##0.00"; + + public Object coerceToUi(Object val, Component comp) { + if (val != null) { + String format = (String) comp.getAttribute("format"); + if (format == null) { + format = FORMAT; + } + DecimalFormat df = new DecimalFormat(format,new java.text.DecimalFormatSymbols(java.util.Locale.US)); + return df.format(val); + } + return null; + } + + public Object coerceToBean(Object val, Component cmpnt) { + if (val == null){ + return null; + } + + if (val instanceof String) { + + return (val.toString().trim().isEmpty())?(BigDecimal)null: new BigDecimal(val.toString().replace(",", "")); + } + return null; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/StringToShortConverter.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/StringToShortConverter.java new file mode 100644 index 000000000..e42528e7a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/StringToShortConverter.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias; + +import java.util.Iterator; +import org.zkoss.zk.ui.Component; +import org.zkoss.zkplus.databind.TypeConverter; +import org.zkoss.zul.Comboitem; + +/** + * + * @author Administrador + */ +public class StringToShortConverter implements TypeConverter { + + public Object coerceToUi(Object val, Component comp) { + if (val != null) { + //iterate to find the selected radio via the value + for (Iterator it = comp.getChildren().iterator(); it.hasNext();) { + final Component child = (Component) it.next(); + if (child instanceof Comboitem) { + String ret = null; + if (val instanceof Short) { + ret = String.valueOf(val); + } + + if (ret.equals(((Comboitem) child).getValue())) { + return child; + } + } + } + } + return null; + } + + public Object coerceToBean(Object val, Component cmpnt) { + val = val != null ? ((Comboitem) val).getValue() : null; + if (val instanceof String) { + return Short.parseShort((String) val); + } + return null; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/DefaultItemMenuSistema.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/DefaultItemMenuSistema.java new file mode 100644 index 000000000..9a9650f93 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/DefaultItemMenuSistema.java @@ -0,0 +1,54 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu; + +import org.zkoss.zk.ui.Desktop; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.labellocator.MenuLabelLocator; +import com.rjconsultores.ventaboletos.web.utilerias.menu.labellocator.ZKMenuLabelLocator; + +public class DefaultItemMenuSistema implements ItemMenuSistema { + protected String claveTraduccionMenu; + protected MenuLabelLocator menuLabelLocator; + protected Desktop desktop; + + public DefaultItemMenuSistema(String claveTraduccionMenu) { + this.menuLabelLocator = ZKMenuLabelLocator.getInstance(); + this.claveTraduccionMenu = claveTraduccionMenu; + + } + + public DefaultItemMenuSistema(String claveTradiccionMenu, MenuLabelLocator menuLabelLocator) { + this.menuLabelLocator = menuLabelLocator; + this.claveTraduccionMenu = claveTradiccionMenu; + + } + + @Override + public String getDescItemMenu() { + if (claveTraduccionMenu != null) { + String valor = menuLabelLocator.getLabel(claveTraduccionMenu); + return (valor == null) ? "--" : valor; + } + return "--"; + } + + @Override + public void ejecutar() { + } + + @Override + public String getClaveMenu() { + return ""; + } + + @Override + public void setDesktop(Desktop desktop) { + this.desktop = desktop; + + } + + @Override + public Desktop getDesktop() { + return desktop; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/ItemMenuSistema.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/ItemMenuSistema.java new file mode 100644 index 000000000..89bc18118 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/ItemMenuSistema.java @@ -0,0 +1,24 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu; + +import org.zkoss.zk.ui.Desktop; + +public interface ItemMenuSistema { + /** + * Regresa la descripción del menu + * @return + */ + public String getDescItemMenu(); + /** + * Ejecuta la operación del menu + */ + public void ejecutar(); + /** + * Indica se el menu es visible + * @return + */ + public String getClaveMenu(); + + public void setDesktop(Desktop desktop); + + public Desktop getDesktop(); +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/MenuFactory.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/MenuFactory.java new file mode 100644 index 000000000..6634e7caa --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/MenuFactory.java @@ -0,0 +1,12 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu; + +import org.zkoss.zul.api.Menubar; + +public interface MenuFactory { + /** + * Realiza la construction del menu + * @param menuBar + */ + public void construirMenu(Menubar menuBar); + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/MenuFactoryPropertiesImpl.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/MenuFactoryPropertiesImpl.java new file mode 100644 index 000000000..f6d473e25 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/MenuFactoryPropertiesImpl.java @@ -0,0 +1,287 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import org.zkoss.zk.ui.Desktop; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Menu; +import org.zkoss.zul.Menuitem; +import org.zkoss.zul.Menupopup; +import org.zkoss.zul.api.Menubar; + +import com.rjconsultores.ventaboletos.entidad.PerfilFuncion; +import com.rjconsultores.ventaboletos.entidad.UsuarioPerfil; +import com.rjconsultores.ventaboletos.web.utilerias.menu.exception.MenuConfiguracionException; +import com.rjconsultores.ventaboletos.web.utilerias.menu.exception.MenuNoExisteException; + +public class MenuFactoryPropertiesImpl implements MenuFactory { + + private List tree = new ArrayList();// Una lista con los itens del menu + private BufferedReader menuReader; // El reader para leer el properties como un archivo texto + private Properties miProperties; // El properties cargado normalmente. Asi se puede ocupar con las claves, etc + private Desktop desktop; // Desktop de la aplicación + private List listUsuarioPerfil;// El perfil del usuario + private List listClavesPermisos; + + public MenuFactoryPropertiesImpl(Desktop desktop, List listUsuarioPerfil) { + super(); + this.desktop = desktop; + this.listUsuarioPerfil = listUsuarioPerfil; + initListClavesPermissos(); + } + + private void initListClavesPermissos() { + listClavesPermisos = new ArrayList(); + for (UsuarioPerfil up : listUsuarioPerfil) { + List listPerfilFuncion = up.getPerfil().getPerfilFuncionList(); + for (PerfilFuncion pf : listPerfilFuncion) { + listClavesPermisos.add(pf.getFuncionSistema().getDescruta()); + } + } + } + + /** + * Empeza la construccion del menu + * + * @param menuBar + */ + @Override + public void construirMenu(Menubar menuBar) { + try { + this.cargarMenuProperties(); + this.contruir(null); + + for (No no : tree) { + String klass = miProperties.getProperty(no.getNombre()); + + Menu menu = this.createMenu(klass); + menuBar.appendChild(menu); + + this.contruirMenus(no, menu); + + } + } catch (IOException e) { + new MenuConfiguracionException("No fue posible cargar el archivo de menu.", e); + } + } + + /** + * Hace la construccion de los menus + * + * @param no + * @param menu + */ + private void contruirMenus(No no, Menu menu) { + for (No noH : no.getHijos()) { + String klass = miProperties.getProperty(noH.getNombre()); + if (noH.getHijos().isEmpty()) { + Menupopup menupopup = menu.getMenupopup(); + if (menupopup == null) { + menupopup = new Menupopup(); + } + menupopup.appendChild(this.createMenuItem(klass)); + + menu.appendChild(menupopup); + } else { + Menu menuHijo = this.createMenu(klass); + + Menupopup nuevoMenupopup = new Menupopup(); + nuevoMenupopup.appendChild(menuHijo); + Menupopup menupopup = menu.getMenupopup(); + + menupopup.appendChild(nuevoMenupopup); + contruirMenus(noH, menuHijo); + } + } + } + + /** + * Carga el archivo properties en una estructura de arbol + * + * @param noPadre + * @throws IOException + */ + public void contruir(No noPadre) throws IOException { + String linea = menuReader.readLine(); + + if (linea == null) { + return; + } + + String[] arregloLinea = linea.split("="); + + if (noPadre == null) { + No padre = new No(arregloLinea[0]); + tree.add(padre); + this.contruir(padre); + } else { + No hijo = new No(arregloLinea[0]); + + if (hijo.getNivel() == 1) { + tree.add(hijo); + contruir(hijo); + return; + } + if ((noPadre.getNivel() + 1) == hijo.getNivel()) { + noPadre.add(hijo); + contruir(hijo); + } else { + for (No no : tree) { + if (((no.getNivel() + 1) == hijo.getNivel()) && (hijo.getNombre().startsWith(no.getNombre()))) { + no.add(hijo); + contruir(no); + break; + + } + } + } + } + } + + /** + * Crea un nuevo menu + * + * @param strClass + * @return + */ + private Menu createMenu(String strClass) { + ItemMenuSistema item = this.crearNueboItem(strClass); + + if (item != null) { + Menu j = new Menu(item.getDescItemMenu()); +// if (item.getClaveMenu() != null) { não é usado. O arquivo de menu que deve controlar isso +// j.setVisible(listClavesPermisos.contains(item.getClaveMenu())); +// } + return j; + } + return null; + } + + /** + * Crea un nuevo menuItem + * + * @param strClass + * @return + */ + private Menuitem createMenuItem(String strClass) { + final ItemMenuSistema item = this.crearNueboItem(strClass); + + if (item != null) { + Menuitem j = new Menuitem(item.getDescItemMenu()); + j.addEventListener("onClick", new EventListener() { + @Override + public void onEvent(Event arg0) throws Exception { + item.ejecutar(); + } + }); + if (item.getClaveMenu() != null) { + j.setVisible(listClavesPermisos.contains(item.getClaveMenu())); + } + return j; + } + return null; + } + + /** + * Crea una instancia del menu especificado + * + * @param strClass + * @return + */ + private ItemMenuSistema crearNueboItem(String strClass) { + ItemMenuSistema classe = null; + try { + Class c = Class.forName(strClass); + + classe = (ItemMenuSistema) c.newInstance(); + classe.setDesktop(desktop); + // Constructor constructor = c.getConstructor(new Class[]{Desktop.class}); + // classe = (ItemMenuSistema) constructor.newInstance(Executions.getCurrent().getDesktop()); + } catch (ClassNotFoundException e) { + throw new MenuNoExisteException("El menu " + strClass + " no fue encontrado.", e); + } catch (InstantiationException e) { + throw new MenuNoExisteException("No se puede crear el menu " + strClass + ".", e); + } catch (IllegalAccessException e) { + throw new MenuNoExisteException("No fue posible accesar " + strClass + ".", e); + } + + return classe; + } + + /** + * Hace la carga del properties + * + * @throws IOException + */ + private void cargarMenuProperties() throws IOException { + InputStream miStream = this.getClass().getResourceAsStream("/com/rjconsultores/ventaboletos/web/cliente/menu/menu.properties"); + menuReader = new BufferedReader(new InputStreamReader(miStream)); + + InputStream miStream2 = this.getClass().getResourceAsStream("/com/rjconsultores/ventaboletos/web/cliente/menu/menu.properties"); + + miProperties = new Properties(); + miProperties.load(miStream2); + } + + /** + * Clase con la estructura del menu leída del archivo properties + * + * @author gleimar + * + */ + public class No { + String nombre; + List hijos; + + public No(String nombre) { + this.nombre = nombre; + this.hijos = new ArrayList(); + } + + public No(String nombre, String hijo) { + super(); + this.nombre = nombre; + hijos = new ArrayList(); + hijos.add(new No(hijo)); + } + + public No(String nombre, List hijos) { + super(); + this.nombre = nombre; + this.hijos = hijos; + } + + public String getNombre() { + return nombre; + } + + public void setNombre(String nombre) { + this.nombre = nombre; + } + + public List getHijos() { + return hijos; + } + + public void setHijos(List hijos) { + this.hijos = hijos; + } + + public boolean add(No e) { + return hijos.add(e); + } + + public int getNivel() { + return nombre.split("\\.").length; + } + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/exception/MenuConfiguracionException.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/exception/MenuConfiguracionException.java new file mode 100644 index 000000000..65d5bcaab --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/exception/MenuConfiguracionException.java @@ -0,0 +1,13 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.exception; + +public class MenuConfiguracionException extends RuntimeException { + + public MenuConfiguracionException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + + public MenuConfiguracionException(String arg0) { + super(arg0); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/exception/MenuNoExisteException.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/exception/MenuNoExisteException.java new file mode 100644 index 000000000..fd8fd8299 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/exception/MenuNoExisteException.java @@ -0,0 +1,13 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.exception; + +public class MenuNoExisteException extends RuntimeException { + + public MenuNoExisteException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + + public MenuNoExisteException(String arg0) { + super(arg0); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ayuda/ItemMenuVersion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ayuda/ItemMenuVersion.java new file mode 100644 index 000000000..be33eaab0 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ayuda/ItemMenuVersion.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.ayuda; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuVersion extends DefaultItemMenuSistema { + + public ItemMenuVersion() { + super("indexController.mniVersion.label"); + } + + @Override + public String getClaveMenu() { + return null; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/version.zul", + Labels.getLabel("indexController.mniVersion.label"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ayuda/MenuAyuda.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ayuda/MenuAyuda.java new file mode 100644 index 000000000..aa224f2d7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ayuda/MenuAyuda.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.ayuda; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class MenuAyuda extends DefaultItemMenuSistema { + + public MenuAyuda() { + super("indexController.mnAjuda.label"); + } + + @Override + public String getClaveMenu() { + return "____"; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuArticulo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuArticulo.java new file mode 100644 index 000000000..41c01d95d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuArticulo.java @@ -0,0 +1,25 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuArticulo extends DefaultItemMenuSistema { + + public ItemMenuArticulo() { + super("indexController.mniArticulo.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.ARTICULO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaArticulo.zul", Labels.getLabel("busquedaArticuloController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuAssociacionClaseServicioMarca.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuAssociacionClaseServicioMarca.java new file mode 100644 index 000000000..68cadee16 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuAssociacionClaseServicioMarca.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuAssociacionClaseServicioMarca extends DefaultItemMenuSistema { + + public ItemMenuAssociacionClaseServicioMarca() { + super("indexController.mniAsociacionClaseServicioMarca.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.ASOCIACIONTIPODELSERVICIOYMARCA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaAsociacionClaseServicioMarca.zul", + Labels.getLabel("busquedaAsociacionClaseServicioMarcaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuCategoria.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuCategoria.java new file mode 100644 index 000000000..30a69cbe5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuCategoria.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuCategoria extends DefaultItemMenuSistema { + + public ItemMenuCategoria() { + super("indexController.mniCategoria.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.TIPODEPASAJERO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaCategoria.zul", + Labels.getLabel("busquedaCategoriaController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuCiudad.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuCiudad.java new file mode 100644 index 000000000..1229f76a2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuCiudad.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuCiudad extends DefaultItemMenuSistema { + + public ItemMenuCiudad() { + super("indexController.mniCiudad.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.CIUDAD"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaCiudad.zul", + Labels.getLabel("busquedaCiudadController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuClaseServicio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuClaseServicio.java new file mode 100644 index 000000000..e24f90d83 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuClaseServicio.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuClaseServicio extends DefaultItemMenuSistema { + + public ItemMenuClaseServicio() { + super("indexController.mniClaseServicio.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.TIPODESERVICIO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaClaseServicio.zul", + Labels.getLabel("busquedaClaseServicioController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuColonia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuColonia.java new file mode 100644 index 000000000..076d4be70 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuColonia.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuColonia extends DefaultItemMenuSistema { + + public ItemMenuColonia() { + super("indexController.mniColonia.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.COLONIA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaColonia.zul", + Labels.getLabel("busquedaColoniaController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuCuponConvenio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuCuponConvenio.java new file mode 100644 index 000000000..44234d80a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuCuponConvenio.java @@ -0,0 +1,29 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuCuponConvenio extends DefaultItemMenuSistema { + + public ItemMenuCuponConvenio() { + super("indexController.mniCuponConvenio.label"); + } + + @Override + public String getClaveMenu() { + //Menu Desabilitado - Elvia: Las tablas que se manejan en la alta de convenios son: + //Convenio - Convenio_det + + return "___COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.CUPONCONVENIO___"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaCuponConvenio.zul", + Labels.getLabel("busquedaCuponConvenioController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuEmpresa.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuEmpresa.java new file mode 100644 index 000000000..5bdc73acb --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuEmpresa.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuEmpresa extends DefaultItemMenuSistema { + + public ItemMenuEmpresa() { + super("indexController.mniEmpresa.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.EMPRESA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaEmpresa.zul", + Labels.getLabel("busquedaEmpresaController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuEstado.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuEstado.java new file mode 100644 index 000000000..1118f0d28 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuEstado.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuEstado extends DefaultItemMenuSistema { + + public ItemMenuEstado() { + super("indexController.mniEstado.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.ESTADO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaEstado.zul", + Labels.getLabel("busquedaEstadoController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuFormaPago.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuFormaPago.java new file mode 100644 index 000000000..414ee50cb --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuFormaPago.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuFormaPago extends DefaultItemMenuSistema { + + public ItemMenuFormaPago() { + super("indexController.mniFormaPago.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.FORMADEPAGO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaFormaPago.zul", + Labels.getLabel("busquedaFormaPagoController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuMarcas.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuMarcas.java new file mode 100644 index 000000000..1533c32f5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuMarcas.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuMarcas extends DefaultItemMenuSistema { + + public ItemMenuMarcas() { + super("indexController.mniMarcas.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.MARCAS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaMarca.zul", + Labels.getLabel("busquedaMarcaController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuMoneda.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuMoneda.java new file mode 100644 index 000000000..c7721e604 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuMoneda.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuMoneda extends DefaultItemMenuSistema { + + public ItemMenuMoneda() { + super("indexController.mniMoneda.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.MONEDA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaMoneda.zul", + Labels.getLabel("busquedaMonedaController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuPais.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuPais.java new file mode 100644 index 000000000..2d04bbdbf --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuPais.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuPais extends DefaultItemMenuSistema { + + public ItemMenuPais() { + super("indexController.mniPais.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.PAIS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaPais.zul", + Labels.getLabel("busquedaPaisController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuPlaza.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuPlaza.java new file mode 100644 index 000000000..9b032bdf9 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuPlaza.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuPlaza extends DefaultItemMenuSistema { + + public ItemMenuPlaza() { + super("indexController.mniPlaza.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.PLAZA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaPlaza.zul", + Labels.getLabel("busquedaPlazaController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuProductoServicio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuProductoServicio.java new file mode 100644 index 000000000..dab609123 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuProductoServicio.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuProductoServicio extends DefaultItemMenuSistema { + + public ItemMenuProductoServicio() { + super("indexController.mniProductoServicio.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.PRODUCTOSERVICIO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaProductoServicio.zul", + Labels.getLabel("busquedaProductoServicioController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuPtovtaEmpresa.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuPtovtaEmpresa.java new file mode 100644 index 000000000..692a08f1d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuPtovtaEmpresa.java @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; +import org.zkoss.util.resource.Labels; + +/** + * + * @author Desenvolvimento + */ +public class ItemMenuPtovtaEmpresa extends DefaultItemMenuSistema { + + public ItemMenuPtovtaEmpresa() { + super("indexController.mniPtovtaEmpresa.label"); + } + + @Override + public String getClaveMenu() { + //Essa funcionalidade está dentro do Menu Punto de Venta + return "___COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.PTOVTAEMPRESA___"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaPtovtaEmpresa.zul", + Labels.getLabel("busquedaPtovtaEmpresaController.window.title"), + null, desktop); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuPuntoVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuPuntoVenta.java new file mode 100644 index 000000000..57860beff --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuPuntoVenta.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuPuntoVenta extends DefaultItemMenuSistema { + + public ItemMenuPuntoVenta() { + super("indexController.mniPuntoVenta.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.PUNTODEVENTA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaPuntoVenta.zul", + Labels.getLabel("busquedaPuntoVentaController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoConvenio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoConvenio.java new file mode 100644 index 000000000..4bce0de04 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoConvenio.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTipoConvenio extends DefaultItemMenuSistema { + + public ItemMenuTipoConvenio() { + super("indexController.mniTipoConvenio.label"); + } + + @Override + public String getClaveMenu() { + //Menu Desabilitado - Elvia: Las tablas que se manejan en la alta de convenios son: + //Convenio - Convenio_det + return "___COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.TIPOCONVENIO___"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaTipoConvenio.zul", + Labels.getLabel("busquedaTipoConvenioController.window.title"), null, desktop); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoCorte.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoCorte.java new file mode 100644 index 000000000..7b3ff5248 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoCorte.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTipoCorte extends DefaultItemMenuSistema { + + public ItemMenuTipoCorte() { + super("indexController.mniTipoCorte.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.TIPOCORTE"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaTipoCorte.zul", + Labels.getLabel("busquedaTipoCorteController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoPuntoVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoPuntoVenta.java new file mode 100644 index 000000000..0066f3c21 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoPuntoVenta.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTipoPuntoVenta extends DefaultItemMenuSistema { + + public ItemMenuTipoPuntoVenta() { + super("indexController.mniTipoPuntoVenta.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.TIPODEPUNTODEVENTA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaTipoPuntoVenta.zul", + Labels.getLabel("busquedaTipoPuntoVentaController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoServicio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoServicio.java new file mode 100644 index 000000000..3244dc8a9 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoServicio.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTipoServicio extends DefaultItemMenuSistema { + + public ItemMenuTipoServicio() { + super("indexController.mniTipoServicio.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.TIPODECORRIDA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaTipoServicio.zul", + Labels.getLabel("busquedaTipoServicioController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoVenta.java new file mode 100644 index 000000000..55c0a1f8a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTipoVenta.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTipoVenta extends DefaultItemMenuSistema { + + public ItemMenuTipoVenta() { + super("indexController.mniTipoVenta.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.TIPODEVENTA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaTipoVenta.zul", + Labels.getLabel("busquedaTipoVentaController.window.title"), + null, desktop); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTurno.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTurno.java new file mode 100644 index 000000000..3618b3e9c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/ItemMenuTurno.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTurno extends DefaultItemMenuSistema { + + public ItemMenuTurno() { + super("indexController.mniTurno.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.TURNO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/catalogos/busquedaTurno.zul", + Labels.getLabel("busquedaTurnoController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/MenuCatalogos.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/MenuCatalogos.java new file mode 100644 index 000000000..eeaf1880c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/catalogos/MenuCatalogos.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class MenuCatalogos extends DefaultItemMenuSistema { + + public MenuCatalogos() { + super("indexController.mnCatalogos.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO"; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuComisionistaExterno.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuComisionistaExterno.java new file mode 100644 index 000000000..12384b272 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuComisionistaExterno.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuComisionistaExterno extends DefaultItemMenuSistema { + + public ItemMenuComisionistaExterno() { + super("indexController.mniComisionistaExterno.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.MENU.COMISIONISTAEXTERNO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/busquedaComisionistaExterno.zul", + Labels.getLabel("busquedaComisionistaExternoController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionAlerta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionAlerta.java new file mode 100644 index 000000000..30cff650f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionAlerta.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuConfiguracionAlerta extends DefaultItemMenuSistema { + + public ItemMenuConfiguracionAlerta() { + super("indexController.mniConfiguracionAlerta.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.MENU.ALERTACTRL"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/busquedaAlertaCtrl.zul", + Labels.getLabel("busquedaAlertaCtrlController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionCancelacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionCancelacion.java new file mode 100644 index 000000000..7f46e19ee --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionCancelacion.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuConfiguracionCancelacion extends DefaultItemMenuSistema { + + public ItemMenuConfiguracionCancelacion() { + super("indexController.mniConfiguracionCancelacion.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.MENU.CONFIGURACIONDECANCELACION"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/busquedaConfiguracionCancelacion.zul", + Labels.getLabel("busquedaConfiguracionCancelacionController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionCategorias.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionCategorias.java new file mode 100644 index 000000000..60cc7ec49 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionCategorias.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuConfiguracionCategorias extends DefaultItemMenuSistema { + + public ItemMenuConfiguracionCategorias() { + super("indexController.mniConfiguracionCategorias.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.MENU.CONFIGURACIONTIPODEPASAJERO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/busquedaConfiguracionCategorias.zul", + Labels.getLabel("busquedaConfiguracionCategoriaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionGeneral.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionGeneral.java new file mode 100644 index 000000000..0a3fbe709 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionGeneral.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuConfiguracionGeneral extends DefaultItemMenuSistema { + + public ItemMenuConfiguracionGeneral() { + super("indexController.mniConfiguracionGeneral.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.MENU.CONFIGURACIONGENERAL"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/busquedaConfiguracionGeneral.zul", + Labels.getLabel("busquedaConfiguracionGeneralController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionReservacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionReservacion.java new file mode 100644 index 000000000..084225f0d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionReservacion.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuConfiguracionReservacion extends DefaultItemMenuSistema { + + public ItemMenuConfiguracionReservacion() { + super("indexController.mniConfiguracionReservacion.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.MENU.CONFIGURACIONDERESERVACION"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/busquedaConfiguracionReservacion.zul", + Labels.getLabel("busquedaConfiguracionReservacionController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionServicio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionServicio.java new file mode 100644 index 000000000..71ba4d26a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConfiguracionServicio.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuConfiguracionServicio extends DefaultItemMenuSistema { + + public ItemMenuConfiguracionServicio() { + super("indexController.mniConfiguracionServicio.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.MENU.CONFIGURACIONDESERVICIOPRO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/cyberviaje/busquedaProductoServicio.zul", + Labels.getLabel("busquedaCyberViajeProductoServicioController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConvenio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConvenio.java new file mode 100644 index 000000000..b5245d172 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuConvenio.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuConvenio extends DefaultItemMenuSistema { + + public ItemMenuConvenio() { + super("indexController.mniConvenio.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.MENU.CONVENIO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/busquedaConvenio.zul", + Labels.getLabel("busquedaConvenioController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuMotivoCancelacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuMotivoCancelacion.java new file mode 100644 index 000000000..e86f328c8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuMotivoCancelacion.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuMotivoCancelacion extends DefaultItemMenuSistema { + + public ItemMenuMotivoCancelacion() { + super("indexController.mniMotivoCancelacion.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.MOTIVOSDELACANCELACION"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/busquedaMotivoCancelacion.zul", + Labels.getLabel("busquedaMotivoCancelacionController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuMotivoReimpresion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuMotivoReimpresion.java new file mode 100644 index 000000000..8425c1a87 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuMotivoReimpresion.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuMotivoReimpresion extends DefaultItemMenuSistema { + + public ItemMenuMotivoReimpresion() { + super("indexController.mniMotivoReimpresion.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.MOTIVOSDELAREIMPRESION"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/busquedaMotivoReimpresion.zul", + Labels.getLabel("busquedaMotivoReimpresionController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuPeriodoVacacional.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuPeriodoVacacional.java new file mode 100644 index 000000000..6f800c8e1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuPeriodoVacacional.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuPeriodoVacacional extends DefaultItemMenuSistema { + + public ItemMenuPeriodoVacacional() { + super("indexController.mniPeriodoVacacional.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.PERIODOVACACIONAL"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/busquedaPeriodoVacacional.zul", + Labels.getLabel("busquedaPeriodoVacacionalController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuRestriccionFormaPago.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuRestriccionFormaPago.java new file mode 100644 index 000000000..94deabb48 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuRestriccionFormaPago.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuRestriccionFormaPago extends DefaultItemMenuSistema { + + public ItemMenuRestriccionFormaPago() { + super("indexController.mniRestriccionFormaPago.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.MENU.RESTRICCIONDEFORMAPAGO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/busquedaRestriccionFormaPago.zul", + Labels.getLabel("busquedaRestriccionFormaPagoController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuSecretaria.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuSecretaria.java new file mode 100644 index 000000000..882fdd694 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuSecretaria.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuSecretaria extends DefaultItemMenuSistema { + + public ItemMenuSecretaria() { + super("indexController.mniSecretaria.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES.MENU.SECRETARIA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/busquedaSecretaria.zul", + Labels.getLabel("busquedaSecretariaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuTipoCambioCiudad.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuTipoCambioCiudad.java new file mode 100644 index 000000000..62c246149 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/ItemMenuTipoCambioCiudad.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTipoCambioCiudad extends DefaultItemMenuSistema { + + public ItemMenuTipoCambioCiudad() { + super("indexController.mniTipoCambioCiudad.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.TIPOCAMBIOCIUDAD"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/configuraciones_comerciales/busquedaTipoCambioCiudad.zul", + Labels.getLabel("busquedaTipoCambioCiudadController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/MenuConfiguracionesComerciales.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/MenuConfiguracionesComerciales.java new file mode 100644 index 000000000..ec6b702a4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/confcomerciales/MenuConfiguracionesComerciales.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class MenuConfiguracionesComerciales extends DefaultItemMenuSistema { + + public MenuConfiguracionesComerciales() { + super("indexController.mnConfiguracionesComerciales.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CONFIGURACIONECCOMERCIALES"; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuAltaCortesiaRH.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuAltaCortesiaRH.java new file mode 100644 index 000000000..c150c3edb --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuAltaCortesiaRH.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuAltaCortesiaRH extends DefaultItemMenuSistema { + + public ItemMenuAltaCortesiaRH() { + super("indexController.mniAltaCortesiaRH.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CORTESIAS.ALTACORTESIAPORRECURSOSHUMANOS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/cortesias/busquedaAltaCortesiaRH.zul", + Labels.getLabel("busquedaAltaCortesiaRHController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuCortesiaDireccion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuCortesiaDireccion.java new file mode 100644 index 000000000..e90aa6457 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuCortesiaDireccion.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuCortesiaDireccion extends DefaultItemMenuSistema { + + public ItemMenuCortesiaDireccion() { + super("indexController.mniCortesiaTD.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CORTESIAS.ALTACORTESIAPORDIRECCION"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/cortesias/busquedaCortesiaTipoDireccion.zul", + Labels.getLabel("busquedaCortesiaTipoDireccionController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuGrupoCortesia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuGrupoCortesia.java new file mode 100644 index 000000000..e9a9a8dbe --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuGrupoCortesia.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuGrupoCortesia extends DefaultItemMenuSistema { + + public ItemMenuGrupoCortesia() { + super("indexController.mniGrupoCortesias.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CORTESIAS.GRUPOCORTESIA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/cortesias/busquedaGrupoCortesias.zul", + Labels.getLabel("busquedaGrupoCortesiasController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuTipoCortesia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuTipoCortesia.java new file mode 100644 index 000000000..dac387865 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuTipoCortesia.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTipoCortesia extends DefaultItemMenuSistema { + + public ItemMenuTipoCortesia() { + super("indexController.mniTipoCortesia.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CORTESIAS.TIPOCORTESIA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/cortesias/busquedaTipoCortesia.zul", + Labels.getLabel("busquedaTipoCortesiaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuTipoCortesiaDescuento.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuTipoCortesiaDescuento.java new file mode 100644 index 000000000..4b64013d3 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/ItemMenuTipoCortesiaDescuento.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTipoCortesiaDescuento extends DefaultItemMenuSistema { + + public ItemMenuTipoCortesiaDescuento() { + super("indexController.mniTipoCortesiaD.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CORTESIAS.TIPOCORTESIADESCUENTO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/cortesias/busquedaTipoCortesiaDescuento.zul", + Labels.getLabel("busquedaTipoCortesiaDController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/MenuCortesias.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/MenuCortesias.java new file mode 100644 index 000000000..ff82feac9 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/cortesias/MenuCortesias.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class MenuCortesias extends DefaultItemMenuSistema { + + public MenuCortesias() { + super("indexController.mnCortesias.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CORTESIAS"; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/ItemMenuClaseServicioEquivalencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/ItemMenuClaseServicioEquivalencia.java new file mode 100644 index 000000000..f21896bbb --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/ItemMenuClaseServicioEquivalencia.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuClaseServicioEquivalencia extends DefaultItemMenuSistema { + + public ItemMenuClaseServicioEquivalencia() { + super("indexController.mniClaseservicioEquivalencia.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.EQUIVALENCIA.MENU.CLASESERVICIOEQUIVALENCIA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/equivalencia/busquedaClaseservicioEquivalencia.zul", + Labels.getLabel("busqeudaClaseservicioEquivalenciaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/ItemMenuEmpresaEquivalencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/ItemMenuEmpresaEquivalencia.java new file mode 100644 index 000000000..97d98439a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/ItemMenuEmpresaEquivalencia.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuEmpresaEquivalencia extends DefaultItemMenuSistema { + + public ItemMenuEmpresaEquivalencia() { + super("indexController.mniEmpresaEquivalencia.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.EQUIVALENCIA.MENU.EMPRESAEQUIVALENCIA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/equivalencia/busquedaEmpresaEquivalencia.zul", + Labels.getLabel("busquedaEmpresaEquivalenciaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/ItemMenuMotivoCancelacionEquivalencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/ItemMenuMotivoCancelacionEquivalencia.java new file mode 100644 index 000000000..56d82bf66 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/ItemMenuMotivoCancelacionEquivalencia.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuMotivoCancelacionEquivalencia extends DefaultItemMenuSistema { + + public ItemMenuMotivoCancelacionEquivalencia() { + super("indexController.mniMotivocancelacionEquivalencia.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.EQUIVALENCIA.MENU.MOTIVOCANCELACIONEQUIVALENCIA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/equivalencia/busquedaMotivocancelacionEquivalencia.zul", + Labels.getLabel("busquedamotivocancelacionEquivalenciaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/ItemMenuParadaEquivalencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/ItemMenuParadaEquivalencia.java new file mode 100644 index 000000000..7cf8c1def --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/ItemMenuParadaEquivalencia.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuParadaEquivalencia extends DefaultItemMenuSistema { + + public ItemMenuParadaEquivalencia() { + super("indexController.mniParadaEquivalencia.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.EQUIVALENCIA.MENU.PARADAEQUIVALENCIA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/equivalencia/busquedaParadaEquivalencia.zul", + Labels.getLabel("busquedaParadaEquivalenciaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/MenuEquivalencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/MenuEquivalencia.java new file mode 100644 index 000000000..2c77ee64a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/equivalencia/MenuEquivalencia.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class MenuEquivalencia extends DefaultItemMenuSistema { + + public MenuEquivalencia() { + super("indexController.mnEquivalencia.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.EQUIVALENCIA.MENU"; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuAutobus.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuAutobus.java new file mode 100644 index 000000000..0935ce6fd --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuAutobus.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuAutobus extends DefaultItemMenuSistema { + + public ItemMenuAutobus() { + super("indexController.mniAutobus.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.AUTOBUS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/esquema_operacional/busquedaAutobus.zul", + Labels.getLabel("busquedaAutobusController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuCorrida.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuCorrida.java new file mode 100644 index 000000000..046394822 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuCorrida.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuCorrida extends DefaultItemMenuSistema { + + public ItemMenuCorrida() { + super("indexController.mniCorrida.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.CONFIGURACIONDECORRIDAS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/esquema_operacional/busquedaCorrida.zul", + Labels.getLabel("busquedaConfiguracionCorridaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuDiagramaAutobus.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuDiagramaAutobus.java new file mode 100644 index 000000000..010537a7b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuDiagramaAutobus.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuDiagramaAutobus extends DefaultItemMenuSistema { + + public ItemMenuDiagramaAutobus() { + super("indexController.mniDiagramaAutoBus.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO.MENU.DIAGRAMASDEAUTOBUS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/esquema_operacional/busquedaDiagramaAutobus.zul", + Labels.getLabel("busquedaDiagramaAutobusController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuEsquemaOperacionalParadas.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuEsquemaOperacionalParadas.java new file mode 100644 index 000000000..294062046 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuEsquemaOperacionalParadas.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuEsquemaOperacionalParadas extends DefaultItemMenuSistema { + + public ItemMenuEsquemaOperacionalParadas() { + super("indexController.mniEsquemaOperacionalParadas.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.PARADAS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/esquema_operacional/busquedaParada.zul", + Labels.getLabel("busquedaCatalogoDeParadaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuEsquemaOperacionalRuta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuEsquemaOperacionalRuta.java new file mode 100644 index 000000000..ead587924 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuEsquemaOperacionalRuta.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuEsquemaOperacionalRuta extends DefaultItemMenuSistema { + + public ItemMenuEsquemaOperacionalRuta() { + super("indexController.mniEsquemaOperacionalRuta.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.RUTA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/esquema_operacional/busquedaRuta.zul", + Labels.getLabel("busquedaCatalogoDeRutaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuGeneracionAutomaticaTramoRuta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuGeneracionAutomaticaTramoRuta.java new file mode 100644 index 000000000..bf06bf4b5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuGeneracionAutomaticaTramoRuta.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuGeneracionAutomaticaTramoRuta extends DefaultItemMenuSistema { + + public ItemMenuGeneracionAutomaticaTramoRuta() { + super("indexController.mniGeneracionAutomaticaTramosRutas"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.GENERACION_AUTOMATICA_TRAMO_RUTA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/esquema_operacional/generacion_tramo_ruta/editarTramoRuta.zul", + Labels.getLabel("editarTramoRutaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuGeneracionCorrida.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuGeneracionCorrida.java new file mode 100644 index 000000000..0a9ddd1da --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuGeneracionCorrida.java @@ -0,0 +1,56 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional; + +import java.text.SimpleDateFormat; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.zkoss.util.resource.Labels; +import org.zkoss.zul.Messagebox; + +import com.rjconsultores.ventaboletos.entidad.Constante; +import com.rjconsultores.ventaboletos.service.ConstanteService; +import com.rjconsultores.ventaboletos.service.CorridaService; +import com.rjconsultores.ventaboletos.web.gui.controladores.esquemaoperacional.GeracionCorridaController; +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; +import com.rjconsultores.ventaboletos.web.utilerias.spring.AppContext; + +public class ItemMenuGeneracionCorrida extends DefaultItemMenuSistema { + private static Logger log = Logger.getLogger(ItemMenuGeneracionCorrida.class); + + public ItemMenuGeneracionCorrida() { + super("indexController.mniGeracionCorrida.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.GENERACIONDECORRIDA"; + } + + @Override + public void ejecutar() { + + SimpleDateFormat sdfData = new SimpleDateFormat("dd/MM/yyyy"); + CorridaService corridaService = (CorridaService) AppContext.getApplicationContext().getBean("corridaService"); + + try { + int resp = Messagebox.show( + Labels.getLabel("geracionCorridaController.MSG.gerarPergunta", + new Object[] { sdfData.format(corridaService.calcularDataFinalGeneracionCorrida()) }), + Labels.getLabel("geracionCorridaController.window.title"), Messagebox.YES | Messagebox.NO, Messagebox.QUESTION); + + if (resp == Messagebox.YES) { + boolean hayError = corridaService.generarCorridaAutomatica(); + + if (!hayError) { + Messagebox.show(Labels.getLabel("geracionCorridaController.MSG.ok"), + Labels.getLabel("geracionCorridaController.window.title"), Messagebox.OK, Messagebox.INFORMATION); + } else { + Messagebox.show(Labels.getLabel("MSG.Error"), Labels.getLabel("geracionCorridaController.window.title"), + Messagebox.OK, Messagebox.ERROR); + } + } + } catch (InterruptedException e) { + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuRolOperativo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuRolOperativo.java new file mode 100644 index 000000000..b592dcbbf --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuRolOperativo.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuRolOperativo extends DefaultItemMenuSistema { + + public ItemMenuRolOperativo() { + super("indexController.mniRolOperativo.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.ROLOPERATIVO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/esquema_operacional/busquedaRolOperativo.zul", + Labels.getLabel("busquedaRolOperativoController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuTipoParadas.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuTipoParadas.java new file mode 100644 index 000000000..994b62822 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuTipoParadas.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTipoParadas extends DefaultItemMenuSistema { + + public ItemMenuTipoParadas() { + super("indexController.mniTipoParadas.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.TIPO_PARADA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/esquema_operacional/busquedaTipoParada.zul", + Labels.getLabel("busquedaTipoParadaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuTramo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuTramo.java new file mode 100644 index 000000000..c4cdfb3ce --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuTramo.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTramo extends DefaultItemMenuSistema { + + public ItemMenuTramo() { + super("indexController.mniTramo.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.TRAMO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/esquema_operacional/busquedaTramo.zul", + Labels.getLabel("busquedaTramosController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuTramoKmServicio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuTramoKmServicio.java new file mode 100644 index 000000000..15785b1a1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuTramoKmServicio.java @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; +import org.zkoss.util.resource.Labels; + +/** + * + * @author Desenvolvimento + */ +public class ItemMenuTramoKmServicio extends DefaultItemMenuSistema { + + public ItemMenuTramoKmServicio() { + super("indexController.mniTramoKmServicio.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.TRAMOKMSERVICIO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/esquema_operacional/busquedaTramoKmServicio.zul", + Labels.getLabel("busquedaTramoKmServicioController.window.title"), null,desktop); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuVia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuVia.java new file mode 100644 index 000000000..345b61451 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/ItemMenuVia.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuVia extends DefaultItemMenuSistema { + + public ItemMenuVia() { + super("indexController.mniVia.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL.MENU.VIA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/esquema_operacional/busquedaVia.zul", + Labels.getLabel("busquedaViaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/MenuEsquemaOperacional.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/MenuEsquemaOperacional.java new file mode 100644 index 000000000..402b38013 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/esquemaoperacional/MenuEsquemaOperacional.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class MenuEsquemaOperacional extends DefaultItemMenuSistema { + + public MenuEsquemaOperacional() { + super("indexController.mnEsquemaOperacional.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.ESQUEMAOPERACIONAL"; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/ItemMenuCategoriaVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/ItemMenuCategoriaVenta.java new file mode 100644 index 000000000..1ce7d20c0 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/ItemMenuCategoriaVenta.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuCategoriaVenta extends DefaultItemMenuSistema { + + public ItemMenuCategoriaVenta() { + super("indexController.mniCategoriaVenta.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.INFORMES.MENU.CATEGORIAVENTA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/informes/categoria_venta/informeCategoriaVenta.zul", + Labels.getLabel("informeCategoriaVentaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/ItemMenuPasajeroServicio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/ItemMenuPasajeroServicio.java new file mode 100644 index 000000000..f7e376dc6 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/ItemMenuPasajeroServicio.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuPasajeroServicio extends DefaultItemMenuSistema { + + public ItemMenuPasajeroServicio() { + super("indexController.mniPassageirosServico.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.INFORMES.MENU.PASAJEROSERVICIO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/informes/pasajero_servicio/informePasajeroServico.zul", + Labels.getLabel("indexController.mniPassageirosServico.label"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/ItemMenuServicioDiario.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/ItemMenuServicioDiario.java new file mode 100644 index 000000000..cdac856a4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/ItemMenuServicioDiario.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuServicioDiario extends DefaultItemMenuSistema { + + public ItemMenuServicioDiario() { + super("indexController.mniServicioDiario.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.INFORMES.MENU.SERVICIODIARIO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/informes/servicio_diario/informeServicioDiario.zul", + Labels.getLabel("informeServicioDiarioController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/ItemMenuVentasPuntoVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/ItemMenuVentasPuntoVenta.java new file mode 100644 index 000000000..89cdf92f3 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/ItemMenuVentasPuntoVenta.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuVentasPuntoVenta extends DefaultItemMenuSistema { + + public ItemMenuVentasPuntoVenta() { + super("indexController.mniVentasPuntoVenta.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.INFORMES.MENU.VENTASPUNTOVENTA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/informes/ventas_puntoventa/informeVentasPuntoVenta.zul", + Labels.getLabel("indexController.mniVentasPuntoVenta.label"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/MenuInformes.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/MenuInformes.java new file mode 100644 index 000000000..2090967c1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/informes/MenuInformes.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class MenuInformes extends DefaultItemMenuSistema { + + public MenuInformes() { + super("indexController.mnInformes.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.INFORMES.MENU"; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ingreso/ItemMenuBancos.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ingreso/ItemMenuBancos.java new file mode 100644 index 000000000..f6b2fd134 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ingreso/ItemMenuBancos.java @@ -0,0 +1,24 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.ingreso; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuBancos extends DefaultItemMenuSistema { + + public ItemMenuBancos() { + super("indexController.mni.bancos"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.EVENTOEXTRA.MENU.BANCOS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/ingreso/busquedaBanco.zul", + Labels.getLabel("busquedaBancoController.window.title"), null, desktop); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ingreso/ItemMenuIngreso.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ingreso/ItemMenuIngreso.java new file mode 100644 index 000000000..64fc9d645 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ingreso/ItemMenuIngreso.java @@ -0,0 +1,24 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.ingreso; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuIngreso extends DefaultItemMenuSistema { + + public ItemMenuIngreso() { + super("indexController.mni.catalogoIngreso"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.EVENTOEXTRA.MENU.INGRESOS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/ingreso/busquedaIngreso.zul", + Labels.getLabel("busquedaTipoEventoExtraController.window.title"), null, desktop); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ingreso/MenuIngreso.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ingreso/MenuIngreso.java new file mode 100644 index 000000000..922d52f6d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/ingreso/MenuIngreso.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.ingreso; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class MenuIngreso extends DefaultItemMenuSistema { + + public MenuIngreso() { + super("indexController.mn.ingresosExtras"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.INGRESO"; + } + +} \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pagoconductor/ItemMenuActualizaTarjetaViaje.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pagoconductor/ItemMenuActualizaTarjetaViaje.java new file mode 100644 index 000000000..e60db949b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pagoconductor/ItemMenuActualizaTarjetaViaje.java @@ -0,0 +1,25 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pagoconductor; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuActualizaTarjetaViaje extends DefaultItemMenuSistema { + + public ItemMenuActualizaTarjetaViaje() { + super("indexController.mniActualizarTablaTarjetas.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.INFORMES.MENU.SERVICIODIARIO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/pago_conductor/actualizaTarjetaViaje.zul", + Labels.getLabel("importaTarjetaController.window.title"), null,desktop); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pagoconductor/ItemMenuEnvioNomina.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pagoconductor/ItemMenuEnvioNomina.java new file mode 100644 index 000000000..6e55d6dd2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pagoconductor/ItemMenuEnvioNomina.java @@ -0,0 +1,25 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pagoconductor; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuEnvioNomina extends DefaultItemMenuSistema { + + public ItemMenuEnvioNomina() { + super("indexController.mniEnvioNomina.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.INFORMES.MENU.SERVICIODIARIO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/pago_conductor/envioNomina.zul", + Labels.getLabel("envioTarjetaNominaController.window.title"), null,desktop); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pagoconductor/ItemMenuMantenimientosMovimientos.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pagoconductor/ItemMenuMantenimientosMovimientos.java new file mode 100644 index 000000000..fb63abe94 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pagoconductor/ItemMenuMantenimientosMovimientos.java @@ -0,0 +1,25 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pagoconductor; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuMantenimientosMovimientos extends DefaultItemMenuSistema { + + public ItemMenuMantenimientosMovimientos() { + super("indexController.mniMantenimientoMovimientos.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.INFORMES.MENU.SERVICIODIARIO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/pago_conductor/busquedaTarjetaViaje.zul", + Labels.getLabel("busquedaTarjetaViajeController.window.title"), null,desktop); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pagoconductor/MenuPagoConductor.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pagoconductor/MenuPagoConductor.java new file mode 100644 index 000000000..8e04e3a48 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pagoconductor/MenuPagoConductor.java @@ -0,0 +1,15 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pagoconductor; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class MenuPagoConductor extends DefaultItemMenuSistema { + + public MenuPagoConductor() { + super("indexController.mniPagoConductor.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.CATALOGO"; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuAcumulacionPorVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuAcumulacionPorVenta.java new file mode 100644 index 000000000..493a2c08e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuAcumulacionPorVenta.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuAcumulacionPorVenta extends DefaultItemMenuSistema { + + public ItemMenuAcumulacionPorVenta() { + super("indexController.mniAcumulacionPorVenta.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SENDAAMIGO.MENU.CONFIGURACIONPARAACUMULACIONPORVENTA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/senda_amigo/busquedaAcumulacionPorVenta.zul", + Labels.getLabel("busquedaAcumulacionPorVentaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuCanjePuntos.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuCanjePuntos.java new file mode 100644 index 000000000..076538b37 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuCanjePuntos.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuCanjePuntos extends DefaultItemMenuSistema { + + public ItemMenuCanjePuntos() { + super("indexController.mniCanjePuntos.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SENDAAMIGO.MENU.CONFIGURACIONPARACANJEDEPUNTOS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/senda_amigo/busquedaCanjeDePuntos.zul", + Labels.getLabel("busquedaParamCanjePuntoController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuGeneracionTarjeta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuGeneracionTarjeta.java new file mode 100644 index 000000000..2eb6926fb --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuGeneracionTarjeta.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuGeneracionTarjeta extends DefaultItemMenuSistema { + + public ItemMenuGeneracionTarjeta() { + super("indexController.mniGeneracionTarjetaSA.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SENDAAMIGO.GENERACIONTARJETASENDAAMIGO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/senda_amigo/busquedaGeneracionTarjetaSA.zul", + Labels.getLabel("busquedaGeneracionTarjetaSAController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuParamAcumulacionMasivo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuParamAcumulacionMasivo.java new file mode 100644 index 000000000..de14dbb89 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuParamAcumulacionMasivo.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuParamAcumulacionMasivo extends DefaultItemMenuSistema { + + public ItemMenuParamAcumulacionMasivo() { + super("indexController.mniParamAcumulacionMasivo.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SENDAAMIGO.MENU.CONFIGURACIONPARAACUMULACIONMASIVA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/senda_amigo/busquedaParamAcumulaMasivo.zul", + Labels.getLabel("busquedaParamAcumulacionMasivoController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuParamCompraPuntos.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuParamCompraPuntos.java new file mode 100644 index 000000000..e2c9845fc --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuParamCompraPuntos.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuParamCompraPuntos extends DefaultItemMenuSistema { + + public ItemMenuParamCompraPuntos() { + super("indexController.mniParamCompraPunto.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SENDAAMIGO.MENU.CONFIGURACIONPARACOMPRADEPUNTOS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/senda_amigo/busquedaParamCompraPunto.zul", + Labels.getLabel("busquedaParamCompraPuntoController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuParamCostoTarjeta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuParamCostoTarjeta.java new file mode 100644 index 000000000..4cbfbc8e4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuParamCostoTarjeta.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuParamCostoTarjeta extends DefaultItemMenuSistema { + + public ItemMenuParamCostoTarjeta() { + super("indexController.mniParamCostoTarjeta.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SENDAAMIGO.MENU.CONFIGURACIONCOSTOTARJETA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/senda_amigo/busquedaParamCostoTarjeta.zul", + Labels.getLabel("busquedaParamCostoTarjetaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuTipoDomicilio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuTipoDomicilio.java new file mode 100644 index 000000000..f24ec6110 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuTipoDomicilio.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTipoDomicilio extends DefaultItemMenuSistema { + + public ItemMenuTipoDomicilio() { + super("indexController.mniTipoDomicilio.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SENDAAMIGO.MENU.TIPOODOMICILIO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/senda_amigo/busquedaTipoDomicilio.zul", + Labels.getLabel("busquedaTipoDomicilioController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuTipoMovimiento.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuTipoMovimiento.java new file mode 100644 index 000000000..cc96bb428 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuTipoMovimiento.java @@ -0,0 +1,27 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTipoMovimiento extends DefaultItemMenuSistema { + + public ItemMenuTipoMovimiento() { + super("indexController.mniTipoMovimiento.label"); + } + + @Override + public String getClaveMenu() { + return "___COM.RJCONSULTORES.ADMINISTRACION.GUI.SENDAAMIGO.MENU.TIPOMOVIMIENTO___"; + //Rafael: mniTipoMovimiento � um catalogo interno, n�o ficara vis�vel. + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/senda_amigo/busquedaTipoMovimiento.zul", + Labels.getLabel("busquedaTipoMovimientoController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuTipoOcupacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuTipoOcupacion.java new file mode 100644 index 000000000..d006059b4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/ItemMenuTipoOcupacion.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTipoOcupacion extends DefaultItemMenuSistema { + + public ItemMenuTipoOcupacion() { + super("indexController.mniTipoOcupacion.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SENDAAMIGO.MENU.TIPOOCUPACION"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/senda_amigo/busquedaTipoOcupacion.zul", + Labels.getLabel("busquedaTipoOcupacionController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/MenuPasajeroFrecuente.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/MenuPasajeroFrecuente.java new file mode 100644 index 000000000..3b6b8f129 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pasajerofrecuente/MenuPasajeroFrecuente.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class MenuPasajeroFrecuente extends DefaultItemMenuSistema { + + public MenuPasajeroFrecuente() { + super("indexController.mnSendaAmigo.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SENDAAMIGO"; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pricing/ItemMenuPricing.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pricing/ItemMenuPricing.java new file mode 100644 index 000000000..12e1b5617 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pricing/ItemMenuPricing.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pricing; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuPricing extends DefaultItemMenuSistema { + + public ItemMenuPricing() { + super("indexController.mniPricing.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.PRICING.MENU.PRICING"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/pricing/busquedaPricing.zul", + Labels.getLabel("busquedaPricingController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pricing/ItemMenuPricingEspecifico.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pricing/ItemMenuPricingEspecifico.java new file mode 100644 index 000000000..dc894b21c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pricing/ItemMenuPricingEspecifico.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pricing; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuPricingEspecifico extends DefaultItemMenuSistema { + + public ItemMenuPricingEspecifico() { + super("indexController.mniPricingEspecifico.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.PRICING.MENU.PRICINGESPECIFICO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/pricing/busquedaPricingEspecifico.zul", + Labels.getLabel("busquedaPricingEspecificoController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pricing/MenuPricing.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pricing/MenuPricing.java new file mode 100644 index 000000000..45011f4f0 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/pricing/MenuPricing.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.pricing; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class MenuPricing extends DefaultItemMenuSistema { + + public MenuPricing() { + super("indexController.mnPricing.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.PRICING"; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuAutorizacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuAutorizacion.java new file mode 100644 index 000000000..a3ef0d958 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuAutorizacion.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuAutorizacion extends DefaultItemMenuSistema { + + public ItemMenuAutorizacion() { + super("indexController.mniAutorizacion.label"); + } + + @Override + public String getClaveMenu() { + return "___COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.AUTORIZACION__";//retirado por solicitacion + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/seguridad/busquedaAutorizacion.zul", + Labels.getLabel("busquedaAutorizacionController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuAutorizacionPerfil.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuAutorizacionPerfil.java new file mode 100644 index 000000000..3acda0bc8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuAutorizacionPerfil.java @@ -0,0 +1,27 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuAutorizacionPerfil extends DefaultItemMenuSistema { + + public ItemMenuAutorizacionPerfil() { + super("indexController.mniAutorizacionPerfil.label"); + } + + @Override + public String getClaveMenu() { + //return "____COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.AUTORIZACIONPERFIL____"; + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.AUTORIZACIONPERFIL"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/seguridad/busquedaAutorizacionPerfil.zul", + Labels.getLabel("busquedaAutorizacionPerfilController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuCompaniaBancaria.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuCompaniaBancaria.java new file mode 100644 index 000000000..788847875 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuCompaniaBancaria.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuCompaniaBancaria extends DefaultItemMenuSistema { + + public ItemMenuCompaniaBancaria() { + super("indexController.mniCompaniaBancaria.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.COMPANIABANCARIA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/seguridad/busquedaCompaniaBancaria.zul", + Labels.getLabel("indexController.mniCompaniaBancaria.label"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuEstacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuEstacion.java new file mode 100644 index 000000000..009f7b812 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuEstacion.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuEstacion extends DefaultItemMenuSistema { + + public ItemMenuEstacion() { + super("indexController.mniEstacion.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.ESTACION"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/seguridad/busquedaEstacion.zul", + Labels.getLabel("busquedaEstacionPerfilController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuPerfil.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuPerfil.java new file mode 100644 index 000000000..916564543 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuPerfil.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuPerfil extends DefaultItemMenuSistema { + + public ItemMenuPerfil() { + super("indexController.mniPerfil.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.PERFIL"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/seguridad/busquedaPerfil.zul", + Labels.getLabel("busquedaPerfilController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuUsuario.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuUsuario.java new file mode 100644 index 000000000..6827dda1b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/ItemMenuUsuario.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuUsuario extends DefaultItemMenuSistema { + + public ItemMenuUsuario() { + super("indexController.mniUsuario.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD.MENU.USUARIO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/seguridad/busquedaUsuario.zul", + Labels.getLabel("busquedaUsuarioController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/MenuSeguridad.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/MenuSeguridad.java new file mode 100644 index 000000000..23b8a663b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/seguridad/MenuSeguridad.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class MenuSeguridad extends DefaultItemMenuSistema { + + public MenuSeguridad() { + super("indexController.mnSeguridad.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.SEGURIDAD"; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuCambioVigencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuCambioVigencia.java new file mode 100644 index 000000000..4fd181a9f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuCambioVigencia.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuCambioVigencia extends DefaultItemMenuSistema { + + public ItemMenuCambioVigencia() { + super("indexController.mniCambioVigencia.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.CAMBIODEVIGENCIA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/tarifas/cambioVigencia.zul", + Labels.getLabel("indexController.mniCambioVigencia.label"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuExcepcionRedondeo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuExcepcionRedondeo.java new file mode 100644 index 000000000..467ef00ba --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuExcepcionRedondeo.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuExcepcionRedondeo extends DefaultItemMenuSistema { + + public ItemMenuExcepcionRedondeo() { + super("indexController.mniExcepcionRedondo.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.EXCEPCIONREDONDO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/tarifas/busquedaExceptionRedondo.zul", + Labels.getLabel("busquedaExceptionRedondoController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuMercadoCompetido.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuMercadoCompetido.java new file mode 100644 index 000000000..d3c0ae154 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuMercadoCompetido.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuMercadoCompetido extends DefaultItemMenuSistema { + + public ItemMenuMercadoCompetido() { + super("indexController.mniMercadoCompetido.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.MERCADOCOMPETIDO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/tarifas/busquedaMercadoCompetido.zul", + Labels.getLabel("busquedaMercadoCompetidoController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuModificacionMasiva.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuModificacionMasiva.java new file mode 100644 index 000000000..e7ab785ab --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuModificacionMasiva.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuModificacionMasiva extends DefaultItemMenuSistema { + + public ItemMenuModificacionMasiva() { + super("indexController.mniModificacionMasiva.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.MODIFICACIONMASIVADETARIFAS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/tarifas/modificacionMasivaTarifas.zul", + Labels.getLabel("indexController.mniModificacionMasiva.label"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuRedondeo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuRedondeo.java new file mode 100644 index 000000000..d986d79fe --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuRedondeo.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuRedondeo extends DefaultItemMenuSistema { + + public ItemMenuRedondeo() { + super("indexController.mniRedondeo.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.REDONDEO"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/tarifas/busquedaRedondeo.zul", + Labels.getLabel("busquedaRedondeoController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuTarifaEscala.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuTarifaEscala.java new file mode 100644 index 000000000..a3daa4a49 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuTarifaEscala.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTarifaEscala extends DefaultItemMenuSistema { + + public ItemMenuTarifaEscala() { + super("indexController.mniTarifasEscala.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.TARIFAESCALA"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/tarifas/tarifa_escala/tarifaEscala.zul", + Labels.getLabel("tarifaEscalaContorller.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuTarifas.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuTarifas.java new file mode 100644 index 000000000..abfa63a4c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuTarifas.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTarifas extends DefaultItemMenuSistema { + + public ItemMenuTarifas() { + super("indexController.mniTarifas.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.TARIFAS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/tarifas/busquedaTarifas.zul", + Labels.getLabel("busquedaTarifaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuTarifasMinimas.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuTarifasMinimas.java new file mode 100644 index 000000000..e21f70f54 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuTarifasMinimas.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuTarifasMinimas extends DefaultItemMenuSistema { + + public ItemMenuTarifasMinimas() { + super("indexController.mniTarifasMinimas.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.TARIFASMINIMAS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/tarifas/busquedaTarifasMinimas.zul", + Labels.getLabel("busquedaTarifasMinimasController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuVigenciaTarifa.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuVigenciaTarifa.java new file mode 100644 index 000000000..f46e88dfa --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/ItemMenuVigenciaTarifa.java @@ -0,0 +1,26 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuVigenciaTarifa extends DefaultItemMenuSistema { + + public ItemMenuVigenciaTarifa() { + super("indexController.mniVigenciaTarifa.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS.MENU.VIGENCIATARIFAS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/tarifas/busquedaVigenciaTarifa.zul", + Labels.getLabel("busquedaVigenciaTarifaController.window.title"), null,desktop); + + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/MenuTarifas.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/MenuTarifas.java new file mode 100644 index 000000000..2efd281ff --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/tarifas/MenuTarifas.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class MenuTarifas extends DefaultItemMenuSistema { + + public MenuTarifas() { + super("indexController.mnTarifas.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.TARIFAS"; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/labellocator/MenuLabelLocator.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/labellocator/MenuLabelLocator.java new file mode 100644 index 000000000..6dd3780e7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/labellocator/MenuLabelLocator.java @@ -0,0 +1,11 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.labellocator; + +/** + * Clase responsable por localizar el texto de un menu por una clave + * + * @author gleimar + * + */ +public interface MenuLabelLocator { + public String getLabel(String key); +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/labellocator/ZKMenuLabelLocator.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/labellocator/ZKMenuLabelLocator.java new file mode 100644 index 000000000..3a03ec03e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/labellocator/ZKMenuLabelLocator.java @@ -0,0 +1,23 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.labellocator; + +import org.zkoss.util.resource.Labels; + +public class ZKMenuLabelLocator implements MenuLabelLocator { + + private static MenuLabelLocator INSTANCE; + + private ZKMenuLabelLocator(){ + + } + @Override + public String getLabel(String key) { + return Labels.getLabel(key); + } + public static MenuLabelLocator getInstance(){ + if (INSTANCE == null){ + INSTANCE = new ZKMenuLabelLocator(); + } + return INSTANCE; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties new file mode 100644 index 000000000..bfea59f4a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties @@ -0,0 +1,102 @@ +catalogos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.MenuCatalogos +catalogos.articulos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuArticulo +catalogos.tipoCorte=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuTipoCorte +catalogos.claseServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuClaseServicio +catalogos.categoria=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuCategoria +catalogos.estado=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuEstado +catalogos.ciudad=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuCiudad +catalogos.colonia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuColonia +catalogos.cuponConvenio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuCuponConvenio +catalogos.empresa=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuEmpresa +catalogos.formaPago=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuFormaPago +catalogos.marcas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuMarcas +catalogos.monedas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuMoneda +catalogos.pais=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuPais +catalogos.plaza=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuPlaza +catalogos.productoServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuProductoServicio +catalogos.tipoConvenio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuTipoConvenio +catalogos.tipoPuntoVenta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuTipoPuntoVenta +catalogos.tipoServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuTipoServicio +catalogos.associacioClaseServicioMarca=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuAssociacionClaseServicioMarca +catalogos.tipoVenta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuTipoVenta +catalogos.puntoVenta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuPuntoVenta +catalogos.turno=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuTurno +confComerciales=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.MenuConfiguracionesComerciales +confComerciales.secretaria=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuSecretaria +confComerciales.convenio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConvenio +confComerciales.tipoCambioCiudad=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuTipoCambioCiudad +confComerciales.comisionistaExterno=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuComisionistaExterno +confComerciales.configuracionCancelacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionCancelacion +confComerciales.configuracionCategorias=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionCategorias +confComerciales.configuracionGeneral=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionGeneral +confComerciales.configuracionReservacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionReservacion +confComerciales.restriccionFormaPago=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuRestriccionFormaPago +confComerciales.configuracionServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionServicio +confComerciales.configuracionAlerta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuConfiguracionAlerta +confComerciales.motivoCancelacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuMotivoCancelacion +confComerciales.motivoReimpresion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuMotivoReimpresion +confComerciales.periodoVacacional=com.rjconsultores.ventaboletos.web.utilerias.menu.item.confcomerciales.ItemMenuPeriodoVacacional +cortesias=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.MenuCortesias +cortesias.grupoCortesia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuGrupoCortesia +cortesias.tipoCortesia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuTipoCortesia +cortesias.tipoCortesiaDescuento=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuTipoCortesiaDescuento +cortesias.cortesiaDireccion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuCortesiaDireccion +cortesias.altaCortesiaRH=com.rjconsultores.ventaboletos.web.utilerias.menu.item.cortesias.ItemMenuAltaCortesiaRH +esquemaOperacional=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.MenuEsquemaOperacional +esquemaOperacional.tipoParadas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuTipoParadas +esquemaOperacional.paradas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuEsquemaOperacionalParadas +esquemaOperacional.autobus=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuAutobus +esquemaOperacional.diagramaAutobus=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuDiagramaAutobus +esquemaOperacional.via=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuVia +esquemaOperacional.generacionAutomaticaTramoRuta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuGeneracionAutomaticaTramoRuta +esquemaOperacional.tramo=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuTramo +esquemaOperacional.tramoKmServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuTramoKmServicio +esquemaOperacional.ruta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuEsquemaOperacionalRuta +esquemaOperacional.corrida=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuCorrida +esquemaOperacional.rolOperativo=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuRolOperativo +esquemaOperacional.generacionCorrida=com.rjconsultores.ventaboletos.web.utilerias.menu.item.esquemaoperacional.ItemMenuGeneracionCorrida +pricing=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pricing.MenuPricing +pricing.general=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pricing.ItemMenuPricing +pricing.especifico=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pricing.ItemMenuPricingEspecifico +tarifas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.MenuTarifas +tarifas.redondeo=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuRedondeo +tarifas.excepcionRedondeo=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuExcepcionRedondeo +tarifas.vigenciaTarifa=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuVigenciaTarifa +tarifas.tarifasMinimas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuTarifasMinimas +tarifas.mercadoCompetido=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuMercadoCompetido +tarifas.cambioVigencia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuCambioVigencia +tarifas.modificacionMasiva=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuModificacionMasiva +tarifas.tarifas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuTarifas +tarifas.tarifaEscala=com.rjconsultores.ventaboletos.web.utilerias.menu.item.tarifas.ItemMenuTarifaEscala +pasajeroFrecuente=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.MenuPasajeroFrecuente +pasajeroFrecuente.tipoDomicilio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuTipoDomicilio +pasajeroFrecuente.tipoOcupacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuTipoOcupacion +pasajeroFrecuente.tipoMovimiento=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuTipoMovimiento +pasajeroFrecuente.paramAcumulacionMasivo=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuParamAcumulacionMasivo +pasajeroFrecuente.acumulacionPorVenta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuAcumulacionPorVenta +pasajeroFrecuente.canjePuntos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuCanjePuntos +pasajeroFrecuente.paramCompraPuntos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuParamCompraPuntos +pasajeroFrecuente.paramCostoTarjeta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuParamCostoTarjeta +pasajeroFrecuente.generacionTarjeta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.pasajerofrecuente.ItemMenuGeneracionTarjeta +seguridad=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.MenuSeguridad +seguridad.companiaBancaria=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuCompaniaBancaria +seguridad.estacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuEstacion +seguridad.autorizacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuAutorizacion +seguridad.perfil=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuPerfil +seguridad.autorizacionPerfil=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuAutorizacionPerfil +seguridad.usuario=com.rjconsultores.ventaboletos.web.utilerias.menu.item.seguridad.ItemMenuUsuario +equivalencia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia.MenuEquivalencia +equivalencia.parada=com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia.ItemMenuParadaEquivalencia +equivalencia.empresa=com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia.ItemMenuEmpresaEquivalencia +equivalencia.claseServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia.ItemMenuClaseServicioEquivalencia +equivalencia.motivoCancelacion=com.rjconsultores.ventaboletos.web.utilerias.menu.item.equivalencia.ItemMenuMotivoCancelacionEquivalencia +ingresosExtras=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ingreso.MenuIngreso +ingresosExtras.bancos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ingreso.ItemMenuBancos +ingresosExtras.ingreso=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ingreso.ItemMenuIngreso +informes=com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes.MenuInformes +informes.pasajeroServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes.ItemMenuPasajeroServicio +informes.servicioDiario=com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes.ItemMenuServicioDiario +informes.categoriaVenta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes.ItemMenuCategoriaVenta +informes.ventasPuntoVenta=com.rjconsultores.ventaboletos.web.utilerias.menu.item.informes.ItemMenuVentasPuntoVenta +ayuda=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ayuda.MenuAyuda +ayuda.version=com.rjconsultores.ventaboletos.web.utilerias.menu.item.ayuda.ItemMenuVersion \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/HibernateSearchObject.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/HibernateSearchObject.java new file mode 100644 index 000000000..ad234ce83 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/HibernateSearchObject.java @@ -0,0 +1,49 @@ +package com.rjconsultores.ventaboletos.web.utilerias.paginacion; + +/** + * Copyright 2010 the original author or authors. + * + * This file is part of Zksample2. http://zksample2.sourceforge.net/ + * + * Zksample2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Zksample2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Zksample2. If not, see . + */ +import com.trg.search.Search; +import java.io.Serializable; + +/** + * SearchObject depending on the Search Object from the Hibernate-Generic-DAO + * framework.
+ * + * @see http://code.google.com/p/hibernate-generic-dao/
+ * Many thanks to David Wolverton. + * + * @author bbruhns + * @author sgerth + * + * @param + */ +public class HibernateSearchObject extends Search implements Serializable { + + private static final long serialVersionUID = 1L; + + public HibernateSearchObject(Class entityClass) { + super(entityClass); + } + + public HibernateSearchObject(Class entityClass, int pageSize) { + super(entityClass); + setFirstResult(0); + setMaxResults(pageSize); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/HibernateSearchSupport.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/HibernateSearchSupport.java new file mode 100644 index 000000000..95be01cad --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/HibernateSearchSupport.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.paginacion; + +import java.util.List; + +import org.hibernate.NonUniqueResultException; + +import com.trg.search.ExampleOptions; +import com.trg.search.Filter; +import com.trg.search.ISearch; +import com.trg.search.SearchResult; + +/** + * + * @author gleimar + */ +public interface HibernateSearchSupport { + + int count(Class searchClass, ISearch search); + + int count(ISearch search); + + String generateQL(Class entityClass, ISearch search, List paramList); + + String generateRowCountQL(Class entityClass, ISearch search, List paramList); + + Filter getFilterFromExample(Object example, ExampleOptions options); + + Filter getFilterFromExample(Object example); + + List search(Class searchClass, ISearch search); + + List search(ISearch search); + + SearchResult searchAndCount(Class searchClass, ISearch search); + + SearchResult searchAndCount(ISearch search); + + T searchUnique(Class entityClass, ISearch search) throws NonUniqueResultException; + + Object searchUnique(ISearch search) throws NonUniqueResultException; +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/HibernateSearchSupportImpl.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/HibernateSearchSupportImpl.java new file mode 100644 index 000000000..90580fdb5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/HibernateSearchSupportImpl.java @@ -0,0 +1,180 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.paginacion; + +import java.util.List; + +import org.hibernate.NonUniqueResultException; +import org.hibernate.Session; +import org.hibernate.SessionFactory; + +import com.trg.search.ExampleOptions; +import com.trg.search.Filter; +import com.trg.search.ISearch; +import com.trg.search.SearchResult; +import com.trg.search.hibernate.HibernateSearchProcessor; + +/** + * @author bbruhns + * + */ +public class HibernateSearchSupportImpl implements HibernateSearchSupport { + + private HibernateSearchProcessor hibernateSearchProcessor; + private SessionFactory sessionFactory; + + /* + * (non-Javadoc) + * + * @see + * de.forsthaus.backend.dao.impl.HibernateSearchSupport#count(java.lang. + * Class, com.trg.search.ISearch) + */ + public int count(Class searchClass, ISearch search) { + return hibernateSearchProcessor.count(getCurrentSession(), searchClass, search); + } + + /* + * (non-Javadoc) + * + * @see + * de.forsthaus.backend.dao.impl.HibernateSearchSupport#count(com.trg.search + * .ISearch) + */ + public int count(ISearch search) { + return hibernateSearchProcessor.count(getCurrentSession(), search); + } + + /* + * (non-Javadoc) + * + * @see + * de.forsthaus.backend.dao.impl.HibernateSearchSupport#generateQL(java. + * lang.Class, com.trg.search.ISearch, java.util.List) + */ + public String generateQL(Class entityClass, ISearch search, List paramList) { + return hibernateSearchProcessor.generateQL(entityClass, search, paramList); + } + + /* + * (non-Javadoc) + * + * @see + * de.forsthaus.backend.dao.impl.HibernateSearchSupport#generateRowCountQL + * (java.lang.Class, com.trg.search.ISearch, java.util.List) + */ + public String generateRowCountQL(Class entityClass, ISearch search, List paramList) { + return hibernateSearchProcessor.generateRowCountQL(entityClass, search, paramList); + } + + private Session getCurrentSession() { + return getSessionFactory().getCurrentSession(); + } + + /* + * (non-Javadoc) + * + * @see + * de.forsthaus.backend.dao.impl.HibernateSearchSupport#getFilterFromExample + * (java.lang.Object) + */ + public Filter getFilterFromExample(Object example) { + return hibernateSearchProcessor.getFilterFromExample(example); + } + + /* + * (non-Javadoc) + * + * @see + * de.forsthaus.backend.dao.impl.HibernateSearchSupport#getFilterFromExample + * (java.lang.Object, com.trg.search.ExampleOptions) + */ + public Filter getFilterFromExample(Object example, ExampleOptions options) { + return hibernateSearchProcessor.getFilterFromExample(example, options); + } + + private SessionFactory getSessionFactory() { + return sessionFactory; + } + + /* + * (non-Javadoc) + * + * @see + * de.forsthaus.backend.dao.impl.HibernateSearchSupport#search(java.lang + * .Class, com.trg.search.ISearch) + */ + @SuppressWarnings("unchecked") + public List search(Class searchClass, ISearch search) { + return hibernateSearchProcessor.search(getCurrentSession(), searchClass, search); + } + + /* + * (non-Javadoc) + * + * @see + * de.forsthaus.backend.dao.impl.HibernateSearchSupport#search(com.trg.search + * .ISearch) + */ + @SuppressWarnings("unchecked") + public List search(ISearch search) { + return hibernateSearchProcessor.search(getCurrentSession(), search); + } + + /* + * (non-Javadoc) + * + * @see + * de.forsthaus.backend.dao.impl.HibernateSearchSupport#searchAndCount(java + * .lang.Class, com.trg.search.ISearch) + */ + @SuppressWarnings("unchecked") + public SearchResult searchAndCount(Class searchClass, ISearch search) { + return hibernateSearchProcessor.searchAndCount(getCurrentSession(), searchClass, search); + } + + /* + * (non-Javadoc) + * + * @see + * de.forsthaus.backend.dao.impl.HibernateSearchSupport#searchAndCount(com + * .trg.search.ISearch) + */ + @SuppressWarnings("unchecked") + public SearchResult searchAndCount(ISearch search) { + return hibernateSearchProcessor.searchAndCount(getCurrentSession(), search); + } + + /* + * (non-Javadoc) + * + * @see + * de.forsthaus.backend.dao.impl.HibernateSearchSupport#searchUnique(java + * .lang.Class, com.trg.search.ISearch) + */ + @SuppressWarnings("unchecked") + public T searchUnique(Class entityClass, ISearch search) throws NonUniqueResultException { + return (T) hibernateSearchProcessor.searchUnique(getCurrentSession(), entityClass, search); + } + + /* + * (non-Javadoc) + * + * @see + * de.forsthaus.backend.dao.impl.HibernateSearchSupport#searchUnique(com + * .trg.search.ISearch) + */ + public Object searchUnique(ISearch search) throws NonUniqueResultException { + return hibernateSearchProcessor.searchUnique(getCurrentSession(), search); + } + + public void setHibernateSearchProcessor(HibernateSearchProcessor hibernateSearchProcessor) { + this.hibernateSearchProcessor = hibernateSearchProcessor; + } + + public void setSessionFactory(SessionFactory sessionFactory) { + this.sessionFactory = sessionFactory; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/PagedListService.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/PagedListService.java new file mode 100644 index 000000000..fba657692 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/PagedListService.java @@ -0,0 +1,29 @@ +/** + * Copyright 2010 the original author or authors. + * + * This file is part of Zksample2. http://zksample2.sourceforge.net/ + * + * Zksample2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Zksample2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Zksample2. If not, see . + */ +package com.rjconsultores.ventaboletos.web.utilerias.paginacion; + +import com.trg.search.SearchResult; +import java.util.List; + +public interface PagedListService { + + public List getBySearchObject(HibernateSearchObject so); + + public SearchResult getSRBySearchObject(HibernateSearchObject so); +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/PagedListServiceImpl.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/PagedListServiceImpl.java new file mode 100644 index 000000000..b0c376c1c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/PagedListServiceImpl.java @@ -0,0 +1,74 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +/** + * Copyright 2010 the original author or authors. + * + * This file is part of Zksample2. http://zksample2.sourceforge.net/ + * + * Zksample2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Zksample2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Zksample2. If not, see . + */ +package com.rjconsultores.ventaboletos.web.utilerias.paginacion; + +import java.util.List; + +import com.trg.search.SearchResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * Service implementation for methods that depends on PagedListWrapper + * class.
+ * + * @author bbruhns + * @author sgerth + */ +@Service("pagedListService") +public class PagedListServiceImpl implements PagedListService { + + @Autowired + private HibernateSearchSupport hibernateSearchSupport; + + public PagedListServiceImpl() { + } + + public PagedListServiceImpl(HibernateSearchSupport hibernateSearchSupport) { + this.hibernateSearchSupport = hibernateSearchSupport; + } + + public HibernateSearchSupport getHibernateSearchSupport() { + return hibernateSearchSupport; + } + + public void setHibernateSearchSupport(HibernateSearchSupport hibernateSearchSupport) { + this.hibernateSearchSupport = hibernateSearchSupport; + } + + @SuppressWarnings("unused") + private void initSearchObject(HibernateSearchObject so, int start, int pageSize) { + so.setFirstResult(start); + so.setMaxResults(pageSize); + } + + @Override + public List getBySearchObject(HibernateSearchObject so) { + return getHibernateSearchSupport().search(so); + } + + @Override + public SearchResult getSRBySearchObject(HibernateSearchObject so) { + return getHibernateSearchSupport().searchAndCount(so); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/PagedListWrapper.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/PagedListWrapper.java new file mode 100644 index 000000000..690fc296d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/paginacion/PagedListWrapper.java @@ -0,0 +1,256 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.paginacion; + +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import com.trg.search.SearchResult; +import java.io.Serializable; +import java.util.Comparator; +import java.util.List; +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Component; +import org.zkoss.lang.Strings; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.FieldComparator; +import org.zkoss.zul.Listhead; +import org.zkoss.zul.Listheader; +import org.zkoss.zul.Paging; +import org.zkoss.zul.event.PagingEvent; + +/** + * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ * Helper class for getting a paged record list that can be sorted by DB.
+ *
+ * + * All not used Listheaders must me declared as:
+ * listheader.setSortAscending("");
+ * listheader.setSortDescending("");
+ * + *
+ * zkoss 3.6.0 or greater (by using FieldComparator)
+ * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ * + * @changes 07/24/2009: sge changes for clustering.
+ * + * @author bbruhns + * @author sgerth + */ +@Component +@Scope("prototype") +public class PagedListWrapper implements Serializable { + + private static final long serialVersionUID = -7399762307122148637L; + static final Logger logger = Logger.getLogger(PagedListWrapper.class); + // Service that calls the DAO methods + @Autowired + private PagedListService pagedListService; + // param. The listboxes paging component + private Paging paging; + // param. The SearchObject + private HibernateSearchObject hibernateSearchObject; + // not used yet. so it's init to 'true'. + private final boolean supportPaging = true; + private MyListbox listBox; + + /** + * default constructor.
+ */ + public PagedListWrapper() { + super(); + } + + public void init(HibernateSearchObject hibernateSearchObject1, MyListbox listBox, Paging paging1) { + this.listBox = listBox; + setPaging(paging1); + setListeners(); + + setSearchObject(hibernateSearchObject1); + } + + private void initModel() { + getSearchObject().setFirstResult(0); + getSearchObject().setMaxResults(getPageSize()); + + + + SearchResult searchResult = getPagedListService().getSRBySearchObject(getSearchObject()); + getPaging().setTotalSize(searchResult.getTotalCount()); + listBox.setData(searchResult.getResult()); + } + + /** + * Refreshes the list by calling the DAO methode with the modified search + * object.
+ * + * @param so + * SearchObject, holds the entity and properties to search.
+ * @param start + * Row to start.
+ * @param pageSize + * Count rows to fetch.
+ */ + void refreshModel(int start) { + getSearchObject().setFirstResult(start); + getSearchObject().setMaxResults(getPageSize()); + + + listBox.setData(getPagedListService().getBySearchObject(getSearchObject())); + } + + boolean isSupportPagging() { + return supportPaging; + } + + public void clearFilters() { + getSearchObject().clearFilters(); + initModel(); + } + + /** + * Sets the listeners.
+ *
+ * 1. "onPaging" for the paging component.
+ * 2. "onSort" for all listheaders that have a sortDirection declared.
+ * All not used Listheaders must me declared as: + * listheader.setSortAscending(""); listheader.setSortDescending("");
+ */ + private void setListeners() { + + // Add 'onPaging' listener to the paging component + getPaging().addEventListener("onPaging", new OnPagingEventListener()); + + Listhead listhead = listBox.getListhead(); + List list = listhead.getChildren(); + + OnSortEventListener onSortEventListener = new OnSortEventListener(); + for (Object object : list) { + if (object instanceof Listheader) { + Listheader lheader = (Listheader) object; + + if (lheader.getSortAscending() != null || lheader.getSortDescending() != null) { + +// if (logger.isDebugEnabled()) { +// logger.debug("--> : " + lheader.getId()); +// } + lheader.addEventListener("onSort", onSortEventListener); + } + } + } + } + + /** + * "onPaging" eventlistener for the paging component.
+ *
+ * Calculates the next page by currentPage and pageSize values.
+ * Calls the methode for refreshing the data with the new rowStart and + * pageSize.
+ */ + public final class OnPagingEventListener implements EventListener { + + @Override + public void onEvent(Event event) throws Exception { + + PagingEvent pe = (PagingEvent) event; + int pageNo = pe.getActivePage(); + int start = pageNo * getPageSize(); + +// if (logger.isDebugEnabled()) { +// logger.debug("--> : " + start + "/" + getPageSize()); +// } + + // refresh the list + refreshModel(start); + } + } + + /** + * "onSort" eventlistener for the listheader components.
+ *
+ * Checks wich listheader is clicked and checks which orderDirection must be + * set.
+ * + * Calls the methode for refreshing the data with the new ordering. and the + * remembered rowStart and pageSize.
+ */ + public final class OnSortEventListener implements EventListener, Serializable { + + private static final long serialVersionUID = 1L; + + @Override + public void onEvent(Event event) throws Exception { + final Listheader lh = (Listheader) event.getTarget(); + final String sortDirection = lh.getSortDirection(); + + if ("ascending".equals(sortDirection)) { + final Comparator cmpr = lh.getSortDescending(); + if (cmpr instanceof FieldComparator) { + String orderBy = ((FieldComparator) cmpr).getOrderBy(); + orderBy = StringUtils.substringBefore(orderBy, "DESC").trim(); + + // update SearchObject with orderBy + getSearchObject().clearSorts(); + getSearchObject().addSort(orderBy, true); + } + } else if ("descending".equals(sortDirection) || "natural".equals(sortDirection) || Strings.isBlank(sortDirection)) { + final Comparator cmpr = lh.getSortAscending(); + if (cmpr instanceof FieldComparator) { + String orderBy = ((FieldComparator) cmpr).getOrderBy(); + orderBy = StringUtils.substringBefore(orderBy, "ASC").trim(); + + // update SearchObject with orderBy + getSearchObject().clearSorts(); + getSearchObject().addSort(orderBy, false); + } + } + +// if (logger.isDebugEnabled()) { +// logger.debug("--> : " + lh.getId() + "/" + sortDirection); +// logger.debug("--> added getSorts() : " + getSearchObject().getSorts().toString()); +// } + + if (isSupportPagging()) { + // refresh the list + getPaging().setActivePage(0); + refreshModel(0); + } + } + } + + public PagedListService getPagedListService() { + return pagedListService; + } + + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++// + // ++++++++++++++++++ getter / setter +++++++++++++++++++// + // ++++++++++++++++++++++++++++++++++++++++++++++++++++++// + HibernateSearchObject getSearchObject() { + return hibernateSearchObject; + } + + public int getPageSize() { + return getPaging().getPageSize(); + } + + Paging getPaging() { + return paging; + } + + public void setPagedListService(PagedListService pagedListService) { + this.pagedListService = pagedListService; + } + + private void setPaging(Paging paging) { + this.paging = paging; + } + + public void setSearchObject(HibernateSearchObject hibernateSearchObject1) { + this.hibernateSearchObject = hibernateSearchObject1; + initModel(); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/FormaPagoDetRender.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/FormaPagoDetRender.java new file mode 100644 index 000000000..d4a9e1493 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/FormaPagoDetRender.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.FormaPagoDet; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class FormaPagoDetRender implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + FormaPagoDet formaPagoDet = (FormaPagoDet) o; + + Listcell lc = new Listcell(formaPagoDet.getFormaPago().getDescpago()); + lc.setParent(lstm); + + lc = new Listcell(formaPagoDet.getCargosextras().toString()); + lc.setParent(lstm); + + lstm.setAttribute("data", formaPagoDet); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/ParamRecoleccionRender.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/ParamRecoleccionRender.java new file mode 100644 index 000000000..b68394dff --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/ParamRecoleccionRender.java @@ -0,0 +1,30 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ParamRecoleccion; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Desenvolvimento + */ +public class ParamRecoleccionRender implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ParamRecoleccion tm = (ParamRecoleccion) o; + + Listcell lc = new Listcell(tm.getImporteinicial() == null ? "" : tm.getImporteinicial().setScale(2).toString()); + lc.setParent(lstm); + + lc = new Listcell(tm.getImporteadicional() == null ? "" : tm.getImporteadicional().setScale(2).toString()); + lc.setParent(lstm); + + + lstm.setAttribute("data", tm); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/PtovtaEmpresaRender.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/PtovtaEmpresaRender.java new file mode 100644 index 000000000..6b02dac21 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/PtovtaEmpresaRender.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Desenvolvimento + */ +public class PtovtaEmpresaRender implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PtovtaEmpresa ptoVta = (PtovtaEmpresa) o; + + Listcell lc = new Listcell(ptoVta.getEmpresa() == null ? " - " : ptoVta.getEmpresa().getNombempresa()); + lc.setParent(lstm); + + lstm.setAttribute("data", ptoVta); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/PtovtaUsuarioBancarioRender.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/PtovtaUsuarioBancarioRender.java new file mode 100644 index 000000000..8674973e9 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/PtovtaUsuarioBancarioRender.java @@ -0,0 +1,30 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PtoVtaUsuarioBancario; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Desenvolvimento + */ +public class PtovtaUsuarioBancarioRender implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PtoVtaUsuarioBancario ptoVta = (PtoVtaUsuarioBancario) o; + + Listcell lc = new Listcell(ptoVta.getEmpresa() == null ? " - " : ptoVta.getEmpresa().getNombempresa()); + lc.setParent(lstm); + + lc = new Listcell(ptoVta.getUsuarioBancario() == null ? " - " : ptoVta.getUsuarioBancario().getCveusuario()); + lc.setParent(lstm); + + lstm.setAttribute("data", ptoVta); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAlertaCtrl.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAlertaCtrl.java new file mode 100644 index 000000000..0dd42fd48 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAlertaCtrl.java @@ -0,0 +1,150 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.AlertaCtrl; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import java.math.BigDecimal; +import org.zkoss.util.resource.Labels; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderAlertaCtrl implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + AlertaCtrl alertaCtrl = (AlertaCtrl) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(alertaCtrl.getAlertactrlId().toString()); + lc.setParent(lstm); + + if (alertaCtrl.getPorcalta() == null) { + lc = new Listcell(Labels.getLabel("busquedaAlertaCtrlController.tipoBaja.label")); + } else if (alertaCtrl.getPorcbaja() == null) { + lc = new Listcell(Labels.getLabel("busquedaAlertaCtrlController.tipoAlta.label")); + } + lc.setParent(lstm); + + Ruta ruta = alertaCtrl.getRuta(); + if (ruta != null) { + lc = new Listcell(alertaCtrl.getRuta().getDescruta()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + ClaseServicio claseServicio = alertaCtrl.getClaseServicio(); + if (claseServicio != null) { + lc = new Listcell(alertaCtrl.getClaseServicio().getDescclase()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Parada origem = alertaCtrl.getOrigem(); + if (origem != null) { + lc = new Listcell(alertaCtrl.getOrigem().getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Parada destino = alertaCtrl.getDestino(); + if (destino != null) { + lc = new Listcell(alertaCtrl.getDestino().getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Corrida corrida = alertaCtrl.getCorrida(); + if (corrida != null) { + lc = new Listcell(alertaCtrl.getCorrida().getId().getCorridaId().toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (corrida == null) { + lc = new Listcell(""); + lc.setParent(lstm); + lc = new Listcell(""); + lc.setParent(lstm); + lc = new Listcell(""); + lc.setParent(lstm); + lc = new Listcell(""); + lc.setParent(lstm); + lc = new Listcell(""); + lc.setParent(lstm); + lc = new Listcell(""); + lc.setParent(lstm); + lc = new Listcell(""); + lc.setParent(lstm); + } else { + //Lunes + Checkbox ckbLun = new Checkbox(); + ckbLun.setChecked(alertaCtrl.getIndlunes()); + ckbLun.setDisabled(true); + lc = new Listcell(); + ckbLun.setParent(lc); + lc.setParent(lstm); + + + Checkbox ckbMar = new Checkbox(); + ckbMar.setChecked(alertaCtrl.getIndmartes()); + ckbMar.setDisabled(true); + lc = new Listcell(); + ckbMar.setParent(lc); + lc.setParent(lstm); + + + Checkbox ckbMie = new Checkbox(); + ckbMie.setChecked(alertaCtrl.getIndmiercoles()); + ckbMie.setDisabled(true); + lc = new Listcell(); + ckbMie.setParent(lc); + lc.setParent(lstm); + + Checkbox ckbJue = new Checkbox(); + ckbJue.setChecked(alertaCtrl.getIndjueves()); + ckbJue.setDisabled(true); + lc = new Listcell(); + ckbJue.setParent(lc); + lc.setParent(lstm); + + Checkbox ckbVie = new Checkbox(); + ckbVie.setChecked(alertaCtrl.getIndviernes()); + ckbVie.setDisabled(true); + lc = new Listcell(); + ckbVie.setParent(lc); + lc.setParent(lstm); + + Checkbox ckbSab = new Checkbox(); + ckbSab.setChecked(alertaCtrl.getIndsabado()); + ckbSab.setDisabled(true); + lc = new Listcell(); + ckbSab.setParent(lc); + lc.setParent(lstm); + + Checkbox ckbDom = new Checkbox(); + ckbDom.setChecked(alertaCtrl.getInddomingo()); + ckbDom.setDisabled(true); + lc = new Listcell(); + ckbDom.setParent(lc); + lc.setParent(lstm); + } + lstm.setAttribute("data", alertaCtrl); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAltaCortesiaRH.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAltaCortesiaRH.java new file mode 100644 index 000000000..473b4257d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAltaCortesiaRH.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Cortesia; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderAltaCortesiaRH implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + +} +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderArticulo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderArticulo.java new file mode 100644 index 000000000..f9685270e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderArticulo.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Articulo; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderArticulo implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Articulo articulo = (Articulo) o; + + Listcell lc = new Listcell(articulo.getArticuloId().toString()); + lc.setParent(lstm); + + lc = new Listcell(articulo.getDescarticulo()); + lc.setParent(lstm); + + lstm.setAttribute("data", articulo); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAutobus.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAutobus.java new file mode 100644 index 000000000..364d2a3a3 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAutobus.java @@ -0,0 +1,40 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Autobus; +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderAutobus implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Autobus autoBus = (Autobus) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(autoBus.getAutobusId().toString()); + lc.setParent(lstm); + + lc = new Listcell(autoBus.getNumautobus()); + lc.setParent(lstm); + + DiagramaAutobus da = autoBus.getDiagramaAutobus(); + if (da != null) { + lc = new Listcell(da.getDescDiagrama()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", autoBus); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAutorizacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAutorizacion.java new file mode 100644 index 000000000..a3614dc32 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAutorizacion.java @@ -0,0 +1,34 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderAutorizacion implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Autorizacion autorizacion = (Autorizacion) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(autorizacion.getAutorizacionId().toString()); + lc.setParent(lstm); + + lc = new Listcell(autorizacion.getDescautorizacion()); + lc.setParent(lstm); + + lc = new Listcell(autorizacion.getNombautorizacion()); + lc.setParent(lstm); + + lstm.setAttribute("data", autorizacion); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAutorizacionPerfil.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAutorizacionPerfil.java new file mode 100644 index 000000000..b867b93f1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderAutorizacionPerfil.java @@ -0,0 +1,46 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Autorizacion; +import com.rjconsultores.ventaboletos.entidad.AutorizacionPerfil; +import com.rjconsultores.ventaboletos.entidad.Perfil; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderAutorizacionPerfil implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + AutorizacionPerfil autorizacionPerfil = (AutorizacionPerfil) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(autorizacionPerfil.getAutorizacionperfilId().toString()); + lc.setParent(lstm); + + Autorizacion autorizacion = autorizacionPerfil.getAutorizacion(); + if (autorizacion != null) { + lc = new Listcell(autorizacion.getNombautorizacion()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Perfil perfil = autorizacionPerfil.getPerfil(); + if (perfil != null) { + lc = new Listcell(perfil.getDescperfil()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", autorizacionPerfil); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderBanco.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderBanco.java new file mode 100644 index 000000000..8adc142f8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderBanco.java @@ -0,0 +1,53 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Banco; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderBanco implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Banco banco = (Banco) o; + + Listcell lc = new Listcell(banco.getBancoId().toString()); + lc.setParent(lstm); + + lc = new Listcell(banco.getPuntoVenta() == null ? "" : banco.getPuntoVenta().getNombpuntoventa()); + lc.setParent(lstm); + + //CVE Sucursal + lc = new Listcell(banco.getEmpresa() == null ? "" : banco.getEmpresa().getNombempresa()); + lc.setParent(lstm); + + //CVE Sucursal + lc = new Listcell(banco.getMoneda() == null ? "" : banco.getMoneda().getDescmoneda()); + lc.setParent(lstm); + + //Banco + lc = new Listcell(banco.getNombbanco() == null ? "" : banco.getNombbanco()); + lc.setParent(lstm); + + //N Conta + lc = new Listcell(banco.getNumcuenta() == null ? "" : banco.getNumcuenta().toString()); + lc.setParent(lstm); + + //Algo REF + //lc = new Listcell(banco.getAlgoritmoref() == null ? "" : banco.getAlgoritmoref()); + //lc.setParent(lstm); + + //Concepto + //lc = new Listcell(banco.getConcepto() == null ? "" : banco.getConcepto()); + //lc.setParent(lstm); + + lstm.setAttribute("data", banco); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCancelacionCargo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCancelacionCargo.java new file mode 100644 index 000000000..33ec8462b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCancelacionCargo.java @@ -0,0 +1,36 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CancelacionCargo; +import java.math.RoundingMode; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderCancelacionCargo implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CancelacionCargo cc = (CancelacionCargo) o; + + Listcell lc = lc = new Listcell((cc.getTiempominimo() == null) ? "" : cc.getTiempominimo().setScale(2, RoundingMode.HALF_UP).toString()); + lc.setParent(lstm); + + lc = new Listcell((cc.getTiempomaximo() == null) ? "" : cc.getTiempomaximo().setScale(2, RoundingMode.HALF_UP).toString()); + lc.setParent(lstm); + + lc = new Listcell((cc.getPorccargo() == null) ? "" : cc.getPorccargo().setScale(2, RoundingMode.HALF_UP).toString()); + lc.setParent(lstm); + + lc = new Listcell((cc.getImportecargo() == null) ? "" : cc.getImportecargo().setScale(2, RoundingMode.HALF_UP).toString()); + lc.setParent(lstm); + + lstm.setAttribute("data", cc); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeParadas.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeParadas.java new file mode 100644 index 000000000..7130491a5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeParadas.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderCatalogoDeParadas implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Parada parada = (Parada) o; + + Listcell lc = lc = new Listcell(parada.getParadaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(parada.getDescparada()); + lc.setParent(lstm); + + lc = new Listcell(parada.getCveparada()); + lc.setParent(lstm); + + lstm.setAttribute("data", parada); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeRutas.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeRutas.java new file mode 100644 index 000000000..b5a48cdea --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeRutas.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Ruta; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderCatalogoDeRutas implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Ruta ruta = (Ruta) o; + + Listcell lc = new Listcell(ruta.getRutaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(ruta.getDescruta()); + lc.setParent(lstm); + + lc = new Listcell((ruta.getClaseServicio() == null)?"":ruta.getClaseServicio().getDescclase()); + lc.setParent(lstm); + + lstm.setAttribute("data", ruta); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeRutasCombinacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeRutasCombinacion.java new file mode 100644 index 000000000..64252d340 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeRutasCombinacion.java @@ -0,0 +1,97 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.RutaCombinacion; +import com.rjconsultores.ventaboletos.entidad.Via; +import com.rjconsultores.ventaboletos.service.ViaService; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zul.Combobox; +import org.zkoss.zul.Comboitem; +import org.zkoss.zul.ListModelList; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Radiogroup; + +/** + * + * @author Rafius + */ +@Scope("prototype") +public class RenderCatalogoDeRutasCombinacion extends MyGenericForwardComposer implements ListitemRenderer { + + @Autowired + private ViaService viaService; + + @Override + public void render(Listitem lstm, Object o) throws Exception { + RutaCombinacion rutaCombinacion = (RutaCombinacion) o; + + // Listcell lc = new Listcell((rutaCombinacion.getIndventa() == Boolean.TRUE) ? "Si" : "No"); + Listcell lc = new Listcell(); +// +// +// +// + final Radiogroup rg = new Radiogroup(); + //rc.setId("radioGroup2"); + Radio r1 = new Radio(); + r1.setValue("si"); + r1.setLabel("Si"); + + //r1.setId("si"); + Radio r2 = new Radio(); + r2.setValue("no"); + r2.setLabel("No"); + //r2.setId("no"); + r1.setParent(rg); + r2.setParent(rg); + if (rutaCombinacion.getIndventa() == Boolean.TRUE) { + r1.setChecked(true); + } else { + r2.setChecked(true); + } + rg.addEventListener("onClick", new EventListener() { + + @Override + public void onEvent(Event event) throws Exception { + Radio a = rg.getSelectedItem(); + + } + }); + lc.appendChild(rg); + lc.setParent(lstm); + + lc = new Listcell(rutaCombinacion.getTramo().getDesctramo()); + lc.setParent(lstm); + + lc = new Listcell(rutaCombinacion.getTramo().getVia().getNombvia()); + lc.setParent(lstm); + + lc = new Listcell(); + Combobox combo = new Combobox(); + combo.setMold("rounded"); + combo.setWidth("100%"); + + viaService.obtenerTodos(); + List lsVia = viaService.obtenerTodos(); + combo.setModel(new ListModelList(lsVia)); + combo.setSelectedItem(new Comboitem(rutaCombinacion.getTramo().getVia().getNombvia())); + + lc.appendChild(combo); + lc.setParent(lstm); + + lstm.setAttribute("data", rutaCombinacion); + } + + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeRutasCombinacionRow.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeRutasCombinacionRow.java new file mode 100644 index 000000000..190d0c112 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeRutasCombinacionRow.java @@ -0,0 +1,92 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.RutaCombinacion; +import com.rjconsultores.ventaboletos.web.utilerias.MyListbox; +import java.util.ArrayList; +import java.util.List; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; +import org.zkoss.zk.ui.event.Events; +import org.zkoss.zul.Button; +import org.zkoss.zul.Div; +import org.zkoss.zul.Grid; +import org.zkoss.zul.Label; +import org.zkoss.zul.ListModelList; +import org.zkoss.zul.Radio; +import org.zkoss.zul.Radiogroup; +import org.zkoss.zul.Row; +import org.zkoss.zul.RowRenderer; +import org.zkoss.zul.Textbox; + +/** + * + * @author Rafius + */ +public class RenderCatalogoDeRutasCombinacionRow implements RowRenderer { + + private Grid demoGrid; + private MyListbox rutaCombinacionList; + + public void render(Row row, java.lang.Object data) { + + RutaCombinacion rutaCombinacion = (RutaCombinacion) data; + + // the data append to each row with simple label + Textbox text = new Textbox((rutaCombinacion.getIndventa() == Boolean.TRUE) ? "Si" : "No"); + text.setInplace(true); + row.appendChild(text); + + Radio radio = new Radio(); + radio.setLabel("Si"); + //radio.setId("Si"); + radio.setChecked((rutaCombinacion.getIndventa() == Boolean.TRUE) ? Boolean.TRUE : Boolean.FALSE); + Radio radio2 = new Radio(); + radio2.setLabel("No"); + //radio2.setId("No"); + radio2.setChecked((rutaCombinacion.getIndventa() == Boolean.TRUE) ? Boolean.FALSE : Boolean.TRUE); + + final Radiogroup radioGroup = new Radiogroup(); + radioGroup.setId("radioGroup" + rutaCombinacion.getTramo().getDesctramo()); + radioGroup.appendChild(radio); + radioGroup.appendChild(radio2); + final Div d = new Div(); + radioGroup.setParent(d); + radioGroup.addEventListener(Events.ON_CLICK, new EventListener() { + + public void onEvent(Event event) throws Exception { + + String retorno = radioGroup.getSelectedItem().getLabel(); + d.appendChild(new Label(retorno)); + } + }); + row.appendChild(radioGroup); + row.appendChild(new Label(rutaCombinacion.getTramo().getDesctramo())); + + // we create a thumb up/down comment to each row + final Div d2 = new Div(); + final Button thumbBtn = new Button(null, "/gui/img/create_doc.gif"); + thumbBtn.setParent(d2); + thumbBtn.addEventListener(Events.ON_CLICK, new EventListener() { + + public void onEvent(Event event) throws Exception { + d2.appendChild(new Label("Desativado!!!")); + thumbBtn.setDisabled(true); + //Pega o MysListBox +// List rc = new ArrayList(); +// rutaCombinacionList = (MyListbox) d2.getFellow("rutaCombinacionList"); + + //Pegar o dataGrid + + demoGrid = (Grid) d2.getFellow("demoGrid"); + + + + } + }); + row.appendChild(d2); // Any component could created as a child of grid + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeRutasSecuencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeRutasSecuencia.java new file mode 100644 index 000000000..95d209098 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCatalogoDeRutasSecuencia.java @@ -0,0 +1,44 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ParadaSecuencia; +import com.rjconsultores.ventaboletos.entidad.Via; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderCatalogoDeRutasSecuencia implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ParadaSecuencia ps = (ParadaSecuencia) o; + + Listcell lc = new Listcell(ps.getSecuencia().toString()); + lc.setParent(lstm); + + Parada parada = ps.getParada(); + if (parada != null) { + lc = new Listcell(parada.getCveparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Via via = ps.getVia(); + if (via != null) { + lc = new Listcell(via.getNombvia()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", ps); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCategoria.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCategoria.java new file mode 100644 index 000000000..2531395f0 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCategoria.java @@ -0,0 +1,31 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCategoria implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Categoria categoria = (Categoria) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(categoria.getCategoriaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(categoria.getDesccategoria()); + lc.setParent(lstm); + + lstm.setAttribute("data", categoria); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCategoriaDescuento.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCategoriaDescuento.java new file mode 100644 index 000000000..94fabe6c9 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCategoriaDescuento.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CategoriaClase; +import com.rjconsultores.ventaboletos.entidad.CategoriaCtrl; +import com.rjconsultores.ventaboletos.entidad.CategoriaMarca; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderCategoriaDescuento implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CategoriaCtrl cc = (CategoriaCtrl) o; + + Listcell lc = new Listcell(cc.getCategoriactrlId().toString()); + lc.setParent(lstm); + + lc = new Listcell(cc.getEmpresa().getNombempresa()); + lc.setParent(lstm); + + StringBuilder sb = new StringBuilder(); + for (CategoriaMarca m : cc.getCategoriaMarcaList()) { + sb.append(m.getMarca().getDescmarca()).append(", "); + } + lc = new Listcell(sb.toString()); + lc.setParent(lstm); + + StringBuilder sb2 = new StringBuilder(); + for (CategoriaClase m : cc.getCategoriaClaseList()) { + sb2.append(m.getClaseServicio().getDescclase()).append(", "); + } + lc = new Listcell(sb2.toString()); + lc.setParent(lstm); + + lstm.setAttribute("data", cc); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCategoriaTipoPtoVta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCategoriaTipoPtoVta.java new file mode 100644 index 000000000..df765f194 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCategoriaTipoPtoVta.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CategoriaTipoPtoVta; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Desenvolvimento + */ +public class RenderCategoriaTipoPtoVta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CategoriaTipoPtoVta cc = (CategoriaTipoPtoVta) o; + + Listcell lc = new Listcell(cc.getCategoria() == null ? "" : cc.getCategoria().getDesccategoria()); + lc.setParent(lstm); + + lstm.setAttribute("data", cc); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCiudad.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCiudad.java new file mode 100644 index 000000000..8ad95a228 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCiudad.java @@ -0,0 +1,50 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author MCosso + */ +public class RenderCiudad implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Ciudad ciudad = (Ciudad) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(ciudad.getCiudadId().toString() == null ? "-" : ciudad.getCiudadId().toString()); + lc.setParent(lstm); + + lc = new Listcell(ciudad.getNombciudad() == null ? "-" : ciudad.getNombciudad()); + lc.setParent(lstm); + + lc = new Listcell(ciudad.getEstado() == null ? "-" : ciudad.getEstado().getNombestado()); + lc.setParent(lstm); + + lc = new Listcell(ciudad.getPlaza() == null ? "-" : ciudad.getPlaza().getNombplaza()); + lc.setParent(lstm); + + if (ciudad.getZonaHoraria() != null) { + lc = new Listcell(ciudad.getZonaHoraria().toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (ApplicationProperties.getInstance().mostrarEquivalencia()) { + lc = new Listcell(ciudad.getEquivalenciaId() == null ? "-" : ciudad.getEquivalenciaId()); + lc.setParent(lstm); + } + + lstm.setAttribute("data", ciudad); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderClaseServicio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderClaseServicio.java new file mode 100644 index 000000000..0f335b8e1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderClaseServicio.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderClaseServicio implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ClaseServicio claseServicio = (ClaseServicio) o; + + Listcell lc = new Listcell(claseServicio.getClaseservicioId().toString()); + lc.setParent(lstm); + + lc = new Listcell(claseServicio.getDescclase()); + lc.setParent(lstm); + + lstm.setAttribute("data", claseServicio); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderClaseServicioMarca.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderClaseServicioMarca.java new file mode 100644 index 000000000..9c4e2951e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderClaseServicioMarca.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.MarcaClaseServicio; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderClaseServicioMarca implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + MarcaClaseServicio marcaClaseServicio = (MarcaClaseServicio) o; + + // o id eh uma chave composta: + String id = marcaClaseServicio.getMarcaClaseservicioPK().getClaseservicio().getClaseservicioId().toString() + + " / " + marcaClaseServicio.getMarcaClaseservicioPK().getMarca().getMarcaId().toString(); + Listcell lc = new Listcell(id); + lc.setParent(lstm); + + lc = new Listcell(marcaClaseServicio.getMarcaClaseservicioPK().getMarca().getDescmarca()); + lc.setParent(lstm); + + lc = new Listcell(marcaClaseServicio.getMarcaClaseservicioPK().getClaseservicio().getDescclase()); + lc.setParent(lstm); + + lstm.setAttribute("data", marcaClaseServicio); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderClaseservicioEquivalencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderClaseservicioEquivalencia.java new file mode 100644 index 000000000..287f773de --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderClaseservicioEquivalencia.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ClaseservicioEquivalencia; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderClaseservicioEquivalencia implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ClaseservicioEquivalencia claseservicioEquivalencia = (ClaseservicioEquivalencia) o; + + Listcell lc = lc = new Listcell(claseservicioEquivalencia.getClaseservicioequivalenciaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(claseservicioEquivalencia.getClaseservicio().getDescclase()); + lc.setParent(lstm); + + lc = new Listcell(claseservicioEquivalencia.getComisionistaExterno().getDesccomisionista()); + lc.setParent(lstm); + + lc = new Listcell(claseservicioEquivalencia.getEquivalenciaId()); + lc.setParent(lstm); + + lstm.setAttribute("data", claseservicioEquivalencia); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderColonia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderColonia.java new file mode 100644 index 000000000..e78bb5e06 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderColonia.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Colonia; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderColonia implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Colonia colonia = (Colonia) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(colonia.getColoniaId().toString() == null ? "-" : colonia.getColoniaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(colonia.getDesccolonia() == null ? "-" : colonia.getDesccolonia()); + lc.setParent(lstm); + + lc = new Listcell(colonia.getCodpostal() == null ? "-" : colonia.getCodpostal()); + lc.setParent(lstm); + + lc = new Listcell(colonia.getCiudad() == null ? "-" : colonia.getCiudad().getNombciudad()); + lc.setParent(lstm); + + lstm.setAttribute("data", colonia); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderComisionistaExterno.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderComisionistaExterno.java new file mode 100644 index 000000000..b4d7450e1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderComisionistaExterno.java @@ -0,0 +1,31 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ComisionistaExterno; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderComisionistaExterno implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ComisionistaExterno comisionistaExterno = (ComisionistaExterno) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(comisionistaExterno.getComisionistaexternoId().toString()); + lc.setParent(lstm); + + lc = new Listcell(comisionistaExterno.getDesccomisionista()); + lc.setParent(lstm); + + lstm.setAttribute("data", comisionistaExterno); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCompaniaBancaria.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCompaniaBancaria.java new file mode 100644 index 000000000..4d964cae8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCompaniaBancaria.java @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CompaniaBancaria; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCompaniaBancaria implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + CompaniaBancaria companiaBancaria = (CompaniaBancaria) o; + + Listcell lc = new Listcell(companiaBancaria.getCompaniabancariaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(companiaBancaria.getCvecompania()); + lc.setParent(lstm); + + lc = new Listcell(companiaBancaria.getCvesucursal()); + lc.setParent(lstm); + + lstm.setAttribute("data", companiaBancaria); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCancelacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCancelacion.java new file mode 100644 index 000000000..03c86237e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCancelacion.java @@ -0,0 +1,41 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CancelacionCtrl; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionCancelacion implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CancelacionCtrl cancelacion = (CancelacionCtrl) o; + + Listcell lc = new Listcell(cancelacion.getCancelacionctrlId() == null ? "" : cancelacion.getCancelacionctrlId().toString()); + lc.setParent(lstm); + + lc = new Listcell(cancelacion.getMarca() == null ? "" : cancelacion.getMarca().getDescmarca()); + lc.setParent(lstm); + + lc = new Listcell(cancelacion.getParadaOrigem() == null ? "" : cancelacion.getParadaOrigem().getCveparada()); + lc.setParent(lstm); + + lc = new Listcell(cancelacion.getParadaDestino() == null ? "" : cancelacion.getParadaDestino().getCveparada()); + lc.setParent(lstm); + + lc = new Listcell(cancelacion.getPuntoVenta() == null ? "" : cancelacion.getPuntoVenta().getNombpuntoventa()); + lc.setParent(lstm); + + lc = new Listcell(cancelacion.getMotivoCancelacion() == null ? "" : cancelacion.getMotivoCancelacion().getDescmotivo()); + lc.setParent(lstm); + + lstm.setAttribute("data", cancelacion); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaClase.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaClase.java new file mode 100644 index 000000000..bab0e1ac1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaClase.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CategoriaClase; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionCategoriaClase implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CategoriaClase categoria = (CategoriaClase) o; + + Listcell lc = new Listcell(categoria.getClaseServicio() == null ? "" : categoria.getClaseServicio().getDescclase()); + lc.setParent(lstm); + + + lstm.setAttribute("data", categoria); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaCorrida.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaCorrida.java new file mode 100644 index 000000000..3f032b60d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaCorrida.java @@ -0,0 +1,31 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CategoriaCorrida; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionCategoriaCorrida implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CategoriaCorrida categoria = (CategoriaCorrida) o; + + Listcell lc = new Listcell(categoria.getCorridaCtrl().getCorridaId().toString()); + lc.setParent(lstm); + + SimpleDateFormat sf = new SimpleDateFormat("HH:mm"); + lc = new Listcell((categoria.getCorridaCtrl().getHorario() == null)?"-":sf.format(categoria.getCorridaCtrl().getHorario())); + lc.setParent(lstm); + + lstm.setAttribute("data", categoria); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaDecuento.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaDecuento.java new file mode 100644 index 000000000..9218c5c4a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaDecuento.java @@ -0,0 +1,59 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CategoriaDescuento; +import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo; +import java.text.SimpleDateFormat; +import java.util.List; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionCategoriaDecuento implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CategoriaDescuento categoria = (CategoriaDescuento) o; + + Listcell lc = new Listcell(categoria.getCategoria() != null ? categoria.getCategoria().getDesccategoria() : "0"); + lc.setParent(lstm); + + lc = new Listcell(categoria.getCantautorizada() != null ? categoria.getCantautorizada().toString() : "0"); + lc.setParent(lstm); + + lc = new Listcell(categoria.getDescuentoimporte() != null ? categoria.getDescuentoimporte().toString() : "0"); + lc.setParent(lstm); + + lc = new Listcell(categoria.getDescuentoporc() != null ? categoria.getDescuentoporc().toString() : "0"); + lc.setParent(lstm); + + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + String vigencia = ""; + List lsCategoriaPeriodo = categoria.getCategoriaPeriodoList(); + for (CategoriaPeriodo cp : lsCategoriaPeriodo) { + if (cp.getActivo()) { + if (cp.getFecinicio() != null) { + vigencia = vigencia + sdf.format(cp.getFecinicio()); + } + + vigencia = vigencia + " - "; + + if (cp.getFecfin() != null) { + vigencia = vigencia + sdf.format(cp.getFecfin()); + } + + vigencia = vigencia + "; "; + } + } + lc = new Listcell(vigencia); + lc.setParent(lstm); + + lstm.setAttribute("data", categoria); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaMarca.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaMarca.java new file mode 100644 index 000000000..70fa4d3d7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaMarca.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CategoriaMarca; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionCategoriaMarca implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CategoriaMarca categoria = (CategoriaMarca) o; + + Listcell lc = new Listcell(categoria.getMarca() == null ? "" : categoria.getMarca().getDescmarca()); + lc.setParent(lstm); + + + lstm.setAttribute("data", categoria); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaMercado.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaMercado.java new file mode 100644 index 000000000..217758d37 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaMercado.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CategoriaMercado; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionCategoriaMercado implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CategoriaMercado reservacioMercado = (CategoriaMercado) o; + + Listcell lc = new Listcell(reservacioMercado.getOrigem() == null ? "-" : reservacioMercado.getOrigem().getDescparada()); + lc.setParent(lstm); + + lc = new Listcell(reservacioMercado.getDestino() == null ? "-" : reservacioMercado.getDestino().getDescparada()); + lc.setParent(lstm); + + lstm.setAttribute("data", reservacioMercado); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaPeriodo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaPeriodo.java new file mode 100644 index 000000000..aa656f66f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCategoriaPeriodo.java @@ -0,0 +1,34 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.GregorianCalendar; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderConfiguracionCategoriaPeriodo implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CategoriaPeriodo categoriaPeriodo = (CategoriaPeriodo) o; + + SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + + Listcell lc = new Listcell(categoriaPeriodo.getFecinicio() == null ? "" : sf.format(categoriaPeriodo.getFecinicio())); + lc.setParent(lstm); + + lc = new Listcell(categoriaPeriodo.getFecfin() == null ? "" : sf.format(categoriaPeriodo.getFecfin())); + lc.setParent(lstm); + + lstm.setAttribute("data", categoriaPeriodo); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCorrida.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCorrida.java new file mode 100644 index 000000000..539b8a955 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCorrida.java @@ -0,0 +1,110 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.EsquemaCorrida; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionCorrida implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + EsquemaCorrida corrida = (EsquemaCorrida) o; + + Listcell lc = new Listcell(corrida.getEsquemacorridaId().toString()); + lc.setParent(lstm); + + SimpleDateFormat dt = new SimpleDateFormat("dd/MM/yy"); + lc = new Listcell(dt.format(corrida.getEsquemaOperacional().getFecniciovigencia())); + lc.setParent(lstm); + + lc = new Listcell(dt.format(corrida.getEsquemaOperacional().getFecfinvigencia())); + lc.setParent(lstm); + + if (corrida.getHorasalida() == null) { + lc = new Listcell("-"); + lc.setParent(lstm); + } else { + SimpleDateFormat hr = new SimpleDateFormat("HH:mm"); + lc = new Listcell(hr.format(corrida.getHorasalida())); + lc.setParent(lstm); + } + //Ruta + lc = new Listcell(corrida.getRuta().getDescruta() == null ? "-" : corrida.getRuta().getDescruta()); + lc.setParent(lstm); + //Marca + lc = new Listcell(corrida.getMarca().getDescmarca() == null ? "-" : corrida.getMarca().getDescmarca()); + lc.setParent(lstm); + + //Semana + String l = (corrida.getIndlunes() == Boolean.TRUE) ? "L " : "- "; + String ma = (corrida.getIndmartes() == Boolean.TRUE) ? "MA " : "- "; + String mi = (corrida.getIndmiercoles() == Boolean.TRUE) ? "MI " : "- "; + String j = (corrida.getIndjueves() == Boolean.TRUE) ? "J " : "- "; + String v = (corrida.getIndviernes() == Boolean.TRUE) ? "V " : "- "; + String s = (corrida.getIndsabado() == Boolean.TRUE) ? "S " : "- "; + String d = (corrida.getInddomingo() == Boolean.TRUE) ? "D " : "- "; + + lc = new Listcell(l + ma + mi + j + v + s + d); + lc.setParent(lstm); + + //Clase + try { + lc = new Listcell(corrida.getClaseServicio().getDescclase() == null ? "-" : corrida.getClaseServicio().getDescclase()); + lc.setParent(lstm); + } catch (Exception e) { + lc = new Listcell("-"); + lc.setParent(lstm); + } + //EmpC + try { + lc = new Listcell(corrida.getEmpresa().getNombempresa() == null ? "-" : corrida.getEmpresa().getNombempresa()); + lc.setParent(lstm); + } catch (Exception e) { + lc = new Listcell("-"); + lc.setParent(lstm); + } + //EmpI + try { + lc = new Listcell(corrida.getEmpresa1().getNombempresa() == null ? "-" : corrida.getEmpresa1().getNombempresa()); + lc.setParent(lstm); + } catch (Exception e) { + lc = new Listcell("-"); + lc.setParent(lstm); + } + //RolOperativo + try { + lc = new Listcell(corrida.getRolOperativo().getDescroloperativo() == null ? "-" : corrida.getRolOperativo().getDescroloperativo()); + lc.setParent(lstm); + } catch (Exception e) { + lc = new Listcell("-"); + lc.setParent(lstm); + } + + //Status + + if (corrida.getStatusCorrida() == null) { + lc = new Listcell("-"); + lc.setParent(lstm); + } else if (corrida.getStatusCorrida().equals("L")) { + lc = new Listcell("LATENTE"); + lc.setParent(lstm); + } else if (corrida.getStatusCorrida().equals("A")) { + lc = new Listcell("AUTORIZADA"); + lc.setParent(lstm); + } else { + lc = new Listcell("CANCELADA"); + lc.setParent(lstm); + } + + lstm.setAttribute("data", corrida); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCorridaTramo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCorridaTramo.java new file mode 100644 index 000000000..ccd6d0eb8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionCorridaTramo.java @@ -0,0 +1,54 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ParadaEsquema; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import java.util.Calendar; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionCorridaTramo implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ParadaEsquema pe = (ParadaEsquema) o; + + Listcell lc = new Listcell(pe.getNumsecuencia().toString()); + lc.setParent(lstm); + + lc = new Listcell(pe.getParada().getCveparada()); + lc.setParent(lstm); + +// SimpleDateFormat sf = new SimpleDateFormat("HH:mm"); +// if (pe.getTiempoEstancia() != null) { +// lc = new Listcell(sf.format(pe.getTiempoEstancia())); +// } else { +// lc = new Listcell(""); +// } +// + if (pe.getTiempoEstancia() == null) { + lc = new Listcell(""); + } else { + Calendar c = Calendar.getInstance(); + c.setTime(pe.getTiempoEstancia()); + System.out.println(DateUtil.getFecInicio().getTime() + " " + c.getTime()); + Long tempo = DateUtil.getElapsedMinutos(DateUtil.getFecInicio().getTime(), c.getTime()); + long minutos = (tempo % 60); + int horas = (tempo.intValue() / 60); + + + String sMinutos = String.valueOf(minutos); + lc = new Listcell(horas + ":" + ((sMinutos.length() < 2) ? "0" + sMinutos : sMinutos)); + } + lc.setParent(lstm); + + lstm.setAttribute("data", pe); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionFormasPago.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionFormasPago.java new file mode 100644 index 000000000..5d579bb19 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionFormasPago.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.FormaPagoDet; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderConfiguracionFormasPago implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + FormaPagoDet claseServicio = (FormaPagoDet) o; + + Listcell lc = new Listcell(claseServicio.getFormaPago().getDescpago()); + lc.setParent(lstm); + + lc = new Listcell(claseServicio.getFormaPago().getDescpago()); + lc.setParent(lstm); + + lstm.setAttribute("data", claseServicio); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionGeneral.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionGeneral.java new file mode 100644 index 000000000..0cfb21df0 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionGeneral.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Constante; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionGeneral implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Constante constante = (Constante) o; + + Listcell lc = new Listcell(constante.getConstanteId().toString()); + lc.setParent(lstm); + + lc = new Listcell(constante.getDescconstante()); + lc.setParent(lstm); + + lc = new Listcell(constante.getValorconstante()); + lc.setParent(lstm); + + lstm.setAttribute("data", constante); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacion.java new file mode 100644 index 000000000..5624d5c1b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacion.java @@ -0,0 +1,87 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +import com.rjconsultores.ventaboletos.entidad.ReservacionCtrl; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionReservacion implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ReservacionCtrl reservacion = (ReservacionCtrl) o; + + Listcell lc = new Listcell(reservacion.getReservacionctrlId().toString()); + lc.setParent(lstm); + + lc = null; + + lc = new Listcell((reservacion.getDescConfig() == null) ? "" : reservacion.getDescConfig()); + lc.setParent(lstm); + + SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy"); + + Date fecInicio = reservacion.getFecinicio(); + if (fecInicio != null) { + lc = new Listcell(sf.format(fecInicio)); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Date fecFinal = reservacion.getFecfinal(); + if (fecFinal != null) { + lc = new Listcell(sf.format(fecFinal)); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + String[] hMTliberacion = capturarHoraMinuto(reservacion.getTiempoliberacion()); + String[] hMTliberacioninternet = capturarHoraMinuto(reservacion.getTiempoliberacioninternet()); + String[] hMTprevio = capturarHoraMinuto(reservacion.getTiempoprevio()); + String[] hMTpreviointernet = capturarHoraMinuto(reservacion.getTiempopreviointernet()); + + lc = new Listcell(hMTliberacion[0] + ":" + hMTliberacion[1]); + lc.setParent(lstm); + + lc = new Listcell(hMTliberacioninternet[0] + ":" + hMTliberacioninternet[1]); + lc.setParent(lstm); + + lc = new Listcell(hMTprevio[0] + ":" + hMTprevio[1]); + lc.setParent(lstm); + + lc = new Listcell(hMTpreviointernet[0] + ":" + hMTpreviointernet[1]); + lc.setParent(lstm); + + lstm.setAttribute("data", reservacion); + } + + public String[] capturarHoraMinuto(Date data) { + String[] horaMinuto = new String[2]; + Calendar c = Calendar.getInstance(); + c.setTime(data); + System.out.println(DateUtil.getFecInicio().getTime() + " " + c.getTime()); + Long tempo = DateUtil.getElapsedMinutos(DateUtil.getFecInicio().getTime(), c.getTime()); + long minutos = (tempo % 60); + Integer horas = (tempo.intValue() / 60); + String sMinutos = String.valueOf(minutos); + horaMinuto[0] = horas.toString(); + horaMinuto[1] = ((sMinutos.length() < 2) ? "0" + sMinutos : sMinutos); + + return horaMinuto; + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionCategoria.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionCategoria.java new file mode 100644 index 000000000..02e6b4049 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionCategoria.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ReservacionCategoria; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionReservacionCategoria implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ReservacionCategoria reservacion = (ReservacionCategoria) o; + + Listcell lc = new Listcell(reservacion.getCategoria().getDesccategoria()); + lc.setParent(lstm); + + lstm.setAttribute("data", reservacion); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionClase.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionClase.java new file mode 100644 index 000000000..543f8be04 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionClase.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ReservacionClase; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionReservacionClase implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ReservacionClase reservacion = (ReservacionClase) o; + + Listcell lc = new Listcell(reservacion.getClaseServicio().getDescclase()); + lc.setParent(lstm); + + + lstm.setAttribute("data", reservacion); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionMarca.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionMarca.java new file mode 100644 index 000000000..c46bb0cc4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionMarca.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ReservacionMarca; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionReservacionMarca implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ReservacionMarca reservacion = (ReservacionMarca) o; + + Listcell lc = new Listcell(reservacion.getMarca().getDescmarca()); + lc.setParent(lstm); + + + lstm.setAttribute("data", reservacion); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionMercado.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionMercado.java new file mode 100644 index 000000000..b5588481f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionMercado.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ReservacionMercado; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionReservacionMercado implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ReservacionMercado reservacioMercado = (ReservacionMercado) o; + + Listcell lc = new Listcell(reservacioMercado.getParadaOrigem().getDescparada()); + lc.setParent(lstm); + + lc = new Listcell(reservacioMercado.getParadaDestino().getDescparada()); + lc.setParent(lstm); + + lstm.setAttribute("data", reservacioMercado); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionPuntoVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionPuntoVenta.java new file mode 100644 index 000000000..f9192a6f3 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConfiguracionReservacionPuntoVenta.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ReservacionPuntoVenta; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderConfiguracionReservacionPuntoVenta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ReservacionPuntoVenta reservacion = (ReservacionPuntoVenta) o; + + Listcell lc = new Listcell(reservacion.getPuntoVenta().getNombpuntoventa()); + lc.setParent(lstm); + + lstm.setAttribute("data", reservacion); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConvenio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConvenio.java new file mode 100644 index 000000000..dcb3925c7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConvenio.java @@ -0,0 +1,66 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Convenio; +import org.zkoss.util.resource.Labels; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderConvenio implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Convenio convenio = (Convenio) o; + + Listcell lc = new Listcell(convenio.getConvenioId().toString()); + lc.setParent(lstm); + + if (convenio.getDescconvenio() != null) { + lc = new Listcell(convenio.getDescconvenio()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (convenio.getCveconvenio() != null) { + lc = new Listcell(convenio.getCveconvenio()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Boolean valida = convenio.getValidafolio(); + if (valida == null) { + lc = new Listcell(Labels.getLabel("MSG.NO.VALIDA")); + } else { + if (valida) { + lc = new Listcell(Labels.getLabel("MSG.VALIDA")); + } else { + lc = new Listcell(Labels.getLabel("MSG.NO.VALIDA")); + } + } + lc.setParent(lstm); + + if (convenio.getImprimeprecio() != null) { + if (convenio.getImprimeprecio().equals(Convenio.IMPRIME_DESCONTO)) { + lc = new Listcell(Labels.getLabel("MSG.IMPRIME.DESCONTO")); + } else if (convenio.getImprimeprecio().equals(Convenio.IMPRIME_PRECO_MENOS_DESCONTO)) { + lc = new Listcell(Labels.getLabel("MSG.IMPRIME.PRECO.MENOS.DESCONTO")); + } else if (convenio.getImprimeprecio().equals(Convenio.IMPRIME_PRECO_TOTAL)) { + lc = new Listcell(Labels.getLabel("MSG.IMPRIME.PRECO.TOTAL")); + } + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", convenio); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConvenioDet.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConvenioDet.java new file mode 100644 index 000000000..d6f3c56a5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderConvenioDet.java @@ -0,0 +1,50 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ConvenioDet; +import java.math.BigDecimal; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderConvenioDet implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ConvenioDet convenioDet = (ConvenioDet) o; + + Listcell lc = new Listcell(); + + BigDecimal porcentagem = convenioDet.getPorcdescuento(); + if (porcentagem != null) { + lc = new Listcell(porcentagem.setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Long inicial = convenioDet.getNumfolioinicial(); + if (inicial != null) { + lc = new Listcell(inicial.toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Long finaly = convenioDet.getNumfoliofinal(); + if (finaly != null) { + lc = new Listcell(finaly.toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", convenioDet); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCorrida.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCorrida.java new file mode 100644 index 000000000..147e904a8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCorrida.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Corrida; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCorrida implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Corrida corrida = (Corrida) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(corrida.getId().getCorridaId().toString()); + lc.setParent(lstm); + + SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy"); + lc = new Listcell(format.format(corrida.getId().getFeccorrida())); + lc.setParent(lstm); + + if (corrida.getOrigem() != null) { + lc = new Listcell(corrida.getOrigem().getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (corrida.getDestino() != null) { + lc = new Listcell(corrida.getDestino().getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (corrida.getRuta() != null) { + lc = new Listcell(corrida.getRuta().getDescruta()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (corrida.getClaseServicio() != null) { + lc = new Listcell(corrida.getClaseServicio().getDescclase()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", corrida); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCorridaTarjetaRecaudacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCorridaTarjetaRecaudacion.java new file mode 100644 index 000000000..1a50c71fc --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCorridaTarjetaRecaudacion.java @@ -0,0 +1,77 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import java.text.SimpleDateFormat; +import java.util.Date; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCorridaTarjetaRecaudacion implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + Corrida corrida = (Corrida) o; + + Listcell lc = new Listcell(corrida.getId().getCorridaId().toString()); + lc.setParent(lstm); + + SimpleDateFormat sdfData = new SimpleDateFormat("dd/MM/yyyy"); + lc = new Listcell(sdfData.format(corrida.getId().getFeccorrida())); + lc.setParent(lstm); + + SimpleDateFormat sdfHora = new SimpleDateFormat("HH:mm"); + Date hora = corrida.getFechorsalida(); + if (hora != null) { + lc = new Listcell(sdfHora.format(hora)); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Parada origem = corrida.getOrigem(); + if (origem != null) { + lc = new Listcell(origem.getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Parada destino = corrida.getDestino(); + if (destino != null) { + lc = new Listcell(destino.getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + ClaseServicio claseServicio = corrida.getClaseServicio(); + if (claseServicio != null) { + lc = new Listcell(claseServicio.getDescclase()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Marca marca = corrida.getMarca(); + if (marca != null) { + lc = new Listcell(marca.getDescmarca()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", corrida); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCorridaTarjetaViaje.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCorridaTarjetaViaje.java new file mode 100644 index 000000000..7f14cd163 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCorridaTarjetaViaje.java @@ -0,0 +1,71 @@ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.CorridaTramo; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; + +public class RenderCorridaTarjetaViaje implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + CorridaTramo corridaTramo = (CorridaTramo) o; + + Listcell lc = new Listcell(corridaTramo.getCorrida().getId().getCorridaId().toString()); + lc.setParent(lstm); + + SimpleDateFormat sdfData = new SimpleDateFormat("dd/MM/yyyy"); + lc = new Listcell(sdfData.format(corridaTramo.getCorrida().getId().getFeccorrida())); + lc.setParent(lstm); + + SimpleDateFormat sdfHora = new SimpleDateFormat("HH:mm"); + Date hora = corridaTramo.getFechorSalidaOriginal(); + if (hora != null) { + lc = new Listcell(sdfHora.format(hora)); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Parada origem = corridaTramo.getOrigem(); + if (origem != null) { + lc = new Listcell(origem.getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Parada destino = corridaTramo.getDestino(); + if (destino != null) { + lc = new Listcell(destino.getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + ClaseServicio claseServicio = corridaTramo.getCorrida().getClaseServicio(); + if (claseServicio != null) { + lc = new Listcell(claseServicio.getDescclase()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Marca marca = corridaTramo.getCorrida().getMarca(); + if (marca != null) { + lc = new Listcell(marca.getDescmarca()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", corridaTramo); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCortesia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCortesia.java new file mode 100644 index 000000000..129d65e88 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCortesia.java @@ -0,0 +1,69 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Cortesia; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderCortesia implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Cortesia cortesia = (Cortesia) o; + SimpleDateFormat formatoData = new SimpleDateFormat("dd/MM/yyyy"); + + Listcell lc = new Listcell(cortesia.getCortesiaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(cortesia.getEmpleado().getCveEmpleado()); + lc.setParent(lstm); + + lc = new Listcell(cortesia.getTipoCortesia() == null ? "" : cortesia.getTipoCortesia().getDesctipo()); + lc.setParent(lstm); + + lc = new Listcell(cortesia.getMarca().getDescmarca()); + lc.setParent(lstm); + + lc = new Listcell(cortesia.getClaseServicio().getDescclase()); + lc.setParent(lstm); + + lc = new Listcell(cortesia.getOrigem().getDescparada()); + lc.setParent(lstm); + + lc = new Listcell(cortesia.getDestino().getDescparada()); + lc.setParent(lstm); + + lc = new Listcell(cortesia.getMotivoViaje() == null ? "" : cortesia.getMotivoViaje().getDescMotivoViaje()); + lc.setParent(lstm); + + if (cortesia.getNdstatus() != null) { + String status; + if (cortesia.getNdstatus().equals("P")) { + status = "Pendiente"; + } else { + status = "Utilizada"; + } + lc = new Listcell(status); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", cortesia); + + if (cortesia.getFecmodif() != null) { + lc = new Listcell(formatoData.format(cortesia.getFecmodif())); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCortesiaBeneficiario.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCortesiaBeneficiario.java new file mode 100644 index 000000000..637e2c1bb --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCortesiaBeneficiario.java @@ -0,0 +1,61 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario; +import com.rjconsultores.ventaboletos.entidad.TipoCortesiaDescuento; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderCortesiaBeneficiario implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CortesiaBeneficiario cortesiaBeneficiario = (CortesiaBeneficiario) o; + DecimalFormat df = new DecimalFormat("###,###,##0.00", new java.text.DecimalFormatSymbols(java.util.Locale.US)); + + StringBuilder sb = new StringBuilder(""); + if (cortesiaBeneficiario.getNombBenef() != null){ + sb.append(cortesiaBeneficiario.getNombBenef()).append(" "); + } + if (cortesiaBeneficiario.getNombPaterno()!= null){ + sb.append(cortesiaBeneficiario.getNombPaterno()).append(" "); + } + if (cortesiaBeneficiario.getNombMaterno()!= null){ + sb.append(cortesiaBeneficiario.getNombMaterno()); + } + Listcell lc = new Listcell(sb.toString()); + lc.setParent(lstm); + + if (cortesiaBeneficiario.getIndtipobenef() != null) { + String status; + if (cortesiaBeneficiario.getIndtipobenef().equals("E")) { + status = "Empleado"; + } else { + status = "Familiar"; + } + lc = new Listcell(status); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + TipoCortesiaDescuento tcd = cortesiaBeneficiario.getDescuento(); + if (tcd != null) { + lc = new Listcell(df.format(tcd.getPorcdescuento())); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", cortesiaBeneficiario); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCortesiaDireccion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCortesiaDireccion.java new file mode 100644 index 000000000..9eaecaa01 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCortesiaDireccion.java @@ -0,0 +1,51 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CortesiaDireccion; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderCortesiaDireccion implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CortesiaDireccion cortesiaDireccion = (CortesiaDireccion) o; + SimpleDateFormat f = new SimpleDateFormat("dd/MM/yyyy"); + + + Listcell lc = new Listcell(cortesiaDireccion.getCortesiaDireccionId().toString()); + lc.setParent(lstm); + + lc = new Listcell(cortesiaDireccion.getMarca().getDescmarca()); + lc.setParent(lstm); + + lc = new Listcell(cortesiaDireccion.getClaseServicio().getDescclase()); + lc.setParent(lstm); + + lc = new Listcell(cortesiaDireccion.getNumFolioInicio().toString()); + lc.setParent(lstm); + + lc = new Listcell(cortesiaDireccion.getNumFolioFin().toString()); + lc.setParent(lstm); + + lc = new Listcell(cortesiaDireccion.getTipocortesiaDescuento().getPorcdescuento().toString()); + lc.setParent(lstm); + + lc = new Listcell(f.format(cortesiaDireccion.getFecInicioV())); + lc.setParent(lstm); + + lc = new Listcell(f.format(cortesiaDireccion.getFecFinV())); + lc.setParent(lstm); + + lstm.setAttribute("data", cortesiaDireccion); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCuponConvenio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCuponConvenio.java new file mode 100644 index 000000000..744ed4910 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCuponConvenio.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CuponConvenio; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderCuponConvenio implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CuponConvenio cc = (CuponConvenio) o; + + Listcell lc = new Listcell(cc.getTipoConvenio().getTipoConvenioID().toString()); + lc.setParent(lstm); + + lc = new Listcell(cc.getTipoConvenio().getDescTipo()); + lc.setParent(lstm); + + lc = new Listcell(cc.getFolioInicio().toString()); + lc.setParent(lstm); + + lc = new Listcell(cc.getFolioFinal().toString()); + lc.setParent(lstm); + + lstm.setAttribute("data", cc); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCuponSecretaria.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCuponSecretaria.java new file mode 100644 index 000000000..331bd0181 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCuponSecretaria.java @@ -0,0 +1,50 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.CuponSecretaria; +import java.math.BigDecimal; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCuponSecretaria implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + CuponSecretaria cuponSecretaria = (CuponSecretaria) o; + + Listcell lc = new Listcell(); + + BigDecimal porcentagem = cuponSecretaria.getPorcdescuento(); + if (porcentagem != null) { + lc = new Listcell(porcentagem.setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Long inicial = cuponSecretaria.getNumfolioinicio(); + if (inicial != null) { + lc = new Listcell(inicial.toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Long finaly = cuponSecretaria.getNumfoliofinal(); + if (finaly != null) { + lc = new Listcell(finaly.toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", cuponSecretaria); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdClaseServicio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdClaseServicio.java new file mode 100644 index 000000000..22b0976e7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdClaseServicio.java @@ -0,0 +1,34 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.ProdClaseServicio; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCyberViajeProdClaseServicio implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ProdClaseServicio prodClaseServicio = (ProdClaseServicio) o; + + Listcell lc = null; + + ClaseServicio claseServicio = prodClaseServicio.getClaseServicio(); + if (claseServicio != null) { + lc = new Listcell(claseServicio.getDescclase()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", prodClaseServicio); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdFormaPago.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdFormaPago.java new file mode 100644 index 000000000..e1748075f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdFormaPago.java @@ -0,0 +1,34 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.entidad.ProdFormaPago; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCyberViajeProdFormaPago implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ProdFormaPago prodFormaPago = (ProdFormaPago) o; + + Listcell lc = null; + + FormaPago formaPafo = prodFormaPago.getFormaPago(); + if (formaPafo != null) { + lc = new Listcell(formaPafo.getDescpago()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", prodFormaPago); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdMarca.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdMarca.java new file mode 100644 index 000000000..47475df1f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdMarca.java @@ -0,0 +1,36 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.ProdMarca; +import java.math.BigDecimal; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCyberViajeProdMarca implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ProdMarca prodMarca = (ProdMarca) o; + + Listcell lc = null; + + Marca marca = prodMarca.getMarca(); + if (marca != null) { + lc = new Listcell(marca.getDescmarca()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + + lstm.setAttribute("data", prodMarca); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdMercado.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdMercado.java new file mode 100644 index 000000000..944a8935c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdMercado.java @@ -0,0 +1,42 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.ProdMercado; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCyberViajeProdMercado implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ProdMercado prodMercado = (ProdMercado) o; + + Listcell lc = null; + + Parada origem = prodMercado.getParada1(); + if (origem != null) { + lc = new Listcell(origem.getCveparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Parada destino = prodMercado.getParada(); + if (destino != null) { + lc = new Listcell(destino.getCveparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", prodMercado); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdPrecio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdPrecio.java new file mode 100644 index 000000000..aab6e9f7b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdPrecio.java @@ -0,0 +1,40 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ProdPrecio; +import java.math.RoundingMode; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderCyberViajeProdPrecio implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ProdPrecio prodMarca = (ProdPrecio) o; + SimpleDateFormat formatoData = new SimpleDateFormat("dd/MM/yyyy"); + DecimalFormat df = new DecimalFormat("###,###,##0.00", new java.text.DecimalFormatSymbols(java.util.Locale.US)); + + Listcell lc = null; + + lc = new Listcell(prodMarca.getMarca() == null ? "" : prodMarca.getMarca().getDescmarca()); + lc.setParent(lstm); + lc = new Listcell(prodMarca.getImporteinicial() == null ? "" : df.format(prodMarca.getImporteinicial())); + lc.setParent(lstm); + lc = new Listcell(prodMarca.getImportefinal() == null ? "" : df.format(prodMarca.getImportefinal())); + lc.setParent(lstm); + lc = new Listcell(prodMarca.getPrecio() == null ? "" : df.format(prodMarca.getPrecio())); + lc.setParent(lstm); + + + lstm.setAttribute("data", prodMarca); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdPuntoVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdPuntoVenta.java new file mode 100644 index 000000000..d7bde408d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdPuntoVenta.java @@ -0,0 +1,34 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ProdPuntoVenta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCyberViajeProdPuntoVenta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ProdPuntoVenta prodPuntoVenta = (ProdPuntoVenta) o; + + Listcell lc = null; + + PuntoVenta puntoVenta = prodPuntoVenta.getPuntoVenta(); + if (puntoVenta != null) { + lc = new Listcell(puntoVenta.getNombpuntoventa()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", prodPuntoVenta); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdRuta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdRuta.java new file mode 100644 index 000000000..f8d94dba5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdRuta.java @@ -0,0 +1,34 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ProdRuta; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCyberViajeProdRuta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ProdRuta prodRuta = (ProdRuta) o; + + Listcell lc = null; + + Ruta ruta = prodRuta.getRuta(); + if (ruta != null) { + lc = new Listcell(ruta.getDescruta()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", prodRuta); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdTipoptovta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdTipoptovta.java new file mode 100644 index 000000000..45b0d3274 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdTipoptovta.java @@ -0,0 +1,34 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ProdTipoptovta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCyberViajeProdTipoptovta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ProdTipoptovta prodTipoptovta = (ProdTipoptovta) o; + + Listcell lc = null; + + TipoPuntoVenta tipoPuntoVenta = prodTipoptovta.getTipoPtovta(); + if (tipoPuntoVenta != null) { + lc = new Listcell(tipoPuntoVenta.getDesctipo()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", prodTipoptovta); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdVigencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdVigencia.java new file mode 100644 index 000000000..5965aa2c6 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderCyberViajeProdVigencia.java @@ -0,0 +1,45 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ProdVigencia; +import java.text.SimpleDateFormat; +import java.util.Date; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderCyberViajeProdVigencia implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + ProdVigencia prodVigencia = (ProdVigencia) o; + SimpleDateFormat f = new SimpleDateFormat("dd/MM/yyyy"); + + Listcell lc = null; + + Date fecInicio = prodVigencia.getFecvigenciainicio(); + if (fecInicio != null) { + lc = new Listcell(f.format(fecInicio)); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Date fecFim = prodVigencia.getFecvigenciafin(); + if (fecFim != null) { + lc = new Listcell(f.format(fecFim)); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", prodVigencia); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderDeducciones.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderDeducciones.java new file mode 100644 index 000000000..6ce222f42 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderDeducciones.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderDeducciones implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderDescripcionViajes.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderDescripcionViajes.java new file mode 100644 index 000000000..4f7a622e2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderDescripcionViajes.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderDescripcionViajes implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderDetDiagramaAutobus.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderDetDiagramaAutobus.java new file mode 100644 index 000000000..54bc3e289 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderDetDiagramaAutobus.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderDetDiagramaAutobus implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + DetDiagramaAutobus detDiagramaAutobus = (DetDiagramaAutobus) o; + + Listcell lc = new Listcell(detDiagramaAutobus.getAsiento()); + lc.setParent(lstm); + + lstm.setAttribute("data", detDiagramaAutobus); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderDiagramaAutobus.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderDiagramaAutobus.java new file mode 100644 index 000000000..55bb83ee2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderDiagramaAutobus.java @@ -0,0 +1,36 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.DiagramaAutobus; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderDiagramaAutobus implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + DiagramaAutobus claseServicio = (DiagramaAutobus) o; + + Listcell lc = new Listcell(claseServicio.getDiagramaautobusId().toString()); + lc.setParent(lstm); + + lc = new Listcell(claseServicio.getDescDiagrama()); + lc.setParent(lstm); + + Short cantAsientos = claseServicio.getCantasientos(); + if (cantAsientos != null) { + lc = new Listcell(claseServicio.getCantasientos().toString()); + lc.setParent(lstm); + } + + lstm.setAttribute("data", claseServicio); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEditarPricingCorrida.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEditarPricingCorrida.java new file mode 100644 index 000000000..3fa173f26 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEditarPricingCorrida.java @@ -0,0 +1,73 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.Parada; +import java.text.SimpleDateFormat; +import java.util.Date; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderEditarPricingCorrida implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + Corrida corrida = (Corrida) o; + + Listcell lc = new Listcell(corrida.getId().getCorridaId().toString()); + lc.setParent(lstm); + + SimpleDateFormat sdfHora = new SimpleDateFormat("HH:mm"); + Date hora = corrida.getFechorsalida(); + if (hora != null) { + lc = new Listcell(sdfHora.format(hora)); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Parada origem = corrida.getOrigem(); + if (origem != null) { + lc = new Listcell(origem.getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Parada destino = corrida.getDestino(); + if (destino != null) { + lc = new Listcell(destino.getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + ClaseServicio claseServicio = corrida.getClaseServicio(); + if (claseServicio != null) { + lc = new Listcell(claseServicio.getDescclase()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Marca marca = corrida.getMarca(); + if (marca != null) { + lc = new Listcell(marca.getDescmarca()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", corrida); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEmpleado.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEmpleado.java new file mode 100644 index 000000000..e33f75726 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEmpleado.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Empleado; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderEmpleado implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Empleado empleado = (Empleado) o; + + Listcell lc = new Listcell(empleado.getNombEmpleado()); + lc.setParent(lstm); + + lc = new Listcell(empleado.getNombPaterno()); + lc.setParent(lstm); + + lc = new Listcell(empleado.getNombMaterno()); + lc.setParent(lstm); + + lc = new Listcell(empleado.getEmpresa().getNombempresa()); + lc.setParent(lstm); + + + + lstm.setAttribute("data", empleado); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEmpresa.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEmpresa.java new file mode 100644 index 000000000..dc1cbb87b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEmpresa.java @@ -0,0 +1,77 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import org.zkoss.util.resource.Labels; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderEmpresa implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Empresa empresa = (Empresa) o; + + Listcell lc = new Listcell(empresa.getEmpresaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(empresa.getNombempresa()); + lc.setParent(lstm); + + Boolean externa = empresa.getIndExterna(); + if (externa != null) { + if (externa) { + lc = new Listcell(Labels.getLabel("MSG.SI")); + lc.setParent(lstm); + } else { + lc = new Listcell(Labels.getLabel("MSG.NO")); + lc.setParent(lstm); + } + } + Boolean pago = empresa.getPagoConductor(); + if (pago != null) { + if (pago) { + lc = new Listcell(Labels.getLabel("MSG.SI")); + lc.setParent(lstm); + } else { + lc = new Listcell(Labels.getLabel("MSG.NO")); + lc.setParent(lstm); + } + } + + Short tipo = empresa.getIndTipo(); + Short short1 = 1; + Short short2 = 2; + Short short3 = 3; + if (tipo != null) { + if (tipo.equals(short1)) { + lc = new Listcell(Labels.getLabel("editarEmpresaController.IndTipo.1")); + } else if (tipo.equals(short2)) { + lc = new Listcell(Labels.getLabel("editarEmpresaController.IndTipo.2")); + } else if (tipo.equals(short3)) { + lc = new Listcell(Labels.getLabel("editarEmpresaController.IndTipo.3")); + } + } else { + lc = new Listcell(Labels.getLabel("")); + } + lc.setParent(lstm); + + lc = new Listcell(empresa.getRfc()); + lc.setParent(lstm); + + if (!ApplicationProperties.getInstance().mostrarEquivalencia()) { + lc = new Listcell(empresa.getEquivalenciaId()); + lc.setParent(lstm); + } + + lstm.setAttribute("data", empresa); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEmpresaEquivalencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEmpresaEquivalencia.java new file mode 100644 index 000000000..84fbf991f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEmpresaEquivalencia.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.EmpresaEquivalencia; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderEmpresaEquivalencia implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + EmpresaEquivalencia empresaEquivalencia = (EmpresaEquivalencia) o; + + Listcell lc = lc = new Listcell(empresaEquivalencia.getEmpresaequivalenciaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(empresaEquivalencia.getEmpresa().getNombempresa()); + lc.setParent(lstm); + + lc = new Listcell(empresaEquivalencia.getComisionistaExterno().getDesccomisionista()); + lc.setParent(lstm); + + lc = new Listcell(empresaEquivalencia.getEquivalenciaId()); + lc.setParent(lstm); + + lstm.setAttribute("data", empresaEquivalencia); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEmpresaModificacionMassivaTarifa.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEmpresaModificacionMassivaTarifa.java new file mode 100644 index 000000000..cb4583a2e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEmpresaModificacionMassivaTarifa.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderEmpresaModificacionMassivaTarifa implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Empresa empresa = (Empresa) o; + + Listcell lc = new Listcell(empresa.getEmpresaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(empresa.getNombempresa()); + lc.setParent(lstm); + + lstm.setAttribute("data", empresa); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEstacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEstacion.java new file mode 100644 index 000000000..02eb0b668 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEstacion.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Estacion; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderEstacion implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Estacion estacion = (Estacion) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(estacion.getEstacionId().toString()); + lc.setParent(lstm); + + lc = new Listcell(estacion.getDescestacion()); + lc.setParent(lstm); + + //Convertendo a mascara em Hexa novamente. + if (estacion.getDescmac() != null && !estacion.getDescmac().equals("") ) { + Long hx = Long.parseLong(estacion.getDescmac(), 10); + String descMac = Long.toHexString(hx); + + while (descMac.length() < 12) { + descMac = "0" + descMac; + } + //AABBCCDDEEFF + //AA-BB-CC-DD-EE-FF + descMac = descMac.substring(0, 2).concat("-").concat(descMac.substring(2, 4).concat("-")).concat(descMac.substring(4, 6)).concat("-").concat(descMac.substring(6, 8)).concat("-").concat(descMac.substring(8, 10).concat("-")).concat(descMac.substring(10, 12)); + + lc = new Listcell(descMac.toUpperCase()); + lc.setParent(lstm); + } else { + lc = new Listcell(""); + lc.setParent(lstm); + } + + Long numCaja = estacion.getNumcaja(); + if (numCaja != null) { + lc = new Listcell(numCaja.toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + PuntoVenta pv = estacion.getPuntoVenta(); + if (pv != null) { + lc = new Listcell(pv.getNombpuntoventa()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", estacion); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEstado.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEstado.java new file mode 100644 index 000000000..c6ff3b65c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderEstado.java @@ -0,0 +1,44 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Estado; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author MCosso + */ +public class RenderEstado implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Estado estado = (Estado) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(estado.getEstadoId().toString()); + lc.setParent(lstm); + + lc = new Listcell(estado.getNombestado()); + lc.setParent(lstm); + + if (estado.getPais() != null) { + lc = new Listcell(estado.getPais().getNombpais()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (ApplicationProperties.getInstance().mostrarEquivalencia()) { + lc = new Listcell(estado.getEquivalenciaId()); + lc.setParent(lstm); + } + + lstm.setAttribute("data", estado); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderExcepcionRedondo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderExcepcionRedondo.java new file mode 100644 index 000000000..9dbca53ac --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderExcepcionRedondo.java @@ -0,0 +1,48 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ExcepcionRedondo; +import com.rjconsultores.ventaboletos.entidad.Parada; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderExcepcionRedondo implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ExcepcionRedondo excepcion = (ExcepcionRedondo) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(excepcion.getExcepcionredondoId().toString()); + lc.setParent(lstm); + + lc = new Listcell(excepcion.getIndtipo()); + lc.setParent(lstm); + + Parada origem = excepcion.getOrigem(); + if (origem != null) { + lc = new Listcell(origem.getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Parada destino = excepcion.getDestino(); + if (destino != null) { + lc = new Listcell(destino.getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", excepcion); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderFormaPago.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderFormaPago.java new file mode 100644 index 000000000..41b39f8c6 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderFormaPago.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.FormaPago; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderFormaPago implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + FormaPago formaPago = (FormaPago) o; + + Listcell lc = new Listcell(formaPago.getFormapagoId().toString()); + lc.setParent(lstm); + + lc = new Listcell(formaPago.getDescpago()); + lc.setParent(lstm); + + if (ApplicationProperties.getInstance().mostrarEquivalencia()) { + lc = new Listcell(formaPago.getEquivalenciaId()); + lc.setParent(lstm); + } + + lstm.setAttribute("data", formaPago); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderGrupoCortesias.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderGrupoCortesias.java new file mode 100644 index 000000000..5f357bfb1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderGrupoCortesias.java @@ -0,0 +1,30 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.GrupoCortesia; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderGrupoCortesias implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + GrupoCortesia grupoCortesias = (GrupoCortesia) o; + + Listcell lc = new Listcell(grupoCortesias.getGrupocortesiaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(grupoCortesias.getDescgrupo()); + lc.setParent(lstm); + + lstm.setAttribute("data", grupoCortesias); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMarca.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMarca.java new file mode 100644 index 000000000..12a5cab34 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMarca.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderMarca implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Marca marca = (Marca) o; + + Listcell lc = new Listcell(marca.getMarcaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(marca.getDescmarca()); + lc.setParent(lstm); + + if (ApplicationProperties.getInstance().mostrarEquivalencia()) { + lc = new Listcell(marca.getEquivalenciaId()); + lc.setParent(lstm); + } + + lstm.setAttribute("data", marca); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMenu.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMenu.java new file mode 100644 index 000000000..cac2f1112 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMenu.java @@ -0,0 +1,41 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.FuncionSistema; +import com.rjconsultores.ventaboletos.entidad.Sistema; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderMenu implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + FuncionSistema funcionSistema = (FuncionSistema) o; + + Listcell lc = new Listcell(funcionSistema.getFuncionsistemaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(funcionSistema.getNombfuncion()); + lc.setParent(lstm); + + lc = new Listcell(funcionSistema.getDescruta()); + lc.setParent(lstm); + + Sistema sistema = funcionSistema.getSistema(); + if (sistema != null) { + lc = new Listcell(sistema.toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", funcionSistema); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMercadoCompetido.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMercadoCompetido.java new file mode 100644 index 000000000..b61ac7900 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMercadoCompetido.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.MercadoCompetido; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderMercadoCompetido implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + MercadoCompetido mercadoCompetido = (MercadoCompetido) o; + + Listcell lc = new Listcell(mercadoCompetido.getMercadocompetidoId() == null ? "-" : mercadoCompetido.getMercadocompetidoId().toString()); + lc.setParent(lstm); + + lc = new Listcell(mercadoCompetido.getClaseServicio().getDescclase()); + lc.setParent(lstm); + + lc = new Listcell(mercadoCompetido.getOrigem().getDescparada()); + lc.setParent(lstm); + + lc = new Listcell(mercadoCompetido.getDestino().getDescparada()); + lc.setParent(lstm); + + lstm.setAttribute("data", mercadoCompetido); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMerchantBancario.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMerchantBancario.java new file mode 100644 index 000000000..35728648b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMerchantBancario.java @@ -0,0 +1,30 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.MerchantBancario; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderMerchantBancario implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + MerchantBancario merchantBancario = (MerchantBancario) o; + + Listcell lc = new Listcell(merchantBancario.getCvemerchant()); + lc.setParent(lstm); + + lc = new Listcell(merchantBancario.getDescmerchant()); + lc.setParent(lstm); + + lstm.setAttribute("data", merchantBancario); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMoneda.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMoneda.java new file mode 100644 index 000000000..bd7fb38bb --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMoneda.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderMoneda implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Moneda moneda = (Moneda) o; + + Listcell lc = new Listcell(moneda.getMonedaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(moneda.getDescmoneda()); + lc.setParent(lstm); + + if (ApplicationProperties.getInstance().mostrarEquivalencia()) { + lc = new Listcell(moneda.getEquivalenciaId()); + lc.setParent(lstm); + } + + lstm.setAttribute("data", moneda); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMotivoCancelacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMotivoCancelacion.java new file mode 100644 index 000000000..3ede1eaec --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMotivoCancelacion.java @@ -0,0 +1,41 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.MotivoCancelacion; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderMotivoCancelacion implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + MotivoCancelacion motivoCancelacion = (MotivoCancelacion) o; + + Listcell lc = new Listcell(motivoCancelacion.getMotivocancelacionId().toString()); + lc.setParent(lstm); + + lc = new Listcell(motivoCancelacion.getDescmotivo()); + lc.setParent(lstm); + + String tipoMotivo = motivoCancelacion.getTipomotivo(); + if (tipoMotivo != null) { + if (tipoMotivo.equals("B")) { + lc = new Listcell("BOLETOS"); + } else { + lc = new Listcell("CORRIDAS"); + } + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", motivoCancelacion); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMotivoReimpresion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMotivoReimpresion.java new file mode 100644 index 000000000..74fac82ab --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMotivoReimpresion.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.MotivoReimpresion; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderMotivoReimpresion implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + MotivoReimpresion motivoReimpression = (MotivoReimpresion) o; + + Listcell lc = new Listcell(motivoReimpression.getMotivoreimpresionId().toString()); + lc.setParent(lstm); + + lc = new Listcell(motivoReimpression.getDescmotivo()); + lc.setParent(lstm); + + lstm.setAttribute("data", motivoReimpression); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMotivocancelacionEquivalencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMotivocancelacionEquivalencia.java new file mode 100644 index 000000000..572c44b9d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderMotivocancelacionEquivalencia.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.MotivocancelacionEquivalencia; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderMotivocancelacionEquivalencia implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + MotivocancelacionEquivalencia mce = (MotivocancelacionEquivalencia) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(mce.getMotivoequivalenciaId().toString() == null ? "-" : mce.getMotivoequivalenciaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(mce.getMotivoCancelacion() == null ? "-" : mce.getMotivoCancelacion().getDescmotivo()); + lc.setParent(lstm); + + lc = new Listcell(mce.getComisionistaExterno() == null ? "-" : mce.getComisionistaExterno().getDesccomisionista()); + lc.setParent(lstm); + + lc = new Listcell(mce.getEquivalenciaId() == null ? "-" : mce.getEquivalenciaId()); + lc.setParent(lstm); + + lstm.setAttribute("data", mce); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPais.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPais.java new file mode 100644 index 000000000..5e28f9a2b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPais.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Pais; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPais implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Pais pais = (Pais) o; + + Listcell lc = new Listcell(pais.getPaisId().toString()); + lc.setParent(lstm); + + lc = new Listcell(pais.getNombpais()); + lc.setParent(lstm); + + lstm.setAttribute("data", pais); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderParadaEquivalencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderParadaEquivalencia.java new file mode 100644 index 000000000..049a72d29 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderParadaEquivalencia.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ParadaEquivalencia; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderParadaEquivalencia implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ParadaEquivalencia paradaEquivalencia = (ParadaEquivalencia) o; + + Listcell lc = lc = new Listcell(paradaEquivalencia.getParadaequivalenciaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(paradaEquivalencia.getParada().getDescparada()); + lc.setParent(lstm); + + lc = new Listcell(paradaEquivalencia.getParada().getCveparada()); + lc.setParent(lstm); + + lc = new Listcell(paradaEquivalencia.getComisionistaExterno().getDesccomisionista()); + lc.setParent(lstm); + + lc = new Listcell(paradaEquivalencia.getEquivalenciaId()); + lc.setParent(lstm); + + lstm.setAttribute("data", paradaEquivalencia); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPercepciones.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPercepciones.java new file mode 100644 index 000000000..4240117e9 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPercepciones.java @@ -0,0 +1,19 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderPercepciones implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPerfil.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPerfil.java new file mode 100644 index 000000000..cc6465815 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPerfil.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Perfil; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderPerfil implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Perfil perfil = (Perfil) o; + + Listcell lc = new Listcell(perfil.getPerfilId().toString()); + lc.setParent(lstm); + + lc = new Listcell(perfil.getDescperfil()); + lc.setParent(lstm); + + lstm.setAttribute("data", perfil); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPeriodoVacacional.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPeriodoVacacional.java new file mode 100644 index 000000000..ab5bdb4e7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPeriodoVacacional.java @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PeriodoVacacional; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPeriodoVacacional implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PeriodoVacacional pv = (PeriodoVacacional) o; + + Listcell lc = new Listcell(pv.getPeriodovacacionalId().toString()); + lc.setParent(lstm); + + SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy"); + lc = new Listcell(sf.format(pv.getFecinicio())); + lc.setParent(lstm); + + lc = new Listcell(sf.format(pv.getFecfinal())); + lc.setParent(lstm); + lstm.setAttribute("data", pv); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPermiso.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPermiso.java new file mode 100644 index 000000000..8a0834972 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPermiso.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PerfilFuncion; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderPermiso implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PerfilFuncion permiso = (PerfilFuncion) o; + + Listcell lc = new Listcell(permiso.getFuncionSistema().toString()); + lc.setParent(lstm); + + lstm.setAttribute("data", permiso); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPlaza.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPlaza.java new file mode 100644 index 000000000..5a784157b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPlaza.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Plaza; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderPlaza implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Plaza plaza = (Plaza) o; + + Listcell lc = new Listcell(plaza.getPlazaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(plaza.getNombplaza()); + lc.setParent(lstm); + + lstm.setAttribute("data", plaza); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricing.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricing.java new file mode 100644 index 000000000..62a0ea772 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricing.java @@ -0,0 +1,48 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Pricing; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricing implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Pricing p = (Pricing) o; + + Listcell lc = new Listcell(); + + if (p.getNombPricing() != null) { + + if (p.getPricingId() != null) { + lc = new Listcell(p.getPricingId().toString()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (p.getNombPricing() != null) { + lc = new Listcell(p.getNombPricing()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (p.getEmpresa() != null) { + lc = new Listcell(p.getEmpresa().getNombempresa()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + } + lstm.setAttribute("data", p); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingAnticipacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingAnticipacion.java new file mode 100644 index 000000000..99a54825c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingAnticipacion.java @@ -0,0 +1,34 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingAnticipacion; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Desenvolvimento + */ +public class RenderPricingAnticipacion implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingAnticipacion pm = (PricingAnticipacion) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(pm.getCantdiasmin() == null ? "" : pm.getCantdiasmin().toString()); + lc.setParent(lstm); + + lc = new Listcell(pm.getCantdiasmax() == null ? "" : pm.getCantdiasmax().toString()); + lc.setParent(lstm); + + lc = new Listcell(pm.getPorcpricing() == null ? "" : pm.getPorcpricing().toString()); + lc.setParent(lstm); + + lstm.setAttribute("data", pm); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingAsiento.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingAsiento.java new file mode 100644 index 000000000..59abd69a1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingAsiento.java @@ -0,0 +1,31 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingAsiento; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricingAsiento implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingAsiento pa = (PricingAsiento) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(pa.getNumeasiento()); + lc.setParent(lstm); + + lc = new Listcell(pa.getPorcentaje().toString()); + lc.setParent(lstm); + + lstm.setAttribute("data", pa); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingCategoria.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingCategoria.java new file mode 100644 index 000000000..2ed6a7dbf --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingCategoria.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingCategoria; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricingCategoria implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingCategoria pc = (PricingCategoria) o; + + Listcell lc = new Listcell(); + + if (pc.getCategoria() != null) { + lc = new Listcell(pc.getCategoria().getDesccategoria()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", pc); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingClase.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingClase.java new file mode 100644 index 000000000..e92ab6dc7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingClase.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingClase; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricingClase implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingClase pc = (PricingClase) o; + + Listcell lc = new Listcell(); + + if (pc.getClaseServicio() != null) { + lc = new Listcell(pc.getClaseServicio().getDescclase()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", pc); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingCorrida.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingCorrida.java new file mode 100644 index 000000000..02c93a44f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingCorrida.java @@ -0,0 +1,69 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingCorrida; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.RutaSecuencia; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.service.RutaSecuenciaService; +import java.text.SimpleDateFormat; +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.zkoss.zkplus.spring.SpringUtil; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricingCorrida implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingCorrida pc = (PricingCorrida) o; + + Listcell lc = new Listcell(); + + if (pc.getCorridaCtrl() != null) { + lc = new Listcell(pc.getCorridaCtrl().getCorridaId().toString()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + SimpleDateFormat sf = new SimpleDateFormat("HH:mm"); + if (pc.getCorridaCtrl() != null) { + lc = new Listcell((pc.getCorridaCtrl().getHorario() == null) ? "-" : sf.format(pc.getCorridaCtrl().getHorario())); + + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + Ruta r = pc.getCorridaCtrl().getRuta(); + + RutaSecuenciaService rutaSecuenciaService = (RutaSecuenciaService) SpringUtil.getBean("rutaSecuenciaService"); + List rs = rutaSecuenciaService.buscarSecuenciaOrdenado(r); + if (rs.size() > 0) { + Tramo origem = rs.get(0).getTramo(); + Tramo destino = rs.get(rs.size() - 1).getTramo(); + + lc = new Listcell(origem.getOrigem().getDescparada()); + lc.setParent(lstm); + lc = new Listcell(destino.getDestino().getDescparada()); + lc.setParent(lstm); + } else { + lc = new Listcell(""); + lc.setParent(lstm); + lc = new Listcell(""); + lc.setParent(lstm); + } + + + lstm.setAttribute("data", pc); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingDia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingDia.java new file mode 100644 index 000000000..61e3bedf3 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingDia.java @@ -0,0 +1,122 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingDia; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricingDia implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingDia pc = (PricingDia) o; + + Listcell lc = new Listcell(); + + SimpleDateFormat sf = new SimpleDateFormat("HH:mm"); + if (pc.getPricingdiaId() != null) { + lc = new Listcell(sf.format(pc.getHorarioinicio())); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (pc.getPricingdiaId() != null) { + lc = new Listcell(sf.format(pc.getHorariofin())); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + //Lunes + Checkbox ckbLun = new Checkbox(); + if (pc.getIndlunes() == Boolean.TRUE) { + ckbLun.setChecked(true); + } else { + ckbLun.setChecked(false); + } + ckbLun.setDisabled(true); + lc = new Listcell(); + ckbLun.setParent(lc); + lc.setParent(lstm); + + + Checkbox ckbMar = new Checkbox(); + if (pc.getIndmartes() == Boolean.TRUE) { + ckbMar.setChecked(true); + } else { + ckbMar.setChecked(false); + } + ckbMar.setDisabled(true); + lc = new Listcell(); + ckbMar.setParent(lc); + lc.setParent(lstm); + + + Checkbox ckbMie = new Checkbox(); + if (pc.getIndmiercoles() == Boolean.TRUE) { + ckbMie.setChecked(true); + } else { + ckbMie.setChecked(false); + } + ckbMie.setDisabled(true); + lc = new Listcell(); + ckbMie.setParent(lc); + lc.setParent(lstm); + + Checkbox ckbJue = new Checkbox(); + if (pc.getIndjueves() == Boolean.TRUE) { + ckbJue.setChecked(true); + } else { + ckbJue.setChecked(false); + } + ckbJue.setDisabled(true); + lc = new Listcell(); + ckbJue.setParent(lc); + lc.setParent(lstm); + + Checkbox ckbVie = new Checkbox(); + if (pc.getIndviernes() == Boolean.TRUE) { + ckbVie.setChecked(true); + } else { + ckbVie.setChecked(false); + } + ckbVie.setDisabled(true); + lc = new Listcell(); + ckbVie.setParent(lc); + lc.setParent(lstm); + + Checkbox ckbSab = new Checkbox(); + if (pc.getIndsabado() == Boolean.TRUE) { + ckbSab.setChecked(true); + } else { + ckbSab.setChecked(false); + } + ckbSab.setDisabled(true); + lc = new Listcell(); + ckbSab.setParent(lc); + lc.setParent(lstm); + + Checkbox ckbDom = new Checkbox(); + if (pc.getInddomingo() == Boolean.TRUE) { + ckbDom.setChecked(true); + } else { + ckbDom.setChecked(false); + } + ckbDom.setDisabled(true); + lc = new Listcell(); + ckbDom.setParent(lc); + lc.setParent(lstm); + + lstm.setAttribute("data", pc); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingEspecifico.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingEspecifico.java new file mode 100644 index 000000000..4d24513d7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingEspecifico.java @@ -0,0 +1,48 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingEspecifico; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; + +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; +import org.zkoss.zul.Listcell; + +/** + * + * @author Cássio Rocha + */ +public class RenderPricingEspecifico implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingEspecifico pe = (PricingEspecifico) o; + + Listcell lc = new Listcell(pe.getPricingespecificoId().toString()); + lc.setParent(lstm); + + lc = new Listcell(pe.getNombPricing() == null ? "" : pe.getNombPricing()); + lc.setParent(lstm); + + lc = new Listcell(pe.getMarca().getDescmarca()); + lc.setParent(lstm); + + lc = new Listcell(pe.getMoneda().getDescmoneda()); + lc.setParent(lstm); + + lc = new Listcell(pe.getCategoria().getDesccategoria()); + lc.setParent(lstm); + + lc = new Listcell(pe.getClaseServicio().getDescclase()); + lc.setParent(lstm); + + lc = new Listcell(DateUtil.getStringDate(pe.getFechorinicio(), "dd/MM/yyyy HH:mm")); + lc.setParent(lstm); + + lc = new Listcell(DateUtil.getStringDate(pe.getFechorfin(), "dd/MM/yyyy HH:mm")); + lc.setParent(lstm); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingImporte.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingImporte.java new file mode 100644 index 000000000..358d930a9 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingImporte.java @@ -0,0 +1,40 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingImporte; +import java.math.RoundingMode; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricingImporte implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingImporte pi = (PricingImporte) o; + + Listcell lc = new Listcell(); + + if (pi.getImporte() != null) { + lc = new Listcell(pi.getImporte().setScale(2, RoundingMode.HALF_UP).toString()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (pi.getMoneda() != null) { + lc = new Listcell(pi.getMoneda().getDescmoneda()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", pi); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingMarca.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingMarca.java new file mode 100644 index 000000000..17fb0873c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingMarca.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingMarca; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricingMarca implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingMarca pm = (PricingMarca) o; + + Listcell lc = new Listcell(); + + if (pm.getMarca() != null) { + lc = new Listcell(pm.getMarca().getDescmarca()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", pm); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingMercado.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingMercado.java new file mode 100644 index 000000000..c96b85623 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingMercado.java @@ -0,0 +1,53 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingMercado; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricingMercado implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingMercado pm = (PricingMercado) o; + + Listcell lc = new Listcell(); + + if (pm.getOrigen() != null) { + lc = new Listcell(pm.getOrigen().getCveparada()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (pm.getOrigen() != null) { + lc = new Listcell(pm.getOrigen().getDescparada()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (pm.getDestino() != null) { + lc = new Listcell(pm.getDestino().getCveparada()); + } else { + lc = new Listcell("-"); + } + + lc.setParent(lstm); + if (pm.getDestino() != null) { + lc = new Listcell(pm.getDestino().getDescparada()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", pm); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingOcupacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingOcupacion.java new file mode 100644 index 000000000..e25035a24 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingOcupacion.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingOcupacion; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricingOcupacion implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + + PricingOcupacion po = (PricingOcupacion) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(po.getOcupacioninicial().toString()); + lc.setParent(lstm); + + lc = new Listcell(po.getOcupacionfinal().toString()); + lc.setParent(lstm); + + lc = new Listcell(po.getPorcentaje().toString()); + lc.setParent(lstm); + + lstm.setAttribute("data", po); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingPuntoVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingPuntoVenta.java new file mode 100644 index 000000000..9336ce9ef --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingPuntoVenta.java @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricingPuntoVenta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingPuntoVenta ppv = (PricingPuntoVenta) o; + + Listcell lc = new Listcell(); + + if (ppv.getPuntoVenta() != null) { + lc = new Listcell(ppv.getPuntoVenta().getNombpuntoventa()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", ppv); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingRuta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingRuta.java new file mode 100644 index 000000000..fe2599315 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingRuta.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingRuta; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricingRuta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingRuta pc = (PricingRuta) o; + + Listcell lc = new Listcell(); + + if (pc.getRuta() != null) { + lc = new Listcell(pc.getRuta().getRutaId().toString() + " - " + pc.getRuta().getDescruta()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", pc); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingTipoPtoVta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingTipoPtoVta.java new file mode 100644 index 000000000..8c556ed21 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingTipoPtoVta.java @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricingTipoPtoVta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingTipoPtoVta pc = (PricingTipoPtoVta) o; + + Listcell lc = new Listcell(); + + if (pc.getTipoPtovta() != null) { + lc = new Listcell(pc.getTipoPtovta().getDesctipo()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", pc); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingTipoServicio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingTipoServicio.java new file mode 100644 index 000000000..7a52f5a76 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingTipoServicio.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingTipoServicio; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Desenvolvimento + */ +public class RenderPricingTipoServicio implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingTipoServicio pm = (PricingTipoServicio) o; + + Listcell lc = new Listcell(); + + if (pm.getTipoServicio() != null) { + lc = new Listcell(pm.getTipoServicio().getDescservicio()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", pm); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingVigencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingVigencia.java new file mode 100644 index 000000000..c8c9c43fe --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPricingVigencia.java @@ -0,0 +1,55 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PricingVigencia; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderPricingVigencia implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PricingVigencia pv = (PricingVigencia) o; + + SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + Listcell lc = new Listcell(); + + if (pv.getFecinicioviaje() != null) { + lc = new Listcell(sf.format(pv.getFecinicioviaje())); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (pv.getFecfinviaje() != null) { + lc = new Listcell(sf.format(pv.getFecfinviaje())); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (pv.getFecinicioventa() != null) { + lc = new Listcell(sf.format(pv.getFecinicioventa())); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (pv.getFecfinventa() != null) { + lc = new Listcell(sf.format(pv.getFecfinventa())); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", pv); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderProdPrecio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderProdPrecio.java new file mode 100644 index 000000000..415d1dc14 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderProdPrecio.java @@ -0,0 +1,41 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ProdPrecio; +import java.text.DecimalFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderProdPrecio implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ProdPrecio prodPrecio = (ProdPrecio) o; + DecimalFormat df = new DecimalFormat("###,###,##0.00",new java.text.DecimalFormatSymbols(java.util.Locale.US)); + + Listcell lc = null; + if (prodPrecio.getImporteinicial() != null){ + lc = new Listcell(df.format(prodPrecio.getImporteinicial())); + }else{ + lc = new Listcell(""); + } + lc.setParent(lstm); + if (prodPrecio.getImportefinal() != null){ + lc = new Listcell(df.format(prodPrecio.getImportefinal())); + }else{ + lc = new Listcell(""); + } + lc.setParent(lstm); + + + + lstm.setAttribute("data", prodPrecio); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderProductoServicio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderProductoServicio.java new file mode 100644 index 000000000..78ef728b8 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderProductoServicio.java @@ -0,0 +1,48 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ProdMarca; +import com.rjconsultores.ventaboletos.entidad.ProductoServicio; +import java.math.BigDecimal; +import java.math.BigInteger; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderProductoServicio implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ProductoServicio p = (ProductoServicio) o; + + Listcell lc = new Listcell(p.getProductoservicioId().toString()); + lc.setParent(lstm); + + lc = new Listcell(p.getEmpresa() == null ? "" : p.getEmpresa().getNombempresa()); + lc.setParent(lstm); + + lc = new Listcell(p.getDescproductoservicio()); + lc.setParent(lstm); + + if (p.getIndtipo() != null) { + String status; + if (p.getIndtipo().equals("S")) { + status = "SERVICIO"; + } else { + status = "PRODUCTO"; + } + lc = new Listcell(status); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", p); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPtovtaEmpresa.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPtovtaEmpresa.java new file mode 100644 index 000000000..43f9ba53e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPtovtaEmpresa.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Desenvolvimento + */ +public class RenderPtovtaEmpresa implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + + PtovtaEmpresa p = (PtovtaEmpresa) o; + + Listcell lc = new Listcell(p.getPtovtaempresaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(p.getEmpresa() == null ? "" : p.getEmpresa().getNombempresa()); + lc.setParent(lstm); + + lc = new Listcell(p.getPuntoVenta() == null ? "" : p.getPuntoVenta().getNombpuntoventa()); + lc.setParent(lstm); + + lstm.setAttribute("data", p); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPuntoVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPuntoVenta.java new file mode 100644 index 000000000..294f781dd --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderPuntoVenta.java @@ -0,0 +1,51 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Ciudad; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderPuntoVenta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + PuntoVenta puntoVenta = (PuntoVenta) o; + + Listcell lc = new Listcell(puntoVenta.getPuntoventaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(puntoVenta.getNombpuntoventa()); + lc.setParent(lstm); + + Empresa empresa = puntoVenta.getEmpresa(); + if (empresa != null) { + lc = new Listcell(empresa.getNombempresa()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lc = new Listcell(puntoVenta.getDireccioncalle()); + lc.setParent(lstm); + + lc = new Listcell(puntoVenta.getDireccionnumero()); + lc.setParent(lstm); + + lc = new Listcell(puntoVenta.getNumtelefonouno()); + lc.setParent(lstm); + + lc = new Listcell(puntoVenta.getNumtelefonodos()); + lc.setParent(lstm); + + lstm.setAttribute("data", puntoVenta); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRedondeo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRedondeo.java new file mode 100644 index 000000000..5d2986a61 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRedondeo.java @@ -0,0 +1,50 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Redondeo; +import java.math.BigDecimal; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderRedondeo implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Redondeo permiso = (Redondeo) o; + + Listcell lc = new Listcell(); + + BigDecimal valorInicial = permiso.getValorinicial(); + if (valorInicial != null) { + lc = new Listcell(valorInicial.setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + BigDecimal valorFinal = permiso.getValorfinal(); + if (valorFinal != null) { + lc = new Listcell(valorFinal.setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + BigDecimal valorRedondeo = permiso.getValorredondeo(); + if (valorRedondeo != null) { + lc = new Listcell(valorRedondeo.setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", permiso); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRedondeoCtrl.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRedondeoCtrl.java new file mode 100644 index 000000000..9d57f8361 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRedondeoCtrl.java @@ -0,0 +1,53 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.RedondeoCtrl; +import com.rjconsultores.ventaboletos.entidad.RedondeoMarca; +import org.zkoss.util.resource.Labels; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderRedondeoCtrl implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + RedondeoCtrl redondeoCtrl = (RedondeoCtrl) o; + + Listcell lc = new Listcell(); + + lc = new Listcell(redondeoCtrl.getRedondeoctrlId().toString()); + lc.setParent(lstm); + + Boolean aplicaDescuento = redondeoCtrl.getIndaplicadescuento(); + if (aplicaDescuento) { + lc = new Listcell(Labels.getLabel("MSG.SI")); + } else { + lc = new Listcell(Labels.getLabel("MSG.NO")); + } + lc.setParent(lstm); + + Boolean aplicaPricing = redondeoCtrl.getIndaplicapricing(); + if (aplicaPricing) { + lc = new Listcell(Labels.getLabel("MSG.SI")); + } else { + lc = new Listcell(Labels.getLabel("MSG.NO")); + } + lc.setParent(lstm); + + StringBuilder sb = new StringBuilder(); + for (RedondeoMarca rm : redondeoCtrl.getRedondeoMarcaList()) { + sb.append(rm.getMarca().getDescmarca()).append(", "); + } + lc = new Listcell(sb.toString()); + lc.setParent(lstm); + + lstm.setAttribute("data", redondeoCtrl); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRedondeoMarca.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRedondeoMarca.java new file mode 100644 index 000000000..baced02c7 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRedondeoMarca.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Marca; +import com.rjconsultores.ventaboletos.entidad.RedondeoMarca; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderRedondeoMarca implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + RedondeoMarca redondeoMarca = (RedondeoMarca) o; + + Listcell lc = new Listcell(); + + Marca marca = redondeoMarca.getMarca(); + + lc = new Listcell(marca.getDescmarca() == null ? "" : marca.getDescmarca()); + lc.setParent(lstm); + + + lstm.setAttribute("data", redondeoMarca); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRedondo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRedondo.java new file mode 100644 index 000000000..cdfff0ae9 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRedondo.java @@ -0,0 +1,67 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Redondeo; +import java.math.BigDecimal; +import org.zkoss.util.resource.Labels; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderRedondo implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Redondeo permiso = (Redondeo) o; + + Listcell lc = new Listcell(); + + BigDecimal valorInicial = permiso.getValorinicial(); + if (valorInicial != null) { + lc = new Listcell(valorInicial.setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + BigDecimal valorFinal = permiso.getValorfinal(); + if (valorFinal != null) { + lc = new Listcell(valorFinal.setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + BigDecimal valorRedondeo = permiso.getValorredondeo(); + if (valorRedondeo != null) { + lc = new Listcell(valorRedondeo.setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Boolean aplicaDescuento = permiso.getRedondeoCtrl().getIndaplicadescuento(); + if (aplicaDescuento) { + lc = new Listcell(Labels.getLabel("MSG.SI")); + } else { + lc = new Listcell(Labels.getLabel("MSG.NO")); + } + lc.setParent(lstm); + + Boolean aplicaPricing = permiso.getRedondeoCtrl().getIndaplicapricing(); + if (aplicaPricing) { + lc = new Listcell(Labels.getLabel("MSG.SI")); + } else { + lc = new Listcell(Labels.getLabel("MSG.NO")); + } + lc.setParent(lstm); + + lstm.setAttribute("data", permiso); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRestriccionFormaPago.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRestriccionFormaPago.java new file mode 100644 index 000000000..048b5ac68 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRestriccionFormaPago.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderRestriccionFormaPago implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ConfigRestriccionPago configFormaPago = (ConfigRestriccionPago) o; + + Listcell lc = new Listcell(configFormaPago.getConfigrestriccionId().toString()); + lc.setParent(lstm); + + lc = new Listcell(configFormaPago.getFormaPago().getDescpago()); + lc.setParent(lstm); + + lc = new Listcell(configFormaPago.getRestriccion().getDescrestriccion()); + lc.setParent(lstm); + + lstm.setAttribute("data", configFormaPago); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRolOperativo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRolOperativo.java new file mode 100644 index 000000000..fd1e8eb01 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRolOperativo.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.RolOperativo; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderRolOperativo implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + + RolOperativo rol = (RolOperativo) o; + SimpleDateFormat sf = new SimpleDateFormat("HH:mm:ss"); + + Listcell lc = new Listcell(rol.getRoloperativoId().toString()); + lc.setParent(lstm); + + lc = new Listcell(rol.getDescroloperativo()); + lc.setParent(lstm); + + lc = new Listcell(sf.format(rol.getTiempoprevio())); + lc.setParent(lstm); + + lc = new Listcell((rol.getDiagramaAutobus() == null) ? "" : rol.getDiagramaAutobus().getDescDiagrama()); + lc.setParent(lstm); + + lstm.setAttribute("data", rol); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRutaEmpresa.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRutaEmpresa.java new file mode 100644 index 000000000..39cafa5db --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderRutaEmpresa.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.RutaEmpresa; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderRutaEmpresa implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + RutaEmpresa rutaEmpresa = (RutaEmpresa) o; + + Listcell lc = new Listcell(rutaEmpresa.getEmpresa().getNombempresa()); + lc.setParent(lstm); + + lstm.setAttribute("data", rutaEmpresa); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSecretaria.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSecretaria.java new file mode 100644 index 000000000..bfea5bed4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSecretaria.java @@ -0,0 +1,50 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Secretaria; +import org.zkoss.util.resource.Labels; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderSecretaria implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Secretaria secretaria = (Secretaria) o; + + Listcell lc = new Listcell(secretaria.getSecretariaId() == null ? "" : secretaria.getSecretariaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(secretaria.getDescsecretaria()); + lc.setParent(lstm); + + lc = new Listcell(secretaria.getCvesecretaria()); + lc.setParent(lstm); + + Boolean valida = secretaria.getValidafolio(); + if (valida) { + lc = new Listcell(Labels.getLabel("MSG.VALIDA")); + } else { + lc = new Listcell(Labels.getLabel("MSG.NO.VALIDA")); + } + lc.setParent(lstm); + + if (secretaria.getImprimeprecio().equals(Secretaria.PRECIO_TOTAL)) { + lc = new Listcell(Labels.getLabel("MSG.PRECIO.TOTAL")); + } else if (secretaria.getImprimeprecio().equals(Secretaria.PRECIO_MENOS_DESCUENTO)) { + lc = new Listcell(Labels.getLabel("MSG.PRECIO.MENOS.DESCONTO")); + } else if (secretaria.getImprimeprecio().equals(Secretaria.DESCUENTO_COBRAR)) { + lc = new Listcell(Labels.getLabel("MSG.DESCUENTO.COBRAR")); + } + lc.setParent(lstm); + + lstm.setAttribute("data", secretaria); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamAcumulaMasivo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamAcumulaMasivo.java new file mode 100644 index 000000000..5d9261940 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamAcumulaMasivo.java @@ -0,0 +1,44 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaMasivo; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderSendaAmigoParamAcumulaMasivo implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ParamAcumulaMasivo pam = (ParamAcumulaMasivo) o; + + Listcell lc = new Listcell(pam.getParamacumulamasivo().toString()); + lc.setParent(lstm); + + lc = new Listcell(pam.getEmpresa().getNombempresa()); + lc.setParent(lstm); + + SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy"); + lc = new Listcell(sf.format(pam.getFeciniciovigencia())); + lc.setParent(lstm); + + lc = new Listcell(sf.format(pam.getFecfinvigencia())); + lc.setParent(lstm); + + + lc = new Listcell(pam.getMinpuntootorga().toString()); + lc.setParent(lstm); + + lc = new Listcell(pam.getMaxpuntootorga().toString()); + lc.setParent(lstm); + + lstm.setAttribute("data", pam); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamAcumulaPunto.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamAcumulaPunto.java new file mode 100644 index 000000000..b83168234 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamAcumulaPunto.java @@ -0,0 +1,75 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ParamAcumulaPunto; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderSendaAmigoParamAcumulaPunto implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ParamAcumulaPunto pap = (ParamAcumulaPunto) o; + + Listcell lc = new Listcell(); + if (pap.getParamacumulapuntoId() != null) { + lc = new Listcell(pap.getParamacumulapuntoId().toString()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (pap.getOrigem() != null) { + lc = new Listcell(pap.getOrigem().getDescparada()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (pap.getDestino() != null) { + lc = new Listcell(pap.getDestino().getDescparada()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy"); + if (pap.getFeciniciovigencia() != null) { + lc = new Listcell(sf.format(pap.getFeciniciovigencia())); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (pap.getFecfinvigencia() != null) { + lc = new Listcell(sf.format(pap.getFecfinvigencia())); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (pap.getCantboletooperacion() != null) { + lc = new Listcell(pap.getCantboletooperacion().toString()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (pap.getCantoperaciondia() != null) { + lc = new Listcell(pap.getCantoperaciondia().toString()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", pap); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamCanjePunto.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamCanjePunto.java new file mode 100644 index 000000000..71947caca --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamCanjePunto.java @@ -0,0 +1,54 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ParamCanjePunto; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderSendaAmigoParamCanjePunto implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + ParamCanjePunto pap = (ParamCanjePunto) o; + + Listcell lc = new Listcell(pap.getParamcanjepuntoId().toString()); + lc.setParent(lstm); + + lc = new Listcell(pap.getOrigem().getDescparada()); + lc.setParent(lstm); + + lc = new Listcell(pap.getDestino().getDescparada()); + lc.setParent(lstm); + + SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy"); + if (pap.getFeciniciovigencia() != null) { + lc = new Listcell(sf.format(pap.getFeciniciovigencia())); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + if (pap.getFecfinvigencia() != null) { + lc = new Listcell(sf.format(pap.getFecfinvigencia())); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + if (pap.getPorcentaje() != null) { + lc = new Listcell(pap.getPorcentaje().toString()); + } else { + lc = new Listcell("-"); + } + lc.setParent(lstm); + + lstm.setAttribute("data", pap); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamCompraPunto.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamCompraPunto.java new file mode 100644 index 000000000..af17b6ef1 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamCompraPunto.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ParamCompraPunto; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderSendaAmigoParamCompraPunto implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + ParamCompraPunto pcp = (ParamCompraPunto) o; + + Listcell lc = new Listcell(pcp.getParamcomprapuntoId().toString()); + lc.setParent(lstm); + + SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy"); + lc = new Listcell(sf.format(pcp.getFeciniciovigencia())); + lc.setParent(lstm); + + lc = new Listcell(sf.format(pcp.getFecfinvigencia())); + lc.setParent(lstm); + + lstm.setAttribute("data", pcp); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamCostoTarjeta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamCostoTarjeta.java new file mode 100644 index 000000000..c8f66f888 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSendaAmigoParamCostoTarjeta.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.ParamCostoTarjeta; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Rafius + */ +public class RenderSendaAmigoParamCostoTarjeta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + SimpleDateFormat formatoData = new SimpleDateFormat("dd/MM/yyyy"); + DecimalFormat df = new DecimalFormat("###,###,##0.00",new java.text.DecimalFormatSymbols(java.util.Locale.US)); + + ParamCostoTarjeta pct = (ParamCostoTarjeta) o; + + Listcell lc = new Listcell(pct.getParamcostotarjetaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(pct.getEmpresa().getNombempresa()); + lc.setParent(lstm); + + lc = new Listcell(df.format(pct.getValcostoinicial())); + lc.setParent(lstm); + + lstm.setAttribute("data", pct); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSistema.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSistema.java new file mode 100644 index 000000000..8f191af01 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderSistema.java @@ -0,0 +1,30 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Sistema; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderSistema implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + Sistema formaPago = (Sistema) o; + + Listcell lc = new Listcell(formaPago.getSistemaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(formaPago.getNombsistema()); + lc.setParent(lstm); + + lstm.setAttribute("data", formaPago); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarifa.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarifa.java new file mode 100644 index 000000000..cc8c1c25a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarifa.java @@ -0,0 +1,111 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Tarifa; +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderTarifa implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Tarifa t = (Tarifa) o; + SimpleDateFormat formatoData = new SimpleDateFormat("dd/MM/yyyy"); + DecimalFormat df = new DecimalFormat("###,###,##0.00", new java.text.DecimalFormatSymbols(java.util.Locale.US)); + + Listcell lc = new Listcell(t.getTarifaId().toString()); + lc.setParent(lstm); + + if (t.getPrecio() != null) { + //lc = new Listcell(t.getPrecio().setScale(2).toString()); + lc = new Listcell(df.format(t.getPrecio())); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (t.getPreciooriginal() != null) { + //lc = new Listcell(t.getPreciooriginal().setScale(2).toString()); + lc = new Listcell(df.format(t.getPreciooriginal())); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (t.getStatustarifa() != null) { + String status; + if (t.getStatustarifa().equals("A")) { + status = "Autorizado"; + } else { + status = "Latente"; + } + lc = new Listcell(status); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + + if (t.getTramo() != null) { + lc = new Listcell(t.getTramo().getOrigem().getDescparada()); + lc.setParent(lstm); + lc = new Listcell(t.getTramo().getDestino().getDescparada()); + lc.setParent(lstm); + lc = new Listcell(t.getTramo().getVia().getNombvia()); + lc.setParent(lstm); + } else { + lc = new Listcell(""); + lc.setParent(lstm); + lc = new Listcell(""); + lc.setParent(lstm); + lc = new Listcell(""); + lc.setParent(lstm); + } + + + + if (t.getMarca() != null) { + lc = new Listcell(t.getMarca().getDescmarca()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (t.getVigenciaTarifa() != null) { + String vigencia = formatoData.format(t.getVigenciaTarifa().getFeciniciovigencia()) + " - " + + formatoData.format(t.getVigenciaTarifa().getFecfinvigencia()); + lc = new Listcell(vigencia); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (t.getClaseServicio() != null) { + lc = new Listcell(t.getClaseServicio().getDescclase()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (t.getMoneda() != null) { + lc = new Listcell(t.getMoneda().getDescmoneda()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + + + lstm.setAttribute("data", t); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarifaCategoria.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarifaCategoria.java new file mode 100644 index 000000000..bbebb0746 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarifaCategoria.java @@ -0,0 +1,50 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Categoria; +import com.rjconsultores.ventaboletos.entidad.TarifaCategoria; +import java.math.BigDecimal; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderTarifaCategoria implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TarifaCategoria tarifaCategoria = (TarifaCategoria) o; + + Listcell lc = null; + Categoria categoria = tarifaCategoria.getCategoria(); + if (categoria != null) { + lc = new Listcell(categoria.getDesccategoria()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + BigDecimal precio = tarifaCategoria.getPrecio(); + if (precio != null) { + lc = new Listcell(precio.setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + BigDecimal precioAbierto = tarifaCategoria.getPrecioredabierto(); + if (precioAbierto != null) { + lc = new Listcell(precioAbierto.setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", tarifaCategoria); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarifaMinima.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarifaMinima.java new file mode 100644 index 000000000..b14bf6ee3 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarifaMinima.java @@ -0,0 +1,78 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TarifaMinima; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderTarifaMinima implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TarifaMinima tm = (TarifaMinima) o; + + Listcell lc; + + + lc = new Listcell(tm.getTarifaminimaId().toString()); + lc.setParent(lstm); + + if (tm.getImportetarifa() != null) { + lc = new Listcell(tm.getImportetarifa().setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (tm.getMarca() != null) { + lc = new Listcell(tm.getMarca().getDescmarca()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (tm.getOrigem() != null) { + lc = new Listcell(tm.getOrigem().getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (tm.getDestino() != null) { + lc = new Listcell(tm.getDestino().getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (tm.getClaseServicio() != null) { + lc = new Listcell(tm.getClaseServicio().getDescclase()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (tm.getPlaza() != null) { + lc = new Listcell(tm.getPlaza().getNombplaza()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (tm.getMoneda() != null) { + lc = new Listcell(tm.getMoneda().getDescmoneda()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", tm); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarifaTipoPuntoVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarifaTipoPuntoVenta.java new file mode 100644 index 000000000..b6dfe72e2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarifaTipoPuntoVenta.java @@ -0,0 +1,50 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TarifaTipoptovta; +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import java.math.BigDecimal; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderTarifaTipoPuntoVenta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TarifaTipoptovta tarifaTipoPuntoVenta = (TarifaTipoptovta) o; + + Listcell lc = null; + TipoPuntoVenta tipoPuntoVenta = tarifaTipoPuntoVenta.getTipoPuntoVenta(); + if (tipoPuntoVenta != null) { + lc = new Listcell(tipoPuntoVenta.getDesctipo()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + BigDecimal precio = tarifaTipoPuntoVenta.getPrecio(); + if (precio != null) { + lc = new Listcell(precio.setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + BigDecimal precioAbierto = tarifaTipoPuntoVenta.getPrecioredabierto(); + if (precioAbierto != null) { + lc = new Listcell(precioAbierto.setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", tarifaTipoPuntoVenta); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaFidelidad.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaFidelidad.java new file mode 100644 index 000000000..d1451854c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaFidelidad.java @@ -0,0 +1,36 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad; + + +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderTarjetaFidelidad implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + + TarjetaFidelidad tfC = (TarjetaFidelidad) o; + Listcell lc; + + lc = new Listcell(tfC.getTarjetaFidelidadId().toString()); + lc.setParent(lstm); + + lc = new Listcell(tfC.getDescGeneracion()); + lc.setParent(lstm); + + lc = new Listcell(tfC.getNumTarjeta()); + lc.setParent(lstm); + + lstm.setAttribute("data", tfC); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaFidelidadClaves.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaFidelidadClaves.java new file mode 100644 index 000000000..bef4ce84c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaFidelidadClaves.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderTarjetaFidelidadClaves implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TarjetaFidelidad tf = (TarjetaFidelidad) o; + + Listcell lc = new Listcell(tf.getDescGeneracion()); + lc.setParent(lstm); + + lc = new Listcell(tf.getNumTarjeta().toString()); + lc.setParent(lstm); + + lstm.setAttribute("data", tf); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaRecaudacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaRecaudacion.java new file mode 100644 index 000000000..8d5417f8a --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaRecaudacion.java @@ -0,0 +1,130 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Autobus; +import com.rjconsultores.ventaboletos.entidad.ClaseServicio; +import com.rjconsultores.ventaboletos.entidad.Corrida; +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Ruta; +import com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacion; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Checkbox; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTarjetaRecaudacion implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + TarjetaRecaudacion tarjetaRecaudacion = (TarjetaRecaudacion) o; + SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + + Listcell lc = new Listcell(tarjetaRecaudacion.getTarjetasRecaudacionPK(). + getTarjetarecaudacionId().toString()); + lc.setParent(lstm); + + Corrida corrida = tarjetaRecaudacion.getCorrida(); + if (corrida != null) { + lc = new Listcell(corrida.getId().getCorridaId().toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (corrida != null) { + lc = new Listcell(sf.format(corrida.getId().getFeccorrida())); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Parada origen = tarjetaRecaudacion.getOrigen(); + if (origen != null) { + lc = new Listcell(origen.getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Parada destino = tarjetaRecaudacion.getDestino(); + if (destino != null) { + lc = new Listcell(destino.getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Ruta ruta = tarjetaRecaudacion.getRuta(); + if (ruta != null) { + lc = new Listcell(ruta.getDescruta()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Autobus autobus = tarjetaRecaudacion.getAutobus(); + if (autobus != null) { + lc = new Listcell(autobus.getNumautobus()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + ClaseServicio claseServicio = tarjetaRecaudacion.getClaseServicio(); + if (claseServicio != null) { + lc = new Listcell(claseServicio.getDescclase()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Empresa empresa = tarjetaRecaudacion.getEmpresa(); + if (empresa != null) { + lc = new Listcell(empresa.getNombempresa()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Double ingresoCorrida = tarjetaRecaudacion.getIngresoCorrida(); + if (ingresoCorrida != null) { + lc = new Listcell(ingresoCorrida.toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lc = new Listcell(); + Checkbox checkManual = new Checkbox(); + if (tarjetaRecaudacion.getTarjetasRecaudacionPK().getManual()) { + checkManual.setChecked(Boolean.TRUE); + } else { + checkManual.setChecked(Boolean.FALSE); + } + checkManual.setDisabled(Boolean.TRUE); + lc.appendChild(checkManual); + lc.setParent(lstm); + + lc = new Listcell(); + Checkbox checkAtualizado = new Checkbox(); + if (tarjetaRecaudacion.getActualizar()) { + checkAtualizado.setChecked(Boolean.TRUE); + } else { + checkAtualizado.setChecked(Boolean.FALSE); + } + checkAtualizado.setDisabled(Boolean.TRUE); + lc.appendChild(checkAtualizado); + lc.setParent(lstm); + + lstm.setAttribute("data", tarjetaRecaudacion); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaViaje.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaViaje.java new file mode 100644 index 000000000..5f84d8b33 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTarjetaViaje.java @@ -0,0 +1,169 @@ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.dao.TarjetaViajeDAO; +import java.text.SimpleDateFormat; + +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +import com.rjconsultores.ventaboletos.entidad.TarjetaViaje; +import com.rjconsultores.ventaboletos.web.utilerias.spring.AppContext; +import java.util.List; + +public class RenderTarjetaViaje implements ListitemRenderer { + + private TarjetaViajeDAO tarjetaViajeDAO; + + public RenderTarjetaViaje() { + tarjetaViajeDAO = (TarjetaViajeDAO) AppContext.getApplicationContext().getBean("tarjetaViajeDAO"); + } + + @Override + public void render(Listitem lstm, Object o) throws Exception { + + TarjetaViaje tarjeta = (TarjetaViaje) o; + + String style = ""; + + + if (tarjeta.getIndRebote() != null && tarjeta.getIndRebote().equals(1)) { + style = "color:green"; + } + + if (tarjeta.getConductor() != null && tarjeta.getConductor1() != null) { + if (!tarjeta.getConductor().getConductorId().equals(tarjeta.getConductor1().getConductorId())) { + style = "color:blue"; + } + //Esse teste checa se houve uma volta para o autobus/condutor, + //Se teve volta a TarjetaViaje tem que ser preta + List ls = tarjetaViajeDAO.buscarTarjetaPorFiltros(tarjeta); + if (ls.size() > 1) { + boolean existeCorridaVolta = tarjetaViajeDAO.buscarTarjetaExisteVolta(tarjeta); + if (existeCorridaVolta) { + style = ""; + } else { + style = "color:blue"; + } + } + + } + if (tarjeta.geteCorridaDuplicada() == true) { + style = "color:red"; + + //Esse teste checa se houve uma volta para o autobus/condutor, + //Se teve volta a TarjetaViaje tem que ser preta + List ls = tarjetaViajeDAO.buscarTarjetaPorFiltros(tarjeta); + if (ls.size() > 1) { + boolean existeCorridaVolta = tarjetaViajeDAO.buscarTarjetaExisteVolta(tarjeta); + if (existeCorridaVolta) { + style = ""; + } else { + style = "color:red"; + } + } + } + + Listcell lc = new Listcell(tarjeta.getTarjetaviajeId().toString()); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getEmpresa() != null ? String.valueOf(tarjeta.getEmpresa().getNombempresa()) : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getAutobus() != null ? tarjeta.getAutobus().getNumautobus() : ""); + lc.setParent(lstm); + lc.setStyle(style); + + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + + lc = new Listcell(tarjeta.getFecHorSalida() == null ? "" : sdf.format(tarjeta.getFecHorSalida())); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getFoliotarjetaviaje() != null ? tarjeta.getFoliotarjetaviaje() : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getOrigen() != null ? tarjeta.getOrigen() : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getDestino() != null ? tarjeta.getDestino() : ""); + lc.setParent(lstm); + lc.setStyle(style); + + //busquedaTarjetaViajeController.lhTipo.label + lc = new Listcell(tarjeta.getNumsecuencia() != null ? getDescSeq(tarjeta.getNumsecuencia().shortValue()) : ""); + lc.setParent(lstm); + lc.setStyle(style); + + //busquedaTarjetaViajeController.lhKmsAutobus.label + lc = new Listcell(tarjeta.getKmReal() != null ? String.valueOf(tarjeta.getKmReal()) : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getNumCorrida() != null ? tarjeta.getNumCorrida().toString() : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getClaseServicio().getClaseservicioId() != null ? String.valueOf(tarjeta.getClaseServicio().getClaseservicioId()) : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getConductor() != null ? tarjeta.getConductor().getEmpleado().getCveEmpleado() : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getOrigen() != null ? tarjeta.getOrigen() : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getDestino() != null ? tarjeta.getDestino() : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getKmPagoConductor() != null ? String.valueOf(tarjeta.getKmPagoConductor()) : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getConductor1() != null ? tarjeta.getConductor1().getEmpleado().getCveEmpleado() : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getOrigen() != null ? tarjeta.getOrigen() : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getDestino() != null ? tarjeta.getDestino() : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getKmPagoConductor() != null ? String.valueOf(tarjeta.getKmPagoConductor()) : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getIndstatustarjeta() != null ? tarjeta.getIndstatustarjeta() : ""); + lc.setParent(lstm); + lc.setStyle(style); + + lc = new Listcell(tarjeta.getFoliotarjetaviaje()); + lc.setParent(lstm); + lc.setStyle(style); + + lstm.setAttribute("data", tarjeta); + } + + private String getDescSeq(Short numSeq) { + if (numSeq == null) { + return ""; + } + + if (numSeq.shortValue() == 1) { + return "P"; + } else { + return "S"; + } + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCambioCiudad.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCambioCiudad.java new file mode 100644 index 000000000..8a7fb2d31 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCambioCiudad.java @@ -0,0 +1,27 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TipoCambioCiudad; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTipoCambioCiudad implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TipoCambioCiudad tcc = (TipoCambioCiudad) o; + + Listcell lc = new Listcell(); + lc = new Listcell(tcc.getCiudad().getNombciudad()); + lc.setParent(lstm); + + lstm.setAttribute("data", tcc); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCambioCtrl.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCambioCtrl.java new file mode 100644 index 000000000..5baf59611 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCambioCtrl.java @@ -0,0 +1,74 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Moneda; +import com.rjconsultores.ventaboletos.entidad.TipoCambioCiudad; +import com.rjconsultores.ventaboletos.entidad.TipoCambioCtrl; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Date; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTipoCambioCtrl implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TipoCambioCtrl p = (TipoCambioCtrl) o; + + Listcell lc = new Listcell(); + lc = new Listcell(p.getTipocambioctrlId().toString()); + lc.setParent(lstm); + + BigDecimal importe = p.getImportecambio(); + if (importe != null) { + lc = new Listcell(importe.setScale(2).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + Date data = p.getFecaplicacion(); + if (data != null) { + lc = new Listcell(format.format(data)); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Moneda monedaOrigen = p.getMonedaOrigen(); + if (monedaOrigen != null) { + lc = new Listcell(monedaOrigen.getDescmoneda()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Moneda monedaDestino = p.getMonedaDestino(); + if (monedaDestino != null) { + lc = new Listcell(monedaDestino.getDescmoneda()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + + StringBuilder sb = new StringBuilder(); + for (TipoCambioCiudad tc : p.getTipoCambioCiudadList()) { + sb.append(tc.getCiudad().getNombciudad()); + break; + } + lc = new Listcell(sb.toString()); + lc.setParent(lstm); + + lstm.setAttribute("data", p); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoConvenio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoConvenio.java new file mode 100644 index 000000000..6ef36c55e --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoConvenio.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TipoConvenio; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderTipoConvenio implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TipoConvenio tc = (TipoConvenio) o; + + Listcell lc = new Listcell(tc.getTipoConvenioID().toString()); + lc.setParent(lstm); + + lc = new Listcell(tc.getDescTipo()); + lc.setParent(lstm); + + lstm.setAttribute("data", tc); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCorte.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCorte.java new file mode 100644 index 000000000..173946c77 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCorte.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TipoCorte; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTipoCorte implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TipoCorte articulo = (TipoCorte) o; + + Listcell lc = new Listcell(articulo.getTipocorteId().toString()); + lc.setParent(lstm); + + lc = new Listcell(articulo.getDesctipo()); + lc.setParent(lstm); + + lstm.setAttribute("data", articulo); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCortesia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCortesia.java new file mode 100644 index 000000000..3770b048c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCortesia.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TipoCortesia; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderTipoCortesia implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TipoCortesia tipoCortesia = (TipoCortesia) o; + + Listcell lc = new Listcell(tipoCortesia.getTipocortesiaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(tipoCortesia.getDesctipo()); + lc.setParent(lstm); + + lc = new Listcell(tipoCortesia.getGrupoCortesia().getDescgrupo()); + lc.setParent(lstm); + + lstm.setAttribute("data", tipoCortesia); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCortesiaD.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCortesiaD.java new file mode 100644 index 000000000..c9c1f6d83 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoCortesiaD.java @@ -0,0 +1,33 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TipoCortesiaDescuento; +import java.math.RoundingMode; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Shiro + */ +public class RenderTipoCortesiaD implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TipoCortesiaDescuento tipoCortesiaDescuento = (TipoCortesiaDescuento) o; + + Listcell lc = new Listcell(tipoCortesiaDescuento.getTipocortesiadescuentoId().toString()); + lc.setParent(lstm); + + lc = new Listcell(tipoCortesiaDescuento.getTipoCortesia().getDesctipo()); + lc.setParent(lstm); + + lc = new Listcell(tipoCortesiaDescuento.getPorcdescuento().setScale(2, RoundingMode.UP).toString()); + lc.setParent(lstm); + + lstm.setAttribute("data", tipoCortesiaDescuento); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoDomicilio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoDomicilio.java new file mode 100644 index 000000000..8590702c2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoDomicilio.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TipoDomicilio; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTipoDomicilio implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TipoDomicilio tipoDomicilio = (TipoDomicilio) o; + + Listcell lc = new Listcell(tipoDomicilio.getTipodomicilioId().toString()); + lc.setParent(lstm); + + lc = new Listcell(tipoDomicilio.getDesctipo()); + lc.setParent(lstm); + + lc = new Listcell(tipoDomicilio.getCvetipodomicilio()); + lc.setParent(lstm); + + lstm.setAttribute("data", tipoDomicilio); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoEventoExtra.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoEventoExtra.java new file mode 100644 index 000000000..5c59ca6af --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoEventoExtra.java @@ -0,0 +1,51 @@ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import java.math.RoundingMode; + +import org.zkoss.util.resource.Labels; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +import com.rjconsultores.ventaboletos.entidad.TipoEventoExtra; + +public class RenderTipoEventoExtra implements ListitemRenderer { + + private String getTipo(int idTipo) { + if (idTipo == 1) { + return Labels.getLabel("editarTipoEventoExtraController.rd1.label"); + } else if (idTipo == 2) { + return Labels.getLabel("editarTipoEventoExtraController.rd2.label"); + } else if (idTipo == 3) { + return Labels.getLabel("editarTipoEventoExtraController.rd3.label"); + } + return ""; + } + + public void render(Listitem lstm, Object o) throws Exception { + TipoEventoExtra banco = (TipoEventoExtra) o; + + Listcell lc = new Listcell(banco.getTipoeventoextraId().toString()); + lc.setParent(lstm); + + lc = new Listcell(banco.getDescTipoEvento() == null ? "" + : banco.getDescTipoEvento()); + lc.setParent(lstm); + + String indTipo = null; + + if (banco.getIndoperacion() == null) { + indTipo = ""; + } else { + indTipo = getTipo(banco.getIndoperacion().intValue()); + } + + lc = new Listcell(indTipo); + lc.setParent(lstm); + + + + lstm.setAttribute("data", banco); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoMovimiento.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoMovimiento.java new file mode 100644 index 000000000..273d18131 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoMovimiento.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TipoMovimiento; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTipoMovimiento implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TipoMovimiento tipoMovimiento = (TipoMovimiento) o; + + Listcell lc = new Listcell(tipoMovimiento.getTipomovimientoId().toString()); + lc.setParent(lstm); + + lc = new Listcell(tipoMovimiento.getDescmovimiento()); + lc.setParent(lstm); + + lstm.setAttribute("data", tipoMovimiento); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoOcupacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoOcupacion.java new file mode 100644 index 000000000..4a99e017d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoOcupacion.java @@ -0,0 +1,32 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TipoOcupacion; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTipoOcupacion implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TipoOcupacion tipoOcupacion = (TipoOcupacion) o; + + Listcell lc = new Listcell(tipoOcupacion.getTipoocupacionId().toString()); + lc.setParent(lstm); + + lc = new Listcell(tipoOcupacion.getDesctipo()); + lc.setParent(lstm); + + lc = new Listcell(tipoOcupacion.getCvetipoocupacion()); + lc.setParent(lstm); + + lstm.setAttribute("data", tipoOcupacion); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoParada.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoParada.java new file mode 100644 index 000000000..12ea5b989 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoParada.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TipoParada; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTipoParada implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TipoParada tipoParada = (TipoParada) o; + + Listcell lc = new Listcell(tipoParada.getTipoparadaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(tipoParada.getDesctipo()); + lc.setParent(lstm); + + lstm.setAttribute("data", tipoParada); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoPuntoVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoPuntoVenta.java new file mode 100644 index 000000000..acd07ac15 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoPuntoVenta.java @@ -0,0 +1,36 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta; +import com.rjconsultores.ventaboletos.utilerias.ApplicationProperties; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTipoPuntoVenta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TipoPuntoVenta tipoPuntoVenta = (TipoPuntoVenta) o; + + Listcell lc = new Listcell(tipoPuntoVenta.getTipoptovtaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(tipoPuntoVenta.getDesctipo()); + lc.setParent(lstm); + + + if (ApplicationProperties.getInstance().mostrarEquivalencia()) { + lc = new Listcell(tipoPuntoVenta.getEquivalenciaId()); + lc.setParent(lstm); + } + + lstm.setAttribute("data", tipoPuntoVenta); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoServicio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoServicio.java new file mode 100644 index 000000000..9c1c9c319 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoServicio.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TipoServicio; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTipoServicio implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TipoServicio tipoServicio = (TipoServicio) o; + + Listcell lc = new Listcell(tipoServicio.getTiposervicioId().toString()); + lc.setParent(lstm); + + lc = new Listcell(tipoServicio.getDescservicio()); + lc.setParent(lstm); + + lstm.setAttribute("data", tipoServicio); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoVenta.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoVenta.java new file mode 100644 index 000000000..ab6b44146 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTipoVenta.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TipoVenta; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTipoVenta implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TipoVenta tipoVenta = (TipoVenta) o; + + Listcell lc = new Listcell(tipoVenta.getTipoventaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(tipoVenta.getDesctipoventa()); + lc.setParent(lstm); + + lstm.setAttribute("data", tipoVenta); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramo.java new file mode 100644 index 000000000..ff59073c6 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramo.java @@ -0,0 +1,73 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.Tramo; +import com.rjconsultores.ventaboletos.entidad.Via; +import java.math.BigDecimal; +import java.math.RoundingMode; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTramo implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Tramo tramo = (Tramo) o; + + Listcell lc = new Listcell(tramo.getTramoId().toString()); + lc.setParent(lstm); + + lc = new Listcell(tramo.getDesctramo()); + lc.setParent(lstm); + + Parada origem = tramo.getOrigem(); + if (origem != null) { + lc = new Listcell(origem.getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Parada destino = tramo.getDestino(); + if (destino != null) { + lc = new Listcell(destino.getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + Via via = tramo.getVia(); + if (via != null) { + lc = new Listcell(via.getNombvia()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + BigDecimal kmReal = tramo.getKmReal(); + if (kmReal != null) { + lc = new Listcell(kmReal.setScale(2, RoundingMode.UP).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + BigDecimal kmPgCondutor = tramo.getKmPagoConductor(); + if (kmPgCondutor != null) { + lc = new Listcell(kmPgCondutor.setScale(2, RoundingMode.UP).toString()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", tramo); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramoKm.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramoKm.java new file mode 100644 index 000000000..a2c93c149 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramoKm.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.TramoKm; + +/** + * + * @author Administrador + */ +public class RenderTramoKm implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TramoKm tramoKm = (TramoKm) o; + Listcell lc = new Listcell((tramoKm.getCantkmpagoconductor() == null) ? "" : tramoKm.getCantkmpagoconductor().toString()); + lc.setParent(lstm); + + Empresa empresa = tramoKm.getEmpresa(); + lc = new Listcell((empresa == null) ? "" : empresa.getNombempresa()); + lc.setParent(lstm); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramoKmServicio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramoKmServicio.java new file mode 100644 index 000000000..262acf3f5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramoKmServicio.java @@ -0,0 +1,37 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.TramoKmServicio; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Desenvolvimento + */ +public class RenderTramoKmServicio implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TramoKmServicio tramoKm = (TramoKmServicio) o; + + Listcell lc = new Listcell((tramoKm.getTramokmservicioId() == null) ? "" : tramoKm.getTramokmservicioId().toString()); + lc.setParent(lstm); + + lc = new Listcell((tramoKm.getEmpresa() == null) ? "" : tramoKm.getEmpresa().getNombempresa()); + lc.setParent(lstm); + + lc = new Listcell((tramoKm.getClaseServicio() == null) ? "" : tramoKm.getClaseServicio().getDescclase()); + lc.setParent(lstm); + + lc = new Listcell((tramoKm.getTramo() == null) ? "" : tramoKm.getTramo().getDesctramo()); + lc.setParent(lstm); + + lc = new Listcell((tramoKm.getCantkmpagoconductor() == null) ? "" : tramoKm.getCantkmpagoconductor().setScale(2).toString()); + lc.setParent(lstm); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramoServicio.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramoServicio.java new file mode 100644 index 000000000..3137ced72 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramoServicio.java @@ -0,0 +1,47 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import java.util.Calendar; + +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +import com.rjconsultores.ventaboletos.entidad.TramoServicio; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; + +/** + * + * @author Rafius + */ +public class RenderTramoServicio implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TramoServicio serv = (TramoServicio) o; + + Listcell lc = new Listcell(serv.getClaseServicio().getDescclase()); + lc.setParent(lstm); + + + if (serv.getTiemporecorrido() == null) { + lc = new Listcell(""); + } else { + Calendar c = Calendar.getInstance(); + c.setTime(serv.getTiemporecorrido()); + System.out.println(DateUtil.getFecInicio().getTime()+ " " + c.getTime()); + Long tempo = DateUtil.getElapsedMinutos(DateUtil.getFecInicio().getTime(), c.getTime()); + long minutos = (tempo % 60); + int horas = (tempo.intValue() / 60); + + + String sMinutos = String.valueOf(minutos); + lc = new Listcell(horas + ":" + ((sMinutos.length() < 2) ? "0" + sMinutos : sMinutos)); + } + lc.setParent(lstm); + + lstm.setAttribute("data", serv); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramoTiempo.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramoTiempo.java new file mode 100644 index 000000000..fa46166c5 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTramoTiempo.java @@ -0,0 +1,59 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.TramoTiempo; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTramoTiempo implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + TramoTiempo tramoTiempo = (TramoTiempo) o; + + SimpleDateFormat sf = new SimpleDateFormat("HH:mm"); + + Listcell lc = new Listcell(tramoTiempo.getClaseServicio().toString()); + lc.setParent(lstm); + + lc = new Listcell(sf.format(tramoTiempo.getHorainicio())); + lc.setParent(lstm); + + lc = new Listcell(sf.format(tramoTiempo.getHorafin())); + lc.setParent(lstm); + + lc = new Listcell(sf.format(tramoTiempo.getTiemporecorrido())); + lc.setParent(lstm); + + lc = new Listcell((tramoTiempo.getIndapliclun()) ? "Si" : "No"); + lc.setParent(lstm); + + lc = new Listcell((tramoTiempo.getIndaplicmar()) ? "Si" : "No"); + lc.setParent(lstm); + + lc = new Listcell((tramoTiempo.getIndaplicmie()) ? "Si" : "No"); + lc.setParent(lstm); + + lc = new Listcell((tramoTiempo.getIndaplicjue()) ? "Si" : "No"); + lc.setParent(lstm); + + lc = new Listcell((tramoTiempo.getIndaplicvie()) ? "Si" : "No"); + lc.setParent(lstm); + + lc = new Listcell((tramoTiempo.getIndaplicsab()) ? "Si" : "No"); + lc.setParent(lstm); + + lc = new Listcell((tramoTiempo.getIndaplicdom()) ? "Si" : "No"); + lc.setParent(lstm); + + lstm.setAttribute("data", tramoTiempo); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTurno.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTurno.java new file mode 100644 index 000000000..8f53af73c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderTurno.java @@ -0,0 +1,29 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Turno; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderTurno implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Turno turno = (Turno) o; + + Listcell lc = new Listcell(turno.getTurnoId().toString()); + lc.setParent(lstm); + + lc = new Listcell(turno.getDescturno()); + lc.setParent(lstm); + + lstm.setAttribute("data", turno); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderUbicacion.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderUbicacion.java new file mode 100644 index 000000000..c03f6285d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderUbicacion.java @@ -0,0 +1,42 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Parada; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.entidad.UsuarioUbicacion; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderUbicacion implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + UsuarioUbicacion ubicacion = (UsuarioUbicacion) o; + + Listcell lc; + Parada parada = ubicacion.getParada(); + if (parada != null) { + lc = new Listcell(parada.getDescparada()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + PuntoVenta puntoVenta = ubicacion.getPuntoVenta(); + if (puntoVenta != null) { + lc = new Listcell(puntoVenta.getNombpuntoventa()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", ubicacion); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderUsuario.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderUsuario.java new file mode 100644 index 000000000..fee442a6c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderUsuario.java @@ -0,0 +1,52 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Perfil; +import com.rjconsultores.ventaboletos.entidad.Usuario; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderUsuario implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Usuario usuario = (Usuario) o; + + Listcell lc = new Listcell(usuario.getUsuarioId().toString()); + lc.setParent(lstm); + + lc = new Listcell(usuario.getClaveUsuario()); + lc.setParent(lstm); + + lc = new Listcell(usuario.getEmpleado() == null ? "" : usuario.getEmpleado().getCveEmpleado()); + lc.setParent(lstm); + + lc = new Listcell(usuario.getNombusuario()); + lc.setParent(lstm); + + lc = new Listcell(usuario.getNombpaterno()); + lc.setParent(lstm); + + lc = new Listcell(usuario.getNombmaterno()); + lc.setParent(lstm); + + if (!usuario.getUsuarioPerfilList().isEmpty()) { + Perfil p = usuario.getUsuarioPerfilList().get(0).getPerfil(); + if (p != null) { + lc = new Listcell(p.getDescperfil()); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + } + + lstm.setAttribute("data", usuario); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderUsuarioBancario.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderUsuarioBancario.java new file mode 100644 index 000000000..6a4232520 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderUsuarioBancario.java @@ -0,0 +1,30 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.UsuarioBancario; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderUsuarioBancario implements ListitemRenderer { + + @Override + public void render(Listitem lstm, Object o) throws Exception { + UsuarioBancario usuarioBancario = (UsuarioBancario) o; + + Listcell lc = new Listcell(usuarioBancario.getCveusuario()); + lc.setParent(lstm); + + lc = new Listcell(usuarioBancario.getPassword()); + lc.setParent(lstm); + + lstm.setAttribute("data", usuarioBancario); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderVia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderVia.java new file mode 100644 index 000000000..5a3e4ab5b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderVia.java @@ -0,0 +1,30 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.Via; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderVia implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + Via via = (Via) o; + + Listcell lc = new Listcell(via.getViaId().toString()); + lc.setParent(lstm); + + lc = new Listcell(via.getNombvia()); + lc.setParent(lstm); + + + lstm.setAttribute("data", via); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderVigenciaTarifa.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderVigenciaTarifa.java new file mode 100644 index 000000000..15ffe91cb --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderVigenciaTarifa.java @@ -0,0 +1,42 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author rodrigo + */ +public class RenderVigenciaTarifa implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + VigenciaTarifa vigenciaTarifa = (VigenciaTarifa) o; + SimpleDateFormat f = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); + + Listcell lc = new Listcell(vigenciaTarifa.getVigenciatarifaId().toString()); + lc.setParent(lstm); + + if (vigenciaTarifa.getFeciniciovigencia() != null) { + lc = new Listcell(f.format(vigenciaTarifa.getFeciniciovigencia())); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (vigenciaTarifa.getFecfinvigencia() != null) { + lc = new Listcell(f.format(vigenciaTarifa.getFecfinvigencia())); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", vigenciaTarifa); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderVigenciaTarifaModificacionMassivaTarifa.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderVigenciaTarifaModificacionMassivaTarifa.java new file mode 100644 index 000000000..84129aa76 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/render/RenderVigenciaTarifaModificacionMassivaTarifa.java @@ -0,0 +1,42 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.rjconsultores.ventaboletos.web.utilerias.render; + +import com.rjconsultores.ventaboletos.entidad.VigenciaTarifa; +import java.text.SimpleDateFormat; +import org.zkoss.zul.Listcell; +import org.zkoss.zul.Listitem; +import org.zkoss.zul.ListitemRenderer; + +/** + * + * @author Administrador + */ +public class RenderVigenciaTarifaModificacionMassivaTarifa implements ListitemRenderer { + + public void render(Listitem lstm, Object o) throws Exception { + VigenciaTarifa vigenciaTarifa = (VigenciaTarifa) o; + SimpleDateFormat f = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); + + Listcell lc = new Listcell(vigenciaTarifa.getVigenciatarifaId().toString()); + lc.setParent(lstm); + + if (vigenciaTarifa.getFeciniciovigencia() != null) { + lc = new Listcell(f.format(vigenciaTarifa.getFeciniciovigencia())); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + if (vigenciaTarifa.getFecfinvigencia() != null) { + lc = new Listcell(f.format(vigenciaTarifa.getFecfinvigencia())); + } else { + lc = new Listcell(""); + } + lc.setParent(lstm); + + lstm.setAttribute("data", vigenciaTarifa); + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/servlet/ImageServlet.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/servlet/ImageServlet.java new file mode 100644 index 000000000..e16a0cc45 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/servlet/ImageServlet.java @@ -0,0 +1,59 @@ +package com.rjconsultores.ventaboletos.web.utilerias.servlet; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.core.io.ClassPathResource; + +/** + * Servlet implementation class ImageServlet + */ +public class ImageServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + private static final String PATH_IMAGENES = "/com/rjconsultores/ventaboletos/web/cliente/imagenes/"; + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse resp) throws ServletException, IOException { + // Set content type + resp.setContentType("image/png"); + + String imagene = request.getParameter("imagene"); + if (imagene != null) { + // Open the file and output streams + InputStream in = getImagene(imagene); + OutputStream out = resp.getOutputStream(); + + // Copy the contents of the file to the output stream + byte[] buf = new byte[1024]; + int count = 0; + while ((count = in.read(buf)) >= 0) { + out.write(buf, 0, count); + } + in.close(); + out.close(); + } + } + + private InputStream getImagene(String imagene) { + InputStream inputStream = null; + try { + inputStream = new ClassPathResource(PATH_IMAGENES + imagene).getInputStream(); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return inputStream; + } + +} diff --git a/src/java/log4j_original.xml b/src/java/log4j_original.xml new file mode 100644 index 000000000..c7de4c865 --- /dev/null +++ b/src/java/log4j_original.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/spring-config.xml b/src/java/spring-config.xml new file mode 100644 index 000000000..ea4afbd53 --- /dev/null +++ b/src/java/spring-config.xml @@ -0,0 +1,296 @@ + + + + + + + + + + + + + + + + com.rjconsultores.ventaboletos.entidad.AlertaCtrl + com.rjconsultores.ventaboletos.entidad.Autobus + com.rjconsultores.ventaboletos.entidad.Autorizacion + com.rjconsultores.ventaboletos.entidad.AutorizacionPerfil + + com.rjconsultores.ventaboletos.entidad.Articulo + com.rjconsultores.ventaboletos.entidad.AsientoExclusivo + + com.rjconsultores.ventaboletos.entidad.Banco + com.rjconsultores.ventaboletos.entidad.CancelacionCtrl + + com.rjconsultores.ventaboletos.entidad.CancelacionCargo + com.rjconsultores.ventaboletos.entidad.Categoria + com.rjconsultores.ventaboletos.entidad.CategoriaClase + com.rjconsultores.ventaboletos.entidad.CategoriaCorrida + com.rjconsultores.ventaboletos.entidad.CategoriaCtrl + com.rjconsultores.ventaboletos.entidad.CategoriaDescuento + com.rjconsultores.ventaboletos.entidad.CategoriaMarca + com.rjconsultores.ventaboletos.entidad.CategoriaMercado + com.rjconsultores.ventaboletos.entidad.CategoriaPeriodo + com.rjconsultores.ventaboletos.entidad.CategoriaTipoPtoVta + com.rjconsultores.ventaboletos.entidad.Ciudad + com.rjconsultores.ventaboletos.entidad.Colonia + com.rjconsultores.ventaboletos.entidad.ClaseServicio + com.rjconsultores.ventaboletos.entidad.ClaseservicioEquivalencia + + com.rjconsultores.ventaboletos.entidad.ComisionistaExterno + + com.rjconsultores.ventaboletos.entidad.CompaniaBancaria + + com.rjconsultores.ventaboletos.entidad.Conductor + com.rjconsultores.ventaboletos.entidad.ConfigRestriccionPago + + com.rjconsultores.ventaboletos.entidad.Convenio + com.rjconsultores.ventaboletos.entidad.ConvenioDet + com.rjconsultores.ventaboletos.entidad.Constante + com.rjconsultores.ventaboletos.entidad.Corrida + com.rjconsultores.ventaboletos.entidad.CorridaCtrl + com.rjconsultores.ventaboletos.entidad.CorridaTramo + com.rjconsultores.ventaboletos.entidad.Cortesia + com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario + + com.rjconsultores.ventaboletos.entidad.CortesiaDireccion + + com.rjconsultores.ventaboletos.entidad.CuponConvenio + com.rjconsultores.ventaboletos.entidad.CuponSecretaria + + com.rjconsultores.ventaboletos.entidad.DetDiagramaAutobus + + com.rjconsultores.ventaboletos.entidad.DepositoBancario + + com.rjconsultores.ventaboletos.entidad.DiagramaAutobus + + com.rjconsultores.ventaboletos.entidad.Division + com.rjconsultores.ventaboletos.entidad.Empleado + com.rjconsultores.ventaboletos.entidad.Empresa + com.rjconsultores.ventaboletos.entidad.EmpresaEquivalencia + + com.rjconsultores.ventaboletos.entidad.Estacion + com.rjconsultores.ventaboletos.entidad.Estado + com.rjconsultores.ventaboletos.entidad.EsquemaAsiento + com.rjconsultores.ventaboletos.entidad.EsquemaCorrida + com.rjconsultores.ventaboletos.entidad.EsquemaOperacional + + com.rjconsultores.ventaboletos.entidad.EsquemaTramo + com.rjconsultores.ventaboletos.entidad.Estado + com.rjconsultores.ventaboletos.entidad.ExcepcionRedondo + + com.rjconsultores.ventaboletos.entidad.FormaPago + com.rjconsultores.ventaboletos.entidad.FormaPagoDet + com.rjconsultores.ventaboletos.entidad.GrupoCortesia + com.rjconsultores.ventaboletos.entidad.FuncionSistema + com.rjconsultores.ventaboletos.entidad.Marca + com.rjconsultores.ventaboletos.entidad.MercadoCompetido + + com.rjconsultores.ventaboletos.entidad.MerchantBancario + + com.rjconsultores.ventaboletos.entidad.Moneda + com.rjconsultores.ventaboletos.entidad.MarcaClaseServicio + + com.rjconsultores.ventaboletos.entidad.MotivoCancelacion + + com.rjconsultores.ventaboletos.entidad.MotivocancelacionEquivalencia + + com.rjconsultores.ventaboletos.entidad.MotivoReimpresion + + com.rjconsultores.ventaboletos.entidad.MotivoViaje + com.rjconsultores.ventaboletos.entidad.Nodo + com.rjconsultores.ventaboletos.entidad.Pais + com.rjconsultores.ventaboletos.entidad.Parada + com.rjconsultores.ventaboletos.entidad.ParadaEquivalencia + + com.rjconsultores.ventaboletos.entidad.ParamAcumulaMasivo + + com.rjconsultores.ventaboletos.entidad.ParamAcumulaPunto + + com.rjconsultores.ventaboletos.entidad.ParamCanjePunto + + com.rjconsultores.ventaboletos.entidad.ParamCostoTarjeta + + com.rjconsultores.ventaboletos.entidad.ParamCompraPunto + + com.rjconsultores.ventaboletos.entidad.ParamRecoleccion + + com.rjconsultores.ventaboletos.entidad.Perfil + com.rjconsultores.ventaboletos.entidad.PerfilFuncion + com.rjconsultores.ventaboletos.entidad.PeriodoVacacional + com.rjconsultores.ventaboletos.entidad.Plaza + com.rjconsultores.ventaboletos.entidad.Pricing + com.rjconsultores.ventaboletos.entidad.PricingAnticipacion + com.rjconsultores.ventaboletos.entidad.PricingImporte + com.rjconsultores.ventaboletos.entidad.PricingVigencia + com.rjconsultores.ventaboletos.entidad.PricingClase + com.rjconsultores.ventaboletos.entidad.PricingMarca + com.rjconsultores.ventaboletos.entidad.PricingMercado + com.rjconsultores.ventaboletos.entidad.PricingDia + com.rjconsultores.ventaboletos.entidad.PricingCorrida + com.rjconsultores.ventaboletos.entidad.PricingPuntoVenta + com.rjconsultores.ventaboletos.entidad.PricingCategoria + com.rjconsultores.ventaboletos.entidad.PricingTipoPtoVta + com.rjconsultores.ventaboletos.entidad.PricingTipoServicio + com.rjconsultores.ventaboletos.entidad.PricingAsiento + com.rjconsultores.ventaboletos.entidad.PricingOcupacion + + com.rjconsultores.ventaboletos.entidad.PricingEspecifico + + com.rjconsultores.ventaboletos.entidad.PricingRuta + com.rjconsultores.ventaboletos.entidad.ProductoServicio + + + com.rjconsultores.ventaboletos.entidad.ProdClaseServicio + + com.rjconsultores.ventaboletos.entidad.ProdFormaPago + com.rjconsultores.ventaboletos.entidad.ProdMarca + com.rjconsultores.ventaboletos.entidad.ProdPrecio + com.rjconsultores.ventaboletos.entidad.ProdMercado + com.rjconsultores.ventaboletos.entidad.ProdPuntoVenta + com.rjconsultores.ventaboletos.entidad.ProdRuta + com.rjconsultores.ventaboletos.entidad.ProdTipoptovta + com.rjconsultores.ventaboletos.entidad.ProdVigencia + com.rjconsultores.ventaboletos.entidad.ProductoServicio + + com.rjconsultores.ventaboletos.entidad.PtovtaEmpresa + com.rjconsultores.ventaboletos.entidad.PtoVtaUsuarioBancario + + com.rjconsultores.ventaboletos.entidad.PuntoVenta + com.rjconsultores.ventaboletos.entidad.Redondeo + com.rjconsultores.ventaboletos.entidad.RedondeoCtrl + com.rjconsultores.ventaboletos.entidad.RedondeoMarca + com.rjconsultores.ventaboletos.entidad.ReservacionCategoria + + com.rjconsultores.ventaboletos.entidad.ReservacionClase + + com.rjconsultores.ventaboletos.entidad.ReservacionCtrl + + com.rjconsultores.ventaboletos.entidad.ReservacionMarca + + com.rjconsultores.ventaboletos.entidad.ReservacionMercado + + com.rjconsultores.ventaboletos.entidad.ReservacionPuntoVenta + + com.rjconsultores.ventaboletos.entidad.RestriccionPago + + com.rjconsultores.ventaboletos.entidad.RolOperativo + com.rjconsultores.ventaboletos.entidad.Ruta + com.rjconsultores.ventaboletos.entidad.RutaCombinacion + + com.rjconsultores.ventaboletos.entidad.RutaEmpresa + com.rjconsultores.ventaboletos.entidad.RutaSecuencia + com.rjconsultores.ventaboletos.entidad.RhPagoConductor + com.rjconsultores.ventaboletos.entidad.Secretaria + com.rjconsultores.ventaboletos.entidad.Sistema + com.rjconsultores.ventaboletos.entidad.TarjetaFidelidad + + com.rjconsultores.ventaboletos.entidad.TarjetaRecaudacion + + + com.rjconsultores.ventaboletos.entidad.Tarifa + com.rjconsultores.ventaboletos.entidad.TarifaHist + com.rjconsultores.ventaboletos.entidad.TarifaMinima + com.rjconsultores.ventaboletos.entidad.TarifaCategoria + + com.rjconsultores.ventaboletos.entidad.TarifaTipoptovta + + com.rjconsultores.ventaboletos.entidad.TipoConvenio + com.rjconsultores.ventaboletos.entidad.TipoCambioCtrl + com.rjconsultores.ventaboletos.entidad.TipoCambioCiudad + + com.rjconsultores.ventaboletos.entidad.TipoCorte + com.rjconsultores.ventaboletos.entidad.TipoCortesiaDescuento + + com.rjconsultores.ventaboletos.entidad.TipoCortesia + com.rjconsultores.ventaboletos.entidad.TipoDomicilio + com.rjconsultores.ventaboletos.entidad.TipoEmpleado + com.rjconsultores.ventaboletos.entidad.TipoMovimiento + com.rjconsultores.ventaboletos.entidad.TipoOcupacion + com.rjconsultores.ventaboletos.entidad.TipoParada + com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta + com.rjconsultores.ventaboletos.entidad.TipoServicio + com.rjconsultores.ventaboletos.entidad.TipoVenta + com.rjconsultores.ventaboletos.entidad.Tramo + com.rjconsultores.ventaboletos.entidad.TramoServicio + com.rjconsultores.ventaboletos.entidad.TramoKmServicio + + com.rjconsultores.ventaboletos.entidad.TramoTiempo + com.rjconsultores.ventaboletos.entidad.TramoKm + com.rjconsultores.ventaboletos.entidad.Turno + com.rjconsultores.ventaboletos.entidad.Usuario + com.rjconsultores.ventaboletos.entidad.UsuarioBancario + + com.rjconsultores.ventaboletos.entidad.UsuarioPerfil + com.rjconsultores.ventaboletos.entidad.UsuarioUbicacion + + com.rjconsultores.ventaboletos.entidad.Via + com.rjconsultores.ventaboletos.entidad.VigenciaTarifa + com.rjconsultores.ventaboletos.entidad.Zona + + com.rjconsultores.ventaboletos.entidad.ParamArticulo + com.rjconsultores.ventaboletos.entidad.EventoExtra + com.rjconsultores.ventaboletos.entidad.TipoEventoExtra + + com.rjconsultores.ventaboletos.entidad.AjusteEventoExtra + + com.rjconsultores.ventaboletos.entidad.TarjetaViaje + + + + + + ${database.dialect} + + ${database.showSql} + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/web/META-INF/MANIFEST.MF b/web/META-INF/MANIFEST.MF new file mode 100644 index 000000000..a6339dd29 --- /dev/null +++ b/web/META-INF/MANIFEST.MF @@ -0,0 +1,11 @@ +Manifest-Version: 1.0 +Implementation-Vendor: Potix Corporation +Ant-Version: Apache Ant 1.7.1 +Implementation-Title: org.zkoss.zkapp +Implementation-Version: 5.0.0 +Specification-Vendor: Potix Corporation +Specification-Title: ZK App +Created-By: 10.0-b23 (Sun Microsystems Inc.) +Implementation-URL: http://www.zkoss.org/ +Specification-Version: 5.0.0 + diff --git a/web/META-INF/context.xml b/web/META-INF/context.xml new file mode 100644 index 000000000..8def43c8a --- /dev/null +++ b/web/META-INF/context.xml @@ -0,0 +1,2 @@ + + diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label new file mode 100644 index 000000000..591b85977 --- /dev/null +++ b/web/WEB-INF/i3-label_es_MX.label @@ -0,0 +1,3492 @@ +# V. 1.4 +# Para cambiar esta plantilla, seleccione Herramientas | Plantillas +# Y abrir la plantilla en el editor. + +# Formato de la clav +# Control ZUL. Identificación del Componente. Propiedad = XXX +# . . = XXX + +#Versao do VentaBoleto: +versao = ADM_20120622_1RC37 + +# MSG Defaut: +MSG.CONSTRAINT.PORCENTAGEM = Los valores deben estar entre 0 y 100 +MSG.CONSTRAINT.DECIMALBOX = Los valores deben estar entre 0 y 9999999 +MSG.CONSTRAINT.CONSTRAINTNUMBERBD = El valor debe tener el tamaño de {0} digitos más {1} decimales. +MSG.CONSTRAINT.CONSTRAINTNUMBERBDOBLIGATORIO = Los valores son obligatorios +MSG.CONSTRAINT.MACConstraint = La MAC informada no es valida +MSG.SI = Si +MSG.NO = No +MSG.VALIDA = Valida +MSG.NO.VALIDA = No Valida +MSG.ningunRegistro = No se encontró ningún registro con esa búsqueda. +MSG.Registro.Existe = Ya existe un registro con estos datos. +MSG.Registro.Existe.Origem.Destino.Via = Ya existe un registro con estos datos de origen, destino, vía. +MSG.Equivalencia.Existe = Ya existe un registro con esta equivalencia. +MSG.Error = Ha ocurrido un error, póngase en contacto con el administrador del sistema. +MSG.Error.Open.Windows = Ha ocurrido un error, póngase en contacto con el administrador del sistema. +MSG.Error.combobox = Valor introducido no existe. +MSG.Error.combobox.origen = Origen no existe. +MSG.Error.combobox.destino = Destino no existe. +MSG.Error.combobox.hacerBusqueda = Debe de hacer la búsqueda en el combo +MSG.Origem.Igual.Destino = Origen igual a Destino. +MSG.IMPRIME.DESCONTO = Descuento convenido +MSG.IMPRIME.PRECO.MENOS.DESCONTO = Precio menos descuento convenido +MSG.IMPRIME.PRECO.TOTAL = Precio Total +MSG.Porcentaje = Porcentaje mayor que 100% +MSG.PRECIO.TOTAL = Precio total +MSG.PRECIO.MENOS.DESCONTO = Precio menos descuento por cobrar +MSG.DESCUENTO.COBRAR = Descuento por cobrar +MSG.SELECCIONE.VALOR.CORRECTO = Seleccione un valor correcto para la búsqueda. +MSG.noEditabled = No se puede borrar o editar estos datos. +MSG.Folios = Folio final es menor o igual a folio inicial. +MSG.emailValido=Informe un correo valido +MSG.necesita.origen = Necesita informar una origen. +MSG.necesita.via = Necesita informar una vía. +MSG.necesita.destino = Necesita informar un destino. +MSG.exception.RegistroConDependenciaException=No se puede eliminar el registro. Hay datos que dependen de él +MSG.necesita.contaContable = Cuenta contable obligatorio +MSG.necesita.tipoEvento = Tipo evento obligatorio +MSG.necesita.formaPago = Forma pago obligatorio + + +# Labels Defaul +lb.id = ID +lb.dec = Descripción +lb.Equivalencia = Equivalencia + +# tooltip botões +tooltiptext.btnFechar = Cerrar +tooltiptext.btnEliminar = Eliminar +tooltiptext.btnActualizar = Actualizar +tooltiptext.btnAgregar = Agregar +tooltiptext.btnGuardar = Guardar + +# Pantalla de inicio de sesión: +winLogin.title = Ingresar +winLogin.lblUsuario = Usuario: +winLogin.lblSenha = Contraseña: +winLogin.btnAcessar = Acceso +winLogin.lblloginIncorreto = Inicio de Sesión Incorrecto. Intentelo de nuevo. + +# Indice de pantalla principal: +indexController.win.title = Venta de entradas +indexController.mnCatalogos.label = Catálogos +indexController.mnConfiguracionesComerciales.label = Configuración Comercial +indexController.mnEsquemaOperacional.label = Esquema Operacional +indexController.mnPricing.label = Pricing +indexController.mnTarifas.label = Tarifas +indexController.mnSendaAmigo.label = Pasajero Frecuente +indexController.mniMarcas.label = Marcas +indexController.mniMoneda.label = Moneda +indexController.mniPlaza.label = Plaza +indexController.mniClaseServicio.label = Tipo de servicio +indexController.mniCorrida.label = Configuración de Corridas +indexController.mniGeracionCorrida.label = Generación de Corrida +indexController.mniFormaPago.label = Forma de Pago +indexController.mniPeriodoVacacional.label = Período vacacional +indexController.mniMotivoCancelacion.label = Motivos de la Cancelación +indexController.mniMotivoReimpresion.label = Motivos de la Reimpresión +indexController.mniCategoria.label = Tipo de Pasajero +indexController.mniPuntoVenta.label = Punto de venta +indexController.mniEmpresa.label = Empresa +indexController.mniTipoServicio.label = Tipo de Corrida +indexController.mniTipoVenta.label = Tipo de Venta +indexController.mniDiagramaAutoBus.label = Diagramas de Autobús +indexController.mniAsociacionClaseServicioMarca.label = Asociación tipo del servicio y marca +indexController.mniTipoPuntoVenta.label = Canal de Venta +indexController.mniRestriccionFormaPago.label = Restricción de Forma pago +indexController.mniConfiguracionCategorias.label = Configuración Tipo de Pasajero +indexController.mniConfiguracionFormaPago.label = Configuración de Forma pago +indexController.mniConfiguracionGeneral.label = Configuración General +indexController.mniConfiguracionReservacion.label = Configuración de Reservación +indexController.mniConfiguracionCancelacion.label = Configuración de Cancelación +indexController.mniEsquemaOperacionalParadas.label = Paradas +indexController.mniEsquemaOperacionalRuta.label = Ruta +indexController.mniTramo.label = Tramo +indexController.mniTramoKmServicio.label = Tramo Km Servicio +indexController.mniVia.label = Vía +indexController.toolBar.tooltiptext = Cerrar +indexController.mnVentaBoletos.label = Comisionistas +indexController.mniVentaBoletosViajeTDO.label = Venta Boletos +indexController.mniTarifasMinimas.label = Tarifas Mínimas +indexController.mniTarifas.label = Tarifas +indexController.mniVigenciaTarifa.label = Vigencia Tarifas +indexController.mniTarifasEscala.label = Tarifa Escala +indexController.mniMercadoCompetido.label = Mercado Competido +indexController.mniAcumulacionPorVenta.label = Configuración Acumulación por venta +indexController.mniCanjePuntos.label = Configuración para Canje de puntos +indexController.mniParamAcumulacionMasivo.label = Configuración Acumulación Masiva +indexController.mniParamCompraPunto.label = Configuración Compra de puntos +indexController.mniParamCostoTarjeta.label = Configuración costo tarjeta +indexController.mniModificacionMasiva.label = Modificación Masiva de Tarifas +indexController.mniCambioVigencia.label = Cambio de Vigencia +indexController.mnAjuda.label = Ayuda +indexController.mniVersion.label = Versión +indexController.mniPricing.label = Pricing +indexController.mniConfiguracionServicio.label = Configuración de Producto o Servicio +indexController.mniPricingEspecifico.label = Pricing Específico +indexController.mnSeguridad.label = Seguridad +indexController.mniPerfil.label = Perfil +indexController.mniPermisos.label = Permiso +indexController.mniMenus.label = Menu +indexController.mniSistema.label = Sitema +indexController.mniUsuario.label = Usuario +indexController.mniUbicacionUsuario.label = Ubicación del Usuario +indexController.mniTipoParadas.label = Tipo Parada +indexController.mniAutobus.label = Autobús +indexController.mniAutorizacion.label = Autorización +indexController.mniAutorizacionPerfil.label = Autorización Perfil +indexController.mniEstacion.label = Estación +indexController.mniExcepcionRedondo.label = Excepción Viaje Redondo +indexController.mniRedondeo.label = Reglas de Redondeo +indexController.mniRedondeoMarca.label = Redondeo Marca +indexController.mniComisionistaExterno.label = Comisionista Externo +indexController.mniConvenio.label = Convenio +indexController.mniConfiguracionAlerta.label = Configuración Alertas +indexController.mniSecretaria.label = Secretaría +indexController.mniCiudad.label = Ciudad +indexController.mniColonia.label = Colonia +indexController.mniArticulo.label = Artículo +indexController.mniTipoCorte.label = Tipo de Corte de Turno +indexController.mniTurno.label = Turno +indexController.mniTipoMovimiento.label = Tipo Movimiento +indexController.mniTipoOcupacion.label = Tipo Ocupación +indexController.mniTipoDomicilio.label = Tipo Domicilio +indexController.mniTipoCambioCiudad.label = Tipo Cambio Ciudad +indexController.mniEstado.label = Estado +indexController.mnEquivalencia.label = Equivalencia +indexController.mniParadaEquivalencia.label = Equivalencia Parada +indexController.mniTramoSecuencia.label = Tramo en Secuencia +indexController.mniEmpresaEquivalencia.label = Equivalencia Empresa +indexController.mniClaseservicioEquivalencia.label = Equivalencia Tipo Servicio +indexController.mniMotivocancelacionEquivalencia.label = Equivalencia Motivo Cancelación +indexController.mniPais.label = País +indexController.mnInformes.label = Informes +indexController.mniPassageirosServico.label = Pasajeros por Corrida +indexController.mniServicioDiario.label = Corrida Diária +indexController.mniCategoriaVenta.label = Categoria Venta +indexController.mniVentasPuntoVenta.label = Ventas Punto de Venta +indexController.mniCompaniaBancaria.label = Compañia Bancaria +indexController.mnRecaudacion.label = Recaudación +indexController.mniBuscaTarjetas.label = Tarjetas de Viajes +indexController.mniInicioTurnoRecaudacion.label = Inicio Turno Recaudacion +indexController.mniCorteTurnoRecaudacion.label = Corte Turno +indexController.mniGeneracionAutomaticaTramosRutas = Generación Tramos y Rutas +indexController.mn.ingresosExtras = Eventos Extras +indexController.mni.catalogoIngreso = Tipo de Eventos +indexController.mni.bancos = Bancos +indexController.mniPagoConductor.label = Pago Condutor +indexController.mniActualizarTablaTarjetas.label = Atualizar Cartao de Viagem +indexController.mniMantenimientoMovimientos.label = Manutencao de Movimientos +indexController.mniEnvioNomina.label = Envio a Nomina +indexController.mniPtovtaEmpresa.label = Punto Venta Empresa + +#PARTE REALIZADA POR MANUEL +indexController.mnCortesias.label = Cortesías +indexController.mniTipoCortesiaD.label = Descuento por tipo de Cortesía +indexController.mniGrupoCortesias.label = Grupo cortesías +indexController.mniAltaCortesiaRH.label = Alta cortesía por RH +indexController.mniTipoCortesia.label = Tipo cortesía +indexController.mniCortesiaTD.label = Cortesía de tipo dirección +indexController.mniRolOperativo.label = Rol operativo +indexController.mniGeneracionTarjetaSA.label = Generacion tarjeta senda amigo +indexController.mniProductoServicio.label = Producto o Servicio +indexController.mniTipoConvenio.label = Tipo convenio +indexController.mniCuponConvenio.label = Cupon convenio + +# Muestra la Búsqueda Tipo Servicio +busquedaClaseServicioController.window.title = Tipo de servicio +busquedaClaseServicioController.btnRefresh.tooltiptext = Actualizar +busquedaClaseServicioController.btnNovo.tooltiptext = Agregar +busquedaClaseServicioController.btnCerrar.tooltiptext = Cerrar +busquedaClaseServicioController.btnPesquisa.label = Búsqueda +busquedaClaseServicioController.lhDesc.label = Descripción +busquedaClaseServicioController.lhId.label = ID + +# Pantalla Clase Editar Servicio +editarClaseServicioController.window.title = Tipo de servicio +editarClaseServicioController.btnApagar.tooltiptext = Eliminar +editarClaseServicioController.btnSalvar.tooltiptext = Guardar +editarClaseServicioController.btnFechar.tooltiptext = Cerrar +editarClaseServicioController.lbNome.value = Tipo de servicio +editarClaseServicioController.MSG.suscribirOK = Tipo de servicio se registró exitosamente. +editarClaseServicioController.MSG.borrarPergunta = ¿Desea eliminar tipo de servicio? +editarClaseServicioController.MSG.borrarOK = Tipo de servicio se eliminó exitosamente. + +# Muestra el formulario de Búsqueda de Pago +busquedaFormaPagoController.window.title = Forma de pago +busquedaFormaPagoController.btnRefresh.tooltiptext = Actualizar +busquedaFormaPagoController.btnNovo.tooltiptext = Agregar +busquedaFormaPagoController.btnCerrar.tooltiptext = Cerrar +busquedaFormaPagoController.btnPesquisa.label = Búsqueda +busquedaFormaPagoController.txtNome.label = Forma de pago +busquedaFormaPagoController.lhDesc.label = Descripción +busquedaFormaPagoController.lhId.label = ID + +# Pantalla Editar Forma de Pago +editarFormaPagoController.window.title = Forma de pago +editarFormaPagoController.btnApagar.tooltiptext = Eliminar +editarFormaPagoController.btnSalvar.tooltiptext = Guardar +editarFormaPagoController.btnFechar.tooltiptext = Cerrar +editarFormaPagoController.lbNome.value = Forma de pago +editarFormaPagoController.lbOperacion.value = Operación +editarFormaPagoController.lbOperacion1.value = Vendido / Impreso +editarFormaPagoController.lbOperacion2.value = Reexpedido +editarFormaPagoController.lbOperacion3.value = Reimpreso +editarFormaPagoController.lbOperacion4.value = N/A +editarFormaPagoController.MSG.suscribirOK = Forma de pago se registró exitosamente. +editarFormaPagoController.MSG.borrarPergunta = ¿Desea eliminar forma de pago? +editarFormaPagoController.MSG.borrarOK = Forma de pago se eliminó exitosamente. +editarFormaPagoController.MSG.existe.registro= Ya existe un registro con estos datos. + +# Muestra el tipo de Búsqueda Punto Venta +busquedaTipoPuntoVentaController.window.title = Canal de venta +busquedaTipoPuntoVentaController.btnRefresh.tooltiptext = Actualizar +busquedaTipoPuntoVentaController.btnNovo.tooltiptext = Agregar +busquedaTipoPuntoVentaController.btnCerrar.tooltiptext = Cerrar +busquedaTipoPuntoVentaController.btnPesquisa.label = Búsqueda +busquedaTipoPuntoVentaController.lhDesc.label = Descripción +busquedaTipoPuntoVentaController.txtNome.label = Canal de Venta +busquedaTipoPuntoVentaController.lhID.label = ID + +# Editar Tipo de Pantalla Punto Venta +editarTipoPuntoVentaController.window.title = Canal de venta +editarTipoPuntoVentaController.btnApagar.tooltiptext = Eliminar +editarTipoPuntoVentaController.btnSalvar.tooltiptext = Guardar +editarTipoPuntoVentaController.btnFechar.tooltiptext = Cerrar +editarTipoPuntoVentaController.lbNome.value = Canal de venta +editarTipoPuntoVentaController.MSG.suscribirOK = Canal de venta se registró exitosamente. +editarTipoPuntoVentaController.MSG.borrarPergunta = ¿Desea eliminar el canal de venta? +editarTipoPuntoVentaController.MSG.borrarOK = Canal de venta se eliminó exitosamente. +lbEquivalencia.value = Equivalencia + +# Muestra el formulario de Búsqueda Restricción de Pago +busquedaRestriccionFormaPagoController.window.title = Restricción de forma de pago +busquedaRestriccionFormaPagoController.FormaPago = Forma de pago +busquedaRestriccionFormaPagoController.btnRefresh.tooltiptext = Actualizar +busquedaRestriccionFormaPagoController.btnNovo.tooltiptext = Agregar +busquedaRestriccionFormaPagoController.btnCerrar.tooltiptext = Cerrar +busquedaRestriccionFormaPagoController.btnPesquisa.label = Búsqueda +busquedaRestriccionFormaPagoController.lhId.label = ID +busquedaRestriccionFormaPagoController.lhForma.label = Descripción +busquedaRestriccionFormaPagoController.lhDesc.label = Restricción + +# Pantalla Editar formulario de Restricción de Pago +editarRestriccionFormaPagoController.window.title = Restricción de forma de pago +editarRestriccionFormaPagoController.btnApagar.tooltiptext = Eliminar +editarRestriccionFormaPagoController.btnSalvar.tooltiptext = Guardar +editarRestriccionFormaPagoController.btnFechar.tooltiptext = Cerrar +editarRestriccionFormaPagoController.lblFormaPago.value = Restricción de forma de pago +editarRestriccionFormaPagoController.lblRestricionFormaPago.value = Restricción de forma de pago +editarRestriccionFormaPagoController.MSG.suscribirOK = Restricción de forma de pago se registró exitosamente. +editarRestriccionFormaPagoController.MSG.borrarPergunta = ¿Desea eliminar restricción de forma de pago? +editarRestriccionFormaPagoController.MSG.borrarOK = Restricción de forma de pago se eliminó exitosamente. +editarRestriccionFormaPagoController.MSG.puedoDarDeAlta = La forma de pago {0} ya existe. + +# Muestra el Período vacacional Búsqueda +busquedaPeriodoVacacionalController.window.title = Período vacacional +busquedaPeriodoVacacionalController.btnRefresh.tooltiptext = Actualizar +busquedaPeriodoVacacionalController.btnNovo.tooltiptext = Agregar +busquedaPeriodoVacacionalController.btnCerrar.tooltiptext = Cerrar +busquedaPeriodoVacacionalController.btnPesquisa.label = Búsqueda +busquedaPeriodoVacacionalController.lhId.label = ID +busquedaPeriodoVacacionalController.lhFecinicio.label = Período Inicial +busquedaPeriodoVacacionalController.lhFecfinal.label = Período Final + +# Pantalla Editar Período vacacional +editarPeriodoVacacionalController.window.title = Período Vacacional +editarPeriodoVacacionalController.btnApagar.tooltiptext = Eliminar +editarPeriodoVacacionalController.btnSalvar.tooltiptext = Guardar +editarPeriodoVacacionalController.btnFechar.tooltiptext = Cerrar +editarPeriodoVacacionalController.lbNome.value = Período vacacional +editarPeriodoVacacionalController.lbFecInicio.value = Período Inicial +editarPeriodoVacacionalController.lbFecFinal.value = Período Final +editarPeriodoVacacionalController.MSG.suscribirOK = Período de vacaciones se registró exitosamente. +editarPeriodoVacacionalController.MSG.borrarPergunta = ¿Desea eliminar el período de vacaciones? +editarPeriodoVacacionalController.MSG.borrarOK = Período de vacaciones se eliminó exitosamente. +editarPeriodoVacacionalController.MSG.busquedaPeriodo = Fecha de inicio posterior a la fecha final. +editarPeriodoVacacionalController.MSG.busquedaNull = Fecha final esta en blanco. +editarPeriodoVacacionalController.MSG.conflitoVigencias = La vigencia informada se traslapa con otra ya existente. + + +# Muestra la CANCELACION de la Búsqueda Razón +busquedaMotivoCancelacionController.window.title = Motivo de la Cancelación +busquedaMotivoCancelacionController.btnRefresh.tooltiptext = Actualizar +busquedaMotivoCancelacionController.btnNovo.tooltiptext = Agregar +busquedaMotivoCancelacionController.btnCerrar.tooltiptext = Cerrar +busquedaMotivoCancelacionController.btnPesquisa.label = Búsqueda +busquedaMotivoCancelacionController.lhId.label = ID +busquedaMotivoCancelacionController.lhDesc.label = Descripción +busquedaMotivoCancelacionController.txtNombre.label = Motivo de Cancelación + +# Pantalla Editar CANCELACION Razón +editarMotivoCancelacionController.window.title = Motivo de Cancelación +editarMotivoCancelacionController.btnApagar.tooltiptext = Eliminar +editarMotivoCancelacionController.btnSalvar.tooltiptext = Guardar +editarMotivoCancelacionController.btnFechar.tooltiptext = Cerrar +editarMotivoCancelacionController.lbNome.value = Descripción +editarMotivoCancelacionController.MSG.suscribirOK = Motivo de la cancelación se registró exitosamente. +editarMotivoCancelacionController.MSG.borrarPergunta = ¿Desea eliminar este motivo de cancelación? +editarMotivoCancelacionController.MSG.borrarOK = Motivo de la cancelación se eliminó exitosamente. +editarMotivoCancelacionController.lbtipomotivo.value = Tipo motivo +editarMotivoCancelacionController.MSG.tipo = Necesita informar un tipo motivo. + +# Muestra la Reimpresión de la Búsqueda Razón +busquedaMotivoReimpresionController.window.title = Motivos de la reimpresión +busquedaMotivoReimpresionController.btnRefresh.tooltiptext = Actualizar +busquedaMotivoReimpresionController.btnNovo.tooltiptext = Agregar +busquedaMotivoReimpresionController.btnCerrar.tooltiptext = Cerrar +busquedaMotivoReimpresionController.btnPesquisa.label = Búsqueda +busquedaMotivoReimpresionController.lhId.label = ID +busquedaMotivoReimpresionController.lhDesc.label = Descripción +busquedaMotivoReimpresionController.txtNombre.label = Motivo Reimpresion + +# Pantalla Editar Reimpresión Razón +editarMotivoReimpresionController.window.title = Motivos de la reimpresión +editarMotivoReimpresionController.btnApagar.tooltiptext = Eliminar +editarMotivoReimpresionController.btnSalvar.tooltiptext = Guardar +editarMotivoReimpresionController.btnFechar.tooltiptext = Cerrar +editarMotivoReimpresionController.lbNome.value = Motivos de la reimpresión +editarMotivoReimpresionController.MSG.suscribirOK = Motivo de reimpresión se registró exitosamente. +editarMotivoReimpresionController.MSG.borrarPergunta = ¿Desea eliminar este motivo de reimpresión? +editarMotivoReimpresionController.MSG.borrarOK = Motivo de reimpresión se eliminó exitosamente. + +# Muestra la Búsqueda por categoría +busquedaCategoriaController.window.title = Tipo de pasajero +busquedaCategoriaController.btnRefresh.tooltiptext = Actualizar +busquedaCategoriaController.btnNovo.tooltiptext = Agregar +busquedaCategoriaController.btnCerrar.tooltiptext = Cerrar +busquedaCategoriaController.btnPesquisa.label = Búsqueda +busquedaCategoriaController.lhId.label = ID +busquedaCategoriaController.lhDesc.label = Descripción +busquedaCategoriaController.txtNombre.label = Tipo Pasajero + +# Pantalla Editar Categoría +editarCategoriaController.window.title = Tipo de pasajero +editarCategoriaController.btnApagar.tooltiptext = Eliminar +editarCategoriaController.btnSalvar.tooltiptext = Guardar +editarCategoriaController.btnFechar.tooltiptext = Cerrar +editarCategoriaController.lbNome.value = Descripción +editarCategoriaController.MSG.suscribirOK = Tipo de Pasajero se registró exitosamente. +editarCategoriaController.MSG.borrarPergunta = ¿Desea eliminar este tipo de pasajero? +editarCategoriaController.MSG.borrarOK = Tipo de pasajero se eliminó exitosamente. +editarCategoriaController.MSG.tiempo = Tiempo mínimo mayor que tiempo máximo + +# Muestra la Moneda de la Búsqueda +busquedaMonedaController.window.title = Moneda +busquedaMonedaController.btnRefresh.tooltiptext = Actualizar +busquedaMonedaController.btnNovo.tooltiptext = Agregar +busquedaMonedaController.btnCerrar.tooltiptext = Cerrar +busquedaMonedaController.btnPesquisa.label = Búsqueda +busquedaMonedaController.lhId.label = ID +busquedaMonedaController.lhDesc.label = Descripción +busquedaMonedaController.txtNombre.label = Moneda + +# Pantalla Editar Moneda +editarMonedaController.window.title = Moneda +editarMonedaController.btnApagar.tooltiptext = Eliminar +editarMonedaController.btnSalvar.tooltiptext = Guardar +editarMonedaController.btnFechar.tooltiptext = Cerrar +editarMonedaController.lbNome.value = Moneda +editarMonedaController.MSG.suscribirOK = Moneda se registró exitosamente. +editarMonedaController.MSG.borrarPergunta = ¿Desea eliminar esta moneda? +editarMonedaController.MSG.borrarOK = Moneda se eliminó exitosamente. + +# Muestra la País de la Búsqueda +busquedaPaisController.window.title = País +busquedaPaisController.btnRefresh.tooltiptext = Actualizar +busquedaPaisController.btnNovo.tooltiptext = Agregar +busquedaPaisController.btnCerrar.tooltiptext = Cerrar +busquedaPaisController.btnPesquisa.label = Búsqueda +busquedaPaisController.lhId.label = ID +busquedaPaisController.lhDesc.label = Descripción +busquedaPaisController.txtNombre.label = País + +# Pantalla Editar País +editarPaisController.window.title = País +editarPaisController.btnApagar.tooltiptext = Eliminar +editarPaisController.btnSalvar.tooltiptext = Guardar +editarPaisController.btnFechar.tooltiptext = Cerrar +editarPaisController.lbNome.value = País +editarPaisController.MSG.suscribirOK = País se registró exitosamente. +editarPaisController.MSG.borrarPergunta = ¿Desea eliminar este País? +editarPaisController.MSG.borrarOK = País se eliminó exitosamente. + +# Pantalla de la Sociedad de la Búsqueda +busquedaEmpresaController.window.title = Empresa +busquedaEmpresaController.btnRefresh.tooltiptext = Actualizar +busquedaEmpresaController.btnNovo.tooltiptext = Agregar +busquedaEmpresaController.btnCerrar.tooltiptext = Cerrar +busquedaEmpresaController.btnPesquisa.label = Búsqueda +busquedaEmpresaController.lhId.label = ID +busquedaEmpresaController.lhDesc.label = Descripción +busquedaEmpresaController.txtNombre.label = Empresa + +# Pantalla de Edición de la empresa +editarEmpresaController.window.title = Empresa +editarEmpresaController.btnApagar.tooltiptext = Eliminar +editarEmpresaController.btnSalvar.tooltiptext = Guardar +editarEmpresaController.btnFechar.tooltiptext = Cerrar +editarEmpresaController.lbNome.value = Descripción +editarEmpresaController.lbActivo.value = Activo +editarEmpresaController.MSG.suscribirOK = La empresa se registró exitosamente. +editarEmpresaController.MSG.borrarPergunta = ¿Desea eliminar esta empresa? +editarEmpresaController.MSG.borrarOK = Empresa se eliminó exitosamente. +editarEmpresaController.externa.label = Externa +editarEmpresaController.pagoConductor.label = Pago Conductor +editarEmpresaController.IndTipo.1 = AUTOTRANSPORTES +editarEmpresaController.IndTipo.2 = PRODUCTOS Y SERVICIOS +editarEmpresaController.IndTipo.3 = TELEFONICA +editarEmpresaController.IndTipo.label = Tipo +editarEmpresaController.equivalenciaElektraId.label = Equivalencia Elektra +editarEmpresaController.rfc.label = RFC + +# Muestra el punto de Búsqueda de Venta +busquedaPuntoVentaController.window.title = Punto de venta +busquedaPuntoVentaController.btnRefresh.tooltiptext = Actualizar +busquedaPuntoVentaController.btnNovo.tooltiptext = Agregar +busquedaPuntoVentaController.btnCerrar.tooltiptext = Cerrar +busquedaPuntoVentaController.btnPesquisa.label = Búsqueda +busquedaPuntoVentaController.lhId.label = ID +busquedaPuntoVentaController.lhDesc.label = Descripción + +# Editar el punto de la pantalla de Venta +editarPuntoVentaController.window.title = Punto de venta +editarPuntoVentaController.btnApagar.tooltiptext = Eliminar +editarPuntoVentaController.btnSalvar.tooltiptext = Guardar +editarPuntoVentaController.btnFechar.tooltiptext = Cerrar +editarPuntoVentaController.lbNome.value = Punto de venta +editarPuntoVentaController.lbActivo.value = Activo +editarPuntoVentaController.lbCalle.value = Calle +editarPuntoVentaController.lbNumero.value = Número +editarPuntoVentaController.lbDescCorreo.value = Descripción Correo +editarPuntoVentaController.lbColonia.value = Colonia +editarPuntoVentaController.lbCodPostal.value = CP +editarPuntoVentaController.lbStaAprobacion.value = Aprobación +editarPuntoVentaController.lbComentarios.value = Comentarios +editarPuntoVentaController.lbdscUsuarioInternet.value = Usuario Internet +editarPuntoVentaController.lbdscContrasenaInternet.value = Contraseña Internet +editarPuntoVentaController.lbPoblacion.value = Población +editarPuntoVentaController.lbMunicipio.value = Municipio +editarPuntoVentaController.lbEstado.value = Estado +editarPuntoVentaController.lbTelefonoUno.value = Teléfono 1 +editarPuntoVentaController.lbTelefonoDos.value = Teléfono 2 +editarPuntoVentaController.lbNumEdirecion.value = Dirección +editarPuntoVentaController.lbIndDatosTarjeta.value = Pasa de datos +editarPuntoVentaController.lbNodo.value = Nodo +editarPuntoVentaController.lbEmpresa.value = Empresa +editarPuntoVentaController.lbparada.value = Parada +editarPuntoVentaController.lbTpoPtoVta.value = Canal de Venta +editarPuntoVentaController.lbMoneda.value = Moneda +editarPuntoVentaController.lbCiudad.value = Ciudad +editarPuntoVentaController.lblInicial.value = Inicial +editarPuntoVentaController.lblAdicional.value = Adicional +editarPuntoVentaController.RadSi.value.value = Si +editarPuntoVentaController.RadNo.value = No +editarPuntoVentaController.MSG.suscribirOK = Punto de venta se registró exitosamente. +editarPuntoVentaController.MSG.empresa = Necesita informar una empresa +editarPuntoVentaController.MSG.punto = Necesita informar un punto de venta +editarPuntoVentaController.MSG.moneda = Necesita informar una moneda +editarPuntoVentaController.MSG.nodo = Necesita informar un nodo +editarPuntoVentaController.MSG.ciudad = Necesita informar una ciudad +editarPuntoVentaController.MSG.formaDePago = Necesita informar una forma de pago +editarPuntoVentaController.MSG.borrarPergunta = ¿Desea eliminar este punto de venta? +editarPuntoVentaController.MSG.borrarOK = Punto de venta se eliminó exitosamente. +editarPuntoVentaController.MSG.Achou.FormaPago = Forma pago ya está registrada. +editarPuntoVentaController.MSG.Achou.ParamRecoleccion = Param Recoleccion ya está registrada. +editarPuntoVentaController.MSG.Achou.PtovtaEmpresa = Empresas para venta ya está registrada. +editarPuntoVentaController.MSG.Achou.PtovtaUsuario = Empresa ya está registrado. +editarPuntoVentaController.tab.label.endereco = Dirección +editarPuntoVentaController.tab.label.recoleccion = Recoleccion +editarPuntoVentaController.tab.label.empVenta = Empresas para venta +editarPuntoVentaController.tab.label.usuBancario = Usuarios bancarios + +# Muestra el TipoVenta Búsqueda +busquedaTipoVentaController.window.title = Tipo de Venta +busquedaTipoVentaController.btnRefresh.tooltiptext = Actualizar +busquedaTipoVentaController.btnNovo.tooltiptext = Agregar +busquedaTipoVentaController.btnCerrar.tooltiptext = Cerrar +busquedaTipoVentaController.btnPesquisa.label = Búsqueda +busquedaTipoVentaController.lhId.label = ID +busquedaTipoVentaController.lhDesc.label = Descripción +busquedaTipoVentaController.txtNombre.label = Tipo de Venta + +# Pantalla Editar TipoVenta +editarTipoVentaController.window.title = Tipo de Venta +editarTipoVentaController.btnApagar.tooltiptext = Eliminar +editarTipoVentaController.btnSalvar.tooltiptext = Guardar +editarTipoVentaController.btnFechar.tooltiptext = Cerrar +editarTipoVentaController.lbNome.value = Descripción +editarTipoVentaController.MSG.suscribirOK = Tipo de venta se registró exitosamente. +editarTipoVentaController.MSG.borrarPergunta = ¿Desea eliminar este tipo de venta? +editarTipoVentaController.MSG.borrarOK = Tipo de venta se eliminó exitosamente. + +# Muestra el TipoServicio Búsqueda +busquedaTipoServicioController.window.title = Tipo de Corrida +busquedaTipoServicioController.btnRefresh.tooltiptext = Actualizar +busquedaTipoServicioController.btnNovo.tooltiptext = Agregar +busquedaTipoServicioController.btnCerrar.tooltiptext = Cerrar +busquedaTipoServicioController.btnPesquisa.label = Búsqueda +busquedaTipoServicioController.lhId.label = ID +busquedaTipoServicioController.lhDesc.label = Descripción +busquedaTipoServicioController.txtNombre.label = Tipo Corrida + +# Pantalla Editar TipoServicio +editarTipoServicioController.window.title = Tipo de Corrida +editarTipoServicioController.btnApagar.tooltiptext = Eliminar +editarTipoServicioController.btnSalvar.tooltiptext = Guarda Tipo de Corrida +editarTipoServicioController.btnFechar.tooltiptext = Cerrar +editarTipoServicioController.lbNome.value = Descripción +editarTipoServicioController.MSG.suscribirOK = Tipo de corrida se registró exitosamente. +editarTipoServicioController.MSG.borrarPergunta = ¿Desea eliminar este tipo de corrida? +editarTipoServicioController.MSG.borrarOK = Tipo de corrida se eliminó exitosamente. + + +# Muestra el configuration Búsqueda en +busquedaConfiguracionGeneralController.window.title = Configuración General +busquedaConfiguracionGeneralController.btnRefresh.tooltiptext = Actualizar +busquedaConfiguracionGeneralController.btnNovo.tooltiptext = Agregar +busquedaConfiguracionGeneralController.btnCerrar.tooltiptext = Cerrar +busquedaConfiguracionGeneralController.btnPesquisa.label = Búsqueda +busquedaConfiguracionGeneralController.lhId.label = ID +busquedaConfiguracionGeneralController.lhDesc.label = Descripción +busquedaConfiguracionGeneralController.txtNombre.label = Nombre Constante +busquedaConfiguracionGeneralController.lhValor.label = Contenido + +# Pantalla Editar configuration General +editarConfiguracionGeneralController.window.title = Configuración General +editarConfiguracionGeneralController.btnApagar.tooltiptext = Eliminar +editarConfiguracionGeneralController.btnSalvar.tooltiptext = Guardar +editarConfiguracionGeneralController.btnFechar.tooltiptext = Cerrar +editarConfiguracionGeneralController.lbNome.value = Nombre Constante +editarConfiguracionGeneralController.lbDesc.value = Descripción +editarConfiguracionGeneralController.lbValor.value = Contenido +editarConfiguracionGeneralController.lbIndTipo.value = Tipo +editarConfiguracionGeneralController.lbMantenimiento.value = Mantenimiento +editarConfiguracionGeneralController.RadSi.value = Si +editarConfiguracionGeneralController.RadNo.value = No +editarConfiguracionGeneralController.MSG.suscribirOK = Configuración general se registró exitosamente. +editarConfiguracionGeneralController.MSG.borrarPergunta = ¿Desea eliminar configuración general? +editarConfiguracionGeneralController.MSG.borrarOK = Configuración general se eliminó exitosamente. +editarConfiguracionGeneralController.MSG.ori = Necesita informar un origen +editarConfiguracionGeneralController.MSG.des = Necesita informar un destino +editarConfiguracionGeneralController.MSG.punto = Necesita informar un punto de venta + +#BuscaConfiguracionDeReservacion +busquedaConfiguracionReservacionController.window.title = Configuración de Reservación +busquedaConfiguracionReservacionController.btnRefresh.tooltiptext = Actualizar +busquedaConfiguracionReservacionController.btnNovo.tooltiptext = Agregar +busquedaConfiguracionReservacionController.btnCerrar.tooltiptext = Cerrar +busquedaConfiguracionReservacionController.btnPesquisa.label = Búsqueda +busquedaConfiguracionReservacionController.lhId.label = ID +busquedaConfiguracionReservacionController.lhFecinicio.label = Período Inicial +busquedaConfiguracionReservacionController.lhFecfinal.label = Período Final +busquedaConfiguracionReservacionController.periodo.label = Necesita informar un Período Inicial y Período Final. + +#Editar ConfiguracionDeReservacion +editarConfiguracionReservacionController.window.title = Configuración de Reservación +editarConfiguracionReservacionController.btnApagar.tooltiptext = Eliminar +editarConfiguracionReservacionController.btnSalvar.tooltiptext = Guardar +editarConfiguracionReservacionController.btnFechar.tooltiptext = Cerrar +editarConfiguracionReservacionController.lbNome.value = Marco Libro +editarConfiguracionReservacionController.lbDescricao.value = Descripción +editarConfiguracionReservacionController.lbFecInicio.value = Fecha Inicial +editarConfiguracionReservacionController.lbFecFinal.value = Fecha Final +editarConfiguracionReservacionController.lbTiempoLiberacion.value = Tiempo liberación de reservación: +editarConfiguracionReservacionController.lbTiempoLiberacionInternet.value = Tiempo liberación de reservación internet: +editarConfiguracionReservacionController.lbTiempoPrevio.value = Tiempo previo a corrida para reservar: +editarConfiguracionReservacionController.lbTiempoPrevioInternet.value = Tiempo previo a corrida para reservar en internet: +editarConfiguracionReservacionController.lbTiempoLiberacion = Reservación +editarConfiguracionReservacionController.lbTiempoLiberacionInternet = Reservación internet +editarConfiguracionReservacionController.lbTiempoPrevio = Previo reservar +editarConfiguracionReservacionController.lbTiempoPrevioInternet = Previo reservar en internet +editarConfiguracionReservacionController.lbNumAsientosCorrida.value = Número de asientos +editarConfiguracionReservacionController.lbDias.value = Días de la Semana +editarConfiguracionReservacionController.lbLun.value = Lunes +editarConfiguracionReservacionController.lbMar.value = Martes +editarConfiguracionReservacionController.lbMie.value = Miércoles +editarConfiguracionReservacionController.lbJue.value = Jueves +editarConfiguracionReservacionController.lbVie.value = Viernes +editarConfiguracionReservacionController.lbSab.value = Sábado +editarConfiguracionReservacionController.lbDom.value = Domingo +editarConfiguracionReservacionController.lbLunM.value = Lun +editarConfiguracionReservacionController.lbMarM.value = Mar +editarConfiguracionReservacionController.lbMieM.value = Mié +editarConfiguracionReservacionController.lbJueM.value = Jue +editarConfiguracionReservacionController.lbVieM.value = Vie +editarConfiguracionReservacionController.lbSabM.value = Sáb +editarConfiguracionReservacionController.lbDomM.value = Dom +editarConfiguracionReservacionController.tabCtrl.value = Configuración +editarConfiguracionReservacionController.tabCategoria.value = Tipo de Pasajero +editarConfiguracionReservacionController.btnAddCategoria.tooltiptext = Agregar +editarConfiguracionReservacionController.btnBorrarCategoria.tooltiptext = Eliminar +editarConfiguracionReservacionController.tabPuntoVenta.value = Punto de venta +editarConfiguracionReservacionController.btnAddPuntoVenta.tooltiptext = Agregar +editarConfiguracionReservacionController.btnBorrarPuntoVenta.tooltiptext = Eliminar +editarConfiguracionReservacionController.tabClase.value = Tipo de servicio +editarConfiguracionReservacionController.btnAddClase.tooltiptext = Agregar +editarConfiguracionReservacionController.btnBorrarClase.tooltiptext = Eliminar +editarConfiguracionReservacionController.tabMercado.value = Mercado +editarConfiguracionReservacionController.tabOrigem.value = Origen +editarConfiguracionReservacionController.tabDestino.value = Destino +editarConfiguracionReservacionController.btnAddMercado.tooltiptext = Agregar +editarConfiguracionReservacionController.btnBorrarMercado.tooltiptext = Eliminar +editarConfiguracionReservacionController.tabMarca.value = Marca +editarConfiguracionReservacionController.btnAddMarca.tooltiptext = Agregar +editarConfiguracionReservacionController.btnBorrarMarca.tooltiptext = Eliminar +editarConfiguracionReservacionController.MSG.suscribirOK = Configuración de reservación se registró exitosamente. +editarConfiguracionReservacionController.MSG.borrarPergunta = ¿Desea eliminar la configuración de reservación? +editarConfiguracionReservacionController.MSG.borrarOK = Configuración de la reservación se eliminó exitosamente. +editarConfiguracionReservacionController.MSG.selectItem = Seleccionar una opción a eliminar +editarConfiguracionReservacionController.MSG.selectItemDiferente = Igualdad de origen y de destino. +editarConfiguracionReservacionController.MSG.busquedaPeriodo = Fecha de inicio posterior a la fecha final. +editarConfiguracionReservacionController.MSG.busquedaNull = Fecha de inicio o fecha final en blanco. +editarConfiguracionReservacionController.MSG.conflitoVigencias = La vigencia informada se traslapa con otra ya existente. +editarConfiguracionReservacionController.MSG.necesitaCategoria = Necesita informar un tipo de pasajero. +editarConfiguracionReservacionController.MSG.necesitaPunto = Necesita informar un punto de venta. +editarConfiguracionReservacionController.MSG.necesitaClase = Necesita informar un tipo de servicio. +editarConfiguracionReservacionController.MSG.necesitaMercado = Necesita informar un mercado. +editarConfiguracionReservacionController.MSG.necesitaMarca = Necesita informar una marca. + +# Muestra la CANCELACION configuracional Búsqueda +busquedaConfiguracionCancelacionController.window.title = Configuración de cancelación +busquedaConfiguracionCancelacionController.btnRefresh.tooltiptext = Actualizar +busquedaConfiguracionCancelacionController.btnNovo.tooltiptext = Agregar +busquedaConfiguracionCancelacionController.btnCerrar.tooltiptext = Cerrar +busquedaConfiguracionCancelacionController.btnPesquisa.label = Búsqueda +busquedaConfiguracionCancelacionController.lhId.label = ID +busquedaConfiguracionCancelacionController.lhTiempo.label = Tiempo previo permitido +busquedaConfiguracionCancelacionController.lhTiempo.Inicio = Inicio +busquedaConfiguracionCancelacionController.lhTiempo.Fim = Final +busquedaConfiguracionCancelacionController.lhMotivo.label = Motivo Cancelación +busquedaConfiguracionCancelacionController.lhPunto.label = Punto de venta +busquedaConfiguracionCancelacionController.lhOrigen.label = Origen +busquedaConfiguracionCancelacionController.lhDestino.label = Destino +busquedaConfiguracionCancelacionController.lhCveOrigen.label = Clave Origen +busquedaConfiguracionCancelacionController.lhCveDestino.label = Clave Destino +busquedaConfiguracionCancelacionController.lhMarca.label = Marca +busquedaConfiguracionCancelacionController.btnLimpar.tooltiptext = Eliminar + +# Pantalla Editar configuracional CANCELACION +editarConfiguracionCancelacionController.window.title = Configuración de cancelación +editarConfiguracionCancelacionController.btnApagar.tooltiptext = Eliminar +editarConfiguracionCancelacionController.btnSalvar.tooltiptext = Guardar +editarConfiguracionCancelacionController.btnFechar.tooltiptext = Cerrar +editarConfiguracionCancelacionController.lbNome.value = Configuración de Cancelación +editarConfiguracionCancelacionController.lbTiempo.label = Tiempo +editarConfiguracionCancelacionController.lbPunto.label = Punto de venta +editarConfiguracionCancelacionController.lbOrigen.label = Origen +editarConfiguracionCancelacionController.lbDestino.label = Destino +editarConfiguracionCancelacionController.lbMarca.label = Marca +editarConfiguracionCancelacionController.lbMotivo.label = Motivo Cancelación +editarConfiguracionCancelacionController.MSG.suscribirOK = Configuración de cancelación se registró exitosamente. +editarConfiguracionCancelacionController.MSG.borrarPergunta = ¿Desea eliminar la configuración de cancelación? +editarConfiguracionCancelacionController.MSG.borrarOK = Cancelación de configuración se eliminó exitosamente +editarConfiguracionCancelacionController.tabCtrl.label = Cancelación +editarConfiguracionCancelacionController.tabCargo.label = Penalización +editarConfiguracionCancelacionController.maximo.label = Tiempo Máximo (horas) +editarConfiguracionCancelacionController.minimo.label = Tiempo Mínimo (horas) +editarConfiguracionCancelacionController.porc.label = Porcentaje +editarConfiguracionCancelacionController.importe.label = Importe +editarConfiguracionCancelacionController.btnAddCorrida.tooltiptext = Agregar +editarConfiguracionCancelacionController.btnBorrarCorrida.tooltiptext = Eliminar +editarConfiguracionCancelacionController.MSG.obsAntes = Antes salida corrida +editarConfiguracionCancelacionController.MSG.obsDespues = Después salida corrida +editarConfiguracionCancelacionController.MSG.selectItemDiferente = Igualdad de origen y de destino. +editarConfiguracionCancelacionController.MSG.selectItemTodas = Solo acepta todos en destino cuando origen es todos. + +# Muestra el formulario de Búsqueda configuracional Pago +busquedaConfiguracionFormaPagoController.window.title = Configuración de método de forma de pago +busquedaConfiguracionFormaPagoController.btnRefresh.tooltiptext = Actualizar +busquedaConfiguracionFormaPagoController.btnNovo.tooltiptext = Agregar +busquedaConfiguracionFormaPagoController.btnCerrar.tooltiptext = Cerrar +busquedaConfiguracionFormaPagoController.btnPesquisa.label = Búsqueda +busquedaConfiguracionFormaPagoController.lhId.label = Metodo de forma de pago +busquedaConfiguracionFormaPagoController.lhDesc.label = Empresa + +# Pantalla Editar Forma de Pago configuracional +editarConfiguracionFormaPagoController.window.title = Configuración de metodo de forma de pago +editarConfiguracionFormaPagoController.btnApagar.tooltiptext = Eliminar +editarConfiguracionFormaPagoController.btnSalvar.tooltiptext = Guardar +editarConfiguracionFormaPagoController.btnFechar.tooltiptext = Cerrar +editarConfiguracionFormaPagoController.lblFormaPago.value = Forma de pago +editarConfiguracionFormaPagoController.lblPuntoVenta.value = Punto de venta +editarConfiguracionFormaPagoController.lblEmpresa.value = Empresa +editarConfiguracionFormaPagoController.lblCargosExtras.value = Cargos extras +editarConfiguracionFormaPagoController.MSG.suscribirOK = Forma pago se registró exitosamente. +editarConfiguracionFormaPagoController.MSG.borrarPergunta = ¿Desea eliminar configuración de metodo de forma pago? +editarConfiguracionFormaPagoController.MSG.borrarOK = Configuración de metodo de forma de pago se eliminó exitosamente + +# Muestra el diagrama de Autobuses de la Búsqueda +busquedaDiagramaAutobusController.window.title = Diagrama de autobús +busquedaDiagramaAutobusController.btnRefresh.tooltiptext = Actualizar +busquedaDiagramaAutobusController.btnNovo.tooltiptext = Agregar +busquedaDiagramaAutobusController.btnCerrar.tooltiptext = Cerrar +busquedaDiagramaAutobusController.btnPesquisa.label = Búsqueda +busquedaDiagramaAutobusController.lhDesc.label = Diagrama de autobús + +# Pantalla Autobús Edición de Diagrama +editarDiagramaAutobusController.window.title = Diagrama de autobús +editarDiagramaAutobusController.msg.asientoObligatorio = Informe el número del asiento +editarDiagramaAutobusController.btnApagar.tooltiptext = Eliminar +editarDiagramaAutobusController.btnSalvar.tooltiptext = Guardar +editarDiagramaAutobusController.btnFechar.tooltiptext = Cerrar +editarDiagramaAutobusController.lblMarcaautobus.value = Marca autobús +editarDiagramaAutobusController.lblCantasientos.value = Cantidad asientos +editarDiagramaAutobusController.lblMaxparados.value = Máximo parados +editarDiagramaAutobusController.lhlateralDireitaList.label = LD +editarDiagramaAutobusController.lhacentoLateralDireitaJanelaList.label = AJ +editarDiagramaAutobusController.lhentreAcentosLateralDireitaList.label = EAD +editarDiagramaAutobusController.lhacentoLateralDireitaCorredorList.label = ADC +editarDiagramaAutobusController.lhcorredorList.label = C +editarDiagramaAutobusController.lhacentoLateralEsquerdaCorredorList.label = AEC +editarDiagramaAutobusController.lhentreAcentosLateralEsquerdaList.label = EAE +editarDiagramaAutobusController.lhacentoLateralEsquerdaJanelaList.label = AEJ +editarDiagramaAutobusController.lhlateralEsquerdaList.label = LE +editarDiagramaAutobusController.lblLegenda.value = Leyenda +editarDiagramaAutobusController.lblLD.value = LD: Lateral Izquierdo +editarDiagramaAutobusController.lblADJ.value = JJ: Derecho asientos en las ventanas laterales +editarDiagramaAutobusController.lblEAD.value = EAD: lado derecho de escaños +editarDiagramaAutobusController.lblADC.value = ADC: Los asientos del lado derecho del Corredor +editarDiagramaAutobusController.lblC.value = Corredor +editarDiagramaAutobusController.lblAEC.value = AEC: Los asientos del lado izquierdo del Corredor +editarDiagramaAutobusController.lblEAE.value = EA: entre los asientos del lado izquierdo +editarDiagramaAutobusController.lblAEJ.value = AEJ: Izquierda asientos en las ventanas laterales +editarDiagramaAutobusController.lblLE.value = LE: Lateral Izquierdo +editarDiagramaAutobusController.MSG.suscribirOK = Diagrama de autobús se registró exitosamente. +editarDiagramaAutobusController.MSG.borrarPergunta = ¿Desea eliminar el diagrama de autobús? +editarDiagramaAutobusController.MSG.borrarOK = Diagrama de autobús se eliminó exitosamente. +editarDiagramaAutobusController.MSG.Corrida.Futura = Este diagrama es utilizado en corridas futuras, no se puede eliminar. +editarDiagramaAutobusController.MSG.BorrarAsientoPergunta = Confirmar eliminar asiento? +editarDiagramaAutobusController.lblDescDiagrama.value = Descripción +editarDiagramaAutobusController.lbId.value = ID +editarDiagramaAutobusController.Existe.Asiento = El asiento ya existe +editarDiagramaAutobusController.Sem.Asiento = Sin asientos configurados +editarDiagramaAutobusController.Qtde.Asiento = Cantidad asientos diferente do configurado +editarDiagramaAutobusController.legenda.1 = Zona de asientos +editarDiagramaAutobusController.legenda.2 = Zona de pasillo +editarDiagramaAutobusController.legenda.3 = Zona de accesorios +editarDiagramaAutobusController.legenda.4 = Zona universal +editarDiagramaAutobusController.legenda.5 = Nomeclatura para accesorios +editarDiagramaAutobusController.legenda.6 = WC - Baño +editarDiagramaAutobusController.legenda.7 = CF - Cafeteria +editarDiagramaAutobusController.legenda.8 = TV - Televisión +editarDiagramaAutobusController.legenda.9 = PT - Porta Traje + + +# Pantalla Diagrama Autobús Edición Detalle +editarDetDiagramaAutobusController.window.title = Configuración Detalle autobús +editarDetDiagramaAutobusController.lbTipo.value = Tipo +editarDetDiagramaAutobusController.btnSalvar.tooltiptext = Guardar +editarDetDiagramaAutobusController.btnFechar.tooltiptext = Cerrar +editarDetDiagramaAutobusController.lbAsiento.value = Asiento +editarDetDiagramaAutobusController.lbVendible.value = Usted puede vender +editarDetDiagramaAutobusController.lbInternet.value = La venta de Internet +editarDetDiagramaAutobusController.MSG.validacionCantAsientos=La cantidad de asientos es menor +editarDetDiagramaAutobusController.MSG.validacionCantAsientosSalvar=La cantidad de asientos no esta correcta con el autobús + +# Mostrar la marca de la Búsqueda +busquedaMarcaController.window.title = Marca +busquedaMarcaController.btnRefresh.tooltiptext = Actualizar +busquedaMarcaController.btnNovo.tooltiptext = Agregar +busquedaMarcaController.btnCerrar.tooltiptext = Cerrar +busquedaMarcaController.btnPesquisa.label = Búsqueda +busquedaMarcaController.lhDesc.label = Descripción +busquedaMarcaController.txtNome.label = Marca +busquedaMarcaController.lhId.label = ID + +# Pantalla Editar etiqueta +editarMarcaController.window.title = Marca +editarMarcaController.btnApagar.tooltiptext = Eliminar +editarMarcaController.btnSalvar.tooltiptext = Guardar +editarMarcaController.btnFechar.tooltiptext = Cerrar +editarMarcaController.lbNome.value = Marca +editarMarcaController.MSG.suscribirOK = Marca se registró exitosamente. +editarMarcaController.MSG.borrarPergunta = ¿Desea eliminar marca? +editarMarcaController.MSG.SinImagenPergunta = ¿Está seguro de guardar la marca sin imagen? +editarMarcaController.MSG.borrarOK = Marca se eliminó exitosamente. +editarMarcaController.MSG.errorIMG = Archivo no es la imagen: +editarMarcaController.fileupload.label = Seleccionar Foto + +# Muestra la Asociación Marcos Búsqueda Servicio Clase +busquedaAsociacionClaseServicioMarcaController.window.title = Asociación Tipo de servicio y Marca +busquedaAsociacionClaseServicioMarcaController.btnRefresh.tooltiptext = Actualizar +busquedaAsociacionClaseServicioMarcaController.btnNovo.tooltiptext = Agregar +busquedaAsociacionClaseServicioMarcaController.btnCerrar.tooltiptext = Cerrar +busquedaAsociacionClaseServicioMarcaController.btnPesquisa.label = Búsqueda +busquedaAsociacionClaseServicioMarcaController.lhId.label = ID +busquedaAsociacionClaseServicioMarcaController.lhMarca.label = Marca +busquedaAsociacionClaseServicioMarcaController.lhDesc.label = Tipo de servicio + +# Pantalla Editar Clase Asociación Marca Servicio +editarAsociacionClaseServicioMarcaController.window.title = Asociación Tipo de servicio y Marca +editarAsociacionClaseServicioMarcaController.btnApagar.tooltiptext = Eliminar +editarAsociacionClaseServicioMarcaController.btnSalvar.tooltiptext = Guarda Asociación Tipo de servicio y Marca +editarAsociacionClaseServicioMarcaController.btnFechar.tooltiptext = Cerrar +editarAsociacionClaseServicioMarcaController.lblMarca.value = Marca +editarAsociacionClaseServicioMarcaController.lblClaseServicio.value = Tipo de servicio +editarAsociacionClaseServicioMarcaController.MSG.suscribirOK = Asociación tipo de servicio y marca se registró exitosamente. +editarAsociacionClaseServicioMarcaController.MSG.borrarPergunta = ¿Desea eliminar asociación tipo de servicio y marca? +editarAsociacionClaseServicioMarcaController.MSG.borrarOK = Tipo de servicio y marca se eliminó exitosamente. +editarAsociacionClaseServicioMarcaController.MSG.existe.registro = Asociación Tipo de servicio y Marca , ya existe un registro con estos datos. + +# Mostrar la categoría Configuracao Búsqueda +busquedaConfiguracionCategoriaController.window.title = Configuración Tipo de Pasajero +busquedaConfiguracionCategoriaController.lhId.label = ID +busquedaConfiguracionCategoriaController.lhDesc.label = Descripción +busquedaConfiguracionCategoriaController.lhMarca.label = Marca +busquedaConfiguracionCategoriaController.lhClase.label = Tipo de servicio +busquedaConfiguracionCategoriaController.txtNome.label = Empresa +busquedaConfiguracionCategoriaController.lhTipo.label = Tipo de Pasajero +busquedaConfiguracionCategoriaController.btnRefresh.tooltiptext = Actualizar +busquedaConfiguracionCategoriaController.btnNovo.tooltiptext = Agregar +busquedaConfiguracionCategoriaController.btnCerrar.tooltiptext = Cerrar +busquedaConfiguracionCategoriaController.btnPesquisa.label = Búsqueda + + +# Pantalla Editar Configuración Categorí­a +editarConfiguracionCategoriaController.window.title = Tipo de Configuración de Pasajero +editarConfiguracionCategoriaController.MSG.noEsPermitidoTodosMarca = Para agregar la Marca TODAS, debe de eliminar la(s) Marca(s) que ya existe(n) +editarConfiguracionCategoriaController.MSG.noEsPermitidoMarcaTodosExiste = Para agregar la Marca deseada, debe de eliminar la Marca TODAS +editarConfiguracionCategoriaControllerPeriodo.window.title = Vigencias para el descuento +editarConfiguracionCategoriaController.btnApagar.tooltiptext = Eliminar +editarConfiguracionCategoriaController.btnEditarDatosCategoria.value = Tipo Pasajero +editarConfiguracionCategoriaController.btnEditarDatosCategoria.tooltiptext = Cambiar Tipo Pasajero +editarConfiguracionCategoriaController.btnSalvar.tooltiptext = Guardar +editarConfiguracionCategoriaController.btnFechar.tooltiptext = Cerrar +editarConfiguracionCategoriaController.btnAgregarPeriodo.tooltiptext = Cambiar Períodos de Vigencia +editarConfiguracionCategoriaController.btnAgregarPeriodo.value = Períodos de Vigencia +editarConfiguracionCategoriaController.MSG.suscribirOK = Tipo de configuración pasajero se registró exitosamente. +editarConfiguracionCategoriaController.MSG.borrarPergunta = ¿Desea eliminar tipo de configuración de pasajero? +editarConfiguracionCategoriaController.MSG.editarPeriodo = Antes de editar el período de vigencia es necesario guardar la configuración de pasajero. +editarConfiguracionCategoriaController.MSG.borrarOK = Tipo de configuración pasajero se eliminó exitosamente. +editarConfiguracionCategoriaController.MSG.categoriaPeriodoObligatorio = Debe de informar las viegencias para los descuentos +editarConfiguracionCategoriaController.lblCategorias.value = Tipo de Pasajero +editarConfiguracionCategoriaController.lblEmpresa.value = Empresa +editarConfiguracionCategoriaController.lblMarca.value = Marca +editarConfiguracionCategoriaController.lblCorrida.value = Carreras +editarConfiguracionCategoriaController.lblClaseServicio.value = Tipo de servicio +editarConfiguracionCategoriaController.lblOrigen.value = Origen (Inicio Ruta) +editarConfiguracionCategoriaController.lblDestino.value = Destino (Fin Ruta) +editarConfiguracionCategoriaController.lblCantAutorizada.value = Cantidad Autorizada +editarConfiguracionCategoriaController.lblDescuentoPorc.value = Porcentaje +editarConfiguracionCategoriaController.lblDescuentoImporte.value = Importe +editarConfiguracionCategoriaController.lblDescuento.value = Tipo Descuento +editarConfiguracionCategoriaController.lblQtdPeriodo.value = Qtd. Período +editarConfiguracionCategoriaController.lbFecInicio.value = Fecha de Inicio +editarConfiguracionCategoriaController.lbFecFinal.value = Fecha de Fin +editarConfiguracionCategoriaController.tabConfiguracoes.label = Configuración +editarConfiguracionCategoriaController.tabPeriodos.label = Períodos +editarConfiguracionCategoriaController.tabMarca.label = Marca +editarConfiguracionCategoriaController.tabDesconto.label = Descuento +editarConfiguracionCategoriaController.tabMercado.label = Mercado +editarConfiguracionCategoriaController.tabClase.label = Tipo de servicio +editarConfiguracionCategoriaController.tabCorrida.label = Corrida +editarConfiguracionCategoriaController.tabCorridaHorario.label = Hora +editarConfiguracionCategoriaController.btnAddMarca.tooltiptext = Agregar +editarConfiguracionCategoriaController.btnBorrarMarca.tooltiptext = Eliminar +editarConfiguracionCategoriaController.btnAddClase.tooltiptext = Agregar tipo +editarConfiguracionCategoriaController.btnBorrarClase.tooltiptext = Eliminar +editarConfiguracionCategoriaController.btnAddCorrida.tooltiptext = Agregar +editarConfiguracionCategoriaController.btnBorrarCorrida.tooltiptext = Eliminar +editarConfiguracionCategoriaController.btnAddMercado.tooltiptext = Agregar +editarConfiguracionCategoriaController.btnBorrarMercado.tooltiptext = Eliminar +editarConfiguracionCategoriaController.MSG.selecionarPeriodo = Seleccione un período a eliminar +editarConfiguracionCategoriaController.MSG.selectItem = Selecciona un Elemento. +editarConfiguracionCategoriaController.MSG.selectDescuento = Seleccione un descuento. +editarConfiguracionCategoriaController.MSG.selectCategoria = Seleccione un tipo de pasajero. +editarConfiguracionCategoriaController.MSG.busquedaPeriodo = Fecha de inicio posterior a la fecha final. +editarConfiguracionCategoriaController.MSG.busquedaPeriodoFechaActual = Fecha de inicio anterior a la fecha actual. +editarConfiguracionCategoriaController.MSG.busquedaNull = Fecha de inicio o fecha final en blanco. +editarConfiguracionCategoriaController.MSG.selectItemDiferente = Origen y destino deben ser diferentes. +editarConfiguracionCategoriaController.MSG.corrida = Corrida no existe. +editarConfiguracionCategoriaController.MSG.descuentoExiste = Descuento existe. +editarConfiguracionCategoriaController.MSG.descuento = Necesita informar un descuento +editarConfiguracionCategoriaController.MSG.descuentoAdulto = Es necesario informar al menos el tipo de pasajero ADULTO. +editarConfiguracionCategoriaController.MSG.periodoObligatorio = Es necesario informar la vigencias +editarConfiguracionCategoriaController.MSG.conflitoVigencias = El período informado se traslapa con otro ya existente. +editarConfiguracionCategoriaController.MSG.cualDesaEditar = ¿Desea editar los períodos de descuentos? +editarConfiguracionCategoriaController.MSG.necesitaDescuento = Necesita informar un descuento. +editarConfiguracionCategoriaController.MSG.necesitaMarca = Necesita informar una marca. +editarConfiguracionCategoriaController.MSG.necesitaMercado = Necesita informar un mercado. +editarConfiguracionCategoriaController.MSG.necesitaClase = Necesita informar un tipo de servicio. + + +# Detener la pantalla de Búsqueda +busquedaCatalogoDeParadaController.window.title = Parada +busquedaCatalogoDeParadaController.btnRefresh.tooltiptext = Actualizar +busquedaCatalogoDeParadaController.btnNovo.tooltiptext = Agregar +busquedaCatalogoDeParadaController.btnCerrar.tooltiptext = Cerrar +busquedaCatalogoDeParadaController.btnPesquisa.label = Búsqueda +busquedaCatalogoDeParadaController.lhId.label = ID +busquedaCatalogoDeParadaController.lhParada.label = Parada +busquedaCatalogoDeParadaController.lhDesc.label = Descripción +busquedaCatalogoDeParadaController.lbCveParada.label = Clave Parada + +# Editar Desfile de pantalla +editarCatalogoDeParadaController.window.title = Parada +editarCatalogoDeParadaController.btnApagar.tooltiptext = Eliminar +editarCatalogoDeParadaController.btnSalvar.tooltiptext = Guardar +editarCatalogoDeParadaController.btnFechar.tooltiptext = Cerrar +editarCatalogoDeParadaController.lbNome.value = Descripción +editarCatalogoDeParadaController.lbCveParada.value = Clave Parada +editarCatalogoDeParadaController.MSG.suscribirOK = La parada se registró exitosamente. +editarCatalogoDeParadaController.MSG.borrarPergunta = ¿Desea eliminar esta parada? +editarCatalogoDeParadaController.MSG.borrarOK = La parada se eliminó exitosamente. +editarCatalogoDeParadaController.lbCiudad.value = Ciudad +editarCatalogoDeParadaController.lbTipoParada.value = Tipo Parada +editarCatalogoDeParadaController.lbNodo.value = Nodo + +# Detener la pantalla de Búsqueda +busquedaCatalogoDeRutaController.window.title = Ruta +busquedaCatalogoDeRutaController.btnRefresh.tooltiptext = Actualizar +busquedaCatalogoDeRutaController.btnNovo.tooltiptext = Agregar +busquedaCatalogoDeRutaController.btnCerrar.tooltiptext = Cerrar +busquedaCatalogoDeRutaController.btnPesquisa.label = Búsqueda +busquedaCatalogoDeRutaController.lhId.label = ID +busquedaCatalogoDeRutaController.lhDesc.label = Ruta +busquedaCatalogoDeRutaController.lhClase.label = Clase +busquedaCatalogoDeRutaController.lbClase.value = Tipo de servicio +busquedaCatalogoDeRutaController.msg.validactionRemocionParada=No es posible quitar la parada "{0}" de la ruta pues ya existe(n) corrida(s) que la ocupa. Quite la parada "{0}" de las seguintes corridas : ({1}) para después quitar en la ruta. + +# Pantalla Editar Ruta +editarCatalogoDeRutaController.msg.validacionCambionEnCombinaciones = Al agregar o quitar una parada las combinatorias serán remplazadas. Es necesario revisar las combinatorias en caso de que exista alguna configuración específica para una(s) de ella(s). Confirma la grabación? +editarCatalogoDeRutaController.msg.cambioSecuencia = No es posible cambiar el origen inicial o destino final para una ruta ya existente +editarCatalogoDeRutaController.msg.validacion.paradas = Debe informar las secuencias de la ruta +editarCatalogoDeRutaController.msg.validacion.empresa = Debe informar la empresa de la ruta +editarCatalogoDeRutaController.msg.validacion.yaExisteParada = La parada informada ya existe en la secuencia +editarCatalogoDeRutaController.window.title = Ruta +editarCatalogoDeRutaController.btnApagar.tooltiptext = Eliminar +editarCatalogoDeRutaController.btnSalvar.tooltiptext = Guardar +editarCatalogoDeRutaController.btnFechar.tooltiptext = Cerrar +editarCatalogoDeRutaController.btnModificar.tooltiptext = Modificar secuencia +editarCatalogoDeRutaController.lbNome.value = Ruta +editarCatalogoDeRutaController.lbClase.value = Tipo de servicio +editarCatalogoDeRutaController.lbTramo.value = Parada +editarCatalogoDeRutaController.lbVia.value = Via +editarCatalogoDeRutaController.lbOrigem.value = Origen +editarCatalogoDeRutaController.lbDestino.value = Destino +editarCatalogoDeRutaController.lbParada.value = Parada +editarCatalogoDeRutaController.lbSecuencia.value = Secuencia +editarCatalogoDeRutaController.lbVenta.value = Vende +editarCatalogoDeRutaController.lbAddBorrar.value = Agregar +editarCatalogoDeRutaController.MSG.suscribirOK = Ruta se registró exitosamente. +editarCatalogoDeRutaController.MSG.sequencia = Debe informar al menos dos secuencias +editarCatalogoDeRutaController.MSG.borrarPergunta = ¿Desea eliminar esta ruta? +editarCatalogoDeRutaController.MSG.gerarPergunta = ¿Generar combinación? +editarCatalogoDeRutaController.MSG.borrarOK = Ruta se eliminó exitosamente. +editarCatalogoDeRutaController.MSG.selectItem = Error al seleccionar un elemento +editarCatalogoDeRutaController.MSG.tramoExiste = Combinación existente. +editarCatalogoDeRutaController.MSG.tramo = Tramo inexistente. +editarCatalogoDeRutaController.MSG.removerSecuencia = No se puede remover la primera o la ultima secuencia. +editarCatalogoDeRutaController.MSG.parada = Parada inexistente. +editarCatalogoDeRutaController.tabRuta.value = Ruta +editarCatalogoDeRutaController.tabSecuencia.value = Secuencia +editarCatalogoDeRutaController.tabCombinacion.value = Combinación +editarCatalogoDeRutaController.btnAddCombinacion.tooltiptext = Agregar +editarCatalogoDeRutaController.btnBorrarCombinacion.tooltiptext = Eliminar +editarCatalogoDeRutaController.btnGerarCombinacion.tooltiptext = Generar Combinación +editarCatalogoDeRutaController.btnAddSecuencia.tooltiptext = Agregar +editarCatalogoDeRutaController.btnBorrarSecuencia.tooltiptext = Eliminar +editarCatalogoDeRutaController.RadSi.value = Si +editarCatalogoDeRutaController.RadNo.value = No +editarCatalogoDeRutaController.radAprobacionAutorizado.value = Autorizado +editarCatalogoDeRutaController.radAprobacionLatente.value = Latente +editarCatalogoDeRutaController.radioNombreObrigadotio = Solicitar nombre pasajero +editarCatalogoDeRutaController.radioNombreObrigadotio.rdSi = Si +editarCatalogoDeRutaController.radioNombreObrigadotio.rdNo = No +editarCatalogoDeRutaController.lbEmpresa.value = Empresa +editarCatalogoDeRutaController.tabRutaEmpresa.value = Ruta Empresa +editarCatalogoDeRutaController.btnAddEmpresa.tooltiptext = Agregar +editarCatalogoDeRutaController.btnBorrarEmpresa.tooltiptext = Eliminar +editarCatalogoDeRutaController.lhTiempoEstancia = Tiempo Estancia +editarCatalogoDeRutaController.MSG.addTramos = Agregar +editarCatalogoDeRutaController.MSG.tramoInicioFim = Tramo inicial o final no puede borrar +editarCatalogoDeRutaController.VentaOffLine = Venta en hand held off line + +# A través de la pantalla de Búsqueda +busquedaViaController.window.title = Vía +busquedaViaController.btnRefresh.tooltiptext = Actualizar +busquedaViaController.btnNovo.tooltiptext = Agregar +busquedaViaController.btnCerrar.tooltiptext = Cerrar +busquedaViaController.btnPesquisa.label = Búsqueda +busquedaViaController.lhDesc.label = Descripción +busquedaViaController.lhVia.label = Vía +busquedaViaController.lhId.label = ID + +# Editar pantalla a través de +editarViaController.window.title = Vía +editarViaController.btnApagar.tooltiptext = Eliminar +editarViaController.btnSalvar.tooltiptext = Guardar +editarViaController.btnFechar.tooltiptext = Cerrar +editarViaController.lbNome.value = Vía +editarViaController.MSG.suscribirOK = Vía se registró exitosamente. +editarViaController.MSG.borrarPergunta = ¿Desea eliminar la vía? +editarViaController.MSG.borrarOK = Vía se eliminó exitosamente. + +# Muestra el Tramos Búsqueda +busquedaTramosController.window.title = Tramos +busquedaTramosController.btnRefresh.tooltiptext = Actualizar +busquedaTramosController.btnNovo.tooltiptext = Agregar +busquedaTramosController.btnCerrar.tooltiptext = Cerrar +busquedaTramosController.btnPesquisa.label = Búsqueda +busquedaTramosController.lhId.label = ID +busquedaTramosController.lhDesc.label = Tramo + +# Pantalla Editar Tramos +editarTramosController.window.title = Tramo +editarTramosController.btnApagar.tooltiptext = Eliminar +editarTramosController.btnSalvar.tooltiptext = Guardar +editarTramosController.btnFechar.tooltiptext = Cerrar +editarTramosController.lbNome.value = Tramo +editarTramosController.MSG.suscribirOK = Tramo se registró exitosamente. +editarTramosController.MSG.ori = Necesita informar un origen. +editarTramosController.MSG.des = Necesita informar un destino. +editarTramosController.MSG.borrarPergunta = ¿Desea eliminar tramo? +editarTramosController.MSG.borrarOK = Tramo se eliminó exitosamente. +editarTramosController.MSG.borrarFalse = No se puede eliminar ese tramo. +editarTramosController.MSG.obligatorioTramoTiempo = Debe informar tiempo por tramo +editarTramosController.MSG.obligatorioTramoTiempoDia = Debe informar el día de la semana +editarTramosController.labelDestino.value = Destino +editarTramosController.labelOrigen.value = Origen +editarTramosController.labelVia.value = Vía +editarTramosController.tabTramos.label = Tramos +editarTramosController.tabServicio.label = Tiempo General +editarTramosController.lbKmReal.value = KM Real +editarTramosController.lbKmTarifa.value = KM Precio +editarTramosController.lbKmPagoConductor.value = Km Pago Conductor +editarTramosController.lbTiempoRecorrido.value = Viaje en el Tiempo +editarTramosController.btnApagarAtributo.tooltiptext = Eliminar +editarTramosController.btnSalvarAtributo.tooltiptext = Agregar +editarTramosController.lbClaseServicio.value = Tipo de servicio +editarTramosController.MSG.BorrarTramoAtributo = Eliminar atributo del tramo? +editarTramosController.MSG.selecioneTramoAtributo = Seleccionar un tramo atributo a eliminar. +editarTramosController.ClaseServicio.value = Tipo Servicio +editarTramosController.tabTiempo.label = Excepciones de Tiempo +editarTramosController.tabExcepcionesKm.label = Excepciones de Km +editarTramosController.lbTiemporecorrido.value = Tiempo Recorrido +editarTramosController.lbHorainicio.value = Hora Inicio +editarTramosController.lbHorafin.value = Hora Fin +editarTramosController.lbTiempoRecorrido.value = Tiempo Recorrido +editarTramosController.lbnumdiasemana.value = Num Día Semana +editarTramosController.btnApagarTiempo.tooltiptext = Eliminar +editarTramosController.btnSalvarTiempo.tooltiptext = Guarda Tramo Tiempo +editarTramosController.MSG.selecioneTramoTiempo = Seleccionar una excepciones de tiempo. +editarTramosController.lhTiempoHorainicio.value = Inicio +editarTramosController.lhTiempoHorafin.value = Fin +editarTramosController.lhTiempoNumdiasemana.value = Días Semana +editarTramosController.lhTiempoTiemporecorrido.value = Recorrido +editarTramosController.MSG.borrarTramoServicio = Eliminar tiempo del tramo? +editarTramosController.MSG.borrarTramoTiempo = Elimina excepción de tiempo? +editarTramosController.MSG.selecioneTramoServicio = Seleccionar un tiempo general a eliminar. +editarTramosController.MSG.OrigemDestinoIguais = Datos origen, destino debe ser diferentes. +editarTramosController.MSG.tipoServicio = Debe de informar el Tipo de Servicio +editarTramosController.MSG.tiempo = Debe de informar el Tiempo Recorrido +editarTramosController.lbItxCantkmpagoconductor.value=Km Conductor +editarTramosController.labelEmpresa.value=Empresa +editarTramosController.btnApagarExcepcioneKm.tooltiptext = Eliminar +editarTramosController.btnSalvarExceptioneKm.tooltiptext = Guarda Tramo Km +editarTramosController.MSG.selecioneTramoKm = Seleccione una excepcione de Km. +editarTramosController.MSG.borrarTramoKm = Elimina excepción de Km? + +#Panatalla VentaBoletos Comisionistas +pantalla.VentaBoletosTDO.window.title = Grupo Senda - Comisionista onLine +pantalla.VentaBoletosCalendar.window.title = Grupo Senda - Comisionista onLine +pantalla.VentaBoletosBus.window.title = Grupo Senda - Comisionista onLine +pantalla.VentaBoletosDatosPasajero.window.title = Grupo Senda - Comisionista onLine +pantalla.VentaBoletosDatosServicios.window.title = Grupo Senda - Comisionista onLine +pantalla.VentaBoletosServicios.window.title = Grupo Senda - Comisionista onLine - Servicios +VentaBoletosController.lblOrigen.value = ¿ De que Ciudad Viajas ? +VentaBoletosController.lblDestino.value = ¿ A que Ciudad Vas ? +VentaBoletosController.lblTipoViaje.value = ¿ Como es tu Viaje ? +VentaBoletosController.btnContinuar.label = Continuar +VentaBoletosController.btnRegresar.label = Regresar +VentaBoletosController.btnTerminales.label = Terminales +VentaBoletosController.btnCancelar.label = Cancelar +VentaBoletosController.btnServicios.label = Servicios + +# Detener la pantalla de Configuración de Corridas +busquedaConfiguracionCorridaController.window.title = Configuración de Corridas +busquedaConfiguracionCorridaController.btnRefresh.tooltiptext = Actualizar +busquedaConfiguracionCorridaController.btnNovo.tooltiptext = Agregar +busquedaConfiguracionCorridaController.btnCerrar.tooltiptext = Cerrar +busquedaConfiguracionCorridaController.btnPesquisa.label = Búsqueda +busquedaConfiguracionCorridaController.lhId.label = ID +busquedaConfiguracionCorridaController.lhDesc.label = Corrida +busquedaConfiguracionCorridaController.lhHora.label = Horario +busquedaConfiguracionCorridaController.lhRuta.label = Ruta +busquedaConfiguracionCorridaController.lhMarca.label = Marca +busquedaConfiguracionCorridaController.lhDe.label = De +busquedaConfiguracionCorridaController.lhHasta.label = Hasta +busquedaConfiguracionCorridaController.lhClase.value = Tipo Servicio +busquedaConfiguracionCorridaController.lhMarca.value = Marca +busquedaConfiguracionCorridaController.lhEmpresaCorrida.value = Empresa Corrida +busquedaConfiguracionCorridaController.lhEmpresaIngresso.value = Empresa Ingreso +busquedaConfiguracionCorridaController.lhEmpresaRolOperativo.value = Rol Operativo +busquedaConfiguracionCorridaController.lhStatus.value = Status +busquedaConfiguracionCorridaController.lhClase.value = Tipo Servicio +busquedaConfiguracionCorridaController.lhSemana.value = Días de la Semana + +# Detener la pantalla de Configuración de Corridas +editarConfiguracionCorridaController.window.title = Configuración de Corridas +editarConfiguracionCorridaController.btnApagar.tooltiptext = Eliminar +editarConfiguracionCorridaController.btnSalvar.tooltiptext = Guardar +editarConfiguracionCorridaController.btnFechar.tooltiptext = Cerrar +editarConfiguracionCorridaController.btnRemoverTramo.tooltiptext = Eliminar +editarConfiguracionCorridaController.btnAdcionarTramo.tooltiptext = Agregar +editarConfiguracionCorridaController.lbVigencia.value = Vigencia +editarConfiguracionCorridaController.lbDe.value = De +editarConfiguracionCorridaController.lbHasta.value = Hasta +editarConfiguracionCorridaController.lbCada.value = Cada +editarConfiguracionCorridaController.lbMinutos.value = Minutos +editarConfiguracionCorridaController.lbHrs.value = Hrs. +editarConfiguracionCorridaController.cmbClase.value = Tipo servicio +editarConfiguracionCorridaController.cmbClase2.value = Tipo servicio Doble Piso +editarConfiguracionCorridaController.doblePiso.value = Doble Piso +editarConfiguracionCorridaController.cmbMarca.value = Marca +editarConfiguracionCorridaController.cmbRuta.value = Ruta +editarConfiguracionCorridaController.cmbEmpresaCorrida.value = Empresa Corrida +editarConfiguracionCorridaController.cmbEmpresaIngresso.value = Empresa Ingreso +editarConfiguracionCorridaController.cmbEmpresaRolOperativo.value = Rol Operativo +editarConfiguracionCorridaController.cmbEmpresaRolOperativo2.value = Rol Operativo Doble Piso +editarConfiguracionCorridaController.cmbStatus.value = Status +editarConfiguracionCorridaController.cmbAsiento.value = Asientos +editarConfiguracionCorridaController.cmbAsiento.tooltiptext = Planeación de asientos cedidos +editarConfiguracionCorridaController.rdPorBloq.value = Por Bloque: +editarConfiguracionCorridaController.rdPorHora.value = Por Horario: +editarConfiguracionCorridaController.rdLatente.value = Latente +editarConfiguracionCorridaController.rdAutorizada.value = Autorizada +editarConfiguracionCorridaController.rdCancelada.value = Cancelada +editarConfiguracionCorridaController.lbSemana.value = Días de la Semana: +editarConfiguracionCorridaController.lbL.value = L +editarConfiguracionCorridaController.lbMa.value = Ma +editarConfiguracionCorridaController.lbMi.value = Mi +editarConfiguracionCorridaController.lbJ.value = J +editarConfiguracionCorridaController.lbV.value = V +editarConfiguracionCorridaController.lbS.value = S +editarConfiguracionCorridaController.lbD.value = D +editarConfiguracionCorridaController.lbCantParados.value = Cantidad de parados +editarConfiguracionCorridaController.MSG.suscribirOK = La configuración de la corrida se registró exitosamente. +editarConfiguracionCorridaController.MSG.borrarPergunta = ¿Desea eliminar esta corrida? +editarConfiguracionCorridaController.MSG.borrarOK = Corrida se eliminó exitosamente. +editarConfiguracionCorridaController.MSG.selectItem = Selecciona un Elemento. +editarConfiguracionCorridaController.MSG.busquedaPeriodo = Fecha de inicio posterior a la fecha final. +editarConfiguracionCorridaController.MSG.fecha = No es posible ingresar fechas anteriores a la actual para nuevas corridas +editarConfiguracionCorridaController.MSG.Clase = Necesita informar un tipo servicio +editarConfiguracionCorridaController.MSG.Clase2 = Necesita informar un tipo servicio para piso extra +editarConfiguracionCorridaController.MSG.Marca = Necesita informar ua marca +editarConfiguracionCorridaController.MSG.Ruta = Necesita informar una ruta +editarConfiguracionCorridaController.MSG.Empresa = Necesita informar una empresa corrida +editarConfiguracionCorridaController.MSG.Empresa1 = Necesita informar una empresa ingresso +editarConfiguracionCorridaController.MSG.Rol = Necesita informar un rol operativo +editarConfiguracionCorridaController.MSG.Rol2 = Necesita informar un rol operativo para piso extra +editarConfiguracionCorridaController.btnAbrirEsquemaCorrida.tooltiptext = Abre el esquema opercional de la corrida rebote +editarConfiguracionCorridaController.tabCorrida.value = Corrida +editarConfiguracionCorridaController.tabCorridaTramo.value = Parada +editarConfiguracionCorridaController.fletes = Fletes +editarConfiguracionCorridaController.division.value = Division +editarConfiguracionCorridaController.viajesEspeciales = Viajes Especiales +editarConfiguracionCorridaController.transportePasajeros = Transporte de Pasajeros +editarConfiguracionCorridaController.tipoCorrida.value = Tipo Corrida +editarConfiguracionCorridaController.esquemaTramoList.tooltiptext= Duplo click editar Tiempo Estancia +editarConfiguracionCorridaController.MSG.RutaSemTramos = Ruta no possui tramos. +editarConfiguracionCorridaController.MSG.RutaVazia = Seleccione una ruta. +editarConfiguracionCorridaController.lblNumEsquemaRebote.value=Nº Esquema Corrida +editarConfiguracionCorridaController.btnBuscarEsquemaCorrida.tooltiptext = Hace la búsqueda de la Configuración de Corrida +editarConfiguracionCorridaController.tabCorridaRebote.value = Rebote +editarConfiguracionCorridaController.btnAbrirEsquemaCorrida.error = No hay corrida rebote selecccionada + + +#Planeacion de Asiento Controller +editarConfiguracionCorridaAsientoController.window.title = Planeación de asientos +editarConfiguracionCorridaAsientoController.btnApagar.tooltiptext = Eliminar +editarConfiguracionCorridaAsientoController.btnSalvar.tooltiptext = Guardar +editarConfiguracionCorridaAsientoController.btnFechar.tooltiptext = Cerrar +editarConfiguracionCorridaAsientoController.btnRemoverTramo.tooltiptext = Eliminar +editarConfiguracionCorridaAsientoController.btnLiberar.value = Liberar +editarConfiguracionCorridaAsientoController.btnCeder.value = Asignar +editarConfiguracionCorridaController.lbAsiento.value = Asiento: +editarConfiguracionCorridaController.lbOrigem.value = Origen: +editarConfiguracionCorridaAsientoController.lbAsiento.value = Asiento: +editarConfiguracionCorridaAsientoController.lbOrigem.value = Parada: +editarConfiguracionCorridaAsientoController.MSG.salvo = Planeación de asientos se registró exitosamente. +editarConfiguracionCorridaAsientoController.MSG.existe = Ya existe un registro con estos datos. +editarConfiguracionCorridaAsientoController.MSG.liberar = Asiento(s) liberado(s). +editarConfiguracionCorridaAsientoController.MSG.help = (Ej: 1,2,3,4 o 1-4) +editarConfiguracionCorridaAsientoController.MSG.invalido = Asiento invalido + +# Buesqueda de Tarifas Mínimas +busquedaTarifasMinimasController.window.title = Tarifas Mínimas +busquedaTarifasMinimasController.btnRefresh.tooltiptext = Actualizar +busquedaTarifasMinimasController.btnNovo.tooltiptext = Agregar +busquedaTarifasMinimasController.btnCerrar.tooltiptext = Cerrar +busquedaTarifasMinimasController.lhImportetarifa.label = Tarifa +busquedaTarifasMinimasController.lhMarca.label = Marca +busquedaTarifasMinimasController.lhOrigem.label = Origen +busquedaTarifasMinimasController.lhDestino.label = Destino +busquedaTarifasMinimasController.lhClaseServicio.label = Tipo de servicio +busquedaTarifasMinimasController.lhPlaza.label = Plaza +busquedaTarifasMinimasController.lhMoneda.label = Moneda + +# Editar Tarifas Mínimas +editarTarifaMinimaController.window.title = Tarifa Mínima +editarTarifaMinimaController.btnApagar.tooltiptext = Eliminar +editarTarifaMinimaController.btnSalvar.tooltiptext = Registrar Tarifa Mínima +editarTarifaMinimaController.btnFechar.tooltiptext = Cerrar +editarTarifaMinimaController.btnFechar.MSG.SuscbrirOK = Tarifa mínima registrada. +editarTarifaMinimaController.btnFechar.MSG.borrarOK = Tarifa mínima se eliminó exitosamente. +editarTarifaMinimaController.btnFechar.MSG.Deseja.Borrar = Desea eliminar esta tarifa mínima? +editarTarifaMinimaController.btnFechar.MSG.moneda = Necesita informar una moneda +editarTarifaMinimaController.btnFechar.MSG.plaza = Necesita informar una plaza +editarTarifaMinimaController.btnFechar.MSG.marca = Necesita informar una marca +editarTarifaMinimaController.btnFechar.MSG.origen = Necesita informar un origen +editarTarifaMinimaController.btnFechar.MSG.destino = Necesita informar un destino +editarTarifaMinimaController.btnFechar.MSG.tipo = Necesita informar un tipo de servicio + +# Búsqueda de Tarifas: +busquedaTarifaController.window.title = Tarifas +busquedaTarifaController.btnRefresh.tooltiptext = Actualizar +busquedaTarifaController.btnNovo.tooltiptext = Agregar +busquedaTarifaController.btnCerrar.tooltiptext = Cerrar +busquedaTarifaController.lhId.label = ID +busquedaTarifaController.lhPrecio.label = Precio +busquedaTarifaController.lhPrecioExcel.label = Precio Actual +busquedaTarifaController.lhPrecioNuevo.label = Precio Simulado +busquedaTarifaController.lhPrecioOriginal.label = Precio Original +busquedaTarifaController.lhMarca.label = Marca +busquedaTarifaController.lhOrigen.label = Origen +busquedaTarifaController.lhDestino.label = Destino +busquedaTarifaController.lhVia.label = Via +busquedaTarifaController.lhFeciniciovigencia.label = Vigencia +busquedaTarifaController.lhClaseServicio.label = Tipo Servicio +busquedaTarifaController.lhMoneda.label = Moneda +busquedaTarifaController.lhEmpresa.label = Empresa +busquedaTarifaController.lhRuta.label = Ruta +busquedaTarifaController.lhTipoPuntoVenta.label = Canal de venta +busquedaTarifaController.lhCategoria.label = Tipo de pasajero +busquedaTarifaController.lhTramo.label = Tramo +busquedaTarifaController.btnPesquisa.label = Búsqueda +busquedaTarifaController.lhVigencia.label = Vigencia +busquedaTarifaController.lhStatusTarifa.label = Estatus Tarifa +busquedaTarifaController.lhprecioredabierto.label = Precio redondo abierto +busquedaTarifaController.btnAddTarifaCategoria.tooltiptext = Agregar +busquedaTarifaController.btnRmvTarifaCategoria.tooltiptext = Eliminar +busquedaTarifaController.lhTipoPontoVenta.label = Canal de venta +busquedaTarifaController.btnAddTarifaTipoPontoVenta.tooltiptext = Agregar +busquedaTarifaController.btnRmvTarifaTipoPontoVenta.tooltiptext = Eliminar +busquedaTarifaController.MSG.tramo = No encontro ningun registro con ese tramo +busquedaTarifaController.MSG.moneda = No encontro ningun registro con esa moneda +busquedaTarifaController.MSG.marca = No encontro ningun registro con esa marca +busquedaTarifaController.MSG.claseServicio = No encontro ningun registro con ese tipo servicio +busquedaTarifaController.MSG.vigenciaTarifa = No encontro ningun registro con esa vigencia +busquedaTarifaController.MSG.categoria = No encontro ningun registro con ese tipo pasajero +busquedaTarifaController.MSG.tipoPuntoVenta = No encontro ningun registro con ese canal de venta + +# Editar Tarifa: +editarTarifaController.window.title = Tarifa +editarTarifaController.btnFechar.MSG.SuscbrirOK = Tarifa se registró exitosamente. +editarTarifaController.btnFechar.MSG.Deseja.Borrar = Tarifa ¿Desea borrar? +editarTarifaController.btnFechar.MSG.borrarOK = Tarifa se eliminó exitosamente. +editarTarifaController.btnApagar.tooltiptext = Borrar tarifa +editarTarifaController.btnSalvar.tooltiptext = Guardar +editarTarifaController.btnFechar.tooltiptext = Cerrar +editarTarifaController.tabTarifa.label = Tarifa +editarTarifaController.tabTarifaTipoPasajero.label = Tarifa por tipo de pasajero +editarTarifaController.tabTarifaCanalVenta.label = Tarifa por canal de venta +editarTarifaController.MSG.MercadoCompetido = Esa tarifa pertenece a un mercado competido. Desea continuar? +editarTarifaController.MSG.TarifaMinima = Esa tarifa es inferior a la tarifa mínima parametrizada. Desea continuar? +modificacionMasivaTarifasController.MSG.SemVigencia = Seleccione una vigencia. +modificacionMasivaTarifasController.MSG.RegistroSalvos = registro(s) procesado(s) exitosamente. + +# Búsqueda Vigencia Tarifa +busquedaVigenciaTarifaController.window.title = Vigencia Tarifa +busquedaVigenciaTarifaController.btnRefresh.tooltiptext = Actualizar +busquedaVigenciaTarifaController.btnNovo.tooltiptext = Agregar +busquedaVigenciaTarifaController.btnCerrar.tooltiptext = Cerrar +busquedaVigenciaTarifaController.lbFecInicio.value = Fecha Inicio +busquedaVigenciaTarifaController.lbFecFinal.value = Fecha Fin +busquedaVigenciaTarifaController.btnPesquisa.label = Búsqueda +busquedaVigenciaTarifaController.lhFecInicio.label = Fecha Inicio +busquedaVigenciaTarifaController.lhFecFinal.label = Fecha Fin +busquedaVigenciaTarifaController.lbfechabilitacionventa.value = Fecha habilitación venta + +# Editar Vigencia Tarifa +editarVigenciaTarifaController.window.title = Vigencia Tarifa +editarVigenciaTarifaController.btnFechar.MSG.SuscbrirOK = Vigencia se registró exitosamente. +editarVigenciaTarifaController.btnFechar.MSG.Deseja.Borrar = ¿Desea eliminar esta vigencia? +editarVigenciaTarifaController.btnFechar.MSG.borrarOK = Vigencia tarifa se eliminó exitosamente. +editarVigenciaTarifaController.btnApagar.tooltiptext = Eliminar +editarVigenciaTarifaController.btnSalvar.tooltiptext = Guardar +editarVigenciaTarifaController.btnFechar.tooltiptext = Cerrar +editarVigenciaTarifaController.MSG.FimMenorInicio = Vigencia final menor que inicial. +editarVigenciaTarifaController.MSG.conflitoVigencias = La vigencia informada se traslapa con otra ya existente. +editarVigenciaTarifaController.MSG.podeApagar = Hay tarifas con esta vigencia, no se puede eliminarla. +editarVigenciaTarifaController.MSG.fecVenta = Fecha habilitación venta debe estar entre fecha inicio y fecha fin. + +# Tarifa Escala +tarifaEscalaContorller.window.title = Tarifa Escala +tarifaEscalaContorller.btnApagar.tooltiptext = Autorizar Escala +tarifaEscalaContorller.btnExportarExcel.tooltiptext = Exportar Excel +tarifaEscalaContorller.btnSalvar.tooltiptext = Guardar +tarifaEscalaContorller.btnFechar.tooltiptext = Cerrar +tarifaEscalaContorller.lhRuta.label = Ruta +tarifaEscalaContorller.lhFeciniciovigencia.label = Vigencia +tarifaEscalaContorller.lhMarca.label = Marca +tarifaEscalaContorller.lhMoneda.label = Moneda +tarifaEscalaContorller.lhClaseServicio.label = Tipo Servicio +tarifaEscalaContorller.MSGSelecioneEscala = Seleccione una escala de tarifa. +tarifaEscalaContorller.MSGEscalaAutoriazada = Escala autorizada exitosamente. +tarifaEscalaContorller.MSGAutoriazarEscala = Desea guardar y autorizar escala? +tarifaEscalaContorller.MSGTarifasAtualizadas = Tarifa(s) atualizada(s) exitosamente. +tarifaEscalaContorller.MSGNOPodeAlterarTarifaMinima = La(s) siguiente(s) tarifa(s) no respeta(n) la tarifa mínima: +tarifaEscalaContorller.MSGSelMarca = Seleccione una marca. +tarifaEscalaContorller.MSGSelClaseServicio = Seleccione un tipo de servicio. +tarifaEscalaContorller.MSGAlterarTarifaMercadoCompetido = Esa tarifa es parte de un mercado competido, desea modificarla? +tarifaEscalaContorller.MSG.noAutorizado = ROJO = NO AUTORIZADA + +# Búsqueda Mercado Competido +busquedaMercadoCompetidoController.window.title = Mercado Competido +busquedaMercadoCompetidoController.btnRefresh.tooltiptext = Actualizar +busquedaMercadoCompetidoController.btnNovo.tooltiptext = Agregar +busquedaMercadoCompetidoController.btnCerrar.tooltiptext = Cerrar +busquedaMercadoCompetidoController.lhId.label = ID +busquedaMercadoCompetidoController.lhClaseServicio.label = Tipo de servicio +busquedaMercadoCompetidoController.lhOrigem.label = Origen +busquedaMercadoCompetidoController.lhDestino.label = Destino +busquedaMercadoCompetidoController.btnPesquisa.label = Búsqueda + +# Editar Mercado Competido +editarMercadoCompetidoController.window.title = Mercado Competido +editarMercadoCompetidoController.btnApagar.tooltiptext = Eliminar +editarMercadoCompetidoController.btnSalvar.tooltiptext = Guardar +editarMercadoCompetidoController.btnFechar.tooltiptext = Cerrar +editarMercadoCompetidoController.btnFechar.MSG.SuscbrirOK = Mercado competido se registró exitosamente. +editarMercadoCompetidoController.btnFechar.MSG.Deseja.Borrar = ¿Desea eliminar este mercado competido? +editarMercadoCompetidoController.btnFechar.MSG.BorrarOK = Mercado competido se eliminó exitosamente. + +#Senda Amigo - Búsqueda Senda amigo - Acumulacion Por Venta +busquedaAcumulacionPorVentaController.window.title = Configuración Acumulación por venta +busquedaAcumulacionPorVentaController.lhId.label = ID +busquedaAcumulacionPorVentaController.lhOrigen.label = Origen +busquedaAcumulacionPorVentaController.lhDestino.label = Destino +busquedaAcumulacionPorVentaController.lhFechainicial.label = Fecha Inicial +busquedaAcumulacionPorVentaController.lhFechafinal.label = Fecha Final +busquedaAcumulacionPorVentaController.lhPorcentaje.label = Porcentaje +busquedaAcumulacionPorVentaController.btnPesquisa.label = Búsqueda +busquedaAcumulacionPorVentaController.lhVigencia.label = Fechas de Vigencia +busquedaAcumulacionPorVentaController.Boletos.label = Boletos por Operación +busquedaAcumulacionPorVentaController.Operaciones.label = Operaciones por día +busquedaAcumulacionPorVentaController.tipodepasajero = Tipo de pasajero + +#Senda Amigo - Editar Senda amigo - Acumulacion Por Venta +editarParamAcumulaPuntoController.window.title = Configuración para Acumulación por venta +editarParamAcumulaPuntoController.btnFechar.MSG.SuscbrirOK = Acumulación por venta se registró exitosamente. +editarParamAcumulaPuntoController.btnFechar.MSG.Deseja.Borrar = Acumulación por venta ¿Desea borrar? +editarParamAcumulaPuntoController.btnFechar.MSG.borrarOK = Acumulación por venta se eliminó exitosamente. +editarParamAcumulaPuntoController.btnApagar.tooltiptext = Eliminar +editarParamAcumulaPuntoController.btnSalvar.tooltiptext = Guardar +editarParamAcumulaPuntoController.btnFechar.tooltiptext = Cerrar +editarParamAcumulaPuntoController.Porcentaje.value = Porcentaje +editarParamAcumulaPuntoController.PorcentajeM.value = Porcentaje mercado +editarParamAcumulaPuntoController.PorcentajeE.value = Porcentaje empresa +editarParamAcumulaPuntoController.PorcentajeF.value = Porcentaje forma pago +editarParamAcumulaPuntoController.PorcentajeC.value = Porcentaje categoria +editarParamAcumulaPuntoController.Boletos.label = Boletos por Operación +editarParamAcumulaPuntoController.Operaciones.label = Operaciones por día +editarParamAcumulaPuntoController.Fpago.label = Forma pago +editarParamAcumulaPuntoController.Fecha.label = Fecha de Vigencias +editarParamAcumulaPuntoController.Empresa.label = Empresa +editarParamAcumulaPuntoController.Categoria.label = Categoria +editarParamAcumulaPuntoController.Pasajero.label = Pasajero +editarParamAcumulaPuntoController.lhOrigen.label = Origen +editarParamAcumulaPuntoController.lhDestino.label = Destino +editarParamAcumulaPuntoController.MSG.suscribirOK = Acumulación por venta se registró exitosamente. +editarParamAcumulaPuntoController.MSG.borrarPergunta = ¿Desea eliminar acumulación por venta? +editarParamAcumulaPuntoController.MSG.borrarOK = Acumulación por venta se eliminó exitosamente. +editarParamAcumulaPuntoController.MSG.boleto = Boleto por operación ou operaciones por día vazio. +editarParamAcumulaPuntoController.MSG.fecha = Fecha inicial ou fecha final em branco. +editarParamAcumulaPuntoController.MSG.cmbDestino = Origen ou destino em branco. +editarParamAcumulaPuntoController.MSG.busquedaPeriodo = Fecha de inicio posterior a la fecha final. + +#Senda Amigo - Búsqueda Senda amigo - Canje de Puntos +busquedaParamCanjePuntoController.window.title = Configuración para Canje de puntos +busquedaParamCanjePuntoController.lhOrigen.label = Origen +busquedaParamCanjePuntoController.lhDestino.label = Destino +busquedaParamCanjePuntoController.lhFechainicial.label = Fecha Inicial +busquedaParamCanjePuntoController.lhFechafinal.label = Fecha Final +busquedaParamCanjePuntoController.lhPorcentaje.label = Porcentaje +busquedaParamCanjePuntoController.btnPesquisa.label = Búsqueda +busquedaParamCanjePuntoController.lhVigencia.label = Fechas de Vigencia + +#Senda Amigo - Editar Senda amigo - Acumulacion Por Venta +editarParamCanjePuntoController.window.title = Configuración para Canje de Puntos +editarParamCanjePuntoController.btnFechar.MSG.SuscbrirOK = Canje de puntos se registró exitosamente. +editarParamCanjePuntoController.btnFechar.MSG.Deseja.Borrar = Canje de puntos ¿Desea borrar? +editarParamCanjePuntoController.btnFechar.MSG.borrarOK = Canje de punto se eliminó exitosamente. +editarParamCanjePuntoController.btnApagar.tooltiptext = Eliminar +editarParamCanjePuntoController.btnSalvar.tooltiptext = Guardar +editarParamCanjePuntoController.btnFechar.tooltiptext = Cerrar +editarParamCanjePuntoController.Porcentaje.value = Porcentaje Aplicar +editarParamCanjePuntoController.Boletos.value = Boletos por Operación +editarParamCanjePuntoController.Operaciones.value = Operaciones por día +editarParamCanjePuntoController.MSG.suscribirOK = Canje de punto se registró exitosamente. +editarParamCanjePuntoController.MSG.borrarPergunta= ¿Desea eliminar canje de punto? +editarParamCanjePuntoController.MSG.borrarOK= Canje de punto se eliminó exitosamente. +editarParamCanjePuntoController.MSG.busquedaPeriodo= Fecha de inicio posterior a la fecha final. + +#Senda Amigo - busquedaParamCostoTarjeta +busquedaParamCostoTarjetaController.window.title = Configuración costo tarjeta +busquedaParamCostoTarjetaController.lhEmpresa.label = Empresa +busquedaParamCostoTarjetaController.lhPrecio.label = Precio +busquedaParamCostoTarjetaController.btnPesquisa.label = Búsqueda + +#Senda Amigo - Editar Senda amigo - Acumulacion Por Venta +editarParamCostoTarjetaController.window.title = Configuración costo tarjeta +editarParamCostoTarjetaController.btnFechar.MSG.SuscbrirOK = Tarjeta se registró exitosamente. +editarParamCostoTarjetaController.btnFechar.MSG.Deseja.Borrar = Tarjeta ¿Desea borrar? +editarParamCostoTarjetaController.btnFechar.MSG.borrarOK = Tarjeta se eliminó exitosamente. +editarParamCostoTarjetaController.btnApagar.tooltiptext = Eliminar +editarParamCostoTarjetaController.btnSalvar.tooltiptext = Guardar +editarParamCostoTarjetaController.btnFechar.tooltiptext = Cerrar +editarParamCostoTarjetaController.Empresa.value = Empresa +editarParamCostoTarjetaController.Precio.value = Precio por otorgar +editarParamCostoTarjetaController.MSG.suscribirOK = Tarjeta se registró exitosamente. +editarParamCostoTarjetaController.MSG.borrarPergunta = ¿Desea eliminar Tarjeta? +editarParamCostoTarjetaController.MSG.borrarOK = Tarjeta se eliminó exitosamente. + +#Senda Amigo - busquedaParamAcumulacionMasivoController +busquedaParamAcumulacionMasivoController.window.title = Configuración para Acumulación Masiva +busquedaParamAcumulacionMasivoController.lhId.label = ID +busquedaParamAcumulacionMasivoController.lhPunto.label = Empresa +busquedaParamAcumulacionMasivoController.lhPunto2.label = Empresa +busquedaParamAcumulacionMasivoController.lhMax.label = Máximo +busquedaParamAcumulacionMasivoController.lhMin.label = Mínimo +busquedaParamAcumulacionMasivoController.btnPesquisa.label = Búsqueda + +#Senda Amigo - editar Masivo +editarParamAcumulaMasivoController.window.title = Configuración para Acumulación Masiva +editarParamAcumulaMasivoController.btnFechar.MSG.SuscbrirOK = Acumulación masiva se registró exitosamente. +editarParamAcumulaMasivoController.btnFechar.MSG.Deseja.Borrar = Acumulación masiva ¿Desea borrar? +editarParamAcumulaMasivoController.btnFechar.MSG.borrarOK = Acumulación masiva se eliminó exitosamente. +editarParamAcumulaMasivoController.btnApagar.tooltiptext = Eliminar +editarParamAcumulaMasivoController.btnSalvar.tooltiptext = Guardar +editarParamAcumulaMasivoController.btnFechar.tooltiptext = Cerrar +editarParamAcumulaMasivoController.lhMax.label = Máximo +editarParamAcumulaMasivoController.lhMin.label = Mínimo +editarParamAcumulaMasivoController.lhPunto.label = Empresa +editarParamAcumulaMasivoController.lhPunto2.label = Empresa +editarParamAcumulaMasivoController.MSG.suscribirOK = Acumulación masiva se registró exitosamente. +editarParamAcumulaMasivoController.MSG.borrarPergunta = ¿Desea eliminar acumulación masiva? +editarParamAcumulaMasivoController.MSG.borrarOK = Acumulación masiva se eliminó exitosamente. +editarParamAcumulaMasivoController.MSG.conflitoVigencias = La vigencia informada se traslapa con otra ya existente. + +#Senda Amigo - busquedaParamCompraPuntoController +busquedaParamCompraPuntoController.window.title = Configuración para Compra de puntos +busquedaParamAcumulacionMasivoController.lhMultiplos.label = Múltiplos +busquedaParamAcumulacionMasivoController.lhCosto.label = Costo por Puntos +busquedaParamAcumulacionMasivoController.lhFecIni.label = Fecha Inicio +busquedaParamAcumulacionMasivoController.lhFecFim.label = Fecha Final +busquedaParamCompraPuntoController.btnPesquisa.label = Búsqueda + +#Senda Amigo - editar ParamCompraPuntoController +editarParamCompraPuntoController.window.title = Configuración para Compra de puntos +editarParamCompraPuntoController.btnFechar.MSG.SuscbrirOK = Configuración para compra se registró exitosamente. +editarParamCompraPuntoController.btnFechar.MSG.Deseja.Borrar = Configuración para compra ¿Desea borrar? +editarParamCompraPuntoController.btnFechar.MSG.borrarOK = Configuración para compra se eliminó exitosamente. +editarParamCompraPuntoController.lhCantidad.label = Cantidad (múltiplos) +editarParamCompraPuntoController.lhCosto.label = Costo por puntos +editarParamCompraPuntoController.lhIni.label = Fecha Inicio +editarParamCompraPuntoController.lhFim.label = Fecha Final +editarParamCompraPuntoController.MSG.suscribirOK = Configuración para compra se registró exitosamente. +editarParamCompraPuntoController.MSG.borrarPergunta = ¿Desea eliminar configuración para compra? +editarParamCompraPuntoController.MSG.borrarOK = Configuración para compra se eliminó exitosamente. +editarParamCompraPuntoController.MSG.busquedaPeriodo= Fecha de inicio posterior a la fecha final. + +# Cambio de Vigencias +cambioVigenciaController.window.title = Cambio de Vigencia +cambioVigenciaController.btnFechar.tooltiptext = Cerrar +cambioVigenciaController.Vigencia = Vigencia Original +cambioVigenciaController.MSGCambiarSucesso = Actualizacion vigencia exitosamente. +cambioVigenciaController.MSGCambiarVigencias = ¿Desea cambiar vigencia? +cambioVigenciaController.NovaVigencia = Vigencia Nueva +cambioVigenciaController.btnCambiarVigencia.label = Mover Tarifas de Vigencia + +# Modificacion Masiva Tarifa +modificacionMasivaTarifasController.window.title = Modificación Masiva de Tarifas +modificacionMasivaTarifasController.porcentagem.label = % (0-100) +modificacionMasivaTarifasController.MSGAplicar = Aplicar modificación? +modificacionMasivaTarifasController.MSGAplicadoSucesso = Modificación aplicada exitosamente. Esperar el archivo de resultados. +modificacionMasivaTarifasController.radIncremento = Incremento +modificacionMasivaTarifasController.radDecremento = Decremento +modificacionMasivaTarifasController.tipoModificacion = Tipo Modificación +modificacionMasivaTarifasController.btnUpLoadExcel.tooltiptext = Importar Excel autorizado. +modificacionMasivaTarifasController.btnUpLoadExcel.label = Importar Excel autorizado +modificacionMasgeracionCorridaController.MSG.ForaVigenciaivaTarifasController.btnUpLoadExcel.label = Importar Excel autorizado +modificacionMasivaTarifasController.btnGerarExcel.label = Generar Excel con simulación +modificacionMasivaTarifasController.btnGerarExcel.tooltiptext = Generar Excel con simulación. +modificacionMasivaTarifasController.MSG.SemVigencia = Seleccione una vigencia. +modificacionMasivaTarifasUploadController.MSG.pergunta = Seleccione la vigencia la cual será aplicada la modificación: +modificacionMasivaTarifasUploadController.MSG.radioUno = Vigencia seleccionada: {0} +modificacionMasivaTarifasUploadController.MSG.radioDos = Otra vigencia: +modificacionMasivaTarifasUploadController.MSG.salvar = Aplicar Modificaciones +modificacionMasivaTarifasUploadController.MSG.excel = Error a importar archivo Excel. + +#Geracion de Corrida +geracionCorridaController.window.title = Generación de Corridas +geracionCorridaController.lhGerar.label = Generar corridas +geracionCorridaController.MSG.gerarPergunta = ¿Desea generar corridas hasta la fecha de {0}? +geracionCorridaController.Data = Fecha +geracionCorridaController.MSG.ok = Generación exitosa de corridas. +geracionCorridaController.MSG.ForaVigencia = No hay planeación vigente para esta fecha. +geracionCorridaController.MSG.qtdDias = Valor inválido na configuração general ({0}). + +# Búsqueda de Corrida +editarPricingCorridaController.lbFecInicio.value = Fecha Inicio +editarPricingCorridaController.lbFecFinal.value = Fecha Fin +editarPricingCorridaController.labelOrigen.value = Origen +editarPricingCorridaController.labelDestino.value = Destino +editarPricingCorridaController.lhId.label = ID +editarPricingCorridaController.feccorrida.label = Fecha +editarPricingCorridaController.fechorsalida.label = Hora Salida +editarPricingCorridaController.claseServicio.label = Tipo Servicio +editarPricingCorridaController.marca.label = Marca +editarPricingCorridaController.btnPesquisa.label = Búsqueda +editarPricingCorridaController.lblInicio.value = Hora Salida Inicio +editarPricingCorridaController.lblFin.value = Hora Salida Fin + +#Pricing - busquedaPricingController +busquedaPricingController.window.title = Pricing +busquedaPricingEspecificoController.window.title = Pricing Específico +busquedaPricingController.lhEmpresa.label = Empresa +busquedaPricingController.lhNome.label = Nombre Pricing +busquedaPricingController.btnPesquisa.label = Búsqueda +busquedaPricingController.btnRefresh.tooltiptext = Actualizar +busquedaPricingController.btnCerrar.tooltiptext = Cerrar + +#Pricing - busquedaPricingController +editarPricingController.MSG.porcentajeCero = Cuando se informa el pricing por asiento o ocupación, el porcentaje principal tienes que quedar como cero +editarPricingController.window.title = Pricing +editarPricingController.windowEspecifico.title = Pricing Específico +editarPricingController.windowVigencia.title = Vigencia +editarPricingController.windowTramo.title = Tramo +editarPricingController.lhTramo.label = Tramo +editarPricingController.windowImporte.title = Importe +editarPricingController.windowMarca.title = Marca +editarPricingController.windowClase.title = Tipo Servicio +editarPricingController.windowTipoServicio.title = Tipo Servicio +editarPricingController.windowPuntoVenta.title = Punto venta +editarPricingController.windowTipoPtoVta.title = Canal venta +editarPricingController.windowCategoria.title = Tipo pasajero +editarPricingController.windowRuta.title = Ruta +editarPricingController.windowMercado.title = Mercado +editarPricingController.windowDia.title = Día de la semana +editarPricingController.windowCorrida.title = Corrida +editarPricingController.msgSencillo.title = Porcentaje sencillo mayor de lo permitido +editarPricingController.msgRedondo.title = Porcentaje viaje redondo mayor de lo permitido +editarPricingController.windowOcupacion.title = Ocupación +editarPricingController.windowAsiento.title = Asiento +editarPricingController.windowAnticipacion.title = Anticipación +editarPricingController.windowTipoServicio.title = Tipo servicio +editarPricingController.btnApagar.tooltiptext = Eliminar +editarPricingController.btnSalvar.tooltiptext = Guardar +editarPricingController.btnFechar.tooltiptext = Cerrar +editarPricingController.tarifia.label = Tarifa +editarPricingController.tarifiaredondoabierto.label = Tarifa redondo abierto +editarPricingController.tabGen.label = General +editarPricingController.tabApl.label = Aplicación +editarPricingController.tabMer.label = Mercado +editarPricingController.tabCor.label = Corridas +editarPricingController.tabAsi.label = Asientos +editarPricingController.tabOcu.label = Ocupación +editarPricingController.tabAnti.label = Anticipación +editarPricingController.tabTipo.label = Tipo servicio +editarPricingController.lhEmpresa.label = Empresa +editarPricingController.lhNome.label = Nome Pricing +editarPricingController.lhCantidad.label = Cantidad asientos por corrida +editarPricingController.lhFechaInicio.label = Fecha inicio +editarPricingController.lhFechaFin.label = Fecha fin +editarPricingController.lhFechaHoraInicio.label = Fecha y hora inicio +editarPricingController.lhFechaHoraInicioLH.label = Fecha inicio +editarPricingController.lhFechaHoraFin.label = Fecha y hora fin +editarPricingController.lhFechaHoraFin.labelLH = Fecha fin +editarPricingController.lhPorcSen.label = Porcentaje sencillo +editarPricingController.lhPorcRed.label = Porcentaje viaje redondo +editarPricingController.lhCantDias.label = Días de anticipación +editarPricingController.nombrePricing.label = Nombre pricing +editarPricingController.nombrePricingEsp.label = Nombre pricing específico +editarPricingController.trans.label = Transferible +editarPricingController.origem.label = Origen +editarPricingController.destino.label = Destino +editarPricingController.cance.label = Cancelable +editarPricingController.reser.label = Reservable +editarPricingController.si.label = Sí +editarPricingController.no.label = No +editarPricingController.lbVig.label = Vigencias +editarPricingController.lbImp = Importe +editarPricingController.lblDescuento.value = Tipo Pricing +editarPricingController.vigencia.value = Vigencias +editarPricingController.vigInicioViaje.value = Inicio viaje +editarPricingController.vigFinViaje.value = Fin viaje +editarPricingController.vigHoraInicioViaje.value = Fecha inicio viaje +editarPricingController.vigHoraFinViaje.value = Fecha fin viaje +editarPricingController.vigInicioVenta.value = Inicio venta +editarPricingController.vigFinVenta.value = Fin venta +editarPricingController.importe.value = Importe +editarPricingController.impImp.value = Importe +editarPricingController.impMon.value = Moneda +editarPricingController.btnModificar.value = Modificar +editarPricingController.btnNovoImporte.tooltiptext = Agregar +editarPricingController.btnApagarImporte.tooltiptext = Eliminar +editarPricingController.btnNovoMarca.tooltiptext = Agregar +editarPricingController.btnNovoClasse.tooltiptext = Agregar +editarPricingController.btnNovoPuntoVenta.tooltiptext = Agregar +editarPricingController.btnNovoMercado.tooltiptext = Agregar +editarPricingController.btnNovoRuta.tooltiptext = Agregar +busquedaPricingController.btnNovo.tooltiptext = Agregar +editarPricingController.btnNovoTipoPtoVta.tooltiptext = Agregar +editarPricingController.btnNovoCategoria.tooltiptext = Agregar +editarPricingController.btnApagarPricing.tooltiptext = Eliminar +editarPricingController.btnNovoDia.tooltiptext = Agregar +editarPricingController.btnNovoCorrida.tooltiptext = Agregar +editarPricingController.btnNovoAsiento.tooltiptext = Agregar +editarPricingController.btnNovoOcupacion.tooltiptext = Agregar +editarPricingController.btnNovoVigencia.tooltiptext = Agregar +editarPricingController.btnApagarVigencia.tooltiptext = Eliminar +editarPricingController.MSG.suscribirOK = Configuración de pricing se registró exitosamente. +editarPricingController.MSG.borrarPergunta = ¿Desea eliminar configuración de pricing? +editarPricingController.MSG.borrarOK = Configuración de pricing se eliminó exitosamente. +editarPricingController.MSG.fechaViaje = Fecha inicio de viaje posterior a la fecha final. +editarPricingController.MSG.fechaVenta = Fecha inicio de venta posterior a la fecha final. +editarPricingController.MSG.selectItem = Selecciona un Elemento. +editarPricingController.MSG.borrarPerguntaVigencia = ¿Desea eliminar vigencia? +editarPricingController.MSG.borrarPerguntaImporte = ¿Desea eliminar importe? +editarPricingController.MSG.borrarPerguntaMarca = ¿Desea eliminar marca? +editarPricingController.MSG.borrarPerguntaClase = ¿Desea eliminar tipo de servicio? +editarPricingController.MSG.borrarPerguntaPuntoVenta = ¿Desea eliminar el Punto de Venta? +editarPricingController.MSG.borrarPerguntaRuta = ¿Desea eliminar ruta? +editarPricingController.MSG.borrarPerguntaMercado = ¿Desea eliminar mercado? +editarPricingController.MSG.borrarPerguntaCategoria = ¿Desea eliminar tipo pasajero? +editarPricingController.MSG.borrarPerguntaTipoPtoVta = ¿Desea eliminar canal de venta? +editarPricingController.MSG.borrarPerguntaDia = ¿Desea eliminar día de la semana y horario? +editarPricingController.MSG.borrarPerguntaCorrida = ¿Desea eliminar corrida? +editarPricingController.MSG.borrarPerguntaOcupacion = ¿Desea eliminar ocupación? +editarPricingController.MSG.borrarPerguntaAsiento = ¿Desea eliminar asiento? +editarPricingController.MSG.borrarPerguntaAnticipacion = ¿Desea eliminar anticipación? +editarPricingController.MSG.borrarPerguntaTipoServicio = ¿Desea eliminar tipo servicio? +editarPricingController.MSG.categoriaExiste = Registro duplicado. +editarPricingController.MSG.rutaExiste = Registro duplicado. +editarPricingController.MSG.mercadoExiste = Registro duplicado. +editarPricingController.MSG.tipoPuntoExiste = Registro duplicado. +editarPricingController.MSG.claseExiste = Registro duplicado. +editarPricingController.MSG.corridaExiste = Registro duplicado. +editarPricingController.MSG.puntoVentaExiste = Registro duplicado. +editarPricingController.MSG.asientoExiste = Registro duplicado. +editarPricingController.MSG.vigenciaExiste = Fecha inicio - fin de venta informada se traslapa con otra ya existente. +editarPricingController.MSG.corrida = Esta corrida no existe. +editarPricingController.MSG.datas = Hora de inicio posterior a la hora final. +editarPricingController.MSG.datasFecha = Fecha y hora inicio posterior a fecha y hora fin. +editarPricingController.MSG.datas1 = La fecha de inicio de venta tiene que ser menor o igual a la fecha de inicio de viaje. +editarPricingController.MSG.datas2 = La fecha de fin de venta no puede ser mayor que la fecha de fin de viaje. +editarPricingController.MSG.tipoPtoVtaVazio = Necesita informar un canal de venta en la pestaña de Aplicación +editarPricingController.MSG.categoriaVazio = Necesita informar un tipo pasajero en la pestaña de Aplicación +editarPricingController.MSG.marcaVazio = Necesita informar una marca en la pestaña de Aplicación +editarPricingController.MSG.rutaVazio = Necesita informar una ruta en la pestaña de Aplicación +editarPricingController.MSG.claseVazio = Necesita informar un tipo de servicio en la pestaña de Aplicación +editarPricingController.MSG.puntoVazio = Necesita informar un punto de venta en la pestaña de Aplicación +editarPricingController.MSG.mercadoVazio = Necesita informar un mercado en la pestaña de mercado +editarPricingController.MSG.empresaVazio = Necesita informar una Empresa +editarPricingController.MSG.nomPricingVazio = Necesita informar el Nombre del Pricing +editarPricingController.MSG.cantDiasAntecipacionVazio = Necesita informar la cantidad de Días de Antecipación +editarPricingController.MSG.cantAsientosCorridasVazio = Necesita informar la cantidad de asientos por Corrida +editarPricingController.MSG.cantImportePricingVazio = Necesita los Importes +editarPricingController.MSG.porcentajeSencilloVazio = Necesita informar la Porcentaje Sencillo +editarPricingController.MSG.porcentajeRedondoVazio = Necesita informar la Porcentaje de Viaje Redondo +editarPricingController.MSG.vigenciasVazio = Necesita informar las Vigencias +editarPricingController.MSG.existeMoneda = Moneda duplicada. +editarPricingController.moneda.value = Moneda +editarPricingController.marca.value = Marca +editarPricingController.clase.value = Tipo de servicio +editarPricingController.punto.value = Punto de venta +editarPricingController.ptovta.value = Canal de venta +editarPricingController.ruta.value = Ruta +editarPricingController.mercado.value = Mercado +editarPricingController.categoria.value = Tipo pasajero +editarPricingController.mercadoOrigen.value = Origen +editarPricingController.mercadoDestino.value = Destino +editarPricingController.MSG.mercadoIguais = Igualdad de origen y de destino. +editarPricingController.porDia.value = Por día de la semana y horario +editarPricingController.porCorrida.value = Por corrida +editarPricingController.lbDias.value = Días de la Semana +editarPricingController.lbLunM.value = Lun +editarPricingController.lbMarM.value = Mar +editarPricingController.lbMieM.value = Mié +editarPricingController.lbJueM.value = Jue +editarPricingController.lbVieM.value = Vie +editarPricingController.lbSabM.value = Sáb +editarPricingController.lbDomM.value = Dom +editarPricingController.hIni.value = Horario Inicial +editarPricingController.hFim.value = Horario Final +editarPricingController.corridaId.value = Nº Corrida +editarPricingController.corridaHora.value = Hora Corrida +editarPricingController.asiento.value = Asiento +editarPricingController.nombAsiento.value = Nombre Asiento +editarPricingController.ocupacion.value = Ocupación +editarPricingController.porcentaje.value = Porcentaje % +editarPricingController.ocupacionMin.value = Ocupación Mínima +editarPricingController.ocupacionMax.value = Ocupación Máxima +editarPricingController.ocupacionPorcentaje.value = Porcentaje mayor que 100% +editarPricingController.ocupacionErrada.value = Ocupación mínima mayor que ocupación máxima. +editarPricingController.ocupacionErrada = Ocupación informada se traslapa con otra ya existente. +editarPricingController.anticipacionPorcentaje.value = Porcentaje mayor que 100% +editarPricingController.anticipacionErrada.value = Anticipación mínima mayor que ocupación máxima. +editarPricingController.anticipacionErrada = Anticipación informada se traslapa con otra ya existente. +editarPricingController.MSG.tipoPtoVta = Necesita informar un canal de venta +editarPricingController.MSG.categoria = Necesita informar un tipo pasajero +editarPricingController.MSG.claseServicio = Necesita informar un tipo servicio +editarPricingController.MSG.marca = Necesita informar una marca +editarPricingController.MSG.origen = Necesita informar un origen +editarPricingController.MSG.destino = Necesita informar un destino +editarPricingController.MSG.moneda = Necesita informar una moneda +editarPricingController.MSG.traslapa = Hora informada se traslapa con otra ya existente. +editarPricingController.anticipacionMin.value = Cantidad dias mínimo +editarPricingController.anticipacionMax.value = Cantidade dias máximo +editarPricingController.tipoServicio.value = Tipo Servicio + +# Búsqueda Sistema +busquedaSistemaController.window.title = Sistema +busquedaSistemaController.btnRefresh.tooltiptext = Actualizar +busquedaSistemaController.btnNovo.tooltiptext = Agregar +busquedaSistemaController.btnCerrar.tooltiptext = Cerrar +busquedaSistemaController.btnPesquisa.label = Búsqueda +busquedaSistemaController.lhId.label = ID +busquedaSistemaController.lhDesc.label = Sistema + +# Editar Sistema +editarSistemaController.window.title = Sistema +editarSistemaController.lbNome.value = Sistema +editarSistemaController.MSG.suscribirOK = Sistema registró. +editarSistemaController.MSG.borrarPergunta = ¿Desea borrar el Sistema? +editarSistemaController.MSG.borrarOK = Sistema se eliminó exitosamente. +editarSistemaController.btnFechar.tooltiptext = Cerrar +editarSistemaController.btnApagar.tooltiptext = Eliminar +editarSistemaController.btnSalvar.tooltiptext = Guardar + +# Búsqueda Menu +busquedaMenuController.window.title = Menu +busquedaMenuController.btnPesquisa.label = Búsqueda +busquedaMenuController.btnRefresh.tooltiptext = Actualizar +busquedaMenuController.btnNovo.tooltiptext = Agregar +busquedaMenuController.btnCerrar.tooltiptext = Cerrar +busquedaMenuController.lhId.label = ID +busquedaMenuController.lhNombFuncion.label = Nombre menu +busquedaMenuController.lhDescruta.label = Descripción ruta +busquedaMenuController.lhSistema.label = Sistema + +# Editar Menu +editarMenuController.window.title = Menu +editarMenuController.MSG.suscribirOK = Menu registrado. +editarMenuController.MSG.borrarPergunta = ¿Desea borrar el Menu? +editarMenuController.MSG.borrarOK = Menu se eliminó exitosamente. +editarMenuController.btnApagar.tooltiptext = Eliminar +editarMenuController.btnSalvar.tooltiptext = Guardar +editarMenuController.btnFechar.tooltiptext = Cerrar + +# Búsqueda Perfil +busquedaPerfilController.window.title = Perfil +busquedaPerfilController.btnRefresh.tooltiptext = Actualizar +busquedaPerfilController.btnNovo.tooltiptext = Agregar +busquedaPerfilController.btnCerrar.tooltiptext = Cerrar +busquedaPerfilController.lhId.label = ID +busquedaPerfilController.lhDesc.label = Perfil +busquedaPerfilController.btnPesquisa.label = Búsqueda + +# Editar Perfil +editarPerfilController.window.title = Perfil +editarPerfilController.btnApagar.tooltiptext = Eliminar +editarPerfilController.btnSalvar.tooltiptext = Guardar +editarPerfilController.btnFechar.tooltiptext = Cerrar +editarPerfilController.lbNome.value = Perfil +editarPerfilController.lhPermiso.label = Función +editarPerfilController.btnAddPermiso.tooltiptext = Agregar +editarPerfilController.btnBorrarPermiso.tooltiptext = Eliminar +editarPerfilController.MSG.suscribirOK = Perfil se registró exitosamente. +editarPerfilController.MSG.borrarPergunta =¿Eliminar el Perfil? +editarPerfilController.MSG.borrarOK = Perfil se eliminó exitosamente. +editarPerfilController.MSG.funcionObligatorio = Debe de informar al menos un menu para el perfil + +# Búsqueda Usuario +busquedaUsuarioController.window.title = Usuario +busquedaUsuarioController.btnRefresh.tooltiptext = Actualizar +busquedaUsuarioController.btnNovo.tooltiptext = Agregar +busquedaUsuarioController.btnCerrar.tooltiptext = Cerrar +busquedaUsuarioController.lhId.label = ID +busquedaUsuarioController.cveEmpleado.label = Clave de Empleado +busquedaUsuarioController.nombusuario.label = Nombre usuario +busquedaUsuarioController.nombpaterno.label = Apellido paterno +busquedaUsuarioController.nombmaterno.label = Apellido materno +busquedaUsuarioController.perfil.label = Perfil +busquedaUsuarioController.btnPesquisa.label = Búsqueda + +# Editar Usuario +editarUsuarioController.window.title = Usuario +editarUsuarioController.tabel.ubicacion = Ubicación +editarUsuarioController.MSG.suscribirOK = Usuario se registró exitosamente. +editarUsuarioController.MSG.borrarPergunta = ¿Eliminar el usuario? +editarUsuarioController.MSG.borrarOK = Usuario se eliminó exitosamente. +editarUsuarioController.MSG.empleado = Empleado no existe. +editarUsuarioController.MSG.existeEmpleado = Existe un Usuario con la clave {0} dado de alta +editarUsuarioController.MSG.necessitaUbicacion = Es necesario informar una ubicación. +editarUsuarioController.senha.label = Contraseña +editarUsuarioController.confirmarsenha.label = Confirmar contraseña +editarUsuarioController.MSG.configmSenha = Por favor, confirmar la contraseña. +editarUsuarioController.btnAdicionarUbicacion.tooltiptext = Agregar +editarUsuarioController.btnRemoverUbicacion.tooltiptext = Eliminar +editarUsuarioController.lhParada.label = Parada +editarUsuarioController.lhPuntoVenta.label = Punto de venta +busquedaUsuarioController.CveUsuario.label = Clave de Usuario +busquedaUsuarioController.CveEmpleado.label = Clave de Empleado + + +#cREADO POR mANUEL + +#Pantalla Busuqeda Grupo Cortesías + +busquedaGrupoCortesiasController.window.title = Grupo Cortesías +busquedaGrupoCortesiasController.btnRefresh.tooltiptext = Actualizar +busquedaGrupoCortesiasController.btnNovo.tooltiptext = Agregar +busquedaGrupoCortesiasController.btnCerrar.tooltiptext = Cerrar +busquedaGrupoCortesiasController.btnPesquisa.label = Búsqueda +busquedaGrupoCortesiasController.lhId.label = ID +busquedaGrupoCortesiasController.lhNomeG.label = Descripción +busquedaGrupoCortesiasController.txtNombre.label = Grupo Cortesía + +#Pantalla Editar Grupo Cortesías + + +editarGrupoCortesiasController.window.title = Grupo Cortesía +editarGrupoCortesiasController.btnApagar.tooltiptext = Eliminar grupo cortesía +editarGrupoCortesiasController.btnSalvar.tooltiptext = Guardar +editarGrupoCortesiasController.btnFechar.tooltiptext = Cerrar +editarGrupoCortesiasController.lbNome.value = Grupo Cortesía +editarGrupoCortesiasController.MSG.suscribirOK = Grupo cortesía se registró exitosamente. +editarGrupoCortesiasController.MSG.BorrarPergunta = ¿Desea eliminar grupo cortesía? +editarGrupoCortesiasController.MSG.BorrarOK = Grupo cortesía se eliminó exitosamente. + + + +#Pantalla Búsqueda Tipo Cortesía + +busquedaTipoCortesiaController.window.title = Tipo Cortesía +busquedaTipoCortesiaController.btnRefresh.tooltiptext = Actualizar +busquedaTipoCortesiaController.btnNovo.tooltiptext = Agregar +busquedaTipoCortesiaController.btnCerrar.tooltiptext = Cerrar +busquedaTipoCortesiaController.btnPesquisa.label = Búsqueda +busquedaTipoCortesiaController.lhId.label = ID +busquedaTipoCortesiaController.lblDesc.label = Tipo Cortesía +busquedaTipoCortesiaController.lhGC.label = Grupo Cortesía +busquedaTipoCortesiaController.lhDesc.label = Tipo Cortesía + +#Pantalla Editar Tipo Cortesía + +editarTipoCortesiaController.window.title = Tipo Cortesía +editarTipoCortesiaController.btnApagar.tooltiptext = Eliminar +editarTipoCortesiaController.btnSalvar.tooltiptext = Guardar +editarTipoCortesiaController.btnFechar.tooltiptext = Cerrar +editarTipoCortesiaController.lblGC.value = Grupo Cortesía +editarTipoCortesiaController.lblTC.value = Tipo Cortesía +editarTipoCortesiaController.MSG.suscribirOK = Tipo cortesía se registró exitosamente. +editarTipoCortesiaController.MSG.BorrarPergunta = ¿Desea eliminar tipo cortesía? +editarTipoCortesiaController.MSG.BorrarOK = Tipo cortesía se eliminó exitosamente. +editarTipoCortesiaController.MSG.grupo = Necesita informar un grupo cortesía + +#Pantalla Búsqueda Tipo Cortesías con Descuento + +busquedaTipoCortesiaDController.window.title = Descuento por tipo de Cortesía +busquedaTipoCortesiaDController.btnRefresh.tooltiptext = Actualizar +busquedaTipoCortesiaDController.btnNovo.tooltiptext = Agregar +busquedaTipoCortesiaDController.btnCerrar.tooltiptext = Cerrar +busquedaTipoCortesiaDController.btnPesquisa.label = Búsqueda +busquedaTipoCortesiaDController.cmbTipoCortesia.label = Tipo Cortesía +busquedaTipoCortesiaDController.lhDesc.label = Tipo Cortesía +busquedaTipoCortesiaDController.lhtipoC.label = Descripción +busquedaTipoCortesiaDController.lhId.label = ID +busquedaTipoCortesiaDController.lhporDesc.label = Porcentaje % +busquedaTipoCortesiaDController.lblCortesia.value = Cortesía +busquedaTipoCortesiaDController.lblPorcentajeCortesia.value = Porcentaje +busquedaTipoCortesiaDController.lblTipoCortesia.value = Tipo Cortesía + +#Pantalla Edita Tipo Cortesías con Descuento + +editarTipoCortesiaDController.window.title = Descuento por tipo de Cortesía +editarTipoCortesiaDController.btnApagar.tooltiptext = Eliminar +editarTipoCortesiaDController.btnSalvar.tooltiptext = Guardar +editarTipoCortesiaDController.btnFechar.tooltiptext = Cerrar +editarTipoCortesiaDController.MSG.suscribirOK = Tipo de cortesía con descuento se registró exitosamente. +editarTipoCortesiaDController.MSG.BorrarPergunta = ¿Desea eliminar tipo de cortesía con descuento? +editarTipoCortesiaDController.MSG.BorrarOK = Tipo de cortesía con descuento se eliminó exitosamente. +editarTipoCortesiaDController.lbTipoC.value = Tipo Cortesía +editarTipoCortesiaDController.lbPdesc.value = Porcentaje Descuento +editarTipoCortesiaDController.MSG.Porcentaje = Porcentaje debe ser inferior a 100. +editarTipoCortesiaDController.MSG.tipo = Necesita informar un tipo cortesía. + +#Pantalla Alta Cortesía por RH + +busquedaAltaCortesiaRHController.window.title = Alta Cortesía por RH +busquedaAltaCortesiaRHController.btnRefresh.tooltiptext = Actualizar +busquedaAltaCortesiaRHController.btnNovo.tooltiptext = Agregar +busquedaAltaCortesiaRHController.btnCerrar.tooltiptext = Cerrar +busquedaAltaCortesiaRHController.btnPesquisa.label = Búsqueda +busquedaAltaCortesiaRHController.lblClave.label = Clave del Empleado +busquedaAltaCortesiaRHController.lhCortesia.label = ID +busquedaAltaCortesiaRHController.lhEmpleado.label = Empleado +busquedaAltaCortesiaRHController.lhCorreo.label = Correo +busquedaAltaCortesiaRHController.lhTipoC.label = Tipo Cortesía +busquedaAltaCortesiaRHController.lhMarca.label = Marca +busquedaAltaCortesiaRHController.lhClser.label = Tipo Servicio +busquedaAltaCortesiaRHController.lhOrigen.label = Origen +busquedaAltaCortesiaRHController.lhDestino.label = Destino +busquedaAltaCortesiaRHController.lhIdnTv.label = IND Tipo Viaje +busquedaAltaCortesiaRHController.lhFecI.label = Fecha Inicial +busquedaAltaCortesiaRHController.lhFecF.label = Fecha Final +busquedaAltaCortesiaRHController.lhMotivo.label = Motivo Viaje +busquedaAltaCortesiaRHController.lhFecha.label = Fecha de Alta +busquedaAltaCortesiaRHController.lhStatus.label = Status +busquedaAltaCortesiaRHController.lblCortesiaId.label = Cortesía + + +#Pantalla Edita Alta Cortesía por RH + +editarAltaCortesiaRHController.window.title = Alta Cortesía por RH + +editarAltaCortesiaRHController.tabEmpleado.label = Datos del Empleado +editarAltaCortesiaRHController.lblClvEmpleado.value = Clave Empleado +editarAltaCortesiaRHController.lblEmpresa.value = Empresa +editarAltaCortesiaRHController.lblNombre.value = Nombre +editarAltaCortesiaRHController.lblApP.value = Apellido Paterno +editarAltaCortesiaRHController.lblApM.value = Apellico Materno +editarAltaCortesiaRHController.lblPuesto.value = Puesto +editarAltaCortesiaRHController.lblCorreoElectronivo.value = E-mail +editarAltaCortesiaRHController.lblTipoCortesia.value = Tipo Cortesía +editarAltaCortesiaRHController.tabViaje.label = Datos Viaje +editarAltaCortesiaRHController.tabBeneficiarios.label = Cantidad Beneficiarios +editarAltaCortesiaRHController.lblMarca.value = Marca +editarAltaCortesiaRHController.lblClaseServicio.value = Tipo Servicio +editarAltaCortesiaRHController.lblOrigen.value = Origen +editarAltaCortesiaRHController.lblDestino.value = Destino +editarAltaCortesiaRHController.lblTipoViaje.value = Tipo Viaje +editarAltaCortesiaRHController.lblFechaVigenciaInicio.value = Fecha de Vigencia Inicio +editarAltaCortesiaRHController.lblFechaVigenciaFin.value = Fecha de Vigencia Fin +editarAltaCortesiaRHController.lblMotivo.value = Motivo Viaje +editarAltaCortesiaRHController.btnPesquisa.label = Búsqueda +editarAltaCortesiaRHController.MSG.suscribirOK = Cortesía se registró exitosamente. +editarAltaCortesiaRHController.MSG.yaExisteBeneficiario=El beneficiario ya existe +editarAltaCortesiaRHController.MSG.borrarPergunta = ¿Deseas eliminar la cortesía? +editarAltaCortesiaRHController.MSG.borrarOK = Cortesía se eliminó exisitosamente. +editarAltaCortesiaRHController.MSG.informacionNumeroIdGenerado = El número de la cortesia es {0} +editarAltaCortesiaRHController.lblNombreB.value = Nombre +editarAltaCortesiaRHController.lblApPB.value = Apellido Paterno +editarAltaCortesiaRHController.lblApMB.value = Apellido Materno +editarAltaCortesiaRHController.lbltP.value = Porcentaje +editarAltaCortesiaRHController.btnApagarBen.tooltiptext = Eliminar +editarAltaCortesiaRHController.btnSalvarBen.tooltiptext = Agregar +editarAltaCortesiaRHController.lblNomBen.value = Nombre Beneficiario +editarAltaCortesiaRHController.lblCortesiaBen.value = Cortesía +editarAltaCortesiaRHController.lblpor.value = Porcentaje +editarAltaCortesiaRHController.lblTipoP.value = Tipo Persona +editarAltaCortesiaRHController.lblNomEmB.value = Nombre Empleado +editarAltaCortesiaRHController.lblEmCor.value = Cortesía +editarAltaCortesiaRHController.btnPesquisa.label = Búsqueda +editarAltaCortesiaRHController.lblfecIda.value = Fecha Ida +editarAltaCortesiaRHController.lblfecRegreso.value = Fecha Regreso +editarAltaCortesiaRHController.MSG.CortesiaAlta = La fecha final es menor a la inicial. +editarAltaCortesiaRHController.MSG.cortesia = Necesita informar un tipo cortesía +editarAltaCortesiaRHController.MSG.marca = Necesita informar una marca +editarAltaCortesiaRHController.MSG.clase = Necesita informar una clase servicio +editarAltaCortesiaRHController.MSG.origen = Necesita informar un origen +editarAltaCortesiaRHController.MSG.destino = Necesita informar un destino +editarAltaCortesiaRHController.MSG.motivo = Necesita informar un motivo viaje +editarAltaCortesiaRHController.MSG.porcentaje = Necesita informar un porcentaje +editarAltaCortesiaRHController.MSG.empleado = Necesita informar un empleado +editarAltaCortesiaRHController.MSG.naoEmpleado = Empleado no encontrado +editarAltaCortesiaRHController.MSG.NomBene.vazio = Nombre vacío +editarAltaCortesiaRHController.MSG.ApPBene.vazio = Apellido Paterno vacío +editarAltaCortesiaRHController.MSG.ApMBene.vazio = Apellido Materno vacío +editarAltaCortesiaRHController.MSG.porcentaje.vazio = Porcentaje vacío +editarAltaCortesiaRHController.MSG.beneficiario = Necesita informar un beneficiario. + +#Pantalla Búsqueda Cortesía Tipo Direccion +busquedaCortesiaTipoDireccionController.window.title = Cortesía de Tipo Dirección +busquedaCortesiaTipoDireccionController.btnRefresh.tooltiptext = Actualizar +busquedaCortesiaTipoDireccionController.btnCerrar.tooltiptext = Cerrar +busquedaCortesiaTipoDireccionController.btnNovo.tooltiptext = Agregar +busquedaCortesiaTipoDireccionController.lblMarca.label = Marca +busquedaCortesiaTipoDireccionController.lblClaseSer.label = Tipo Servicio +busquedaCortesiaTipoDireccionController.lblFecInicial.label = Fecha Inicial +busquedaCortesiaTipoDireccionController.lblFecFinal.label = Fecha Final +busquedaCortesiaTipoDireccionController.btnPesquisa.label = Búsqueda +busquedaCortesiaTipoDireccionController.lhMarca.label = Marca +busquedaCortesiaTipoDireccionController.lhClaseSer.label = Tipo Servicio +busquedaCortesiaTipoDireccionController.lhFolioIni.label = Folio Inicial +busquedaCortesiaTipoDireccionController.lhFolioFin.label = Folio Final +busquedaCortesiaTipoDireccionController.lhTipoDes.label = Tipo Descuento +busquedaCortesiaTipoDireccionController.lhFecInicial.label = Fecha Inicial +busquedaCortesiaTipoDireccionController.lhFecFinal.label = Fecha Final +busquedaCortesiaTipoDireccionController.MSG.CortesiaDireccionAlta = La fecha inicial es porterior a la inicial. + + +#Pantalla Editar Cortesía Tipo Direccion + +editarCortesiaTipoDireccionController.window.title = Cortesía de Tipo Dirección +editarCortesiaTipoDireccionController.btnApagar.tooltiptext = Eliminar +editarCortesiaTipoDireccionController.btnSalvar.tooltiptext = Guardar +editarCortesiaTipoDireccionController.btnFechar.tooltiptext = Cerrar +editarCortesiaTipoDireccionController.lbTipoC.value = Tipo Descuento +editarCortesiaTipoDireccionController.lblMarca.value = Marca +editarCortesiaTipoDireccionController.lblClaseServicio.value = Tipo Servicio +editarCortesiaTipoDireccionController.lbFolioIni.value = Folio Inicial +editarCortesiaTipoDireccionController.lbFolioFin.value = Folio Final +editarCortesiaTipoDireccionController.lbFecInicial.value = Fecha Vigencia Inicial +editarCortesiaTipoDireccionController.lbFecFinal.value = Fecha Vigencia Final +editarCortesiaTipoDireccionController.MSG.suscribirOK = Cortesía de tipo dirección se registró exitosamente. +editarCortesiaTipoDireccionController.MSG.BorrarPergunta = ¿Desea eliminar la cortesía de tipo dirección? +editarCortesiaTipoDireccionController.MSG.BorrarOK = Cortesía de tipo dirección se eliminó exitosamente. +editarCortesiaTipoDireccionController.MSG.CortesiaDireccionAlta = La fecha final es menor a la inicial. +editarCortesiaTipoDireccionController.MSG.folio = Folio final es menor que folio inicial. +editarAltaCortesiaRHController.MSG.ErrorSalva = Para asignar cortesía debe haber un beneficiario. +editarCortesiaTipoDireccionController.MSG.descuento = Necesita informar un tipo descuento +editarCortesiaTipoDireccionController.MSG.marca = Necesita informar una marca +editarCortesiaTipoDireccionController.MSG.clase = Necesita informar una clase de servicio +editarCortesiaTipoDireccionController.MSG.Folio = Folio informado se traslapa con otroa ya existente. + +#Pantalla Búsqueda Rol Operativo + +busquedaRolOperativoController.window.title = Rol Operativo +busquedaRolOperativoController.btnRefresh.tooltiptext = Actualizar +busquedaRolOperativoController.btnNovo.tooltiptext = Agregar +busquedaRolOperativoController.btnCerrar.tooltiptext = Cerrar +busquedaRolOperativoController.btnPesquisa.label = Búsqueda +busquedaRolOperativoController.lblDesRol.label = Descripción Rol +busquedaRolOperativoController.lblDiagramaBus.label = Diagrama Autobús +busquedaRolOperativoController.lhDesRol.label = Descripción Rol Operativo +busquedaRolOperativoController.lhTimePre.label = Tiempo Previo +busquedaRolOperativoController.lhDesDA.label = Descripción Diagrama Autobús + + +#Pantalla Editar Rol Operativo + +editarRolOperativoController.window.title = Rol Operativo +editarRolOperativoController.btnApagar.tooltiptext = Eliminar +editarRolOperativoController.btnSalvar.tooltiptext = Guardar +editarRolOperativoController.btnFechar.tooltiptext = Cerrar +editarRolOperativoController.MSG.suscribirOK = Rol operativo se registró exitosamente. +editarRolOperativoController.MSG.BorrarPergunta = ¿Deseas eliminar el rol operativo? +editarRolOperativoController.MSG.BorrarOK = Rol operativo se eliminó exitosamente. +editarRolOperativoController.lblDesRol.value = Descripción Rol Operativo +editarRolOperativoController.lblTimepre.value = Tiempo Previo +editarRolOperativoController.lblDiagramaBus.value = Diagrama Autobús + + +#Pantalla Búsqueda Generacion Tarjeta Senda Amigo + +busquedaGeneracionTarjetaSAController.window.title = Generacion Tarjeta Senda Amigo +busquedaGeneracionTarjetaSAController.btnRefresh.tooltiptext = Actualizar +busquedaGeneracionTarjetaSAController.btnNovo.tooltiptext = Agregar +busquedaGeneracionTarjetaSAController.btnCerrar.tooltiptext = Cerrar +busquedaGeneracionTarjetaSAController.lblNameP.label = Nombre del Paquete +busquedaGeneracionTarjetaSAController.btnPesquisa.label = Búsqueda +busquedaGeneracionTarjetaSAController.lhNameP.label = Nombre Paquete +busquedaGeneracionTarjetaSAController.lhCantidad.label = Tarjetas + + +#Pantalla Editar Generacion Tarjeta Senda Amigo + +editarGeneracionTarjetaSAController.window.title = Generacion de Tarjeta Senda Amigo +editarGeneracionTarjetaSAController.btnApagar.tooltiptext = Eliminar +editarGeneracionTarjetaSAController.btnSalvar.tooltiptext = Guardar +editarGeneracionTarjetaSAController.btnFechar.tooltiptext = Cerrar +editarGeneracionTarjetaSAController.btnAgragar.tooltiptext = Agregar +editarGeneracionTarjetaSAController.MSG.suscribirOK = Generacion tarjeta se registró exitosamente. +editarGeneracionTarjetaSAController.MSG.BorrarPergunta = Deseas eliminar este paquete? +editarGeneracionTarjetaSAController.MSG.BorrarOK = Paquete se eliminó exitosamente. +editarGeneracionTarjetaSAController.NomPaquete.value = Nombre del Paquete +editarGeneracionTarjetaSAController.qtdFolios.value = Cantidad de Folios +editarGeneracionTarjetaSAController.folios.value = Tarjeta +editarGeneracionTarjetaSAController.MSG.necessitaTarjeta = Necesita agregar una tarjeta. + +#Pantalla Búsqueda Producto o Servicio + +busquedaCyberViajeProductoServicioController.window.title = Configuración de Producto o Servicio +busquedaProductoServicioController.btnRefresh.tooltiptext = Actualizar +busquedaProductoServicioController.btnNovo.tooltiptext = Agregar +busquedaProductoServicioController.btnCerrar.tooltiptext = Cerrar +busquedaProductoServicioController.lblNombre.label = Nombre +busquedaGrupoCortesiasController.btnPesquisa.label = Búsqueda +busquedaGrupoCortesiasController.lhInd.label = Producto / Servicio +busquedaGrupoCortesiasController.lhDesc.label = Nombre +busquedaGrupoCortesiasController.lhEmpr.label = Empresa +busquedaGrupoCortesiasController.lhPrecio.label = Importe + + +#Pantalla Edita Producto o Servicio +editarProductoServicioController.window.title = Configuración de Producto o Servicio +editarProductoServicioController.MSG.suscribirOK = Producto/servicio se registró exitosamente. +editarProductoServicioController.MSG.BorrarPergunta = ¿Deseas eliminar el producto o servicio? +editarProductoServicioController.MSG.BorrarOK = Producto/servicio se eliminó exitosamente. +editarProductoServicioController.MSG.importe = Necesita informar un importe. +editarProductoServicioController.btnApagar.tooltiptext = Eliminar +editarProductoServicioController.btnSalvar.tooltiptext = Guardar +editarProductoServicioController.btnFechar.tooltiptext = Cerrar +editarProductoServicioController.lbNome.value = Descripción +editarProductoServicioController.lblPrecio.value = Importe +editarProductoServicioController.descImpresion.value = Descripción del servicio a imprimir en el boleto + + +#Pantalla Búsqueda Tipo Convenio + +busquedaTipoConvenioController.window.title = Tipo Convenio +busquedaTipoConvenioController.btnRefresh.tooltiptext = Actualizar +busquedaTipoConvenioController.btnNovo.tooltiptext = Agregar +busquedaTipoConvenioController.btnCerrar.tooltiptext = Cerrar +busquedaTipoConvenioController.lblNombre.label = Convenio +busquedaTipoConvenioController.btnPesquisa.label = Búsqueda +busquedaTipoConvenioController.lhInd.label = Convenio +busquedaTipoConvenioController.lhDesc.label = Descripción +busquedaTipoConvenioController.lhId.label = ID + +#Pantalla Edita Tipo Convenio + +editarTipoConvenioController.window.title = Tipo Convenio +editarTipoConvenioController.MSG.suscribirOK = Convenio se registró exitosamente. +editarTipoConvenioController.MSG.BorrarPergunta = ¿Deseas eliminar el convenio? +editarTipoConvenioController.MSG.BorrarOK = Convenio se eliminó exitosamente. +editarTipoConvenioController.btnApagar.tooltiptext = Eliminar +editarTipoConvenioController.btnSalvar.tooltiptext = Guardar +editarTipoConvenioController.btnFechar.tooltiptext = Cerrar +editarTipoConvenioController.lbNome.value = Convenio + + +#Pantalla Búsqueda Cupon Convenio + +busquedaCuponConvenioController.window.title = Cupon Convenio +busquedaCuponConvenioController.btnRefresh.tooltiptext = Actualizar +busquedaCuponConvenioController.btnNovo.tooltiptext = Agregar +busquedaCuponConvenioController.btnCerrar.tooltiptext = Cerrar +busquedaCuponConvenioController.btnPesquisa.label = Búsqueda +busquedaCuponConvenioController.lhIdCon.label = ID +busquedaCuponConvenioController.lhtipoCon.label = Descripción +busquedaCuponConvenioController.lhFolioIni.label = Folio Inicial +busquedaCuponConvenioController.lhFolioFin.label = Folio Final +busquedaCuponConvenioController.lblTipoCon.label = Tipo Convenio + +#Pantalla Edita Cupon Convenio +editarCuponConvenioController.window.title = Cupon Convenio +editarCuponConvenioController.MSG.suscribirOK = Cupon se registró exitosamente. +editarCuponConvenioController.MSG.BorrarPergunta = ¿Deseas eliminar el cupon? +editarCuponConvenioController.MSG.BorrarOK = Cupon se eliminó exitosamente. +editarCuponConvenioController.btnApagar.tooltiptext = Eliminar +editarCuponConvenioController.btnSalvar.tooltiptext = Guardar +editarCuponConvenioController.btnFechar.tooltiptext = Cerrar +editarCuponConvenioController.lblTipoCon.value = Convenio +editarCuponConvenioController.lblFolioIni.value = Folio inicial +editarCuponConvenioController.lblFolioFin.value = Folio Final + +#CyberViaje - busquedaProductoServicioController +busquedaProductoServicioController.window.title = Producto o Servicio +busquedaProductoServicioController.lhNome.label = Producto o Servicio +busquedaProductoServicioController.lhId.label = ID +busquedaProductoServicioController.lhServ.label = Descripción +busquedaProductoServicioController.lhTipo.label = Tipo +busquedaProductoServicioController.lhPrecio.label = Precio +busquedaProductoServicioController.btnPesquisa.label = Búsqueda + +#CyberViaje - Editar +editarProductoServicioController.window.title = Configuración de Producto o Servicio +editarProductoServicioController.windowProdClaseServicio.title = Tipo de Servicio +editarProductoServicioController.windowProdFormaPago.title = Forma de Pago +editarProductoServicioController.windowProdMarca.title = Marca +editarProductoServicioController.windowProdMercado.title = Mercado +editarProductoServicioController.windowProdPuntoVenta.title = Punto de Venta +editarProductoServicioController.windowProdRuta.title = Ruta +editarProductoServicioController.windowProdTipoptovta.title = Canal de Venta +editarProductoServicioController.windowProdVigencia.title = Vigencia +editarProductoServicioController.tabApl.label = Aplicación +editarProductoServicioController.tabTar.label = Tarifa +editarProductoServicioController.desc.title = Descripción +editarProductoServicioController.precio.title = Precio +editarProductoServicioController.Tipo.label = Tipo +editarProductoServicioController.Servicio.label = Servicio +editarProductoServicioController.Produto.label = Producto +editarProductoServicioController.MSG.fechaViaje = Fecha inicio posterior a la fecha final. +editarProductoServicioController.MSG.suscribirOK = Configuración de producto o servicio se registró exitosamente. +editarProductoServicioController.MSG.borrarPergunta = ¿Desea eliminar esta configuración de producto o servicio? +editarProductoServicioController.MSG.borrarOK = Configuración de producto o servicio se eliminó exitosamente. +editarProductoServicioController.btnApagar.tooltiptext = Eliminar +editarProductoServicioController.btnSalvar.tooltiptext = Guardar +editarProductoServicioController.btnFechar.tooltiptext = Cerrar +editarProductoServicioController.btnModificar.value = Modificar +editarProductoServicioController.MSG.selectItem = Selecciona un Elemento. +editarProductoServicioController.prodClaseServicio.value = Tipo de Servicio +editarProductoServicioController.btnNovoProdClaseServicio.tooltiptext = Agregar +editarProductoServicioController.btnApagarProdClaseServicio.tooltiptext = Eliminar +editarProductoServicioController.btnModificarProdClaseServicio.tooltiptext = Modificar +editarProductoServicioController.prodPrecio.value = Precio +editarProductoServicioController.btnNovoProdPrecio.tooltiptext = Agregar +editarProductoServicioController.btnApagarProdPrecio.tooltiptext = Eliminar +editarProductoServicioController.prodFormaPago.value = Forma de Pago +editarProductoServicioController.btnNovoProdFormaPago.tooltiptext = Agregar +editarProductoServicioController.btnApagarProdFormaPago.tooltiptext = Eliminar +editarProductoServicioController.btnModificarProdFormaPago.tooltiptext = Modificar +editarProductoServicioController.prodMarca.value = Marca. +editarProductoServicioController.btnNovoProdMarca.tooltiptext = Agregar +editarProductoServicioController.btnApagarProdMarca.tooltiptext = Eliminar +editarProductoServicioController.btnModificarProdMarca.tooltiptext = Modificar +editarProductoServicioController.prodMercado.value = Mercado +editarProductoServicioController.btnNovoProdMercado.tooltiptext = Agregar +editarProductoServicioController.btnApagarProdMercado.tooltiptext = Eliminar +editarProductoServicioController.btnModificarProdMercado.tooltiptext = Modificar +editarProductoServicioController.prodPuntoVenta.value = Punto de Venta +editarProductoServicioController.btnNovoProdPuntoVenta.tooltiptext = Agregar +editarProductoServicioController.btnApagarProdPuntoVenta.tooltiptext = Eliminar +editarProductoServicioController.btnModificarProdPuntoVenta.tooltiptext = Modificar +editarProductoServicioController.prodRuta.value = Ruta +editarProductoServicioController.btnNovoProdRuta.tooltiptext = Agregar +editarProductoServicioController.btnApagarProdRuta.tooltiptext = Eliminar +editarProductoServicioController.btnModificarProdRuta.tooltiptext = Modificar +editarProductoServicioController.prodTipoptovta.value = Canal de Venta +editarProductoServicioController.btnNovoTipoptovta.tooltiptext = Agregar +editarProductoServicioController.btnApagarTipoptovta.tooltiptext = Eliminar +editarProductoServicioController.btnModificarTipoptovta.tooltiptext = Modificar +editarProductoServicioController.prodVigencia.value = Vigencia +editarProductoServicioController.btnNovoVigencia.tooltiptext = Agregar +editarProductoServicioController.btnApagarVigencia.tooltiptext = Eliminar +editarProductoServicioController.btnModificarVigencia.tooltiptext = Modificar + +# Producto Clase de Servicio +editarProdClaseServicioController.winEditarProdClaseServicioController.title = Producto Clase de Servicio +editarProdClaseServicioController.btnSalvar.tooltiptext = Registrar producto clase de servicio. +editarProdClaseServicioController.btnFechar.tooltiptext = Cerrar +editarProdClaseServicioController.ClaseServicio.value = Clase de servicio +editarProdClaseServicioController.MSG.borrarPergunta = ¿Desea borrar este producto clase de servicio? +editarProdClaseServicioController.MSG.borrarSucesso = Producto clase de servicio se eliminó exitosamente. +editarProdClaseServicioController.MSG.vazio = Producto clase vacío. + +# Producto Precio +editarProdPrecioController.winEditarProdPrecioController.title = Producto Precio +editarProdPrecioController.btnSalvar.tooltiptext = Registrar producto Precio. +editarProdPrecioController.btnFechar.tooltiptext = Cerrar +editarProdPrecioController.Precio.value = Producto Precio +editarProdPrecioController.marca.value = Marca +editarProdPrecioController.bolIni.value = Boleto Precio Inicial +editarProdPrecioController.bolFim.value = Boleto Precio Final +editarProdPrecioController.tarifa.value = Precio Servicio +editarProdPrecioController.MSG.borrarPergunta = ¿Desea borrar este Producto Precio? +editarProdPrecioController.MSG.borrarSucesso = Producto precio se eliminó exitosamente. +editarProdPrecioController.MSG.vazio = Producto precio vacío. +editarProdPrecioController.MSG.iniFim = Precio inicial mayor que precio final. + +# Producto Forma de Pago +editarProdFormaPagoController.winEditarProdFormaPago.title = Producto Forma de Pago +editarProdFormaPagoController.btnSalvar.tooltiptext = Registrar producto forma de pago. +editarProdFormaPagoController.btnFechar.tooltiptext = Cerrar +editarProdFormaPagoController.FormaPago.value = Forma de pago +editarProdFormaPagoController.MSG.borrarPergunta = ¿Desea borrar este producto forma de pago? +editarProdFormaPagoController.MSG.borrarSucesso = Producto forma de pago se eliminó exitosamente. +editarProdFormaPagoController.MSG.vazio = Producto forma de pago vacío. + +# Producto Marca +editarProdMarcaController.winEditarProdMarca.title = Marca +editarProdMarcaController.btnSalvar.tooltiptext = Registrar marca. +editarProdMarcaController.btnFechar.tooltiptext = Cerrar +editarProdMarcaController.ProdMarca.value = Marca +editarProdMarcaController.ProdMarcaPrecio.value = Precio +editarProdMarcaController.MSG.borrarPergunta = ¿Desea borrar esta marca? +editarProdMarcaController.MSG.borrarSucesso = Marca se eliminó exitosamente. +editarProdMarcaController.MSG.vazio = Marca vacío. +editarProdMarcaController.txtImporteInicial.value=Importe Inicial +editarProdMarcaController.txtImporteFinal.value=Importe Final +editarProdMarcaController.btnNovoProdPrecio.tooltiptext=Agregar +editarProdMarcaController.btnApagarProdPrecio.tooltiptext=Eliminar +editarProdMarcaController.importeInicial.label=Importe Inicial +editarProdMarcaController.importeFinal.label=Importe Final +editarProdMarcaController.MSG.valoresImportes=Debe de informar todos los importes. +editarProdMarcaController.MSG.seleccionarUnImporte=Debe de seleccionar un importe +editarProdMarcaController.MSG.salvarOk = Marca producto se registró exitosamente +editarProdMarcaController.MSG.conflitoVigencias = El precio informado se traslapa con otra ya existente. +editarProdMarcaController.MSG.necesitaImporte = Necesita informar un precio servicio. + + +# Producto Mercado +editarProdMercadoController.winEditarProdMercado.title = Producto Mercado +editarProdMercadoController.btnSalvar.tooltiptext = Registrar producto mercado. +editarProdMercadoController.btnFechar.tooltiptext = Cerrar +editarProdMercadoController.Origem.value = Origen +editarProdMercadoController.Destino.value = Destino +editarProdMercadoController.cveOrigem.value = Clave origen +editarProdMercadoController.cveDestino.value = Clave destino +editarProdMercadoController.MSG.borrarPergunta = ¿Desea borrar este producto mercado? +editarProdMercadoController.MSG.borrarSucesso = Producto mercado se eliminó exitosamente. +editarProdMercadoController.MSG.vazio = Producto mercado vacío. + +# Producto Punto de Venta +editarProdPuntoVentaController.winEditarProdPuntoVenta.title = Producto Punto de Venta +editarProdPuntoVentaController.btnSalvar.tooltiptext = Registrar producto punto de venta. +editarProdPuntoVentaController.btnFechar.tooltiptext = Cerrar +editarProdPuntoVentaController.PuntoVenta.value = Punto de venta +editarProdPuntoVentaController.MSG.borrarPergunta = ¿Desea borrar este producto punto de venta? +editarProdPuntoVentaController.MSG.borrarSucesso = Producto punto de venta se eliminó exitosamente. +editarProdPuntoVentaController.MSG.vazio = Producto punto de venta vacío. + + +# Producto Ruta +editarProdRutaController.winEditarProdRuta.title = Producto Ruta +editarProdRutaController.btnSalvar.tooltiptext = Registrar producto ruta. +editarProdRutaController.btnFechar.tooltiptext = Cerrar +editarProdRutaController.Ruta.value = Ruta +editarProdRutaController.MSG.borrarPergunta = ¿Desea borrar este producto ruta? +editarProdRutaController.MSG.borrarSucesso = Producto ruta se se eliminó exitosamente. +editarProdRutaController.MSG.vazio = Producto ruta vacío. + +# Producto Canal de Venta +editarProdTipoptovtaController.winEditarProdTipoPuntoVenta.title = Producto Canal de Venta +editarProdTipoptovtaController.btnSalvar.tooltiptext = Registrar producto Canal de Venta. +editarProdTipoptovtaController.btnFechar.tooltiptext = Cerrar +editarProdTipoptovtaController.TipoPuntoVenta.value = Canal de Venta +editarProdTipoptovtaController.MSG.borrarPergunta = ¿Desea borrar este producto Canal de Venta? +editarProdTipoptovtaController.MSG.borrarSucesso = Producto Canal de Venta se eliminó exitosamente. +editarProdTipoptovtaController.MSG.vazio = Canal de Venta vacío. + +# Producto Vigencia +editarProdVigenciaController.winEditarProdVigencia.title = Producto Vigencia +editarProdVigenciaController.btnSalvar.tooltiptext = Registrar producto vigencia. +editarProdVigenciaController.btnFechar.tooltiptext = Cerrar +editarProdVigenciaController.lbFecInicio.value = Inicio +editarProdVigenciaController.lbFecFinal.value = Fin +editarProdVigenciaController.MSG.borrarPergunta = ¿Desea borrar este producto vigencia? +editarProdVigenciaController.MSG.borrarSucesso = Producto vigencia se eliminó exitosamente. +editarProdVigenciaController.MSG.vazio = Producto vigencia vacío. +editarProdVigenciaController.MSG.registroTraslapado = El período informado se traslapa con otro ya existente + + + +# Búsqueda Tipo Parada +busquedaTipoParadaController.window.title = Tipo Parada +busquedaTipoParadaController.btnRefresh.tooltiptext = Actualizar +busquedaTipoParadaController.btnNovo.tooltiptext = Agregar +busquedaTipoParadaController.btnCerrar.tooltiptext = Cerrar +busquedaTipoParadaController.txtNombre.label = Tipo Parada +busquedaTipoParadaController.btnPesquisa.label = Búsqueda +busquedaTipoParadaController.lhId.label = ID +busquedaTipoParadaController.lhDesc.label = Descripción + +# Editar Tipo Parada +editarTipoParadaController.window.title = Tipo Parada +editarTipoParadaController.btnApagar.tooltiptext = Eliminar +editarTipoParadaController.btnSalvar.tooltiptext = Guardar +editarTipoParadaController.btnFechar.tooltiptext = Cerrar +editarTipoParadaController.lhDesc.label = Tipo Parada +editarTipoParadaController.MSG.suscribirOK = Tipo Parada se registró exitosamente. +editarTipoParadaController.MSG.borrarPergunta = ¿Eliminar Tipo Parada? +editarTipoParadaController.MSG.borrarOK = Tipo Parada se eliminó exitosamente. + +# Búsqueda Autobús +busquedaAutobusController.window.title = Autobús +busquedaAutobusController.btnRefresh.tooltiptext = Actualizar +busquedaAutobusController.btnNovo.tooltiptext = Agregar +busquedaAutobusController.btnCerrar.tooltiptext = Cerrar +busquedaAutobusController.txtNome.label = Número Autobús +busquedaAutobusController.btnPesquisa.label = Búsqueda +busquedaAutobusController.lhNome.label = Número Autobús +busquedaAutobusController.lhID.label = ID +busquedaAutobusController.lhDiagramaAutobus.label = Diagrama Autobús +busquedaAutobusController.diagramaautobus.label = Diagrama Autobús + +# Editar Autobús +editarAutobusController.window.title = Autobús +editarAutobusController.MSG.suscribirOK = Autobús se registró exitosamente. +editarAutobusController.MSG.borrarPergunta = ¿Eliminar autobus? +editarAutobusController.MSG.borrarOK = Autobús se eliminó exitosamente. +editarAutobusController.btnApagar.tooltiptext = Eliminar +editarAutobusController.btnSalvar.tooltiptext = Guardar +editarAutobusController.btnFechar.tooltiptext = Cerrar +editarAutobusController.lbNome.value = Número Autobús +busquedaAutobusController.diagramaautobus.label = Diagrama Autobús +busquedaAutobusController.diagramaautobusPiso.label = Diagrama Autobus (segundo piso) + +# Búsqueda Autorizacion +busquedaAutorizacionController.window.title = Autorización +busquedaAutorizacionController.btnRefresh.tooltiptext = Actualizar +busquedaAutorizacionController.btnNovo.tooltiptext = Agregar +busquedaAutorizacionController.btnCerrar.tooltiptext = Cerrar +busquedaAutorizacionController.lhNombAutorizacion.label = Nombre +busquedaAutorizacionController.lhIDAutorizacion.label = ID +busquedaAutorizacionController.lhDescAutorizacion.label = Descripción +busquedaAutorizacionController.btnPesquisa.label = Búsqueda + +# Editar Autorizacion +editarAutorizacionController.window.title = Autorización +editarAutorizacionController.btnApagar.tooltiptext = Eliminar +editarAutorizacionController.btnSalvar.tooltiptext = Guardar +editarAutorizacionController.btnFechar.tooltiptext = Cerrar +editarAutorizacionController.MSG.suscribirOK = Autorización se registró exitosamente. +editarAutorizacionController.MSG.borrarPergunta = ¿Eliminar Autorización? +editarAutorizacionController.MSG.borrarOK = Autorización se eliminó exitosamente. + +# Búsqueda Autorizacion Perfil +busquedaAutorizacionPerfilController.window.title = Autorización Perfil +busquedaAutorizacionPerfilController.btnRefresh.tooltiptext = Actualizar +busquedaAutorizacionPerfilController.btnNovo.tooltiptext = Agregar +busquedaAutorizacionPerfilController.btnCerrar.tooltiptext = Cerrar +busquedaAutorizacionPerfilController.lhAutorizacion.label = Autorización +busquedaAutorizacionPerfilController.lhPerfil.label = Perfil +busquedaAutorizacionPerfilController.btnPesquisa.label = Búsqueda + +# Editar Autorizacion Perfil +editarAutorizacionPerfilController.window.title = Autorización Perfil +editarAutorizacionPerfilController.btnApagar.tooltiptext = Eliminar +editarAutorizacionPerfilController.btnSalvar.tooltiptext = Guardar +editarAutorizacionPerfilController.btnFechar.tooltiptext = Cerrar +editarAutorizacionPerfilController.MSG.suscribirOK = Autorización Perfil se registró exitosamente. +editarAutorizacionPerfilController.MSG.borrarPergunta = ¿Eliminar Autorización Perfil? +editarAutorizacionPerfilController.MSG.borrarOK = Autorización Perfil se eliminó exitosamente. + +# Búsqueda Estacion +busquedaEstacionPerfilController.window.title = Estación +busquedaEstacionController.btnRefresh.tooltiptext = Actualizar +busquedaEstacionController.btnNovo.tooltiptext = Agregar +busquedaEstacionController.btnCerrar.tooltiptext = Cerrar +busquedaEstacionController.lhDescEstacion.label = Descripción +busquedaEstacionController.ID.label = ID +busquedaEstacionController.lhDescMac.label = Descripción Mac +busquedaEstacionController.lhNumCaja.label = Caja +busquedaEstacionController.lhPuntoVenta.label = Punto Venta +busquedaEstacionController.btnPesquisa.label = Búsqueda + +# Editar Estacion +editarEstacionController.window.title = Estación +editarEstacionController.btnApagar.tooltiptext = Eliminar +editarEstacionController.btnSalvar.tooltiptext = Guardar +editarEstacionController.btnFechar.tooltiptext = Cerrar +editarEstacionController.conexion = Conexión Bancaria +editarEstacionController.usuario = Usuario Bancario +editarEstacionController.IndTipo.1 = BANORTE +editarEstacionController.IndTipo.2 = MANUAL +editarEstacionController.IndTipo.3 = SANTANDER +editarEstacionController.pinPad = Pinpad con impresora propia +editarEstacionController.MSG.suscribirOK = Estación se registró exitosamente. +editarEstacionController.MSG.borrarPergunta = ¿Eliminar Estación? +editarEstacionController.MSG.borrarOK = Estación se eliminó exitosamente. + +# Búsqueda Excepción Redondo +busquedaExceptionRedondoController.window.title = Excepción Viaje Redondo +busquedaExceptionRedondoController.btnRefresh.tooltiptext = Actualizar +busquedaExceptionRedondoController.btnNovo.tooltiptext = Agregar +busquedaExceptionRedondoController.btnCerrar.tooltiptext = Cerrar +busquedaExceptionRedondoController.lhIndtipo.label = Tipo +busquedaExceptionRedondoController.lhOrigem.label = Origen +busquedaExceptionRedondoController.lhDestino.label = Destino +busquedaExceptionRedondoController.btnPesquisa.label = Búsqueda + +# Editar Excepción Redondo +editarExceptionRedondoController.window.title = Excepción Viaje Redondo +editarExceptionRedondoController.btnApagar.tooltiptext = Eliminar +editarExceptionRedondoController.btnSalvar.tooltiptext = Guardar +editarExceptionRedondoController.btnFechar.tooltiptext = Cerrar +editarExceptionRedondoController.btnFechar.MSG.SuscbrirOK = Excepción Viaje Redondo se registró exitosamente. +editarExceptionRedondoController.btnFechar.MSG.Deseja.Borrar = ¿Eliminar Excepción Viaje Redondo? +editarExceptionRedondoController.btnFechar.MSG.BorrarOK = Excepción Viaje Redondo se eliminó exitosamente. +editarExceptionRedondoController.radio.abierto = Abierto +editarExceptionRedondoController.radio.confirmado = Confirmado + +# Búsqueda Redondeo +busquedaRedondeoController.window.title = Reglas de Redondeo +busquedaRedondeoController.btnRefresh.tooltiptext = Actualizar +busquedaRedondeoController.btnNovo.tooltiptext = Agregar +busquedaRedondeoController.btnCerrar.tooltiptext = Cerrar +busquedaRedondeoController.lhvalorinicial.label = Valor Inicial +busquedaRedondeoController.lhvalorfinal.label = Valor Final +busquedaRedondeoController.lhvalorredondeo.label = Valor Redondeo +busquedaRedondeoController.lhindaplicadescuento.label = Aplica Descuento +busquedaRedondeoController.lhindaplicapricing.label = Aplica Pricing +busquedaRedondeoController.btnPesquisa.label = Búsqueda + +# Editar Redondeo +editarRedondeoController.window.title = Reglas de Redondeo +editarRedondeoController.tabRedondeo.title = Redondeo +editarRedondeoController.tabMarca.title = Marca +editarRedondeoController.MSG.SuscbrirOK = Redondeo se registró exitosamente. +editarRedondeoController.MSG.Deseja.Borrar = ¿Eliminar Redondeo? +editarRedondeoController.MSG.BorrarOK = Redondeo se eliminó exitosamente. +editarRedondeoController.btnApagar.tooltiptext = Eliminar +editarRedondeoController.btnSalvar.tooltiptext = Guardar +editarRedondeoController.btnApagarMarca.tooltiptext = Eliminar +editarRedondeoController.btnSalvarMarca.tooltiptext = Guardar +editarRedondeoController.btnApagarRedondeo.tooltiptext = Eliminar +editarRedondeoController.btnSalvarRedondeo.tooltiptext = Guardar +editarRedondeoController.MSG.necesitaDescuento = Necesita informar un redondeo. +editarRedondeoController.MSG.necesitaMarca = Necesita informar una marca. +editarRedondeoController.MSG.valores = Valor inicial mayor que valor final. +editarRedondeoController.MSG.valoresTraslapa = Valores informado se traslapa con otro ya existente + +editarRedondeoController.btnFechar.tooltiptext = Cerrar +editarRedondeoController.lhMarca.label = Marca + + +# Búsqueda Redondeo Marca +busquedaRedondeoMarcaController.window.title = Redondeo Marca +busquedaRedondeoMarcaController.btnRefresh.tooltiptext = Actualizar +busquedaRedondeoMarcaController.btnNovo.tooltiptext = Agregar +busquedaRedondeoMarcaController.btnCerrar.tooltiptext = Cerrar +busquedaRedondeoMarcaController.lhMarca.label = Marca +busquedaRedondeoMarcaController.btnPesquisa.label = Búsqueda + +# Editar Redondeo Marca +editarRedondeoMarcaController.window.title = Redondeo Marca +editarRedondeoMarcaController.MSG.SuscbrirOK = Redondeo Marca se registró exitosamente. +editarRedondeoMarcaController.MSG.Deseja.Borrar = ¿Eliminar Redondeo Marca? +editarRedondeoMarcaController.MSG.BorrarOK = Redondeo Marca se eliminó exitosamente. +editarRedondeoMarcaController.btnApagar.tooltiptext = Eliminar +editarRedondeoMarcaController.btnSalvar.tooltiptext = Guardar +editarRedondeoMarcaController.btnFechar.tooltiptext = Cerrar + +# Búsqueda Comisionista Externo +busquedaComisionistaExternoController.window.title = Comisionista Externo +busquedaComisionistaExternoController.btnRefresh.tooltiptext = Actualizar +busquedaComisionistaExternoController.btnNovo.tooltiptext = Agregar +busquedaComisionistaExternoController.btnCerrar.tooltiptext = Cerrar +busquedaComisionistaExternoController.desccomisionista.label = Descripción +busquedaComisionistaExternoController.ID.label = ID +busquedaComisionistaExternoController.btnPesquisa.label = Búsqueda + +# Editar Comisionista Externo +editarComisionistaExternoController.window.title = Comisionista Externo +editarComisionistaExternoController.btnApagar.tooltiptext = Eliminar +editarComisionistaExternoController.btnSalvar.tooltiptext = Guardar +editarComisionistaExternoController.btnFechar.tooltiptext = Cerrar +editarComisionistaExternoController.MSG.suscribirOK = Comisionista Externo se registró exitosamente. +editarComisionistaExternoController.MSG.borrarPergunta = ¿Eliminar Comisionista Externo? +editarComisionistaExternoController.MSG.borrarOK = Comisionista Externo se eliminó exitosamente. + +# Búsqueda Convenio +busquedaConvenioController.window.title = Convenio +busquedaConvenioController.btnRefresh.tooltiptext = Actualizar +busquedaConvenioController.btnNovo.tooltiptext = Agregar +busquedaConvenioController.btnCerrar.tooltiptext = Cerrar +busquedaConvenioController.btnPesquisa.label = Búsqueda +busquedaConvenioController.descconvenio.label = Descripción +busquedaConvenioController.descconvenioID.label = ID +busquedaConvenioController.cveconvenio.label = Clave +busquedaConvenioController.validafolio.label = Valida Folio +busquedaConvenioController.imprimeprecio.label = Importe a Imprimir + +# Editar Convenio +editarConvenioController.window.title = Convenio +editarConvenioController.btnApagar.tooltiptext = Eliminar +editarConvenioController.btnSalvar.tooltiptext = Guardar +editarConvenioController.btnFechar.tooltiptext = Cerrar +editarConvenioController.lbDescConvenio.value = Convenio +editarConvenioController.lbCveConvenio.value = Clave Convenio +editarConvenioController.lbValidaFolio.value = Valida Folio +editarConvenioController.PrecioTotal.value = Precio Total +editarConvenioController.PrecioDescuento.value = Precio - Descuento convenido +editarConvenioController.Descuento.value = Descuento convenido +editarConvenioController.btnAddConvenioDet.tooltiptext = Agregar +editarConvenioController.btnBorrarConvenioDet.tooltiptext = Eliminar +editarConvenioController.lbPorcdescuento.value = Porcentaje +editarConvenioController.lbNumfolioinicio.value = Folio Inicial +editarConvenioController.lbNumfoliofinal.value = Folio Final +editarConvenioController.MSG.suscribirOK = Convenio se registró exitosamente. +editarConvenioController.MSG.borrarPergunta = ¿Eliminar Convenio? +editarConvenioController.MSG.borrarOK = Convenio se eliminó exitosamente. +editarConvenioController.Impression.value = Importe a Imprimir +editarConvenioController.ImpressionSeleccione.value = Seleccione un tipo Impresión del precio en el boleto +editarConvenioController.MSG.necessaitaPorcentaje.value = Necesita informar un porcentaje +editarConvenioController.MSG.registroTraslapado = El folio informado se traslapa con otro ya existente +editarConvenioController.MSG.pocentaje = Más de un descuento permitido sólo para rango de folios diferentes + +# Búsqueda Alerta CTRL +busquedaAlertaCtrlController.window.title = Configuración de Alertas +busquedaAlertaCtrlController.tabGenerico.title = Generico +busquedaAlertaCtrlController.btnRefresh.tooltiptext = Actualizar +busquedaAlertaCtrlController.btnNovo.tooltiptext = Agregar +busquedaAlertaCtrlController.btnCerrar.tooltiptext = Cerrar +busquedaAlertaCtrlController.tipo.label = Tipo de Alerta +busquedaAlertaCtrlController.tipoAlta.label = Alta +busquedaAlertaCtrlController.tipoBaja.label = Baja +busquedaAlertaCtrlController.tipoAmabos.label = Ambas +busquedaAlertaCtrlController.ruta.label = Ruta +busquedaAlertaCtrlController.origem.label = Origen +busquedaAlertaCtrlController.destino.label = Destino +busquedaAlertaCtrlController.claseservicio.label = Tipo Servicio +busquedaAlertaCtrlController.corrida.label = Corrida +busquedaAlertaCtrlController.btnPesquisa.label = Búsqueda +busquedaAlertaCtrlController.porc.label = Porcentaje +busquedaAlertaCtrlController.tiempo.label = Tiempo +busquedaAlertaCtrlController.btnProcurarCorrida.label = Búsqueda Corrida +busquedaAlertaCtrlController.corridaId.label = Número de Corrida +busquedaAlertaCtrlController.corridadata.label = Fec Corrida +busquedaAlertaCtrlController.corridaHora.label = Hora Corrida + + +# Editar Alerta CTRL +editarAlertaCtrlController.window.title = Configuración de Alerta +editarAlertaCtrlController.btnApagar.tooltiptext = Eliminar +editarAlertaCtrlController.btnSalvar.tooltiptext = Guardar +editarAlertaCtrlController.btnFechar.tooltiptext = Cerrar +editarAlertaCtrlController.MSG.suscribirOK = Configuración Alerta se registró exitosamente. +editarAlertaCtrlController.MSG.borrarPergunta = ¿Eliminar Configuración Alerta? +editarAlertaCtrlController.MSG.borrarOK = Configuración Alerta se eliminó exitosamente. +editarAlertaCtrlController.MSG.seleccionar.corrida = Seleccione una corrida. +editarAlertaCtrlController.MSG.necessitaTipo = Necesita informa un tipo de alerta. +editarAlertaCtrlController.MSG.question = ¿Desea crear una configuración de alerta generica ou por corrida? +editarAlertaCtrlController.MSG.generico = Generico +editarAlertaCtrlController.MSG.corrida = Corrida +editarAlertaCtrlController.MSG.traslapa = Ya existe una corrida com estos datos. +editarAlertaCtrlController.MSG.obligatorioDia = Debe de seleccionar un dia de la semana +editarAlertaCtrlController.confCorrida.label = Configuración Generica +editarAlertaCtrlController.confGenerica.label = Configuración por Corrida +editarAlertaCtrlController.corridaNoEncontrada.label = No se encontro ninguna corrida com esse id. +editarAlertaCtrlController.MSG.origenNoExisteRuta = El origen informada no existe en la ruta +editarAlertaCtrlController.MSG.destinoNoExisteRuta = El destino informada no existe en la ruta + +# Búsqueda Secretaría +busquedaSecretariaController.window.title = Secretaría +busquedaSecretariaController.btnRefresh.tooltiptext = Actualizar +busquedaSecretariaController.btnNovo.tooltiptext = Agregar +busquedaSecretariaController.btnCerrar.tooltiptext = Cerrar +busquedaSecretariaController.DescSecretaria.label = Descripción +busquedaSecretariaController.SecretariaID.label = ID +busquedaSecretariaController.CveSecretaria.label = Clave Secretaría +busquedaSecretariaController.btnPesquisa.label = Búsqueda +busquedaSecretariaController.validafolio.label = Valida Folio +busquedaSecretariaController.imprimeprecio.label = Importe a Imprimir + +# Editar Secretaría +editarSecretariaController.window.title = Secretaría +editarSecretariaController.btnApagar.tooltiptext = Eliminar +editarSecretariaController.btnSalvar.tooltiptext = Guardar +editarSecretariaController.btnFechar.tooltiptext = Cerrar +editarSecretariaController.lbDescSecretaria.value = Secretaría +editarSecretariaController.lbCveSecretaria.value = Clave Secretaría +editarSecretariaController.lbValidaFolio.value = Valida Folio +editarSecretariaController.Impression.value = Importe a Imprimir +editarSecretariaController.PrecioTotal.value = Precio total +editarSecretariaController.PrecioDescuento.value = Precio menos descuento por cobrar +editarSecretariaController.Descuento.value = Descuento por cobrar +editarSecretariaController.btnAddCuponSecretaria.tooltiptext = Agregar +editarSecretariaController.btnBorrarCuponSecretaria.tooltiptext = Eliminar +editarSecretariaController.lbPorcdescuento.value = Porcentaje Descuento +editarSecretariaController.lbNumfolioinicio.value = Folio Inicial +editarSecretariaController.lbNumfoliofinal.value = Folio Final +editarSecretariaController.MSG.suscribirOK = Secretaría se registró exitosamente. +editarSecretariaController.MSG.borrarPergunta = ¿Eliminar Secretaría? +editarSecretariaController.MSG.borrarOK = Secretaría se eliminó exitosamente. +editarSecretariaController.MSG.folio = Folio final es menor o igual a folio inicial. +editarSecretariaController.MSG.necessaitaPorcentaje.value = Necesita informar un porcentaje +editarSecretariaController.MSG.registroTraslapado = El folio informado se traslapa con otro ya existente +editarSecretariaController.MSG.pocentaje = Más de un descuento permitido sólo para rango de folios diferentes + +# Búsqueda Ciudad +busquedaCiudadController.window.title = Ciudad +busquedaCiudadController.btnRefresh.tooltiptext = Actualizar +busquedaCiudadController.btnNovo.tooltiptext = Agregar +busquedaCiudadController.btnCerrar.tooltiptext = Cerrar +busquedaCiudadController.lhId.label = ID +busquedaCiudadController.txtNome.label = Ciudad +busquedaCiudadController.btnPesquisa.label = Búsqueda +busquedaCiudadController.lhNome.label = Descripción +busquedaCiudadController.lhEstado.label = Estado +busquedaCiudadController.lhPlaza.label = Plaza +busquedaCiudadController.estado.label = Estado +busquedaCiudadController.plaza.label = Plaza +busquedaCiudadController.zonahorario.label = Zona horaria + +# Editar Ciudad +editarCiudadController.window.title = Ciudad +editarCiudadController.MSG.suscribirOK = Ciudad se registró exitosamente. +editarCiudadController.MSG.borrarPergunta = ¿Desea eliminar esta Ciudad? +editarCiudadController.MSG.borrarOK = Ciudad se eliminó exitosamente. +editarCiudadController.btnApagar.tooltiptext = Eliminar +editarCiudadController.btnSalvar.tooltiptext = Guardar +editarCiudadController.btnFechar.tooltiptext = Cerrar +editarCiudadController.lbNome.value = Ciudad +busquedaCiudadController.estado.label = Estado +busquedaCiudadController.plaza.label = Plaza + +# Búsqueda Colonia +busquedaColoniaController.window.title = Colonia +busquedaColoniaController.btnRefresh.tooltiptext = Actualizar +busquedaColoniaController.btnNovo.tooltiptext = Agregar +busquedaColoniaController.btnCerrar.tooltiptext = Cerrar +busquedaColoniaController.lhId.label = ID +busquedaColoniaController.txtNome.label = Colonia +busquedaColoniaController.btnPesquisa.label = Búsqueda +busquedaColoniaController.lhNome.label = Descripción +busquedaColoniaController.lhCodPostal.label = Cod Postal +busquedaColoniaController.lhCiudad.label = Ciudad + + +# Editar Colonia +editarColoniaController.window.title = Colonia +editarColoniaController.MSG.suscribirOK = Colonia se registró exitosamente. +editarColoniaController.MSG.borrarPergunta = ¿Desea eliminar esta Colonia? +editarColoniaController.MSG.borrarOK = Colonia se eliminó exitosamente. +editarColoniaController.btnApagar.tooltiptext = Eliminar +editarColoniaController.btnSalvar.tooltiptext = Guardar +editarColoniaController.btnFechar.tooltiptext = Cerrar +editarColoniaController.lbNome.value = Colonia +editarColoniaController.lhCodPostal.label = Cod Postal +editarColoniaController.lhCiudad.label = Ciudad +editarColoniaController.lhEquivalencia.label = Equivalencia + + +# Búsqueda Artículo +busquedaArticuloController.window.title = Artículo +busquedaArticuloController.btnRefresh.tooltiptext = Actualización +busquedaArticuloController.btnNovo.tooltiptext = Agregar +busquedaArticuloController.btnCerrar.tooltiptext = Cerrar +busquedaArticuloController.txtNombre.label = Descripción +busquedaArticuloController.btnPesquisa.label = Búsqueda +busquedaArticuloController.lhId.label = ID +busquedaArticuloController.lhDesc.label = Descripción + +# Búsqueda Plaza +busquedaPlazaController.window.title = Plaza +busquedaPlazaController.btnRefresh.tooltiptext = Actualización +busquedaPlazaController.btnNovo.tooltiptext = Agregar +busquedaPlazaController.btnCerrar.tooltiptext = Cerrar +busquedaPlazaController.txtNombre.label = Descripción +busquedaPlazaController.btnPesquisa.label = Búsqueda +busquedaPlazaController.lhId.label = ID +busquedaPlazaController.lhDesc.label = Descripción + +# Editar Artículo +editarArticuloController.window.title = Artículo +editarArticuloController.btnApagar.tooltiptext = Eliminar +editarArticuloController.btnSalvar.tooltiptext = Guardar +editarArticuloController.btnFechar.tooltiptext = Cerrar +editarArticuloController.lhDesc.label = Descripción +editarArticuloController.MSG.suscribirOK = Artículo se registró exitosamente. +editarArticuloController.MSG.borrarPergunta = ¿Eliminar artículo? +editarArticuloController.MSG.borrarOK = Artículo se eliminó exitosamente. + +# Editar Plaza +editarPlazaController.window.title = Plaza +editarPlazaController.btnApagar.tooltiptext = Eliminar +editarPlazaController.btnSalvar.tooltiptext = Guardar +editarPlazaController.btnFechar.tooltiptext = Cerrar +editarPlazaController.lhDesc.label = Descripción +editarPlazaController.MSG.suscribirOK = Plaza se registró exitosamente. +editarPlazaController.MSG.borrarPergunta = ¿Eliminar plaza? +editarPlazaController.MSG.borrarOK = Plaza se eliminó exitosamente. + +# Busqeuda Tipo Corte +busquedaTipoCorteController.window.title = Tipo Corte +busquedaTipoCorteController.btnRefresh.tooltiptext = Actualizar +busquedaTipoCorteController.btnNovo.tooltiptext = Agregar +busquedaTipoCorteController.btnCerrar.tooltiptext = Cerrar +busquedaTipoCorteController.txtNombre.label = Descripción +busquedaTipoCorteController.btnPesquisa.label = Búsqueda +busquedaTipoCorteController.lhId.label = ID +busquedaTipoCorteController.lhDesc.label = Descripción + +# Editar Tipo Corte +editarTipoCorteController.window.title = Tipo Corte +editarTipoCorteController.btnApagar.tooltiptext = Eliminar +editarTipoCorteController.btnSalvar.tooltiptext = Guardar +editarTipoCorteController.btnFechar.tooltiptext = Cerrar +editarTipoCorteController.lhDesc.label = Descripción +editarTipoCorteController.MSG.suscribirOK = Tipo Corte se registró exitosamente. +editarTipoCorteController.MSG.borrarPergunta = ¿Eliminar Tipo Corte? +editarTipoCorteController.MSG.borrarOK = Tipo Corte se elemino exitosamente. + +# Búsqueda Turno +busquedaTurnoController.window.title = Turno +busquedaTurnoController.btnRefresh.tooltiptext = Actualizar +busquedaTurnoController.btnNovo.tooltiptext = Agregar +busquedaTurnoController.btnCerrar.tooltiptext = Cerrar +busquedaTurnoController.txtNombre.label = Descripción +busquedaTurnoController.btnPesquisa.label = Búsqueda +busquedaTurnoController.lhId.label = ID +busquedaTurnoController.lhDesc.label = Descripción + +# Editar Turno +editarTurnoController.window.title = Turno +editarTurnoController.btnApagar.tooltiptext = Eliminar +editarTurnoController.btnSalvar.tooltiptext = Guardar +editarTurnoController.btnFechar.tooltiptext = Cerrar +editarTurnoController.lhDesc.label = Descripción +editarTurnoController.MSG.suscribirOK = Turno se registró exitosamente. +editarTurnoController.MSG.borrarPergunta = ¿Eliminar Turno? +editarTurnoController.MSG.borrarOK = Turno se eliminó exitosamente. + +# Búsqueda Tipo Movimiento +busquedaTipoMovimientoController.window.title = Tipo Movimiento +busquedaTipoMovimientoController.btnRefresh.tooltiptext = Actualizar +busquedaTipoMovimientoController.btnNovo.tooltiptext = Agregar +busquedaTipoMovimientoController.btnCerrar.tooltiptext = Cerrar +busquedaTipoMovimientoController.txtNombre.label = Descripción +busquedaTipoMovimientoController.lhId.label = ID +busquedaTipoMovimientoController.lhDesc.label = Descripción +busquedaTipoMovimientoController.btnPesquisa.label = Búsqueda + +# Editar Tipo Movimiento +editarTipoMovimientoController.window.title = Tipo Movimiento +editarTipoMovimientoController.btnApagar.tooltiptext = Eliminar +editarTipoMovimientoController.btnSalvar.tooltiptext = Guardar +editarTipoMovimientoController.btnFechar.tooltiptext = Cerrar +editarTipoMovimientoController.lhDesc.label = Descripción +editarTipoMovimientoController.MSG.suscribirOK = Tipo Movimiento se registró exitosamente. +editarTipoMovimientoController.MSG.borrarPergunta = ¿Eliminar Tipo Movimiento? +editarTipoMovimientoController.MSG.borrarOK = Tipo Movimiento se eliminó exitosamente. + +# Búsqueda Tipo Ocupacion +busquedaTipoOcupacionController.window.title = Tipo Ocupacion +busquedaTipoOcupacionController.btnRefresh.tooltiptext = Actualizar +busquedaTipoOcupacionController.btnNovo.tooltiptext = Agregar +busquedaTipoOcupacionController.btnCerrar.tooltiptext = Cerrar +busquedaTipoOcupacionController.txtNombre.label = Descripción +busquedaTipoOcupacionController.txtCve.label = Clave +busquedaTipoOcupacionController.btnPesquisa.label = Búsqueda +busquedaTipoOcupacionController.lhId.label = ID +busquedaTipoOcupacionController.lhDesc.label = Descripción +busquedaTipoOcupacionController.lhCVE.label = Clave + +# Editar Tipo Ocupacion +editarTipoOcupacionController.window.title = Tipo Ocupacion +editarTipoOcupacionController.btnApagar.tooltiptext = Eliminar +editarTipoOcupacionController.btnSalvar.tooltiptext = Guardar +editarTipoOcupacionController.btnFechar.tooltiptext = Cerrar +editarTipoOcupacionController.lhDesc.label = Descripción +editarTipoOcupacionController.lhCVE.label = Clave +editarTipoOcupacionController.MSG.suscribirOK = Tipo Ocupacion se registró exitosamente. +editarTipoOcupacionController.MSG.borrarPergunta = ¿Eliminar Tipo Ocupación? +editarTipoOcupacionController.MSG.borrarOK = Tipo Ocupacion se eliminó exitosamente. + +# Búsqueda Tipo Domicilio +busquedaTipoDomicilioController.window.title = Tipo Domicilio +busquedaTipoDomicilioController.btnRefresh.tooltiptext = Actualizar +busquedaTipoDomicilioController.btnNovo.tooltiptext = Agregar +busquedaTipoDomicilioController.btnCerrar.tooltiptext = Cerrar +busquedaTipoDomicilioController.txtNombre.label = Descripción +busquedaTipoDomicilioController.txtCve.label = Clave +busquedaTipoDomicilioController.btnPesquisa.label = Búsqueda +busquedaTipoDomicilioController.lhId.label = ID +busquedaTipoDomicilioController.lhDesc.label = Descripción +busquedaTipoDomicilioController.lhCVE.label = Clave + +# Editar Tipo Domicilio +editarTipoDomicilioController.window.title = Tipo Domicilio +editarTipoDomicilioController.btnApagar.tooltiptext = Eliminar +editarTipoDomicilioController.btnSalvar.tooltiptext = Guardar +editarTipoDomicilioController.btnFechar.tooltiptext = Cerrar +editarTipoDomicilioController.lhDesc.label = Descripción +editarTipoDomicilioController.lhCVE.label = Clave +editarTipoDomicilioController.MSG.suscribirOK = Tipo Domicilio se registró exitosamente. +editarTipoDomicilioController.MSG.borrarPergunta = ¿Eliminar Tipo Domicilio? +editarTipoDomicilioController.MSG.borrarOK = Tipo Domicilio se eliminó exitosamente. +editarTipoDomicilioController.MSG.clave = Ya existe un registro con esta clave. + +# Búsqueda Tipo Cambio Ciudad +busquedaTipoCambioCiudadController.window.title = Tipo Cambio Ciudad +busquedaTipoCambioCiudadController.btnRefresh.tooltiptext = Actualizar +busquedaTipoCambioCiudadController.btnNovo.tooltiptext = Agregar +busquedaTipoCambioCiudadController.btnCerrar.tooltiptext = Cerrar +busquedaTipoCambioCiudadController.Importecambio = Paridad +busquedaTipoCambioCiudadController.FecaplicacionDe = Período Inicial +busquedaTipoCambioCiudadController.FecaplicacionAte = Período Final +busquedaTipoCambioCiudadController.Fecaplicacion = Período Aplicacion +busquedaTipoCambioCiudadController.MonedaOrigen = Moneda Origen +busquedaTipoCambioCiudadController.MonedaDestino = Moneda Destino +busquedaTipoCambioCiudadController.Ciudad = Ciudad +busquedaTipoCambioCiudadController.btnPesquisa.label = Búsqueda + +# Editar Tipo Cambio Ciudad + +editarTipoCambioCiudadController.window.title = Tipo Cambio Ciudad +editarTipoCambioCiudadController.MSG.borrarPergunta = ¿Eliminar Tipo Cambio Ciudad? +editarTipoCambioCiudadController.MSG.borrarOK = Tipo Cambio Ciudad se eliminó exitosamente. +editarTipoCambioCiudadController.btnApagar.tooltiptext = Eliminar +editarTipoCambioCiudadController.btnSalvar.tooltiptext = Guardar +editarTipoCambioCiudadController.btnFechar.tooltiptext = Cerrar +editarTipoCambioCiudadController.FecaplicacionAte = Fecha/Hora Aplicación +editarTipoCambioCiudadController.MonedaOrigen = Moneda Origen +editarTipoCambioCiudadController.MonedaDestino = Moneda Destino +editarTipoCambioCiudadController.Importecambio = Paridad +editarTipoCambioCiudadController.btnAddCiudad.tooltiptext = Agregar +editarTipoCambioCiudadController.btnBorrarCiudad.tooltiptext = Eliminar +editarTipoCambioCiudadController.Ciudad = Ciudad +editarTipoCambioCiudadController.MSG.necessitaCiudad = Necesita informar una ciudad. +editarTipoCambioCiudadController.MSG.diferenteMoneda = Moneda Destino debe ser obrigatoriamente diferente de Moneda Origen +editarTipoCambioCiudadController.MSG.suscribirOK = Tipo Cambio Ciudad se registró exitosamente. + +# Muestra la Estado de la Búsqueda +busquedaEstadoController.window.title = Estado +busquedaEstadoController.btnRefresh.tooltiptext = Actualizar +busquedaEstadoController.btnNovo.tooltiptext = Agregar +busquedaEstadoController.btnCerrar.tooltiptext = Cerrar +busquedaEstadoController.btnPesquisa.label = Búsqueda +busquedaEstadoController.lhId.label = ID +busquedaEstadoController.lhDesc.label = Descripción +busquedaEstadoController.txtNombre.label = Estado +busquedaEstadoController.lhPais.label = País + +# Pantalla Editar Estado +editarEstadoController.window.title = Estado +editarEstadoController.btnApagar.tooltiptext = Eliminar +editarEstadoController.btnSalvar.tooltiptext = Guardar +editarEstadoController.btnFechar.tooltiptext = Cerrar +editarEstadoController.lbNome.value = Estado +editarEstadoController.lbPais.value = País +editarEstadoController.MSG.suscribirOK = Estado se registró exitosamente. +editarEstadoController.MSG.borrarPergunta = ¿Desea eliminar este estado? +editarEstadoController.MSG.borrarOK = Estado se eliminó exitosamente. + +#Pantalla Editar Tramo Secuencia +editarTramosSecuenciaController.window.title= Tramo +editarTramosSecuenciaController.lbParada.value=Parada +editarTramosSecuenciaController.btnApagarParada.tooltiptext = Quitar parada +editarTramosSecuenciaController.btnAgregarParada.tooltiptext = Agregar +editarTramosSecuenciaController.lhCve.value=Clave +editarTramosSecuenciaController.lhParada.value=Parada +editarTramosSecuenciaController.labelVia.value=Via +editarTramosSecuenciaController.MSG.viaObligatorio=Seleccione una vía +editarTramosSecuenciaController.MSG.paradasObligatorio=Seleccione las paradas +editarTramosSecuenciaController.MSG.gridObligatorio=No hay registros en el grid +editarTramosSecuenciaController.MSG.registroSucceso=Los tramos se registraron exitosamente. +editarEstadoController.MSG.borrarOK = Estado se eliminó exitosamente. + +# Búsqueda Parada Equivalencia +busquedaParadaEquivalenciaController.window.title = Equivalencia Parada +busquedaParadaEquivalenciaController.btnRefresh.tooltiptext = Actualizar +busquedaParadaEquivalenciaController.btnNovo.tooltiptext = Agregar +busquedaParadaEquivalenciaController.btnCerrar.tooltiptext = Cerrar +busquedaParadaEquivalenciaController.lhParada.label = Parada +busquedaParadaEquivalenciaController.lbCveParada.value = Clave Parada +busquedaParadaEquivalenciaController.cmbComissionestaExterno.value = Comisionista Externo +busquedaParadaEquivalenciaController.btnPesquisa.label = Búsqueda +busquedaParadaEquivalenciaController.lhId.label = ID +busquedaParadaEquivalenciaController.lhDesc.label = Parada +busquedaParadaEquivalenciaController.lbCveParada.label = Clave Parada + +# Editar Parada Equivalencia +editarParadaEquivalenciaController.window.title = Equivalencia Parada +editarParadaEquivalenciaController.btnApagar.tooltiptext = Eliminar +editarParadaEquivalenciaController.btnSalvar.tooltiptext = Guardar +editarParadaEquivalenciaController.btnFechar.tooltiptext = Cerrar +editarParadaEquivalenciaController.cmbComissionestaExterno.value = Comisionista Externo +editarParadaEquivalenciaController.cmbParada.value = Parada +editarParadaEquivalenciaController.lbNome.value = Equivalencia +editarParadaEquivalenciaController.MSG.suscribirOK = Parada Equivalencia se registró exitosamente. +editarParadaEquivalenciaController.MSG.borrarPergunta = ¿Desea eliminar Parada Equivalencia? +editarParadaEquivalenciaController.MSG.borrarOK = Parada Equivalencia se eliminó exitosamente. + +# Búsqueda Empresa Equivalencia +busquedaEmpresaEquivalenciaController.window.title = Equivalencia Empresa +busquedaEmpresaEquivalenciaController.btnRefresh.tooltiptext = Actualizar +busquedaEmpresaEquivalenciaController.btnNovo.tooltiptext = Agregar +busquedaEmpresaEquivalenciaController.btnCerrar.tooltiptext = Cerrar +busquedaEmpresaEquivalenciaController.lhEmpresa.label = Empresa +busquedaEmpresaEquivalenciaController.cmbComissionestaExterno.value = Comisionista Externo +busquedaEmpresaEquivalenciaController.btnPesquisa.label = Búsqueda +busquedaEmpresaEquivalenciaController.lhId.label = ID +busquedaEmpresaEquivalenciaController.lhDesc.label = Empresa +busquedaEmpresaEquivalenciaController.cmbComissionestaExterno.value = Comisionista Externo +busquedaEmpresaEquivalenciaController.lbEquivalencia.value = Equivalencia + +# Editar Empresa Equivalencia +editarEmpresaEquivalenciaController.window.title = Equivalencia Empresa +editarEmpresaEquivalenciaController.btnApagar.tooltiptext = Eliminar +editarEmpresaEquivalenciaController.btnSalvar.tooltiptext = Guardar +editarEmpresaEquivalenciaController.btnFechar.tooltiptext = Cerrar +editarEmpresaEquivalenciaController.cmbEmpresa.value = Empresa +editarEmpresaEquivalenciaController.cmbComissionestaExterno.value = Comisionista Externo +editarEmpresaEquivalenciaController.lbEquivalencia.value = Equivalencia +editarEmpresaEquivalenciaController.MSG.suscribirOK = Empresa Equivalencia se registró exitosamente. +editarEmpresaEquivalenciaController.MSG.borrarPergunta = ¿Desea borrar Empresa Equivalencia? +editarEmpresaEquivalenciaController.MSG.borrarOK = Empresa Equivalencia se eliminó exitosamente. + +# Búsqueda Tipo Servicio Equivalencia +busqeudaClaseservicioEquivalenciaController.window.title = Equivalencia Tipo Servicio +busqeudaClaseservicioEquivalenciaController.btnRefresh.tooltiptext = Actualizar +busqeudaClaseservicioEquivalenciaController.btnNovo.tooltiptext = Agregar +busqeudaClaseservicioEquivalenciaController.btnCerrar.tooltiptext = Cerrar +busqeudaClaseservicioEquivalenciaController.lhClaseservicio.label = Tipo Servicio +busqeudaClaseservicioEquivalenciaController.cmbComissionestaExterno.value = Comisionista Externo +busqeudaClaseservicioEquivalenciaController.btnPesquisa.label = Búsqueda +busqeudaClaseservicioEquivalenciaController.lhId.label = ID +busqeudaClaseservicioEquivalenciaController.lhDesc.label = Tipo Servicio +busqeudaClaseservicioEquivalenciaController.cmbComissionestaExterno.value = Comisionista Externo +busqeudaClaseservicioEquivalenciaController.lbEquivalencia.value = Equivalencia + +# Editar Tipo Servicio Equivalencia +editarClaseservicioEquivalenciaController.window.title = Equivalencia Tipo Servicio +editarClaseservicioEquivalenciaController.btnApagar.tooltiptext = Eliminar +editarClaseservicioEquivalenciaController.btnSalvar.tooltiptext = Guardar +editarClaseservicioEquivalenciaController.btnFechar.tooltiptext = Cerrar +editarClaseservicioEquivalenciaController.cmbClaseServicio.value = Tipo Servicio +editarClaseservicioEquivalenciaController.cmbComissionestaExterno.value = Comisionista Externo +editarClaseservicioEquivalenciaController.lbEquivalencia.value = Equivalencia +editarClaseservicioEquivalenciaController.MSG.suscribirOK = Tipo Servicio Equivalencia se registró exitosamente. +editarClaseservicioEquivalenciaController.MSG.borrarPergunta = ¿Desea eliminar Tipo Servicio Equivalencia? +editarClaseservicioEquivalenciaController.MSG.borrarOK = Tipo Servicio Equivalencia se eliminó exitosamente. + +# Búsqueda Motivo cancelacion equivalencia +busquedamotivocancelacionEquivalenciaController.window.title = Equivalencia Motivo Cancelación +busquedamotivocancelacionEquivalenciaController.btnRefresh.tooltiptext = Actualizar +busquedamotivocancelacionEquivalenciaController.btnNovo.tooltiptext = Agregar +busquedamotivocancelacionEquivalenciaController.btnCerrar.tooltiptext = Cerrar +busquedamotivocancelacionEquivalenciaController.btnPesquisa.label = Búsqueda +busquedamotivocancelacionEquivalenciaController.cmbComissionestaExterno.value = Comisionista Externo +busquedamotivocancelacionEquivalenciaController.cmbMotivoCancelacion.value = Motivo Cancelación +busquedamotivocancelacionEquivalenciaController.lbEquivalencia.value = Equivalencia + +# Editar Motivo cancelacion equivalencia +editarMotivoCancelacionEquivalenciaController.window.title = Equivalencia Motivo Cancelación +editarMotivoCancelacionEquivalenciaController.btnApagar.tooltiptext = Eliminar +editarMotivoCancelacionEquivalenciaController.btnSalvar.tooltiptext = Guardar +editarMotivoCancelacionEquivalenciaController.btnFechar.tooltiptext = Cerrar +editarMotivoCancelacionEquivalenciaController.cmbComissionestaExterno.value = Comisionista Externo +editarMotivoCancelacionEquivalenciaController.cmbMotivoCancelacion.value = Motivo Cancelación +editarMotivoCancelacionEquivalenciaController.lbEquivalencia.value = Equivalencia +editarMotivoCancelacionEquivalenciaController.MSG.suscribirOK = Motivo cancelación equivalencia se registró exitosamente. +editarMotivoCancelacionEquivalenciaController.MSG.borrarPergunta = ¿Desea eliminar Motivo cancelación equivalencia? +editarMotivoCancelacionEquivalenciaController.MSG.borrarOK = Motivo cancelación equivalencia se eliminó exitosamente. + +#Editar datos de la categoria +editarConfiguracionCategoriaDatosCategoriaController.title=Editar datos Tipo de Pasajero + +#Editar pricing dia +EditarPricingDiaController.MSG.obligatorioDia=Debe de seleccionar un dia de la semana + +# INFORME PASAJERO POR SERVICIO +informePasajeroServicioController.window.title = Pasajero por Corrida +informePasajeroServicioController.btnFechar.tooltiptext = Cerrar +informePasajeroServicioController.cmbMarca.value = Marca +informePasajeroServicioController.cmbEmpresa.value = Empresa +informePasajeroServicioController.servicio.label = Corrida +informePasajeroServicioController.lbFecInicio.value = Fecha Inicio +informePasajeroServicioController.lbFecFinal.value = Fecha Fin + +# INFORME SERVICIO DIARIO +informeServicioDiarioController.window.title = Servicio Diario +informeServicioDiarioController.btnFechar.tooltiptext = Cerrar +informeServicioDiarioController.servicio.label = Corrida +informeServicioDiarioController.lbFecInicio.value = Fecha Inicio +informeServicioDiarioController.lbFecFinal.value = Fecha Fin + +# INFORME CATEGORIA VENTA +informeCategoriaVentaController.window.title = Categoria Venta +informeCategoriaVentaController.btnFechar.tooltiptext = Cerrar +informeCategoriaVentaController.labelOrigen.value = Origen +informeCategoriaVentaController.labelDestino.value = Destino +informeCategoriaVentaController.cmbEmpresa.value = Empresa +informeCategoriaVentaController.servicio.label = Corrida +informeCategoriaVentaController.lbFecInicio.value = Fecha Inicio +informeCategoriaVentaController.lbFecFinal.value = Fecha Fin + +# INFORME VENTAS PUNTO VENTA +informeVentasPuntoVentaController.window.title = Ventas Punto Venta +informeVentasPuntoVentaController.btnFechar.tooltiptext = Cerrar +informeVentasPuntoVentaController.cmbEmpresa.value = Empresa +informeVentasPuntoVentaController.lbFecInicio.value = Fecha Inicio +informeVentasPuntoVentaController.lbFecFinal.value = Fecha Fin + +# Busqueda Compania Bancaria +busquedaCompaniaBancaria.window.title = Compania Bancaria +busquedaCompaniaBancaria.btnRefresh.tooltiptext = Actualizar +busquedaCompaniaBancaria.btnNovo.tooltiptext = Agregar +busquedaCompaniaBancaria.btnCerrar.tooltiptext = Cerrar +busquedaCompaniaBancaria.lhcvecompania.label = Clave compañia +busquedaCompaniaBancaria.lhcvesucursal.label = Clave sucursal +busquedaCompaniaBancaria.btnPesquisa.label = Búsqueda +busquedaCompaniaBancaria.lhcompaniabancariaId.label = ID + +# Editar Compania Bancaria +editarCompaniaBancariaController.window.title = Compañia Bancaria +editarCompaniaBancariaController.btnApagar.tooltiptext = Eliminar +editarCompaniaBancariaController.btnSalvar.tooltiptext = Guardar +editarCompaniaBancariaController.btnFechar.tooltiptext = Cerrar +editarCompaniaBancariaController.MSG.suscribirOK = Compania Bancaria se registró exitosamente. +editarCompaniaBancariaController.MSG.borrarPergunta = ¿Desea eliminar Compania Bancaria? +editarCompaniaBancariaController.MSG.borrarOK = Compania Bancaria se eliminó exitosamente. +editarCompaniaBancariaController.MSG.usu = Necesita informar un Usuario Bancario. +editarCompaniaBancariaController.MSG.mer = Necesita informar un Merchant Bancario. + +# Editar Merchant Bancario +editarMerchantBancarioController.window.title = Merchant Bancario +editarMerchantBancarioController.btnSalvar.tooltiptext = Guardar +editarMerchantBancarioController.btnFechar.tooltiptext = Cerrar +editarMerchantBancarioController.cvemerchant.label = Clave Merchant +editarMerchantBancarioController.descmerchant.label = Descripción Merchant + +# Editar Usuario bancario +editarUsuarioBancarioController.window.title = Usuario Bancario +editarUsuarioBancarioController.btnSalvar.tooltiptext = Guardar +editarUsuarioBancarioController.btnFechar.tooltiptext = Cerrar +editarUsuarioBancarioController.cveusuario.label = Clave Usuario +editarUsuarioBancarioController.password.label = Password + +# Busqueda Tarjeta Recaudacion +busquedaTarjetaRecaudacionController.window.title = Tarjeta Recaudación +busquedaTarjetaRecaudacionController.btnRefresh.tooltiptext = Actualizar +busquedaTarjetaRecaudacionController.btnNovo.tooltiptext = Agregar +busquedaTarjetaRecaudacionController.btnCerrar.tooltiptext = Cerrar +busquedaTarjetaRecaudacionController.claveConductor.label = Clave Conductor +busquedaTarjetaRecaudacionController.btnPesquisa.label = Búsqueda +busquedaTarjetaRecaudacionController.pago.label = Pago +busquedaTarjetaRecaudacionController.numTarjeta.label = Tarjeta +busquedaTarjetaRecaudacionController.fechaHora.label = Fecha/Hora +busquedaTarjetaRecaudacionController.origen.label = Origen +busquedaTarjetaRecaudacionController.destino.label = Destino +busquedaTarjetaRecaudacionController.ruta.label = Ruta +busquedaTarjetaRecaudacionController.autoBus.label = Autobus +busquedaTarjetaRecaudacionController.servicio.label = Servicio +busquedaTarjetaRecaudacionController.empresa.label = Empresa +busquedaTarjetaRecaudacionController.ingresoCorrida.label = Ingresso Corrida +busquedaTarjetaRecaudacionController.manual.label = Manual +busquedaTarjetaRecaudacionController.atualizado.label = Actualizado +busquedaTarjetaRecaudacionController.observaciones.label = Obervaciones +busquedaTarjetaRecaudacionController.corrida.label = Corrida +busquedaTarjetaRecaudacionController.btnConfirmaPago = Confirma Pago +busquedaTarjetaRecaudacionController.MSG.Seleccionar.Tajetas = Seleccione tajetas + +# Editar Tarjeta Recaudacion +editarTarjetaRecaudacionController.window.title = Tarjeta Recaudación + +# Login Conductor Recaudacion +winLoginConductorRecaudacion.title = Ingresar Conductor +winLoginConductorRecaudacion.lblUsuario = Clave Conductor +winLoginConductorRecaudacion.lblSenha = Contraseña +winLoginConductorRecaudacion.btnAcessar = Acesso +winLoginConductorRecaudacion.lblloginIncorreto = Inicio de Sesión Incorrecto. Intentelo de nuevo. +winLoginConductorRecaudacion.conductor.corecto = Conductor corecto? +winLoginConductorRecaudacion.conductor.nombre = Nombre: +winLoginConductorRecaudacion.conductor.clave = Clave: + +# Confirma Pago Tarjetas Recaudacion +pagarTarjetasViajesController.window.title = Confirma Pago +pagarTarjetasViajesController.label.Conductor = Conductor +pagarTarjetasViajesController.label.DescripcionViajes = Descripcion Viajes +pagarTarjetasViajesController.label.FechaHora = Fecha/Hora +pagarTarjetasViajesController.label.Trayecto = Trayecto +pagarTarjetasViajesController.label.KM = KM +pagarTarjetasViajesController.label.Salario = Salario +pagarTarjetasViajesController.label.Percepciones = Percepciones +pagarTarjetasViajesController.label.Concepto = Concepto +pagarTarjetasViajesController.label.Cantidad = Cantidad +pagarTarjetasViajesController.label.TotalPercepciones = Total Percepciones +pagarTarjetasViajesController.label.Deducciones = Deducciones +pagarTarjetasViajesController.label.TotalDeducciones = Total Deducciones +pagarTarjetasViajesController.label.TotalPercepciones = Total Percepciones +pagarTarjetasViajesController.label.NetoPagar = Neto a Pagar + +# Abertura de Turno Recaudacion +aberturaTurnoRecaudacionController.title = Inicio Turno Recaudacion +aberturaTurnoRecaudacionController.btnInicioTurno = Inicio Turno +aberturaTurnoRecaudacionController.lblFechaHoraInicioTurno = Fecha/Hora Inicio +aberturaTurnoRecaudacionController.lblValorInicioTurno = Valor Inicio + +# COrte de Turno Recaudacion +corteTurnoRecaudacionController.title = Corte de Turno +corteTurnoRecaudacionController.ImpressaoCompleta.label = Impressão Completo +corteTurnoRecaudacionController.ImpressaoSimples.label = Impressão Simples +corteTurnoRecaudacionController.FechaInicio.label = Fecha Inicio +corteTurnoRecaudacionController.ClvRecaudador.label = Clave Operador +corteTurnoRecaudacionController.FechaFinal.label = Fecha Final +corteTurnoRecaudacionController.HoraInicio.label = Hhora Inicio +corteTurnoRecaudacionController.NombreRecaudador.label = Nombre Recaudador +corteTurnoRecaudacionController.HoraFinal.label = Hora Final +corteTurnoRecaudacionController.SaldoInicialCaja.label = Saldo Inicio +corteTurnoRecaudacionController.Turno.label = Turno +corteTurnoRecaudacionController.SaldoFinalCaja.label = Saldo Final +corteTurnoRecaudacionController.ReposicionTurno.label = Reposicion +corteTurnoRecaudacionController.SaldoFinalTransferidoPara.label = Saldo Final Trsansferido +corteTurnoRecaudacionController.Recoleccciones.label = Reolecciones +corteTurnoRecaudacionController.FolioRecibo.label = Folio Recibo +corteTurnoRecaudacionController.TipoPago.label = Tipo Pago +corteTurnoRecaudacionController.Operador.label = Operador +corteTurnoRecaudacionController.Autobus.label = Autobus +corteTurnoRecaudacionController.Percepcion.label = Percepcion +corteTurnoRecaudacionController.Deduccion.label = Dedccion +corteTurnoRecaudacionController.NetoLiquidar.label = Neto Liquidar +corteTurnoRecaudacionController.AbonoCartera.label = Abono Cartera +corteTurnoRecaudacionController.NetoPagar.label = Neto Pagar +corteTurnoRecaudacionController.TotalPago.label = Total Pago +corteTurnoRecaudacionController.TotalPagadoNormal.label = Total Pago Normal +corteTurnoRecaudacionController.TotalPagadoCapacitacion.label = Total Pago Capacitacion +corteTurnoRecaudacionController.TotalPagadoIncapacidades.label = Total Pago Incapacidades +corteTurnoRecaudacionController.TotalAbonoCartera.label = Total Abono Catera + + +#Generación automatica de tarmos y rutas +editarTramoRutaController.window.title=Generación Automática de Tramos y Ruta +editarTramoRutaController.lblRuta.value=Ruta +editarTramoRutaController.lblClase.value= Tipo de servicio +editarTramoRutaController.lblVtaHandHeld.value= Venta Hand Held +editarTramoRutaController.lblNombrePasajero.value= Solicita Nombre Pasajero +editarTramoRutaController.btnAgregarPaso.label= Agregar Paso +editarTramoRutaController.btnCombinacion.label= Combinación +editarTramoRutaController.tabRuta.value=Secuencia +editarTramoRutaController.tabEmpresa.value=Empresa +editarTramoRutaController.lbEmpresa.value=Empresa +editarTramoRutaController.msg.empresaObligatoria=Informe la empresa +editarTramoRutaController.btnBorrarEmpresa.tooltiptext=Eliminar +editarTramoRutaController.btnAddEmpresa.tooltiptext=Guardar + + +#Agregar tramo +nuevaParadaController.window.title=Nuevo Tramo +nuevaParadaController.lblOrigen.value=Origen +nuevaParadaController.lblDestino.value=Destino +nuevaParadaController.lblVia.value=Vía + +#GridRutaSecuencia +gridRutaSecuencia.btnEliminarPaso.tooltip=Eliminar Paso +gridRutaSecuencia.columnOrigen.label=Origen +gridRutaSecuencia.columnDestino.label=Destino +gridRutaSecuencia.columnVia.label=Vía +gridRutaSecuencia.columnKmsReal.label=Kms Real +gridRutaSecuencia.columnKmsConductor.label=Kms Conductor +gridRutaSecuencia.columnTiempoRecorrido.label=Tiempo Recorrido +gridRutaSecuencia.columnIDTramo.label=ID +gridRutaSecuencia.agregarSecuencia.exception.origenDestinoObligatorio=La origen y destino deben ser informados +gridRutaSecuencia.paradaExisteException.msg=La parada {0} ya existe +gridRutaSecuencia.msg.eliminarPaso=Eliminar Paso +gridRutaSecuencia.msg.agregarDespues=Agregar Después + +#TramoRutaServiceImpl +tramoRutaServiceImpl.msg.combinacionObligatorio=La combinación deve de ser informada +tramoRutaServiceImpl.msg.secuenciaObligatorio=La secuencia deve de ser informada +tramoRutaServiceImpl.msg.cambosObligatoriosSecuencia=Todos los campos de la secuencia deben ser informados en el Tramo {0} - {1} +tramoRutaServiceImpl.msg.cambosObligatoriosCombinacion=Todos los campos de la combinación deben ser informados en el Tramo {0} - {1} +tramoRutaServiceImpl.msg.empresaObligatoria=Informe la Empresa de la Ruta + + +#editarCombinacionTramoRutaController +editarCombinacionTramoRutaController.window.title=Generar Combinación +editarCombinacionTramoRutaController.btnSalvar.tooltiptext=Guardar +editarCombinacionTramoRutaController.btnFechar.tooltiptext= Cerrar +editarCombinacionTramoRutaController.btnRutaRegreso.tooltiptext=Generar Ruta Regreso +editarCombinacionTramoRutaController.MSG.suscribirOK = La ruta y sus tramos se registró exitosamente. +editarCombinacionTramoRutaController.MSG.suscribirOK = La ruta y sus tramos se registró exitosamente. +editarCombinacionTramoRutaController.tabRegreso.label=Regreso +editarCombinacionTramoRutaController.tabIda.label=Ida +editarCombinacionTramoRutaController.MSG.generarRutaRegreso=¿Desea generar la ruta de regreso? +editarCombinacionTramoRutaController.MSG.rutaIdaGenerada=Ruta de Ida generada : {0} +editarCombinacionTramoRutaController.MSG.rutaRegresoGenerada=Ruta de Regreso generada : {0} + +#estacionServiceImpl +estacionServiceImpl.msg.cajaDuplicado=El caja ya existe en el Punto informado + +# Pantalla de la Sociedad de la Búsqueda +busquedaBancoController.window.title = Banco +busquedaBancoController.btnRefresh.tooltiptext = Actualizar +busquedaBancoController.btnNovo.tooltiptext = Agregar +busquedaBancoController.btnCerrar.tooltiptext = Cerrar +busquedaBancoController.btnPesquisa.label = Búsqueda +busquedaBancoController.lhId.label = ID +busquedaBancoController.lhDesc.label = Descripción +busquedaBancoController.banco.label = Nombre Banco +busquedaBancoController.puntoVenta.label = Punto Venta +busquedaBancoController.empresa.label = Empresa +busquedaBancoController.numCuenta.label = Número Cuenta +busquedaBancoController.algoritmo.label = Algoritmo Ref +busquedaBancoController.concepto.label = Concepto +busquedaBancoController.nombre.label = Nombre de Banco +busquedaBancoController.clave.label = Clave de Sucursal +busquedaBancoController.idBanco.label = ID Banco +busquedaBancoController.moneda.label = Moneda + +# Pantalla de Edición de la banco +editarBancoController.window.title = Banco +editarBancoController.btnApagar.tooltiptext = Eliminar +editarBancoController.btnSalvar.tooltiptext = Guardar +editarBancoController.btnFechar.tooltiptext = Cerrar +editarBancoController.lbNome.value = Nombre Banco +editarBancoController.lbActivo.value = Activo +editarBancoController.MSG.suscribirOK = El banco se registró exitosamente. +editarBancoController.MSG.borrarPergunta = ¿Desea eliminar este banco? +editarBancoController.MSG.borrarOK = Banco se eliminó exitosamente. +editarBancoController.nomBanco.label = Nombre do Banco +editarBancoController.dem.label = Referencia +editarBancoController.cuentaDinero.label = Cuenta de dinero (concepto) +editarBancoController.numCuenta.label = Numero de Cuenta +editarBancoController.algRef.label = Algoritmo Referencia +editarBancoController.punto.label = Punto de Venta +editarBancoController.empresa.label = Empresa +editarBancoController.moneda.label = Moneda + +# Pantalla de la Sociedad de la Búsqueda +busquedaTipoEventoExtraController.window.title = Tipo de Eventos +busquedaTipoEventoExtraController.btnRefresh.tooltiptext = Actualizar +busquedaTipoEventoExtraController.btnNovo.tooltiptext = Agregar +busquedaTipoEventoExtraController.btnCerrar.tooltiptext = Cerrar +busquedaTipoEventoExtraController.btnPesquisa.label = Búsqueda +busquedaTipoEventoExtraController.lhId.label = ID +busquedaTipoEventoExtraController.nombre.label = Descripción del Ingreso +busquedaTipoEventoExtraController.tipo.label = Tipo de Ingreso +busquedaTipoEventoExtraController.empresa.label = Empresa + +busquedaTipoEventoExtraController.lhId.label = ID +busquedaTipoEventoExtraController.lhDesc.label = Descripción +busquedaTipoEventoExtraController.lh3.label = Tipo Ing +busquedaTipoEventoExtraController.lh4.label = Cuenta +busquedaTipoEventoExtraController.lh5.label = Imp Max +busquedaTipoEventoExtraController.lh6.label = Valida Corte +busquedaTipoEventoExtraController.lh7.label = Valida Docto +busquedaTipoEventoExtraController.lh8.label = Contrapartida +busquedaTipoEventoExtraController.lh9.label = IVA +busquedaTipoEventoExtraController.lh10.label = Empresa Venta +busquedaTipoEventoExtraController.lh11.label = Empresa Ingreso + + +# Pantalla de Edición de la tipoEventoExtra +editarTipoEventoExtraController.MSG.formaPagoObligatolia = Forma pago contra partida es obligatolia +editarTipoEventoExtraController.MSG.tipoObligatolia = Tipo es obligatorio +editarTipoEventoExtraController.window.title = Tipo de Eventos +editarTipoEventoExtraController.btnApagar.tooltiptext = Eliminar +editarTipoEventoExtraController.btnSalvar.tooltiptext = Guardar +editarTipoEventoExtraController.btnFechar.tooltiptext = Cerrar +editarTipoEventoExtraController.lbNome.value = Descripción del Ingreso +editarTipoEventoExtraController.tipoOperacion.value = Tipo +editarTipoEventoExtraController.lbActivo.value = Activo +editarTipoEventoExtraController.MSG.suscribirOK = El ingreso se registró exitosamente. +editarTipoEventoExtraController.MSG.borrarPergunta = ¿Desea eliminar este ingreso? +editarTipoEventoExtraController.MSG.borrarOK = Ingreso se eliminó exitosamente. +editarTipoEventoExtraController.MSG.evento = No se puede eliminar el registro. Hay datos que dependen de él +editarTipoEventoExtraController.tipoIngreso.label = Tipo de Ingreso +editarTipoEventoExtraController.cuenta.label = Cuenta Contable +editarTipoEventoExtraController.importeMaximo.label = Importe Máximo +editarTipoEventoExtraController.validaCorte.label = Valida Corte +editarTipoEventoExtraController.validaDocumento.label = Valida Documento +editarTipoEventoExtraController.boleto.label = Valida Corrida +editarTipoEventoExtraController.ajuste.label = Ajuste +editarTipoEventoExtraController.contrapartida.label = Contrapartida +editarTipoEventoExtraController.ordem.label = Orden Servicio +editarTipoEventoExtraController.formaPago.label = Forma de Pago +editarTipoEventoExtraController.cuentaContable.label = Cuenta Contable +editarTipoEventoExtraController.iva.label = IVA +editarTipoEventoExtraController.movimiento.label = Movimiento +editarTipoEventoExtraController.proveedor.label = Proveedor +editarTipoEventoExtraController.si.label = Sí +editarTipoEventoExtraController.no.label = No +editarTipoEventoExtraController.contrapartida.label = Contrapartida +editarTipoEventoExtraController.Operacion.label = Operación +editarTipoEventoExtraController.rd1.label = EVENTO EXTRA +editarTipoEventoExtraController.rd2.label = AJUSTE +editarTipoEventoExtraController.rd3.label = CHEQUE + +#Pago Conductor +indexController.mniPagoConductor.label = Pago Conductor +indexController.mniActualizarTablaTarjetas.label = Actualizar Tarjeta Viaje +indexController.mniMantenimientoMovimientos.label = Mantenimiento de Movimientos +indexController.mniEnvioNomina.label = Envio a Nomina +importaTarjetaController.window.title = Actualizacion de tabla de Tarjeta de Viaje +envioNominaController.window.title = Envio Nomina +busquedaTarjetaViajeController.window.title = Mantenimientos de Movimientos +envioTarjetaNominaController.window.title = Envio a Nomina +importaTarjetaController.btnCerrar.tooltiptext = Cerrar +importaTarjetaController.lhGerar.label = Actualizar Tarjetas +envioNominaController.lhEnviar.label = Enviar Nomina +busquedaTarjetaViajeController.lhFechainicial.label = Fecha Corrida +busquedaTarjetaViajeController.lhFechafinal.label = Fecha Final +busquedaTarjetaViajeController.lhAutobusIni.label = Autobús Inicial +busquedaTarjetaViajeController.lhAutobusFin.label = Autobús Final +busquedaTarjetaViajeController.lhFolioRef.label = Folio Ref. +busquedaTarjetaViajeController.lhEmpresa.label = Empresa +busquedaTarjetaViajeController.lhMarca.label = Marca +busquedaTarjetaViajeController.lhSec.label = Secuencia +busquedaTarjetaViajeController.lhId.label = Id +busquedaTarjetaViajeController.lhEmpresa.label = Empresa +busquedaTarjetaViajeController.lhAutobus.label = Autobús +busquedaTarjetaViajeController.lhFecha.label = Fecha +busquedaTarjetaViajeController.lhFolio.label = Folio +busquedaTarjetaViajeController.lhOrigenAut.label = Origen Aut +busquedaTarjetaViajeController.lhDestinoAut.label = Destino Aut +busquedaTarjetaViajeController.lhTipo.label = Tipo +busquedaTarjetaViajeController.lhKmsAutobus.label = Kms Auto +busquedaTarjetaViajeController.lhCorrida.label = Corrida +busquedaTarjetaViajeController.lhServicio.label = Servicio +busquedaTarjetaViajeController.lhOperador1.label = Operador 1 +busquedaTarjetaViajeController.lhOrigenOp1.label = Ori Ope 1 +busquedaTarjetaViajeController.lhDestinoOp1.label = Des Ope 1 +busquedaTarjetaViajeController.lhKmsOp1.label = Kms Ope 1 +busquedaTarjetaViajeController.lhOperador2.label = Operador 2 +busquedaTarjetaViajeController.lhOrigenOp2.label = Ori Ope 2 +busquedaTarjetaViajeController.lhDestinoOp2.label = Des Ope 2 +busquedaTarjetaViajeController.lhKmsOp2.label = Kms Ope 2 +busquedaTarjetaViajeController.status.label = Status +busquedaTarjetaViajeController.lhOrigen.label = Origen +busquedaTarjetaViajeController.lhDestino.label = Destino +busquedaTarjetaViajeController.lhKms.label = Kms +busquedaTarjetaViajeController.lhOperadorOrigen.label = Operador 1 +busquedaTarjetaViajeController.lhOperadorDestino.label = Operador 2 +busquedaTarjetaViajeController.lhOperadorKms.label = Operador Kms +editarTarjetaController.MSG.suscribirOK = Tarjeta Viaje se registró exitosamente. +editarTarjetaViajeController.btnApagar.tooltiptext = Eliminar +editarTarjetaViajeController.MSG.cuentaContableObligatorio = Cuenta contable obligatorio +editarTarjetaViajeController.btnSalvar.tooltiptext = Guardar +editarTarjetaViajeController.btnFechar.tooltiptext = Cerrar +editarTarjetaViajeController.MSG.borrarPergunta = ¿Desea eliminar esta Tarjeta Viaje? +editarTarjetaViajeController.window.title = Tarjeta Viaje +editarTarjetaViajeController.MSG.borrarOK = Tarjeta Viaje se eliminó exitosamente. +envioNominaControllerController.MSG.enviarOK = Envió a Nomina exitosamente. +envioNominaControllerController.MSG.noHayArchivosOK = No hay archivos a enviar +editarTarjetaController.primaria = Primária +editarTarjetaController.secundaria = Secundária + + +# Muestra la Búsqueda Tramo Km Servicio +busquedaTramoKmServicioController.window.title = Tramo Km Servicio +busquedaTramoKmServicioController.btnRefresh.tooltiptext = Actualizar +busquedaTramoKmServicioController.btnNovo.tooltiptext = Agregar +busquedaTramoKmServicioController.btnCerrar.tooltiptext = Cerrar +busquedaTramoKmServicioController.btnPesquisa.label = Búsqueda +busquedaTramoKmServicioController.lhDesc.label = Descripción +busquedaTramoKmServicioController.lhId.label = ID +busquedaTramoKmServicioController.lhEmpresa.label = Empresa +busquedaTramoKmServicioController.lhClaseServicio.label = Clase de Servicio +busquedaTramoKmServicioController.lhTramo.label = Tramo +busquedaTramoKmServicioController.lhKmPago.label = Km pago condutor + +# Pantalla Tramo Km Servicio +editarTramoKmServicioController.window.title = Tramo Km Servicio +editarTramoKmServicioController.btnApagar.tooltiptext = Eliminar +editarTramoKmServicioController.btnSalvar.tooltiptext = Guardar +editarTramoKmServicioController.btnFechar.tooltiptext = Cerrar +editarTramoKmServicioController.lbNome.value = Tramo Km Servicio +editarTramoKmServicioController.MSG.suscribirOK = Tramo Km Servicio se registró exitosamente. +editarTramoKmServicioController.MSG.borrarPergunta = ¿Desea eliminar Tramo Km Servicio? +editarTramoKmServicioController.MSG.borrarOK = Tramo Km Servicio se eliminó exitosamente. +editarTramoKmServicioController.labelOrigem.value = Origen +editarTramoKmServicioController.labelDestino.value = Destino + + +# Muestra la Búsqueda Punto Venta Empresa +busquedaPtovtaEmpresaController.window.title = Punto Venta Empresa +busquedaPtovtaEmpresaController.btnRefresh.tooltiptext = Actualizar +busquedaPtovtaEmpresaController.btnNovo.tooltiptext = Agregar +busquedaPtovtaEmpresaController.btnCerrar.tooltiptext = Cerrar +busquedaPtovtaEmpresaController.btnPesquisa.label = Búsqueda +busquedaPtovtaEmpresaController.lhId.label = ID +busquedaPtovtaEmpresaController.lhDesc.label = Descripción +busquedaPtovtaEmpresaController.lhEmpresa.label = Empresa +busquedaPtovtaEmpresaController.lhPuntoVenta.label = Punto de Venta +busquedaPtovtaEmpresaController.txtNombre.label = Punto Venta Empresa + +# Pantalla Editar Punto Venta Empresa +editarPtovtaEmpresaController.window.title = Punto Venta Empresa +editarPtovtaEmpresaController.btnApagar.tooltiptext = Eliminar +editarPtovtaEmpresaController.btnSalvar.tooltiptext = Guardar +editarPtovtaEmpresaController.btnFechar.tooltiptext = Cerrar +editarPtovtaEmpresaController.lbNome.value = Descripción +editarPtovtaEmpresaController.lhEmpresa.label = Empresa +editarPtovtaEmpresaController.lhPuntoVenta.label = Punto de Venta +editarPtovtaEmpresaController.MSG.suscribirOK = Punto Venta Empresa se registró exitosamente. +editarPtovtaEmpresaController.MSG.borrarPergunta = ¿Desea eliminar este Punto Venta Empresa? +editarPtovtaEmpresaController.MSG.borrarOK = Punto Venta Empresa se eliminó exitosamente. + + +rutaServiceImpl.msg.validacionTRamo=El tramo no existe : {0} - {1} Via {2} Clase {3} +rutaServiceImpl.msg.validacionTRamoCombinacion=El tramo no existe : {0}({1}) - {2}({3}) \ No newline at end of file diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label new file mode 100644 index 000000000..89b3b9940 --- /dev/null +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -0,0 +1,2444 @@ +# V. 1.4 +# To change this template, choose Tools | Templates +# and open the template in the editor. + +# Formato da chave: +# Controler da ZUL . ID do componente . Propiedade = XXX +# .. = XXX + +#Versao do VentaBoleto: +versao = ADM_20120622_1RC37 + +# MSG Defaut: +MSG.CONSTRAINT.PORCENTAGEM = Os valores deven estar entre 0 e 100 +MSG.SI = Sim +MSG.NO = Não +MSG.VALIDA = Valida +MSG.NO.VALIDA = Não Valida +MSG.ningunRegistro = Não encontrou nenhum registro com essa busca. +MSG.Registro.Existe = Já existe um registro com estes dados. +MSG.Equivalencia.Existe = Já existe un registro con essa equivalencia. +MSG.Error = Ocorreu algum erro, contate o administrador. +MSG.Error.combobox = Valor digitado não existe. +MSG.Origem.Igual.Destino = Origem igual a Destino. +MSG.IMPRIME.DESCONTO = Desconto acordado +MSG.IMPRIME.PRECO.MENOS.DESCONTO = Preço menos desconto acordado +MSG.IMPRIME.PRECO.TOTAL = Preço Total +MSG.PRECIO.TOTAL = Preço total +MSG.PRECIO.MENOS.DESCONTO = Preço menos desconto por cobrar +MSG.DESCUENTO.COBRAR = Desconto por cobrar + +# Tela de Login: +winLogin.title = Login +winLogin.lblUsuario = Usúario: +winLogin.lblSenha = Senha: +winLogin.btnAcessar = Acessar +winLogin.lblloginIncorreto = Login incorreto. Tente novamente. + +# Tela Index principal: +indexController.win.title = Venda de Bilhetes +indexController.mnCatalogos.label = Cadastros +indexController.mnConfiguracionesComerciales.label = Configurações Comerciais +indexController.mnEsquemaOperacional.label = Esquema operacional +indexController.mnPricing.label = Pricing +indexController.mnTarifas.label = Tarifas +indexController.mnSendaAmigo.label = Senda Amigo +indexController.mniMarcas.label = Marcas +indexController.mniMoneda.label = Moeda +indexController.mniCorrida.label = Configuración de Corrida +indexController.mniGeracionCorrida.label = Geración de Corrida +indexController.mniClaseServicio.label = Tipo de Serviços +indexController.mniFormaPago.label = Formas de Pagamento +indexController.mniPeriodoVacacional.label = Período de Férias +indexController.mniMotivoCancelacion.label = Motivo de Cancelamento +indexController.mniMotivoReimpresion.label = Motivo de Reimpressão +indexController.mniCategoria.label = Tipo de pasajero +indexController.mniPuntoVenta.label = Ponto de Venda +indexController.mniEmpresa.label = Empresa +indexController.mniTipoServicio.label = Tipo de Serviço +indexController.mniTipoVenta.label = Tipo de Venda +indexController.mniDiagramaAutoBus.label = Diagramas de Onibus +indexController.mniAsociacionClaseServicioMarca.label = Asociação Tipo Serviço Marca +indexController.mniTipoPuntoVenta.label = Tipo Ponto de Venda +indexController.mniRestriccionFormaPago.label = Restrição de Forma de Pagamento +indexController.mniConfiguracionCategorias.label = Configuração de Tipo de pasajero +indexController.mniConfiguracionFormaPago.label = Configuração de Forma de Pagamento +indexController.mniConfiguracionGeneral.label = Configuração Geral +indexController.mniConfiguracionReservacion.label = Configuração de Reserva +indexController.mniConfiguracionCancelacion.label = Configuração de Cancelamento +indexController.mniEsquemaOperacionalParadas.label = Localidades +indexController.mniEsquemaOperacionalRuta.label = Linha +indexController.mniTramo.label = Tramo +indexController.mniTramoKmServicio.label = Tramo Km Servicio +indexController.mniVia.label = Via +indexController.toolBar.tooltiptext = Fechar +indexController.mniTarifasMinimas.label = Tarifas Mínimas +indexController.mniTarifas.label = Tarifas +indexController.mniVigenciaTarifa.label = Vigência de Tarifas +indexController.mniTarifasEscala.label = Tarifa Escala +indexController.mniMercadoCompetido.label = Mercado Competido +indexController.mniAcumulacionPorVenta.label = Configuración para Acumulación por venta +indexController.mniCanjePuntos.label = Configuración para Canje de puntos +indexController.mniModificacionMasiva.label = Modificação Massiva de Tarifas +indexController.mniCambioVigencia.label = Mudança de Vigência +indexController.mnAjuda.label = Ajuda +indexController.mniVersion.label = Sobre +indexController.mniPricing.label = Pricing +indexController.mniPricingEspecifico.label = Pricing Especifico +indexController.mnSeguridad.label = Segurança +indexController.mniPerfil.label = Perfil +indexController.mniPermisos.label = Permissão +indexController.mniMenus.label = Menu +indexController.mniSistema.label = Sitema +indexController.mniUsuario.label = Usuário +indexController.mniUbicacionUsuario.label = Localização do usuário +indexController.mniAutobus.label = Autobus +indexController.mniAutorizacion.label = Autorização +indexController.mniAutorizacionPerfil.label = Autorização Perfil +indexController.mniEstacion.label = Estação +indexController.mniExcepcionRedondo.label = Exceção Arredondamento +indexController.mniRedondeo.label = Arredondamento +indexController.mniRedondeoMarca.label = Arredondamento Marca +indexController.mniComisionistaExterno.label = Comissionista Externo +indexController.mniConvenio.label = Convênio +indexController.mniConfiguracionAlerta.label = Configuração Alertas +indexController.mniSecretaria.label = Secretaria +indexController.mniArticulo.label = Artigo +indexController.mniTipoCorte.label = Tipo Corte de turno +indexController.mniTurno.label = Turno +indexController.mniTipoMovimiento.label = Tipo Movimento +indexController.mniTipoOcupacion.label = Tipo Ocupação +indexController.mniTipoDomicilio.label = Tipo Domicilio +indexController.mniEstado.label = Estado +indexController.mniPais.label = País +indexController.mnInformes.label = Relatórios +indexController.mniPassageirosServico.label = Passageiros por Corrida +indexController.mniServicioDiario.label = Corrida Diária +indexController.mniCategoriaVenta.label = Categoria Venda +indexController.mniVentasPuntoVenta.label = Ventas Punto de Venta +indexController.mnRecaudacion.label = Recaudación +indexController.mniBuscaTarjetas.label = Tarjetas de Viajes +indexController.mniInicioTurnoRecaudacion.label = Inicio Turno Recaudacion +indexController.mniCorteTurnoRecaudacion.label = Corte Turno +indexController.mn.ingresosExtras = Eventos Extras +indexController.mni.catalogoIngreso = Catalogo de Ingresos +indexController.mni.bancos = Bancos +indexController.mniPtovtaEmpresa.label = Punto Venta Empresa + +# Tela de Busqueda Clase Servicio +busquedaClaseServicioController.window.title = Busca de Tipo de Serviços +busquedaClaseServicioController.btnRefresh.tooltiptext = Recarregar +busquedaClaseServicioController.btnNovo.tooltiptext = Novo Tipo de Serviço +busquedaClaseServicioController.btnCerrar.tooltiptext = Fechar +busquedaClaseServicioController.btnPesquisa.label = Buscar +busquedaClaseServicioController.lhDesc.label = Descrição + +# Tela de Editar Clase Servicio +editarClaseServicioController.window.title = Editar Tipo de Serviço +editarClaseServicioController.btnApagar.tooltiptext = Apagar Tipo de Serviço +editarClaseServicioController.btnSalvar.tooltiptext = Salvar Tipo de Serviço +editarClaseServicioController.btnFechar.tooltiptext = Fechar +editarClaseServicioController.lbNome.value = Tipo de Serviço +editarClaseServicioController.MSG.suscribirOK = Tipo de Serviço cadastrada com sucesso. +editarClaseServicioController.MSG.borrarPergunta = Deseja realmete excluir o Tipo de Serviço? +editarClaseServicioController.MSG.borrarOK = Tipo de Serviço excluido com sucesso. + +# Tela de Busqueda Forma Pago +busquedaFormaPagoController.window.title = Busca de Forma de Pagamento +busquedaFormaPagoController.btnRefresh.tooltiptext = Recarregar +busquedaFormaPagoController.btnNovo.tooltiptext = Nova Forma de Pagamento +busquedaFormaPagoController.btnCerrar.tooltiptext = Fechar +busquedaFormaPagoController.btnPesquisa.label = Buscar +busquedaFormaPagoController.lhDesc.label = Forma Pagamento + +# Tela de Editar Forma Pago +editarFormaPagoController.window.title = Editar Forma de Pagamento +editarFormaPagoController.btnApagar.tooltiptext = Apagar Forma de Pagamento +editarFormaPagoController.btnSalvar.tooltiptext = Salvar Forma de Pagamento +editarFormaPagoController.btnFechar.tooltiptext = Fechar +editarFormaPagoController.lbNome.value = Forma de Pagamento +editarFormaPagoController.lbOperacion.value = Operação +editarFormaPagoController.lbOperacion1.value = Vendido / Impresso +editarFormaPagoController.lbOperacion2.value = Reexpedido +editarFormaPagoController.lbOperacion3.value = Reimpresso +editarFormaPagoController.lbOperacion4.value = N/A +editarFormaPagoController.MSG.suscribirOK = Forma de Pagamento cadastrada com sucesso. +editarFormaPagoController.MSG.borrarPergunta = Deseja realmete excluir a Forma de Pagamento? +editarFormaPagoController.MSG.borrarOK = Forma de Pagamento excluida com sucesso. +editarFormaPagoController.MSG.existe.registro = Forma de pago, já existe esta informação. + +# Tela de Busqueda Tipo Punto Venta +busquedaTipoPuntoVentaController.window.title = Busca de Tipo Ponto de Venda +busquedaTipoPuntoVentaController.btnRefresh.tooltiptext = Recarregar +busquedaTipoPuntoVentaController.btnNovo.tooltiptext = Novo Tipo de Ponto de Venda +busquedaTipoPuntoVentaController.btnCerrar.tooltiptext = Fechar +busquedaTipoPuntoVentaController.btnPesquisa.label = Buscar +busquedaTipoPuntoVentaController.lhDesc.label = Tipo de Ponto de Venda +busquedaTipoPuntoVentaController.lhID.label = ID + +# Tela de Editar Tipo Punto Venta +editarTipoPuntoVentaController.window.title = Editar Tipo de Ponto de Venda +editarTipoPuntoVentaController.btnApagar.tooltiptext = Apagar Tipo de Ponto de Venda +editarTipoPuntoVentaController.btnSalvar.tooltiptext = Salvar Tipo de Ponto de Venda +editarTipoPuntoVentaController.btnFechar.tooltiptext = Fechar +editarTipoPuntoVentaController.lbNome.value = Tipo de Ponto de Venda +editarTipoPuntoVentaController.MSG.suscribirOK = Tipo de Ponto de Venda cadastrado com sucesso. +editarTipoPuntoVentaController.MSG.borrarPergunta = Deseja realmete excluir o Tipo de Ponto de Venda? +editarTipoPuntoVentaController.MSG.borrarOK = Tipo de Ponto de Venda excluido com sucesso. + +# Muestra el TipoServicio Búsqueda +busquedaTipoServicioController.window.title = Tipo de Servicio +busquedaTipoServicioController.btnRefresh.tooltiptext = Actualizar +busquedaTipoServicioController.btnNovo.tooltiptext = Nuevo Tipo de Servicio +busquedaTipoServicioController.btnCerrar.tooltiptext = Cierre +busquedaTipoServicioController.btnPesquisa.label = Búsqueda +busquedaTipoServicioController.lhId.label = ID +busquedaTipoServicioController.lhDesc.label = Descrição + +# Pantalla Editar TipoServicio +editarTipoServicioController.window.title = Tipo de Servicio +editarTipoServicioController.btnApagar.tooltiptext = Eliminar Tipo de Servicio +editarTipoServicioController.btnSalvar.tooltiptext = Guarda Tipo de Servicio +editarTipoServicioController.btnFechar.tooltiptext = Cierre +editarTipoServicioController.lbNome.value = Descrição +editarTipoServicioController.MSG.suscribirOK = Tipo de Servicio Registrado con Éxito. +editarTipoServicioController.MSG.BorrarPergunta = ¿Desea Eliminar este Tipo de Servicio? +editarTipoServicioController.MSG.BorrarOK = Tipo de Servicio Eliminado con Éxito. + +# Tela de Busqueda de Restrição de Forma Pago +busquedaRestriccionFormaPagoController.window.title = Busca de Restrição de Forma de Pagamento +busquedaRestriccionFormaPagoController.FormaPago = Forma de Pago +busquedaRestriccionFormaPagoController.btnRefresh.tooltiptext = Recarregar +busquedaRestriccionFormaPagoController.btnNovo.tooltiptext = Nova Restrição de Forma de Pagamento +busquedaRestriccionFormaPagoController.btnCerrar.tooltiptext = Fechar +busquedaRestriccionFormaPagoController.btnPesquisa.label = Buscar +busquedaRestriccionFormaPagoController.lhId.label = Forma Pagamento +busquedaRestriccionFormaPagoController.lhDesc.label = Restrição + +# Tela de Editar Restrição de Forma Pago +editarRestriccionFormaPagoController.window.title = Editar Restrição Forma de Pagamento +editarRestriccionFormaPagoController.btnApagar.tooltiptext = Apagar Restrição Forma de Pagamento +editarRestriccionFormaPagoController.btnSalvar.tooltiptext = Salvar Restrição Forma de Pagamento +editarRestriccionFormaPagoController.btnFechar.tooltiptext = Fechar +editarRestriccionFormaPagoController.lblFormaPago.value = Forma de Pagamento +editarRestriccionFormaPagoController.lblRestricionFormaPago.value = Restrição +editarRestriccionFormaPagoController.MSG.suscribirOK = Restrição de Forma de Pagamento cadastrado com sucesso. +editarRestriccionFormaPagoController.MSG.borrarPergunta = Deseja realmete excluir a Restrição da Forma de Pagamento? +editarRestriccionFormaPagoController.MSG.borrarOK = Restrição de Forma de Pagamento excluido com sucesso. + +# Tela de Busqueda Periodo Vacacional +busquedaPeriodoVacacionalController.window.title = Busca de Período de Férias +busquedaPeriodoVacacionalController.btnRefresh.tooltiptext = Recarregar +busquedaPeriodoVacacionalController.btnNovo.tooltiptext = Novo Período de Férias +busquedaPeriodoVacacionalController.btnCerrar.tooltiptext = Fechar +busquedaPeriodoVacacionalController.btnPesquisa.label = Buscar +busquedaPeriodoVacacionalController.lhId.label = ID +busquedaPeriodoVacacionalController.lhFecinicio.label = Período Inicial +busquedaPeriodoVacacionalController.lhFecfinal.label = Período Final + +# Tela de Editar Periodo Vacacional +editarPeriodoVacacionalController.window.title = Editar Período de Férias +editarPeriodoVacacionalController.btnApagar.tooltiptext = Apagar Período de Férias +editarPeriodoVacacionalController.btnSalvar.tooltiptext = Salvar Período de Férias +editarPeriodoVacacionalController.btnFechar.tooltiptext = Fechar +editarPeriodoVacacionalController.lbNome.value = Período de Férias +editarPeriodoVacacionalController.lbFecInicio.value = Período Inicial +editarPeriodoVacacionalController.lbFecFinal.value = Período Final +editarPeriodoVacacionalController.MSG.suscribirOK = Período de Férias cadastrado com sucesso. +editarPeriodoVacacionalController.MSG.borrarPergunta = Deseja realmete excluir o Período de Férias? +editarPeriodoVacacionalController.MSG.borrarOK = Período de Férias excluido com sucesso. +editarPeriodoVacacionalController.MSG.busquedaPeriodo = Data Inicial maior que a data Final. +editarPeriodoVacacionalController.MSG.busquedaNull = Data inicial ou final em branco. + +# Tela de Busqueda Motivo Cancelacion +busquedaMotivoCancelacionController.window.title = Busca de Motivo Cancelamento +busquedaMotivoCancelacionController.btnRefresh.tooltiptext = Recarregar +busquedaMotivoCancelacionController.btnNovo.tooltiptext = Novo Motivo Cancelamento +busquedaMotivoCancelacionController.btnCerrar.tooltiptext = Fechar +busquedaMotivoCancelacionController.btnPesquisa.label = Buscar +busquedaMotivoCancelacionController.lhId.label = ID +busquedaMotivoCancelacionController.lhDesc.label = Descrição + +# Tela de Editar Motivo Cancelacion +editarMotivoCancelacionController.window.title = Editar Motivo Cancelamento +editarMotivoCancelacionController.btnApagar.tooltiptext = Apagar Motivo Cancelamento +editarMotivoCancelacionController.btnSalvar.tooltiptext = Salvar Motivo Cancelamento +editarMotivoCancelacionController.btnFechar.tooltiptext = Fechar +editarMotivoCancelacionController.lbNome.value = Descrição +editarMotivoCancelacionController.MSG.suscribirOK = Motivo Cancelamento cadastrado com sucesso. +editarMotivoCancelacionController.MSG.borrarPergunta = Deseja realmete excluir esse Motivo de Cancelamento? +editarMotivoCancelacionController.MSG.borrarOK = Motivo Cancelamento excluído com sucesso. +editarMotivoCancelacionController.lbtipomotivo.value = Tipo Motivo +editarMotivoCancelacionController.MSG.tipo = Necesita informar un tipo motivo. + +# Tela de Busqueda Motivo Reimpresion +busquedaMotivoReimpresionController.window.title = Busca de Motivo de Reimpressão +busquedaMotivoReimpresionController.btnRefresh.tooltiptext = Recarregar +busquedaMotivoReimpresionController.btnNovo.tooltiptext = Novo Motivo de Reimpressão +busquedaMotivoReimpresionController.btnCerrar.tooltiptext = Fechar +busquedaMotivoReimpresionController.btnPesquisa.label = Buscar +busquedaMotivoReimpresionController.lhId.label = ID +busquedaMotivoReimpresionController.lhDesc.label = Descrição + +# Tela de Editar Motivo Reimpresion +editarMotivoReimpresionController.window.title = Editar Motivo de Reimpresso +editarMotivoReimpresionController.btnApagar.tooltiptext = Apagar Motivo de Reimpressão +editarMotivoReimpresionController.btnSalvar.tooltiptext = Salvar Motivo de Reimpressão +editarMotivoReimpresionController.btnFechar.tooltiptext = Fechar +editarMotivoReimpresionController.lbNome.value = Motivo de Reimpressão +editarMotivoReimpresionController.MSG.suscribirOK = Motivo de Reimpressão cadastrado com sucesso. +editarMotivoReimpresionController.MSG.borrarPergunta = Deseja realmete excluir esse Motivo de Cancelamento? +editarMotivoReimpresionController.MSG.borrarOK = Motivo de Reimpressão excluido com sucesso. + +# Tela de Busqueda Categoria +busquedaCategoriaController.window.title = Busca de Tipo de pasajero +busquedaCategoriaController.btnRefresh.tooltiptext = Recarregar +busquedaCategoriaController.btnNovo.tooltiptext = Novo Tipo de pasajero +busquedaCategoriaController.btnCerrar.tooltiptext = Fechar +busquedaCategoriaController.btnPesquisa.label = Buscar +busquedaCategoriaController.lhId.label = ID +busquedaCategoriaController.lhDesc.label = Descrição + +# Tela de Editar Categoria +editarCategoriaController.window.title = Editar Tipo de pasajero +editarCategoriaController.btnApagar.tooltiptext = Apagar Tipo de pasajero +editarCategoriaController.btnSalvar.tooltiptext = Salvar Tipo de pasajero +editarCategoriaController.btnFechar.tooltiptext = Fechar +editarCategoriaController.lbNome.value = Descrição +editarCategoriaController.MSG.suscribirOK = Tipo de pasajero cadastrada com sucesso. +editarCategoriaController.MSG.borrarPergunta = Deseja realmete excluir esse Tipo de pasajero? +editarCategoriaController.MSG.borrarOK = Tipo de pasajero excluido com sucesso. + +# Tela de Busqueda Moneda +busquedaMonedaController.window.title = Busca de Moneda +busquedaMonedaController.btnRefresh.tooltiptext = Recarregar +busquedaMonedaController.btnNovo.tooltiptext = Nova Moneda +busquedaMonedaController.btnCerrar.tooltiptext = Fechar +busquedaMonedaController.btnPesquisa.label = Buscar +busquedaMonedaController.lhId.label = ID +busquedaMonedaController.lhDesc.label = Moneda + +# Tela de Editar Moneda +editarMonedaController.window.title = Editar Moneda +editarMonedaController.btnApagar.tooltiptext = Apagar Moneda +editarMonedaController.btnSalvar.tooltiptext = Salvar Moneda +editarMonedaController.btnFechar.tooltiptext = Fechar +editarMonedaController.lbNome.value = Moneda +editarMonedaController.MSG.suscribirOK = Moneda cadastrada com sucesso. +editarMonedaController.MSG.borrarPergunta = Deseja realmete excluir essa Moneda? +editarMonedaController.MSG.borrarOK = Moneda excluida com sucesso. + +# Tela de Busqueda Pais +busquedaPaisController.window.title = Busca de Pais +busquedaPaisController.btnRefresh.tooltiptext = Recarregar +busquedaPaisController.btnNovo.tooltiptext = Nova Pais +busquedaPaisController.btnCerrar.tooltiptext = Fechar +busquedaPaisController.btnPesquisa.label = Buscar +busquedaPaisController.lhId.label = ID +busquedaPaisController.lhDesc.label = Pais + +# Tela de Editar Pais +editarPaisController.window.title = Editar Pais +editarPaisController.btnApagar.tooltiptext = Apagar Pais +editarPaisController.btnSalvar.tooltiptext = Salvar Pais +editarPaisController.btnFechar.tooltiptext = Fechar +editarPaisController.lbNome.value = Pais +editarPaisController.MSG.suscribirOK = Pais cadastrada com sucesso. +editarPaisController.MSG.borrarPergunta = Deseja realmete excluir essa Pais? +editarPaisController.MSG.borrarOK = Pais excluida com sucesso. + +# Tela de Busqueda Empresa +busquedaEmpresaController.window.title = Buscar Empresa +busquedaEmpresaController.btnRefresh.tooltiptext = Recarregar +busquedaEmpresaController.btnNovo.tooltiptext = Nova Empresa +busquedaEmpresaController.btnCerrar.tooltiptext = Fechar +busquedaEmpresaController.btnPesquisa.label = Buscar +busquedaEmpresaController.lhId.label = ID +busquedaEmpresaController.lhDesc.label = Empresa + +# Tela de Editar Empresa +editarEmpresaController.window.title = Editar Empresa +editarEmpresaController.btnApagar.tooltiptext = Apagar Empresa +editarEmpresaController.btnSalvar.tooltiptext = Salvar Empresa +editarEmpresaController.btnFechar.tooltiptext = Fechar +editarEmpresaController.lbNome.value = Empresa +editarEmpresaController.lbActivo.value = Ativo +editarEmpresaController.MSG.suscribirOK = Empresa cadastrada com sucesso. +editarEmpresaController.MSG.borrarPergunta = Deseja realmete excluir essa Empresa? +editarEmpresaController.MSG.borrarOK = Empresa excluida com sucesso. +editarEmpresaController.externa.label = Externa +editarEmpresaController.IndTipo.1 = Autotransportes +editarEmpresaController.IndTipo.2 = Productos y Servicios +editarEmpresaController.IndTipo.3 = Telefonica +editarEmpresaController.IndTipo.label = Tipo + +# Tela de Busqueda Ponto de Venda +busquedaPuntoVentaController.window.title = Busca de Ponto de Venda +busquedaPuntoVentaController.btnRefresh.tooltiptext = Recarregar +busquedaPuntoVentaController.btnNovo.tooltiptext = Novo Ponto de Venda +busquedaPuntoVentaController.btnCerrar.tooltiptext = Fechar +busquedaPuntoVentaController.btnPesquisa.label = Buscar +busquedaPuntoVentaController.lhId.label = ID +busquedaPuntoVentaController.lhDesc.label = Ponto de Venda + +# Tela de Editar Ponto de Venda +editarPuntoVentaController.window.title = Editar Ponto de Venda +editarPuntoVentaController.btnApagar.tooltiptext = Apagar Ponto de Venda +editarPuntoVentaController.btnSalvar.tooltiptext = Salvar Ponto de Venda +editarPuntoVentaController.btnFechar.tooltiptext = Fechar +editarPuntoVentaController.lbNome.value = Ponto de Venda +editarPuntoVentaController.lbCalle.value = Rua +editarPuntoVentaController.lbNumero.value = Numero +editarPuntoVentaController.lbDescCorreo.value = Descrição Correio +editarPuntoVentaController.lbColonia.value = Colonia +editarPuntoVentaController.lbCodPostal.value = CEP +editarPuntoVentaController.lbStaAprobacion.value = Status Aprobacion +editarPuntoVentaController.lbComentarios.value = Comentários +editarPuntoVentaController.lbPoblacion.value = Poblacion +editarPuntoVentaController.lbMunicipio.value = Municipio +editarPuntoVentaController.lbEstado.value = Estado +editarPuntoVentaController.lbTelefonoUno.value = Telefone Um +editarPuntoVentaController.lbTelefonoDos.value = Telefone Dois +editarPuntoVentaController.lbNumEdirecion.value = Edirecion +editarPuntoVentaController.lbIndDatosTarjeta.value = Dados Tarjeta +editarPuntoVentaController.lbNodo.value = Nodo +editarPuntoVentaController.lbEmpresa.value = Empresa +editarPuntoVentaController.lbparada.value = Localidade +editarPuntoVentaController.lbTpoPtoVta.value = Tipo Ponto de Venda +editarPuntoVentaController.lbActivo.value = Ativo +editarPuntoVentaController.lbMoneda.value = Moeda +editarPuntoVentaController.lbCiudad.value = Cidade +editarPuntoVentaController.RadSi.value.value = Sim +editarPuntoVentaController.RadNo.value = Não +editarPuntoVentaController.MSG.suscribirOK = Ponto de Venda cadastrado com sucesso. +editarPuntoVentaController.MSG.borrarPergunta = Deseja realmete excluir esse Ponto de Venda? +editarPuntoVentaController.MSG.borrarOK = Ponto de Venda excluido com sucesso. +editarPuntoVentaController.MSG.Achou.FormaPago = Forma pago já está registrado. +editarPuntoVentaController.tab.label.endereco = Endereço +editarPuntoVentaController.tab.label.recoleccion = Recoleccion +editarPuntoVentaController.tab.label.empVenta = Empresas para venta + + +# Tela de Busqueda TipoVenta +busquedaTipoVentaController.window.title = Busca de Tipo de Venda +busquedaTipoVentaController.btnRefresh.tooltiptext = Recarregar +busquedaTipoVentaController.btnNovo.tooltiptext = Novo Tipo de Venda +busquedaTipoVentaController.btnCerrar.tooltiptext = Fechar +busquedaTipoVentaController.btnPesquisa.label = Buscar +busquedaTipoVentaController.lhId.label = ID +busquedaTipoVentaController.lhDesc.label = Tipo de Venda + +# Tela de Editar TipoVenta +editarTipoVentaController.window.title = Editar Tipo de Venda +editarTipoVentaController.btnApagar.tooltiptext = Apagar Tipo de Venda +editarTipoVentaController.btnSalvar.tooltiptext = Salvar Tipo de Venda +editarTipoVentaController.btnFechar.tooltiptext = Fechar +editarTipoVentaController.lbNome.value = Tipo de Venda +editarTipoVentaController.MSG.suscribirOK = Tipo de Venda cadastrado com sucesso. +editarTipoVentaController.MSG.borrarPergunta = Deseja realmete excluir esse Tipo de Venda? +editarTipoVentaController.MSG.borrarOK = Tipo de Venda excluido com sucesso. + +# Tela de Busqueda Configuracion Geral +busquedaConfiguracionGeneralController.window.title = Busca de Configuração Geral +busquedaConfiguracionGeneralController.btnRefresh.tooltiptext = Recarregar +busquedaConfiguracionGeneralController.btnNovo.tooltiptext = Nova Configuração Geral +busquedaConfiguracionGeneralController.btnCerrar.tooltiptext = Fechar +busquedaConfiguracionGeneralController.btnPesquisa.label = Buscar +busquedaConfiguracionGeneralController.lhId.label = ID +busquedaConfiguracionGeneralController.lhDesc.label = Nome Constante +busquedaConfiguracionGeneralController.lhValor.label = Valor + +# Tela de Editar Configuracion Geral +editarConfiguracionGeneralController.window.title = Editar Configuração Geral +editarConfiguracionGeneralController.btnApagar.tooltiptext = Apagar Configuração Geral +editarConfiguracionGeneralController.btnSalvar.tooltiptext = Salvar Configuração Geral +editarConfiguracionGeneralController.btnFechar.tooltiptext = Fechar +editarConfiguracionGeneralController.lbNome.value = Nome Constante +editarConfiguracionGeneralController.lbDesc.value = Descrição +editarConfiguracionGeneralController.lbValor.value = Valor +editarConfiguracionGeneralController.lbIndTipo.value = Tipo +editarConfiguracionGeneralController.lbMantenimiento.value = Mantenimiento +editarConfiguracionGeneralController.RadSi.value = Sim +editarConfiguracionGeneralController.RadNo.value = Não +editarConfiguracionGeneralController.MSG.suscribirOK = Configuração Geral cadastrada com sucesso. +editarConfiguracionGeneralController.MSG.borrarPergunta = Deseja realmete excluir a Configuração Geral? +editarConfiguracionGeneralController.MSG.borrarOK = Configuração Geral excluida com sucesso. + +# Tela de Busqueda Configuracion Reservacion +busquedaConfiguracionReservacionController.window.title = Busca de Configuração de Reserva +busquedaConfiguracionReservacionController.btnRefresh.tooltiptext = Recarregar +busquedaConfiguracionReservacionController.btnNovo.tooltiptext = Novo Configuração de Reserva +busquedaConfiguracionReservacionController.btnCerrar.tooltiptext = Fechar +busquedaConfiguracionReservacionController.btnPesquisa.label = Buscar +busquedaConfiguracionReservacionController.lhId.label = ID +busquedaConfiguracionReservacionController.lhFecinicio.label = Período Inicial +busquedaConfiguracionReservacionController.lhFecfinal.label = Período Final + +# Tela de Editar Configuracion Reservacion +editarConfiguracionReservacionController.window.title = Editar Configuração de Reserva +editarConfiguracionReservacionController.btnApagar.tooltiptext = Apagar Configuração de Reserva +editarConfiguracionReservacionController.btnSalvar.tooltiptext = Salvar Configuração de Reserva +editarConfiguracionReservacionController.btnFechar.tooltiptext = Fechar +editarConfiguracionReservacionController.lbNome.value = Configuração de Reserva +editarConfiguracionReservacionController.lbFecInicio.value = Período Inicial +editarConfiguracionReservacionController.lbFecFinal.value = Período Final +editarConfiguracionReservacionController.lbTiempoLiberacion.value = Tempo Liberação +editarConfiguracionReservacionController.lbTiempoLiberacionInternet.value = Tempo Liberação Internet +editarConfiguracionReservacionController.lbTiempoPrevio.value = Tempo Prévio +editarConfiguracionReservacionController.lbTiempoPrevioInternet.value = Tempo Prévio Internet +editarConfiguracionReservacionController.lbTiempoLiberacion = Reservación +editarConfiguracionReservacionController.lbTiempoLiberacionInternet = Reservación internet +editarConfiguracionReservacionController.lbTiempoPrevio = Previo reservar +editarConfiguracionReservacionController.lbTiempoPrevioInternet = Previo reservar en internet +editarConfiguracionReservacionController.lbNumAsientosCorrida.value = Número de Assentos +editarConfiguracionReservacionController.lbDias.value = Dias da Semana +editarConfiguracionReservacionController.lbLun.value = Segunda-Feira +editarConfiguracionReservacionController.lbMar.value = Terça-Feira +editarConfiguracionReservacionController.lbMie.value = Quarta-Feira +editarConfiguracionReservacionController.lbJue.value = Quinta-Feira +editarConfiguracionReservacionController.lbVie.value = Sexta-Feira +editarConfiguracionReservacionController.lbSab.value = Sabado +editarConfiguracionReservacionController.lbDom.value = Domingo +editarConfiguracionReservacionController.lbLunM.value = Lun +editarConfiguracionReservacionController.lbMarM.value = Mar +editarConfiguracionReservacionController.lbMieM.value = Mié +editarConfiguracionReservacionController.lbJueM.value = Jue +editarConfiguracionReservacionController.lbVieM.value = Vie +editarConfiguracionReservacionController.lbSabM.value = Sáb +editarConfiguracionReservacionController.lbDomM.value = Dom +editarConfiguracionReservacionController.tabCtrl.value = Configuração +editarConfiguracionReservacionController.tabCategoria.value = Tipo de pasajero +editarConfiguracionReservacionController.btnAddCategoria.tooltiptext = Adicionar Tipo de pasajero +editarConfiguracionReservacionController.btnBorrarCategoria.tooltiptext = Remover Tipo de pasajero +editarConfiguracionReservacionController.tabPuntoVenta.value = Ponto de Venda +editarConfiguracionReservacionController.btnAddPuntoVenta.tooltiptext = Adicionar Ponto de Venda +editarConfiguracionReservacionController.btnBorrarPuntoVenta.tooltiptext = Remover Ponto de Venda +editarConfiguracionReservacionController.tabClase.value = Classe +editarConfiguracionReservacionController.btnAddClase.tooltiptext = Adicionar Classe +editarConfiguracionReservacionController.btnBorrarClase.tooltiptext = Remover Classe +editarConfiguracionReservacionController.tabMercado.value = Mercado +editarConfiguracionReservacionController.tabOrigem.value = Origem +editarConfiguracionReservacionController.tabDestino.value = Destino +editarConfiguracionReservacionController.btnAddMercado.tooltiptext = Adicionar Mercado +editarConfiguracionReservacionController.btnBorrarMercado.tooltiptext = Remover Mercado +editarConfiguracionReservacionController.tabMarca.value = Marca +editarConfiguracionReservacionController.btnAddMarca.tooltiptext = Adicionar Marca +editarConfiguracionReservacionController.btnBorrarMarca.tooltiptext = Remover Marca +editarConfiguracionReservacionController.MSG.suscribirOK = Configuração de Reserva cadastrado com sucesso. +editarConfiguracionReservacionController.MSG.borrarPergunta = Deseja realmete excluir o Configuração de Reserva? +editarConfiguracionReservacionController.MSG.borrarOK = Configuração de Reserva excluido com sucesso. +editarConfiguracionReservacionController.MSG.selectItem = Selecione um item abaixo. +editarConfiguracionReservacionController.MSG.selectItemDiferente = Origem e Destino Iguais. +editarConfiguracionReservacionController.MSG.busquedaPeriodo = Data Inicial maior que a data Final. +editarConfiguracionReservacionController.MSG.busquedaNull = Data inicial ou final em branco. + + +# Tela de Busqueda Configuracion Cancelacion +busquedaConfiguracionCancelacionController.window.title = Busca de Configuração de Cancelamento +busquedaConfiguracionCancelacionController.btnRefresh.tooltiptext = Recarregar +busquedaConfiguracionCancelacionController.btnNovo.tooltiptext = Novo Configuração de Cancelamento +busquedaConfiguracionCancelacionController.btnCerrar.tooltiptext = Fechar +busquedaConfiguracionCancelacionController.btnPesquisa.label = Buscar +busquedaConfiguracionCancelacionController.lhTiempo.label = Tempo +busquedaConfiguracionCancelacionController.lhTiempo.Inicio = Inicio +busquedaConfiguracionCancelacionController.lhTiempo.Fim = Final +busquedaConfiguracionCancelacionController.lhPunto.label = Ponto de Venda +busquedaConfiguracionCancelacionController.lhOrigem.label = Origem +busquedaConfiguracionCancelacionController.lhDestino.label = Destino +busquedaConfiguracionCancelacionController.lhMarca.label = Marca + +# Tela de Editar Configuracion Cancelacion +editarConfiguracionCancelacionController.window.title = Editar Configuração de Cancelamento +editarConfiguracionCancelacionController.btnApagar.tooltiptext = Eliminar +editarConfiguracionCancelacionController.btnSalvar.tooltiptext = Guardar +editarConfiguracionCancelacionController.btnFechar.tooltiptext = Cerrar +editarConfiguracionCancelacionController.lbNome.value = Configuración de Cancelación +editarConfiguracionCancelacionController.lbTiempo.label = Tiempo +editarConfiguracionCancelacionController.lbPunto.label = Punto de venta +editarConfiguracionCancelacionController.lbOrigen.label = Origen +editarConfiguracionCancelacionController.lbDestino.label = Destino +editarConfiguracionCancelacionController.lbMarca.label = Marca +editarConfiguracionCancelacionController.lbMotivo.label = Motivo Cancelación +editarConfiguracionCancelacionController.MSG.suscribirOK = Configuración de cancelación se registró exitosamente. +editarConfiguracionCancelacionController.MSG.borrarPergunta = ¿Desea eliminar la configuración de cancelación? +editarConfiguracionCancelacionController.MSG.borrarOK = Cancelación de configuración se eliminó exitosamente +editarConfiguracionCancelacionController.tabCtrl.label = Cancelación +editarConfiguracionCancelacionController.tabCargo.label = Penalización +editarConfiguracionCancelacionController.maximo.label = Tiempo Máximo (horas) +editarConfiguracionCancelacionController.minimo.label = Tiempo Mínimo (horas) +editarConfiguracionCancelacionController.porc.label = Porcentaje +editarConfiguracionCancelacionController.importe.label = Importe +editarConfiguracionCancelacionController.btnAddCorrida.tooltiptext = Agregar +editarConfiguracionCancelacionController.btnBorrarCorrida.tooltiptext = Eliminar +editarConfiguracionCancelacionController.MSG.obsAntes = Antes salida corrida +editarConfiguracionCancelacionController.MSG.obsDespues = Después salida corrida +editarConfiguracionCancelacionController.MSG.selectItemDiferente = Igualdade de origem e destino. +editarConfiguracionCancelacionController.MSG.selectItemTodas = SO aceita TODAS se origem ou destino igual a todas. + +# Tela de Busqueda Configuracion de Forma Pago +busquedaConfiguracionFormaPagoController.window.title = Busca de Configuração de Forma de Pagamento +busquedaConfiguracionFormaPagoController.btnRefresh.tooltiptext = Recarregar +busquedaConfiguracionFormaPagoController.btnNovo.tooltiptext = Nova Configuração de Forma de Pagamento +busquedaConfiguracionFormaPagoController.btnCerrar.tooltiptext = Fechar +busquedaConfiguracionFormaPagoController.btnPesquisa.label = Buscar +busquedaConfiguracionFormaPagoController.lhId.label = Forma Pagamento +busquedaConfiguracionFormaPagoController.lhDesc.label = Empresa + +# Tela de Editar Configuracion de Forma Pago +editarConfiguracionFormaPagoController.window.title = Editar Configuração de Forma de Pagamento +editarConfiguracionFormaPagoController.btnApagar.tooltiptext = Apagar Configuração de Forma de Pagamento +editarConfiguracionFormaPagoController.btnSalvar.tooltiptext = Salvar Configuração de Forma de Pagamento +editarConfiguracionFormaPagoController.btnFechar.tooltiptext = Fechar +editarConfiguracionFormaPagoController.lblFormaPago.value = Forma de Pagamento +editarConfiguracionFormaPagoController.lblPuntoVenta.value = Ponto de Venda +editarConfiguracionFormaPagoController.lblEmpresa.value = Empresa +editarConfiguracionFormaPagoController.lblInicial.value = Inicial +editarConfiguracionFormaPagoController.lblAdicional.value = Adicional +editarConfiguracionFormaPagoController.lblCargosExtras.value = Cargos Extras +editarConfiguracionFormaPagoController.MSG.suscribirOK = Configuração de Forma de Pagamento cadastrada com sucesso. +editarConfiguracionFormaPagoController.MSG.borrarPergunta = Deseja realmete excluir a Configuração de Forma de Pagamento? +editarConfiguracionFormaPagoController.MSG.borrarOK = Configuração de Forma de Pagamento excluida com sucesso. + +# Tela de Busqueda Diagrama de Autobus +busquedaDiagramaAutobusController.window.title = Busca de Diagrama de Autobus +busquedaDiagramaAutobusController.btnRefresh.tooltiptext = Recarregar +busquedaDiagramaAutobusController.btnNovo.tooltiptext = Novo Diagrama de Autobus +busquedaDiagramaAutobusController.btnCerrar.tooltiptext = Fechar +busquedaDiagramaAutobusController.btnPesquisa.label = Buscar +busquedaDiagramaAutobusController.lhDesc.label = Marca Autobus + +# Tela de Editar Diagrama de Autobus +editarDiagramaAutobusController.window.title = Editar Diagrama de Autobus +editarDiagramaAutobusController.btnApagar.tooltiptext = Apagar Diagrama de Autobus +editarDiagramaAutobusController.btnSalvar.tooltiptext = Salvar Diagrama de Autobus +editarDiagramaAutobusController.btnFechar.tooltiptext = Fechar +editarDiagramaAutobusController.lblMarcaautobus.value = Marca Autobus +editarDiagramaAutobusController.lblCantasientos.value = Quantidade de Acentos +editarDiagramaAutobusController.lblMaxparados.value = Máximo em Pé +editarDiagramaAutobusController.lhlateralDireitaList.label = LD +editarDiagramaAutobusController.lhacentoLateralDireitaJanelaList.label = ADJ +editarDiagramaAutobusController.lhentreAcentosLateralDireitaList.label = EAD +editarDiagramaAutobusController.lhacentoLateralDireitaCorredorList.label =ADC +editarDiagramaAutobusController.lhcorredorList.label = C +editarDiagramaAutobusController.lhacentoLateralEsquerdaCorredorList.label = AEC +editarDiagramaAutobusController.lhentreAcentosLateralEsquerdaList.label = EAE +editarDiagramaAutobusController.lhacentoLateralEsquerdaJanelaList.label = AEJ +editarDiagramaAutobusController.lhlateralEsquerdaList.label = LE +editarDiagramaAutobusController.lblLegenda.value = Legenda +editarDiagramaAutobusController.lblLD.value = LD: Lateral Esquerda +editarDiagramaAutobusController.lblADJ.value = ADJ: Assentos Lateral Direita Janela +editarDiagramaAutobusController.lblEAD.value = EAD: Entre Assentos Lateral Direita +editarDiagramaAutobusController.lblADC.value = ADC: Assentos Lateral Direita Corredor +editarDiagramaAutobusController.lblC.value = C: Corredor +editarDiagramaAutobusController.lblAEC.value = AEC: Assentos Lateral Esquerda Corredor +editarDiagramaAutobusController.lblEAE.value = EAE: Entre Assentos Lateral Esquerda +editarDiagramaAutobusController.lblAEJ.value = AEJ: Assentos Lateral Esquerda Janela +editarDiagramaAutobusController.lblLE.value = LE: Lateral Esquerda +editarDiagramaAutobusController.MSG.suscribirOK = Diagrama de Autobus cadastrado com sucesso. +editarDiagramaAutobusController.MSG.borrarPergunta = Deseja realmete excluir o Diagrama de Autobus? +editarDiagramaAutobusController.MSG.borrarOK = Diagrama de Autobus excluido com sucesso. +editarDiagramaAutobusController.MSG.Corrida.Futura = Este diagrama é utilizado em corridas futuras, não se pode excluir. +editarDiagramaAutobusController.MSG.borrarAsientoPergunta = Confirma excluir poltrona? +editarDiagramaAutobusController.lblDescDiagrama.value = Descrição +editarDiagramaAutobusController.Existe.Asiento = Existe asiento +editarDiagramaAutobusController.Sem.Asiento = Sem assentos configurados +editarDiagramaAutobusController.Qtde.Asiento = Quantidade assentos diferente do configurado +editarDiagramaAutobusController.legenda.1 = Assentos +editarDiagramaAutobusController.legenda.2 = Corredor +editarDiagramaAutobusController.legenda.3 = Acessórios +editarDiagramaAutobusController.legenda.4 = Zona universal +editarDiagramaAutobusController.legenda.5 = Legenda: +editarDiagramaAutobusController.legenda.6 = WC - Banheiro +editarDiagramaAutobusController.legenda.7 = CF - Cafeteria +editarDiagramaAutobusController.legenda.8 = TV - Televisão +editarDiagramaAutobusController.legenda.9 = PT - Porta Traje + +# Tela Editar Detablhe Diagrama Autobus: +editarDetDiagramaAutobusController.window.title = Configuração Diagrama Autobus +editarDetDiagramaAutobusController.btnSalvar.tooltiptext = Salvar +editarDetDiagramaAutobusController.btnFechar.tooltiptext = Fechar +editarDetDiagramaAutobusController.lbAsiento.value = Assento +editarDetDiagramaAutobusController.lbVendible.value = Pode vender +editarDetDiagramaAutobusController.lbInternet.value = Vender internet + +# Tela de Busqueda Marca +busquedaMarcaController.window.title = Busca de Marca +busquedaMarcaController.btnRefresh.tooltiptext = Recarregar +busquedaMarcaController.btnNovo.tooltiptext = Nova Marca +busquedaMarcaController.btnCerrar.tooltiptext = Fechar +busquedaMarcaController.btnPesquisa.label = Buscar +busquedaMarcaController.lhDesc.label = Marca + +# Tela de Editar Marca +editarMarcaController.window.title = Editar Marca +editarMarcaController.btnApagar.tooltiptext = Apagar Marca +editarMarcaController.btnSalvar.tooltiptext = Salvar Marca +editarMarcaController.btnFechar.tooltiptext = Fechar +editarMarcaController.lbNome.value = Marca +editarMarcaController.MSG.suscribirOK = Marca cadastrada com sucesso. +editarMarcaController.MSG.borrarPergunta = Deseja realmete excluir a Marca? +editarMarcaController.MSG.borrarOK = Marca excluida com sucesso. +editarMarcaController.MSG.errorIMG = Arquivo não é de imagem: +editarMarcaController.fileupload.label = Selecionar Foto + +# Tela de Busqueda Asociacion Clase Servicio Marca +busquedaAsociacionClaseServicioMarcaController.window.title = Busqueda Associação Tipo Serviço Marca +busquedaAsociacionClaseServicioMarcaController.btnRefresh.tooltiptext = Recarregar +busquedaAsociacionClaseServicioMarcaController.btnNovo.tooltiptext = Nova Associação Tipo Serviço Marca +busquedaAsociacionClaseServicioMarcaController.btnCerrar.tooltiptext = Fechar +busquedaAsociacionClaseServicioMarcaController.btnPesquisa.label = Buscar +busquedaAsociacionClaseServicioMarcaController.lhId.label = Marca +busquedaAsociacionClaseServicioMarcaController.lhDesc.label = Tipo Serviço + +# Tela de Editar Asociacion Clase Servicio Marca +editarAsociacionClaseServicioMarcaController.window.title = Editar Associação Tipo de Serviço Marca +editarAsociacionClaseServicioMarcaController.btnApagar.tooltiptext = Apagar Associação Tipo de Serviço Marca +editarAsociacionClaseServicioMarcaController.btnSalvar.tooltiptext = Salvar Associação Tipo de Serviço Marca +editarAsociacionClaseServicioMarcaController.btnFechar.tooltiptext = Fechar +editarAsociacionClaseServicioMarcaController.lblMarca.value = Marca +editarAsociacionClaseServicioMarcaController.lblClaseServicio.value = Tipo de Serviço +editarAsociacionClaseServicioMarcaController.MSG.suscribirOK = Associação Tipo de Serviço Marca cadastrada com sucesso. +editarAsociacionClaseServicioMarcaController.MSG.borrarPergunta = Deseja realmete excluir a Associação Tipo de Serviço Marca? +editarAsociacionClaseServicioMarcaController.MSG.borrarOK = Associação Tipo de Serviço Marca excluida com sucesso. +editarAsociacionClaseServicioMarcaController.MSG.existe.registro = Associação Tipo de servicio e Marca , já existe um registro com estes dados. + +# Tela de Busqueda Configuracao Categoria +busquedaConfiguracionCategoriaController.window.title = Busqueda Configuração de Tipo de pasajero +busquedaConfiguracionCategoriaController.btnRefresh.tooltiptext = Recarregar +busquedaConfiguracionCategoriaController.btnNovo.tooltiptext = Nova Configuração Tipo de pasajero +busquedaConfiguracionCategoriaController.btnCerrar.tooltiptext = Fechar +busquedaConfiguracionCategoriaController.btnPesquisa.label = Buscar +busquedaConfiguracionCategoriaController.lhDesc.label = Tipo de pasajero + +# Tela de Editar Configuracao Categoria +editarConfiguracionCategoriaController.window.title = Editar Configuração de Tipo de pasajero +editarConfiguracionCategoriaController.btnApagar.tooltiptext = Apagar Configuração de Tipo de pasajero +editarConfiguracionCategoriaController.btnSalvar.tooltiptext = Salvar Configuração de Tipo de pasajero +editarConfiguracionCategoriaController.btnFechar.tooltiptext = Fechar +editarConfiguracionCategoriaController.btnAgregarPeriodo.tooltiptext = Períodos de vigencia +editarConfiguracionCategoriaController.MSG.suscribirOK = Configuração de Tipo de pasajero cadastrada com sucesso. +editarConfiguracionCategoriaController.MSG.borrarPergunta = Deseja realmete excluir a Configuração de Tipo de pasajero? +editarConfiguracionCategoriaController.MSG.editarPeriodo = Para editar o período de vigência é necessario salvar o tipo de passageiro. +editarConfiguracionCategoriaController.MSG.borrarOK = Configuração de Tipo de pasajero excluida com sucesso. +editarConfiguracionCategoriaController.lblCategorias.value = Tipo de pasajero +editarConfiguracionCategoriaController.lblEmpresa.value = Empresa +editarConfiguracionCategoriaController.lblMarca.value = Marca +editarConfiguracionCategoriaController.lblCorrida.value = Corrida +editarConfiguracionCategoriaController.lblClaseServicio.value = Tipo de Serviço +editarConfiguracionCategoriaController.lblOrigem.value = Origem +editarConfiguracionCategoriaController.lblDestino.value = Destino +editarConfiguracionCategoriaController.lblCantAutorizada.value = CantAutorizada +editarConfiguracionCategoriaController.lblDescuentoPorc.value = DescuentoPorc +editarConfiguracionCategoriaController.lblDescuentoImporte.value = DescuentoImporte +editarConfiguracionCategoriaController.lblQtdPeriodo.value = Qtd. Período +editarConfiguracionCategoriaController.lbFecInicio.value = Data Inicio +editarConfiguracionCategoriaController.lbFecFinal.value = Data Fim +editarConfiguracionCategoriaController.tabConfiguracoes.label = Configurações +editarConfiguracionCategoriaController.tabPeriodos.label = Periodos +editarConfiguracionCategoriaController.tabMarca.label = Marca +editarConfiguracionCategoriaController.tabDesconto.label = Desconto +editarConfiguracionCategoriaController.tabMercado.label = Mercado +editarConfiguracionCategoriaController.tabClase.label = Classe +editarConfiguracionCategoriaController.tabCorrida.label = Corrida +editarConfiguracionCategoriaController.btnAddMarca.tooltiptext = Adicionar Marca +editarConfiguracionCategoriaController.btnBorrarMarca.tooltiptext = Remover Marca +editarConfiguracionCategoriaController.btnAddClase.tooltiptext = Adicionar Classe +editarConfiguracionCategoriaController.btnBorrarClase.tooltiptext = Remover Classe +editarConfiguracionCategoriaController.btnAddCorrida.tooltiptext = Adicionar Corrida +editarConfiguracionCategoriaController.btnBorrarCorrida.tooltiptext = Remover Corrida +editarConfiguracionCategoriaController.btnAddMercado.tooltiptext = Adicionar Mercado +editarConfiguracionCategoriaController.btnBorrarMercado.tooltiptext = Remover Mercado +editarConfiguracionCategoriaController.MSG.selecionarPeriodo = Seleccione un período de quitar. +editarConfiguracionCategoriaController.MSG.selectItem = Seleccione un item. +editarConfiguracionCategoriaController.MSG.selectDescuento = Seleccione un Descuento. +editarConfiguracionCategoriaController.MSG.busquedaPeriodo = Data Inicial maior que a data Final. +editarConfiguracionCategoriaController.MSG.busquedaPeriodoFechaActual = Data de inicio anterior a data atual. +editarConfiguracionCategoriaController.MSG.busquedaNull = Data inicial ou final em branco. + +editarConfiguracionCategoriaController.MSG.selecionarPeriodo = Selecione um periodo para remover. + +# Tela de Busqueda Via +busquedaViaController.window.title = Busca de Via +busquedaViaController.btnRefresh.tooltiptext = Recarregar +busquedaViaController.btnNovo.tooltiptext = Nova Via +busquedaViaController.btnCerrar.tooltiptext = Fechar +busquedaViaController.btnPesquisa.label = Buscar +busquedaViaController.lhDesc.label = Via +busquedaViaController.lhId.label = ID + +# Tela de Editar Via +editarViaController.window.title = Editar Via +editarViaController.btnApagar.tooltiptext = Apagar Via +editarViaController.btnSalvar.tooltiptext = Salvar Via +editarViaController.btnFechar.tooltiptext = Fechar +editarViaController.lbNome.value = Via +editarViaController.MSG.suscribirOK = Via cadastrada com sucesso. +editarViaController.MSG.borrarPergunta = Deseja realmete excluir a via? +editarViaController.MSG.borrarOK = Via excluida com sucesso. +editarConfiguracionCategoriaController.MSG.periodoNull = Informe data de inicio e fim. + +# Tela de Busqueda Parada +busquedaCatalogoDeParadaController.window.title = Busca de Localidade +busquedaCatalogoDeParadaController.btnRefresh.tooltiptext = Recarregar +busquedaCatalogoDeParadaController.btnNovo.tooltiptext = Nova Localidade +busquedaCatalogoDeParadaController.btnCerrar.tooltiptext = Fechar +busquedaCatalogoDeParadaController.btnPesquisa.label = Buscar +busquedaCatalogoDeParadaController.lhId.label = ID +busquedaCatalogoDeParadaController.lhDesc.label = Descrição +busquedaCatalogoDeParadaController.lbCveParada.value = Chave Localidade + +# Tela de Editar Parada +editarCatalogoDeParadaController.window.title = Editar Localidade +editarCatalogoDeParadaController.btnApagar.tooltiptext = Apagar Localidade +editarCatalogoDeParadaController.btnSalvar.tooltiptext = Salvar Localidade +editarCatalogoDeParadaController.btnFechar.tooltiptext = Fechar +editarCatalogoDeParadaController.lbNome.value = Localidade +editarCatalogoDeParadaController.lbCveParada.value = Clave Parada +editarCatalogoDeParadaController.MSG.suscribirOK = Localidade cadastrada com sucesso. +editarCatalogoDeParadaController.MSG.borrarPergunta = Deseja realmete excluir essa Localidade? +editarCatalogoDeParadaController.MSG.borrarOK = Localidade excluida com sucesso. +editarCatalogoDeParadaController.lbCiudad.value = Cidade +editarCatalogoDeParadaController.lbTipoParada.value = Tipo Parada +editarCatalogoDeParadaController.lbNodo.value = Nodo + +# Tela de Busqueda Parada +busquedaCatalogoDeRutaController.window.title = Busca de Linha +busquedaCatalogoDeRutaController.btnRefresh.tooltiptext = Recarregar +busquedaCatalogoDeRutaController.btnNovo.tooltiptext = Nova Linha +busquedaCatalogoDeRutaController.btnCerrar.tooltiptext = Fechar +busquedaCatalogoDeRutaController.btnPesquisa.label = Buscar +busquedaCatalogoDeRutaController.lhId.label = ID +busquedaCatalogoDeRutaController.lhDesc.label = Linha +busquedaCatalogoDeRutaController.lbClase.value = Classe + +# Tela de Editar Ruta +editarCatalogoDeRutaController.window.title = Editar Linha +editarCatalogoDeRutaController.btnApagar.tooltiptext = Apagar Linha +editarCatalogoDeRutaController.btnSalvar.tooltiptext = Salvar Linha +editarCatalogoDeRutaController.btnFechar.tooltiptext = Fechar +editarCatalogoDeRutaController.btnModificar.tooltiptext = Modificar secuencia +editarCatalogoDeRutaController.lbNome.value = Linha +editarCatalogoDeRutaController.lbClase.value = Classe +editarCatalogoDeRutaController.lbTramo.value = Parada / Tramo +editarCatalogoDeRutaController.lbVia.value = Via +editarCatalogoDeRutaController.lbOrigem.value = Origen +editarCatalogoDeRutaController.lbDestino.value = Destino +editarCatalogoDeRutaController.lbSecuencia.value = Sequencia +editarCatalogoDeRutaController.lbVenta.value = Vende +editarCatalogoDeRutaController.lbVia.value = Via +editarCatalogoDeRutaController.lbAddBorrar.value = Adicionar / Remover +editarCatalogoDeRutaController.MSG.suscribirOK = Linha cadastrada com sucesso. +editarCatalogoDeRutaController.MSG.sequencia = Infome pelo menos 2 sequencias. +editarCatalogoDeRutaController.MSG.borrarPergunta = Deseja realmete excluir essa Linha? +editarCatalogoDeRutaController.MSG.gerarPergunta = Gerar Combinação? +editarCatalogoDeRutaController.MSG.borrarOK = Linha excluida com sucesso. +editarCatalogoDeRutaController.MSG.selectItem = Selecione um Item. +editarCatalogoDeRutaController.MSG.tramoExiste = Combinacion existente. +editarCatalogoDeRutaController.MSG.tramo = Tramo Inexistente. +editarCatalogoDeRutaController.MSG.removerSecuencia = No se puede remover la primera o la ultima secuencia. +editarCatalogoDeRutaController.tabRuta.value = Ruta +editarCatalogoDeRutaController.tabSecuencia.value = Sequencia +editarCatalogoDeRutaController.tabCombinacion.value = Combinacion +editarCatalogoDeRutaController.btnAddCombinacion.tooltiptext = Adicionar Combinação +editarCatalogoDeRutaController.btnBorrarCombinacion.tooltiptext = Remover Combinação +editarCatalogoDeRutaController.btnGerarCombinacion.tooltiptext = Gerar Combinação +editarCatalogoDeRutaController.btnAddSecuencia.tooltiptext = Adicionar Sequencia +editarCatalogoDeRutaController.btnBorrarSecuencia.tooltiptext = Remover Sequencia +editarCatalogoDeRutaController.RadSi.value = Sim +editarCatalogoDeRutaController.RadNo.value = Não +editarCatalogoDeRutaController.radAprobacionAutorizado.value = Autorizado +editarCatalogoDeRutaController.radAprobacionLatente.value = Latente +editarCatalogoDeRutaController.radioNombreObrigadotio = Solicitar Nome Passageiro +editarCatalogoDeRutaController.radioNombreObrigadotio.rdSi = Sim +editarCatalogoDeRutaController.radioNombreObrigadotio.rdNo = Não +editarCatalogoDeRutaController.lbEmpresa.value = Empresa +editarCatalogoDeRutaController.tabRutaEmpresa.value = Ruta Empresa +editarCatalogoDeRutaController.btnAddEmpresa.tooltiptext = Adicionar Ruta Empresa +editarCatalogoDeRutaController.btnBorrarEmpresa.tooltiptext = Remover Ruta Empresa +editarCatalogoDeRutaController.lhTiempoEstancia = Tempo Espera +editarCatalogoDeRutaController.MSG.addTramos = Agregar tramos a combinação. +editarCatalogoDeRutaController.MSG.tramoInicioFim = Tramo inicial o final no puede borrar. +editarCatalogoDeRutaController.VentaOffLine = Venda no Hand Held off line. + +# Tela de Busqueda Tramos +busquedaTramosController.window.title = Busca de Tramos +busquedaTramosController.btnRefresh.tooltiptext = Recarregar +busquedaTramosController.btnNovo.tooltiptext = Novo Tramo +busquedaTramosController.btnCerrar.tooltiptext = Fechar +busquedaTramosController.btnPesquisa.label = Buscar +busquedaTramosController.lhDesc.label = Tramo + +# Tela de Editar Tramos +editarTramosController.window.title = Editar Tramo +editarTramosController.btnApagar.tooltiptext = Apagar Tramo +editarTramosController.btnSalvar.tooltiptext = Salvar Tramo +editarTramosController.btnFechar.tooltiptext = Fechar +editarTramosController.lbNome.value = Tramo +editarTramosController.MSG.suscribirOK = Tramo cadastrado com sucesso. +editarTramosController.MSG.borrarPergunta = Deseja realmete excluir o tramo? +editarTramosController.MSG.borrarOK = Tramo excluida com sucesso. +editarTramosController.MSG.borrarFalse = Tramo não pode ser eliminado. +editarTramosController.labelDestino.value = Destino +editarTramosController.labelOrigem.value = Origem +editarTramosController.labelVia.value = Via +editarTramosController.tabTramos.label = Tramos +editarTramosController.tabServicio.label = Serviço +editarTramosController.lbKmReal.value = KM Real +editarTramosController.lbKmTarifa.value = KM Tarifa +editarTramosController.lbKmPagoConductor.value = KM Pago Condutor +editarTramosController.lbTiempoRecorrido.value = Tempo Percurso +editarTramosController.btnApagarAtributo.tooltiptext = Adicionar atributo. +editarTramosController.btnSalvarAtributo.tooltiptext = Apagar atributo. +editarTramosController.lbClaseServicio.value = Tipo de Serviço +editarTramosController.MSG.borrarTramoAtributo = Apagar tramo atributo? +editarTramosController.MSG.selecioneTramoAtributo = Selecione um tramo atributo para excluir. +editarTramosController.ClaseServicio.value = Tipo Servicio +editarTramosController.tabTiempo.label = Tiempos +editarTramosController.lbTiemporecorrido.value = Tiempo Recorrido +editarTramosController.lbHorainicio.value = Hora Inicio +editarTramosController.lbHorafin.value = Hora Fin +editarTramosController.lbTiempoRecorrido.value = Tiempo Recorrido +editarTramosController.lbnumdiasemana.value = Num Dia Semana +editarTramosController.btnApagarTiempo.tooltiptext = Apagar Tramo Tiempo +editarTramosController.btnSalvarTiempo.tooltiptext = Salvar Tramo Tiempo +editarTramosController.MSG.borrarTramoTiempo = Borrar Tramo Tiempo? +editarTramosController.MSG.selecioneTramoTiempo = Seleccionar un Tramo Tiempo. +editarTramosController.lhTiempoHorainicio.value = Inicio +editarTramosController.lhTiempoHorafin.value = Fim +editarTramosController.lhTiempoNumdiasemana.value = Dias Semana +editarTramosController.lhTiempoTiemporecorrido.value = Recorrido +editarTramosController.MSG.borrarTramoServicio = Eliminar Tiempo del Tramo? +editarTramosController.MSG.selecioneTramoServicio = Seleccionar un Tramo Tiempo a Eliminar. +editarTramosController.MSG.OrigemDestinoIguais = Dados origem, destino devem ser diferentes. +MSG.Registro.Existe.Origem.Destino.Via = Já existe um registro com esses dados de origem, destino, via. + +# Buscar Corrida +busquedaConfiguracionCorridaController.window.title = Configuração de Corrida +busquedaConfiguracionCorridaController.btnRefresh.tooltiptext = Actualizar +busquedaConfiguracionCorridaController.btnNovo.tooltiptext = New Line +busquedaConfiguracionCorridaController.btnCerrar.tooltiptext = Cierre +busquedaConfiguracionCorridaController.btnPesquisa.label = Búsqueda +busquedaConfiguracionCorridaController.lhId.label = ID +busquedaConfiguracionCorridaController.lhDesc.label = Corrida +busquedaConfiguracionCorridaController.lhHora.label = Horario +busquedaConfiguracionCorridaController.lhRuta.label = Ruta +busquedaConfiguracionCorridaController.lhMarca.label = Marca +busquedaConfiguracionCorridaController.lhDe.label = De +busquedaConfiguracionCorridaController.lhHasta.label = Até +busquedaConfiguracionCorridaController.lhClase.value = Tipo servicio +busquedaConfiguracionCorridaController.cmbMarca.value = Marca +busquedaConfiguracionCorridaController.lhEmpresaCorrida.value = Empresa Corrida +busquedaConfiguracionCorridaController.lhEmpresaIngresso.value = Empresa Ingreso +busquedaConfiguracionCorridaController.lhEmpresaRolOperativo.value = Rol Operativo +busquedaConfiguracionCorridaController.lhStatus.value = Status +busquedaConfiguracionCorridaController.lhClase.value = Tipo servicio +busquedaConfiguracionCorridaController.lhSemana.value = Días de la Semana + +# Detener la pantalla de Configuración de Corrida +editarConfiguracionCorridaController.window.title = Editar Configuración de Corrida +editarConfiguracionCorridaController.btnApagar.tooltiptext = Borrar Corrida +editarConfiguracionCorridaController.btnSalvar.tooltiptext = Guardar la Corrida +editarConfiguracionCorridaController.btnFechar.tooltiptext = Cierre +editarConfiguracionCorridaController.btnRemoverTramo.tooltiptext = Borrar Esquema Tramo +editarConfiguracionCorridaController.btnAdcionarTramo.tooltiptext = Adicionar Esquema Tramo +editarConfiguracionCorridaController.lbVigencia.value = Viagencia de +editarConfiguracionCorridaController.lbDe.value = De +editarConfiguracionCorridaController.lbHasta.value = Hasta +editarConfiguracionCorridaController.lbCada.value = Cada +editarConfiguracionCorridaController.lbMinutos.value = Minutos +editarConfiguracionCorridaController.lbHrs.value = Hrs. +editarConfiguracionCorridaController.cmbClase.value = Tipo servicio +editarConfiguracionCorridaController.cmbMarca.value = Marca +editarConfiguracionCorridaController.cmbRuta.value = Ruta +editarConfiguracionCorridaController.cmbAsiento.value = Asientos +editarConfiguracionCorridaController.cmbAsiento.tooltiptext = Planeación de asientos cedidos +editarConfiguracionCorridaController.cmbEmpresaCorrida.value = Empresa Corrida +editarConfiguracionCorridaController.cmbEmpresaIngresso.value = Empresa Ingreso +editarConfiguracionCorridaController.cmbEmpresaRolOperativo.value = Rol Operativo +editarConfiguracionCorridaController.cmbStatus.value = Status +editarConfiguracionCorridaController.rdPorBloq.value = Por Bloque: +editarConfiguracionCorridaController.rdPorHora.value = Por Horario: +editarConfiguracionCorridaController.rdLatente.value = Latente +editarConfiguracionCorridaController.rdAutorizada.value = Autorizada +editarConfiguracionCorridaController.rdCancelada.value = Cancelada +editarConfiguracionCorridaController.lbSemana.value = Días de la Semana: +editarConfiguracionCorridaController.lbL.value = L +editarConfiguracionCorridaController.lbMa.value = Ma +editarConfiguracionCorridaController.lbMi.value = Mi +editarConfiguracionCorridaController.lbJ.value = J +editarConfiguracionCorridaController.lbV.value = V +editarConfiguracionCorridaController.lbS.value = S +editarConfiguracionCorridaController.lbD.value = D +editarConfiguracionCorridaController.lbCantParados.value = Cantidad de parados +editarConfiguracionCorridaController.MSG.suscribirOK = registró correctamente. +editarConfiguracionCorridaController.MSG.borrarPergunta = No RealMeteo eliminar esta Corrida? +editarConfiguracionCorridaController.MSG.borrarOK = Corrida excluida com sucesso. +editarConfiguracionCorridaController.MSG.selectItem = Selecione um Item. +editarConfiguracionCorridaController.tabCorrida.value = Corrida +editarConfiguracionCorridaController.tabCorridaTramo.value = Corrida Tramo +editarConfiguracionCorridaController.fletes = Fletes +editarConfiguracionCorridaController.viajesEspeciales = Viagens Especiais +editarConfiguracionCorridaController.transportePasajeros = Transporte de Pasajeros +editarConfiguracionCorridaController.tipoCorrida.value = Tipo Corrida +editarConfiguracionCorridaController.esquemaTramoList.tooltiptext= Duplo click editar Tiempo Estancia +editarConfiguracionCorridaController.division.value = Division +editarConfiguracionCorridaController.MSG.busquedaPeriodo = Data de inicio posterior a data final. +editarConfiguracionCorridaController.MSG.RutaSemTramos = Ruta no possui tramos. +editarConfiguracionCorridaController.MSG.RutaVazia = Seleccione una ruta. + +#Planeacion de Asiento Controller +editarConfiguracionCorridaAsientoController.window.title = Planeación de asientos +editarConfiguracionCorridaAsientoController.window.title = Planeación de asientos +editarConfiguracionCorridaAsientoController.btnApagar.tooltiptext = Borrar Planeación de asientos +editarConfiguracionCorridaAsientoController.btnSalvar.tooltiptext = Guardar la Planeación de asientos +editarConfiguracionCorridaAsientoController.btnFechar.tooltiptext = Cierre +editarConfiguracionCorridaAsientoController.btnRemoverTramo.tooltiptext = Borrar Planeación de asientos +editarConfiguracionCorridaAsientoController.btnLiberar.value = Liberar +editarConfiguracionCorridaAsientoController.btnCeder.value = Ceder +editarConfiguracionCorridaAsientoController.lbAsiento.value = Asiento: +editarConfiguracionCorridaAsientoController.lbOrigem.value = Origem: +editarConfiguracionCorridaAsientoController.MSG.salvo = Registró Planeacion de Asiento Correctamente. +editarConfiguracionCorridaAsientoController.MSG.existe = Asiento en el Registro. +editarConfiguracionCorridaAsientoController.MSG.liberar = Asiento(s) Liberado(s). + +# Buesqueda de Tarifas Minimas +busquedaTarifasMinimasController.window.title = Busca de Tarifas Minimas +busquedaTarifasMinimasController.btnRefresh.tooltiptext = Atualizar +busquedaTarifasMinimasController.btnNovo.tooltiptext = Nova Tarifa Minima +busquedaTarifasMinimasController.btnCerrar.tooltiptext = Fechar +busquedaTarifasMinimasController.lhImportetarifa.label = Tarifa +busquedaTarifasMinimasController.lhMarca.label = Marca +busquedaTarifasMinimasController.lhOrigem.label = Origem +busquedaTarifasMinimasController.lhDestino.label = Destino +busquedaTarifasMinimasController.lhClaseServicio.label = Tipo Serviço +busquedaTarifasMinimasController.lhPlaza.label = Plaza +busquedaTarifasMinimasController.lhMoneda.label = Moeda + +# Editar Tarifas Minimas +editarTarifaMinimaController.window.title = Editar Tarifa Mínima +editarTarifaMinimaController.btnApagar.tooltiptext = Apagar Tarifa Mínima +editarTarifaMinimaController.btnSalvar.tooltiptext = Salvar Tarifa Mínima +editarTarifaMinimaController.btnFechar.tooltiptext = Fechar +editarTarifaMinimaController.btnFechar.MSG.SuscbrirOK = Tarifa Mínima gravada com sucesso. +editarTarifaMinimaController.btnFechar.MSG.borrarOK = Tarifa Mínima apagada com sucesso. +editarTarifaMinimaController.btnFechar.MSG.Deseja.Borrar = Deseja realmente apagar Tarifa Mínima? + +# Busqueda de Tarifas: +busquedaTarifaController.window.title = Buscar Tarifas +busquedaTarifaController.btnRefresh.tooltiptext = Atualizar +busquedaTarifaController.btnNovo.tooltiptext = Nova Tarifa +busquedaTarifaController.btnCerrar.tooltiptext = Fechar +busquedaTarifaController.lhPrecio.label = Preço +busquedaTarifaController.lhPrecioNuevo.label = Novo Precio +busquedaTarifaController.lhPrecioOriginal.label = Preço Original +busquedaTarifaController.lhMarca.label = Marca +busquedaTarifaController.lhFeciniciovigencia.label = Vigência +busquedaTarifaController.lhClaseServicio.label = Tipo Serviço +busquedaTarifaController.lhMoneda.label = Moeda +busquedaTarifaController.lhEmpresa.label = Empresa +busquedaTarifaController.lhRuta.label = Ruta +busquedaTarifaController.lhTipoPuntoVenta.label = Canal de venda +busquedaTarifaController.lhCategoria.label = Tipo de passageiro +busquedaTarifaController.lhTramo.label = Tramo +busquedaTarifaController.btnPesquisa.label = Pesquisar +busquedaTarifaController.lhVigencia.label = Vigencia +busquedaTarifaController.lhStatusTarifa.label = Status Tarifa +busquedaTarifaController.lhprecioredabierto.label = Preço redondo aberto +busquedaTarifaController.btnAddTarifaCategoria.tooltiptext = Adicionar tarifa por tipo de passageiro +busquedaTarifaController.btnRmvTarifaCategoria.tooltiptext = Remover tarifa por tipo de passageiro +busquedaTarifaController.lhTipoPontoVenta.label = Tipo Ponto de venda + +# Editar Tarifa: +editarTarifaController.window.title = Editar Tarifa +editarTarifaController.btnFechar.MSG.SuscbrirOK = Tarifa cadastrada com sucesso. +editarTarifaController.btnFechar.MSG.Deseja.Borrar = Deseja realmente apagar essa tarifa? +editarTarifaController.btnFechar.MSG.BorrarOK = Tarifa apagada com sucesso. +editarTarifaController.btnApagar.tooltiptext = Apagar tarifa +editarTarifaController.btnSalvar.tooltiptext = Salvar tarifa +editarTarifaController.btnFechar.tooltiptext = Fechar +editarTarifaController.tabTarifa.label = Tarifa +editarTarifaController.tabTarifaTipoPasajero.label = Tarifa por tipo de passageiro +editarTarifaController.tabTarifaCanalVenta.label = Tarifa por canal de venda +editarTarifaController.MSG.MercadoCompetido = A nova Tarifa é parte de um mercado competido. Deseja continuar? +editarTarifaController.MSG.TarifaMinima = Le nuevo valor es menos de una tarifa mínima. ¿Desea el cambio? + +# Busqueda Vigencia Tarifa +busquedaVigenciaTarifaController.window.title = Vigência Tarifa +busquedaVigenciaTarifaController.btnRefresh.tooltiptext = Atualizar +busquedaVigenciaTarifaController.btnNovo.tooltiptext = Nova Vigência +busquedaVigenciaTarifaController.btnCerrar.tooltiptext = Fechar +busquedaVigenciaTarifaController.lbFecInicio.value = Data Inicio +busquedaVigenciaTarifaController.lbFecFinal.value = Data Fim +busquedaVigenciaTarifaController.btnPesquisa.label = Procurar +busquedaVigenciaTarifaController.lhFecInicio.label = Data Inicio +busquedaVigenciaTarifaController.lhFecFinal.label = Data Fim +busquedaVigenciaTarifaController.lbfechabilitacionventa.value = Data habilita venda + +# Editar Vigencia Tarifa +editarVigenciaTarifaController.window.title = Editar Vigencia Tarifa +editarVigenciaTarifaController.btnFechar.MSG.SuscbrirOK = Vigência cadastrada com sucesso. +editarVigenciaTarifaController.btnFechar.MSG.Deseja.Borrar = Deseja realmente apagar essa vigencia? +editarVigenciaTarifaController.btnFechar.MSG.borrarOK = Vigencia apagada com sucesso. +editarVigenciaTarifaController.btnApagar.tooltiptext = Apagar Vigência +editarVigenciaTarifaController.btnSalvar.tooltiptext = Salvar Vigência +editarVigenciaTarifaController.btnFechar.tooltiptext = Fechar +editarVigenciaTarifaController.MSG.FimMenorInicio = Vigência não cadastrada. Fim vigência menor que inicio. +editarVigenciaTarifaController.MSG.conflitoVigencias = Vigencia não cadastrada. Há um conflito entre datas de outra vigência. + +# Tarifa Escala +tarifaEscalaContorller.window.title = Tarifa Escala +tarifaEscalaContorller.btnApagar.tooltiptext = Autorizar Escala +tarifaEscalaContorller.btnExportarExcel.tooltiptext = Exportar Excel +tarifaEscalaContorller.btnSalvar.tooltiptext = Salvar +tarifaEscalaContorller.btnFechar.tooltiptext = Fechar +tarifaEscalaContorller.lhRuta.label = Ruta +tarifaEscalaContorller.lhFeciniciovigencia.label = Vigencia +tarifaEscalaContorller.lhMarca.label = Marca +tarifaEscalaContorller.lhMoneda.label = Moneda +tarifaEscalaContorller.lhClaseServicio.label = Tipo Serviço +tarifaEscalaContorller.MSGSelecioneEscala = Selecione uma escala de tarifa. +tarifaEscalaContorller.MSGEscalaAutoriazada = Escala autorizada com sucesso. +tarifaEscalaContorller.MSGAutoriazarEscala = Autorizar Escala? +tarifaEscalaContorller.MSGTarifasAtualizadas = Tarifa(s) atualizada(s) com sucesso. +tarifaEscalaContorller.MSGNOPodeAlterarTarifaMinima = Não pode ser alterada, menor que tarifa mínima. +tarifaEscalaContorller.MSGSelMarca = Selecione uma Marca. +tarifaEscalaContorller.MSGSelClaseServicio = Selecione um Tipo de Serviço. +tarifaEscalaContorller.MSGAlterarTarifaMercadoCompetido = Tarifa faz parte de um Mercado Competido, deseja alterá-la mesmo assim? + +#Busqueda Mercado Competido +busquedaMercadoCompetidoController.window.title = Mercado Competido +busquedaMercadoCompetidoController.btnRefresh.tooltiptext = Atualizar +busquedaMercadoCompetidoController.btnNovo.tooltiptext = Novo Mercado Competido +busquedaMercadoCompetidoController.btnCerrar.tooltiptext = Fechar +busquedaMercadoCompetidoController.lhClaseServicio.label = Tipo de Serviço +busquedaMercadoCompetidoController.lhOrigem.label = Origem +busquedaMercadoCompetidoController.lhDestino.label = Destino +busquedaMercadoCompetidoController.btnPesquisa.label = Pesquisar + +#Editar Mercado Competido +editarMercadoCompetidoController.window.title = Mercado Competido +editarMercadoCompetidoController.btnApagar.tooltiptext = Apagar Mercado Competido +editarMercadoCompetidoController.btnSalvar.tooltiptext = Salvar Mercado Competido +editarMercadoCompetidoController.btnFechar.tooltiptext = Fechar +editarMercadoCompetidoController.btnFechar.MSG.SuscbrirOK = Mercado Competido salvo com sucesso. +editarMercadoCompetidoController.btnFechar.MSG.Deseja.Borrar = Deseja realmente apagar Mercado Competido? +editarMercadoCompetidoController.btnFechar.MSG.BorrarOK = Mercado Competido apagado com sucesso. + +#Senda Amigo - Busqueda Senda amigo - Acumulacion Por Venta +busquedaAcumulacionPorVentaController.window.title = Configuración para Acumulación por venta +busquedaAcumulacionPorVentaController.lhOrigen.label = Origen +busquedaAcumulacionPorVentaController.lhDestino.label = Destino +busquedaAcumulacionPorVentaController.lhFechainicial.label = Fecha Inicial +busquedaAcumulacionPorVentaController.lhFechafinal.label = Fecha Final +busquedaAcumulacionPorVentaController.lhPorcentaje.label = Porcentaje +busquedaAcumulacionPorVentaController.btnPesquisa.label = Busqueda +busquedaAcumulacionPorVentaController.lhVigencia.label = Fechas de Vigencia +busquedaAcumulacionPorVentaController.tipodepasajero = Tipo de pasajero + +#Senda Amigo - Editar Senda amigo - Acumulacion Por Venta +editarParamAcumulaPuntoController.window.title = Editar Configuración para Acumulación por venta +editarParamAcumulaPuntoController.btnFechar.MSG.SuscbrirOK = Acumulación por venta registrada con éxito. +editarParamAcumulaPuntoController.btnFechar.MSG.Deseja.Borrar = Acumulación por venta ¿Desea borrar? +editarParamAcumulaPuntoController.btnFechar.MSG.BorrarOK = Acumulación por venta eliminada con éxito. +editarParamAcumulaPuntoController.btnApagar.tooltiptext = Borrar +editarParamAcumulaPuntoController.btnSalvar.tooltiptext = Guardar +editarParamAcumulaPuntoController.btnFechar.tooltiptext = Cerrar +editarParamAcumulaPuntoController.Porcentaje.value = Porcentaje +editarParamAcumulaPuntoController.PorcentajeM.value = Porcentaje Mercado +editarParamAcumulaPuntoController.PorcentajeE.value = Porcentaje Empresa +editarParamAcumulaPuntoController.PorcentajeF.value = Porcentaje Forma Pago +editarParamAcumulaPuntoController.PorcentajeC.value = Porcentaje Categoria +editarParamAcumulaPuntoController.Boletos.label = Boletos por Operación +editarParamAcumulaPuntoController.Operaciones.label = Operaciones por día +editarParamAcumulaPuntoController.Fpago.label = Forma Pago +editarParamAcumulaPuntoController.Empresa.label = Empresa +editarParamAcumulaPuntoController.Categoria.label = Categoria +editarParamAcumulaPuntoController.Pasajero.label = Pasajero +editarParamAcumulaPuntoController.lhOrigen.label = Origen +editarParamAcumulaPuntoController.lhDestino.label = Destino +editarParamAcumulaPuntoController.MSG.suscribirOK = Acumulación por venta Registrado con Éxito. +editarParamAcumulaPuntoController.MSG.borrarPergunta = ¿Desea Eliminar Acumulación por venta? +editarParamAcumulaPuntoController.MSG.borrarOK = Acumulación por venta Eliminado +editarParamAcumulaPuntoController.MSG.busquedaPeriodo = Fecha de Inicio Posterior a la Fecha Final. + +#Senda Amigo - Busqueda Senda amigo - Canje de Puntos +busquedaParamCanjePuntoController.window.title = Configuración para Canje de puntos +busquedaParamCanjePuntoController.lhOrigen.label = Origen +busquedaParamCanjePuntoController.lhDestino.label = Destino +busquedaParamCanjePuntoController.lhFechainicial.label = Fecha Inicial +busquedaParamCanjePuntoController.lhFechafinal.label = Fecha Final +busquedaParamCanjePuntoController.lhPorcentaje.label = Porcentaje +busquedaParamCanjePuntoController.btnPesquisa.label = Búsqueda +busquedaParamCanjePuntoController.lhVigencia.label = Fechas de Vigencia + +#Senda Amigo - Editar Senda amigo - Acumulacion Por Venta +editarParamCanjePuntoController.window.title = Editar Configuración para Canje de Puntos +editarParamCanjePuntoController.btnFechar.MSG.SuscbrirOK = Canje de Puntos registrada con éxito. +editarParamCanjePuntoController.btnFechar.MSG.Deseja.Borrar = Canje de Puntos ¿Desea borrar? +editarParamCanjePuntoController.btnFechar.MSG.BorrarOK = Canje de Punto eliminada con éxito. +editarParamCanjePuntoController.btnApagar.tooltiptext = Borrar +editarParamCanjePuntoController.btnSalvar.tooltiptext = Guardar +editarParamCanjePuntoController.btnFechar.tooltiptext = Cerrar +editarParamCanjePuntoController.Porcentaje.value = Porcentaje Aplicar +editarParamCanjePuntoController.Boletos.value = Boletos por Operación +editarParamCanjePuntoController.Operaciones.value = Operaciones por día +editarParamCanjePuntoController.MSG.suscribirOK = Canje de Punto Registrado con Éxito. +editarParamCanjePuntoController.MSG.borrarPergunta= ¿Desea Eliminar Canje de Punto? +editarParamCanjePuntoController.MSG.borrarOK= Canje de Punto Eliminado +editarParamCanjePuntoController.MSG.busquedaPeriodo= Fecha de Inicio Posterior a la Fecha Final. + +#Senda Amigo - busquedaParamCostoTarjeta +busquedaParamCostoTarjetaController.window.title = Configuración para Asignación de nueva tarjeta a un cliente +busquedaParamCostoTarjetaController.lhEmpresa.label = Empresa +busquedaParamCostoTarjetaController.lhPrecio.label = Precio +busquedaParamCostoTarjetaController.btnPesquisa.label = Busqueda + +#Senda Amigo - Editar Senda amigo - Acumulacion Por Venta +editarParamCostoTarjetaController.window.title = Configuración para Asignación de nueva tarjeta a un cliente +editarParamCostoTarjetaController.btnFechar.MSG.SuscbrirOK = Tarjeta registrada con éxito. +editarParamCostoTarjetaController.btnFechar.MSG.Deseja.Borrar = Tarjeta ¿Desea borrar? +editarParamCostoTarjetaController.btnFechar.MSG.BorrarOK = Tarjeta eliminada con éxito. +editarParamCostoTarjetaController.btnApagar.tooltiptext = Borrar +editarParamCostoTarjetaController.btnSalvar.tooltiptext = Guardar +editarParamCostoTarjetaController.btnFechar.tooltiptext = Cerrar +editarParamCostoTarjetaController.Empresa.value = Empresa +editarParamCostoTarjetaController.Precio.value = Precio por otorgar +editarParamCostoTarjetaController.MSG.suscribirOK = Tarjeta Registrado con Éxito. +editarParamCostoTarjetaController.MSG.borrarPergunta = ¿Desea Eliminar Tarjeta? +editarParamCostoTarjetaController.MSG.borrarOK = Tarjeta Eliminado + +#Senda Amigo - busquedaParamAcumulacionMasivoController +busquedaParamAcumulacionMasivoController.window.title = Configuración para Acumulación Masiva +busquedaParamAcumulacionMasivoController.lhPunto.label = Empresa +busquedaParamAcumulacionMasivoController.lhPunto2.label = Empresa +busquedaParamAcumulacionMasivoController.lhMax.label = Máximo +busquedaParamAcumulacionMasivoController.lhMin.label = Minimo +busquedaParamAcumulacionMasivoController.btnPesquisa.label = Busqueda + +#Senda Amigo - editar Masivo +editarParamAcumulaMasivoController.window.title = Configuración para Acumulación Masiva +editarParamAcumulaMasivoController.btnFechar.MSG.SuscbrirOK = Acumulación Masiva registrada con éxito. +editarParamAcumulaMasivoController.btnFechar.MSG.Deseja.Borrar = Acumulación Masiva ¿Desea borrar? +editarParamAcumulaMasivoController.btnFechar.MSG.BorrarOK = Acumulación Masiva eliminada con éxito. +editarParamAcumulaMasivoController.btnApagar.tooltiptext = Borrar +editarParamAcumulaMasivoController.btnSalvar.tooltiptext = Guardar +editarParamAcumulaMasivoController.btnFechar.tooltiptext = Cerrar +editarParamAcumulaMasivoController.lhMax.label = Máximo +editarParamAcumulaMasivoController.lhMin.label = Minimo +editarParamAcumulaMasivoController.lhPunto.label = Empresa +editarParamAcumulaMasivoController.lhPunto2.label = Empresa +editarParamAcumulaMasivoController.MSG.suscribirOK = Acumulación Masiva Registrado con Éxito. +editarParamAcumulaMasivoController.MSG.borrarPergunta = ¿Desea Eliminar Acumulación Masiva? +editarParamAcumulaMasivoController.MSG.borrarOK = Acumulación Masiva Eliminado + +#Senda Amigo - busquedaParamCompraPuntoController +busquedaParamCompraPuntoController.window.title = Configuración para Compra de puntos +busquedaParamAcumulacionMasivoController.lhMultiplos.label = Múltiplos +busquedaParamAcumulacionMasivoController.lhCosto.label = Costo por Puntos +busquedaParamAcumulacionMasivoController.lhFecIni.label = Fecha Inicio +busquedaParamAcumulacionMasivoController.lhFecFim.label = Fecha Final +busquedaParamCompraPuntoController.btnPesquisa.label = Busqueda + +#Senda Amigo - editar ParamCompraPuntoController +editarParamCompraPuntoController.window.title = Configuración para Compra de puntos +editarParamCompraPuntoController.btnFechar.MSG.SuscbrirOK = Configuración para Compra registrada con éxito. +editarParamCompraPuntoController.btnFechar.MSG.Deseja.Borrar = Configuración para Compra ¿Desea borrar? +editarParamCompraPuntoController.btnFechar.MSG.BorrarOK = Configuración para Compra eliminada con éxito. +editarParamCompraPuntoController.lhCantidad.label = Cantidad (múltiplos) +editarParamCompraPuntoController.lhCosto.label = Costo por puntos +editarParamCompraPuntoController.lhIni.label = Fecha Inicio +editarParamCompraPuntoController.lhFim.label = Fecha Final +editarParamCompraPuntoController.MSG.suscribirOK = Configuración para Compra Registrado con Éxito. +editarParamCompraPuntoController.MSG.borrarPergunta = ¿Desea Eliminar Configuración para Compra? +editarParamCompraPuntoController.MSG.borrarOK = Configuración para Compra Eliminado +editarParamCompraPuntoController.MSG.busquedaPeriodo= Fecha de Inicio Posterior a la Fecha Final. + +# Cambio de Vigencias +cambioVigenciaController.window.title = Mudança de Vigência +cambioVigenciaController.btnFechar.tooltiptext = Fechar +cambioVigenciaController.Vigencia = Vigência +cambioVigenciaController.NovaVigencia = Nova Vigência +cambioVigenciaController.btnCambiarVigencia.tooltiptext = Mudar Vigência +cambioVigenciaController.MSGCambiarSucesso = Alterado vigência da(s) tarifa(s) com sucesso. +cambioVigenciaController.MSGCambiarVigencias = Confirma alteração da vigência? +cambioVigenciaController.NovaVigencia = Nueva Vigencia +cambioVigenciaController.btnCambiarVigencia.label = Mover Tarifas de Vigencia + +# Modificacion Masiva Tarifa +modificacionMasivaTarifasController.window.title = Modificação Massiva de Tarifas +modificacionMasivaTarifasController.porcentagem.label = % (0-100) +modificacionMasivaTarifasController.MSGAplicar = Aplicar modificação? +modificacionMasivaTarifasController.MSGAplicadoSucesso = Modificação aplicada com éxito. Aguarde arquivo de resultados. +modificacionMasivaTarifasController.radIncremento = Incremento +modificacionMasivaTarifasController.radDecremento = Decremento +modificacionMasivaTarifasController.tipoModificacion = Tipo Modificação +modificacionMasivaTarifasController.btnUpLoadExcel.tooltiptext = Importar Excel autorizado. +modificacionMasivaTarifasController.btnUpLoadExcel.label = Importar Excel autorizado +modificacionMasivaTarifasController.btnGerarExcel.label = Generar Excel con simulación +modificacionMasivaTarifasController.btnGerarExcel.tooltiptext = Generar Excel con simulación. +modificacionMasivaTarifasController.MSG.SemVigencia = Seleccione una vigencia. +modificacionMasivaTarifasController.MSG.RegistroSalvos = registro(s) procesado(s) com exito. +modificacionMasivaTarifasUploadController.MSG.pergunta = Selecione a vigência que será aplicada a modificação: +modificacionMasivaTarifasUploadController.MSG.radioUno = Vigência selecionada: {0} +modificacionMasivaTarifasUploadController.MSG.radioDos = Outra vigência: +modificacionMasivaTarifasUploadController.MSG.salvar = Aplicar Alterações +modificacionMasivaTarifasUploadController.MSG.excel = Erro ao importar arquivo Excel, certifique-se que este seja um arquivo válido. + +#Geracion de Corrida +geracionCorridaController.window.title = Geración de Corridas +geracionCorridaController.lhGerar.label = Generar Corridas +geracionCorridaController.MSG.gerarPergunta = Deseja gerar corridas até o dia {0}? +geracionCorridaController.Data = Data +geracionCorridaController.MSG.ok = Corridas geradas com sucesso. +geracionCorridaController.MSG.ForaVigencia = Fora vigencia esquema operacional. +geracionCorridaController.MSG.qtdDias = Valor inválido na configuração geral ({0}). + +#Pricing - busquedaPricingController +busquedaPricingController.window.title = Configuración de Pricing +busquedaPricingController.lhEmpresa.label = Empresa +busquedaPricingController.btnPesquisa.label = Busqueda + +# Busqueda de Corrida +editarPricingCorridaController.lbFecInicio.value = Fecha Inicio +editarPricingCorridaController.lbFecFinal.value = Fecha Fin +editarPricingCorridaController.labelOrigen.value = Origen +editarPricingCorridaController.labelDestino.value = Destino +editarPricingCorridaController.lhId.label = ID +editarPricingCorridaController.feccorrida.label = Fecha +editarPricingCorridaController.fechorsalida.label = Hora Salida +editarPricingCorridaController.claseServicio.label = Clase Servicio +editarPricingCorridaController.marca.label = Marca +editarPricingCorridaController.btnPesquisa.label = Búsqueda + +#Pricing - busquedaPricingController +editarPricingController.window.title = Configuración de Pricing +editarPricingController.windowVigencia.title = Vigencia +editarPricingController.windowImporte.title = Importe +editarPricingController.windowMarca.title = Marcas +editarPricingController.windowClase.title = Clase +editarPricingController.windowPuntoVenta.title = Punto venta +editarPricingController.windowTipoPtoVta.title = Canal venta +editarPricingController.windowCategoria.title = Tipo pasajero +editarPricingController.windowRuta.title = Ruta +editarPricingController.windowMercado.title = Mercado +editarPricingController.windowDia.title = Dia de la semana +editarPricingController.windowCorrida.title = Corrida +editarPricingController.windowOcupacion.title = Ocupacion +editarPricingController.windowAsiento.title = Asiento +editarPricingController.windowAnticipacion.title = Anticipación +editarPricingController.windowTipoServicio.title = Tipo servicio +editarPricingController.btnApagar.tooltiptext = Borrar +editarPricingController.btnSalvar.tooltiptext = Guardar +editarPricingController.btnFechar.tooltiptext = Cerrar +editarPricingController.tabGen.label = General +editarPricingController.tabApl.label = Aplicación +editarPricingController.tabCor.label = Corridas +editarPricingController.tabAsi.label = Asientos +editarPricingController.tabOcu.label = Ocupación +editarPricingController.tabAnti.label = Anticipación +editarPricingController.tabTipo.label = Tipo servicio +editarPricingController.lhEmpresa.label = Empresa +editarPricingController.lhCantidad.label = Cantidad asientos por corrida +editarPricingController.lhPorcSen.label = Porcentaje sencillo +editarPricingController.lhPorcRed.label = Porcentaje viaje redondo +editarPricingController.lhCantDias.label = Dias de antecipação +editarPricingController.trans.label = Transferible +editarPricingController.cance.label = Cancelable +editarPricingController.reser.label = Reservable +editarPricingController.si.label = Sí +editarPricingController.no.label = No +editarPricingController.lbVig.label = Vigencias +editarPricingController.lbImp = Importe +editarPricingController.lblDescuento.value = Tipo Descuento +editarPricingController.vigencia.value = Vigencias +editarPricingController.vigInicioViaje.value = Inicio viaje +editarPricingController.vigFinViaje.value = Fin viaje +editarPricingController.vigHoraInicioViaje.value = Fecha inicio viaje +editarPricingController.vigHoraFinViaje.value = Fecha fin viaje +editarPricingController.vigInicioVenta.value = Inicio venta +editarPricingController.vigFinVenta.value = Fin venta +editarPricingController.importe.value = Importe +editarPricingController.impImp.value = Importe +editarPricingController.impMon.value = Moneda +editarPricingController.btnModificar.value = Modificar +editarPricingController.btnNovoImporte.tooltiptext = Novo importe +editarPricingController.btnApagarImporte.tooltiptext = Borrar importe +editarPricingController.btnNovoVigencia.tooltiptext = Nova vigencia +editarPricingController.btnApagarVigencia.tooltiptext = Borrar vigencia +editarPricingController.MSG.suscribirOK = Configuración de pricing se registró exitosamente. +editarPricingController.MSG.borrarPergunta = ¿Desea eliminar configuración de pricing? +editarPricingController.MSG.borrarOK = Configuración de pricing eliminado +editarPricingController.MSG.fechaViaje = Fecha inicio de viaje posterior a la fecha final. +editarPricingController.MSG.fechaVenta = Fecha inicio de venta posterior a la fecha final. +editarPricingController.MSG.selectItem = Selecciona un Item. +editarPricingController.MSG.borrarPerguntaVigencia = ¿Desea eliminar vigencia? +editarPricingController.MSG.borrarPerguntaImporte = ¿Desea eliminar importe? +editarPricingController.MSG.borrarPerguntaMarca = ¿Desea eliminar marca? +editarPricingController.MSG.borrarPerguntaClase = ¿Desea eliminar clase? +editarPricingController.MSG.borrarPerguntaPuntoVenta = ¿Desea eliminar punto? +editarPricingController.MSG.borrarPerguntaRuta = ¿Desea eliminar ruta? +editarPricingController.MSG.borrarPerguntaMercado = ¿Desea eliminar mercado? +editarPricingController.MSG.borrarPerguntaCategoria = ¿Desea eliminar tipo pasajero? +editarPricingController.MSG.borrarPerguntaTipoPtoVta = ¿Desea eliminar canal de venta? +editarPricingController.MSG.borrarPerguntaDia = ¿Desea eliminar día de la semana y horario? +editarPricingController.MSG.borrarPerguntaCorrida = ¿Desea eliminar corrida? +editarPricingController.MSG.borrarPerguntaOcupacion = ¿Desea eliminar ocupacion? +editarPricingController.MSG.borrarPerguntaAsiento = ¿Desea eliminar asiento? +editarPricingController.MSG.categoriaExiste = Tipo pasajero en el Registro. +editarPricingController.msgSencillo.title = Porcentagem simples maior do que permitido +editarPricingController.msgRedondo.title = Porcentagem viagem rodada maior do que permitido +editarPricingController.MSG.rutaExiste = Ruta en el Registro. +editarPricingController.MSG.mercadoExiste = Mercado en el Registro. +editarPricingController.MSG.tipoPuntoExiste = Canal venta en el Registro. +editarPricingController.MSG.claseExiste = Clase en el Registro. +editarPricingController.MSG.corridaExiste = Corrida en el Registro. +editarPricingController.MSG.puntoVentaExiste = Punto venta en el Registro. +editarPricingController.MSG.asientoExiste = Asiento en el Registro. +editarPricingController.MSG.corrida = Corrida inexistente. +editarPricingController.MSG.datas = Hora de inicio posterior a la hora final. +editarPricingController.MSG.tipoPtoVtaVazio = Necesita informar un canal de venta en la pestaña de Aplicación +editarPricingController.MSG.categoriaVazio = Necesita informar un tipo pasajero en la pestaña de Aplicación +editarPricingController.MSG.existeMoneda = Moeda já existe. +editarPricingController.moneda.value = Moneda +editarPricingController.marca.value = Marca +editarPricingController.clase.value = Tipo de servicio +editarPricingController.punto.value = Punto de venta +editarPricingController.ptovta.value = Canal de venta +editarPricingController.ruta.value = Ruta +editarPricingController.mercado.value = Mercado +editarPricingController.categoria.value = Tipo pasajero +editarPricingController.mercadoOrigen.value = Origen +editarPricingController.mercadoDestino.value = Destino +editarPricingController.MSG.mercadoIguais = Igualdad de Origen y de Destino. +editarPricingController.porDia.value = Por día de la semana y horario +editarPricingController.porCorrida.value = Por corrida +editarPricingController.lbDias.value = Días de la Semana +editarPricingController.lbLunM.value = Lun +editarPricingController.lbMarM.value = Mar +editarPricingController.lbMieM.value = Mie +editarPricingController.lbJueM.value = Jue +editarPricingController.lbVieM.value = Vie +editarPricingController.lbSabM.value = Sab +editarPricingController.lbDomM.value = Dom +editarPricingController.hIni.value = Horario Inicial +editarPricingController.hFim.value = Horario Final +editarPricingController.corridaId.value = Corrida ID +editarPricingController.corridaHora.value = Hora Corrida +editarPricingController.asiento.value = Asiento +editarPricingController.nombAsiento.value = Nome Asiento +editarPricingController.ocupacion.value = Ocupacion +editarPricingController.porcentaje.value = Porcentaje % +editarPricingController.ocupacionMin.value = Ocupación Minima +editarPricingController.ocupacionMax.value = Ocupación Maxima +editarPricingController.ocupacionPorcentaje.value = Ocupacion minima ou maxima maior que 100% +editarPricingController.ocupacionErrada.value = Ocupacion minima maior que ocupacion maxima. +editarPricingController.ocupacionErrada = Ocupación se traslapa. + +# Busqueda Sistema +busquedaSistemaController.window.title = Busca de Sistema +busquedaSistemaController.btnRefresh.tooltiptext = Atualizar +busquedaSistemaController.btnNovo.tooltiptext = Novo Sistema +busquedaSistemaController.btnCerrar.tooltiptext = Fechar +busquedaSistemaController.btnPesquisa.label = Busca +busquedaSistemaController.lhId.label = ID +busquedaSistemaController.lhDesc.label = Sistema + +# Editar Sistema +editarSistemaController.window.title = Sistema +editarSistemaController.lbNome.value = Sistema +editarSistemaController.MSG.suscribirOK = Sistema registrado. +editarSistemaController.MSG.borrarPergunta = Deseja eliminar Sistema? +editarSistemaController.MSG.borrarOK = Sistema eliminado. +editarSistemaController.btnFechar.tooltiptext = Fechar +editarSistemaController.btnApagar.tooltiptext = Eliminar sistema +editarSistemaController.btnSalvar.tooltiptext = Salvar Sistema + +# Busqueda Menu +busquedaMenuController.window.title = Busca de Menu +busquedaMenuController.btnPesquisa.label = Buscar +busquedaMenuController.btnRefresh.tooltiptext = Atualizar +busquedaMenuController.btnNovo.tooltiptext = Novo Menu +busquedaMenuController.btnCerrar.tooltiptext = Fechar +busquedaMenuController.lhId.label = ID +busquedaMenuController.lhNombFuncion.label = Nomme Menu +busquedaMenuController.lhDescruta.label = Descrição Ruta +busquedaMenuController.lhSistema.label = Sistema + +# Editar Menu +editarMenuController.window.title = Menu +editarMenuController.MSG.suscribirOK = Menu registrado. +editarMenuController.MSG.borrarPergunta = Deseja eliminar menu? +editarMenuController.MSG.borrarOK = Menu eliminado. +editarMenuController.btnApagar.tooltiptext = Eliminar menu +editarMenuController.btnSalvar.tooltiptext = Registrar menu +editarMenuController.btnFechar.tooltiptext = Fechar + +# Busqueda Perfil +busquedaPerfilController.window.title = Busca de Perfil +busquedaPerfilController.btnRefresh.tooltiptext = Atualizar +busquedaPerfilController.btnNovo.tooltiptext = Novo perfil +busquedaPerfilController.btnCerrar.tooltiptext = Fechar +busquedaPerfilController.lhId.label = ID +busquedaPerfilController.lhDesc.label = Perfl +busquedaPerfilController.btnPesquisa.label = Busca + +# Editar Perfil +editarPerfilController.window.title = Perfil +editarPerfilController.btnApagar.tooltiptext = Eliminar perfil +editarPerfilController.btnSalvar.tooltiptext = Salvar perfil +editarPerfilController.btnFechar.tooltiptext = Fechar +editarPerfilController.lbNome.value = Perfil +editarPerfilController.lhPermiso.label = Menu +editarPerfilController.btnAddPermiso.tooltiptext = Adicionar permissão +editarPerfilController.btnBorrarPermiso.tooltiptext = Remover permissão +editarPerfilController.MSG.suscribirOK = Perfil salvo com sucesso. +editarPerfilController.MSG.borrarPergunta = Deseja excluir perfil? +editarPerfilController.MSG.borrarOK = Perfil excluido com sucesso. + +# Busqueda Usuario +busquedaUsuarioController.window.title = Busca de usuário +busquedaUsuarioController.btnRefresh.tooltiptext = Atualizar +busquedaUsuarioController.btnNovo.tooltiptext = Novo Usuário +busquedaUsuarioController.btnCerrar.tooltiptext = Fechar +busquedaUsuarioController.lhId.label = ID +busquedaUsuarioController.nombusuario.label = Nome usuario +busquedaUsuarioController.nombpaterno.label = Nome paterno +busquedaUsuarioController.nombmaterno.label = Nome materno +busquedaUsuarioController.perfil.label = Perfil +busquedaUsuarioController.btnPesquisa.label = Busca + +# Editar Usuario +editarUsuarioController.window.title = Nome +editarUsuarioController.tabel.ubicacion = Ubicacion +editarUsuarioController.MSG.suscribirOK = Usuario registrado com exito. +editarUsuarioController.MSG.borrarPergunta = ¿Desea eliminar este usuario? +editarUsuarioController.MSG.borrarOK = Usuario eliminado con éxito. +editarUsuarioController.senha.label = Contraseña +editarUsuarioController.confirmarsenha.label = Confirmar contraseña +editarUsuarioController.MSG.configmSenha = Por favor, confirmar la contraseña. +editarUsuarioController.btnAdicionarUbicacion.tooltiptext = Agregar ubicacion +editarUsuarioController.btnRemoverUbicacion.tooltiptext = Borrar ubicacion +editarUsuarioController.lhParada.label = Parada +editarUsuarioController.lhPuntoVenta.label = Punto de venta +busquedaUsuarioController.CveUsuario.label = Nome de usuario + +#CyberViaje - busquedaProductoServicioController +busquedaProductoServicioController.window.title = Configuración de servicio producto +busquedaProductoServicioController.lhNome.label = Descripcíon +busquedaProductoServicioController.lhServ.label = Servicio y/o Producto +busquedaProductoServicioController.lhTipo.label = Tipo +busquedaProductoServicioController.lhPrecio.label = Precio +busquedaProductoServicioController.btnPesquisa.label = Busqueda + +#CyberViaje - Editar +editarProductoServicioController.window.title = Configuración de servicio producto +editarProductoServicioController.windowProdClaseServicio.title = Producto Clase de Servicio +editarProductoServicioController.windowProdFormaPago.title = Producto Forma de Pago +editarProductoServicioController.windowProdMarca.title = Producto Marca +editarProductoServicioController.windowProdMercado.title = Producto Mercado +editarProductoServicioController.windowProdPuntoVenta.title = Producto Punto de Venta +editarProductoServicioController.windowProdRuta.title = Producto Ruta +editarProductoServicioController.windowProdTipoptovta.title = Producto Tipo Ponto de Venta +editarProductoServicioController.windowProdVigencia.title = Producto Vigencia +editarProductoServicioController.desc.title = Descripción +editarProductoServicioController.precio.title = Precio +editarProductoServicioController.Tipo.label = Tipo +editarProductoServicioController.Servicio.label = Servicio +editarProductoServicioController.Produto.label = Producto +editarProductoServicioController.MSG.fechaViaje = Fecha inicio posterior a la fecha final. +editarProductoServicioController.MSG.suscribirOK = Configuración de servicio producto registrado exitosamente. +editarProductoServicioController.MSG.borrarPergunta = ¿Desea eliminar esta configuración de servicio producto? +editarProductoServicioController.MSG.borrarOK = Configuración de servicio producto eliminado con éxito. +editarProductoServicioController.btnApagar.tooltiptext = Borrar configuración de servicio producto +editarProductoServicioController.btnSalvar.tooltiptext = Registrar configuración de servicio producto +editarProductoServicioController.btnFechar.tooltiptext = Cerrar +editarProductoServicioController.btnModificar.value = Modificar +editarProductoServicioController.MSG.selectItem = Seleccione un item. +editarProductoServicioController.prodClaseServicio.value = Producto Clase de Servicio +editarProductoServicioController.btnNovoProdClaseServicio.tooltiptext = Nuevo producto clase de servicio. +editarProductoServicioController.btnApagarProdClaseServicio.tooltiptext = Borrar producto clase de servicio. +editarProductoServicioController.prodFormaPago.value = Producto Forma de Pago +editarProductoServicioController.btnNovoProdFormaPago.tooltiptext = Nuevo producto forma de pago. +editarProductoServicioController.btnApagarProdFormaPago.tooltiptext = Borrar producto forma de pago. +editarProductoServicioController.prodMarca.value = Producto Marca. +editarProductoServicioController.btnNovoProdMarca.tooltiptext = Nuevo producto marca. +editarProductoServicioController.btnApagarProdMarca.tooltiptext = Borrar producto marca. +editarProductoServicioController.prodMercado.value = Producto Mercado +editarProductoServicioController.btnNovoProdMercado.tooltiptext = Nuevo producto mercado +editarProductoServicioController.btnApagarProdMercado.tooltiptext = Borrar producto mercado. +editarProductoServicioController.prodPuntoVenta.value = Producto Punto de Venta +editarProductoServicioController.btnNovoProdPuntoVenta.tooltiptext = Nuevo producto punto de venta. +editarProductoServicioController.btnApagarProdPuntoVenta.tooltiptext = Borrar producto punto de venta. +editarProductoServicioController.prodRuta.value = Producto Ruta +editarProductoServicioController.btnNovoProdRuta.tooltiptext = Nuevo producto ruta. +editarProductoServicioController.btnApagarProdRuta.tooltiptext = Borrar producto ruta. +editarProductoServicioController.prodTipoptovta.value = Producto Tipo Ponto de Venta +editarProductoServicioController.btnNovoTipoptovta.tooltiptext = Nuevo producto tipo ponto de venta. +editarProductoServicioController.btnApagarTipoptovta.tooltiptext = Borrar producto tipo ponto de venta. +editarProductoServicioController.prodVigencia.value = Producto Vigencia +editarProductoServicioController.btnNovoVigencia.tooltiptext = Nuevo producto vigencia. +editarProductoServicioController.btnApagarVigencia.tooltiptext = Borrar producto vigencia. + +# Producto Clase de Servicio +editarProdClaseServicioController.winEditarProdClaseServicioController.title = Producto Clase de Servicio +editarProdClaseServicioController.btnSalvar.tooltiptext = Registrar producto clase de servicio. +editarProdClaseServicioController.btnFechar.tooltiptext = Cerrar. +editarProdClaseServicioController.ClaseServicio.value = Clase de servicio +editarProdClaseServicioController.MSG.borrarPergunta = ¿Desea borrar este producto clase de servicio? +editarProdClaseServicioController.MSG.borrarSucesso = Producto clase de servicio eliminado con exito. + +# Producto Forma de Pago +editarProdFormaPagoController.winEditarProdFormaPago.title = Producto Forma de Pago +editarProdFormaPagoController.btnSalvar.tooltiptext = Registrar producto forma de pago. +editarProdFormaPagoController.btnFechar.tooltiptext = Cerrar. +editarProdFormaPagoController.FormaPago.value = Forma de pago +editarProdFormaPagoController.MSG.borrarPergunta = ¿Desea borrar este producto forma de pago? +editarProdFormaPagoController.MSG.borrarSucesso = Producto forma de pago eliminado con exito. + +# Producto Marca +editarProdMarcaController.winEditarProdMarca.title = Producto Marca +editarProdMarcaController.btnSalvar.tooltiptext = Registrar producto marca. +editarProdMarcaController.btnFechar.tooltiptext = Cerrar +editarProdMarcaController.ProdMarca.value = Producto marca +editarProdMarcaController.MSG.borrarPergunta = ¿Desea borrar este producto marca? +editarProdMarcaController.MSG.borrarSucesso = Producto marca eliminado con exito. + +# Producto Mercado +editarProdMercadoController.winEditarProdMercado.title = Producto Mercado +editarProdMercadoController.btnSalvar.tooltiptext = Registrar producto mercado. +editarProdMercadoController.btnFechar.tooltiptext = Cerrar. +editarProdMercadoController.Origem.value = Origem +editarProdMercadoController.Destino.value = Destino +editarProdMercadoController.MSG.borrarPergunta = ¿Desea borrar este producto mercado? +editarProdMercadoController.MSG.borrarSucesso = Producto mercado eliminado con exito. + +# Producto Punto de Venta +editarProdPuntoVentaController.winEditarProdPuntoVenta.title = Producto Punto de Venta +editarProdPuntoVentaController.btnSalvar.tooltiptext = Registrar producto punto de venta. +editarProdPuntoVentaController.btnFechar.tooltiptext = Cerrar. +editarProdPuntoVentaController.PuntoVenta.value = Punto de venta +editarProdPuntoVentaController.MSG.borrarPergunta = ¿Desea borrar este producto punto de venta? +editarProdPuntoVentaController.MSG.borrarSucesso = Producto punto de venta eliminado con exito. + +# Producto Ruta +editarProdRutaController.winEditarProdRuta.title = Producto Ruta +editarProdRutaController.btnSalvar.tooltiptext = Registrar producto ruta. +editarProdRutaController.btnFechar.tooltiptext = Cerrar. +editarProdRutaController.Ruta.value = Ruta +editarProdRutaController.MSG.borrarPergunta = ¿Desea borrar este producto ruta? +editarProdRutaController.MSG.borrarSucesso = Producto ruta eliminado con exito. + +# Producto Tipo Punto de Venta +editarProdTipoptovtaController.winEditarProdTipoPuntoVenta.title = Producto Tipo Ponto de Venta +editarProdTipoptovtaController.btnSalvar.tooltiptext = Registrar producto tipo ponto de venta. +editarProdTipoptovtaController.btnFechar.tooltiptext = Cerrar. +editarProdTipoptovtaController.TipoPuntoVenta.value = Canal de venta +editarProdTipoptovtaController.MSG.borrarPergunta = ¿Desea borrar este producto canal de venta? +editarProdTipoptovtaController.MSG.borrarSucesso = Producto canal de venta eliminado con exito. + +# Producto Vigencia +editarProdVigenciaController.winEditarProdVigencia.title = Producto Vigencia +editarProdVigenciaController.btnSalvar.tooltiptext = Registrar producto vigencia. +editarProdVigenciaController.btnFechar.tooltiptext = Cerrar. +editarProdVigenciaController.lbFecInicio.value = Inicio +editarProdVigenciaController.lbFecFinal.value = Fin +editarProdVigenciaController.MSG.borrarPergunta = ¿Desea borrar este producto vigencia? +editarProdVigenciaController.MSG.borrarSucesso = Producto vigencia eliminado con exito. + + +#Pantalla Edita Tipo Cortesias con Descuento + +editarTipoCortesiaDController.window.title = Tipos de Cortesía con Descuento +editarTipoCortesiaDController.btnApagar.tooltiptext = Borrar +editarTipoCortesiaDController.btnSalvar.tooltiptext = Guardar +editarTipoCortesiaDController.btnFechar.tooltiptext = Cerrar +editarTipoCortesiaDController.MSG.suscribirOK = Tipo de cortesia con descuento registrado con èxito. +editarTipoCortesiaDController.MSG.BorrarPergunta = ¿Desea eliminar tipo de cortesia con descuento? +editarTipoCortesiaDController.MSG.BorrarOK = Tipo de cortesia con descuento eliminado. +editarTipoCortesiaDController.lbTipoC.value = Tipo Cortesia +editarTipoCortesiaDController.lbPdesc.value = Porcentaje Descuento +editarTipoCortesiaDController.MSG.Porcentaje = Porcentaje deve ser inferior a 100. + +# Busqueda Tipo Parada +busquedaTipoParadaController.window.title = Tipo Parada +busquedaTipoParadaController.btnRefresh.tooltiptext = Atualizar +busquedaTipoParadaController.btnNovo.tooltiptext = Novo Tipo Parada +busquedaTipoParadaController.btnCerrar.tooltiptext = Fechar +busquedaTipoParadaController.txtNombre.label = Tipo Parada +busquedaTipoParadaController.btnPesquisa.label = Atualizar +busquedaTipoParadaController.lhId.label = ID +busquedaTipoParadaController.lhDesc.label = Tipo Parada + +# Editar Tipo Parada +editarTipoParadaController.window.title = Tipo Parada +editarTipoParadaController.btnApagar.tooltiptext = Apagar Tipo Parada +editarTipoParadaController.btnSalvar.tooltiptext = Salvar Tipo Parada +editarTipoParadaController.btnFechar.tooltiptext = Fechar +editarTipoParadaController.lhDesc.label = Tipo Parada +editarTipoParadaController.MSG.suscribirOK = Registrou Tipo Parada com exito. +editarTipoParadaController.MSG.borrarPergunta = Apagar Tipo Parada? +editarTipoParadaController.MSG.borrarOK = Tipo Parada removida com exito. + +# Busqueda Autobus +busquedaAutobusController.window.title = Busqueda Autobus +busquedaAutobusController.btnRefresh.tooltiptext = Atualizar +busquedaAutobusController.btnNovo.tooltiptext = Novo Autobus +busquedaAutobusController.btnCerrar.tooltiptext = Cerrar +busquedaAutobusController.txtNome.label = Autobus +busquedaAutobusController.btnPesquisa.label = Atualizar +busquedaAutobusController.lhNome.label = Autobus +busquedaAutobusController.lhID.label = ID +busquedaAutobusController.lhDiagramaAutobus.label = Diagrama de Autobus +busquedaAutobusController.diagramaautobus.label = Diagrama de Autobus + +# Editar Autobus +editarAutobusController.window.title = Autobus +editarAutobusController.MSG.suscribirOK = Autobus registrado com exito. +editarAutobusController.MSG.borrarPergunta = Borrar autobus? +editarAutobusController.MSG.borrarOK = Autobus eliminado com exito. +editarAutobusController.btnApagar.tooltiptext = Borrar autobus +editarAutobusController.btnSalvar.tooltiptext = Guardar autobus +editarAutobusController.btnFechar.tooltiptext = Cerrar +editarAutobusController.lbNome.value = Autobus +busquedaAutobusController.diagramaautobus.label = Diagrama Autobus + +# Busqueda Autorizacion +busquedaAutorizacionController.window.title = Buscar Autorização +busquedaAutorizacionController.btnRefresh.tooltiptext = Atualizar +busquedaAutorizacionController.btnNovo.tooltiptext = Nova Autorização +busquedaAutorizacionController.btnCerrar.tooltiptext = Fechar +busquedaAutorizacionController.lhNombAutorizacion.label = Nome +busquedaAutorizacionController.lhDescAutorizacion.label = Descrição +busquedaAutorizacionController.btnPesquisa.label = Atualizar +busquedaAutorizacionController.lhIDAutorizacion.label = ID + + +# Editar Autorizacion +editarAutorizacionController.window.title = Autorizacion +editarAutorizacionController.btnApagar.tooltiptext = Borrar Autorizacion +editarAutorizacionController.btnSalvar.tooltiptext = Guardar Autorizacion +editarAutorizacionController.btnFechar.tooltiptext = Cerrar +editarAutorizacionController.MSG.suscribirOK = Autorizacion registrado con exito. +editarAutorizacionController.MSG.borrarPergunta = Borrar Autorizacion? +editarAutorizacionController.MSG.borrarOK = Autorizacion eliminada con exito. + +# Editar Autorizacion Perfil +editarAutorizacionPerfilController.window.title = Autorização Perfil +editarAutorizacionPerfilController.btnApagar.tooltiptext = Apagar Autorização Perfil +editarAutorizacionPerfilController.btnSalvar.tooltiptext = Salvar Autorização Perfil +editarAutorizacionPerfilController.btnFechar.tooltiptext = Fechar +editarAutorizacionPerfilController.MSG.suscribirOK = Autorização Perfil salva com sucesso. +editarAutorizacionPerfilController.MSG.borrarPergunta = Apagar Autorização Perfil? +editarAutorizacionPerfilController.MSG.borrarOK = Autorização Perfil eliminada com sucesso. + +# Busqueda Estacion +busquedaEstacionPerfilController.window.title = Busca Estação +busquedaEstacionController.btnRefresh.tooltiptext = Atualizar +busquedaEstacionController.btnNovo.tooltiptext = Nova Estação +busquedaEstacionController.btnCerrar.tooltiptext = Fechar +busquedaEstacionController.lhDescEstacion.label = Desc Estação +busquedaEstacionController.ID.label = ID +busquedaEstacionController.lhDescMac.label = Desc Mac +busquedaEstacionController.lhNumCaja.label = Caja +busquedaEstacionController.lhPuntoVenta.label = Ponto Venda +busquedaEstacionController.btnPesquisa.label = Busca + +# Editar Estacion +editarEstacionController.window.title = Estação +editarEstacionController.btnApagar.tooltiptext = Apagar Estação +editarEstacionController.btnSalvar.tooltiptext = Salvar Estação +editarEstacionController.btnFechar.tooltiptext = Fechar +editarEstacionController.conexion = Conexão Bancaria +editarEstacionController.usuario = Usuario Bancario +editarEstacionController.IndTipo.1 = BANORTE +editarEstacionController.IndTipo.2 = MANUAL +editarEstacionController.IndTipo.3 = SANTANDER +editarEstacionController.pinPad = Pinpad con impresora propia +editarEstacionController.MSG.suscribirOK = Estação salva com sucesso. +editarEstacionController.MSG.borrarPergunta = Apagar Estação? +editarEstacionController.MSG.borrarOK = Estação eliminada com sucesso. + +#Busqueda Exception Redondo +busquedaExceptionRedondoController.window.title = Busca Exceção Arredondamento +busquedaExceptionRedondoController.btnRefresh.tooltiptext = Atualizar +busquedaExceptionRedondoController.btnNovo.tooltiptext = Nova Exceção Arredondamento +busquedaExceptionRedondoController.btnCerrar.tooltiptext = Fechar +busquedaExceptionRedondoController.lhIndtipo.label = Tipo +busquedaExceptionRedondoController.lhOrigem.label = Origem +busquedaExceptionRedondoController.lhDestino.label = Destino +busquedaExceptionRedondoController.btnPesquisa.label = Busca + +# Editar Excepcion Redondo +editarExceptionRedondoController.window.title = Exceção Arredondamento +editarExceptionRedondoController.btnApagar.tooltiptext = Excluir Exceção Arredondamento +editarExceptionRedondoController.btnSalvar.tooltiptext = Salvar Exceção Arredondamento +editarExceptionRedondoController.btnFechar.tooltiptext = Fechar +editarExceptionRedondoController.btnFechar.MSG.SuscbrirOK = Exceção Arredondamento registrada com exito. +editarExceptionRedondoController.btnFechar.MSG.Deseja.Borrar = Excluir Exceção Arredondamento? +editarExceptionRedondoController.btnFechar.MSG.BorrarOK = Exceção Arredondamento eliminada com exito. + +# Busqueda Redondeo +busquedaRedondeoController.window.title = Busca Arredondamento +busquedaRedondeoController.btnRefresh.tooltiptext = Atualizar +busquedaRedondeoController.btnNovo.tooltiptext = Novo Arredondamento +busquedaRedondeoController.btnCerrar.tooltiptext = Fechar +busquedaRedondeoController.lhvalorinicial.label = Valor Inicial +busquedaRedondeoController.lhvalorfinal.label = Valor Final +busquedaRedondeoController.lhvalorredondeo.label = Valor Arredondamento +busquedaRedondeoController.lhindaplicadescuento.label = Aplica Desconto +busquedaRedondeoController.lhindaplicapricing.label = Aplica Pricing +busquedaRedondeoController.btnPesquisa.label = Busca + +# Editar Redondeo +editarRedondeoController.window.title = Arredondamento +editarRedondeoController.MSG.SuscbrirOK = Arredondamento registrado com exito. +editarRedondeoController.MSG.Deseja.Borrar = Apagar Arredondamento? +editarRedondeoController.MSG.BorrarOK = Arredondamento eliminado com exito. +editarRedondeoController.btnApagar.tooltiptext = Apagar Arredondamento +editarRedondeoController.btnSalvar.tooltiptext = Salvar Arredondamento +editarRedondeoController.btnFechar.tooltiptext = Fechar + +# Busqueda Redondeo Marca +busquedaRedondeoMarcaController.window.title = Busca Arredondamento Marca +busquedaRedondeoMarcaController.btnRefresh.tooltiptext = Atualizar +busquedaRedondeoMarcaController.btnNovo.tooltiptext = Novo Arredondamento Marca +busquedaRedondeoMarcaController.btnCerrar.tooltiptext = Fechar +busquedaRedondeoMarcaController.lhMarca.label = Marca +busquedaRedondeoMarcaController.btnPesquisa.label = Busca + +# Editar Redondeo Marca +editarRedondeoMarcaController.window.title = Arredondamento Marca +editarRedondeoMarcaController.MSG.SuscbrirOK = Arredondamento Marca registrado com exito. +editarRedondeoMarcaController.MSG.Deseja.Borrar = Apagar Arredondamento Marca? +editarRedondeoMarcaController.MSG.BorrarOK = Arredondamento Marca eleiminado com exito. +editarRedondeoMarcaController.btnApagar.tooltiptext = Apagar Arredondamento Marca +editarRedondeoMarcaController.btnSalvar.tooltiptext = Salvar Arredondamento Marca +editarRedondeoMarcaController.btnFechar.tooltiptext = Fechar + +# Busqueda Comisionista Externo +busquedaComisionistaExternoController.window.title = Busca Comissionista Externo +busquedaComisionistaExternoController.btnRefresh.tooltiptext = Atualizar +busquedaComisionistaExternoController.btnNovo.tooltiptext = Novo Comissionista Externo +busquedaComisionistaExternoController.btnCerrar.tooltiptext = Fechar +busquedaComisionistaExternoController.desccomisionista.label = Descrição +busquedaComisionistaExternoController.ID.label = ID +busquedaComisionistaExternoController.btnPesquisa.label = Busca + +# Editar Comisionista Externo +editarComisionistaExternoController.window.title = Comissionista Externo +editarComisionistaExternoController.btnApagar.tooltiptext = Apagar Comissionista Externo +editarComisionistaExternoController.btnSalvar.tooltiptext = Salvar Comissionista Externo +editarComisionistaExternoController.btnFechar.tooltiptext = Fechar +editarComisionistaExternoController.MSG.suscribirOK = Comissionista Externo se registró exitosamente. +editarComisionistaExternoController.MSG.borrarPergunta = Apagar Comisionista Externo? +editarComisionistaExternoController.MSG.borrarOK = Comissionista Externo se elimino exitosamente. + +# Busqueda Convenio +busquedaConvenioController.window.title = Convênio +busquedaConvenioController.btnRefresh.tooltiptext = Atualizar +busquedaConvenioController.btnNovo.tooltiptext = Novo Convênio +busquedaConvenioController.btnCerrar.tooltiptext = Fechar +busquedaConvenioController.btnPesquisa.label = Busca +busquedaConvenioController.descconvenio.label = Descrição +busquedaConvenioController.descconvenioID.label = ID +busquedaConvenioController.cveconvenio.label = Chave +busquedaConvenioController.validafolio.label = Valida Folio +busquedaConvenioController.imprimeprecio.label = Impressão + +editarConvenioController.window.title = Convênio +editarConvenioController.btnApagar.tooltiptext = Apagar Convênio +editarConvenioController.btnSalvar.tooltiptext = Salvar Convênio +editarConvenioController.btnFechar.tooltiptext = Fechar +editarConvenioController.lbDescConvenio.value = Convênio +editarConvenioController.lbCveConvenio.value = Chave Convênio +editarConvenioController.lbValidaFolio.value = Valida Folio +editarConvenioController.PrecioTotal.value = Preçoo Total +editarConvenioController.PrecioDescuento.value = Preço - Deconto acordado +editarConvenioController.Descuento.value = Deconto acordado +editarConvenioController.btnAddConvenioDet.tooltiptext = Adicionar Detalhe Convênio +editarConvenioController.btnBorrarConvenioDet.tooltiptext = Apagar Detalhe Convênio +editarConvenioController.lbPorcdescuento.value = Porcentagem +editarConvenioController.lbNumfolioinicio.value = Folio Inicial +editarConvenioController.lbNumfoliofinal.value = Folio Final +editarConvenioController.MSG.suscribirOK = Convênio registrado com exito. +editarConvenioController.MSG.borrarPergunta = Apagar Convênio? +editarConvenioController.MSG.borrarOK = Convênio eliminado com exito. +editarConvenioController.Impression.value = Impressão do preço no boleto + +# Busqueda Alerta CTRL +busquedaAlertaCtrlController.window.title = Busca Configuração de Alertas +busquedaAlertaCtrlController.btnRefresh.tooltiptext = Atualizar +busquedaAlertaCtrlController.btnNovo.tooltiptext = Nova Configuração de Alertas +busquedaAlertaCtrlController.btnCerrar.tooltiptext = Fechar +busquedaAlertaCtrlController.ruta.label = Ruta +busquedaAlertaCtrlController.origem.label = Origem +busquedaAlertaCtrlController.destino.label = Destino +busquedaAlertaCtrlController.claseservicio.label = Classe Serviço +busquedaAlertaCtrlController.corrida.label = Corrida +busquedaAlertaCtrlController.btnPesquisa.label = Busca +busquedaAlertaCtrlController.porcalta.label = Porc. Alta +busquedaAlertaCtrlController.porcbaja.label = Porc. Baixa +busquedaAlertaCtrlController.tiempoalta.label = Tempo Alto +busquedaAlertaCtrlController.tiempobaja.label = Tempo Baixo +busquedaAlertaCtrlController.btnProcurarCorrida.label = Busca de Corrida +busquedaAlertaCtrlController.corridaId.label = ID Corrida +busquedaAlertaCtrlController.corridadata.label = Data Corrida +busquedaAlertaCtrlController.corridaHora.label = Hora Corrida + +# Editar Alerta CTRL +editarAlertaCtrlController.window.title = Configuração Alerta +editarAlertaCtrlController.btnApagar.tooltiptext = Apagar Configuração Alerta +editarAlertaCtrlController.btnSalvar.tooltiptext = Salvar Configuração Alerta +editarAlertaCtrlController.btnFechar.tooltiptext = Fechar +editarAlertaCtrlController.MSG.suscribirOK = Configuração Alerta registrado com exito. +editarAlertaCtrlController.MSG.borrarPergunta = Apagar Configuração Alerta? +editarAlertaCtrlController.MSG.borrarOK = Configuração Alerta excluído com exito. +editarAlertaCtrlController.MSG.seleccionar.corrida = Selecione uma corrida. + +# Busqueda Secretaria +busquedaSecretariaController.window.title = Secretaria +busquedaSecretariaController.btnRefresh.tooltiptext = Atualizar +busquedaSecretariaController.btnNovo.tooltiptext = Nova Secretaria +busquedaSecretariaController.btnCerrar.tooltiptext = Fechar +busquedaSecretariaController.DescSecretaria.label = Descrição +busquedaSecretariaController.SecretariaID.label = ID +busquedaSecretariaController.CveSecretaria.label = Chave Secretaria +busquedaSecretariaController.btnPesquisa.label = Busca +busquedaSecretariaController.validafolio.label = Valida Folio +busquedaSecretariaController.imprimeprecio.label = Impressão + +# Editar Secretaria +editarSecretariaController.window.title = Secretaria +editarSecretariaController.btnApagar.tooltiptext = Apagar Secretaria +editarSecretariaController.btnSalvar.tooltiptext = Salvar Secretaria +editarSecretariaController.btnFechar.tooltiptext = Fechar +editarSecretariaController.lbDescSecretaria.value = Secretaria +editarSecretariaController.lbCveSecretaria.value = Chave Secretaria +editarSecretariaController.lbValidaFolio.value = Valida Folio +editarSecretariaController.Impression.value = Impressão +editarSecretariaController.PrecioTotal.value = Preço total +editarSecretariaController.PrecioDescuento.value = Preço menos desconto por cobrar +editarSecretariaController.Descuento.value = Desconto por cobrar +editarSecretariaController.btnAddCuponSecretaria.tooltiptext = Adicionar Cupom Secretaria +editarSecretariaController.btnBorrarCuponSecretaria.tooltiptext = Apagar Cupom Secretaria +editarSecretariaController.lbPorcdescuento.value = Porcentagem Desconto +editarSecretariaController.lbNumfolioinicio.value = Folio Inicial +editarSecretariaController.lbNumfoliofinal.value = Folio Final +editarSecretariaController.MSG.suscribirOK = Secretaria registrada coc exito. +editarSecretariaController.MSG.borrarPergunta = Apagar Secretaria? +editarSecretariaController.MSG.borrarOK = Secretaria eliminada com exito. + +# Busqueda Articulo +busquedaArticuloController.window.title = Artigo +busquedaArticuloController.btnRefresh.tooltiptext = Atualização +busquedaArticuloController.btnNovo.tooltiptext = Novo Artigo +busquedaArticuloController.btnCerrar.tooltiptext = Fechar +busquedaArticuloController.txtNombre.label = Descrição +busquedaArticuloController.btnPesquisa.label = Busca +busquedaArticuloController.lhId.label = ID +busquedaArticuloController.lhDesc.label = Descrição + +# Editar Articulo +editarArticuloController.window.title = Artigo +editarArticuloController.btnApagar.tooltiptext = Apagar Artigo +editarArticuloController.btnSalvar.tooltiptext = Salvar Artigo +editarArticuloController.btnFechar.tooltiptext = Fechar +editarArticuloController.lhDesc.label = Descrição +editarArticuloController.MSG.suscribirOK = Artigo registrou com sucesso. +editarArticuloController.MSG.borrarPergunta = Apagar Artigo? +editarArticuloController.MSG.borrarOK = Artigo se elimino exitosamente. + +busquedaTipoCorteController.window.title = Tipo Corte +busquedaTipoCorteController.btnRefresh.tooltiptext = Atualizar +busquedaTipoCorteController.btnNovo.tooltiptext = Novo Tipo Corte +busquedaTipoCorteController.btnCerrar.tooltiptext = Fechar +busquedaTipoCorteController.txtNombre.label = Descrição +busquedaTipoCorteController.btnPesquisa.label = Busca +busquedaTipoCorteController.lhId.label = ID +busquedaTipoCorteController.lhDesc.label = Descrição + +# Editar Tipo Corte +editarTipoCorteController.window.title = Tipo Corte +editarTipoCorteController.btnApagar.tooltiptext = Pagar Tipo Corte +editarTipoCorteController.btnSalvar.tooltiptext = Salvar Tipo Corte +editarTipoCorteController.btnFechar.tooltiptext = Fechar +editarTipoCorteController.lhDesc.label = Descrição +editarTipoCorteController.MSG.suscribirOK = Tipo Corte se registró exitosamente. +editarTipoCorteController.MSG.borrarPergunta = Apagar Tipo Corte? +editarTipoCorteController.MSG.borrarOK = Tipo Corte se elemino exitosamente. + +# Busqueda Turno +busquedaTurnoController.window.title = Turno +busquedaTurnoController.btnRefresh.tooltiptext = Atualizar +busquedaTurnoController.btnNovo.tooltiptext = Novo Turno +busquedaTurnoController.btnCerrar.tooltiptext = Fechar +busquedaTurnoController.txtNombre.label = Descrição +busquedaTurnoController.btnPesquisa.label = busca +busquedaTurnoController.lhId.label = ID +busquedaTurnoController.lhDesc.label = Descrição + +# Editar Turno +editarTurnoController.window.title = Turno +editarTurnoController.btnApagar.tooltiptext = Apagar Turno +editarTurnoController.btnSalvar.tooltiptext = Salvar Turno +editarTurnoController.btnFechar.tooltiptext = Fechar +editarTurnoController.lhDesc.label = Descrição +editarTurnoController.MSG.suscribirOK = Turno se registró exitosamente. +editarTurnoController.MSG.borrarPergunta = Apagar Turno? +editarTurnoController.MSG.borrarOK = Turno se elimino exitosamente. + +# Busqueda Tipo Movimiento +busquedaTipoMovimientoController.window.title = Tipo Movimento +busquedaTipoMovimientoController.btnRefresh.tooltiptext = Atualizar +busquedaTipoMovimientoController.btnNovo.tooltiptext = Novo Tipo Movimento +busquedaTipoMovimientoController.btnCerrar.tooltiptext = Fechar +busquedaTipoMovimientoController.txtNombre.label = Descrição +busquedaTipoMovimientoController.lhId.label = ID +busquedaTipoMovimientoController.lhDesc.label = Descrição +busquedaTipoMovimientoController.btnPesquisa.label = Busca + +# Editar Tipo Movimiento +editarTipoMovimientoController.window.title = Tipo Movimento +editarTipoMovimientoController.btnApagar.tooltiptext = Apagar Tipo Movimento +editarTipoMovimientoController.btnSalvar.tooltiptext = Salvar Tipo Movimento +editarTipoMovimientoController.btnFechar.tooltiptext = Fechar +editarTipoMovimientoController.lhDesc.label = Descrição +editarTipoMovimientoController.MSG.suscribirOK = Tipo Movimento se registró exitosamente. +editarTipoMovimientoController.MSG.borrarPergunta = Apagar Tipo Movimento? +editarTipoMovimientoController.MSG.borrarOK = Tipo Movimento se elimino exitosamente. + +# Busqueda Tipo Ocupacion +busquedaTipoOcupacionController.window.title = Tipo Ocupação +busquedaTipoOcupacionController.btnRefresh.tooltiptext = Atualizar +busquedaTipoOcupacionController.btnNovo.tooltiptext = Novo Tipo Ocupação +busquedaTipoOcupacionController.btnCerrar.tooltiptext = Fechar +busquedaTipoOcupacionController.txtNombre.label = Descrição +busquedaTipoOcupacionController.txtCve.label = Chave +busquedaTipoOcupacionController.btnPesquisa.label = Busca +busquedaTipoOcupacionController.lhId.label = ID +busquedaTipoOcupacionController.lhDesc.label = Descrição +busquedaTipoOcupacionController.lhCVE.label = Chave + +# Editar Tipo Ocupacion +editarTipoOcupacionController.window.title = Tipo Ocupação +editarTipoOcupacionController.btnApagar.tooltiptext = Apagar Tipo Ocupação +editarTipoOcupacionController.btnSalvar.tooltiptext = Salvar Tipo Ocupação +editarTipoOcupacionController.btnFechar.tooltiptext = Fechar +editarTipoOcupacionController.lhDesc.label = Descrição +editarTipoOcupacionController.lhCVE.label = Chave +editarTipoOcupacionController.MSG.suscribirOK = Tipo Ocupação se registró exitosamente. +editarTipoOcupacionController.MSG.borrarPergunta = Apagar Tipo Ocupacion? +editarTipoOcupacionController.MSG.borrarOK = Tipo Ocupação se elimino exitosamente. + +# Busqueda Tipo Domicilio +busquedaTipoDomicilioController.window.title = Tipo Domicilio +busquedaTipoDomicilioController.btnRefresh.tooltiptext = Atualizar +busquedaTipoDomicilioController.btnNovo.tooltiptext = Novo Tipo Domicilio +busquedaTipoDomicilioController.btnCerrar.tooltiptext = Fechar +busquedaTipoDomicilioController.txtNombre.label = Descripção +busquedaTipoDomicilioController.txtCve.label = Chave +busquedaTipoDomicilioController.btnPesquisa.label = Busca +busquedaTipoDomicilioController.lhId.label = ID +busquedaTipoDomicilioController.lhDesc.label = Descripção +busquedaTipoDomicilioController.lhCVE.label = Chave + +editarTipoDomicilioController.window.title = Tipo Domicilio +editarTipoDomicilioController.btnApagar.tooltiptext = Apagar Tipo Domicilio +editarTipoDomicilioController.btnSalvar.tooltiptext = Salvar Tipo Domicilio +editarTipoDomicilioController.btnFechar.tooltiptext = Fechar +editarTipoDomicilioController.lhDesc.label = Descrição +editarTipoDomicilioController.lhCVE.label = Chave +editarTipoDomicilioController.MSG.suscribirOK = Tipo Domicilio se registró exitosamente. +editarTipoDomicilioController.MSG.borrarPergunta = Apagar Tipo Domicilio? +editarTipoDomicilioController.MSG.borrarOK = Tipo Domicilio se elimino exitosamente. + +# Busqueda Tipo Cambio Ciudad +busquedaTipoCambioCiudadController.window.title = Tipo Cambio Ciudad +busquedaTipoCambioCiudadController.btnRefresh.tooltiptext = Actualizar +busquedaTipoCambioCiudadController.btnNovo.tooltiptext = Nuevo Tipo Cambio Ciudad +busquedaTipoCambioCiudadController.btnCerrar.tooltiptext = Cerrar +busquedaTipoCambioCiudadController.Importecambio = Importe Cambio +busquedaTipoCambioCiudadController.FecaplicacionDe = Período Inicial +busquedaTipoCambioCiudadController.FecaplicacionAte = Período Final +busquedaTipoCambioCiudadController.Fecaplicacion = Período Aplicacion +busquedaTipoCambioCiudadController.MonedaOrigen = Moneda Origen +busquedaTipoCambioCiudadController.MonedaDestino = Moneda Destino +busquedaTipoCambioCiudadController.Ciudad = Ciudad +busquedaTipoCambioCiudadController.btnPesquisa.label = Búsqueda + +# Editar Tipo Cambio Ciudad +editarTipoCambioCiudadController.MSG.suscribirOK = Tipo Cambio Ciudad se registró exitosamente. +editarTipoCambioCiudadController.window.title = Tipo Cambio Ciudad +editarTipoCambioCiudadController.MSG.borrarPergunta = Borrar Tipo Cambio Ciudad? +editarTipoCambioCiudadController.MSG.borrarOK = Tipo Cambio Ciudad se elimino exitosamente. +editarTipoCambioCiudadController.btnApagar.tooltiptext = Borrar +editarTipoCambioCiudadController.btnSalvar.tooltiptext = Guardar +editarTipoCambioCiudadController.btnFechar.tooltiptext = Cerrar +editarTipoCambioCiudadController.FecaplicacionAte = Fecha Aplicacion +editarTipoCambioCiudadController.MonedaOrigen = Moneda Origen +editarTipoCambioCiudadController.MonedaDestino = Moneda Destino +editarTipoCambioCiudadController.Importecambio = Importe +editarTipoCambioCiudadController.btnAddCiudad.tooltiptext = Agregar Ciudad +editarTipoCambioCiudadController.btnBorrarCiudad.tooltiptext = Borrar Ciudad +editarTipoCambioCiudadController.Ciudad = Ciudad + +# Búsqueda Colonia +busquedaColoniaController.window.title = Colonia +busquedaColoniaController.btnRefresh.tooltiptext = Actualizar +busquedaColoniaController.btnNovo.tooltiptext = Nueva Colonia +busquedaColoniaController.btnCerrar.tooltiptext = Cierre +busquedaColoniaController.lhId.label = ID +busquedaColoniaController.txtNome.label = Colonia +busquedaColoniaController.btnPesquisa.label = Búsqueda +busquedaColoniaController.lhNome.label = Descripción +busquedaColoniaController.lhCodPostal.label = Cod Postal +busquedaColoniaController.lhCiudad.label = Ciudad + + +# Editar Colonia +editarColoniaController.window.title = Colonia +editarColoniaController.MSG.suscribirOK = Colonia se registró exitosamente. +editarColoniaController.MSG.borrarPergunta = ¿Desea eliminar esta Colonia? +editarColoniaController.MSG.borrarOK = Colonia se eliminó exitosamente. +editarColoniaController.btnApagar.tooltiptext = Eliminar Colonia +editarColoniaController.btnSalvar.tooltiptext = Guardar Colonia +editarColoniaController.btnFechar.tooltiptext = Cierre +editarColoniaController.lbNome.value = Colonia +editarColoniaController.lhCodPostal.label = Cod Postal +editarColoniaController.lhCiudad.label = Ciudad + + +# Muestra la Estado de la Búsqueda +busquedaEstadoController.window.title = Estado +busquedaEstadoController.btnRefresh.tooltiptext = Actualizar +busquedaEstadoController.btnNovo.tooltiptext = Nuevo Estado +busquedaEstadoController.btnCerrar.tooltiptext = Cerrar +busquedaEstadoController.btnPesquisa.label = Búsqueda +busquedaEstadoController.lhId.label = ID +busquedaEstadoController.lhDesc.label = Descripción +busquedaEstadoController.txtNombre.label = Estado + +# Pantalla Editar Estado +editarEstadoController.window.title = Editar Estado +editarEstadoController.btnApagar.tooltiptext = Eliminar +editarEstadoController.btnSalvar.tooltiptext = Guardar estado +editarEstadoController.btnFechar.tooltiptext = Cerrar +editarEstadoController.lbNome.value = Estado +editarEstadoController.MSG.suscribirOK = Estado se registró exitosamente. +editarEstadoController.MSG.borrarPergunta = ¿Desea eliminar esta estado? +editarEstadoController.MSG.borrarOK = Estado se elimino con exito. + + +# Busqueda Motivo cancelacion equivalencia +busquedamotivocancelacionEquivalenciaController.window.title = Búsqueda Motivo cancelacion equivalencia +busquedamotivocancelacionEquivalenciaController.btnRefresh.tooltiptext = Actualizar +busquedamotivocancelacionEquivalenciaController.btnNovo.tooltiptext = Nuevo Motivo cancelacion equivalencia +busquedamotivocancelacionEquivalenciaController.btnCerrar.tooltiptext = Cerrar +busquedamotivocancelacionEquivalenciaController.btnPesquisa.label = Búsqueda +busquedamotivocancelacionEquivalenciaController.lhId.label = ID +busquedamotivocancelacionEquivalenciaController.cmbComissionestaExterno.value = Comisionista Externo +busquedamotivocancelacionEquivalenciaController.cmbMotivoCancelacion.value = Motivo Cancelacion +busquedamotivocancelacionEquivalenciaController.lbEquivalencia.value = Equivalencia + +# Editar Motivo cancelacion equivalencia +editarmotivocancelacionEquivalenciaController.window.title = Motivo cancelacion equivalencia +editarmotivocancelacionEquivalenciaController.btnApagar.tooltiptext = Borrar Motivo cancelacion equivalencia +editarmotivocancelacionEquivalenciaController.btnSalvar.tooltiptext = Guardar Motivo cancelacion equivalencia +editarmotivocancelacionEquivalenciaController.btnFechar.tooltiptext = Cerrar +editarmotivocancelacionEquivalenciaController.cmbComissionestaExterno.value = Comisionista Externo +editarmotivocancelacionEquivalenciaController.cmbMotivoCancelacion.value = Motivo Cancelacion +editarmotivocancelacionEquivalenciaController.lbEquivalencia.value = Equivalencia +editarmotivocancelacionEquivalenciaController.MSG.suscribirOK = Motivo cancelacion equivalencia se registró exitosamente. +editarmotivocancelacionEquivalenciaController.MSG.borrarPergunta = ¿Desea borrar Motivo cancelacion equivalencia? +editarmotivocancelacionEquivalenciaController.MSG.borrarOK = Motivo cancelacion equivalencia se eliminó exitosamente. + +# INFORME PASAJERO POR SERVICIO +informePasajeroServicioController.window.title = Pasajero por Corrida +informePasajeroServicioController.btnFechar.tooltiptext = Cerrar +informePasajeroServicioController.cmbMarca.value = Marca +informePasajeroServicioController.cmbEmpresa.value = Empresa +informePasajeroServicioController.servicio.label = Corrida +informePasajeroServicioController.lbFecInicio.value = Fecha Inicio +informePasajeroServicioController.lbFecFinal.value = Fecha Fin + +# INFORME SERVICIO DIARIO +informeServicioDiarioController.window.title = Corrida Diario +informeServicioDiarioController.btnFechar.tooltiptext = Cerrar +informeServicioDiarioController.servicio.label = Corrida +informeServicioDiarioController.lbFecInicio.value = Fecha Inicio +informeServicioDiarioController.lbFecFinal.value = Fecha Fin + +# INFORME CATEGORIA VENTA +informeCategoriaVentaController.window.title = Categoria Venta +informeCategoriaVentaController.btnFechar.tooltiptext = Cerrar +informeCategoriaVentaController.labelOrigen.value = Origen +informeCategoriaVentaController.labelDestino.value = Destino +informeCategoriaVentaController.cmbEmpresa.value = Empresa +informeCategoriaVentaController.servicio.label = Corrida +informeCategoriaVentaController.lbFecInicio.value = Fecha Inicio +informeCategoriaVentaController.lbFecFinal.value = Fecha Fin + +# INFORME VENTAS PUNTO VENTA +informeVentasPuntoVentaController.btnFechar.tooltiptext = Cerrar +informeVentasPuntoVentaController.cmbEmpresa.value = Empresa +informeVentasPuntoVentaController.lbFecInicio.value = Fecha Inicio +informeVentasPuntoVentaController.lbFecFinal.value = Fecha Fin + +# Busqueda Compania Bancaria +busquedaCompaniaBancaria.window.title = Compania Bancaria +busquedaCompaniaBancaria.btnRefresh.tooltiptext = Actualizar +busquedaCompaniaBancaria.btnNovo.tooltiptext = Agregar +busquedaCompaniaBancaria.btnCerrar.tooltiptext = Cerrar +busquedaCompaniaBancaria.lhcvecompania.label = Clave compañia +busquedaCompaniaBancaria.lhcvesucursal.label = Clave sucursal +busquedaCompaniaBancaria.btnPesquisa.label = Búsqueda +busquedaCompaniaBancaria.lhcompaniabancariaId.label = ID + +# Editar Compania Bancaria +editarCompaniaBancariaController.window.title = Compañia Bancaria +editarCompaniaBancariaController.btnApagar.tooltiptext = Eliminar +editarCompaniaBancariaController.btnSalvar.tooltiptext = Guardar +editarCompaniaBancariaController.btnFechar.tooltiptext = Cerrar +editarCompaniaBancariaController.MSG.suscribirOK = Compania Bancaria se registró exitosamente. +editarCompaniaBancariaController.MSG.borrarPergunta = ¿Desea eliminar Compania Bancaria? +editarCompaniaBancariaController.MSG.borrarOK = Compania Bancaria se eliminó exitosamente. +editarCompaniaBancariaController.MSG.usu = Necesita informar un Usuario Bancario. +editarCompaniaBancariaController.MSG.mer = Necesita informar un Merchant Bancario. + +# Editar Merchant Bancario +editarMerchantBancarioController.window.title = Merchant Bacario +editarMerchantBancarioController.btnSalvar.tooltiptext = Guardar +editarMerchantBancarioController.btnFechar.tooltiptext = Cerrar +editarMerchantBancarioController.cvemerchant.label = Clave Merchant +editarMerchantBancarioController.descmerchant.label = Descripción Merchant + +# Editar Usuario bancario +editarUsuarioBancarioController.window.title = Usuario Bancario +editarUsuarioBancarioController.btnSalvar.tooltiptext = Guardar +editarUsuarioBancarioController.btnFechar.tooltiptext = Cerrar +editarUsuarioBancarioController.cveusuario.label = Clave Usuario +editarUsuarioBancarioController.password.label = Password + +# Busqueda Tarjeta Recaudacion +busquedaTarjetaRecaudacionController.window.title = Tarjeta Recaudación +busquedaTarjetaRecaudacionController.btnRefresh.tooltiptext = Actualizar +busquedaTarjetaRecaudacionController.btnNovo.tooltiptext = Agregar +busquedaTarjetaRecaudacionController.btnCerrar.tooltiptext = Cerrar +busquedaTarjetaRecaudacionController.claveConductor.label = Clave Conductor +busquedaTarjetaRecaudacionController.btnPesquisa.label = Búsqueda +busquedaTarjetaRecaudacionController.pago.label = Pago +busquedaTarjetaRecaudacionController.numTarjeta.label = Tarjeta +busquedaTarjetaRecaudacionController.fechaHora.label = Fecha/Hora +busquedaTarjetaRecaudacionController.origen.label = Origen +busquedaTarjetaRecaudacionController.destino.label = Destino +busquedaTarjetaRecaudacionController.ruta.label = Ruta +busquedaTarjetaRecaudacionController.autoBus.label = Autobus +busquedaTarjetaRecaudacionController.servicio.label = Servicio +busquedaTarjetaRecaudacionController.empresa.label = Empresa +busquedaTarjetaRecaudacionController.ingresoCorrida.label = Ingresso Corrida +busquedaTarjetaRecaudacionController.manual.label = Manual +busquedaTarjetaRecaudacionController.atualizado.label = Actualizado +busquedaTarjetaRecaudacionController.observaciones.label = Obervaciones +busquedaTarjetaRecaudacionController.corrida.label = Corrida +busquedaTarjetaRecaudacionController.btnConfirmaPago = Confirma Pago + +# Login Conductor Recaudacion +winLoginConductorRecaudacion.title = Ingresar Conductor +winLoginConductorRecaudacion.lblUsuario = Clave Conductor +winLoginConductorRecaudacion.lblSenha = Contraseña +winLoginConductorRecaudacion.btnAcessar = Acesso +winLoginConductorRecaudacion.lblloginIncorreto = Inicio de Sesión Incorrecto. Intentelo de nuevo. +winLoginConductorRecaudacion.conductor.corecto = Conductor corecto? +winLoginConductorRecaudacion.conductor.nombre = Nombre: +winLoginConductorRecaudacion.conductor.clave = Clave: + +# Confirma Pago Tarjetas Recaudacion +pagarTarjetasViajesController.window.title = Confirma Pago +pagarTarjetasViajesController.label.Conductor = Conductor +pagarTarjetasViajesController.label.DescripcionViajes = Descripcion Viajes +pagarTarjetasViajesController.label.FechaHora = Fecha/Hora +pagarTarjetasViajesController.label.Trayecto = Trayecto +pagarTarjetasViajesController.label.KM = KM +pagarTarjetasViajesController.label.Salario = Salario +pagarTarjetasViajesController.label.Percepciones = Percepciones +pagarTarjetasViajesController.label.Concepto = Concepto +pagarTarjetasViajesController.label.Cantidad = Cantidad +pagarTarjetasViajesController.label.TotalPercepciones = Total Percepciones +pagarTarjetasViajesController.label.Deducciones = Deducciones +pagarTarjetasViajesController.label.TotalDeducciones = Total Deducciones +pagarTarjetasViajesController.label.TotalPercepciones = Total Percepciones +pagarTarjetasViajesController.label.NetoPagar = Neto a Pagar + +# Abertura de Turno Recaudacion +aberturaTurnoRecaudacionController.title = Inicio Turno Recaudacion +aberturaTurnoRecaudacionController.btnInicioTurno = Inicio Turno +aberturaTurnoRecaudacionController.lblFechaHoraInicioTurno = Fecha/Hora Inicio +aberturaTurnoRecaudacionController.lblValorInicioTurno = Valor Inicio + + + +# Pantalla de la Sociedad de la Búsqueda +busquedaBancoController.window.title = Banco +busquedaBancoController.btnRefresh.tooltiptext = Actualizar +busquedaBancoController.btnNovo.tooltiptext = Agregar +busquedaBancoController.btnCerrar.tooltiptext = Cerrar +busquedaBancoController.btnPesquisa.label = Búsqueda +busquedaBancoController.lhId.label = ID +busquedaBancoController.lhDesc.label = Descripción +busquedaBancoController.banco.label = Nombre Banco +busquedaBancoController.puntoVenta.label = Punto Venta +busquedaBancoController.empresa.label = Empresa +busquedaBancoController.numCuenta.label = Numero Cuenta +busquedaBancoController.algoritmo.label = Algoritmo Ref +busquedaBancoController.concepto.label = Concepto +busquedaBancoController.nombre.label = Nombre de Banco +busquedaBancoController.clave.label = Clave de Sucursal +busquedaBancoController.idBanco.label = ID Banco +busquedaBancoController.moneda.label = Moneda + +# Pantalla de Edición de la banco +editarBancoController.window.title = Banco +editarBancoController.btnApagar.tooltiptext = Eliminar +editarBancoController.btnSalvar.tooltiptext = Guardar +editarBancoController.btnFechar.tooltiptext = Cerrar +editarBancoController.lbNome.value = Nome Banco +editarBancoController.lbActivo.value = Activo +editarBancoController.MSG.suscribirOK = El banco se registró exitosamente. +editarBancoController.MSG.borrarPergunta = ¿Desea eliminar este banco? +editarBancoController.MSG.borrarOK = Banco se eliminó exitosamente. +editarBancoController.nomBanco.label = Nombre do Banco +editarBancoController.dem.label = Referencia +editarBancoController.cuentaDinero.label = Cuenta de dinero (concepto) +editarBancoController.numCuenta.label = Numero de Cuenta +editarBancoController.algRef.label = Algoritmo Referencia +editarBancoController.punto.label = Punto de Venta +editarBancoController.empresa.label = Empresa +editarBancoController.moneda.label = Moneda + +# Pantalla de la Sociedad de la Búsqueda +busquedaTipoEventoExtraController.window.title = Ingresos Extras +busquedaTipoEventoExtraController.btnRefresh.tooltiptext = Actualizar +busquedaTipoEventoExtraController.btnNovo.tooltiptext = Agregar +busquedaTipoEventoExtraController.btnCerrar.tooltiptext = Cerrar +busquedaTipoEventoExtraController.btnPesquisa.label = Búsqueda +busquedaTipoEventoExtraController.lhId.label = ID +busquedaTipoEventoExtraController.nombre.label = Descripción del Ingreso +busquedaTipoEventoExtraController.tipo.label = Tipo de Ingreso +busquedaTipoEventoExtraController.empresa.label = Empresa + +busquedaTipoEventoExtraController.lhId.label = ID +busquedaTipoEventoExtraController.lhDesc.label = Descripción +busquedaTipoEventoExtraController.lh3.label = Tipo Ing +busquedaTipoEventoExtraController.lh4.label = Cuenta +busquedaTipoEventoExtraController.lh5.label = Imp Max +busquedaTipoEventoExtraController.lh6.label = Valida Corte +busquedaTipoEventoExtraController.lh7.label = Valida Docto +busquedaTipoEventoExtraController.lh8.label = Contrapartida +busquedaTipoEventoExtraController.lh9.label = IVA +busquedaTipoEventoExtraController.lh10.label = Empresa Venta +busquedaTipoEventoExtraController.lh11.label = Empresa Ingreso + + +# Pantalla de Edición de la tipoEventoExtra +editarTipoEventoExtraController.window.title = Catalogo de Ingresos Extras +editarTipoEventoExtraController.btnApagar.tooltiptext = Eliminar +editarTipoEventoExtraController.btnSalvar.tooltiptext = Guardar +editarTipoEventoExtraController.btnFechar.tooltiptext = Cerrar +editarTipoEventoExtraController.lbNome.value = Descripción del Ingreso +editarTipoEventoExtraController.lbActivo.value = Activo +editarTipoEventoExtraController.MSG.suscribirOK = El ingreso se registró exitosamente. +editarTipoEventoExtraController.MSG.borrarPergunta = ¿Desea eliminar este ingreso? +editarTipoEventoExtraController.MSG.borrarOK = Ingreso se eliminó exitosamente. +editarTipoEventoExtraController.tipoIngreso.label = Tipo de Ingreso +editarTipoEventoExtraController.cuenta.label = Cuenta Contable +editarTipoEventoExtraController.importeMaximo.label = Importe Maximo +editarTipoEventoExtraController.validaCorte.label = Valida Corte +editarTipoEventoExtraController.validaDocumento.label = Valida Documento +editarTipoEventoExtraController.boleto.label = Boleto +editarTipoEventoExtraController.ajuste.label = Ajuste +editarTipoEventoExtraController.contrapartida.label = Contrapartida +editarTipoEventoExtraController.ordem.label = Orden Servicio +editarTipoEventoExtraController.formaPago.label = Forma de Pago +editarTipoEventoExtraController.iva.label = IVA +editarTipoEventoExtraController.movimiento.label = Movimiento +editarTipoEventoExtraController.proveedor.label = Proveedor +editarTipoEventoExtraController.si.label = Si +editarTipoEventoExtraController.no.label = No +editarTipoEventoExtraController.contrapartida.label = Contrapartida +editarTipoEventoExtraController.Operacion.label = Operacion +editarTipoEventoExtraController.rd1.label = EVENTO EXTRA +editarTipoEventoExtraController.rd2.label = AJUSTE +editarTipoEventoExtraController.rd3.label = CHEQUE + +#Pago Conductor +importaTarjetaController.window.title = Atualizar Tabela de Cartao de Viagen +busquedaTarjetaViajeController.window.title = Manutencao de movimentos +envioTarjetaNominaController.window.title = Envio a Nomina +importaTarjetaController.btnCerrar.tooltiptext = Fechar +importaTarjetaController.lhGerar.label = Atualizar Cartoes +busquedaTarjetaViajeController.lhFechainicial.label = Data Inicial +busquedaTarjetaViajeController.lhFechafinal.label = Data Final +busquedaTarjetaViajeController.lhAutobusIni.label = Onibus Inicial +busquedaTarjetaViajeController.lhAutobusFin.label = Onibus Final +busquedaTarjetaViajeController.lhEmpresa.label = Empresa +busquedaTarjetaViajeController.lhOrigen.label = Origem +busquedaTarjetaViajeController.lhDestino.label = Destino +busquedaTarjetaViajeController.lhKms.label = Kms +busquedaTarjetaViajeController.lhOperadorOrigen.label = Operador Origem +busquedaTarjetaViajeController.lhOperadorDestino.label = Operador Destino +busquedaTarjetaViajeController.lhOperadorKms.label = Operador Kms +editarTarjetaController.MSG.suscribirOK = Tarjeta Viaje cadastrada com sucesso. +editarTarjetaController.primaria = Primária +editarTarjetaController.secundaria = Secundária + + + +# Muestra la Búsqueda Tramo Km Servicio +busquedaTramoKmServicioController.window.title = Tramo Km Servicio +busquedaTramoKmServicioController.btnRefresh.tooltiptext = Actualizar +busquedaTramoKmServicioController.btnNovo.tooltiptext = Agregar +busquedaTramoKmServicioController.btnCerrar.tooltiptext = Cerrar +busquedaTramoKmServicioController.btnPesquisa.label = Búsqueda +busquedaTramoKmServicioController.lhDesc.label = Descripción +busquedaTramoKmServicioController.lhId.label = ID +busquedaTramoKmServicioController.lhEmpresa.label = Empresa +busquedaTramoKmServicioController.lhClaseServicio.label = Clase de Servicio +busquedaTramoKmServicioController.lhTramo.label = Tramo +busquedaTramoKmServicioController.lhKmPago.label = Km pago condutor + +# Pantalla Tramo Km Servicio +editarTramoKmServicioController.window.title = Tramo Km Servicio +editarTramoKmServicioController.btnApagar.tooltiptext = Eliminar +editarTramoKmServicioController.btnSalvar.tooltiptext = Guardar +editarTramoKmServicioController.btnFechar.tooltiptext = Cerrar +editarTramoKmServicioController.lbNome.value = Tramo Km Servicio +editarTramoKmServicioController.MSG.suscribirOK = Tramo Km Servicio se registró exitosamente. +editarTramoKmServicioController.MSG.borrarPergunta = ¿Desea eliminar Tramo Km Servicio? +editarTramoKmServicioController.MSG.borrarOK = Tramo Km Servicio se eliminó exitosamente. +editarTramoKmServicioController.labelOrigem.value = Origen +editarTramoKmServicioController.labelDestino.value = Destino + + +# Muestra la Búsqueda Punto Venta Empresa +busquedaPtovtaEmpresaController.window.title = Punto Venta Empresa +busquedaPtovtaEmpresaController.btnRefresh.tooltiptext = Actualizar +busquedaPtovtaEmpresaController.btnNovo.tooltiptext = Agregar +busquedaPtovtaEmpresaController.btnCerrar.tooltiptext = Cerrar +busquedaPtovtaEmpresaController.btnPesquisa.label = Búsqueda +busquedaPtovtaEmpresaController.lhId.label = ID +busquedaPtovtaEmpresaController.lhDesc.label = Descripción +busquedaPtovtaEmpresaController.lhEmpresa.label = Empresa +busquedaPtovtaEmpresaController.lhPuntoVenta.label = Punto de Venta +busquedaPtovtaEmpresaController.txtNombre.label = Punto Venta Empresa + +# Pantalla Editar Punto Venta Empresa +editarPtovtaEmpresaController.window.title = Punto Venta Empresa +editarPtovtaEmpresaController.btnApagar.tooltiptext = Eliminar +editarPtovtaEmpresaController.btnSalvar.tooltiptext = Guardar +editarPtovtaEmpresaController.btnFechar.tooltiptext = Cerrar +editarPtovtaEmpresaController.lbNome.value = Descripción +editarPtovtaEmpresaController.lhEmpresa.label = Empresa +editarPtovtaEmpresaController.lhPuntoVenta.label = Punto de Venta +editarPtovtaEmpresaController.MSG.suscribirOK = Punto Venta Empresa se registró exitosamente. +editarPtovtaEmpresaController.MSG.borrarPergunta = ¿Desea eliminar este Punto Venta Empresa? +editarPtovtaEmpresaController.MSG.borrarOK = Punto Venta Empresase eliminó exitosamente. diff --git a/web/WEB-INF/lang-addon.xml b/web/WEB-INF/lang-addon.xml new file mode 100644 index 000000000..02b61d31a --- /dev/null +++ b/web/WEB-INF/lang-addon.xml @@ -0,0 +1,42 @@ + + + + + + xul/html + + + + + + org.zkoss.zul.theme.fontSizeM + + 10px + + + org.zkoss.zul.theme.fontSizeS + 9px + + + org.zkoss.zul.theme.fontSizeXS + 8px + + + org.zkoss.zul.theme.fontSizeMS + 9px + + + + + + + decimalbox + decimalbox + + format + #,##0.00 + + + + + diff --git a/web/WEB-INF/portlet.xml b/web/WEB-INF/portlet.xml new file mode 100644 index 000000000..39f4e96b7 --- /dev/null +++ b/web/WEB-INF/portlet.xml @@ -0,0 +1,49 @@ + + + + + + + ZK loader for ZUML pages + zkPortletLoader + ZK Portlet Loader + + org.zkoss.zk.ui.http.DHtmlLayoutPortlet + + 0 + + + text/html + VIEW + + + en + + + ZK + ZK + ZK,ZUML + + + + + diff --git a/web/WEB-INF/web.xml b/web/WEB-INF/web.xml new file mode 100644 index 000000000..d3518e20d --- /dev/null +++ b/web/WEB-INF/web.xml @@ -0,0 +1,225 @@ + + + + + + + ventaboletos + ventaboletos + + + + + + + + contextConfigLocation + + classpath:spring-config.xml + classpath:applicationContext-security.xml + + + + log4jConfigLocation + classpath:com/rjconsultores/ventaboletos/web/cliente/conf/log4j.xml + + + + + org.springframework.web.util.Log4jConfigListener + + + org.springframework.web.context.ContextLoaderListener + + + org.springframework.web.context.request.RequestContextListener + + + org.springframework.security.web.session.HttpSessionEventPublisher + + + + + + + + ZK listener for session cleanup + org.zkoss.zk.ui.http.HttpSessionListener + + + Spring OpenSessionInViewFilter + org.springframework.orm.hibernate3.support.OpenSessionInViewFilter + + + + Spring OpenSessionInViewFilter + /* + + + ZK loader for ZUML pages + zkLoader + org.zkoss.zk.ui.http.DHtmlLayoutServlet + + update-uri + /zkau + + 1 + + + zkLoader + *.zul + + + zkLoader + *.zhtml + + + zkLoader + *.svg + + + zkLoader + *.xml2html + + + zkLoader + *.mul + + + + + zkLoader + /zk/* + + + + The asynchronous update engine for ZK + auEngine + org.zkoss.zk.au.http.DHtmlUpdateServlet + + + auEngine + /zkau/* + + + + springSecurityFilterChain + org.springframework.web.filter.DelegatingFilterProxy + + + + springSecurityFilterChain + /* + + + dspLoader + org.zkoss.web.servlet.dsp.InterpreterServlet + + class-resource + true + + + + + + ImageServlet + ImageServlet + com.rjconsultores.ventaboletos.web.utilerias.servlet.ImageServlet + + + dspLoader + *.dsp + + + ImageServlet + /ImageServlet + + + + + + 60 + + + + + doc + application/vnd.ms-word + + + gif + image/gif + + + htm + text/html + + + html + text/html + + + jnlp + application/x-java-jnlp-file + + + jpeg + image/jpeg + + + jpg + image/jpeg + + + js + text/javascript + + + pdf + application/pdf + + + png + image/png + + + rar + application/x-rar-compressed + + + txt + text/plain + + + xls + application/vnd.ms-excel + + + xml + text/xml + + + xul + application/vnd.mozilla.xul-xml + + + zhtml + text/html + + + zip + application/x-zip + + + zul + text/html + + + + index.zul + + diff --git a/web/WEB-INF/weblogic.xml b/web/WEB-INF/weblogic.xml new file mode 100644 index 000000000..ab7658fa1 --- /dev/null +++ b/web/WEB-INF/weblogic.xml @@ -0,0 +1,8 @@ + + + + true + true + + /ventaboletosadm + diff --git a/web/WEB-INF/zk.xml b/web/WEB-INF/zk.xml new file mode 100644 index 000000000..5af667010 --- /dev/null +++ b/web/WEB-INF/zk.xml @@ -0,0 +1,64 @@ + + + + + + + + false + + + + ThreadLocal Synchronization Listener + org.zkoss.zkplus.util.ThreadLocalListener + + + + ThreadLocal + + org.springframework.security.core.context.ThreadLocalSecurityContextHolderStrategy=contextHolder; + org.springframework.web.context.request.RequestContextHolder=requestAttributesHolder,inheritableRequestAttributesHolder + + + + + ajax + + 1800 + /timeout.zul + + + + Spring TransactionSynchronizationManager handler + org.zkoss.zkplus.spring.SpringTransactionSynchronizationListener + + + org.zkoss.zul.Window.defaultActionOnShow + + + + + My App Init + com.rjconsultores.ventaboletos.web.utilerias.MyAppInit + + + + + + + 5 + + + + diff --git a/web/accessDenied.zul b/web/accessDenied.zul new file mode 100644 index 000000000..2bcc297ba --- /dev/null +++ b/web/accessDenied.zul @@ -0,0 +1,7 @@ + + + + + Você não tem permissão para acessar o recurso! + + \ No newline at end of file diff --git a/web/component/multiLineMessageBox.zul b/web/component/multiLineMessageBox.zul new file mode 100644 index 000000000..dc856a9bb --- /dev/null +++ b/web/component/multiLineMessageBox.zul @@ -0,0 +1,59 @@ + + + + + + + + + + + +
+
+
+
+ + + + +