Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a751b16c

Von Moritz Bunkus vor fast 18 Jahren hinzugefügt

  • ID a751b16cead5e56b62e18ee616e04323919f5fe1
  • Vorgänger 6715bd15
  • Nachfolger 4671a79f

Speichern von Verkäufern bei Kundenstammdaten.

Unterschiede anzeigen:

bin/mozilla/ct.pl
42 42
use CGI;
43 43
use Data::Dumper;
44 44

  
45
require "bin/mozilla/common.pl";
46

  
45 47
1;
46 48

  
47 49
# end of main
......
583 585
sub form_header {
584 586
  $lxdebug->enter_sub();
585 587

  
588
  $form->get_lists("employees" => "ALL_SALESMEN");
589

  
586 590
  $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
587 591
  $form->{creditlimit} =
588 592
    $form->format_amount(\%myconfig, $form->{creditlimit}, 0);
......
638 642
  }
639 643

  
640 644
  $taxzone = qq|
641
	      <tr>
642 645
		<th align=right>| . $locale->text('Steuersatz') . qq|</th>
643 646
		<td><select name=taxzone_id>$form->{selecttaxzone}</select></td>
644 647
		<input type=hidden name=selecttaxzone value="$form->{selecttaxzone}">
645
	      </tr>|;
648
|;
646 649

  
647 650
  $get_contact_url =
648 651
    "$form->{script}?login=$form->{login}&path=$form->{path}&password=$form->{password}&action=get_contact";
......
772 775
           <td><input name=c_vendor_id size=10 tabindex=18 maxlength=35 value="$form->{c_vendor_id}"></td>
773 776
|;
774 777
  }
775
  $business_salesman = "";
776
  $business          = "<th></th><td></td>";
777
  if ($vertreter) {
778
    $business_salesman = qq|
779
	<tr>
780
          <td colspan=3>
781
            <table>
782
	     <th align=right>| . $locale->text('Type of Business') . qq|</th>
783
	     <td><select name=business tabindex=1>$form->{selectbusiness}</select></td>
784
	     <th align=right>| . $locale->text('Salesman') . qq|</th>
785
	     <td><input name=salesman tabindex=2 value="$form->{salesman}"></td>
786
             <input type=hidden name=salesman_id value="$form->{salesman_id}">
787
             <input type=hidden name=oldsalesman value="$form->{oldsalesman}">
788
            </table>
789
          </td>
790
       <tr>|;
791
    $business = qq|
792
	     <th align=right>| . $locale->text('Username') . qq|</th>
793
	     <td><input name=username maxlength=50 tabindex=22 value="$form->{username}"></td>
794
 	     <th align=right>| . $locale->text('Password') . qq|</th>
795
	     <td><input name=user_password maxlength=12 tabindex=23 value="$form->{user_password}"></td>|;
796
  } else {
797
    $business = qq|
778

  
779
  $business = qq|
798 780
 	  <th align=right>| . $locale->text('Type of Business') . qq|</th>
799 781
	  <td><select name=business tabindex=22>$form->{selectbusiness}</select></td>
800 782
      |;
783

  
784
  $salesman = "";
785

  
786
  if ($form->{db} eq "customer") {
787
    my (@salesman_values, %salesman_labels);
788
    push(@salesman_values, undef);
789
    foreach my $item (@{ $form->{ALL_SALESMEN} }) {
790
      push(@salesman_values, $item->{id});
791
      $salesman_labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login};
792
    }
793

  
794
    $salesman =
795
      qq| <th align="right">| . $locale->text('Salesman') . qq|</th>
796
          <td>| .
797
      NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id},
798
                           '-values' => \@salesman_values, '-labels' => \%salesman_labels))
799
      . qq|</td>|;
801 800
  }
802 801

  
803 802
## LINET: Create a drop-down box with all prior titles and greetings.
......
895 894

  
896 895
      <table width=100%>
897 896
	<tr height="5"></tr>
898
        $business_salesman
899 897
	<tr>
900 898
	  <th align=right nowrap>| . $locale->text($label . ' Number') . qq|</th>
901 899
	  <td><input name="$form->{db}number" size=35 maxlength=35 value="$form->{"$form->{db}number"}"></td>
......
992 990
          <td align=right>| . $locale->text('Obsolete') . qq|</td>
993 991
          <td><input name=obsolete class=checkbox type=checkbox value=1 $form->{obsolete}></td>
994 992
	</tr>
995
        $taxzone
993
        <tr>
994
          $taxzone
995
          $salesman
996
        </tr>
996 997
      </table>
997 998
  <table>
998 999
  <tr>
......
1199 1200
    ($form->{db} eq 'customer')
1200 1201
    ? $locale->text('Save and AR Transaction')
1201 1202
    : $locale->text('Save and AP Transaction');
1202
  if ($vertreter) {
1203
    $update_button =
1204
      qq|<input class=submit type=submit name=action accesskey="u" value="|
1205
      . $locale->text("Update") . qq|">|;
1206
  } else {
1207
    $update_button = "";
1208
  }
1209 1203

  
1210 1204
##<input class=submit type=submit name=action value="|.$locale->text("Save and Quotation").qq|">
1211 1205
##<input class=submit type=submit name=action value="|.$locale->text("Save and RFQ").qq|">
......
1228 1222

  
1229 1223

  
1230 1224
<br>
1231
$update_button
1232 1225
<input class=submit type=submit name=action accesskey="s" value="|
1233 1226
    . $locale->text("Save") . qq|">
1234 1227
<input class=submit type=submit name=action accesskey="s" value="|
......
1283 1276
#  # /saving the history
1284 1277
  
1285 1278
  $form->isblank("name", $locale->text("Name missing!"));
1286
  if ($vertreter && $form->{db} eq "customer") {
1287
    $form->isblank("salesman_id", $locale->text("Salesman missing!"));
1288
  }
1289 1279
  &{"CT::save_$form->{db}"}("", \%myconfig, \%$form);
1290 1280

  
1291 1281
  $form->{callback} = $form->escape($form->{callback}, 1);
......
1397 1387
  $imsg .= " saved!";
1398 1388

  
1399 1389
  $form->isblank("name", $locale->text("Name missing!"));
1400
  if ($vertreter && $form->{db} eq "customer") {
1401
    $form->isblank("salesman_id", $locale->text("Salesman missing!"));
1402
  }
1403 1390
  $rc = &{"CT::save_$form->{db}"}("", \%myconfig, \%$form);
1404 1391
  if ($rc == 3) {
1405 1392
    $form->error($locale->text('customernumber not unique!'));
......
1425 1412
  $imsg .= " saved!";
1426 1413

  
1427 1414
  $form->isblank("name", $locale->text("Name missing!"));
1428
  if ($vertreter && $form->{db} eq "customer") {
1429
    $form->isblank("salesman_id", $locale->text("Salesman missing!"));
1430
  }
1431 1415

  
1432 1416
  my $res = &{"CT::save_$form->{db}"}("", \%myconfig, \%$form);
1433 1417

  

Auch abrufbar als: Unified diff