Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env perl
- use strict;
- use warnings;
- use Tk;
- use Tk::LabFrame;
- #####################
- sub choose_doc_type {
- #####################
- my $mw = MainWindow->new;
- # Mainwindow: sizex/y, positionx/y
- $mw->geometry("210x260-0+0");
- # Default value
- my $doc_type = "";
- my $frame = $mw->LabFrame(
- -label => "Fax/Doc Type",
- -labelside => 'acrosstop',
- -width => 180,
- -height => 200,
- )->place(-x=>10,-y=>10);
- # Put these values into the frame
- $frame->Radiobutton(
- -variable => \$doc_type,
- -value => 'RC_SAVE',
- -text => 'Docs for RC',
- )->place( -x => 10, -y => 5 );
- $frame->Radiobutton(
- -variable => \$doc_type,
- -value => 'OCP_SAVE',
- -text => 'OCP Docs',
- )->place( -x => 10, -y => 30 );
- $frame->Radiobutton(
- -variable => \$doc_type,
- -value => 'NV_SAVE',
- -text => 'New Vendor Docs.',
- )->place( -x => 10, -y => 55 );
- $frame->Radiobutton(
- -variable => \$doc_type,
- -value => 'DELETE',
- -text => 'Junk. Delete it',
- )->place( -x => 10, -y => 80 );
- $frame->Radiobutton(
- -variable => \$doc_type,
- -value => 'NADA',
- -text => 'Leave it.',
- )->place( -x => 10, -y => 105 );
- $frame->Radiobutton(
- -variable => \$doc_type,
- -value => 'SAVE_FAX',
- -text => 'Other - Save it',
- )->place( -x => 10, -y => 130 );
- $frame->Radiobutton(
- -variable => \$doc_type,
- -value => 'AP_SAVE',
- -text => 'AP Docs',
- )->place( -x => 10, -y => 130 );
- my $button_frame = $mw->Frame()->pack(-side => "bottom");
- my $ok_button = $button_frame->Button(-text => 'OK',
- -command => [$mw=>'destroy']
- )->pack(-side => "left");
- MainLoop;
- #print $doc_type . "\n";
- #chomp (my $jj = <STDIN>);
- return $doc_type;
- ############################
- } # end of sub choose doc type
- ############################
- #####################
- sub carr_docs_box {
- #####################
- my ($c_no) = @_;
- my $mw = MainWindow->new;
- $mw->geometry("180x270-0-30");
- $mw->title("Check Button Select");
- my @check = (undef) x 10;
- my $doc_string;
- my $check_frame = $mw->Frame()->pack(-side => "top");
- $check_frame->Label(-text=>"Select Included Documents.")->pack(-side => "top")->pack();
- $check_frame->Checkbutton(-text => 'BC Agrm',
- -variable => \$check[1],
- -onvalue => '_BCA',
- -offvalue => '')->pack();
- $check_frame->Checkbutton(-text => 'Bond',
- -variable => \$check[2],
- -onvalue => '_ATH',
- -offvalue => '')->pack();
- $check_frame->Checkbutton(-text => 'Gen Liab. Insr.',
- -variable => \$check[3],
- -onvalue => '_INL',
- -offvalue => '')->pack();
- $check_frame->Checkbutton(-text => 'Auto Insr.',
- -variable => \$check[4],
- -onvalue => '_INC',
- -offvalue => '')->pack();
- $check_frame->Checkbutton(-text => 'Indp. Contractor',
- -variable => \$check[5],
- -onvalue => '_IND',
- -offvalue => '')->pack();
- $check_frame->Checkbutton(-text => 'Profile',
- -variable => \$check[6],
- -onvalue => '_PRF',
- -offvalue => '')->pack();
- $check_frame->Checkbutton(-text => 'W9 Form',
- -variable => \$check[7],
- -onvalue => '_W9',
- -offvalue => '')->pack();
- $check_frame->Checkbutton(-text => 'Rush Pay Agrm.',
- -variable => \$check[8],
- -onvalue => '_RP',
- -offvalue => '')->pack();
- $check_frame->Checkbutton(-text => 'Other',
- -variable => \$check[9],
- -onvalue => '_OTH',
- -offvalue => '')->pack();
- my $button_frame = $mw->Frame()->pack(-side => "bottom");
- my $ok_button = $button_frame->Button(
- -text => 'OK',
- #-command => \&check_sub)->pack(-side => "left");
- -command => sub {
- check_sub( $mw, \@check, \$doc_string, $c_no )
- })->pack(-side => "left");
- # summary sub
- sub check_sub {
- my ($mw, $check, $doc_string, $c_no) = @_;
- # check to see if they selected quick Pay
- if (defined $check->[8] && $check->[8] eq '_RP') {
- # user says that recvd a Rush Pay agrm
- # verify rush pay agrm and set up rush pay
- rush_pay_set_up($c_no);
- }
- $$doc_string = join "", grep { defined $_ } @$check;
- #print "Doc " . $doc_string . "\n";
- #chomp (my $TT=<STDIN>);
- $mw->destroy;
- }
- MainLoop;
- return $doc_string;
- #########
- } # end of sub
- ############
- my $dt; # type of documents viewed
- my $quit = 'n';
- my $test_cno = 1111;
- while ($quit ne 'q') {
- ($dt) = choose_doc_type();
- print "quit equals: $quit\n";
- if ($dt eq 'OCP_SAVE') { # Classify vendor docs.
- my $doc_string = carr_docs_box($test_cno);
- print "Doc String would be: " . $doc_string . "\n";
- }
- print "Press (q) to quit Enter to continue any other key to quit.\n";
- chomp ($quit = <STDIN>);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement