You are on page 1of 82

A.

ANEXO A:
NUMEROS
ALEATORI
OS

ANEXO A-1: NUMEROS ALEATORIOS PARA LA SECCION DE MOLIDO


0,04047
28
0,74536
50
0,62858
20
0,21917
80
0,57125
21
0,59126
59
0,57264
02
0,84137
82
0,17768
58
0,75831
43
0,86911
51
0,93448
93
0,00064
77
0,34678
54
0,95245
25
0,27582
60
0,84037
67
0,66186
41
0,44320
74
0,46266
32
0,77679
55
0,90366
78
0,95256
85
0,46623
75
0,74436
19

0,46115
54
0,51842
91
0,66040
65
0,25751
65
0,55944
06
0,09843
88
0,38899
46
0,24681
25
0,72659
47
0,90621
76
0,36404
96
0,36291
33
0,17736
55
0,63185
69
0,22052
08
0,07735
78
0,61512
26
0,62279
45
0,25401
77
0,57890
22
0,96783
42
0,79793
00
0,77269
34
0,62825
05
0,41562
34

0,84404
55
0,78669
44
0,55649
40
0,33386
97
0,99626
57
0,97252
92
0,65713
97
0,94837
50
0,83395
95
0,50917
54
0,43914
73
0,66776
82
0,32345
03
0,99394
77
0,23161
01
0,81437
81
0,52562
88
0,57713
01
0,23848
72
0,30396
46
0,15008
82
0,15304
83
0,73733
97
0,08481
40
0,97279
10

0,59911
07
0,59490
83
0,50897
05
0,67445
56
0,89423
46
0,89775
60
0,55925
69
0,55903
03
0,29076
64
0,91899
08
0,43540
78
0,86969
33
0,62538
42
0,05479
08
0,17629
43
0,45950
97
0,95776
64
0,24350
94
0,49855
46
0,62581
58
0,37681
05
0,76480
58
0,92089
29
0,95936
62

0,53991
86
0,32438
34
0,58971
36
0,81182
95
0,91371
46
0,16748
79
0,84977
53
0,54611
73
0,99728
04
0,99996
66
0,93846
94
0,98891
44
0,68049
31
0,15509
63
0,75367
34
0,61525
83
0,35661
93
0,38071
42
0,36675
83
0,98514
12
0,72954
49
0,93254
02
0,75436
07
0,60583
86

0,82998
11
0,24352
12
0,17098
71
0,51302
13
0,78333
00
0,15295
82
0,23760
47
0,18750
29
0,26869
80
0,99456
36
0,42570
54
0,24844
79
0,24677
87
0,28064
85
0,40140
48
0,60630
34
0,22113
22
0,95579
35
0,16733
44
0,50773
77
0,29220
11
0,15088
68
0,65435
97
0,06911
29

0,09313
53
0,74903
68
0,73568
15
0,42123
65
0,40330
03
0,94818
81
0,49336
84
0,83112
69
0,97562
98
0,27981
58
0,81407
06
0,96135
24
0,22201
66
0,27354
97
0,88107
61
0,30228
19
0,91492
04
0,14951
05
0,65639
46
0,25137
26
0,14098
55
0,47696
82
0,46507
65
0,08587
57

0,58066
48
0,63250
91
0,27348
55
0,88474
02
0,34384
50
0,12630
32
0,89421
82
0,13078
62
0,19087
61
0,02268
33
0,42013
80
0,57905
60
0,26520
55
0,85755
98
0,08711
61
0,01789
60
0,41627
18
0,91881
02
0,49075
01
0,57433
62
0,63409
44
0,67604
30
0,06729
38
0,97649
13

ANEXO A-2: NUMEROS ALEATORIOS PARA LA SECCION DE MEZCLADO


0,14982
79
0,76182
10
0,44589
64
0,57584
92
0,23193
71
0,52290
17
0,02300
90
0,15491
78
0,65822
20
0,99526
49
0,84177
64
0,70388
54
0,84765
43
0,04686
61
0,90097
31
0,20559
45
0,37394
84
0,99378
27
0,14970
69
0,98721
42
0,70812
44
0,48825
60
0,34162
17
0,86879
12
0,45024
55
0,58500
95

0,60688
24
0,40403
72
0,92421
92
0,12318
49
0,69946
88
0,73421
73
0,44696
68
0,93631
97
0,60781
56
0,76557
47
0,78904
72
0,25340
97
0,21752
45
0,34963
54
0,34925
20
0,03581
56
0,79309
77
0,59643
61
0,83274
35
0,32037
31
0,61184
38
0,18539
54
0,76892
78
0,80200
38
0,60350
72
0,86074
76

0,09607
96
0,11464
08
0,52883
21
0,80847
09
0,17909
69
0,65047
83
0,77648
81
0,02112
73
0,30474
77
0,31541
52
0,85836
26
0,47565
18
0,83726
80
0,68916
96
0,10251
78
0,99121
45
0,16585
16
0,38880
05
0,88350
34
0,28174
47
0,86520
45
0,51709
22
0,52194
95
0,79903
03
0,37147
34
0,11081
38

0,46704
57
0,85755
36
0,97225
31
0,41996
93
0,65139
42
0,57253
36
0,10666
60
0,02991
61
0,58487
39
0,15276
23
0,58561
68
0,69449
67
0,37085
25
0,99107
36
0,52149
06
0,42521
70
0,94131
83
0,23806
82
0,19027
97
0,58945
05
0,27744
57
0,44517
98
0,05923
06
0,94974
75
0,22701
00
0,92572
74

0,76447
79
0,22296
39
0,50750
31
0,74684
84
0,83238
57
0,76317
01
0,46381
84
0,00925
91
0,76337
91
0,14731
99
0,21320
60
0,72350
98
0,78698
80
0,69151
74
0,13887
85
0,29203
92
0,98197
85
0,24066
53
0,53649
19
0,75719
65
0,34584
85
0,84493
52
0,75778
06
0,13306
85
0,37181
63
0,68087
60

0,70798
43
0,43675
47
0,76356
40
0,74841
30
0,63976
26
0,18346
13
0,22842
62
0,35533
66
0,18024
59
0,66312
04
0,04643
17
0,42306
35
0,61104
41
0,76529
25
0,97012
39
0,52264
92
0,93339
13
0,67671
49
0,08794
13
0,27402
57
0,78461
07
0,88106
08
0,18763
39
0,09565
07
0,19410
98
0,46285
67

0,69474
31
0,43336
15
0,17628
43
0,77998
92
0,17657
38
0,17726
38
0,18017
90
0,17822
34
0,72433
73
0,43243
50
0,73277
67
0,41530
30
0,16814
50
0,73430
48
0,29758
00
0,61596
25
0,03104
71
0,46925
02
0,24643
14
0,77400
69
0,53809
87
0,19948
79
0,33955
45
0,41490
95
0,35342
81
0,32457
76

0,22955
26
0,73552
29
0,80163
55
0,52565
36
0,04445
17
0,26817
11
0,24987
88
0,76116
02
0,16247
43
0,93426
57
0,74272
56
0,76798
08
0,44280
70
0,61455
34
0,15899
78
0,51452
26
0,89251
91
0,46828
08
0,13716
05
0,79177
83
0,46428
58
0,67394
40
0,28710
89
0,91930
86
0,00606
78
0,62307
54

0,78575
24
0,82419
80
0,99273
81
0,45706
32
0,25495
12
0,71135
00
0,53219
86
0,78879
96
0,21087
51
0,29626
01
0,07518
00
0,24053
79
0,40166
63
0,91504
76
0,33690
63
0,32361
00
0,83843
05
0,27484
95

0,22459
24
0,20086
51
0,16719
06
0,88523
04
0,99514
34
0,64433
01
0,19582
78
0,17840
81
0,93730
66
0,52837
44
0,48882
61
0,50822
33
0,29918
29
0,39755
35
0,63302
33
0,00232
58
0,96767
47
0,36423
50

0,25440
49
0,58792
91
0,72274
63
0,88115
42
0,00775
16
0,45151
92
0,71795
97
0,44795
70
0,84314
97
0,12264
42
0,25650
81
0,39939
15
0,46122
60
0,08769
18
0,85829
95
0,20369
19
0,25034
09
0,29717
92

0,50515
39
0,76713
16
0,97345
11
0,01388
73
0,80617
31
0,10873
40
0,39721
57
0,33222
27
0,34544
69
0,84966
11
0,81350
78
0,50189
83
0,76511
94
0,39730
77
0,59561
45
0,28293
70
0,41485
28

0,12356
31
0,53262
74
0,57937
96
0,85942
33
0,31167
48
0,39279
56
0,47099
79
0,88165
11
0,29422
76
0,37299
35
0,62143
55
0,52736
57
0,63133
14
0,50437
61
0,91674
24
0,77334
03
0,77105
42

0,62228
69
0,47057
90
0,26384
36
0,08079
22
0,87646
47
0,47410
59
0,11783
91
0,66800
11
0,96067
32
0,75529
45
0,60931
34
0,27838
14
0,78811
83
0,50441
94
0,21353
04
0,27525
21
0,32067
08

0,67175
47
0,44314
37
0,91540
77
0,98245
41
0,31807
40
0,98940
36
0,52736
66
0,13271
54
0,37020
57
0,64478
59
0,44555
47
0,62299
77
0,30069
09
0,91256
16
0,67734
55
0,44673
74
0,54018
70

0,64406
05
0,25294
93
0,02044
89
0,64898
85
0,64492
42
0,56818
99
0,71298
56
0,43053
52
0,61678
07
0,52027
47
0,41084
81
0,62636
67
0,04247
78
0,05258
56
0,14149
15
0,66505
81
0,08197
18

ANEXO A-3: NUMEROS ALEATORIOS PARA LA SECCION DE EMBUTIDO


0,51192
41
0,61876
59
0,43186
60
0,95601
04
0,28425
66
0,05886
49
0,47344
19
0,29848
24
0,05461
01
0,97399
75
0,57546
28
0,57696
68
0,55891
70
0,38918
53
0,36194
98
0,91410
00
0,16744
09
0,90540
12
0,08033
34
0,75330
10
0,63612
81
0,19619
20
0,28815
72
0,82815
64
0,21807
16
0,66633
63

0,67184
40
0,09242
06
0,54154
71
0,73394
00
0,11695
36
0,60186
26
0,19137
50
0,24788
41
0,50258
84
0,98007
13
0,22808
97
0,47542
91
0,53267
34
0,70224
31
0,77844
12
0,12317
37
0,35937
24
0,20609
89
0,37368
85
0,52305
41
0,90825
64
0,24122
49
0,83904
29
0,09284
58
0,49685
80
0,96987
32

0,05852
01
0,40803
24
0,25965
85
0,04166
54
0,42197
58
0,68830
12
0,12107
23
0,25335
18
0,84004
19
0,06230
60
0,27401
31
0,78635
66
0,22856
40
0,12430
61
0,57254
09
0,54061
53
0,58908
93
0,21617
74
0,93505
31
0,14005
74
0,50582
33
0,36282
28
0,15922
26
0,49308
94
0,32607
05
0,95659
41

0,53010
30
0,08819
55
0,98696
51
0,95480
41
0,29112
01
0,43536
93
0,76000
81
0,62276
19
0,29625
92
0,77389
10
0,40729
56
0,06066
70
0,61237
95
0,19346
78
0,46834
73
0,72478
85
0,33029
61
0,15053
57
0,87981
72
0,15738
26
0,14965
08
0,84295
89
0,28919
82
0,81101
49
0,89954
12
0,37482
14

0,49699
06
0,01336
34
0,74513
54
0,56753
16
0,02378
45
0,83631
27
0,11247
26
0,10481
65
0,51434
97
0,13720
13
0,03838
80
0,90133
28
0,45597
95
0,84078
44
0,55901
92
0,00689
25
0,76563
33
0,91607
67
0,43497
16
0,37086
37
0,44635
30
0,97682
88
0,88850
48
0,07391
69
0,10395
98
0,95341
16

0,69247
63
0,06366
21
0,86334
37
0,67430
52
0,94657
62
0,10736
63
0,01227
48
0,06803
28
0,36206
75
0,60458
27
0,23986
54
0,69199
04
0,60231
51
0,32777
55
0,91839
06
0,38780
96
0,70994
52
0,43908
15
0,22341
63
0,00886
90
0,91358
57
0,04806
01
0,97315
33
0,42511
69
0,90129
85
0,32535
35

0,38474
97
0,21845
68
0,81408
32
0,06835
54
0,00436
73
0,83500
47
0,77846
78
0,64965
74
0,94152
89
0,25521
48
0,77437
80
0,61847
24
0,68143
07
0,39912
63
0,19156
87
0,04889
79
0,17652
28
0,65958
27
0,60208
52
0,06032
07
0,09017
34
0,03776
88
0,83699
98
0,87287
59
0,32642
01
0,80840
99

0,35617
66
0,48688
70
0,41357
05
0,89323
76
0,34332
15
0,61067
93
0,72973
56
0,36035
23
0,96089
09
0,88527
49
0,69842
24
0,51625
47
0,62383
00
0,71385
69
0,93026
58
0,36580
07
0,05072
62
0,12016
76
0,75820
70
0,52318
72
0,21489
43
0,55780
03
0,07338
81
0,25016
00
0,59131
17
0,38974
28

0,74480
77
0,56124
85
0,00624
70
0,33342
99
0,73235
97
0,45357
53
0,78267
79
0,30901
27
0,68734
54
0,92855
85
0,87179
91
0,12643
52
0,12931
16
0,66099
02
0,94890
34
0,88459
49
0,56438
96
0,92613
90
0,73264
56

0,39792
44
0,83370
65
0,12557
10
0,25683
17
0,52137
21
0,17277
88
0,17662
90
0,52581
02
0,54630
74
0,27660
51
0,86072
16
0,29717
05
0,08997
85
0,88318
13
0,58164
48
0,14717
24
0,46388
14
0,19888
31
0,03546
40

0,84749
95
0,63725
46
0,75152
12
0,61077
79
0,49476
62
0,55178
87
0,00655
18
0,37784
75
0,64901
87
0,32931
53
0,64039
76
0,96456
06
0,94223
08
0,08332
87
0,68567
11
0,53514
41
0,49315
43
0,53443
00
0,53624
15

0,49960
64
0,51291
79
0,24400
00
0,54572
93
0,84375
54
0,98865
29
0,57684
58
0,81778
45
0,31583
63
0,35060
21
0,31986
67
0,55393
39
0,27071
45
0,63482
51
0,61280
53
0,97959
46
0,40449
88
0,80639
88
0,34403
56

0,08784
29
0,80417
54
0,01591
95
0,53200
54
0,88834
83
0,30988
65
0,13146
09
0,52280
91
0,50520
82
0,12330
43
0,17940
94
0,60279
99
0,72156
42
0,17363
63
0,23741
46
0,89834
79
0,85505
89
0,40896
94
0,46858
56

0,50053 0,11002
41
83
0,14175 0,82845
21
47
0,91951 0,37469
94
00
0,37274 0,99553
03
28
0,72678 0,49941
24
12
0,49747 0,20974
85
47
0,85520 0,40340
26
72
0,58471 0,11632
98
90
0,30991 0,81466
90
22
0,34455 0,19679
93
73
0,27004 0,21017
53
06
0,63939 0,04541
93
81
0,86330 0,10713
95
85
0,13183 0,37082
07
37
0,37214 0,89193
33
37
0,38148 0,14086
53
41
0,26477 0,43191
12
12
0,49690 0,51590
70
40
0,41424 0,62131
43
21
(Continuacin

0,90713
84
0,61872
81
0,08183
70
0,74485
56
0,30130
76
0,41877
41
0,10922
22

0,80283
56
0,80598
66
0,79753
75
0,11185
13
0,72216
99
0,03096
90
0,51378
41

0,24423
24
0,68966
43
0,59436
13
0,96412
18
0,29069
10
0,24179
23
0,66792
88

0,63263
41
0,53951
11
0,77544
15
0,52350
94
0,31616
43
0,46144
63
0,69283
76

0,34342
78
0,90506
13
0,07141
46
0,51802
46
0,05765
28
0,14084
47
0,78267
88

0,51179
31
0,94799
52
0,51031
28
0,90420
78
0,39664
25
0,35330
87
0,90635
32

0,38561
08
0,56798
20
0,94908
59
0,88246
68
0,40548
84
0,36286
44
0,09139
27

0,14234
88
0,97459
97
0,20559
22
0,60392
72
0,09655
97
0,75883
58
0,13718
36
0,33000
86
0,21001
38
0,89491
26
0,12001
75
0,25444
75
0,43039
15
0,07424
96
0,93252
74
0,26317
99
0,04552
73
0,81010
69
0,20997
63
anexo A-3)
0,33091
37
0,42647
33
0,70239
98
0,71618
58
0,60145
27
0,72646
61
0,70908
74

0,29799
07
0,83846
58
0,28506
41
0,56739
85
0,00711
04
0,30510
78
0,42751
04
0,34054
27
0,78571
53
0,01949
89
0,37216
07
0,66096
20
0,94725
49

0,01996
80
0,14531
97
0,98701
64
0,94821
43
0,61626
10
0,26094
41
0,55492
26
0,46416
29
0,52303
96
0,90169
02
0,53786
76
0,82760
39
0,72157
77

0,69916
33
0,11123
14
0,73554
13
0,20090
44
0,07106
14
0,61426
38
0,08824
28
0,67904
57
0,09447
58
0,88624
07
0,16610
20
0,75612
14
0,58048
05

0,88914
88
0,99038
73
0,45417
03
0,73680
89
0,62338
67
0,46088
52
0,33189
86
0,54359
29
0,70100
62
0,46427
74
0,08409
31
0,90735
83
0,25004
79

0,95220
58
0,58989
39
0,11523
39
0,99293
71
0,18915
07
0,39970
44
0,66818
86
0,97799
78
0,96561
73
0,09864
81
0,85579
11
0,37063
49
0,47527
99

0,14306
21
0,89092
09
0,65333
12
0,97060
44
0,31598
27
0,12407
63
0,43720
55
0,47685
25
0,99634
12
0,81973
38
0,30215
65
0,02972
97
0,74851
33

0,23721
36
0,88707
59
0,43962
77
0,04762
04
0,00319
32
0,00010
55
0,72443
02
0,53976
51
0,46675
44
0,18358
85
0,97503
12
0,25316
93
0,40787
71

0,97640
13
0,43678
35
0,60494
51
0,12788
66
0,64584
32
0,90756
89
0,42916
49
0,02734
23
0,14384
09
0,30277
41
0,16557
15
0,57833
75
0,74585
28

