Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3da73190

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID 3da73190b8f201bfb33e3b6d96bbc6330142e922
  • Vorgänger f775b88a
  • Nachfolger a2b2aea8

Angebote: neue Felder Auftragswahrscheinlichkeit, Voraus. Abrechnungsdatum

Unterschiede anzeigen:

SL/OE.pm
115 115
    qq|  ct.${vc}number AS vcnumber, ct.country, ct.ustid, ct.business_id,  | .
116 116
    qq|  tz.description AS taxzone | .
117 117
    $periodic_invoices_columns .
118
    qq|  , o.order_probability, o.expected_billing_date, (o.netamount * o.order_probability / 100) AS expected_netamount | .
118 119
    qq|FROM oe o | .
119 120
    qq|JOIN $vc ct ON (o.${vc}_id = ct.id) | .
120 121
    qq|LEFT JOIN employee e ON (o.employee_id = e.id) | .
......
243 244
    $query  .= qq| AND ${not} COALESCE(pcfg.active, 'f')|;
244 245
  }
245 246

  
247
  if (($form->{order_probability_value} || '') ne '') {
248
    my $op  = $form->{order_probability_value} eq 'le' ? '<=' : '>=';
249
    $query .= qq| AND (o.order_probability ${op} ?)|;
250
    push @values, $form->{order_probability_value};
251
  }
252

  
253
  if ($form->{expected_billing_date_from}) {
254
    $query .= qq| AND (o.expected_billing_date >= ?)|;
255
    push @values, conv_date($form->{expected_billing_date_from});
256
  }
257

  
258
  if ($form->{expected_billing_date_to}) {
259
    $query .= qq| AND (o.expected_billing_date <= ?)|;
260
    push @values, conv_date($form->{expected_billing_date_to});
261
  }
262

  
246 263
  my $sortdir   = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
247 264
  my $sortorder = join(', ', map { "${_} ${sortdir} " } ("o.id", $form->sort_columns("transdate", $ordnumber, "name")));
248 265
  my %allowed_sort_columns = (
......
561 578
         delivered = ?, proforma = ?, quotation = ?, department_id = ?, language_id = ?,
562 579
         taxzone_id = ?, shipto_id = ?, payment_id = ?, delivery_vendor_id = ?, delivery_customer_id = ?,delivery_term_id = ?,
563 580
         globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?, marge_total = ?, marge_percent = ?
581
         , order_probability = ?, expected_billing_date = ?
564 582
       WHERE id = ?|;
565 583

  
566 584
  @values = ($form->{ordnumber} || '', $form->{quonumber},
......
581 599
             conv_i($form->{salesman_id}), conv_i($form->{cp_id}),
582 600
             $form->{transaction_description},
583 601
             $form->{marge_total} * 1, $form->{marge_percent} * 1,
602
             $form->{order_probability} * 1, conv_date($form->{expected_billing_date}),
584 603
             conv_i($form->{id}));
585 604
  do_query($form, $dbh, $query, @values);
586 605

  
......
811 830
           d.description AS department, o.payment_id, o.language_id, o.taxzone_id,
812 831
           o.delivery_customer_id, o.delivery_vendor_id, o.proforma, o.shipto_id,
813 832
           o.globalproject_id, o.delivered, o.transaction_description, o.delivery_term_id
833
           , o.order_probability, o.expected_billing_date
814 834
         FROM oe o
815 835
         JOIN ${vc} cv ON (o.${vc}_id = cv.id)
816 836
         LEFT JOIN employee e ON (o.employee_id = e.id)

Auch abrufbar als: Unified diff