Revision 5eadc966
Von Moritz Bunkus vor mehr als 14 Jahren hinzugefügt
bin/mozilla/ct.pl | ||
---|---|---|
289 | 289 |
taxzones => "ALL_TAXZONES"); |
290 | 290 |
$form->get_pricegroup(\%myconfig, { all => 1 }); |
291 | 291 |
|
292 |
$form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1, with_obsolete => 1 }) if $::vertreter;
|
|
292 |
$form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::vertreter; |
|
293 | 293 |
|
294 | 294 |
$form->{ALL_SALESMEN} = $form->{ALL_EMPLOYEES}; |
295 | 295 |
$form->{taxincluded} = ($form->{taxincluded}) ? "checked" : ""; |
... | ... | |
336 | 336 |
$main::lxdebug->leave_sub(); |
337 | 337 |
} |
338 | 338 |
|
339 |
sub _do_save { |
|
340 |
$main::auth->assert('customer_vendor_edit & ' . |
|
341 |
'(general_ledger | invoice_edit | vendor_invoice_edit | ' . |
|
342 |
' request_quotation_edit | sales_quotation_edit | sales_order_edit | purchase_order_edit)'); |
|
343 |
|
|
344 |
$::form->isblank("name", $::locale->text("Name missing!")); |
|
345 |
|
|
346 |
if ($::form->{new_salesman_id} && $::vertreter) { |
|
347 |
$::form->{salesman_id} = $::form->{new_salesman_id}; |
|
348 |
delete $::form->{new_salesman_id}; |
|
349 |
} |
|
350 |
|
|
351 |
my $res = $::form->{db} eq 'customer' ? CT->save_customer(\%::myconfig, $::form) : CT->save_vendor(\%::myconfig, $::form); |
|
352 |
|
|
353 |
if (3 == $res) { |
|
354 |
if ($::form->{"db"} eq "customer") { |
|
355 |
$::form->error($::locale->text('This customer number is already in use.')); |
|
356 |
} else { |
|
357 |
$::form->error($::locale->text('This vendor number is already in use.')); |
|
358 |
} |
|
359 |
} |
|
360 |
} |
|
361 |
|
|
339 | 362 |
sub add_transaction { |
340 | 363 |
$main::lxdebug->enter_sub(); |
341 | 364 |
|
... | ... | |
354 | 377 |
# } |
355 | 378 |
# # /saving the history |
356 | 379 |
|
357 |
$form->isblank("name", $locale->text("Name missing!")); |
|
358 |
if ($form->{"db"} eq "customer") { |
|
359 |
CT->save_customer(\%myconfig, \%$form); |
|
360 |
} else { |
|
361 |
CT->save_vendor(\%myconfig, \%$form); |
|
362 |
} |
|
380 |
_do_save(); |
|
363 | 381 |
|
364 | 382 |
$form->{callback} = $form->escape($form->{callback}, 1); |
365 | 383 |
my $name = $form->escape("$form->{name}", 1); |
... | ... | |
516 | 534 |
my $msg = ucfirst $form->{db}; |
517 | 535 |
$msg .= " saved!"; |
518 | 536 |
|
519 |
$form->isblank("name", $locale->text("Name missing!")); |
|
520 |
my $rc; |
|
521 |
if ($form->{"db"} eq "customer") { |
|
522 |
$rc = CT->save_customer(\%myconfig, \%$form); |
|
523 |
} else { |
|
524 |
$rc = CT->save_vendor(\%myconfig, \%$form); |
|
525 |
} |
|
526 |
if ($rc == 3) { |
|
527 |
$form->error($locale->text('customernumber not unique!')); |
|
528 |
} |
|
537 |
_do_save(); |
|
538 |
|
|
529 | 539 |
# saving the history |
530 | 540 |
if(!exists $form->{addition}) { |
531 | 541 |
$form->{snumbers} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber}); |
... | ... | |
550 | 560 |
my $msg = ucfirst $form->{db}; |
551 | 561 |
$msg .= " saved!"; |
552 | 562 |
|
553 |
$form->isblank("name", $locale->text("Name missing!")); |
|
554 |
|
|
555 |
my $res; |
|
556 |
if ($form->{"db"} eq "customer") { |
|
557 |
$res = CT->save_customer(\%myconfig, \%$form); |
|
558 |
} else { |
|
559 |
$res = CT->save_vendor(\%myconfig, \%$form); |
|
560 |
} |
|
563 |
_do_save(); |
|
561 | 564 |
|
562 |
if (3 == $res) { |
|
563 |
if ($form->{"db"} eq "customer") { |
|
564 |
$form->error($locale->text('This customer number is already in use.')); |
|
565 |
} else { |
|
566 |
$form->error($locale->text('This vendor number is already in use.')); |
|
567 |
} |
|
568 |
} |
|
569 | 565 |
# saving the history |
570 | 566 |
if(!exists $form->{addition}) { |
571 | 567 |
$form->{snumbers} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber}); |
Auch abrufbar als: Unified diff
Vertretermodus: Immer bisherigen Vertreter anzeigen & nur wahlweise ändern
Neues Verhalten in der Kundenmaske: Wird ein Kunde neu angelegt, so
muss ein Vertreter ausgewählt werden.
Wird ein bestehender Kunde bearbeitet, so wird der Name des bisher für
ihn ausgewählten Vertreters immer angezeigt. Zusätzlich hat der
Bearbeiter die Möglichkeit, den Vertreter über die Drop-Down-Box der
aktuell gültigen Kunden zu ändern. Wird hier kein Vertreter
ausgewählt, so bleibt der bisherige Vertreter bestehen.