ANEXO A-4: NUMEROS ALEATORIOS PARA LA SECCION DE COCINADO


0,16505
44
0,46540
17
0,96472
47
0,67969
52
0,26409
75
0,12109
26
0,88389
84
0,58060
08
0,16937
38
0,76407
78
0,69136
97
0,67567
56
0,19519
66
0,46987
11
0,54858
43
0,79474
41
0,26464
73
0,44658
62
0,78052
50
0,30651
38
0,31564
10
0,78459
49
0,59611
11
0,58469
74
0,20665
36
0,77183
05

0,06362
61
0,18502
11
0,41857
91
0,01285
85
0,00683
27
0,08550
58
0,57212
28
0,58093
05
0,81533
80
0,25121
43
0,53862
10
0,21034
71
0,44862
87
0,92580
33
0,43941
62
0,61008
30
0,95218
69
0,18736
35
0,95472
73
0,76718
51
0,61934
56
0,71036
05
0,74265
46
0,87986
27
0,93194
46
0,71118
95

0,26055
28
0,42105
64
0,39483
87
0,77989
40
0,88443
20
0,22745
28
0,25665
24
0,83059
57
0,81788
54
0,69149
45
0,19113
20
0,51974
97
0,80661
61
0,50450
29
0,09655
63
0,38828
99
0,08661
01
0,91219
21
0,99310
92
0,30938
97
0,43303
95
0,62134
89
0,81583
63
0,83085
60
0,25592
34
0,11411
95

0,50244
08
0,23497
36
0,62030
03
0,26699
78
0,41651
44
0,57622
18
0,13207
08
0,66231
63
0,13204
12
0,53525
87
0,21239
78
0,30001
48
0,82391
57
0,69902
16
0,29425
62
0,94921
56
0,10104
78
0,14025
55
0,39411
06
0,03753
50
0,51790
46
0,85325
63
0,11079
78
0,68457
76
0,47969
95
0,31599
49

0,24896
61
0,55445
51
0,92455
92
0,26253
11
0,11665
12
0,84999
01
0,50018
83
0,30709
25
0,06308
01
0,34776
89
0,88661
53
0,85141
74
0,42927
31
0,57135
80
0,48412
88
0,74194
38
0,95276
99
0,04537
16
0,73988
61
0,57258
17
0,83450
72
0,25189
32
0,76097
33
0,30253
48
0,04547
12
0,52741
71

0,09507
55
0,10816
54
0,21073
67
0,23085
67
0,78312
59
0,20000
52
0,33605
50
0,06378
43
0,09049
79
0,16808
64
0,43172
89
0,80986
85
0,95225
94
0,16732
75
0,63011
27
0,00184
57
0,96474
83
0,23818
45
0,01226
94
0,11799
30
0,99105
57
0,80040
55
0,79316
58
0,10779
86
0,18398
12
0,49651
62

0,35700
49
0,67815
82
0,95533
37
0,01338
02
0,17274
54
0,61433
42
0,08061
64
0,97487
10
0,22533
13
0,66700
75
0,79104
18
0,70327
43
0,20424
73
0,50119
90
0,29166
28
0,60088
52
0,87828
35
0,27935
52
0,93992
01
0,53189
17
0,24747
14
0,79706
52
0,04335
68
0,01627
87
0,38358
79
0,84211
48

0,47255
55
0,31485
62
0,70255
59
0,76607
46
0,70886
16
0,60298
93
0,56126
77
0,25261
74
0,21255
76
0,13657
30
0,60698
90
0,31365
12
0,16899
68
0,57281
04
0,39982
74
0,05196
30
0,33097
18
0,03823
56
0,59336
15
0,45592
54
0,90170
26
0,16767
67
0,27404
35
0,95948
02
0,50837
60
0,37773
35

0,62614
89
0,91111
66
0,55872
67
0,86023
13
0,56159
22
0,44143
48
0,27765
68
0,33790
36
0,35501
54

0,90154
42
0,19054
16
0,33003
34
0,96871
54
0,69421
60
0,16984
95
0,79495
86
0,03470
96
0,25155
10

0,52089
68
0,30888
28
0,69399
04
0,66354
78
0,25331
91
0,15936
35
0,97350
21
0,68926
60
0,99172
67

0,95702
41
0,99642
18
0,96586
66
0,93768
25
0,15999
97
0,12415
19
0,97316
97
0,45756
42
0,46036
31

0,01606
93
0,74258
59
0,81337
78
0,89126
93
0,86409
70
0,04264
99
0,16225
46
0,95608
06
0,79368
21

0,10547
30
0,15859
17
0,85885
16
0,56141
64
0,15164
61
0,62191
23
0,65190
76
0,46234
09

0,08949
47
0,24581
82
0,09419
32
0,30795
79
0,34511
75
0,44900
07
0,92693
34
0,84567
83

0,41605
58
0,99587
86
0,54924
18
0,55998
71
0,95313
82
0,51863
48
0,49800
58
0,44710
65

B.

ANEXO B:
FORMULA
RIOS DEL
SISTEMA
INFORMA
TICO

C.

ANEXO C:
FORMULA
RIOS DEL
ESTUDIO
DE
METODOS

D.

ANEXO D:
CODIGO
FUENTE

ANEXO D-5: CODIGO FUENTE, MODULO DE AUTENTICACION


