if($form->{transdatefrom}) {
push @where, qq|dord.transdate >= ?|;
push @values, conv_date($form->{transdatefrom});
if($form->{transdatefrom}) {
push @where, qq|dord.transdate >= ?|;
push @values, conv_date($form->{transdatefrom});
+ if($form->{reqdatefrom}) {
+ push @where, qq|dord.reqdate >= ?|;
+ push @values, conv_date($form->{reqdatefrom});
+ }
+
+ if($form->{reqdateto}) {
+ push @where, qq|dord.reqdate <= ?|;
+ push @values, conv_date($form->{reqdateto});
+ }
+
shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, closed = ?,
delivered = ?, department_id = ?, language_id = ?, shipto_id = ?,
globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?,
shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, closed = ?,
delivered = ?, department_id = ?, language_id = ?, shipto_id = ?,
globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?,
- is_sales = ?, taxzone_id = ?, taxincluded = ?, terms = ?, currency_id = (SELECT id FROM currencies WHERE name = ?)
+ is_sales = ?, taxzone_id = ?, taxincluded = ?, terms = ?, currency_id = (SELECT id FROM currencies WHERE name = ?),
+ delivery_term_id = ?
$form->{transaction_description},
$form->{type} =~ /^sales/ ? 't' : 'f',
conv_i($form->{taxzone_id}), $form->{taxincluded} ? 't' : 'f', conv_i($form->{terms}), $form->{currency},
$form->{transaction_description},
$form->{type} =~ /^sales/ ? 't' : 'f',
conv_i($form->{taxzone_id}), $form->{taxincluded} ? 't' : 'f', conv_i($form->{terms}), $form->{currency},
conv_i($form->{id}));
do_query($form, $dbh, $query, @values);
conv_i($form->{id}));
do_query($form, $dbh, $query, @values);
d.description AS department, dord.language_id,
dord.shipto_id,
dord.globalproject_id, dord.delivered, dord.transaction_description,
d.description AS department, dord.language_id,
dord.shipto_id,
dord.globalproject_id, dord.delivered, dord.transaction_description,
- dord.taxzone_id, dord.taxincluded, dord.terms, (SELECT cu.name FROM currencies cu WHERE cu.id=dord.currency_id) AS currency
+ dord.taxzone_id, dord.taxincluded, dord.terms, (SELECT cu.name FROM currencies cu WHERE cu.id=dord.currency_id) AS currency,
+ dord.delivery_term_id
FROM delivery_orders dord
JOIN ${vc} cv ON (dord.${vc}_id = cv.id)
LEFT JOIN employee e ON (dord.employee_id = e.id)
FROM delivery_orders dord
JOIN ${vc} cv ON (dord.${vc}_id = cv.id)
LEFT JOIN employee e ON (dord.employee_id = e.id)
if ($item->[1] ne $sameitem) {
push(@{ $form->{description} }, qq|$item->[1]|);
$sameitem = $item->[1];
if ($item->[1] ne $sameitem) {
push(@{ $form->{description} }, qq|$item->[1]|);
$sameitem = $item->[1];
$form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"});
# add number, description and qty to $form->{number}, ....
$form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"});
# add number, description and qty to $form->{number}, ....
+ if ($form->{"subtotal_$i"} && !$subtotal_header) {
+ $subtotal_header = $i;
+ $position = int($position);
+ $subposition = 0;
+ $position++;
+ } elsif ($subtotal_header) {
+ $subposition += 1;
+ $position = int($position);
+ $position = $position.".".$subposition;
+ } else {
+ $position = int($position);
+ $position++;
+ }
push @{ $form->{TEMPLATE_ARRAYS}{projectdescription} },
$projectdescriptions{$form->{"project_id_$i"}};
push @{ $form->{TEMPLATE_ARRAYS}{projectdescription} },
$projectdescriptions{$form->{"project_id_$i"}};
my $lineweight = $form->{"qty_$i"} * $form->{"weight_$i"};
$totalweight += $lineweight;
push @{ $form->{TEMPLATE_ARRAYS}->{weight} }, $form->format_amount($myconfig, $form->{"weight_$i"}, 3);
my $lineweight = $form->{"qty_$i"} * $form->{"weight_$i"};
$totalweight += $lineweight;
push @{ $form->{TEMPLATE_ARRAYS}->{weight} }, $form->format_amount($myconfig, $form->{"weight_$i"}, 3);