From 5349a1ed016ae603b39d73747eccc6792707db1c Mon Sep 17 00:00:00 2001 From: Sparky6 Date: Tue, 13 Dec 2022 18:38:50 +0100 Subject: [PATCH] epic-s6g --- SL/Controller/Mebil.pm | 6 ++-- SL/DB/Manager/MebilMapping.pm | 28 +++++++++++++++ SL/DB/MebilMapping.pm | 6 ---- SL/mebil/Mapping.pm | 22 ++++++++++++ .../RecentChanges/1-20210218164308.zip | Bin 537 -> 0 bytes .../RecentChanges/12-20210218191800.zip | Bin 553 -> 0 bytes .../RecentChanges/16-20210218192122.zip | Bin 553 -> 0 bytes .../RecentChanges/18-20210218193807.zip | Bin 561 -> 0 bytes .../RecentChanges/22-20210218193819.zip | Bin 560 -> 0 bytes .../RecentChanges/24-20210218193922.zip | Bin 558 -> 0 bytes .../RecentChanges/26-20210218194426.zip | Bin 565 -> 0 bytes .../RecentChanges/29-20210218194432.zip | Bin 564 -> 0 bytes .../RecentChanges/3-20210218191029.zip | Bin 553 -> 0 bytes .../RecentChanges/6-20210218191037.zip | Bin 553 -> 0 bytes .../RecentChanges/9-20210218191653.zip | Bin 553 -> 0 bytes Test/FitNesseRoot/RecentChanges/content.txt | 2 ++ Test/FitnessePages/MappingSuite/.dummy | 0 Test/perl/ErrorChannel.pm | 16 +++++++++ Test/perl/test_action.pl | 33 +++++++++--------- 19 files changed, 89 insertions(+), 24 deletions(-) create mode 100644 SL/mebil/Mapping.pm delete mode 100644 Test/FitNesseRoot/RecentChanges/1-20210218164308.zip delete mode 100644 Test/FitNesseRoot/RecentChanges/12-20210218191800.zip delete mode 100644 Test/FitNesseRoot/RecentChanges/16-20210218192122.zip delete mode 100644 Test/FitNesseRoot/RecentChanges/18-20210218193807.zip delete mode 100644 Test/FitNesseRoot/RecentChanges/22-20210218193819.zip delete mode 100644 Test/FitNesseRoot/RecentChanges/24-20210218193922.zip delete mode 100644 Test/FitNesseRoot/RecentChanges/26-20210218194426.zip delete mode 100644 Test/FitNesseRoot/RecentChanges/29-20210218194432.zip delete mode 100644 Test/FitNesseRoot/RecentChanges/3-20210218191029.zip delete mode 100644 Test/FitNesseRoot/RecentChanges/6-20210218191037.zip delete mode 100644 Test/FitNesseRoot/RecentChanges/9-20210218191653.zip create mode 100644 Test/FitnessePages/MappingSuite/.dummy create mode 100644 Test/perl/ErrorChannel.pm diff --git a/SL/Controller/Mebil.pm b/SL/Controller/Mebil.pm index 570e07011..dbb8c2dea 100644 --- a/SL/Controller/Mebil.pm +++ b/SL/Controller/Mebil.pm @@ -13,6 +13,8 @@ use SL::Locale::String; # t8 #use Data::Dumper; #use SL::ClientJS; +use SL::mebil::Mapping; + use Rose::Object::MakeMethods::Generic ( scalar => [ qw(report number_columns year current_year objects subtotals_per_quarter salesman_id) ], 'scalar --get_set_init' => [ qw(employees types data) ], @@ -56,8 +58,8 @@ sub action_showmap { $::form->{title} = $::locale->text('Mebil Map'); - my $sql = "SELECT fromacc,typ,toacc from mebil_mapping order by ordering"; - $self->{data} = SL::DBUtils::selectall_hashref_query($::form, $::form->get_standard_dbh, $sql); + my $mapping = new SL::mebil::Mapping($::form, $::form->get_standard_dbh); + $self->{data} = $mapping->get_mapping(); $self->prepare_report; $self->list_data; diff --git a/SL/DB/Manager/MebilMapping.pm b/SL/DB/Manager/MebilMapping.pm index 6ccaa0821..9f37457a7 100644 --- a/SL/DB/Manager/MebilMapping.pm +++ b/SL/DB/Manager/MebilMapping.pm @@ -12,3 +12,31 @@ sub object_class { 'SL::DB::MebilMapping' } __PACKAGE__->make_manager_methods; 1; + +# The call above creates the methods shown below. (The actual +# method bodies vary slightly, but this is the gist of it...) +# +# sub get_products +# { +# shift->get_objects(@_, object_class => 'Product'); +# } +# +# sub get_products_iterator +# { +# shift->get_objects_iterator(@_, object_class => 'Product'); +# } +# +# sub get_products_count +# { +# shift->get_objects_count(@_, object_class => 'Product'); +# } +# +# sub update_products +# { +# shift->update_objects(@_, object_class => 'Product'); +# } +# +# sub delete_products +# { +# shift->delete_objects(@_, object_class => 'Product'); +# } diff --git a/SL/DB/MebilMapping.pm b/SL/DB/MebilMapping.pm index 785380ff7..2510d1fbb 100644 --- a/SL/DB/MebilMapping.pm +++ b/SL/DB/MebilMapping.pm @@ -7,10 +7,4 @@ use SL::DB::Manager::MebilMapping; __PACKAGE__->meta->initialize; -sub getMappings { - my $dbh = shift; - - return SL::DB::Manager::MebilMapping::get_mebilmappings(); -} - 1; diff --git a/SL/mebil/Mapping.pm b/SL/mebil/Mapping.pm new file mode 100644 index 000000000..ca2d5ea63 --- /dev/null +++ b/SL/mebil/Mapping.pm @@ -0,0 +1,22 @@ +package SL::mebil::Mapping; + +use strict; + +# Manager methods for mebil + +sub new { + # parameter: 1) ... + my $name = shift; + my $my_data = { + error_channel => shift, + dbh => shift}; + bless $my_data; + return $my_data; +} +sub get_mapping { + my $self = shift; + my $sql = "SELECT fromacc,typ,toacc from mebil_mapping order by ordering"; + return SL::DBUtils::selectall_hashref_query($self->{error_channel}, $self->{dbh}, $sql); +} + +1; diff --git a/Test/FitNesseRoot/RecentChanges/1-20210218164308.zip b/Test/FitNesseRoot/RecentChanges/1-20210218164308.zip deleted file mode 100644 index c463dcdf15b4c21296589c06d0181912bea56459..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 537 zcmWIWW@Zs#;Nak3@S7PF#DE02f$Ze`ypq(s61|d&lG?MrT+Ido4i9VnCo+4S?C(fR z-|EDzyY~idO8#Zn}_-Iy!-nz@Bi>IdaKYHg-FJohP_Z0V>=C`|?mxh+} z=o>h>7&)B28dMQovLjj5)PCQzHFxE<{+L+H5a7+uAzrtsa01YoJd6xLJ}!^&0aX+f zs93Dg!UigJEXwVcK(w{8vlbYaW@aXsGJ#iz9m#~<^~ZHyM1RJp5^`B zzdkoA!|r_IUpKC6yKA@J&ROloC2_Lf<6_c;B-Z2i+$3MN2KcKko-BJqby`;2Tbrpq zyCW_ybQ9-y+v)x?V$;f(>q@?a)by=6x58t#PEkUQ@A3a;(@wlfoA5zs!}+{(Ot1dS z?+1Be$<{Mkoj@nDgFV5>B*K7*4`dI5;sX^R#ZG`Xszzi(LHQkzyJWvrMsyB diff --git a/Test/FitNesseRoot/RecentChanges/12-20210218191800.zip b/Test/FitNesseRoot/RecentChanges/12-20210218191800.zip deleted file mode 100644 index 6026a9e75f0adfe86cb1371f6b69d829a7ec553c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 553 zcmWIWW@Zs#;Nak3SUoE!hye+31KG*>c_pcNC3+-=OdseSQhjrW>)eN6tw6yVLyp%Jrj z&H|vbT^Jb{0&sea52&J`D8C@Js3bGBSg#^CC$#?{-ysE_w)3Av()b^IiMx65Mdi%E z^DUu@GdGBs*zG&(@GS4|{`I+08FuFr|GIHq+g-c$cFt-yE(u^bTuhpf#CrUmo8-&Z z0DslRlVxwHPRnY0Ycthncf{p|ZsPoIJKbMKY+CtpUCEb_n!YvXR(QD7Pv{UA>)*?LB+6X-;CuqPOqL>Lh9gX}?2{GbA)*b4AQ)rf2; e$o~j%6UamjjR0>}Hjq3M5S9Yzc|eCSFaQAEAHUiF diff --git a/Test/FitNesseRoot/RecentChanges/16-20210218192122.zip b/Test/FitNesseRoot/RecentChanges/16-20210218192122.zip deleted file mode 100644 index 9b486732d67035425b05cf2ebf1d83e7b3fdc029..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 553 zcmWIWW@Zs#;Nak3I6NmPhye+31KG*>c_pcNC3+Ph|Em6c#*t zE~`~6s;ZTfM~El+V#@Tx=GUCe*Z%(g@%)jxc{l6}79=NIZQ4^&a_*9k%;Ghs9=r;> zG=*&?6<7N>@EOTHy1w-WyWHNnla?M;4}0bGa?h>w-b^?73pZ7-GV#BU3Cv=BH0_S) z&;G;Kt*6V>*Inh+TKlTD;t-$hMn}2xFV8Pm{azW=c<%e^%&@h+PXA`?WeD(Q=WstE z{Bi-%*)EI>Kt3*y@c~s76y+DB7L{bC7VA~y=7jbiCJD#Px4;$JteYrAW=-p*O=#wBsG-{WG^ge2DE_uM33 zwg&jCE}krVLv>nK+gqEdKD#3>FLV>yTt fLqYyWfSW)jYG?#_v$BEYnSihqNY4X0gnc_pcNC3+T(B#r;U zm$;h;UsTQvJl_(kICF!DiQT@l4$t!b?q8o9m0@>2@vj@#wcWK_Z|AIbc_pcNC3+^5#70MRIFc^WC~8hDT|g z)xOpvnY}SNCe`Oj)A86pO|i{sg>33Ea~?!>r|Gs+ych_D~!C$zkJTTQ0M2h@blZOSu1x2ewccb zJHVTr@*D^9N1mN@^A5cX>QGP*cQAuWMv0g=PPH6u@zC#K;ZRbCUr13xa z5_j|9i^`dS=UYM*XKoNNvDof%RHtRNy|tO@vpeGQLN{@Kx1H`UBQ~vkxvu0(NKN0Gb1OV% z>l7u__#XdnHtoc#vU$!<>BJtQ+G~ky1QsM)8E1k-}Kp1ck=pQXmEbj&{q8C=cSB&>PrJ&mYJUG+Bxy#)SJ=) z-s~L4^Ta1F1-iYKk%1uqr|+ySTk}q2W{8blEmc5}mEvxOV%~YS=5tkRbiSxVdbblGKY30jxC0{~n`qrFV;W1mM zD51vp_xSO4YrgFLZh>lv+1pcC1_o?v7WVL(I@vIjwtgbI+N lEWjI8BeJ0&|0BRXAQLq-0=!w-K=MpLSPG;U10BM^000d1$H4#q diff --git a/Test/FitNesseRoot/RecentChanges/26-20210218194426.zip b/Test/FitNesseRoot/RecentChanges/26-20210218194426.zip deleted file mode 100644 index 4960e1a51d44bfbd19145027e273e74b2e4e36cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 565 zcmWIWW@Zs#;Nak3m@qdehye+31KG*>c_pcNC3+74vEuE&+CO`4^fZ6vfAb<>=Bn?Ey=AkGCG3`{T)8A< z!se&A6$ckR~OIjh~c zBu@5wTuhpf#CrUmo8-&Z0DslRlVxwHPRnY0Ycthncf{p|ZsPoIJKbMKY+CtpUCEb_ zn!YvXR(QD7Pv{UA>)*?LB+6X-;CuqPOqL>Lfp uh3r94T%iJ_m<#Ym)rf2;$o~lN6v#vkjR0>}Hjq3M5S9YzRX~R@FaQ8hCD88x diff --git a/Test/FitNesseRoot/RecentChanges/29-20210218194432.zip b/Test/FitNesseRoot/RecentChanges/29-20210218194432.zip deleted file mode 100644 index 892df892baf3f33670ca57ba9dd6f2b41b78e48d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 564 zcmWIWW@Zs#;Nak3SUfic_pcNC3+le~vQ`5w;2hFj*AeiSQwz>rwC?~mn1N%l|tFFpj^T=kuCO(ENHhuEGySG+Pc zBW&M9HtRk=ta)nS!qYF z1k@ycV+-(R=Scjbpt2h1gRP7V3;{U($OlwWP?TSgT2zvmTC7)*n-ki9knfNJPuuxV zB5C{&zQo-;_@Z)V;Q5wN#hDvKOzifZb$FKdcmMj_s0_RFiGSU=uI;YfdOK&e8<)h% zevgYu6Oveu-*c0E*&5)lx_Gke4b^E`ZEtO+`s|LlywFXY-)*P+%ZN=YU#=_p5>nH* z=G+R8**ZlDHNMCHn@v0MDs93Cp$+Hr&N03EFTWq;i6vXlXmtXe$PV@dBa;XNBC3!* r2#P9HfD~~7-l!Up4F&lh0iFPvsG$+y&B_LnX9B`fAiWak5C#SSQH0Ku diff --git a/Test/FitNesseRoot/RecentChanges/3-20210218191029.zip b/Test/FitNesseRoot/RecentChanges/3-20210218191029.zip deleted file mode 100644 index a8e8dfedb6f031e5fd89427633e4971dca0b84df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 553 zcmWIWW@Zs#;Nak32$~rb#DE02f$Ze`ypq(s61|d&lG^jWT!#z<+8*v*euB~EQ?Qry z?krsmjkrW6XHMSW%*nBQ`B|*yxBhsv<<7~`MK+pbz0QY*k8MZ%OX@c~s76y+DB7L{bC7VA~y=7jbiCJD#Px4;$JteYrAW=-p*O=#wBsG-{WG^ge2DE_uM33 zwg&jCE}krVLv>nK+gqEdKD#3>FLV>yTt fLqYyWfSW)jYG?#_v$BEYnSihqNY4X0gnE_#l0+El%%&%T;v`&zegoIAHuEVJVIDKG7lc{gJl z|5@xv-m|9sP*Ci`ORH|SxxY|QkX-O_&i|UIlKJXWuhi_GmHzdT#?k(p+yUO~96@_D zB^Cgk?ZU{w5P;KTd_WZiMfnA(MJ1W3#d;OFIidXr`3@=Yw4MJXlE(kwOWe(aFDhpS zo^J_NoVh{7#BSeNhi7?z_pi^5%CI}1_}7i=+V0w|w{upzaY>x)_qdoeA&K?)JvYgh ztpWb3izmz8P@R_5_SR;q&+drJ3*E%|-FCXajM%jD<+_qDAvJw#&aLp6ty7dx<9qzS z*|Za{(k6Tm+HgMa9Mh}+^7}!aShDquRwvMj>|jqYGKnxC;s@D-p!h)rNU;^*jj9pZ fP>}x-;3klX8X5uKtZX28CLk;Y((`~0VPF6NW7@xo diff --git a/Test/FitNesseRoot/RecentChanges/9-20210218191653.zip b/Test/FitNesseRoot/RecentChanges/9-20210218191653.zip deleted file mode 100644 index 3e020af8ade02ba1be50b229801e73d6c15077ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 553 zcmWIWW@Zs#;Nak3aF`Vo#DE02f$Ze`ypq(s61|d&lG^i*T!#zYc z?)vZX2fv4#?sa;Xwn~-k+`)&tm;qW_otj(!dk)o5cgX**QKM zvFuv_bhZm41495#kMRLj6cptbq!yKArWWf}gD-J655B0J z8F;=WRB`485fi(8XC0p9{oTJlH!8#KeBxg>u4}t%x8BZK?Zzc>vftxk(u5?|CW42CFLXGe7 z|7O!pyh@w!L1@GIymL&i{>$$Nd1A@dGg_TMC$fV*!N?@SfQTPt4}#(c6(Ge{fH$f} gWJ5vzM}V6^CTeH|c(byBget_standard_dbh; SL::DB->register_db( domain => 'KIVITENDO', @@ -26,13 +22,18 @@ my $db = SL::DB->new(domain => 'KIVITENDO', type => 'KIVITENDO',); my $dbh = $db->dbh; -#$dbh->do("SELECT * FROM mebil_mapping"); - -#$db->begin_work or die $db->error; -#my $m = new SL::Controller::Mebil; -#$m->action_calcmap; -my $mappings = SL::DB::Manager::MebilMapping->get_objects(dbh => $dbh); - -foreach my $map (@$mappings) { - print ("$map\n"); +my $errch = new ErrorChannel; +my $mapper = new SL::mebil::Mapping($errch, $dbh); + +my $command = $ARGV[0]; +if ($command eq "GetMapping") { + my $mapping = $mapper->get_mapping(); + foreach (@$mapping) { + print $_->{fromacc}."\n"; + } + die ("Kein Mapping vorhanden.") unless (scalar(@$mapping) > 0); +} elsif ($command eq "CalcMapping") { + die ("NIY."); +} else { + die "Invalid command: $command"; } -- 2.20.1