Public Class frmAutenticacion
Private Sub btnIngresar_Click(sender As Object, e As EventArgs) Handles btnIngresar.Click
Dim odapterEmp As New ds_EmpleadosTableAdapters.CT_EmpleadosTableAdapter
Dim odatasepEmp As New ds_Empleados
odapterEmp.FillByAutenticacion(odatasepEmp.CT_Empleados, txtUsuario.Text,
txtContrasea.Text, cboCargo.Text)
If odatasepEmp.CT_Empleados.Count = 1 Then
If cboCargo.Items(0) = cboCargo.Text Then
frmPrincipal.Show()
Me.Hide()
End If
If cboCargo.Items(1) = cboCargo.Text Then
frmPrincipal.AdministracionToolStripMenuItem.Enabled = False
frmPrincipal.AprovisionamientoToolStripMenuItem.Enabled = True
frmPrincipal.ProduccionToolStripMenuItem.Enabled = True
frmPrincipal.ComercializacionToolStripMenuItem.Enabled = True
frmPrincipal.ContabilidadToolStripMenuItem.Enabled = False
frmPrincipal.Show()
Me.Hide()
End If
If cboCargo.Items(2) = cboCargo.Text Then
frmPrincipal.AdministracionToolStripMenuItem.Enabled = False
frmPrincipal.AprovisionamientoToolStripMenuItem.Enabled = False
frmPrincipal.ProduccionToolStripMenuItem.Enabled = False
frmPrincipal.ComercializacionToolStripMenuItem.Enabled = False
frmPrincipal.ContabilidadToolStripMenuItem.Enabled = True
frmPrincipal.Show()
Me.Hide()
End If
If cboCargo.Items(3) = cboCargo.Text Then
frmPrincipal.AdministracionToolStripMenuItem.Enabled = False
frmPrincipal.AprovisionamientoToolStripMenuItem.Enabled = True
frmPrincipal.ProduccionToolStripMenuItem.Enabled = True
frmPrincipal.ComercializacionToolStripMenuItem.Enabled = False
frmPrincipal.ContabilidadToolStripMenuItem.Enabled = False
frmPrincipal.Show()
Me.Hide()
End If
If cboCargo.Items(4) = cboCargo.Text Then
frmPrincipal.AdministracionToolStripMenuItem.Enabled = False
frmPrincipal.AprovisionamientoToolStripMenuItem.Enabled = False
frmPrincipal.ProduccionToolStripMenuItem.Enabled = True
frmPrincipal.ComercializacionToolStripMenuItem.Enabled = True
frmPrincipal.ContabilidadToolStripMenuItem.Enabled = False
frmPrincipal.Show()
Me.Hide()
End If
If cboCargo.Items(5) = cboCargo.Text Then
frmPrincipal.AdministracionToolStripMenuItem.Enabled = False
frmPrincipal.AprovisionamientoToolStripMenuItem.Enabled = True
frmPrincipal.ProduccionToolStripMenuItem.Enabled = True
frmPrincipal.ComercializacionToolStripMenuItem.Enabled = True
frmPrincipal.ContabilidadToolStripMenuItem.Enabled = False
frmPrincipal.Show()
Me.Hide()
End If
Else
MessageBox.Show("Datos no validos " & txtUsuario.Text & " no existe o la contrasea es
incorrecta" & vbCrLf & "Introduzca nuevamente los datos", "Error en la autenticacion",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End Sub
Private Sub btnSalir_Click(sender As Object, e As EventArgs) Handles btnSalir.Click
Application.Exit()

End Sub
Private Sub txtUsuario_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtUsuario.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub txtContrasea_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtContrasea.KeyPress
If e.KeyChar = ChrW(Keys.Enter) Then
btnIngresar.PerformClick()
End If
End Sub
Private Sub frmAutenticacion_FormClosed(sender As Object, e As FormClosedEventArgs) Handles
MyBase.FormClosed
Application.Exit()
End Sub
End Class

ANEXO D-6: CODIGO FUENTE, GESTION DE PERSONAL, MODULO


ADMINISTRACION
Public Class frmEmpleados
Private Sub CT_EmpleadosBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
Handles CT_EmpleadosBindingNavigatorSaveItem.Click
Try
Me.CT_EmpleadosBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Ds_Empleados)
Actualizar()
MessageBox.Show("Cambios guardados con exito", "Guardando datos",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
If MessageBox.Show("Ocurrio un error en la base de datos" & vbCrLf & "desea continuar?",
"Error al guardar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) =
Windows.Forms.DialogResult.No Then
Actualizar()
End If
End Try
End Sub
Private Sub frmEmpleados_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Actualizar()
End Sub
Private Sub Botones(ByVal x As Boolean)
BindingNavigatorAddNewItem.Visible = x
BindingNavigatorModificarItem.Visible = x
BindingNavigatorDeleteItem.Visible = x
CT_EmpleadosBindingNavigatorSaveItem.Visible = Not x
BindingNavigatorCancelarItem.Visible = Not x
End Sub
Private Sub Bloquear(ByVal x As Boolean)
Cod_empleadoMaskedTextBox.ReadOnly = x
NombreMaskedTextBox.ReadOnly = x
Direccion_emplMaskedTextBox.ReadOnly = x
Telefono_emplMaskedTextBox.ReadOnly = x
ContraseaMaskedTextBox.ReadOnly = x
Fecha_contratacionDateTimePicker.Enabled = Not x
btnCargo.Visible = Not x
SalarioMaskedTextBox.ReadOnly = x
btnBuscaFoto.Visible = Not x
End Sub
Private Sub Actualizar()
Me.CT_EmpleadosTableAdapter.Fill(Me.Ds_Empleados.CT_Empleados)
Botones(True)
Bloquear(True)
Me.CT_EmpleadosDataGridView.Enabled = True
Me.CT_EmpleadosDataGridView.Focus()
End Sub
Private Sub Cod_empleadoMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Cod_empleadoMaskedTextBox.Validating
If Cod_empleadoMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Cod_empleadoMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Cod_empleadoMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub NombreMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles NombreMaskedTextBox.Validating
If NombreMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(NombreMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(NombreMaskedTextBox, "Dato no valido")

End If
End Sub
Private Sub CIMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles CIMaskedTextBox.Validating
If CIMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(CIMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(CIMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub Direccion_emplMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Direccion_emplMaskedTextBox.Validating
If Direccion_emplMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Direccion_emplMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Direccion_emplMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub Telefono_emplMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Telefono_emplMaskedTextBox.Validating
If Telefono_emplMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Telefono_emplMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Telefono_emplMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub SalarioMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles SalarioMaskedTextBox.Validating
If SalarioMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(SalarioMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(SalarioMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub Cod_empleadoMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles Cod_empleadoMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub NombreMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
NombreMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub CIMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
CIMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub Direccion_emplMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles Direccion_emplMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then

e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub Telefono_emplMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles Telefono_emplMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnCargo.Click
frmManualfunc.Show()
End Sub
Private Sub SalarioMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
SalarioMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub ContraseaMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles ContraseaMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub btnBuscar_Click(sender As Object, e As EventArgs) Handles btnBuscar.Click
Dim dato As String = txtDato.Text
Try
If cboModo.Items(1) = cboModo.Text Then
Me.CT_EmpleadosTableAdapter.FillByCodigoemp(Me.Ds_Empleados.CT_Empleados, dato)
End If
If cboModo.Items(2) = cboModo.Text Then
Me.CT_EmpleadosTableAdapter.FillBynombre(Me.Ds_Empleados.CT_Empleados, dato &
"%")
End If
Catch ex As Exception
End Try
End Sub
Private Sub cboModo_SelectedValueChanged(sender As Object, e As EventArgs) Handles
cboModo.SelectedValueChanged
If cboModo.Items(0) = cboModo.Text Then
Me.CT_EmpleadosTableAdapter.Fill(Me.Ds_Empleados.CT_Empleados)
txtDato.Clear()
Else
txtDato.Clear()
txtDato.Focus()
End If
End Sub
Private Sub txtDato_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtDato.KeyPress
If e.KeyChar = ChrW(Keys.Enter) Then
btnBuscar.PerformClick()
End If
End Sub
Private Sub BindingNavigatorAddNewItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorAddNewItem.Click
Botones(False)
Bloquear(False)
Me.CT_EmpleadosDataGridView.Enabled = False
ErrorProvider1.Dispose()
Cod_empleadoMaskedTextBox.Focus()
End Sub

Private Sub BindingNavigatorModificarItem_Click(sender As Object, e As EventArgs) Handles


BindingNavigatorModificarItem.Click
Botones(False)
Bloquear(False)
Me.CT_EmpleadosDataGridView.Enabled = False
ErrorProvider1.Dispose()
Cod_empleadoMaskedTextBox.Focus()
End Sub
Private Sub BindingNavigatorDeleteItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorDeleteItem.Click
Botones(False)
Me.CT_EmpleadosDataGridView.Enabled = False
End Sub
Private Sub BindingNavigatorCancelarItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorCancelarItem.Click
Actualizar()
End Sub
Private Sub btnBuscaFoto_Click(sender As Object, e As EventArgs) Handles btnBuscaFoto.Click
Try
Dim foto As String
OpenFileDialog1.Filter = "Imagenes *.jpg|*.jpg|Imagenes *.png|*.png|Todos los archivos *.*|
*.*"
OpenFileDialog1.ShowDialog()
foto = OpenFileDialog1.FileName
FotoPictureBox.Image = System.Drawing.Image.FromFile(foto)
Catch ex As Exception
MessageBox.Show("Imagen no valida", "Error de tipo de dato", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
End Class

ANEXO D-7: CODIGO FUENTE, MANUAL DE FUNCIONES, MODULO


ADMINISTRACION
Public Class frmOrganigrama
Private Sub btnGerenteG_Click(sender As Object, e As EventArgs) Handles btnGerenteG.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_ggeneral.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnGerenteprod_Click(sender As Object, e As EventArgs) Handles
btnGerenteprod.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_gproduccion.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnContador_Click(sender As Object, e As EventArgs) Handles btnContador.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_contador.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnSecretaria_Click(sender As Object, e As EventArgs) Handles btnSecretaria.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_secretaria.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnAsGeProd_Click(sender As Object, e As EventArgs) Handles btnAsGeProd.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_asistenteg.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnJefeProd_Click(sender As Object, e As EventArgs) Handles btnJefeProd.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_jdeplanta.pdf"
Try
loProceso = Process.Start(loPSI)

Catch Exp As Exception


MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnEncAlmIns_Click(sender As Object, e As EventArgs) Handles btnEncAlmIns.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_almaceni.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnEncAlmProdTerm_Click(sender As Object, e As EventArgs) Handles
btnEncAlmProdTerm.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_almacenpt.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnAyuAlmIns_Click(sender As Object, e As EventArgs) Handles btnAyuAlmIns.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_aalmaceni.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnAyuAlmProdTern_Click(sender As Object, e As EventArgs) Handles
btnAyuAlmProdTern.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_aalmacenpt.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnCortador_Click(sender As Object, e As EventArgs) Handles btnCortador.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_smolido.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnOpCutter_Click(sender As Object, e As EventArgs) Handles btnOpCutter.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_smezclado.pdf"

Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnAyuOpCutter_Click(sender As Object, e As EventArgs) Handles
btnAyuOpCutter.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_asmezclado.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnEmbutidor_Click(sender As Object, e As EventArgs) Handles btnEmbutidor.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_sembutido.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnAyuEmbutidor_Click(sender As Object, e As EventArgs) Handles
btnAyuEmbutidor.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_asembutido.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnEncHorno_Click(sender As Object, e As EventArgs) Handles btnEncHorno.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_shornos.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnEncCoci_Click(sender As Object, e As EventArgs) Handles btnEncCoci.Click
Dim loPSI As New ProcessStartInfo
Dim loProceso As New Process
loPSI.FileName = Application.StartupPath & "\mf_shornos.pdf"
Try
loProceso = Process.Start(loPSI)
Catch Exp As Exception
MessageBox.Show(Exp.Message, "Carga de archivo", MessageBoxButtons.OK,
MessageBoxIcon.Information)
End Try
End Sub
End Class

ANEXO D-8: CODIGO FUENTE, BOLETAS DE PAGO, MODULO


ADMINISTRACION
Public Class frmPlanillaSueldos
Dim sueldobase, bp, he, che, ba, dom, ob, afp, rciva, od, tg, td, lp As Decimal
Dim gestion, codsuel, carnet, dt, dd As Integer
Dim mes, apenom, carg As String
Dim fcont, hoy, diferencia As Date
Private Sub Imprimir()
PrintDialog1.ShowDialog()
PrintForm1.PrinterSettings = PrintDialog1.PrinterSettings
PrintForm1.Print()
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
frmBuscaEmpleado.ShowDialog()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs)
Close()
End Sub
Private Sub txtSuelBase_TextChanged(sender As Object, e As EventArgs) Handles
txtSuelBase.TextChanged
Try
sueldobase = txtSuelBase.Text
txtTG.Text = Format(sueldobase + bp + che + ba + dom + ob, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub txtBP_TextChanged(sender As Object, e As EventArgs) Handles txtBP.TextChanged
Try
bp = txtBP.Text
txtTG.Text = Format(sueldobase + bp + che + ba + dom + ob, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub txtHE_TextChanged(sender As Object, e As EventArgs) Handles txtHE.TextChanged
Try
he = txtHE.Text
che = (sueldobase / 207.84) * 0.3 * he
txtCHE.Text = che
txtTG.Text = Format(sueldobase + bp + che + ba + dom + ob, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub txtBA_TextChanged(sender As Object, e As EventArgs) Handles txtBA.TextChanged
Try
ba = txtBA.Text
txtTG.Text = Format(sueldobase + bp + che + ba + dom + ob, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles
txtdom.TextChanged
Try
dom = txtdom.Text
txtTG.Text = Format(sueldobase + bp + che + ba + dom + ob, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub txtob_TextChanged(sender As Object, e As EventArgs) Handles txtob.TextChanged
Try
ob = txtob.Text
txtTG.Text = Format(sueldobase + bp + che + ba + dom + ob, "0.00")
Catch ex As Exception
End Try

End Sub
Private Sub txtrciva_TextChanged(sender As Object, e As EventArgs) Handles
txtrciva.TextChanged
Try
rciva = txtrciva.Text
txtTD.Text = Format(afp + rciva + od, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub txtOtros_TextChanged(sender As Object, e As EventArgs) Handles
txtOtros.TextChanged
Try
od = txtOtros.Text
txtTD.Text = Format(afp + rciva + od, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub txtTG_TextChanged(sender As Object, e As EventArgs) Handles txtTG.TextChanged
Try
tg = txtTG.Text
afp = tg * 0.1221
txtAFP.Text = Format(afp, "0.00")
rciva = (tg - afp - 2400) * 0.13
If rciva > 0 Then
txtrciva.Text = Format(rciva, "0.00")
Else
txtrciva.Text = 0
End If
txtLP.Text = Format(tg - td, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub txtAFP_TextChanged(sender As Object, e As EventArgs) Handles txtAFP.TextChanged
Try
txtTD.Text = Format(afp + rciva + od, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub txtTD_TextChanged(sender As Object, e As EventArgs) Handles txtTD.TextChanged
Try
td = txtTD.Text
txtLP.Text = Format(tg - td, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub ComboBox1_SelectedValueChanged(sender As Object, e As EventArgs) Handles
cboMes.SelectedValueChanged
If cboMes.Items(0) = cboMes.Text Then
mes = cboMes.Text
End If
If cboMes.Items(1) = cboMes.Text Then
mes = cboMes.Text
End If
If cboMes.Items(2) = cboMes.Text Then
mes = cboMes.Text
End If
If cboMes.Items(3) = cboMes.Text Then
mes = cboMes.Text
End If
If cboMes.Items(4) = cboMes.Text Then
mes = cboMes.Text
End If
If cboMes.Items(5) = cboMes.Text Then
mes = cboMes.Text
End If
If cboMes.Items(6) = cboMes.Text Then

mes = cboMes.Text
End If
If cboMes.Items(7) = cboMes.Text Then
mes = cboMes.Text
End If
If cboMes.Items(8) = cboMes.Text Then
mes = cboMes.Text
End If
If cboMes.Items(9) = cboMes.Text Then
mes = cboMes.Text
End If
If cboMes.Items(10) = cboMes.Text Then
mes = cboMes.Text
End If
If cboMes.Items(11) = cboMes.Text Then
mes = cboMes.Text
End If
End Sub
Private Sub cboGestion_SelectedValueChanged(sender As Object, e As EventArgs) Handles
cboGestion.SelectedValueChanged
If cboGestion.Items(0) = cboGestion.Text Then
gestion = cboGestion.Text
End If
If cboGestion.Items(1) = cboGestion.Text Then
gestion = cboGestion.Text
End If
If cboGestion.Items(2) = cboGestion.Text Then
gestion = cboGestion.Text
End If
If cboGestion.Items(3) = cboGestion.Text Then
gestion = cboGestion.Text
End If
If cboGestion.Items(4) = cboGestion.Text Then
gestion = cboGestion.Text
End If
If cboGestion.Items(5) = cboGestion.Text Then
gestion = cboGestion.Text
End If
If cboGestion.Items(6) = cboGestion.Text Then
gestion = cboGestion.Text
End If
If cboGestion.Items(7) = cboGestion.Text Then
gestion = cboGestion.Text
End If
If cboGestion.Items(8) = cboGestion.Text Then
gestion = cboGestion.Text
End If
If cboGestion.Items(9) = cboGestion.Text Then
gestion = cboGestion.Text
End If
End Sub
Private Sub txtApNo_TextChanged(sender As Object, e As EventArgs) Handles
txtApNo.TextChanged
apenom = txtApNo.Text
End Sub
Private Sub txtCI_TextChanged(sender As Object, e As EventArgs) Handles txtCI.TextChanged
carnet = txtCI.Text
End Sub
Private Sub txtFechcont_TextChanged(sender As Object, e As EventArgs) Handles
txtFechcont.TextChanged
fcont = txtFechcont.Text
End Sub
Private Sub txtCar_TextChanged(sender As Object, e As EventArgs) Handles txtCar.TextChanged
carg = txtCar.Text
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click


Dim odaptersueld As New dsSueldosTableAdapters.CT_SueldosTableAdapter
codsuel = odaptersueld.ScalarQueryCuentaSuel
odaptersueld.InsertQuerySueldo(codsuel, carnet, apenom, carg, fcont, mes, gestion,
txtDiatrab.Text, salario, ba, he, che, bp, dom, ob, tg, afp, rciva, od, td, lp)
Imprimir()
End Sub
Private Sub txtDiasDom_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub txtDiatrab_TextChanged(sender As Object, e As EventArgs) Handles
txtDiatrab.TextChanged
dt = txtDiatrab.Text
End Sub
Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click
Dim ant As Decimal
Dim bpdia, bpmes, bpgest, bddia, bdmes, bdgest As Integer
Dim odaptercont As New ds_EmpleadosTableAdapters.CT_EmpleadosTableAdapter
bddia = odaptercont.ScalarQueryDiaCont(txtcodemp.Text)
bdmes = odaptercont.ScalarQueryMesCont(txtcodemp.Text)
bdgest = odaptercont.ScalarQueryGestCont(txtcodemp.Text)
bpgest = DateTimePicker1.Value.Year
bpmes = DateTimePicker1.Value.Month
bpdia = DateTimePicker1.Value.Day
ant = (bpgest - bdgest) + (bpmes - bdmes) / 12 + (bpdia - bddia) / 31
Select Case ant
Case Is < 2
txtBA.Text = 0
Case Is < 5
ba = sueldobase * 0.05
txtBA.Text = ba
Case Is < 8
ba = sueldobase * 0.11
txtBA.Text = ba
Case Is < 11
ba = sueldobase * 0.18
txtBA.Text = ba
Case Is < 15
ba = sueldobase * 0.26
txtBA.Text = ba
Case Is < 20
ba = sueldobase * 0.34
txtBA.Text = ba
Case Is < 25
ba = sueldobase * 0.42
txtBA.Text = ba
Case Is >= 25
ba = sueldobase * 0.5
txtBA.Text = ba
Case Else
End Select
End Sub
Private Sub txtLP_TextChanged(sender As Object, e As EventArgs) Handles txtLP.TextChanged
lp = txtLP.Text
End Sub
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles
CheckBox1.CheckedChanged
txtdom.Text = Format((sueldobase / dt) * 4, "0.00")
End Sub
End Class

ANEXO D-9: CODIGO FUENTE, PLANILLA DE SUELDOS PATRONALES,


MODULO ADMINISTRACION
Public Class frmPlanSalPat
Private Sub CT_SueldosBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
Me.Validate()
Me.CT_SueldosBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DsSueldos)
End Sub
Private Sub frmPlanSalPat_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.CT_SueldosTableAdapter.Fill(Me.DsSueldos.CT_Sueldos)
End Sub
Private Sub Imprimir()
PrintDialog1.ShowDialog()
PrintForm1.PrinterSettings = PrintDialog1.PrinterSettings
PrintForm1.Print()
End Sub
Private Sub btnFiltro_Click(sender As Object, e As EventArgs) Handles btnFiltro.Click
Me.CT_SueldosTableAdapter.FillByMesGestion(Me.DsSueldos.CT_Sueldos, cboMes.Text,
cboGestion.Text)
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Imprimir()
End Sub
End Class

ANEXO D-10: CODIGO FUENTE, GESTION DE PROVEEDORES, MODULO


PROVISION
Public Class frmProveedor
Private Sub CT_ProveedoresBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
Handles CT_ProveedoresBindingNavigatorSaveItem.Click
Try
Me.CT_ProveedoresBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DsProveedor)
Actualizar()
MessageBox.Show("Cambios guardados con exito", "Guardando datos",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
If MessageBox.Show("Ocurrio un error en la base de datos" & vbCrLf & "desea continuar?",
"Error al guardar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) =
Windows.Forms.DialogResult.No Then
Actualizar()
End If
End Try
End Sub
Private Sub frmProveedor_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Actualizar()
End Sub
Private Sub Botones(ByVal x As Boolean)
BindingNavigatorAddNewItem.Visible = x
BindingNavigatorModificarItem.Visible = x
BindingNavigatorDeleteItem.Visible = x
CT_ProveedoresBindingNavigatorSaveItem.Visible = Not x
BindingNavigatorCancelarItem.Visible = Not x
End Sub
Private Sub Bloquear(ByVal x As Boolean)
Cod_ProveedorMaskedTextBox.ReadOnly = x
Empresa_ProvMaskedTextBox.ReadOnly = x
Direccion_ProvMaskedTextBox.ReadOnly = x
Telefono_ProvMaskedTextBox.ReadOnly = x
Saldo_cppMaskedTextBox.ReadOnly = x
CI_NITMaskedTextBox.ReadOnly = x
End Sub
Private Sub Actualizar()
Me.CT_ProveedoresTableAdapter.Fill(Me.DsProveedor.CT_Proveedores)
Botones(True)
Bloquear(True)
Me.CT_ProveedoresDataGridView.Enabled = True
Me.CT_ProveedoresDataGridView.Focus()
End Sub
Private Sub Cod_ProvMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Cod_ProveedorMaskedTextBox.Validating
If Cod_ProveedorMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Cod_ProveedorMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Cod_ProveedorMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub EmpresaMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Empresa_ProvMaskedTextBox.Validating
If Empresa_ProvMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Empresa_ProvMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Empresa_ProvMaskedTextBox, "Dato no valido")
End If
End Sub

Private Sub DireccionMaskedTextBox_Validating(sender As Object, e As


System.ComponentModel.CancelEventArgs) Handles Direccion_ProvMaskedTextBox.Validating
If Direccion_ProvMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Direccion_ProvMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Direccion_ProvMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub TelefonoMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Telefono_ProvMaskedTextBox.Validating
If Telefono_ProvMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Telefono_ProvMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Telefono_ProvMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub CI_NITMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles CI_NITMaskedTextBox.Validating
If CI_NITMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(CI_NITMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(CI_NITMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub Saldo_provMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Saldo_cppMaskedTextBox.Validating
If Saldo_cppMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Saldo_cppMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Saldo_cppMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub Cod_ProvMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles Cod_ProveedorMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub EmpresaMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles Empresa_ProvMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub DireccionMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles Direccion_ProvMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub TelefonoMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
Telefono_ProvMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")

End If
End Sub
Private Sub CI_NITMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
CI_NITMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub btnBuscar_Click(sender As Object, e As EventArgs) Handles btnBuscar.Click
Dim dato As String = txtDato.Text
Try
If cboModo.Items(1) = cboModo.Text Then
Me.CT_ProveedoresTableAdapter.FillByCodigo(Me.DsProveedor.CT_Proveedores, dato)
End If
If cboModo.Items(2) = cboModo.Text Then
Me.CT_ProveedoresTableAdapter.FillByempresa(Me.DsProveedor.CT_Proveedores, dato &
"%")
End If
Catch ex As Exception
End Try
End Sub
Private Sub cboModo_SelectedValueChanged(sender As Object, e As EventArgs) Handles
cboModo.SelectedValueChanged
If cboModo.Items(0) = cboModo.Text Then
Me.CT_ProveedoresTableAdapter.Fill(Me.DsProveedor.CT_Proveedores)
txtDato.Clear()
Else
txtDato.Clear()
txtDato.Focus()
End If
End Sub
Private Sub txtDato_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtDato.KeyPress
If e.KeyChar = ChrW(Keys.Enter) Then
btnBuscar.PerformClick()
End If
End Sub
Private Sub BindingNavigatorAddNewItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorAddNewItem.Click
Botones(False)
Bloquear(False)
Me.CT_ProveedoresDataGridView.Enabled = False
ErrorProvider1.Dispose()
Cod_ProveedorMaskedTextBox.Focus()
End Sub
Private Sub BindingNavigatorModificarItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorModificarItem.Click
Botones(False)
Bloquear(False)
Me.CT_ProveedoresDataGridView.Enabled = False
ErrorProvider1.Dispose()
Cod_ProveedorMaskedTextBox.Focus()
End Sub
Private Sub BindingNavigatorDeleteItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorDeleteItem.Click
Botones(False)
Me.CT_ProveedoresDataGridView.Enabled = False
End Sub
Private Sub BindingNavigatorCancelarItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorCancelarItem.Click
Actualizar()
End Sub
End Class

ANEXO D-11: CODIGO FUENTE, COMPRAS, MODULO PROVISION


Public Class frmCompra
Private Sub frmCompra_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim odaptercomp As New dsComprasTableAdapters.CT_ComprasTableAdapter
contcompras = odaptercomp.ScalarQueryCuentaCompras
txtCodComp.Text = contcompras + 1
End Sub
Private Sub Imprimir()
PrintDialog1.ShowDialog()
PrintForm1.PrinterSettings = PrintDialog1.PrinterSettings
PrintForm1.Print()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim odaptercomp As New dsComprasTableAdapters.CT_ComprasTableAdapter
odaptercomp.InsertQueryCompras(txtCodComp.Text, txtProvee.Text, txtCantidad.Text,
txtDescIn.Text, txtImporte.Text)
Dim odapterinsum As New dsInsumosTableAdapters.CT_InsumosTableAdapter
odapterinsum.UpdateQueryInsumoscant(cantact + cantidadinsumo, codinsum)
MessageBox.Show("Registro guardado con exito", "Guardando datos", MessageBoxButtons.OK,
MessageBoxIcon.Information)
Imprimir()
contcompras = odaptercomp.ScalarQueryCuentaCompras
txtCodComp.Text = contcompras + 1
txtDescIn.Clear()
txtProvee.Clear()
txtCantidad.Clear()
txtImporte.Clear()
txtProvee.Focus()
End Sub
Private Sub txtDescIn_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtDescIn.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub txtCantidad_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtCantidad.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub txtImporte_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtImporte.KeyPress
If e.KeyChar = ChrW(Keys.Enter) Then
Button1.PerformClick()
End If
End Sub
Private Sub btnBuscaProv_Click(sender As Object, e As EventArgs) Handles btnBuscaProv.Click
frmBuscaProveedor.ShowDialog()
End Sub
Private Sub btnBuscaInsumo_Click(sender As Object, e As EventArgs) Handles
btnBuscaInsumo.Click
frmBuscaInsumo.ShowDialog()
End Sub
Dim cantidadinsumo As Integer
Private Sub txtCodInsumo_TextChanged(sender As Object, e As EventArgs) Handles
txtCodInsumo.TextChanged
codinsum = txtCodInsumo.Text
End Sub
Private Sub txtCantidad_TextChanged(sender As Object, e As EventArgs) Handles
txtCantidad.TextChanged
Try
cantidadinsumo = txtCantidad.Text

Catch ex As Exception
End Try
End Sub
End Class

ANEXO D-12: CODIGO FUENTE, PRODUCTOS TERMINADOS, MODULO


PRODUCCION
Public Class frmProductos
Private Sub CT_ProductosBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
Handles CT_ProductosBindingNavigatorSaveItem.Click
Try
Me.CT_ProductosBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DsProductos)
Actualizar()
MessageBox.Show("Cambios guardados con exito", "Guardando datos",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
If MessageBox.Show("Ocurrio un error en la base de datos" & vbCrLf & "desea continuar?",
"Error al guardar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) =
Windows.Forms.DialogResult.No Then
Actualizar()
End If
End Try
End Sub
Private Sub frmInventario_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Actualizar()
End Sub
Private Sub Botones(ByVal x As Boolean)
BindingNavigatorAddNewItem.Visible = x
BindingNavigatorModificarItem.Visible = x
BindingNavigatorDeleteItem.Visible = x
CT_ProductosBindingNavigatorSaveItem.Visible = Not x
BindingNavigatorCancelarItem.Visible = Not x
End Sub
Private Sub Bloquear(ByVal x As Boolean)
Cod_ProductoMaskedTextBox.ReadOnly = x
DescripcionMaskedTextBox.ReadOnly = x
PrecioMaskedTextBox.ReadOnly = x
ExistenciasMaskedTextBox.ReadOnly = x
End Sub
Private Sub Actualizar()
Me.CT_ProductosTableAdapter.Fill(Me.DsProductos.CT_Productos)
Botones(True)
Bloquear(True)
Me.CT_ProductosDataGridView.Enabled = True
Me.CT_ProductosDataGridView.Focus()
End Sub
Private Sub Cod_productoMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Cod_productoMaskedTextBox.Validating
If Cod_productoMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Cod_productoMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Cod_productoMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub DescripcionMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles DescripcionMaskedTextBox.Validating
If DescripcionMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(DescripcionMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(DescripcionMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub PrecioMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles PrecioMaskedTextBox.Validating
If PrecioMaskedTextBox.MaskCompleted Then

e.Cancel = False
ErrorProvider1.SetError(PrecioMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(PrecioMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub Existencia_fisicaMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles ExistenciasMaskedTextBox.Validating
If ExistenciasMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(ExistenciasMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(ExistenciasMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub Saldo_invpMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Saldo_invpMaskedTextBox.Validating
If Saldo_invpMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Saldo_invpMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Saldo_invpMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub btnBuscar_Click(sender As Object, e As EventArgs) Handles btnBuscar.Click
Dim dato As String = txtDato.Text
Try
If cboModo.Items(1) = cboModo.Text Then
Me.CT_ProductosTableAdapter.FillByProducto(Me.DsProductos.CT_Productos, dato)
End If
If cboModo.Items(2) = cboModo.Text Then
Me.CT_ProductosTableAdapter.FillByProducto(Me.DsProductos.CT_Productos, dato & "%")
End If
Catch ex As Exception
End Try
End Sub
Private Sub cboModo_SelectedValueChanged(sender As Object, e As EventArgs) Handles
cboModo.SelectedValueChanged
If cboModo.Items(0) = cboModo.Text Then
Me.CT_ProductosTableAdapter.Fill(Me.DsProductos.CT_Productos)
txtDato.Clear()
Else
txtDato.Clear()
txtDato.Focus()
End If
End Sub
Private Sub txtDato_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtDato.KeyPress
If e.KeyChar = ChrW(Keys.Enter) Then
btnBuscar.PerformClick()
End If
End Sub
Private Sub BindingNavigatorAddNewItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorAddNewItem.Click
Botones(False)
Bloquear(False)
Me.CT_ProductosDataGridView.Enabled = False
ErrorProvider1.Dispose()
Cod_productoMaskedTextBox.Focus()
End Sub
Private Sub BindingNavigatorModificarItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorModificarItem.Click
Botones(False)

Bloquear(False)
Me.CT_ProductosDataGridView.Enabled = False
ErrorProvider1.Dispose()
Cod_productoMaskedTextBox.Focus()
End Sub
Private Sub BindingNavigatorDeleteItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorDeleteItem.Click
Botones(False)
Me.CT_ProductosDataGridView.Enabled = False
End Sub
Private Sub BindingNavigatorCancelarItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorCancelarItem.Click
Actualizar()
End Sub
Private Sub Cod_productoMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles Cod_productoMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub DescripcionMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles DescripcionMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub PrecioMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
PrecioMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub ExistenciasMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles ExistenciasMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
End Class

ANEXO D-13: CODIGO FUENTE, INSUMOS, MODULO PRODUCCION


Public Class frmInsumos
Private Sub CT_InsumosBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
Handles CT_InsumosBindingNavigatorSaveItem.Click
Try
Me.CT_InsumosBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DsInsumos)
Actualizar()
MessageBox.Show("Cambios guardados con exito", "Guardando datos",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
If MessageBox.Show("Ocurrio un error en la base de datos" & vbCrLf & "desea continuar?",
"Error al guardar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) =
Windows.Forms.DialogResult.No Then
Actualizar()
End If
End Try
End Sub
Private Sub frmInsumos_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Actualizar()
End Sub
Private Sub Botones(ByVal x As Boolean)
BindingNavigatorAddNewItem.Visible = x
BindingNavigatorModificarItem.Visible = x
BindingNavigatorDeleteItem.Visible = x
CT_InsumosBindingNavigatorSaveItem.Visible = Not x
BindingNavigatorCancelarItem.Visible = Not x
End Sub
Private Sub Bloquear(ByVal x As Boolean)
Cod_insumoMaskedTextBox.ReadOnly = x
DescripcionMaskedTextBox.ReadOnly = x
Existencia_insMaskedTextBox.ReadOnly = x
Saldo_inventarioMaskedTextBox.ReadOnly = x
End Sub
Private Sub Actualizar()
Me.CT_InsumosTableAdapter.Fill(Me.DsInsumos.CT_Insumos)
Botones(True)
Bloquear(True)
Me.CT_InsumosDataGridView.Enabled = True
Me.CT_InsumosDataGridView.Focus()
End Sub
Private Sub Cod_insumoMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Cod_insumoMaskedTextBox.Validating
If Cod_insumoMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Cod_insumoMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Cod_insumoMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub DescripcionMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles DescripcionMaskedTextBox.Validating
If DescripcionMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(DescripcionMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(DescripcionMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub PrecioMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles PrecioMaskedTextBox.Validating
If PrecioMaskedTextBox.MaskCompleted Then
e.Cancel = False

ErrorProvider1.SetError(PrecioMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(PrecioMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub Ficha_tecnicaMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Ficha_tecnicaMaskedTextBox.Validating
If Ficha_tecnicaMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Ficha_tecnicaMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Ficha_tecnicaMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub Existencia_fisicaMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Existencia_insMaskedTextBox.Validating
If Existencia_insMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Existencia_insMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Existencia_insMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub Saldo_inviMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Saldo_inventarioMaskedTextBox.Validating
If Saldo_inventarioMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Saldo_inventarioMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Saldo_inventarioMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub Cod_insumoMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles Cod_insumoMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub DescripcionMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles DescripcionMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub PrecioMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
PrecioMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub Ficha_tecnicaMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles Ficha_tecnicaMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub Existencia_fisicaMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles Existencia_insMaskedTextBox.KeyPress

If e.KeyChar = Convert.ToChar(Keys.Enter) Then


e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub btnBuscar_Click(sender As Object, e As EventArgs) Handles btnBuscar.Click
Dim dato As String = txtDato.Text
Try
If cboModo.Items(1) = cboModo.Text Then
Me.CT_InsumosTableAdapter.FillByCodigo(Me.DsInsumos.CT_Insumos, dato)
End If
If cboModo.Items(2) = cboModo.Text Then
Me.CT_InsumosTableAdapter.FillByInsumo(Me.DsInsumos.CT_Insumos, dato & "%")
End If
Catch ex As Exception
End Try
End Sub
Private Sub cboModo_SelectedValueChanged(sender As Object, e As EventArgs) Handles
cboModo.SelectedValueChanged
If cboModo.Items(0) = cboModo.Text Then
Me.CT_InsumosTableAdapter.Fill(Me.DsInsumos.CT_Insumos)
txtDato.Clear()
Else
txtDato.Clear()
txtDato.Focus()
End If
End Sub
Private Sub txtDato_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtDato.KeyPress
If e.KeyChar = ChrW(Keys.Enter) Then
btnBuscar.PerformClick()
End If
End Sub
Private Sub BindingNavigatorAddNewItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorAddNewItem.Click
Botones(False)
Bloquear(False)
Me.CT_InsumosDataGridView.Enabled = False
ErrorProvider1.Dispose()
Cod_insumoMaskedTextBox.Focus()
End Sub
Private Sub BindingNavigatorModificarItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorModificarItem.Click
Botones(False)
Bloquear(False)
Me.CT_InsumosDataGridView.Enabled = False
ErrorProvider1.Dispose()
Cod_insumoMaskedTextBox.Focus()
End Sub
Private Sub BindingNavigatorDeleteItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorDeleteItem.Click
Botones(False)
Me.CT_InsumosDataGridView.Enabled = False
End Sub
Private Sub BindingNavigatorCancelarItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorCancelarItem.Click
Actualizar()
End Sub
End Class

ANEXO D-14: CODIGO FUENTE, PROGRAMA MAESTRO DE PRODUCCION,


MODULO PRODUCCION
Public Class frmSimplex
Dim prex1 As Decimal = 38
Dim prex2 As Decimal = 41
Dim prex3 As Decimal = 35
Dim prex4 As Decimal = 36
Dim prex5 As Decimal = 47
Dim chod1 As Decimal = 21
Dim chod2 As Decimal = 21
Dim chod3 As Decimal = 21
Dim chod4 As Decimal = 33
Dim chod5 As Decimal = 31
Dim chon1 As Decimal = chod1 * 1.3
Dim chon2 As Decimal = chod2 * 1.3
Dim chon3 As Decimal = chod3 * 1.3
Dim chon4 As Decimal = chod4 * 1.3
Dim chon5 As Decimal = chod5 * 1.3
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
txtsold1.Text = Format(prex1 - chod1, "0,00")
txtsold2.Text = Format(prex2 - chod2, "0,00")
txtsold3.Text = Format(prex3 - chod3, "0,00")
txtsold4.Text = Format(prex4 - chod4, "0,00")
txtsold5.Text = Format(prex5 - chod5, "0,00")
txtsoln1.Text = Format(prex1 - chon1, "0,00")
txtsoln2.Text = Format(prex2 - chon2, "0,00")
txtsoln3.Text = Format(prex3 - chon3, "0,00")
txtsoln4.Text = Format(prex4 - chon4, "0,00")
txtsoln5.Text = Format(prex5 - chon5, "0,00")
Dim objExcel As Excel.Application
Dim xLibro As Excel.Workbook
objExcel = New Excel.Application
xLibro = objExcel.Workbooks.Open("C:\Users\Victor\Desktop\Libro1.xlsm")
xLibro.Application.Cells(6, 15) = txtdh1.Text * 80
xLibro.Application.Cells(7, 15) = txtdh2.Text * 80
xLibro.Application.Cells(8, 15) = txtdh3.Text * 80
xLibro.Application.Cells(9, 15) = txtdh4.Text * 80
xLibro.Application.Cells(10, 15) = txtdh5.Text * 80
xLibro.Application.Cells(11, 15) = txtdh6.Text * 80
xLibro.Application.Cells(12, 15) = txtdh7.Text * 80
xLibro.Application.Cells(13, 15) = txtdh8.Text * 80
xLibro.Application.Cells(14, 15) = txtdh9.Text * 80
xLibro.Application.Cells(15, 15) = txtdh10.Text * 80
xLibro.Application.Cells(16, 15) = txtdh11.Text * 80
xLibro.Application.Cells(17, 15) = txtdh12.Text * 80
xLibro.Application.Cells(2, 3) = txtsold1.Text
xLibro.Application.Cells(2, 4) = txtsold2.Text
xLibro.Application.Cells(2, 5) = txtsold3.Text
xLibro.Application.Cells(2, 6) = txtsold4.Text
xLibro.Application.Cells(2, 7) = txtsold5.Text
xLibro.Application.Cells(2, 8) = txtsoln1.Text
xLibro.Application.Cells(2, 9) = txtsoln2.Text
xLibro.Application.Cells(2, 10) = txtsoln3.Text
xLibro.Application.Cells(2, 11) = txtsoln4.Text
xLibro.Application.Cells(2, 12) = txtsoln5.Text
xLibro.Close(SaveChanges:=True)
xLibro = Nothing
objExcel.Quit()
objExcel = Nothing
Dim ds As New DataSet()
Dim connectionString2 As String = "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data
Source=C:\Users\Victor\Desktop\Libro1.xlsm ;" & "Extended Properties=Excel 12.0"
Dim excelData As New OleDbDataAdapter("SELECT Descripcion,Valores FROM [Hoja2$] ",
connectionString2)
excelData.TableMappings.Add("Table", "ExcelSheet")

excelData.Fill(ds)
Me.DataGridView1.DataSource = ds.Tables(0)
Me.Refresh()
End Sub
Private Sub txtchod1_TextChanged(sender As Object, e As EventArgs)
chod1 = txtchod1.Text
End Sub
Private Sub txtpre1_TextChanged(sender As Object, e As EventArgs)
prex1 = txtpre1.Text
End Sub
Private Sub txtchon1_TextChanged(sender As Object, e As EventArgs)
chon1 = txtchon1.Text
End Sub
Private Sub txtchod2_TextChanged(sender As Object, e As EventArgs)
chod2 = txtchod2.Text
End Sub
Private Sub txtchod3_TextChanged(sender As Object, e As EventArgs)
chod3 = txtchod3.Text
End Sub
Private Sub txtchod4_TextChanged(sender As Object, e As EventArgs)
chod4 = txtchod4.Text
End Sub
Private Sub txtchod5_TextChanged(sender As Object, e As EventArgs)
chod5 = txtchod5.Text
End Sub
Private Sub txtchon2_TextChanged(sender As Object, e As EventArgs)
chon2 = txtchon2.Text
End Sub
Private Sub txtchon3_TextChanged(sender As Object, e As EventArgs)
chon3 = txtchon3.Text
End Sub
Private Sub txtchon4_TextChanged(sender As Object, e As EventArgs)
chon4 = txtchon4.Text
End Sub
Private Sub txtchon5_TextChanged(sender As Object, e As EventArgs)
chon5 = txtchon5.Text
End Sub
Private Sub txtpre2_TextChanged(sender As Object, e As EventArgs)
prex2 = txtpre2.Text
End Sub
Private Sub txtpre3_TextChanged(sender As Object, e As EventArgs)
prex3 = txtpre3.Text
End Sub
Private Sub txtpre4_TextChanged(sender As Object, e As EventArgs)
prex4 = txtpre4.Text
End Sub
Private Sub txtpre5_TextChanged(sender As Object, e As EventArgs)
prex5 = txtpre5.Text
End Sub
Private Sub frmSimplex_Load(sender As Object, e As EventArgs) Handles MyBase.Load
txtdh1.Text = 22
txtdh2.Text = 19
txtdh3.Text = 21
txtdh4.Text = 21
txtdh5.Text = 22
txtdh6.Text = 20
txtdh7.Text = 21
txtdh8.Text = 22
txtdh9.Text = 23
txtdh10.Text = 22
txtdh11.Text = 22
txtdh12.Text = 23
txtchod1.Text = chod1
txtchod2.Text = chod2
txtchod3.Text = chod3
txtchod4.Text = chod4

txtchod5.Text = chod5
txtchon1.Text = chon1
txtchon2.Text = chon2
txtchon3.Text = chon3
txtchon4.Text = chon4
txtchon5.Text = chon5
txtpre1.Text = prex1
txtpre2.Text = prex2
txtpre3.Text = prex3
txtpre4.Text = prex4
txtpre5.Text = prex5
Dim ds1 As New DataSet()
Dim connectionString As String = "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data
Source=C:\Users\Victor\Desktop\pronostico.xlsx ;" & "Extended Properties=Excel 12.0"
Dim excelData1 As New OleDbDataAdapter("SELECT * FROM [RESUMEN$] ", connectionString)
excelData1.TableMappings.Add("Table", "ExcelSheet")
excelData1.Fill(ds1)
Me.DataGridView3.DataSource = ds1.Tables(0)
Me.Refresh()
Me.DataGridView3.ClearSelection()
Me.DataGridView3.CurrentCell = Me.DataGridView3.Rows(Me.DataGridView3.RowCount - (14 Me.DateTimePicker1.Value.Month)).Cells(0)
Dim ds2 As New DataSet()
Dim excelData2 As New OleDbDataAdapter("SELECT * FROM [Datos$] ", connectionString)
excelData2.TableMappings.Add("Table", "ExcelSheet")
excelData2.Fill(ds2)
Me.DataGridView2.DataSource = ds2.Tables(0)
Me.Refresh()
Dim ds3 As New DataSet()
Dim exceldata3 As New OleDbDataAdapter("SELECT * FROM [Hoja3$] ", connectionString)
exceldata3.TableMappings.Add("Table", "ExcelSheet")
exceldata3.Fill(ds3)
Me.DataGridView4.DataSource = ds3.Tables(0)
Me.Refresh()
End Sub
End Class

ANEXO D-15: CODIGO FUENTE, GESTION DE CLIENTES, MODULO VENTAS


Public Class frmClientes
Private Sub CT_ClientesBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
Handles CT_ClientesBindingNavigatorSaveItem.Click
Try
Me.CT_ClientesBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Ds_Clientes)
Actualizar()
MessageBox.Show("Cambios guardados con exito", "Guardando datos",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
If MessageBox.Show("Ocurrio un error en la base de datos" & vbCrLf & "desea continuar?",
"Error al guardar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) =
Windows.Forms.DialogResult.No Then
Actualizar()
End If
End Try
End Sub
Private Sub frmClientes_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Actualizar()
End Sub
Private Sub Botones(ByVal x As Boolean)
BindingNavigatorAddNewItem.Visible = x
BindingNavigatorModificarItem.Visible = x
BindingNavigatorDeleteItem.Visible = x
CT_ClientesBindingNavigatorSaveItem.Visible = Not x
BindingNavigatorCancelarItem.Visible = Not x
End Sub
Private Sub Bloquear(ByVal x As Boolean)
Cod_clienteMaskedTextBox.ReadOnly = x
EmpresaMaskedTextBox.ReadOnly = x
DireccionMaskedTextBox.ReadOnly = x
TelefonoMaskedTextBox.ReadOnly = x
CI_NITMaskedTextBox.ReadOnly = x
Saldo_cpcMaskedTextBox.ReadOnly = x
End Sub
Private Sub Actualizar()
Me.CT_ClientesTableAdapter.Fill(Me.Ds_Clientes.CT_Clientes)
Botones(True)
Bloquear(True)
Me.CT_ClientesDataGridView.Enabled = True
Me.CT_ClientesDataGridView.Focus()
End Sub
Private Sub Cod_clienteMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Cod_clienteMaskedTextBox.Validating
If Cod_clienteMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Cod_clienteMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Cod_clienteMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub EmpresaMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles EmpresaMaskedTextBox.Validating
If EmpresaMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(EmpresaMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(EmpresaMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub DireccionMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles DireccionMaskedTextBox.Validating

If DireccionMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(DireccionMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(DireccionMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub TelefonoMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles TelefonoMaskedTextBox.Validating
If TelefonoMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(TelefonoMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(TelefonoMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub CI_NITMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles CI_NITMaskedTextBox.Validating
If CI_NITMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(CI_NITMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(CI_NITMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub Saldo_cpcMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Saldo_cpcMaskedTextBox.Validating
If Saldo_cpcMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Saldo_cpcMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Saldo_cpcMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub Cod_clienteMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles Cod_clienteMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub EmpresaMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles EmpresaMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub DireccionMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles DireccionMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub TelefonoMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
TelefonoMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub

Private Sub CI_NITMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles


CI_NITMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub btnBuscar_Click(sender As Object, e As EventArgs) Handles btnBuscar.Click
Dim dato As String = txtDato.Text
Try
If cboModo.Items(1) = cboModo.Text Then
Me.CT_ClientesTableAdapter.FillByCodigo(Me.Ds_Clientes.CT_Clientes, dato)
End If
If cboModo.Items(2) = cboModo.Text Then
Me.CT_ClientesTableAdapter.FillByEmpresa(Me.Ds_Clientes.CT_Clientes, dato & "%")
End If
If cboModo.Items(3) = cboModo.Text Then
Me.CT_ClientesTableAdapter.FillByCI_NIT(Me.Ds_Clientes.CT_Clientes, dato)
End If
Catch ex As Exception
End Try
End Sub
Private Sub cboModo_SelectedValueChanged(sender As Object, e As EventArgs) Handles
cboModo.SelectedValueChanged
If cboModo.Items(0) = cboModo.Text Then
Me.CT_ClientesTableAdapter.Fill(Me.Ds_Clientes.CT_Clientes)
txtDato.Clear()
Else
txtDato.Clear()
txtDato.Focus()
End If
End Sub
Private Sub txtDato_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtDato.KeyPress
If e.KeyChar = ChrW(Keys.Enter) Then
btnBuscar.PerformClick()
End If
End Sub
Private Sub BindingNavigatorAddNewItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorAddNewItem.Click
Botones(False)
Bloquear(False)
Me.CT_ClientesDataGridView.Enabled = False
ErrorProvider1.Dispose()
Cod_clienteMaskedTextBox.Focus()
End Sub
Private Sub BindingNavigatorModificarItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorModificarItem.Click
Botones(False)
Bloquear(False)
Me.CT_ClientesDataGridView.Enabled = False
ErrorProvider1.Dispose()
Cod_clienteMaskedTextBox.Focus()
End Sub
Private Sub BindingNavigatorDeleteItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorDeleteItem.Click
Botones(False)
Me.CT_ClientesDataGridView.Enabled = False
End Sub
Private Sub BindingNavigatorCancelarItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorCancelarItem.Click
Actualizar()
End Sub
End Class

ANEXO D-16: CODIGO FUENTE, VENTAS, MODULO VENTAS


Public Class frmVenta
Private Sub frmVenta_Load(sender As Object, e As EventArgs) Handles MyBase.Load
textoconta = 0
Dim odapterfac As New dsFacturaTableAdapters.CT_FacturasTableAdapter
contfactura = odapterfac.ScalarQueryContFac()
txtNoFac.Text = contfactura + 1
End Sub
Private Sub txtPre1_TextChanged(sender As Object, e As EventArgs) Handles
txtPre1.TextChanged
Try
pr1 = txtPre1.Text
txtTot1.Text = cant1 * pr1
f1 = txtTot1.Text
txtTotalPag.Text = f1 + f2 + f3 + f4 + f5 + f6
Catch ex As Exception
End Try
End Sub
Private Sub txtPre2_TextChanged(sender As Object,
txtPre2.TextChanged
Try
pr2 = txtPre2.Text
txtTot2.Text = cant2 * pr2
f2 = txtTot2.Text
txtTotalPag.Text = f1 + f2 + f3 + f4 + f5 + f6
Catch ex As Exception
End Try
End Sub
Private Sub txtPre3_TextChanged(sender As Object,
txtPre3.TextChanged
Try
pr3 = txtPre3.Text
txtTot3.Text = cant3 * pr3
f3 = txtTot3.Text
txtTotalPag.Text = f1 + f2 + f3 + f4 + f5 + f6
Catch ex As Exception
End Try
End Sub
Private Sub txtPre4_TextChanged(sender As Object,
txtPre4.TextChanged
Try
pr4 = txtPre4.Text
txtTot4.Text = cant4 * pr4
f4 = txtTot4.Text
txtTotalPag.Text = f1 + f2 + f3 + f4 + f5 + f6
Catch ex As Exception
End Try
End Sub
Private Sub txtPre5_TextChanged(sender As Object,
txtPre5.TextChanged
Try
pr5 = txtPre5.Text
txtTot5.Text = cant5 * pr5
f5 = txtTot5.Text
txtTotalPag.Text = f1 + f2 + f3 + f4 + f5 + f6
Catch ex As Exception
End Try
End Sub
Private Sub txtPre6_TextChanged(sender As Object,
txtPre6.TextChanged
Try
pr6 = txtPre6.Text
txtTot6.Text = cant6 * pr6
f6 = txtTot6.Text

e As EventArgs) Handles

e As EventArgs) Handles

e As EventArgs) Handles

e As EventArgs) Handles

e As EventArgs) Handles

txtTotalPag.Text = f1 + f2 + f3 + f4 + f5 + f6
Catch ex As Exception
End Try
End Sub
Private Sub txtEfectivo_TextChanged(sender As Object, e As EventArgs) Handles
txtEfectivo.TextChanged
Try
totpag = txtTotalPag.Text
efect = txtEfectivo.Text
txtCambio.Text = efect - totpag
Catch ex As Exception
End Try
End Sub
Private Sub btnAceptar_Click(sender As Object, e As EventArgs) Handles btnAceptar.Click
Dim odaptersalpro As New dsProductosTableAdapters.CT_ProductosTableAdapter
If txtex1.Text = "" Then
MessageBox.Show("Introduzca los datos necesarios para proceder", "Datos Insuficientes",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Else
If txtex2.Text = "" Then
odaptersalpro.UpdateQueryModExistencias(dif1, txtcod1.Text)
Else
If txtex3.Text = "" Then
odaptersalpro.UpdateQueryModExistencias(dif1, txtcod1.Text)
odaptersalpro.UpdateQueryModExistencias(dif2, txtcod2.Text)
Else
If txtex4.Text = "" Then
odaptersalpro.UpdateQueryModExistencias(dif1, txtcod1.Text)
odaptersalpro.UpdateQueryModExistencias(dif2, txtcod2.Text)
odaptersalpro.UpdateQueryModExistencias(dif3, txtcod3.Text)
Else
If txtex5.Text = "" Then
odaptersalpro.UpdateQueryModExistencias(dif1, txtcod1.Text)
odaptersalpro.UpdateQueryModExistencias(dif2, txtcod2.Text)
odaptersalpro.UpdateQueryModExistencias(dif3, txtcod3.Text)
odaptersalpro.UpdateQueryModExistencias(dif4, txtcod4.Text)
Else
If txtex6.Text = "" Then
odaptersalpro.UpdateQueryModExistencias(dif1, txtcod1.Text)
odaptersalpro.UpdateQueryModExistencias(dif2, txtcod2.Text)
odaptersalpro.UpdateQueryModExistencias(dif3, txtcod3.Text)
odaptersalpro.UpdateQueryModExistencias(dif4, txtcod4.Text)
odaptersalpro.UpdateQueryModExistencias(dif5, txtcod5.Text)
Else
odaptersalpro.UpdateQueryModExistencias(dif1, txtcod1.Text)
odaptersalpro.UpdateQueryModExistencias(dif2, txtcod2.Text)
odaptersalpro.UpdateQueryModExistencias(dif3, txtcod3.Text)
odaptersalpro.UpdateQueryModExistencias(dif4, txtcod4.Text)
odaptersalpro.UpdateQueryModExistencias(dif5, txtcod5.Text)
odaptersalpro.UpdateQueryModExistencias(dif6, txtcod6.Text)
End If
End If
End If
End If
End If
End If
frmFactura.txtNombre.Text = txtCliente.Text
frmFactura.txtNIT_CI.Text = txtCI_NIT.Text
frmFactura.txtCant1.Text = txtCant1.Text
frmFactura.txtCant2.Text = txtCant2.Text
frmFactura.txtCant3.Text = txtCant3.Text
frmFactura.txtCant4.Text = txtCant4.Text
frmFactura.txtCant5.Text = txtCant5.Text
frmFactura.txtCant6.Text = txtCant6.Text
frmFactura.txtCon1.Text = txtCon1.Text
frmFactura.txtCon2.Text = txtCon2.Text

frmFactura.txtCon3.Text = txtCon3.Text
frmFactura.txtCon4.Text = txtCon4.Text
frmFactura.txtCon5.Text = txtCon5.Text
frmFactura.txtCon6.Text = txtCon6.Text
frmFactura.txtPre1.Text = txtPre1.Text
frmFactura.txtPre2.Text = txtPre2.Text
frmFactura.txtPre3.Text = txtPre3.Text
frmFactura.txtPre4.Text = txtPre4.Text
frmFactura.txtPre5.Text = txtPre5.Text
frmFactura.txtPre6.Text = txtPre6.Text
frmFactura.txtTot1.Text = txtTot1.Text
frmFactura.txtTot2.Text = txtTot2.Text
frmFactura.txtTot3.Text = txtTot3.Text
frmFactura.txtTot4.Text = txtTot4.Text
frmFactura.txtTot5.Text = txtTot5.Text
frmFactura.txtTot6.Text = txtTot6.Text
frmFactura.txtTotalPag.Text = txtTotalPag.Text
frmFactura.txtEfectivo.Text = txtEfectivo.Text
frmFactura.txtCambio.Text = txtCambio.Text
frmFactura.txtNoFactura.Text = txtNoFac.Text
frmFactura.txtFecha.Text = DateTimePicker1.Value
Dim odapterfac As New dsFacturaTableAdapters.CT_FacturasTableAdapter
odapterfac.InsertQueryFactura(txtNoFac.Text, txtCliente.Text, txtCI_NIT.Text, txtTotalPag.Text,
DateTimePicker1.Value, "")
txtCliente.Text = ""
txtCI_NIT.Text = ""
txtCant1.Text = ""
txtCant2.Text = ""
txtCant3.Text = ""
txtCant4.Text = ""
txtCant5.Text = ""
txtCant6.Text = ""
txtCon1.Text = ""
txtCon2.Text = ""
txtCon3.Text = ""
txtCon4.Text = ""
txtCon5.Text = ""
txtCon6.Text = ""
txtPre1.Text = ""
txtTot1.Text = ""
txtTotalPag.Text = ""
txtEfectivo.Text = ""
txtCambio.Text = ""
frmFactura.ShowDialog()
End Sub
Private Sub txtCon1_DoubleClick(sender As Object, e As EventArgs) Handles txtCon1.DoubleClick
textoconta = 1
frmBuscaProducto.ShowDialog()
End Sub
Private Sub txtCon2_DoubleClick(sender As Object, e As EventArgs) Handles txtCon2.DoubleClick
textoconta = 2
frmBuscaProducto.ShowDialog()
End Sub
Private Sub txtCon3_DoubleClick(sender As Object, e As EventArgs) Handles txtCon3.DoubleClick
textoconta = 3
frmBuscaProducto.ShowDialog()
End Sub
Private Sub txtCon4_DoubleClick(sender As Object, e As EventArgs) Handles txtCon4.DoubleClick
textoconta = 4
frmBuscaProducto.ShowDialog()
End Sub
Private Sub txtCon5_DoubleClick(sender As Object, e As EventArgs) Handles txtCon5.DoubleClick
textoconta = 5
frmBuscaProducto.ShowDialog()
End Sub
Private Sub txtCon6_DoubleClick(sender As Object, e As EventArgs) Handles txtCon6.DoubleClick

textoconta = 6
frmBuscaProducto.ShowDialog()
End Sub
Private Sub txtCliente_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtCliente.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub txtCI_NIT_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtCI_NIT.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub txtCant1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtCant1.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub txtCant2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtCant2.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub txtCant3_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtCant3.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub txtCant4_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtCant4.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub txtCant5_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtCant5.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub txtCant6_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtCant6.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub txtEfectivo_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
txtEfectivo.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub

Dim cant1, cant2, cant3, cant4, cant5, cant6, exi1, exi2, exi3, exi4, exi5, exi6 As Integer
Dim dif1, dif2, dif3, dif4, dif5, dif6 As Integer
Private Sub txtCant1_TextChanged(sender As Object, e As EventArgs) Handles
txtCant1.TextChanged
Try
cant1 = txtCant1.Text
Catch ex As Exception
End Try
End Sub
Private Sub txtCant2_TextChanged(sender As Object, e As EventArgs) Handles
txtCant2.TextChanged
Try
cant2 = txtCant2.Text
Catch ex As Exception
End Try
End Sub
Private Sub txtCant3_TextChanged(sender As Object, e As EventArgs) Handles
txtCant3.TextChanged
Try
cant3 = txtCant3.Text
Catch ex As Exception
End Try
End Sub
Private Sub txtCant4_TextChanged(sender As Object, e As EventArgs) Handles
txtCant4.TextChanged
Try
cant4 = txtCant4.Text
Catch ex As Exception
End Try
End Sub
Private Sub txtCant5_TextChanged(sender As Object, e As EventArgs) Handles
txtCant5.TextChanged
Try
cant5 = txtCant5.Text
Catch ex As Exception
End Try
End Sub
Private Sub txtCant6_TextChanged(sender As Object, e As EventArgs) Handles
txtCant6.TextChanged
Try
cant6 = txtCant6.Text
Catch ex As Exception
End Try
End Sub
Private Sub txtex1_TextChanged(sender As Object, e As EventArgs) Handles txtex1.TextChanged
Try
exi1 = txtex1.Text
If cant1 > exi1 Then
MessageBox.Show("No hay suficiente cantidad del producto en inventario", "Inventario
Insuficiente", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
txtCant1.Text = ""
txtCon1.Text = ""
txtPre1.Text = ""
txtTot1.Text = ""
Else
dif1 = exi1 - cant1
End If
Catch ex As Exception
End Try
End Sub
Private Sub txtex2_TextChanged(sender As Object, e As EventArgs) Handles txtex2.TextChanged
Try
exi2 = txtex2.Text
If cant2 > exi2 Then
MessageBox.Show("No hay suficiente cantidad del producto en inventario", "Inventario
Insuficiente", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)

txtCant2.Text = ""
txtCon2.Text = ""
txtPre2.Text = ""
txtTot2.Text = ""
Else
dif2 = exi2 - cant2
End If
Catch ex As Exception
End Try
End Sub
Private Sub txtex3_TextChanged(sender As Object, e As EventArgs) Handles txtex3.TextChanged
Try
exi3 = txtex3.Text
If cant3 > exi3 Then
MessageBox.Show("No hay suficiente cantidad del producto en inventario", "Inventario
Insuficiente", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
txtCant3.Text = ""
txtCon3.Text = ""
txtPre3.Text = ""
txtTot3.Text = ""
Else
dif3 = exi3 - cant3
End If
Catch ex As Exception
End Try
End Sub
Private Sub txtex4_TextChanged(sender As Object, e As EventArgs) Handles txtex4.TextChanged
Try
exi4 = txtex4.Text
If cant4 > exi4 Then
MessageBox.Show("No hay suficiente cantidad del producto en inventario", "Inventario
Insuficiente", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
txtCant4.Text = ""
txtCon4.Text = ""
txtPre4.Text = ""
txtTot4.Text = ""
Else
dif4 = exi4 - cant4
End If
Catch ex As Exception
End Try
End Sub
Private Sub txtex5_TextChanged(sender As Object, e As EventArgs) Handles txtex5.TextChanged
Try
exi5 = txtex5.Text
If cant5 > exi5 Then
MessageBox.Show("No hay suficiente cantidad del producto en inventario", "Inventario
Insuficiente", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
txtCant5.Text = ""
txtCon5.Text = ""
txtPre5.Text = ""
txtTot5.Text = ""
Else
dif5 = exi5 - cant5
End If
Catch ex As Exception
End Try
End Sub
Private Sub txtex6_TextChanged(sender As Object, e As EventArgs) Handles txtex6.TextChanged
Try
exi6 = txtex6.Text
If cant6 > exi6 Then
MessageBox.Show("No hay suficiente cantidad del producto en inventario", "Inventario
Insuficiente", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
txtCant6.Text = ""
txtCon6.Text = ""

txtPre6.Text = ""
txtTot6.Text = ""
Else
dif6 = exi6 - cant6
End If
Catch ex As Exception
End Try
End Sub
End Class

ANEXO D-17: CODIGO FUENTE, RESGISTROS CONTABLES, MODULO


CONTABILIDAD
Public Class frmContabilidad
Private Sub frmContabilidad_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.CT_TransaccionesTableAdapter.Fill(Me.DsTransacciones.CT_Transacciones)
textoconta = 0
idcuenta = 0
contador = 0
Dim odaptertran As New dsTransaccionesTableAdapters.CT_TransaccionesTableAdapter
contador = odaptertran.ScalarQueryContador()
txtcodtran.Text = contador
t = TextBox1.Text
txtdescripcion.Focus()
End Sub
Private Sub TextB1_DoubleClick(sender As Object, e As EventArgs) Handles TextB1.DoubleClick
textoconta = 1
idcuenta = 1
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB2_DoubleClick(sender As Object, e As EventArgs) Handles TextB2.DoubleClick
textoconta = 2
idcuenta = 2
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB3_DoubleClick(sender As Object, e As EventArgs) Handles TextB3.DoubleClick
textoconta = 3
idcuenta = 3
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB4_DoubleClick(sender As Object, e As EventArgs) Handles TextB4.DoubleClick
textoconta = 4
idcuenta = 4
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB5_DoubleClick(sender As Object, e As EventArgs) Handles TextB5.DoubleClick
textoconta = 5
idcuenta = 5
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB6_DoubleClick(sender As Object, e As EventArgs) Handles TextB6.DoubleClick
textoconta = 6
idcuenta = 6
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB7_DoubleClick(sender As Object, e As EventArgs) Handles TextB7.DoubleClick
textoconta = 7
idcuenta = 7
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB8_DoubleClick(sender As Object, e As EventArgs) Handles TextB8.DoubleClick
textoconta = 8
idcuenta = 8
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB11_DoubleClick(sender As Object, e As EventArgs) Handles TextB11.DoubleClick
textoconta = 11
idcuenta = 1
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB12_DoubleClick(sender As Object, e As EventArgs) Handles TextB12.DoubleClick
textoconta = 12
idcuenta = 2
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB13_DoubleClick(sender As Object, e As EventArgs) Handles TextB13.DoubleClick

textoconta = 13
idcuenta = 3
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB14_DoubleClick(sender As Object, e As EventArgs) Handles TextB14.DoubleClick
textoconta = 14
idcuenta = 4
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB15_DoubleClick(sender As Object, e As EventArgs) Handles TextB15.DoubleClick
textoconta = 15
idcuenta = 5
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB16_DoubleClick(sender As Object, e As EventArgs) Handles TextB16.DoubleClick
textoconta = 16
idcuenta = 6
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB17_DoubleClick(sender As Object, e As EventArgs) Handles TextB17.DoubleClick
textoconta = 17
idcuenta = 7
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub TextB18_DoubleClick(sender As Object, e As EventArgs) Handles TextB18.DoubleClick
textoconta = 18
idcuenta = 8
frmBuscaCuenta.ShowDialog()
End Sub
Private Sub CT_TransaccionesBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
Me.Validate()
Me.CT_TransaccionesBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DsTransacciones)
End Sub
Private Sub btnGuardar_Click(sender As Object, e As EventArgs) Handles btnGuardar.Click
Try
If TextB1.Text = "" Then
cuen1 = TextB11.Text
Else
cuen1 = TextB1.Text
End If
If TextB2.Text = "" Then
cuen2 = TextB12.Text
Else
cuen2 = TextB2.Text
End If
If TextB3.Text = "" Then
cuen3 = TextB13.Text
Else
cuen3 = TextB3.Text
End If
If TextB4.Text = "" Then
cuen4 = TextB14.Text
Else
cuen4 = TextB4.Text
End If
If TextB5.Text = "" Then
cuen5 = TextB15.Text
Else
cuen5 = TextB5.Text
End If
If TextB6.Text = "" Then
cuen6 = TextB16.Text
Else
cuen6 = TextB6.Text
End If

If TextB7.Text = "" Then


cuen7 = TextB17.Text
Else
cuen7 = TextB7.Text
End If
If TextB8.Text = "" Then
cuen8 = TextB18.Text
Else
cuen8 = TextB8.Text
End If
Catch ex As Exception
MessageBox.Show("Error en el registro de cuentas", "Error al Guardar",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
If TextB21.Text = "" Then
If TextTC1.Text = 1 Or 5 Then
sal1 = -(TextB31.Text)
Else
sal1 = TextB31.Text
End If
Else
If TextTC1.Text = 1 Or 5 Then
sal1 = TextB21.Text
Else
sal1 = -(TextB21.Text)
End If
End If
If TextB22.Text = "" Then
If TextTC2.Text = 1 Or 5 Then
sal2 = -(TextB32.Text)
Else
sal2 = TextB32.Text
End If
Else
If TextTC2.Text = 1 Then
sal2 = TextB22.Text
Else
sal2 = -(TextB22.Text)
End If
End If
Try
If TextB23.Text = "" Then
If TextTC3.Text = 1 Or 5 Then
sal3 = -(TextB33.Text)
Else
sal3 = TextB33.Text
End If
Else
If TextTC3.Text = 1 Then
sal3 = TextB23.Text
Else
sal3 = -(TextB23.Text)
End If
End If
Catch ex As Exception
End Try
Try
If TextB24.Text = "" Then
If TextTC4.Text = 1 Or 5 Then
sal4 = -(TextB34.Text)
Else
sal4 = TextB34.Text
End If
Else
If TextTC4.Text = 1 Then
sal4 = TextB24.Text

Else
sal4 = -(TextB24.Text)
End If
End If
Catch ex As Exception
End Try
Try
If TextB25.Text = "" Then
If TextTC5.Text = 1 Or 5 Then
sal5 = -(TextB35.Text)
Else
sal5 = TextB35.Text
End If
Else
If TextTC5.Text = 1 Then
sal5 = TextB25.Text
Else
sal5 = -(TextB25.Text)
End If
End If
Catch ex As Exception
End Try
Try
If TextB26.Text = "" Then
If TextTC6.Text = 1 Or 5 Then
sal6 = -(TextB36.Text)
Else
sal6 = TextB36.Text
End If
Else
If TextTC6.Text = 1 Or 5 Then
sal6 = TextB26.Text
Else
sal6 = -(TextB26.Text)
End If
End If
Catch ex As Exception
End Try
Try
If TextB27.Text = "" Then
If TextTC7.Text = 1 Or 5 Then
sal7 = -(TextB37.Text)
Else
sal7 = TextB37.Text
End If
Else
If TextTC7.Text = 1 Or 5 Then
sal7 = TextB27.Text
Else
sal7 = -(TextB27.Text)
End If
End If
Catch ex As Exception
End Try
Try
If TextB28.Text = "" Then
If TextTC8.Text = 1 Or 5 Then
sal8 = -(TextB38.Text)
Else
sal8 = TextB38.Text
End If
Else
If TextTC8.Text = 1 Or 5 Then
sal8 = TextB28.Text
Else
sal8 = -(TextB28.Text)

End If
End If
Catch ex As Exception
End Try
Dim odaptertran As New dsTransaccionesTableAdapters.CT_TransaccionesTableAdapter
Dim odataseptran As New dsTransacciones
Try
If TextB29.Text = TextB39.Text Then
desc = txtdescripcion.Text
fechatran = DateTimePicker1.Text
codtran = txtcodtran.Text
odaptertran.InsertQueryAgregarFila(codtran, cuen1, cuen2, cuen3, cuen4, cuen5, cuen6,
cuen7, cuen8, sal1, sal2, sal3, sal4, sal5, sal6, sal7, sal8, desc, fechatran)
MessageBox.Show("Registro guardado con exito", "Guardando datos",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MessageBox.Show("No se puede guardar porque se lleno mal la planilla" & vbCrLf &
"corrija los errores", "Error al guardar datos", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
Catch ex As Exception
End Try
End Sub
Private Sub TextB21_TextChanged(sender As Object, e As EventArgs) Handles
TextB21.TextChanged
Try
a = TextB21.Text
TextB29.Text = a + b + c + d + f + g + h + i
TextB41.Text = Format(a / t, "0.00")
TextB49.Text = Format(a / t + b / t + c / t + d / t + f / t + g / t + h / t + i / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB22_TextChanged(sender As Object, e As EventArgs) Handles
TextB22.TextChanged
Try
b = TextB22.Text
TextB29.Text = a + b + c + d + f + g + h + i
TextB42.Text = Format(b / t, "0.00")
TextB49.Text = Format(a / t + b / t + c / t + d / t + f / t + g / t + h / t + i / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB23_TextChanged(sender As Object, e As EventArgs) Handles
TextB23.TextChanged
Try
c = TextB23.Text
TextB29.Text = a + b + c + d + f + g + h + i
TextB43.Text = Format(c / t, "0.00")
TextB49.Text = Format(a / t + b / t + c / t + d / t + f / t + g / t + h / t + i / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB24_TextChanged(sender As Object, e As EventArgs) Handles
TextB24.TextChanged
Try
d = TextB24.Text
TextB29.Text = a + b + c + d + f + g + h + i
TextB44.Text = Format(d / t, "0.00")
TextB49.Text = Format(a / t + b / t + c / t + d / t + f / t + g / t + h / t + i / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB25_TextChanged(sender As Object, e As EventArgs) Handles
TextB25.TextChanged
Try
f = TextB25.Text

TextB29.Text = a + b + c + d + f + g + h + i
TextB45.Text = Format(f / t, "0.00")
TextB49.Text = Format(a / t + b / t + c / t + d / t + f / t + g / t + h / t + i / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB26_TextChanged(sender As Object, e As EventArgs) Handles
TextB26.TextChanged
Try
g = TextB26.Text
TextB29.Text = a + b + c + d + f + g + h + i
TextB46.Text = Format(g / t, "0.00")
TextB49.Text = Format(a / t + b / t + c / t + d / t + f / t + g / t + h / t + i / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB27_TextChanged(sender As Object, e As EventArgs) Handles
TextB27.TextChanged
Try
h = TextB27.Text
TextB29.Text = a + b + c + d + f + g + h + i
TextB47.Text = Format(h / t, "0.00")
TextB49.Text = Format(a / t + b / t + c / t + d / t + f / t + g / t + h / t + i / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB28_TextChanged(sender As Object, e As EventArgs) Handles
TextB28.TextChanged
Try
i = TextB28.Text
TextB29.Text = a + b + c + d + f + g + h + i
TextB48.Text = Format(i / t, "0.00")
TextB49.Text = Format(a / t + b / t + c / t + d / t + f / t + g / t + h / t + i / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB31_TextChanged(sender As Object, e As EventArgs) Handles
TextB31.TextChanged
Try
j = TextB31.Text
TextB39.Text = j + k + l + m + n + o + p + q
TextB51.Text = Format(j / t, "0.00")
TextB59.Text = Format(j / t + k / t + l / t + m / t + n / t + o / t + p / t + q / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB32_TextChanged(sender As Object, e As EventArgs) Handles
TextB32.TextChanged
Try
k = TextB32.Text
TextB39.Text = j + k + l + m + n + o + p + q
TextB52.Text = Format(k / t, "0.00")
TextB59.Text = Format(j / t + k / t + l / t + m / t + n / t + o / t + p / t + q / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB33_TextChanged(sender As Object, e As EventArgs) Handles
TextB33.TextChanged
Try
l = TextB33.Text
TextB39.Text = j + k + l + m + n + o + p + q
TextB53.Text = Format(l / t, "0.00")
TextB59.Text = Format(j / t + k / t + l / t + m / t + n / t + o / t + p / t + q / t, "0.00")
Catch ex As Exception
End Try
End Sub

Private Sub TextB34_TextChanged(sender As Object, e As EventArgs) Handles


TextB34.TextChanged
Try
m = TextB34.Text
TextB39.Text = j + k + l + m + n + o + p + q
TextB54.Text = Format(m / t, "0.00")
TextB59.Text = Format(j / t + k / t + l / t + m / t + n / t + o / t + p / t + q / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB35_TextChanged(sender As Object, e As EventArgs) Handles
TextB35.TextChanged
Try
n = TextB35.Text
TextB39.Text = j + k + l + m + n + o + p + q
TextB55.Text = Format(n / t, "0.00")
TextB59.Text = Format(j / t + k / t + l / t + m / t + n / t + o / t + p / t + q / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB36_TextChanged(sender As Object, e As EventArgs) Handles
TextB36.TextChanged
Try
o = TextB36.Text
TextB39.Text = j + k + l + m + n + o + p + q
TextB56.Text = Format(o / t, "0.00")
TextB59.Text = Format(j / t + k / t + l / t + m / t + n / t + o / t + p / t + q / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB37_TextChanged(sender As Object, e As EventArgs) Handles
TextB37.TextChanged
Try
p = TextB37.Text
TextB39.Text = j + k + l + m + n + o + p + q
TextB57.Text = Format(p / t, "0.00")
TextB59.Text = Format(j / t + k / t + l / t + m / t + n / t + o / t + p / t + q / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub TextB38_TextChanged(sender As Object, e As EventArgs) Handles
TextB38.TextChanged
Try
q = TextB38.Text
TextB39.Text = j + k + l + m + n + o + p + q
TextB58.Text = Format(q / t, "0.00")
TextB59.Text = Format(j / t + k / t + l / t + m / t + n / t + o / t + p / t + q / t, "0.00")
Catch ex As Exception
End Try
End Sub
Private Sub btnCancelar_Click(sender As Object, e As EventArgs) Handles btnCancelar.Click
Close()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
txtdescripcion.Clear()
TextTC1.Clear()
TextTC2.Clear()
TextTC3.Clear()
TextTC4.Clear()
TextTC5.Clear()
TextTC6.Clear()
TextTC7.Clear()
TextTC8.Clear()
TextB1.Clear()
TextB2.Clear()

TextB3.Clear()
TextB4.Clear()
TextB5.Clear()
TextB6.Clear()
TextB7.Clear()
TextB8.Clear()
TextB11.Clear()
TextB12.Clear()
TextB13.Clear()
TextB14.Clear()
TextB15.Clear()
TextB16.Clear()
TextB17.Clear()
TextB18.Clear()
TextB21.Clear()
TextB22.Clear()
TextB23.Clear()
TextB24.Clear()
TextB25.Clear()
TextB26.Clear()
TextB27.Clear()
TextB28.Clear()
TextB29.Clear()
TextB31.Clear()
TextB32.Clear()
TextB33.Clear()
TextB34.Clear()
TextB35.Clear()
TextB36.Clear()
TextB37.Clear()
TextB38.Clear()
TextB39.Clear()
TextB41.Clear()
TextB42.Clear()
TextB43.Clear()
TextB44.Clear()
TextB45.Clear()
TextB46.Clear()
TextB47.Clear()
TextB48.Clear()
TextB49.Clear()
TextB51.Clear()
TextB52.Clear()
TextB53.Clear()
TextB54.Clear()
TextB55.Clear()
TextB56.Clear()
TextB57.Clear()
TextB58.Clear()
TextB59.Clear()
a=0
b=0
c=0
d=0
f=0
g=0
h=0
i=0
j=0
k=0
l=0
m=0
n=0
o=0
p=0
q=0

Dim odaptertran As New dsTransaccionesTableAdapters.CT_TransaccionesTableAdapter


contador = odaptertran.ScalarQueryContador()
txtcodtran.Text = contador
End Sub
End Class

ANEXO D-18: CODIGO FUENTE, CUENTAS, MODULO CONTABILIDAD


Public Class frmCuentas
Private Sub CT_CuentasBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
Handles CT_CuentasBindingNavigatorSaveItem.Click
Try
Me.CT_CuentasBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DsCuentas)
Actualizar()
MessageBox.Show("Cambios guardados con exito", "Guardando datos",
MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
If MessageBox.Show("Ocurrio un error en la base de datos" & vbCrLf & "desea continuar?",
"Error al guardar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) =
Windows.Forms.DialogResult.No Then
Actualizar()
End If
End Try
End Sub
Private Sub frmCuentas_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Actualizar()
End Sub
Private Sub Botones(ByVal x As Boolean)
BindingNavigatorAddNewItem.Visible = x
BindingNavigatorModificarItem.Visible = x
BindingNavigatorDeleteItem.Visible = x
CT_CuentasBindingNavigatorSaveItem.Visible = Not x
BindingNavigatorCancelarItem.Visible = Not x
End Sub
Private Sub Bloquear(ByVal x As Boolean)
Cod_CuentaMaskedTextBox.ReadOnly = x
CuentaMaskedTextBox.ReadOnly = x
SaldoMaskedTextBox.ReadOnly = x
RubroMaskedTextBox.ReadOnly = x
GrupoMaskedTextBox.ReadOnly = x
TituloMaskedTextBox.ReadOnly = x
End Sub
Private Sub Actualizar()
Me.CT_CuentasTableAdapter.Fill(Me.DsCuentas.CT_Cuentas)
Botones(True)
Bloquear(True)
Me.CT_CuentasDataGridView.Enabled = True
Me.CT_CuentasDataGridView.Focus()
End Sub
Private Sub btnBuscar_Click(sender As Object, e As EventArgs) Handles btnBuscar.Click
Dim dato As String = txtDato.Text
Try
If cboModo.Items(1) = cboModo.Text Then
Me.CT_CuentasTableAdapter.FillByCuenta(Me.DsCuentas.CT_Cuentas, dato)
End If
Catch ex As Exception
End Try
End Sub
Private Sub cboModo_SelectedValueChanged(sender As Object, e As EventArgs) Handles
cboModo.SelectedValueChanged
Try
If cboModo.Items(0) = cboModo.Text Then
Me.CT_CuentasTableAdapter.Fill(Me.DsCuentas.CT_Cuentas)
txtDato.Clear()
Else
txtDato.Clear()
txtDato.Focus()
End If
If cboModo.Items(2) = cboModo.Text Then
Me.CT_CuentasTableAdapter.FillByActivo(Me.DsCuentas.CT_Cuentas)
txtDato.Clear()

Else
txtDato.Clear()
txtDato.Focus()
End If
If cboModo.Items(3) = cboModo.Text Then
Me.CT_CuentasTableAdapter.FillByPasivo(Me.DsCuentas.CT_Cuentas)
txtDato.Clear()
Else
txtDato.Clear()
txtDato.Focus()
End If
If cboModo.Items(4) = cboModo.Text Then
Me.CT_CuentasTableAdapter.FillByCapital(Me.DsCuentas.CT_Cuentas)
txtDato.Clear()
Else
txtDato.Clear()
txtDato.Focus()
End If
If cboModo.Items(5) = cboModo.Text Then
Me.CT_CuentasTableAdapter.FillByIngresos(Me.DsCuentas.CT_Cuentas)
txtDato.Clear()
Else
txtDato.Clear()
txtDato.Focus()
End If
If cboModo.Items(6) = cboModo.Text Then
Me.CT_CuentasTableAdapter.FillByGastos(Me.DsCuentas.CT_Cuentas)
txtDato.Clear()
Else
txtDato.Clear()
txtDato.Focus()
End If
Catch ex As Exception
End Try
End Sub
Private Sub Cod_CuentaMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs)
Handles Cod_CuentaMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub CuentaMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
CuentaMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub SaldoMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
SaldoMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub RubroMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
RubroMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then
e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub GrupoMaskedTextBox_KeyPress(sender As Object, e As KeyPressEventArgs) Handles
GrupoMaskedTextBox.KeyPress
If e.KeyChar = Convert.ToChar(Keys.Enter) Then

e.Handled = True
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub Cod_CuentaMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles Cod_CuentaMaskedTextBox.Validating
If Cod_CuentaMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(Cod_CuentaMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(Cod_CuentaMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub CuentaMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles CuentaMaskedTextBox.Validating
If CuentaMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(CuentaMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(CuentaMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub SaldoMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles SaldoMaskedTextBox.Validating
If SaldoMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(SaldoMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(SaldoMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub RubroMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles RubroMaskedTextBox.Validating
If RubroMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(RubroMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(RubroMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub GrupoMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles GrupoMaskedTextBox.Validating
If GrupoMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(GrupoMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(GrupoMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub TituloMaskedTextBox_Validating(sender As Object, e As
System.ComponentModel.CancelEventArgs) Handles TituloMaskedTextBox.Validating
If TituloMaskedTextBox.MaskCompleted Then
e.Cancel = False
ErrorProvider1.SetError(TituloMaskedTextBox, Nothing)
Else
e.Cancel = True
ErrorProvider1.SetError(TituloMaskedTextBox, "Dato no valido")
End If
End Sub
Private Sub BindingNavigatorAddNewItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorAddNewItem.Click

Botones(False)
Bloquear(False)
Me.CT_CuentasDataGridView.Enabled = False
ErrorProvider1.Dispose()
Cod_CuentaMaskedTextBox.Focus()
End Sub
Private Sub BindingNavigatorModificarItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorModificarItem.Click
Botones(False)
Bloquear(False)
Me.CT_CuentasDataGridView.Enabled = False
ErrorProvider1.Dispose()
Cod_CuentaMaskedTextBox.Focus()
End Sub
Private Sub BindingNavigatorDeleteItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorDeleteItem.Click
Botones(False)
Me.CT_CuentasDataGridView.Enabled = False
End Sub
Private Sub BindingNavigatorCancelarItem_Click(sender As Object, e As EventArgs) Handles
BindingNavigatorCancelarItem.Click
Actualizar()
End Sub
End Class

ANEXO D-19: CODIGO FUENTE, INDICADORES FINANCIEROS, MODULO


CONTABILIDAD
Public Class frmIndicesFin
Private Sub frmIndicesFin_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim odapterCuent As New dsCuentasTableAdapters.CT_CuentasTableAdapter
Dim odatasepCuent As New dsCuentas
activo = odapterCuent.ScalarQueryActivo
pasivo = odapterCuent.ScalarQueryPasivo
capital = odapterCuent.ScalarQueryCapital
actcorr = odapterCuent.ScalarQueryActivoCorriente
pascorr = odapterCuent.ScalarQueryPasivoCorriente
cmv = odapterCuent.ScalarQueryCMV
cmvsal = odapterCuent.ScalarQueryCMVySalario
cxp = odapterCuent.ScalarQueryCuantaPagar
cxc = odapterCuent.ScalarQueryCuantasCobrar
dlp = odapterCuent.ScalarQueryDeudaLargoPla
gastos = odapterCuent.ScalarQueryGastos
ingresos = odapterCuent.ScalarQueryIngresos
interes = odapterCuent.ScalarQueryInteres
inventario = odapterCuent.ScalarQueryInventario
ventaneta = odapterCuent.ScalarQueryVentaNeta
txtCaptrab.Text = Format(actcorr + pascorr, "0.00")
txtInCorr.Text = Format(1 / (actcorr / pascorr), "0.00")
txtPruAcida.Text = Format(1 / (actcorr - inventario) / pascorr, "0.00")
txtEndeu.Text = Format((pasivo / activo) * 100, "0.00")
txtEndeuLP.Text = Format(dlp / capital, "0.00")
txtInApala.Text = Format(pasivo / capital, "0.00")
txtCapPagInt.Text = Format((ingresos - gastos) / interes, "0.00")
txtRotcxc.Text = Format((cxc / ventaneta) * 360, "0.00")
txtRotcxp.Text = Format((cxp / cmv) * 360, "0.00")
txtRotInv.Text = Format((inventario / cmv) * 360, "0.00")
txtRotAct.Text = Format((ventaneta / activo) * 100, "0.00")
txtMB.Text = Format(((ventaneta - cmv) / ventaneta) * 100, "0.00")
txtMN.Text = Format(((ventaneta - cmvsal) / ventaneta) * 100, "0.00")
txtRentAct.Text = Format((ventaneta - cmvsal) / activo, "0.00")
txtRentPat.Text = Format((ventaneta - cmvsal) / capital, "0.00")
End Sub
Private Sub btnAtras_Click(sender As Object, e As EventArgs)
Me.Close()
End Sub
Private Sub Imprimir()
PrintDialog1.ShowDialog()
PrintForm1.PrinterSettings = PrintDialog1.PrinterSettings
PrintForm1.Print()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Imprimir()
End Sub
End Class

ANEXO D-20: CODIGO FUENTE, ESTADO DE RESULTADOS, MODULO


CONTABILIDAD
Public Class frmEstadoResultados
Private Sub frmEstadoResultados_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim meses As String = ""
If DateTimePicker1.Value.Month = 1 Then meses = "Enero"
If DateTimePicker1.Value.Month = 2 Then meses = "Febrero"
If DateTimePicker1.Value.Month = 3 Then meses = "Marzo"
If DateTimePicker1.Value.Month = 4 Then meses = "Abril"
If DateTimePicker1.Value.Month = 5 Then meses = "Mayo"
If DateTimePicker1.Value.Month = 6 Then meses = "Junio"
If DateTimePicker1.Value.Month = 7 Then meses = "Julio"
If DateTimePicker1.Value.Month = 8 Then meses = "Agosto"
If DateTimePicker1.Value.Month = 9 Then meses = "Septiembre"
If DateTimePicker1.Value.Month = 10 Then meses = "Octubre"
If DateTimePicker1.Value.Month = 11 Then meses = "Noviembre"
If DateTimePicker1.Value.Month = 12 Then meses = "Diciembre"
txtfecha.Text = "Del 1 de Enero de " & DateTimePicker1.Value.Year & " al " &
DateTimePicker1.Value.Day & " de " & meses & " de " & DateTimePicker1.Value.Year
Dim odaptercuentas As New dsCuentasTableAdapters.CT_CuentasTableAdapter
saldo1.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB1.Text), "0.00")
saldo4.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB4.Text), "0.00")
Saldo7.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB7.Text), "0.00")
Saldo9.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB9.Text), "0.00")
Saldo6.Text = Format(odaptercuentas.ScalarQueryGastosAdm, "0.00")
Saldo10.Text = Format(odaptercuentas.ScalarQueryGastesExtra, "0.00")
End Sub
Private Sub Imprimir()
PrintDialog1.ShowDialog()
PrintForm1.PrinterSettings = PrintDialog1.PrinterSettings
PrintForm1.Print()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Imprimir()
End Sub
Dim er1, er2, er3, er4, er5, er6, er7, er8, er9, er10, er11 As Decimal
Private Sub saldo1_TextChanged(sender As Object, e As EventArgs) Handles saldo1.TextChanged
er1 = saldo1.Text
End Sub
Private Sub saldo4_TextChanged(sender As Object, e As EventArgs) Handles saldo4.TextChanged
er2 = saldo4.Text
saldo5.Text = Format(er1 - er2, "0.00")
End Sub
Private Sub saldo5_TextChanged(sender As Object, e As EventArgs) Handles saldo5.TextChanged
er3 = saldo5.Text
End Sub
Private Sub Saldo6_TextChanged(sender As Object, e As EventArgs) Handles Saldo6.TextChanged
er4 = Saldo6.Text
Saldo8.Text = Format(er3 - er4 - er5, "0.00")
End Sub
Private Sub Saldo7_TextChanged(sender As Object, e As EventArgs) Handles Saldo7.TextChanged
er5 = Saldo7.Text
End Sub
Private Sub Saldo8_TextChanged(sender As Object, e As EventArgs) Handles Saldo8.TextChanged
er6 = Saldo8.Text
End Sub
Private Sub Saldo9_TextChanged(sender As Object, e As EventArgs) Handles Saldo9.TextChanged
er7 = Saldo9.Text
End Sub
Private Sub Saldo10_TextChanged(sender As Object, e As EventArgs) Handles
Saldo10.TextChanged
er8 = Saldo10.Text
Saldo11.Text = Format(er6 + er7 - er8, "0.00")
End Sub

Private Sub Saldo11_TextChanged(sender As Object, e As EventArgs) Handles


Saldo11.TextChanged
er9 = Saldo11.Text
If er9 > 0 Then
Saldo13.Text = Format(er9 - er10, "0.00")
Saldo12.Text = Format(er9 * 0.25, "0.00")
Else
er10 = 0
Saldo12.Text = Format(er10, "0.00")
Saldo13.Text = Format(er9, "0.00")
End If
End Sub
Private Sub Saldo12_TextChanged(sender As Object, e As EventArgs) Handles
Saldo12.TextChanged
er10 = Saldo12.Text
End Sub
Private Sub Saldo13_TextChanged(sender As Object, e As EventArgs) Handles
Saldo13.TextChanged
er11 = Saldo13.Text
End Sub
End Class

ANEXO D-21: CODIGO FUENTE, BALANCE GENERAL, MODULO


CONTABILIDAD
Public Class frmBalanceGeneral
Dim bgcuenta As String
Dim bgsaldo As Decimal
Private Sub frmBalanceGeneral_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim odaptercuentas As New dsCuentasTableAdapters.CT_CuentasTableAdapter
saldo1.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB1.Text), "0.00")
saldo2.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB2.Text), "0.00")
saldo3.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB3.Text), "0.00")
saldo4.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB4.Text), "0.00")
saldo5.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB5.Text), "0.00")
saldo6.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB6.Text), "0.00")
saldo7.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB7.Text), "0.00")
saldo8.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB8.Text), "0.00")
saldo9.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB9.Text), "0.00")
saldo10.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB10.Text), "0.00")
saldo11.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB11.Text), "0.00")
saldo12.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB12.Text), "0.00")
saldo13.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB13.Text), "0.00")
saldo14.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB14.Text), "0.00")
saldo15.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB15.Text), "0.00")
saldo16.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB16.Text), "0.00")
saldo17.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB17.Text), "0.00")
saldo18.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB18.Text), "0.00")
saldo19.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB19.Text), "0.00")
saldo20.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB20.Text), "0.00")
saldo21.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB21.Text), "0.00")
saldo22.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB22.Text), "0.00")
saldo31.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB31.Text), "0.00")
saldo32.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB32.Text), "0.00")
saldo33.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB33.Text), "0.00")
saldo34.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB34.Text), "0.00")
saldo35.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB35.Text), "0.00")
saldo36.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB36.Text), "0.00")
saldo37.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB37.Text), "0.00")
saldo38.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB38.Text), "0.00")
saldo39.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB39.Text), "0.00")
saldo40.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB40.Text), "0.00")
saldo41.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB41.Text), "0.00")
saldo42.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB42.Text), "0.00")
saldo43.Text = Format(odaptercuentas.ScalarQueryoCuenta(TB43.Text), "0.00")
Dim meses As String = ""
If DateTimePicker1.Value.Month = 1 Then meses = "Enero"
If DateTimePicker1.Value.Month = 2 Then meses = "Febrero"
If DateTimePicker1.Value.Month = 3 Then meses = "Marzo"
If DateTimePicker1.Value.Month = 4 Then meses = "Abril"
If DateTimePicker1.Value.Month = 5 Then meses = "Mayo"
If DateTimePicker1.Value.Month = 6 Then meses = "Junio"
If DateTimePicker1.Value.Month = 7 Then meses = "Julio"
If DateTimePicker1.Value.Month = 8 Then meses = "Agosto"
If DateTimePicker1.Value.Month = 9 Then meses = "Septiembre"
If DateTimePicker1.Value.Month = 10 Then meses = "Octubre"
If DateTimePicker1.Value.Month = 11 Then meses = "Noviembre"
If DateTimePicker1.Value.Month = 12 Then meses = "Diciembre"
txtfecha.Text = "al " & DateTimePicker1.Value.Day & " de " & meses & " de " &
DateTimePicker1.Value.Year
End Sub
Dim ac1, ac2, ac3, ac4, ac5, ac6, in1, in2, af1, af2, af3, af4, af5, af6, af7, af8, af9, af10, af11,
af12, af13, ad As Decimal
Dim to1, to2, to3, to4, to5, to6, to7, to8, to9 As Decimal
Dim pc1, pc2, pc3, pc4, pc5, pc6, pnc1, pnc2, pnc3, pnc4, ca1, ca2, ca3 As Decimal
Private Sub saldo1_TextChanged(sender As Object, e As EventArgs) Handles saldo1.TextChanged
ac1 = saldo1.Text
End Sub

