Revision 96d3ef85
Von Sven Schöling vor mehr als 15 Jahren hinzugefügt
bin/mozilla/oe.pl | ||
---|---|---|
306 | 306 |
$TMPL_VAR{sales_employee_labels} = sub { $_[0]->{name} || $_[0]->{login} }; |
307 | 307 |
$TMPL_VAR{shipto_labels} = sub { join "; ", grep { $_ } map { $_[0]->{"shipto${_}" } } qw(name department_1 street city) }; |
308 | 308 |
$TMPL_VAR{contact_labels} = sub { join(', ', $_[0]->{"cp_name"}, $_[0]->{"cp_givenname"}) . ($_[0]->{cp_abteilung} ? " ($_[0]->{cp_abteilung})" : "") }; |
309 |
$TMPL_VAR{department_labels} = sub { "$_[0]->{description}--$_[0]->{id}" };
|
|
309 |
$TMPL_VAR{department_labels} = sub { "$_[0]->{description}--$_[0]->{id}" }; |
|
310 | 310 |
|
311 | 311 |
# vendor/customer |
312 | 312 |
$TMPL_VAR{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" }; |
... | ... | |
329 | 329 |
# credit remaining |
330 | 330 |
$creditwarning = (($form->{creditlimit} != 0) && ($form->{creditremaining} < 0) && !$form->{update}) ? 1 : 0; |
331 | 331 |
$TMPL_VAR{is_credit_remaining_negativ} = ($form->{creditremaining} =~ /-/) ? "0" : "1"; |
332 |
|
|
332 |
|
|
333 | 333 |
# business |
334 | 334 |
$TMPL_VAR{business_label} = ($form->{vc} eq "customer" ? $locale->text('Customer type') : $locale->text('Vendor type')); |
335 | 335 |
|
... | ... | |
457 | 457 |
|
458 | 458 |
sub update { |
459 | 459 |
$lxdebug->enter_sub(); |
460 |
|
|
460 |
|
|
461 | 461 |
my ($recursive_call) = shift; |
462 | 462 |
|
463 | 463 |
check_oe_access(); |
... | ... | |
466 | 466 |
|
467 | 467 |
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate) unless $recursive_call; |
468 | 468 |
$form->{update} = 1; |
469 |
|
|
469 |
|
|
470 | 470 |
$payment_id = $form->{payment_id} if $form->{payment_id}; |
471 |
|
|
471 |
|
|
472 | 472 |
&check_name($form->{vc}); |
473 |
|
|
473 |
|
|
474 | 474 |
$form->{payment_id} = $payment_id if $form->{payment_id} eq ""; |
475 |
|
|
475 |
|
|
476 | 476 |
$buysell = 'buy'; |
477 | 477 |
$buysell = 'sell' if ($form->{vc} eq 'vendor'); |
478 | 478 |
$form->{forex} = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{transdate}, $buysell); |
... | ... | |
689 | 689 |
push(@values, $item->{"id"}); |
690 | 690 |
$labels{$item->{"id"}} = $item->{"name"} ne "" ? $item->{"name"} : $item->{"login"}; |
691 | 691 |
} |
692 |
|
|
692 |
|
|
693 | 693 |
#salesmen |
694 | 694 |
my %labels_salesmen = (); |
695 | 695 |
my @values_salesmen = (''); |
... | ... | |
723 | 723 |
my $vc_label = $form->{vc} eq "customer" ? $locale->text('Customer') : $locale->text('Vendor'); |
724 | 724 |
$vc = |
725 | 725 |
$myconfig{vclimit} <= scalar(@values) |
726 |
? qq|<input type="text" value="| . H(($form->{"old$form->{vc}"} =~ /^(.*)\-\-.*$/)) . qq|" name="$form->{vc}">|
|
|
726 |
? qq|<input type="text" value="| . H(($form->{"old$form->{vc}"} =~ /^(.*)\-\-.*$/)) . qq|" name="$form->{vc}">| |
|
727 | 727 |
: NTI($cgi->popup_menu('-name' => "$form->{vc}", |
728 | 728 |
'-default' => $form->{"old$form->{vc}"}, |
729 | 729 |
'-onChange' => 'document.getElementById(\'update_button\').click();', |
... | ... | |
787 | 787 |
<tr> |
788 | 788 |
<td><input name="l_name" class=checkbox type=checkbox value=Y checked> $vc_label</td> |
789 | 789 |
<td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td> |
790 |
|
|
790 |
|
|
791 | 791 |
<td><input name="l_shipvia" class=checkbox type=checkbox value=Y> | . $locale->text('Ship via') . qq|</td> |
792 | 792 |
</tr> |
793 | 793 |
<tr> |
... | ... | |
1105 | 1105 |
if ($form->{currency} ne $form->{defaultcurrency}); |
1106 | 1106 |
|
1107 | 1107 |
&validate_items; |
1108 |
|
|
1109 |
if($form->{payment_id}) {
|
|
1108 |
|
|
1109 |
if($form->{payment_id}) { |
|
1110 | 1110 |
$payment_id = $form->{payment_id}; |
1111 | 1111 |
} |
1112 |
|
|
1112 |
|
|
1113 | 1113 |
# if the name changed get new values |
1114 | 1114 |
if (&check_name($form->{vc})) { |
1115 |
if($form->{payment_id} eq "") {
|
|
1115 |
if($form->{payment_id} eq "") { |
|
1116 | 1116 |
$form->{payment_id} = $payment_id; |
1117 | 1117 |
} |
1118 | 1118 |
&update; |
... | ... | |
1207 | 1207 |
if ($form->{currency} ne $form->{defaultcurrency}); |
1208 | 1208 |
|
1209 | 1209 |
&validate_items; |
1210 |
|
|
1211 |
if($form->{payment_id}) {
|
|
1210 |
|
|
1211 |
if($form->{payment_id}) { |
|
1212 | 1212 |
$payment_id = $form->{payment_id}; |
1213 | 1213 |
} |
1214 |
|
|
1214 |
|
|
1215 | 1215 |
# if the name changed get new values |
1216 | 1216 |
if (&check_name($form->{vc})) { |
1217 |
if($form->{payment_id} eq "") {
|
|
1217 |
if($form->{payment_id} eq "") { |
|
1218 | 1218 |
$form->{payment_id} = $payment_id; |
1219 | 1219 |
} |
1220 | 1220 |
&update; |
... | ... | |
1271 | 1271 |
$form->{addition} = "SAVED"; |
1272 | 1272 |
$form->save_history($form->dbconnect(\%myconfig)); |
1273 | 1273 |
} |
1274 |
# /saving the history
|
|
1274 |
# /saving the history |
|
1275 | 1275 |
|
1276 | 1276 |
$form->{simple_save} = 1; |
1277 | 1277 |
if(!$form->{print_and_save}) { |
... | ... | |
1350 | 1350 |
$form->{addition} = "DELETED"; |
1351 | 1351 |
$form->save_history($form->dbconnect(\%myconfig)); |
1352 | 1352 |
} |
1353 |
# /saving the history
|
|
1353 |
# /saving the history |
|
1354 | 1354 |
$form->info($msg); |
1355 | 1355 |
exit(); |
1356 | 1356 |
} |
... | ... | |
1386 | 1386 |
$form->{ordnumber} = ""; |
1387 | 1387 |
$form->{quodate} = $form->{transdate}; |
1388 | 1388 |
} |
1389 |
|
|
1389 |
|
|
1390 | 1390 |
$payment_id = $form->{payment_id} if $form->{payment_id}; |
1391 |
|
|
1391 |
|
|
1392 | 1392 |
# if the name changed get new values |
1393 | 1393 |
if (&check_name($form->{vc})) { |
1394 | 1394 |
$form->{payment_id} = $payment_id if $form->{payment_id} eq ""; |
... | ... | |
1441 | 1441 |
$buysell = 'sell'; |
1442 | 1442 |
} |
1443 | 1443 |
|
1444 |
if ( $form->{type} eq 'sales_order'
|
|
1444 |
if ( $form->{type} eq 'sales_order' |
|
1445 | 1445 |
|| $form->{type} eq 'sales_quotation') { |
1446 | 1446 |
$form->{title} = $locale->text('Add Sales Invoice'); |
1447 | 1447 |
$form->{script} = 'is.pl'; |
Auch abrufbar als: Unified diff
Whitespace Purge