992 |
992 |
employee_id = ?,
|
993 |
993 |
salesman_id = ?,
|
994 |
994 |
storno = ?,
|
|
995 |
storno_id = ?,
|
995 |
996 |
globalproject_id = ?,
|
996 |
997 |
cp_id = ?,
|
997 |
998 |
transaction_description = ?,
|
... | ... | |
1009 |
1010 |
conv_i($form->{"shipto_id"}),
|
1010 |
1011 |
conv_i($form->{"delivery_customer_id"}), conv_i($form->{"delivery_vendor_id"}),
|
1011 |
1012 |
conv_i($form->{"employee_id"}), conv_i($form->{"salesman_id"}),
|
1012 |
|
$form->{"storno"} ? 't' : 'f', conv_i($form->{"globalproject_id"}),
|
|
1013 |
$form->{"storno"} ? 't' : 'f', conv_i($form->{storno_id}), conv_i($form->{"globalproject_id"}),
|
1013 |
1014 |
conv_i($form->{"cp_id"}), $form->{transaction_description},
|
1014 |
1015 |
$form->{marge_total}, $form->{marge_percent},
|
1015 |
1016 |
conv_i($form->{"id"}));
|
... | ... | |
2162 |
2163 |
sub is_storno {
|
2163 |
2164 |
$main::lxdebug->enter_sub();
|
2164 |
2165 |
|
2165 |
|
my ($self, $myconfig, $form, $table) = @_;
|
|
2166 |
my ($self, $myconfig, $form, $table, $id) = @_;
|
2166 |
2167 |
|
2167 |
|
$main::lxdebug->leave_sub() and return 0 unless ($form->{id});
|
|
2168 |
$main::lxdebug->leave_sub() and return 0 unless ($id);
|
2168 |
2169 |
|
2169 |
2170 |
# make sure there's no funny stuff in $table
|
2170 |
2171 |
# ToDO: die when this happens and throw an error
|
... | ... | |
2173 |
2174 |
my $dbh = $form->dbconnect($myconfig);
|
2174 |
2175 |
|
2175 |
2176 |
my $query = qq|SELECT storno FROM $table WHERE id = ?|;
|
2176 |
|
my ($result) = selectrow_query($form, $dbh, $query, $form->{id});
|
|
2177 |
my ($result) = selectrow_query($form, $dbh, $query, $id);
|
2177 |
2178 |
|
2178 |
2179 |
$dbh->disconnect();
|
2179 |
2180 |
|
Beim Stornieren von Einkaufs- und Verkaufsrechnung auch die storno_id mit speichern (analog zu AR.pm/AP.pm), damit später eine Unterscheidung zwischen Stornorechnung und stornierter Rechnung möglich ist.