Private Sub saldo2_TextChanged(sender As Object, e As EventArgs) Handles saldo2.TextChanged


ac2 = saldo2.Text
End Sub
Private Sub saldo3_TextChanged(sender As Object, e As EventArgs) Handles saldo3.TextChanged
ac3 = saldo3.Text
End Sub
Private Sub saldo4_TextChanged(sender As Object, e As EventArgs) Handles saldo4.TextChanged
ac4 = saldo4.Text
End Sub
Private Sub saldo5_TextChanged(sender As Object, e As EventArgs) Handles saldo5.TextChanged
ac5 = saldo5.Text
End Sub
Private Sub saldo6_TextChanged(sender As Object, e As EventArgs) Handles saldo6.TextChanged
ac6 = saldo6.Text
tot1.Text = ac1 + ac2 + ac3 + ac4 + ac5 + ac6
End Sub
Private Sub saldo7_TextChanged(sender As Object, e As EventArgs) Handles saldo7.TextChanged
in1 = saldo7.Text
End Sub
Private Sub saldo8_TextChanged(sender As Object, e As EventArgs) Handles saldo8.TextChanged
in2 = saldo8.Text
tot2.Text = in1 + in2
End Sub
Private Sub saldo9_TextChanged(sender As Object, e As EventArgs) Handles saldo9.TextChanged
af1 = saldo9.Text
End Sub
Private Sub saldo10_TextChanged(sender As Object, e As EventArgs) Handles
saldo10.TextChanged
af2 = saldo10.Text
End Sub
Private Sub saldo11_TextChanged(sender As Object, e As EventArgs) Handles
saldo11.TextChanged
af3 = saldo11.Text
End Sub
Private Sub saldo12_TextChanged(sender As Object, e As EventArgs) Handles
saldo12.TextChanged
af4 = saldo12.Text
End Sub
Private Sub saldo13_TextChanged(sender As Object, e As EventArgs) Handles
saldo13.TextChanged
af5 = saldo13.Text
End Sub
Private Sub saldo14_TextChanged(sender As Object, e As EventArgs) Handles
saldo14.TextChanged
af6 = saldo14.Text
End Sub
Private Sub saldo15_TextChanged(sender As Object, e As EventArgs) Handles
saldo15.TextChanged
af7 = saldo15.Text
End Sub
Private Sub saldo16_TextChanged(sender As Object, e As EventArgs) Handles
saldo16.TextChanged
af8 = saldo16.Text
End Sub
Private Sub saldo17_TextChanged(sender As Object, e As EventArgs) Handles
saldo17.TextChanged
af9 = saldo17.Text
End Sub
Private Sub saldo18_TextChanged(sender As Object, e As EventArgs) Handles
saldo18.TextChanged
af10 = saldo18.Text
End Sub
Private Sub saldo19_TextChanged(sender As Object, e As EventArgs) Handles
saldo19.TextChanged
af11 = saldo19.Text
End Sub

