projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Leeren String in undef für anständige DB-Abfrage umwandeln
[kivitendo-erp.git]
/
SL
/
IR.pm
diff --git
a/SL/IR.pm
b/SL/IR.pm
index
454e747
..
8392177
100644
(file)
--- a/
SL/IR.pm
+++ b/
SL/IR.pm
@@
-41,6
+41,7
@@
use SL::CVar;
use SL::DBUtils;
use SL::DO;
use SL::GenericTranslations;
use SL::DBUtils;
use SL::DO;
use SL::GenericTranslations;
+use SL::IO;
use SL::MoreCommon;
use List::Util qw(min);
use SL::MoreCommon;
use List::Util qw(min);
@@
-102,7
+103,7
@@
sub post_invoice {
$form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"});
$form->{"qty_$i"} *= -1 if $form->{storno};
$form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"});
$form->{"qty_$i"} *= -1 if $form->{storno};
- $form->{"inventory_accno_$i"} = $form->{"expense_accno_$i"} if $
main::eur
;
+ $form->{"inventory_accno_$i"} = $form->{"expense_accno_$i"} if $
::lx_office_conf{system}->{eur}
;
# get item baseunit
if (!$item_units{$form->{"id_$i"}}) {
# get item baseunit
if (!$item_units{$form->{"id_$i"}}) {
@@
-317,12
+318,12
@@
sub post_invoice {
my ($invoice_id) = selectfirst_array_query($form, $dbh, qq|SELECT nextval('invoiceid')|);
$query =
my ($invoice_id) = selectfirst_array_query($form, $dbh, qq|SELECT nextval('invoiceid')|);
$query =
- qq|INSERT INTO invoice (id, trans_id, parts_id, description, qty, base_qty,
+ qq|INSERT INTO invoice (id, trans_id, parts_id, description,
longdescription,
qty, base_qty,
sellprice, fxsellprice, discount, allocated, unit, deliverydate,
project_id, serialnumber, price_factor_id, price_factor, marge_price_factor)
sellprice, fxsellprice, discount, allocated, unit, deliverydate,
project_id, serialnumber, price_factor_id, price_factor, marge_price_factor)
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, (SELECT factor FROM price_factors WHERE id = ?), ?)|;
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?,
(SELECT factor FROM price_factors WHERE id = ?), ?)|;
@values = ($invoice_id, conv_i($form->{id}), conv_i($form->{"id_$i"}),
@values = ($invoice_id, conv_i($form->{id}), conv_i($form->{"id_$i"}),
- $form->{"description_$i"}, $form->{"qty_$i"} * -1,
+ $form->{"description_$i"}, $form->{"
longdescription_$i"}, $form->{"
qty_$i"} * -1,
$baseqty * -1, $form->{"sellprice_$i"}, $fxsellprice, $form->{"discount_$i"}, $allocated,
$form->{"unit_$i"}, conv_date($form->{deliverydate}),
conv_i($form->{"project_id_$i"}), $form->{"serialnumber_$i"},
$baseqty * -1, $form->{"sellprice_$i"}, $fxsellprice, $form->{"discount_$i"}, $allocated,
$form->{"unit_$i"}, conv_date($form->{deliverydate}),
conv_i($form->{"project_id_$i"}), $form->{"serialnumber_$i"},
@@
-507,9
+508,11
@@
sub post_invoice {
}
}
}
}
+ IO->set_datepaid(table => 'ap', id => $form->{id}, dbh => $dbh);
+
if ($payments_only) {
if ($payments_only) {
- $query = qq|UPDATE ap SET paid = ?
, datepaid = ?
WHERE id = ?|;
- do_query($form, $dbh, $query,
$form->{paid}, $form->{paid} ? conv_date($form->{datepaid}) : undef
, conv_i($form->{id}));
+ $query = qq|UPDATE ap SET paid = ? WHERE id = ?|;
+ do_query($form, $dbh, $query,
$form->{paid}
, conv_i($form->{id}));
if (!$provided_dbh) {
$dbh->commit();
if (!$provided_dbh) {
$dbh->commit();
@@
-524,7
+527,14
@@
sub post_invoice {
# set values which could be empty
my $taxzone_id = $form->{taxzone_id} * 1;
# set values which could be empty
my $taxzone_id = $form->{taxzone_id} * 1;
- $form->{department_id} = (split /--/, $form->{department})[1];
+
+ # Seit neuestem wird die department_id schon übergeben UND $form->department nicht mehr
+ # korrekt zusammengebaut. Sehr wahrscheinlich beim Umstieg auf T8 kaputt gegangen
+ # Ich lass den Code von 2005 erstmal noch stehen ;-) jb 03-2011
+ # copy & paste von IS.pm
+ if (!$form->{department_id}){
+ $form->{department_id} = (split /--/, $form->{department})[1];
+ }
$form->{invnumber} = $form->{id} unless $form->{invnumber};
$taxzone_id = 0 if (3 < $taxzone_id) || (0 > $taxzone_id);
$form->{invnumber} = $form->{id} unless $form->{invnumber};
$taxzone_id = 0 if (3 < $taxzone_id) || (0 > $taxzone_id);
@@
-533,7
+543,7
@@
sub post_invoice {
$query = qq|UPDATE ap SET
invnumber = ?, ordnumber = ?, quonumber = ?, transdate = ?,
orddate = ?, quodate = ?, vendor_id = ?, amount = ?,
$query = qq|UPDATE ap SET
invnumber = ?, ordnumber = ?, quonumber = ?, transdate = ?,
orddate = ?, quodate = ?, vendor_id = ?, amount = ?,
- netamount = ?, paid = ?, duedate = ?,
datepaid = ?,
+ netamount = ?, paid = ?, duedate = ?,
invoice = ?, taxzone_id = ?, notes = ?, taxincluded = ?,
intnotes = ?, curr = ?, storno_id = ?, storno = ?,
cp_id = ?, employee_id = ?, department_id = ?,
invoice = ?, taxzone_id = ?, notes = ?, taxincluded = ?,
intnotes = ?, curr = ?, storno_id = ?, storno = ?,
cp_id = ?, employee_id = ?, department_id = ?,
@@
-542,7
+552,7
@@
sub post_invoice {
@values = (
$form->{invnumber}, $form->{ordnumber}, $form->{quonumber}, conv_date($form->{invdate}),
conv_date($form->{orddate}), conv_date($form->{quodate}), conv_i($form->{vendor_id}), $amount,
@values = (
$form->{invnumber}, $form->{ordnumber}, $form->{quonumber}, conv_date($form->{invdate}),
conv_date($form->{orddate}), conv_date($form->{quodate}), conv_i($form->{vendor_id}), $amount,
- $netamount, $form->{paid}, conv_date($form->{duedate}),
$form->{paid} ? conv_date($form->{datepaid}) : undef,
+ $netamount, $form->{paid}, conv_date($form->{duedate}),
'1', $taxzone_id, $form->{notes}, $form->{taxincluded} ? 't' : 'f',
$form->{intnotes}, $form->{currency}, conv_i($form->{storno_id}), $form->{storno} ? 't' : 'f',
conv_i($form->{cp_id}), conv_i($form->{employee_id}), conv_i($form->{department_id}),
'1', $taxzone_id, $form->{notes}, $form->{taxincluded} ? 't' : 'f',
$form->{intnotes}, $form->{currency}, conv_i($form->{storno_id}), $form->{storno} ? 't' : 'f',
conv_i($form->{cp_id}), conv_i($form->{employee_id}), conv_i($form->{department_id}),
@@
-574,7
+584,7
@@
sub post_invoice {
# delete zero entries
do_query($form, $dbh, qq|DELETE FROM acc_trans WHERE amount = 0|);
# delete zero entries
do_query($form, $dbh, qq|DELETE FROM acc_trans WHERE amount = 0|);
- Common::webdav_folder($form)
if ($main::webdav)
;
+ Common::webdav_folder($form);
# Link this record to the records it was created from.
RecordLinks->create_links('dbh' => $dbh,
# Link this record to the records it was created from.
RecordLinks->create_links('dbh' => $dbh,
@@
-796,7
+806,7
@@
sub retrieve_invoice {
c3.accno AS expense_accno, c3.new_chart_id AS expense_new_chart, date($transdate) - c3.valid_from AS expense_valid,
i.id AS invoice_id,
c3.accno AS expense_accno, c3.new_chart_id AS expense_new_chart, date($transdate) - c3.valid_from AS expense_valid,
i.id AS invoice_id,
- i.description, i.qty, i.fxsellprice AS sellprice, i.parts_id AS id, i.unit, i.deliverydate, i.project_id, i.serialnumber,
+ i.description, i.
longdescription, i.
qty, i.fxsellprice AS sellprice, i.parts_id AS id, i.unit, i.deliverydate, i.project_id, i.serialnumber,
i.price_factor_id, i.price_factor, i.marge_price_factor, i.discount,
p.partnumber, p.inventory_accno_id AS part_inventory_accno_id, p.bin, pr.projectnumber, pg.partsgroup
i.price_factor_id, i.price_factor, i.marge_price_factor, i.discount,
p.partnumber, p.inventory_accno_id AS part_inventory_accno_id, p.bin, pr.projectnumber, pg.partsgroup
@@
-872,7
+882,7
@@
sub retrieve_invoice {
}
$sth->finish();
}
$sth->finish();
- Common::webdav_folder($form)
if ($main::webdav)
;
+ Common::webdav_folder($form);
$dbh->disconnect();
$dbh->disconnect();
@@
-914,7
+924,7
@@
sub get_vendor {
my $query =
qq|SELECT
v.id AS vendor_id, v.name AS vendor, v.discount as vendor_discount,
my $query =
qq|SELECT
v.id AS vendor_id, v.name AS vendor, v.discount as vendor_discount,
- v.creditlimit, v.terms, v.notes AS intnotes,
+
v.creditlimit, v.terms, v.notes AS intnotes,
v.email, v.cc, v.bcc, v.language_id, v.payment_id,
v.street, v.zipcode, v.city, v.country, v.taxzone_id,
$duedate + COALESCE(pt.terms_netto, 0) AS duedate,
v.email, v.cc, v.bcc, v.language_id, v.payment_id,
v.street, v.zipcode, v.city, v.country, v.taxzone_id,
$duedate + COALESCE(pt.terms_netto, 0) AS duedate,