Revision 2ff471a7
Von Moritz Bunkus vor fast 18 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
1707 | 1707 |
|
1708 | 1708 |
# build selection list |
1709 | 1709 |
if ($count < $myconfig->{vclimit}) { |
1710 |
$query = qq|SELECT id, name |
|
1710 |
$query = qq|SELECT id, name, salesman_id
|
|
1711 | 1711 |
FROM $table WHERE not obsolete |
1712 | 1712 |
ORDER BY name|; |
1713 | 1713 |
$sth = $dbh->prepare($query); |
SL/IS.pm | ||
---|---|---|
1050 | 1050 |
delivery_customer_id = $form->{delivery_customer_id}, |
1051 | 1051 |
delivery_vendor_id = $form->{delivery_vendor_id}, |
1052 | 1052 |
employee_id = $form->{employee_id}, |
1053 |
salesman_id = | . conv_i($form->{salesman_id}, 'NULL') . qq|, |
|
1053 | 1054 |
storno = '$form->{storno}', |
1054 | 1055 |
globalproject_id = | . conv_i($form->{"globalproject_id"}, 'NULL') . qq|, |
1055 | 1056 |
cp_id = | . conv_i($form->{"cp_id"}, 'NULL') . qq| |
... | ... | |
1482 | 1483 |
a.transdate AS invdate, a.deliverydate, a.paid, a.storno, a.gldate, |
1483 | 1484 |
a.shippingpoint, a.shipvia, a.terms, a.notes, a.intnotes, a.taxzone_id, |
1484 | 1485 |
a.duedate, a.taxincluded, a.curr AS currency, a.shipto_id, a.cp_id, |
1485 |
a.employee_id, e.name AS employee, a.payment_id, a.language_id, a.delivery_customer_id, a.delivery_vendor_id, a.type |
|
1486 |
a.employee_id, e.name AS employee, a.salesman_id, a.payment_id, a.language_id, a.delivery_customer_id, a.delivery_vendor_id, a.type
|
|
1486 | 1487 |
FROM ar a |
1487 | 1488 |
LEFT JOIN employee e ON (e.id = a.employee_id) |
1488 | 1489 |
WHERE a.id = $form->{id}|; |
... | ... | |
1685 | 1686 |
c.email, c.cc, c.bcc, c.language_id, c.payment_id AS customer_payment_id, |
1686 | 1687 |
c.street, c.zipcode, c.city, c.country, |
1687 | 1688 |
$duedate + COALESCE(pt.terms_netto, 0) AS duedate, c.notes AS intnotes, |
1688 |
b.discount AS tradediscount, b.description AS business, c.klass as customer_klass, c.taxzone_id |
|
1689 |
b.discount AS tradediscount, b.description AS business, c.klass as customer_klass, c.taxzone_id, |
|
1690 |
c.salesman_id |
|
1689 | 1691 |
FROM customer c |
1690 | 1692 |
LEFT JOIN business b ON (b.id = c.business_id) |
1691 | 1693 |
LEFT JOIN payment_terms pt ON c.payment_id = pt.id |
SL/OE.pm | ||
---|---|---|
447 | 447 |
delivery_customer_id = $form->{delivery_customer_id}, |
448 | 448 |
globalproject_id = | . conv_i($form->{"globalproject_id"}, 'NULL') . qq|, |
449 | 449 |
employee_id = $form->{employee_id}, |
450 |
salesman_id = | . conv_i($form->{salesman_id}, 'NULL') . qq|, |
|
450 | 451 |
cp_id = | . conv_i($form->{cp_id}, 'NULL') . qq| |
451 | 452 |
WHERE id = $form->{id}|; |
452 | 453 |
$dbh->do($query) || $form->dberror($query); |
... | ... | |
677 | 678 |
# it will be killed out and then has to be fetched from the item scope query further down |
678 | 679 |
$query = qq|SELECT o.cp_id, o.ordnumber, o.transdate, o.reqdate, |
679 | 680 |
o.taxincluded, o.shippingpoint, o.shipvia, o.notes, o.intnotes, |
680 |
o.curr AS currency, e.name AS employee, o.employee_id, |
|
681 |
o.curr AS currency, e.name AS employee, o.employee_id, o.salesman_id,
|
|
681 | 682 |
o.$form->{vc}_id, cv.name AS $form->{vc}, o.amount AS invtotal, |
682 | 683 |
o.closed, o.reqdate, o.quonumber, o.department_id, o.cusordnumber, |
683 | 684 |
d.description AS department, o.payment_id, o.language_id, o.taxzone_id, |
bin/mozilla/is.pl | ||
---|---|---|
121 | 121 |
if ($form->{all_customer}) { |
122 | 122 |
unless ($form->{customer_id}) { |
123 | 123 |
$form->{customer_id} = $form->{all_customer}->[0]->{id}; |
124 |
$form->{salesman_id} = $form->{all_customer}->[0]->{salesman_id}; |
|
124 | 125 |
} |
125 | 126 |
} |
126 | 127 |
|
... | ... | |
367 | 368 |
"shipto" => "ALL_SHIPTO", |
368 | 369 |
"projects" => { "key" => "ALL_PROJECTS", |
369 | 370 |
"all" => 0, |
370 |
"old_id" => \@old_project_ids }); |
|
371 |
"old_id" => \@old_project_ids }, |
|
372 |
"employees" => "ALL_SALESMEN"); |
|
371 | 373 |
|
372 | 374 |
my (%labels, @values); |
373 | 375 |
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { |
... | ... | |
405 | 407 |
'-labels' => \%labels, |
406 | 408 |
'-default' => $form->{"globalproject_id"})); |
407 | 409 |
|
410 |
%labels = (); |
|
411 |
@values = (""); |
|
412 |
foreach my $item (@{ $form->{ALL_SALESMEN} }) { |
|
413 |
push(@values, $item->{id}); |
|
414 |
$labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login}; |
|
415 |
} |
|
416 |
|
|
417 |
$salesman = |
|
418 |
qq|<tr> |
|
419 |
<th align="right">| . $locale->text('Salesman') . qq|</th> |
|
420 |
<td>| . |
|
421 |
NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id}, |
|
422 |
'-values' => \@values, '-labels' => \%labels)) |
|
423 |
. qq|</td> |
|
424 |
</tr>|; |
|
425 |
|
|
408 | 426 |
# set option selected |
409 | 427 |
foreach $item (qw(AR customer currency department employee)) { |
410 | 428 |
$form->{"select$item"} =~ s/ selected//; |
... | ... | |
717 | 735 |
<td colspan=2><select name=employee>$form->{selectemployee}</select></td> |
718 | 736 |
<input type=hidden name=selectemployee value="$form->{selectemployee}"> |
719 | 737 |
<td></td> |
720 |
</tr>|; |
|
738 |
</tr> |
|
739 |
$salesman |
|
740 |
|; |
|
721 | 741 |
if ($form->{type} eq "credit_note") { |
722 | 742 |
print qq| <tr> |
723 | 743 |
<th align=right nowrap>| . $locale->text('Credit Note Number') . qq|</th> |
bin/mozilla/oe.pl | ||
---|---|---|
167 | 167 |
# set jscalendar |
168 | 168 |
$form->{jscalendar} = $jscalendar; |
169 | 169 |
|
170 |
my $editing = $form->{id}; |
|
171 |
|
|
170 | 172 |
OE->retrieve(\%myconfig, \%$form); |
171 | 173 |
|
172 | 174 |
if ($form->{payment_id}) { |
... | ... | |
179 | 181 |
$taxzone_id = $form->{taxzone_id}; |
180 | 182 |
} |
181 | 183 |
|
184 |
$salesman_id = $form->{salesman_id} if ($editing); |
|
185 |
|
|
182 | 186 |
|
183 | 187 |
# if multiple rowcounts (== collective order) then check if the |
184 | 188 |
# there were more than one customer (in that case OE::retrieve removes |
... | ... | |
282 | 286 |
# forex |
283 | 287 |
$form->{forex} = $form->{exchangerate}; |
284 | 288 |
|
289 |
$form->{salesman_id} = $salesman_id if ($editing); |
|
290 |
|
|
285 | 291 |
$lxdebug->leave_sub(); |
286 | 292 |
} |
287 | 293 |
|
... | ... | |
418 | 424 |
"shipto" => "ALL_SHIPTO", |
419 | 425 |
"projects" => { "key" => "ALL_PROJECTS", |
420 | 426 |
"all" => 0, |
421 |
"old_id" => \@old_project_ids }); |
|
427 |
"old_id" => \@old_project_ids }, |
|
428 |
"employees" => "ALL_SALESMEN"); |
|
422 | 429 |
|
423 | 430 |
my (%labels, @values); |
424 | 431 |
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { |
... | ... | |
456 | 463 |
'-labels' => \%labels, |
457 | 464 |
'-default' => $form->{"globalproject_id"})); |
458 | 465 |
|
466 |
$salesman = ""; |
|
467 |
if ($form->{type} =~ /^sales_/) { |
|
468 |
%labels = (); |
|
469 |
@values = (""); |
|
470 |
foreach my $item (@{ $form->{ALL_SALESMEN} }) { |
|
471 |
push(@values, $item->{id}); |
|
472 |
$labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login}; |
|
473 |
} |
|
474 |
|
|
475 |
$salesman = |
|
476 |
qq|<tr> |
|
477 |
<th align="right">| . $locale->text('Salesman') . qq|</th> |
|
478 |
<td>| . |
|
479 |
NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id}, |
|
480 |
'-values' => \@values, '-labels' => \%labels)) |
|
481 |
. qq|</td> |
|
482 |
</tr>|; |
|
483 |
} |
|
484 |
|
|
459 | 485 |
$form->{exchangerate} = |
460 | 486 |
$form->format_amount(\%myconfig, $form->{exchangerate}); |
461 | 487 |
|
... | ... | |
803 | 829 |
<table> |
804 | 830 |
$openclosed |
805 | 831 |
$employee |
832 |
$salesman |
|
806 | 833 |
$ordnumber |
807 | 834 |
<tr> |
808 | 835 |
<th width="70%" align="right" nowrap>| . $locale->text('Project Number') . qq|</th> |
locale/de/is | ||
---|---|---|
190 | 190 |
'SAVED FOR DUNNING' => 'Gespeichert', |
191 | 191 |
'SCREENED' => 'Angezeigt', |
192 | 192 |
'Sales Order' => 'Kundenauftrag', |
193 |
'Salesman' => 'Verk?ufer/in', |
|
193 | 194 |
'Save draft' => 'Entwurf speichern', |
194 | 195 |
'Screen' => 'Bildschirm', |
195 | 196 |
'Select a Customer' => 'Endkunde ausw?hlen', |
locale/de/oe | ||
---|---|---|
193 | 193 |
'SCREENED' => 'Angezeigt', |
194 | 194 |
'Sales Order' => 'Kundenauftrag', |
195 | 195 |
'Sales Orders' => 'Auftr?ge', |
196 |
'Salesman' => 'Verk?ufer/in', |
|
196 | 197 |
'Save' => 'Speichern', |
197 | 198 |
'Save and Close' => 'Speichern und schlie?en', |
198 | 199 |
'Save as new' => 'als neu speichern', |
sql/Pg-upgrade2/oe_is_salesman.sql | ||
---|---|---|
1 |
-- @tag: oe_is_salesman |
|
2 |
-- @description: Speichern eines Verkäufers bei Angeboten und Ausgangsrechnungen |
|
3 |
-- @depends: release_2_4_1 |
|
4 |
ALTER TABLE oe ADD COLUMN salesman_id integer; |
|
5 |
ALTER TABLE oe ADD FOREIGN KEY (salesman_id) REFERENCES employee (id); |
|
6 |
ALTER TABLE ar ADD COLUMN salesman_id integer; |
|
7 |
ALTER TABLE ar ADD FOREIGN KEY (salesman_id) REFERENCES employee (id); |
Auch abrufbar als: Unified diff
Speichern und Anzeigen eines Verkäufers bei Verkaufsmasken.