Private Sub saldo20_TextChanged(sender As Object, e As EventArgs) Handles


saldo20.TextChanged
af12 = saldo20.Text
End Sub
Private Sub saldo21_TextChanged(sender As Object, e As EventArgs) Handles
saldo21.TextChanged
af13 = saldo21.Text
tot3.Text = af1 + af2 + af3 + af4 + af5 + af6 + af7 + af8 + af9 + af10 + af11 + af12 + af13
End Sub
Private Sub saldo22_TextChanged(sender As Object, e As EventArgs) Handles
saldo22.TextChanged
ad = saldo22.Text
tot4.Text = ad
End Sub
Private Sub tot4_TextChanged(sender As Object, e As EventArgs) Handles tot4.TextChanged
to4 = tot4.Text
tot5.Text = to1 + to2 + to3 + to4 + to5
End Sub
Private Sub tot3_TextChanged(sender As Object, e As EventArgs) Handles tot3.TextChanged
to3 = tot3.Text
End Sub
Private Sub tot2_TextChanged(sender As Object, e As EventArgs) Handles tot2.TextChanged
to2 = tot2.Text
End Sub
Private Sub tot1_TextChanged(sender As Object, e As EventArgs) Handles tot1.TextChanged
to1 = tot1.Text
End Sub
Private Sub saldo31_TextChanged(sender As Object, e As EventArgs) Handles
saldo31.TextChanged
pc1 = saldo31.Text
End Sub
Private Sub saldo32_TextChanged(sender As Object, e As EventArgs) Handles
saldo32.TextChanged
pc2 = saldo32.Text
End Sub
Private Sub saldo33_TextChanged(sender As Object, e As EventArgs) Handles
saldo33.TextChanged
pc3 = saldo33.Text
End Sub
Private Sub saldo34_TextChanged(sender As Object, e As EventArgs) Handles
saldo34.TextChanged
pc4 = saldo34.Text
End Sub
Private Sub saldo35_TextChanged(sender As Object, e As EventArgs) Handles
saldo35.TextChanged
pc5 = saldo35.Text
End Sub
Private Sub saldo36_TextChanged(sender As Object, e As EventArgs) Handles
saldo36.TextChanged
pc6 = saldo36.Text
tot6.Text = pc1 + pc2 + pc3 + pc4 + pc5 + pc6
End Sub
Private Sub saldo37_TextChanged(sender As Object, e As EventArgs) Handles
saldo37.TextChanged
pnc1 = saldo37.Text
End Sub
Private Sub saldo38_TextChanged(sender As Object, e As EventArgs) Handles
saldo38.TextChanged
pnc2 = saldo38.Text
End Sub
Private Sub saldo39_TextChanged(sender As Object, e As EventArgs) Handles
saldo39.TextChanged
pnc3 = saldo39.Text
End Sub
Private Sub saldo40_TextChanged(sender As Object, e As EventArgs) Handles
saldo40.TextChanged

