Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1927b931

Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt

  • ID 1927b9314ffe8160b819ea9b314153766387d473
  • Vorgänger 796d0b76
  • Nachfolger cdd9fe3f

Gültigkeitstoken Einkaufsrechnung

Unterschiede anzeigen:

SL/DB/ValidityToken.pm
__PACKAGE__->meta->initialize;
use constant SCOPE_SALES_INVOICE_POST => 'SalesInvoice::Post';
use constant SCOPE_DELIVERY_ORDER_SAVE => 'DeliveryOrder::Save';
use constant SCOPE_ORDER_SAVE => 'Order::Save';
use constant SCOPE_RECLAMATION_SAVE => 'Reclamation::Save';
use constant SCOPE_SALES_INVOICE_POST => 'SalesInvoice::Post';
use constant SCOPE_PURCHASE_INVOICE_POST => 'PurchaseInvoice::Post';
use constant SCOPE_DELIVERY_ORDER_SAVE => 'DeliveryOrder::Save';
use constant SCOPE_ORDER_SAVE => 'Order::Save';
use constant SCOPE_RECLAMATION_SAVE => 'Reclamation::Save';
sub create {
my ($class, %params) = @_;
bin/mozilla/do.pl
$form->get_employee();
$form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_SALES_INVOICE_POST())->token;
$form->{convert_from_do_ids} = $form->{id};
# if we have a reqdate (Liefertermin), this is definetely the preferred
# deliverydate for invoices
......
$form->{script} = 'ir.pl';
$script = "ir";
$buysell = 'sell';
$form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_PURCHASE_INVOICE_POST())->token;
} else {
$form->{title} = $locale->text('Add Sales Invoice');
$form->{script} = 'is.pl';
$script = "is";
$buysell = 'buy';
$form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_SALES_INVOICE_POST())->token;
}
for my $i (1 .. $form->{rowcount}) {
bin/mozilla/ir.pl
use SL::DB::Department;
use SL::DB::Project;
use SL::DB::PurchaseInvoice;
use SL::DB::ValidityToken;
use SL::DB::Vendor;
use List::MoreUtils qw(uniq);
use List::Util qw(max sum);
......
$form->{title} = $locale->text('Record Vendor Invoice');
if (!$form->{form_validity_token}) {
$form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_PURCHASE_INVOICE_POST())->token;
}
&invoice_links;
&prepare_invoice;
&display_form;
......
}
sub show_draft {
$::form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_PURCHASE_INVOICE_POST())->token;
update();
}
......
$form->{invnumber} = "Storno zu " . $form->{invnumber};
$form->{rowcount}++;
$form->{employee_id} = $employee_id;
$form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_PURCHASE_INVOICE_POST())->token;
post();
$main::lxdebug->leave_sub();
......
$form->{rowcount}--;
$form->{invdate} = $form->current_date(\%myconfig);
$form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_PURCHASE_INVOICE_POST())->token;
$form->{"converted_from_invoice_id_$_"} = delete $form->{"invoice_id_$_"} for 1 .. $form->{"rowcount"};
$form->{useasnew} = 1;
......
$main::auth->assert('vendor_invoice_edit');
$form->mtime_ischanged('ap');
my $validity_token;
if (!$form->{id}) {
$validity_token = SL::DB::Manager::ValidityToken->fetch_valid_token(
scope => SL::DB::ValidityToken::SCOPE_PURCHASE_INVOICE_POST(),
token => $form->{form_validity_token},
);
$form->error($::locale->text('The form is not valid anymore.')) if !$validity_token;
}
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
$form->isblank("invdate", $locale->text('Invoice Date missing!'));
......
relink_accounts();
if (IR->post_invoice(\%myconfig, \%$form)){
$validity_token->delete if $validity_token;
delete $form->{form_validity_token};
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
$form->{snumbers} = qq|invnumber_| . $form->{invnumber};
bin/mozilla/oe.pl
$main::auth->assert($form->{type} eq 'purchase_order' || $form->{type} eq 'request_quotation' ? 'vendor_invoice_edit' : 'invoice_edit');
$form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_SALES_INVOICE_POST())->token;
$form->{old_salesman_id} = $form->{salesman_id};
$form->get_employee();
......
$form->{script} = 'ir.pl';
$script = "ir";
$buysell = 'sell';
$form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_PURCHASE_INVOICE_POST())->token;
}
if ( $form->{type} eq 'sales_order'
......
$form->{script} = 'is.pl';
$script = "is";
$buysell = 'buy';
$form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_SALES_INVOICE_POST())->token;
}
# bo creates the id, reset it
templates/design40_webpages/ir/form_header.html
<input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
<input type="hidden" name="follow_up_rowcount" value="1">
<input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
[% IF !id %]
[% L.hidden_tag('form_validity_token', form_validity_token) %]
[% END %]
[% INCLUDE 'common/flash.html' %]
[% INCLUDE 'generic/set_longdescription.html' %]
templates/webpages/ir/form_header.html
<input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
<input type="hidden" name="follow_up_rowcount" value="1">
<input type="hidden" name="lastmtime" value="[% HTML.escape(lastmtime) %]">
[% IF !id %]
[% L.hidden_tag('form_validity_token', form_validity_token) %]
[% END %]
[%- INCLUDE 'common/flash.html' %]
[%- INCLUDE 'generic/set_longdescription.html' %]

Auch abrufbar als: Unified diff