Revision d2af074a
Von Jan Büren vor mehr als 9 Jahren hinzugefügt
SL/DO.pm | ||
---|---|---|
685 | 685 |
dord.closed, dord.reqdate, dord.department_id, dord.cusordnumber, |
686 | 686 |
d.description AS department, dord.language_id, |
687 | 687 |
dord.shipto_id, |
688 |
dord.itime,dord.mtime, |
|
688 |
dord.itime, dord.mtime,
|
|
689 | 689 |
dord.globalproject_id, dord.delivered, dord.transaction_description, |
690 | 690 |
dord.taxzone_id, dord.taxincluded, dord.payment_id, (SELECT cu.name FROM currencies cu WHERE cu.id=dord.currency_id) AS currency, |
691 | 691 |
dord.delivery_term_id, dord.itime::DATE AS insertdate |
... | ... | |
720 | 720 |
} |
721 | 721 |
} |
722 | 722 |
$sth->finish(); |
723 |
$form->{mtime} = $form->{itime} if !$form->{mtime};
|
|
723 |
$form->{mtime} ||= $form->{itime};
|
|
724 | 724 |
$form->{lastmtime} = $form->{mtime}; |
725 | 725 |
$form->{donumber_array} =~ s/\s*$//g; |
726 | 726 |
$form->{ordnumber_array} =~ s/ //; |
SL/Form.pm | ||
---|---|---|
2604 | 2604 |
} |
2605 | 2605 |
|
2606 | 2606 |
sub mtime_ischanged { |
2607 |
my ($self, $relation,$option) = @_; |
|
2608 |
#$main::lxdebug->message(LXDebug->DEBUG2(),"mtime_ischanged from rel=".$relation." id=".$id); |
|
2609 |
if ( ! $self->{id} ) { return ; } |
|
2607 |
my ($self, $relation, $option) = @_; |
|
2610 | 2608 |
|
2611 |
my $query = "SELECT mtime, itime FROM ".$relation." WHERE id = ?"; |
|
2609 |
return unless $self->{id}; # maybe better croak, but i have no api doc to refer to ... |
|
2610 |
|
|
2611 |
my $query = "SELECT mtime, itime FROM " . $relation . " WHERE id = ?"; |
|
2612 | 2612 |
my $ref = selectfirst_hashref_query($self, $self->get_standard_dbh, $query, $self->{id}); |
2613 | 2613 |
$ref->{mtime} = $ref->{itime} if !$ref->{mtime}; |
2614 |
#$main::lxdebug->message(LXDebug->DEBUG2(),"my mtime=".$self->{lastmtime}." new mtime=".$ref->{mtime}); |
|
2614 |
|
|
2615 | 2615 |
if ($self->{lastmtime} && $self->{lastmtime} ne $ref->{mtime} ) { |
2616 | 2616 |
my $etxt = $main::locale->text("The document has been changed from other user. Please reopen it in another window and copy the changes to the new window"); |
2617 |
|
|
2617 | 2618 |
$etxt = $main::locale->text("The document has been changed from other user. No mail was sent. Please reopen it in another window and copy the changes to the new window") |
2618 |
if defined $option && $option eq 'mail'; |
|
2619 |
if ($option eq 'mail'); |
|
2620 |
# ^^ I prefer: |
|
2621 |
# my $etxt = ($option eq 'mail') ? locale1 : locale2; |
|
2619 | 2622 |
$self->error($main::locale->text($etxt)); |
2620 | 2623 |
::end_of_request(); |
2621 | 2624 |
} |
... | ... | |
2772 | 2775 |
qq|SELECT |
2773 | 2776 |
a.cp_id, a.invnumber, a.transdate, a.${table}_id, a.datepaid, |
2774 | 2777 |
a.duedate, a.ordnumber, a.taxincluded, (SELECT cu.name FROM currencies cu WHERE cu.id=a.currency_id) AS currency, a.notes, |
2775 |
a.mtime,a.itime, |
|
2778 |
a.mtime, a.itime,
|
|
2776 | 2779 |
a.intnotes, a.department_id, a.amount AS oldinvtotal, |
2777 | 2780 |
a.paid AS oldtotalpaid, a.employee_id, a.gldate, a.type, |
2778 | 2781 |
a.globalproject_id, ${extra_columns} |
... | ... | |
2789 | 2792 |
foreach my $key (keys %$ref) { |
2790 | 2793 |
$self->{$key} = $ref->{$key}; |
2791 | 2794 |
} |
2792 |
$self->{mtime} = $self->{itime} if ! $self->{mtime};
|
|
2795 |
$self->{mtime} ||= $self->{itime};
|
|
2793 | 2796 |
$self->{lastmtime} = $self->{mtime}; |
2794 | 2797 |
my $transdate = "current_date"; |
2795 | 2798 |
if ($self->{transdate}) { |
SL/OE.pm | ||
---|---|---|
947 | 947 |
map { $form->{$_} = '' if ($ref->{$_} ne $form->{$_}) } keys %$ref; |
948 | 948 |
} |
949 | 949 |
} |
950 |
$form->{mtime} = $form->{itime} if ! $form->{mtime};
|
|
950 |
$form->{mtime} ||= $form->{itime};
|
|
951 | 951 |
$form->{lastmtime} = $form->{mtime}; |
952 | 952 |
|
953 | 953 |
# if not given, fill transdate with current_date |
bin/mozilla/oe.pl | ||
---|---|---|
1794 | 1794 |
my $locale = $main::locale; |
1795 | 1795 |
|
1796 | 1796 |
check_oe_access(); |
1797 |
|
|
1798 |
$form->mtime_ischanged('oe'); |
|
1799 | 1797 |
$main::auth->assert('sales_order_edit'); |
1798 |
$form->mtime_ischanged('oe'); |
|
1800 | 1799 |
|
1801 | 1800 |
if ($form->{type} eq "purchase_order") { |
1802 | 1801 |
delete($form->{ordnumber}); |
... | ... | |
1944 | 1943 |
$main::lxdebug->enter_sub(); |
1945 | 1944 |
|
1946 | 1945 |
my $form = $main::form; |
1947 |
my $locale = $main::locale; |
|
1948 | 1946 |
|
1949 | 1947 |
check_oe_access(); |
1950 | 1948 |
|
Auch abrufbar als: Unified diff
Erste Überarbeitung "Prüfen beim Speichern, ob Dokument geändert wurde."