pnc4 = saldo40.Text
tot7.Text = pnc1 + pnc2 + pnc3 + pnc4
End Sub
Private Sub saldo41_TextChanged(sender As Object, e As EventArgs) Handles
saldo41.TextChanged
ca1 = saldo41.Text
End Sub
Private Sub saldo42_TextChanged(sender As Object, e As EventArgs) Handles
saldo42.TextChanged
ca2 = saldo42.Text
End Sub
Private Sub saldo43_TextChanged(sender As Object, e As EventArgs) Handles
saldo43.TextChanged
ca3 = saldo43.Text
tot9.Text = ca1 + ca2 + ca3
End Sub
Private Sub tot6_TextChanged(sender As Object, e As EventArgs) Handles tot6.TextChanged
to6 = tot6.Text
End Sub
Private Sub tot7_TextChanged(sender As Object, e As EventArgs) Handles tot7.TextChanged
to7 = tot7.Text
tot8.Text = to6 + to7
End Sub
Private Sub tot8_TextChanged(sender As Object, e As EventArgs) Handles tot8.TextChanged
to8 = tot8.Text
End Sub
Private Sub tot9_TextChanged(sender As Object, e As EventArgs) Handles tot9.TextChanged
to9 = tot9.Text
tot10.Text = to8 + to9
End Sub
Private Sub Imprimir()
PrintDialog1.ShowDialog()
PrintForm1.PrinterSettings = PrintDialog1.PrinterSettings
PrintForm1.Print()
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Imprimir()
End Sub
End Class

E.

ANEXO E:
NORMAS

ANEXO E-22: Nuevo sistema de facturacion


CAPTULO II ASPECTOS TCNICOS DE LAS FACTURAS O NOTAS FISCALES
Artculo 10.- (Formato General) I. Los sujetos pasivos o terceros responsables del
IVA, en funcin a la(s) modalidad(es) de facturacin por la(s) que optare(n),
debern aplicar en las facturas o notas fiscales los siguientes formatos e
informacin mnima, segn corresponda:
1.

Datos Bsicos del Sujeto Pasivo.- (parte superior izquierda):


a) Razn Social en el caso de Personas Jurdicas o Nombre en el caso de
Personas Naturales.
b) Domicilio tributario (casa matriz), nmero(s) telefnico(s) y la Alcalda a
la que pertenece (o domicilio y Alcalda declarada para el caso de
espectculos pblicos eventuales).
c) Nmero de sucursal, domicilio, nmero(s) telefnico(s) y la Alcalda a la
que pertenece (excepto en espectculos pblicos eventuales); slo en el
caso que la nota fiscal sea emitida en una sucursal.
d) Tipo de Autoimpresor y Nmero del Autoimpresor asignado por el SIN,
para las facturas o notas fiscales de las modalidades de facturacin,
Punto de Venta Da Vinci (PVD), Computarizada (SFC) y Mquina
Registradora (MR).

2.

Datos de Dosificacin.- (parte superior derecha):


a) Nmero de Identificacin Tributaria (NIT) del sujeto pasivo (o de la
Gerencia Distrital correspondiente, para el caso de espectculos
pblicos eventuales).
b) Nmero correlativo de factura, nota fiscal o documento equivalente.
c) Nmero de Autorizacin.
d) El trmino "ORIGINAL" o "COPIA", segn corresponda.

3.

Ttulo y Subttulo.- (parte superior central):


a) "FACTURA" o "FACTURA POR TERCEROS" o "FACTURA CONJUNTA" o
"FACTURA COMERCIAL DE EXPORTACIN" o "RECIBO DE ALQUILER" o
"NOTA DE CRDITO-DBITO" o "FACTURA DE VENTA EN ZONAS
FRANCAS" o "FACTURA TURISTICA"; segn corresponda.
b) Como subttulo: "Sin Derecho a Crdito Fiscal" (segn el Artculo 44 de la
presente Resolucin); o "Cantidad de Facturas: XX" (ejemplo: Cantidad
de Facturas: 05) slo para la Caracterstica Especial Facturacin
Conjunta.

4.

Datos de la Transaccin Comercial.- (parte central):


a) Lugar y Fecha de emisin, en el siguiente orden: LUGAR, DIA, MES, AO.
b) Nombre o Razn Social del comprador.

c) Nmero de Identificacin Tributaria o nmero de Documento de


Identificacin del comprador.
d) Domicilio del comprador, slo en el caso de servicios pblicos
(Electricidad, Agua, Gas domiciliario y Telfono).
e) Detalle: Cantidad, Concepto, Precio Unitario y Total (en caso de
corresponder Descuentos e ICE).
f) Tipo de cambio oficial de venta correspondiente a la fecha de la
transaccin, cuando la operacin sea en moneda extranjera. Para el
caso de entidades del sistema financiero nacional, estas podrn utilizar
el tipo de cambio de moneda extranjera, de acuerdo a disposiciones
emitidas por la Superintendencia de Bancos y Entidades Financieras.
g) Total General en Bolivianos (numeral y literal).
5.

Datos Finales.- (parte inferior):


a) Cdigo de Control, cuando corresponda (izquierda).
b) Fecha lmite de emisin (a la derecha y en negrillas).
c) En negrillas y legible la leyenda: "La reproduccin total o parcial y/o el
uso no autorizado de esta Nota Fiscal, constituye un delito a ser
sancionado conforme a Ley" (Central).

II. Las facturas o notas fiscales con la Caracterstica Especial Facturacin por
Terceros, debern consignar la siguiente informacin (ver Anexo 2):
1. Tercero Emisor.- En la parte superior de la nota fiscal, la informacin del
Tercero emisor dispuesta por el inciso a) del numeral 1 del pargrafo I
del presente Artculo.
2. Sujeto Pasivo Titular.- Toda la informacin dispuesta en los numerales
1al5 del pargrafo I del presente Artculo.
III.
Las facturas o notas fiscales con la Caracterstica Especial Facturacin
Conjunta, debern consignar la siguiente informacin (ver anexo 3):
1. Sujeto pasivo emisor: Primero debe consignarse la informacin detallada
en el pargrafo I del presente Artculo, respecto al Sujeto Pasivo Emisor,
excepto el inciso c) del numeral 5 del mismo pargrafo.
2. Sujeto(s) pasivo(s) incluido(s): Una vez consignada la informacin
previamente citada, para cada sujeto pasivo incluido se debe consignar
los Datos Bsicos de los incisos a), b) y c) del numeral 1 del pargrafo I
del presente Artculo, as como los Datos de Dosificacin excepto el
inciso d), del numeral 2 del mismo pargrafo. Luego la informacin de
los Datos de la Transaccin Comercial establecida en los incisos e), f), y
g) del numeral 4 y los Datos Finales de los incisos a) y b) del numeral 5
del mismo pargrafo.
3. Por nica vez: Al final de la factura o nota fiscal, la suma total (literal y
numeral), as como la leyenda establecida en el inciso c) del numeral 5
del pargrafo I del presente Artculo.

IV.
Las facturas o notas fiscales a ser emitidas bajo la modalidad de
Facturacin Prevalorada, debern consignar la misma informacin establecida en
el pargrafo I del presente Artculo, con las siguientes particularidades (ver
Anexo 4):
1. Datos de la Transaccin Comercial: Las facturas o notas fiscales de esta
modalidad de facturacin no requieren ser emitidas con los datos del comprador
dispuestos en los incisos b), c), d) y f) del numeral 4 del pargrafo I del presente
Artculo, debiendo cumplir con la dems informacin referida en el numeral
sealado. Asimismo, en relacin a la fecha de emisin se aplicar el siguiente
tratamiento diferenciado:
a. Fecha de emisin preimpresa: Para el caso de espectculos pblicos
eventuales o permanentes, u otros similares con fecha
predeterminada.
b. Fecha de emisin consignada deforma manuscrita, con fechero u otro
medio tecnolgico: Para el caso de servicios de espectculos pblicos
permanentes de realizacin continua, venta de GLP en garrafas, pago
por uso de terminales terrestres o areas, u otros similares.
c. Sinfecha de emisin: Para aquellas notas fiscales que por su naturaleza
y forma de emisin no puedan consignar la fecha, especficamente
para servicios de telefona prepagados con tarjetas y venta de
productos a travs de mquinas dispensadoras.
V.
Las facturas o notas fiscales con la Caracterstica Especial Facturacin
Comercial de Exportacin, debern consignar la misma informacin establecida
en el pargrafo I del presente Artculo (excepto la del inciso c) del numeral 4 del
mismo pargrafo), pudiendo adecuar el formato, informacin a consignar,
moneda e idioma de la informacin de los incisos e), f) y g) del numeral 4 del
mismo pargrafo, en funcin a las particularidades y necesidades de la actividad
(ver Anexo 5).
VI.
Las facturas o notas fiscales con la Caracterstica Especial Notas de Crdito
- Dbito, debern consignar la misma informacin establecida en el pargrafo I
del presente Artculo, con las siguientes particularidades (ver Anexo 6):
1.
Datos de Dosificacin.- en la parte superior derecha, la misma informacin
dispuesta en el numeral 2 del pargrafo I del presente Artculo, consignando en
el inciso d) las leyendas "ORIGINAL CLIENTE - NOTA DE DBITO" o "COPIA EMISOR
- NOTA DE CRDITO", segn corresponda.
2.
Datos de la Transaccin Comercial.- La misma informacin dispuesta en los
incisos a), b), c) y d) del numeral 4 del pargrafo I del presente
Artculo, considerando en el inciso e) lo siguiente:
2.1

Datos de la Factura o Notafiscal Original.a) Nmero correlativo de factura o nota fiscal.


b) Nmero de Autorizacin.
c) Fecha de emisin.

d) Detalle: Cantidad, Concepto, Precio Unitario, Descuentos y Total.


e) Tipo de cambio oficial de venta correspondiente a la fecha de la
transaccin, cuando la operacin sea en moneda extranjera.
f) Total General en Bolivianos.
2.2

Datos de la Devolucin o Rescisin.a) Detalle: Cantidad, Concepto, Precio Unitario e Importe Pagado, en la
factura original.
b) Importe total devuelto (numeral y literal).
c) Monto efectivo del Crdito - Dbito.

VII.
Las facturas o notas fiscales emitidas a partir de la modalidad Punto de
Venta Da Vinci, aplicarn los formatos establecidos en el pargrafo I del presente
Artculo, considerando que el Logo y el Nombre o Razn Social del Sujeto Pasivo,
deber ser preimpreso o impreso en la parte superior izquierda del documento,
de acuerdo a los tamaos previstos en el pargrafo II del Artculo 13 de la
presente Resolucin.
Artculo 11.- (Formatos para Tickets y Rollos) I. Los sujetos pasivos o terceros
responsables que opten por la modalidad de Facturacin Mquinas Registradoras
y aquellos que emitan Facturas o Notas Fiscales en Rollo a partir de las
modalidades de Facturacin Computarizada y Punto de Venta Da Vinci, debern
aplicar los siguientes formatos (ver Anexo 7 y 8):
1. Mquinas Registradoras:
1.1 Anverso:
a) Ttulo: "FACTURA".
b) Nmero de Identificacin Tributaria (NIT) del sujeto pasivo. c) Nmero de
la Casa Matriz o Sucursal (Casa Matriz = 0; Sucursal = nmero asignado
por el SIN) y Nmero del Autoimpresor (MR) asignado por el SIN.
d) Nmero de Autorizacin.
e) Nmero correlativo de factura o nota fiscal.
f) Fecha de emisin, en el siguiente formato: DIA, MES, AO
(DD/MM/AAAA).
g) Nmero de Identificacin Tributaria o nmero de Documento de
Identificacin del comprador.
h) Detalle: Cantidad, Concepto, Precio Unitario y Total (en caso de
corresponder descuentos).
i) Total General en Bolivianos (numeral). j) Fecha lmite de emisin.
1.2 Reverso:
a) Razn Social en el caso de Personas Jurdicas o Nombre en el caso de
Personas Naturales.

b) Nmero de Identificacin Tributaria (NIT) del sujeto pasivo.


c) Domicilio tributario (casa matriz), nmero(s) telefnico(s) y la Alcalda a
la que pertenece.
d) Nmero de sucursal, domicilio, nmero(s) telefnico(s) y la Alcalda a la
que pertenece; slo en el caso que la nota fiscal sea emitida en una
sucursal, sin perjuicio de incluir la misma informacin para el resto de
sus sucursales.
e) En negrillas y legible la leyenda: "La reproduccin total o parcial y/o el
uso no autorizado de esta Nota Fiscal, constituye un delito a ser
sancionado conforme a Ley".
2. Facturacin Computarizada y Da Vinci, en rollos:
2.1Anverso:
a) Razn Social en el caso de Personas Jurdicas o Nombre en el caso de
Personas Naturales.
b) Nmero de la Casa Matriz o Sucursal y Nmero del Autoimpresor (SFC o
PVD) asignado por el SIN.
c) Domicilio, nmero(s) telefnico(s) y la Alcalda a la que pertenece la
Casa Matriz o Sucursal de emisin (Casa Matriz = 0; Sucursal = nmero
asignado por el SIN).
d) Ttulo y Subttulo, segn corresponda.
e) Nmero de Identificacin Tributaria (NIT) del sujeto pasivo.
f) Nmero correlativo de factura o nota fiscal.
g) Nmero de Autorizacin.
h) Fecha de emisin, en el siguiente formato: DIA, MES, AO
(DD/MM/AAAA).
i) Nombre o Razn Social del comprador.
j) Nmero de Identificacin Tributaria o nmero de
Documento de Identificacin del comprador. k) Detalle: Cantidad, Concepto,
Precio Unitario y Total (en caso de corresponder descuentos e ICE). l) Tipo de
cambio oficial de venta correspondiente a la fecha de la transaccin, cuando la
operacin sea en moneda extranjera. Para el caso de entidades del sistema
financiero nacional, estas podrn utilizar el tipo de cambio de moneda extranjera,
de acuerdo a disposiciones emitidas por la Superintendencia de Bancos y
Entidades Financieras. m) Total General en Bolivianos (numeral y literal). n)
Cdigo de Control. o) En negrillas la fecha lmite de emisin. p) En negrillas y
legible la leyenda: "La reproduccin total o parcial y/o el uso no autorizado de
esta Nota Fiscal, constituye un delito a ser sancionado conforme a Ley".
2.2. Reverso:
a) Razn Social en el caso de Personas Jurdicas o Nombre en el caso de
Personas Naturales.

b) Nmero de Identificacin Tributaria (NIT) del sujeto pasivo.


c) Domicilio tributario (Casa Matriz), nmero(s) telefnico(s) y la Alcalda a
la que pertenece.
d) Nmero de sucursal, domicilio, nmero(s) telefnico(s) y la Alcalda a la
que pertenece; slo en el caso que la nota fiscal sea emitida en una
sucursal, sin perjuicio de incluir la misma informacin para el resto de
sus sucursales.
Artculo 12.- (Consistencia de la Informacin) La informacin del sujeto pasivo
prevista en los Artculos precedentes, necesariamente debe coincidir con la
registrada en el Padrn Nacional de Contribuyentes. Asimismo, la informacin de
dosificacin consignada en dichos documentos, debe coincidir con la otorgada
por los Sistemas del SIN.
Artculo 13.- (Tamaos) I. Las facturas o notas fiscales del Sistema de Facturacin,
tanto originales como copias, debern aplicar los lmites mnimos y mximos
segn el siguiente cuadro:
Concepto
General
Factura o Notas Fiscales
Prevaloradas
Tickets (Ancho)
Factura o Notas Fiscales en Rollo
(Ancho)
Sticker

Minimo
1/4 Oficio
1/16
Oficio
35 mm

Maximo
Oficio

70 mm
2 x 7 cm

80 mm
4 x 7 cm

1/4 Oficio
50 mm

II. Sin perjuicio de los lmites previamente establecidos y slo a efectos de la


Modalidad de Facturacin Da Vinci, se aplicarn los siguientes tamaos fijos para
las facturas y logos:
Tamao Fijo
Carta

Margen
Izquierdo
0.5 cm

Margen
Superior
1.5 cm

1/2 Carta

0.5 cm

0.5 cm

1/4 Oficio
Rollo de 75 mm
ancho

0.5 cm

0.5 cm

Logo
2x2 cm
1.5x1.5
cm
0.9x0.9
cm
Al
reverso

III.
Las facturas o notas fiscales emitidas a travs de la modalidad de
Facturacin en Lnea, sern impresas nicamente en tamao carta.
IV.
Para el caso de Facturas Prevaloradas emitidas en formato cuerpo-taln,
los lmites se aplicarn tanto para el cuerpo como para el taln (ver Anexo 9).
V.
Aquellos sujetos pasivos o terceros responsables, que por razones
tecnolgicas no puedan aplicar los lmites previstos en el pargrafo I del presente
Artculo para Tickets o Facturas o Notas Fiscales en Rollo, podrn solicitar

autorizacin expresa ante el SIN, conforme al procedimiento dispuesto en el


Artculo 35dela presente disposicin.
Articulo 14.- (Colores y Materiales) I. Las facturas o notas fiscales debern
preimprimirse o imprimirse y emitirse, mnimamente observando lo siguiente:
1. En las modalidades de Facturacin Computarizada y Punto de Venta Da
Vinci, las facturas o notas fiscales debern contener informacin
personalizada del sujeto pasivo, es decir el Logo (si corresponde, pudiendo
mantener sus colores originales) y Nombre o Razn Social del sujeto
pasivo, en cualquier color distinto de negro. El resto de la informacin
podr ser impresa en cualquier color.
2. En las modalidades de Facturacin en Lnea y Electrnica, las facturas o
notas fiscales pueden ser emitidas sobre papel en blanco (salvo
requerimiento del sujeto pasivo), pudiendo imprimirse la informacin
correspondiente en cualquier color.
3. En la modalidad de Facturacin Manual, las facturas o notas fiscales
debern emitirse sobre papel que contenga preimpresa toda la informacin
fija del documento (Datos Bsicos, Datos de Dosificacin, Ttulo, Subttulo
y Datos Finales) en cualquier color distinto de negro (excepcin no
aplicable al Logo) debiendo consignar de forma manuscrita y en cualquier
color la informacin relativa a la transaccin.
4. En la modalidad de Facturacin Prevalorada, las facturas o notas fiscales
debern emitirse en papel que contenga de forma preimpresa la
informacin dispuesta al efecto, en cualquier color distinto de negro
(excepcin no aplicable al Logo), incluida la fecha de emisin de acuerdo al
tratamiento dispuesto en el pargrafo IV. del Artculo 10 de la presente
Resolucin.
5. En la modalidad de Facturacin Mquinas Registradoras y Facturacin
Computarizada en Rollos, las facturas o notas fiscales sern emitidas en
papel cuyo reverso contenga preimpresa la informacin dispuesta en el
Artculo 11 de la presente disposicin, en cualquier color distinto de negro
(excepcin no aplicable al Logo), debiendo imprimirse la informacin
correspondiente al anverso en cualquier color.
II.
Las facturas o notas fiscales debern emitirse en papel (incluso qumico)
con el gramaje mnimo siguiente: originales 48.8 gr. y para las copias 30 gr.,
respectivamente.
III.
Excepto para las modalidades de Facturacin en Lnea y Electrnica, las
facturas o notas fiscales no debern ser emitidas utilizando impresin en papel
trmico.
IV.
Como regla general, los materiales y colores utilizados para la elaboracin
de los originales y copias fsicas de las facturas o notas fiscales, debern permitir
preimprimir, imprimir o consignar de forma ntida, legible, precisa y permanente,
la informacin establecida al efecto.

TABLA DE ANEXOS
ANEXO A-1: NUMEROS ALEATORIOS PARA LA SECCION DE MOLIDO.......................2
ANEXO A-2: NUMEROS ALEATORIOS PARA LA SECCION DE MEZCLADO.................3
ANEXO A-3: NUMEROS ALEATORIOS PARA LA SECCION DE EMBUTIDO..................4
ANEXO A-4: NUMEROS ALEATORIOS PARA LA SECCION DE COCINADO..................6
ANEXO D-1: CODIGO FUENTE, MODULO DE AUTENTICACION...............................10
ANEXO D-2: CODIGO FUENTE, GESTION DE PERSONAL, MODULO ADMINISTRACION
............................................................................................................................. 12
ANEXO D-3: CODIGO FUENTE, MANUAL DE FUNCIONES, MODULO
ADMINISTRACION................................................................................................. 16
ANEXO D-4: CODIGO FUENTE, BOLETAS DE PAGO, MODULO ADMINISTRACION. . .20
ANEXO D-5: CODIGO FUENTE, PLANILLA DE SUELDOS PATRONALES, MODULO
ADMINISTRACION................................................................................................. 25
ANEXO D-6: CODIGO FUENTE, GESTION DE PROVEEDORES, MODULO PROVISION
............................................................................................................................. 26
ANEXO D-7: CODIGO FUENTE, COMPRAS, MODULO PROVISION...........................29
ANEXO D-8: CODIGO FUENTE, PRODUCTOS TERMINADOS, MODULO PRODUCCION
............................................................................................................................. 31
ANEXO D-9: CODIGO FUENTE, INSUMOS, MODULO PRODUCCION........................34
ANEXO D-10: CODIGO FUENTE, PROGRAMA MAESTRO DE PRODUCCION, MODULO
PRODUCCION........................................................................................................ 37
ANEXO D-11: CODIGO FUENTE, GESTION DE CLIENTES, MODULO VENTAS..........40
ANEXO D-12: CODIGO FUENTE, VENTAS, MODULO VENTAS..................................44
ANEXO D-13: CODIGO FUENTE, RESGISTROS CONTABLES, MODULO
CONTABILIDAD..................................................................................................... 51
ANEXO D-14: CODIGO FUENTE, CUENTAS, MODULO CONTABILIDAD....................60
ANEXO D-15: CODIGO FUENTE, INDICADORES FINANCIEROS, MODULO
CONTABILIDAD..................................................................................................... 64
ANEXO D-16: CODIGO FUENTE, ESTADO DE RESULTADOS, MODULO
CONTABILIDAD..................................................................................................... 65
ANEXO D-17: CODIGO FUENTE, BALANCE GENERAL, MODULO CONTABILIDAD....67
ANEXO E-1: Nuevo sistema de facturacion...........................................................72

You might also like