require Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw(conv_i conv_date do_query selectrow_query do_statement dump_query);
+@EXPORT = qw(conv_i conv_date conv_dateq do_query selectrow_query do_statement dump_query);
sub conv_i {
my ($value, $default) = @_;
return (defined($value) && "$value" ne "") ? $value : undef;
}
+sub conv_dateq {
+ my ($value) = @_;
+ if (defined($value) && "$value" ne "") {
+ $value =~ s/\'/\'\'/g;
+ return "'$value'";
+ }
+ return "NULL";
+}
+
sub do_query {
my ($form, $dbh, $query) = splice(@_, 0, 3);
package IR;
use SL::AM;
+use SL::DBUtils;
sub post_invoice {
$main::lxdebug->enter_sub();
ordnumber = '$form->{ordnumber}',
quonumber = '$form->{quonumber}',
transdate = '$form->{invdate}',
+ orddate = | . conv_dateq($form->{"orddate"}) . qq|,
+ quodate = | . conv_dateq($form->{"quodate"}) . qq|,
vendor_id = $form->{vendor_id},
amount = $amount,
netamount = $netamount,
# retrieve invoice
$query = qq|SELECT a.cp_id, a.invnumber, a.transdate AS invdate, a.duedate,
+ a.orddate, a.quodate,
a.ordnumber, a.quonumber, a.paid, a.taxincluded, a.notes, a.taxzone_id, a.storno, a.gldate,
a.intnotes, a.curr AS currency
FROM ap a
use Data::Dumper;
use SL::AM;
+use SL::DBUtils;
sub invoice_details {
$main::lxdebug->enter_sub();
quonumber = '$form->{quonumber}',
cusordnumber = '$form->{cusordnumber}',
transdate = '$form->{invdate}',
+ orddate = | . conv_dateq($form->{orddate}) . qq|,
+ quodate = | . conv_dateq($form->{quodate}) . qq|,
customer_id = $form->{customer_id},
amount = $amount,
netamount = $netamount,
# retrieve invoice
$query = qq|SELECT a.invnumber, a.ordnumber, a.quonumber, a.cusordnumber,
+ a.orddate, a.quodate,
a.transdate AS invdate, a.deliverydate, a.paid, a.storno, a.gldate,
a.shippingpoint, a.shipvia, a.terms, a.notes, a.intnotes, a.taxzone_id,
a.duedate, a.taxincluded, a.curr AS currency, a.shipto_id, a.cp_id,
$form->{"javascript"} .= qq|<script type="text/javascript" src="js/show_form_details.js"></script>|;
+ $jsscript .=
+ $form->write_trigger(\%myconfig, 2,
+ "orddate", "BL", "trigger_orddate",
+ "quodate", "BL", "trigger_quodate");
+
$form->header;
print qq|
<td><input name=ordnumber size=11 value="$form->{ordnumber}"></td>
<input type=hidden name=quonumber value="$form->{quonumber}">
</tr>
+ <tr>
+ <th align="right" nowrap>| . $locale->text('Order Date') . qq|</th>
+ <td><input name="orddate" id="orddate" size="11" title="$myconfig{dateformat}" value="| . Q($form->{orddate}) . qq|"></td>
+ <td><input type="button" name="b_orddate" id="trigger_orddate" value="?"></td>
+ </tr>
+ <tr>
+ <th align="right" nowrap>| . $locale->text('Quotation Date') . qq|</th>
+ <td><input name="quodate" id="quodate" size="11" title="$myconfig{dateformat}" value="| . Q($form->{quodate}) . qq|"></td>
+ <td><input type="button" name="b_quodate" id="trigger_quodate" value="?"></td>
+ </tr>
</table>
</td>
</tr>
$form->{"javascript"} .= qq|<script type="text/javascript" src="js/show_form_details.js"></script>|;
+ $jsscript .=
+ $form->write_trigger(\%myconfig, 2,
+ "orddate", "BL", "trigger_orddate",
+ "quodate", "BL", "trigger_quodate");
+
$form->header;
print qq|
<th align=right nowrap>| . $locale->text('Order Number') . qq|</th>
<td><input name=ordnumber size=11 value="$form->{ordnumber}"></td>
</tr>
+ <tr>
+ <th align="right" nowrap>| . $locale->text('Order Date') . qq|</th>
+ <td><input name="orddate" id="orddate" size="11" title="$myconfig{dateformat}" value="| . Q($form->{orddate}) . qq|"></td>
+ <td><input type="button" name="b_orddate" id="trigger_orddate" value="?"></td>
+ </tr>
<tr>
<th align=right nowrap>| . $locale->text('Quotation Number') . qq|</th>
<td><input name=quonumber size=11 value="$form->{quonumber}"></td>
</tr>
+ <tr>
+ <th align="right" nowrap>| . $locale->text('Quotation Date') . qq|</th>
+ <td><input name="quodate" id="quodate" size="11" title="$myconfig{dateformat}" value="| . Q($form->{quodate}) . qq|"></td>
+ <td><input type="button" name="b_quodate" id="trigger_quodate" value="?"></td>
+ </tr>
<tr>
<th align=right nowrap>| . $locale->text('Customer Order Number') . qq|</th>
<td><input name=cusordnumber size=11 value="$form->{cusordnumber}"></td>
# also copy deliverydate from the order
$form->{deliverydate} = $form->{reqdate} if $form->{reqdate};
+ $form->{orddate} = $form->{transdate};
} else {
$form->isblank("quonumber", $locale->text('Quotation Number missing!'));
$form->isblank("transdate", $locale->text('Quotation Date missing!'));
$form->{ordnumber} = "";
+ $form->{quodate} = $form->{transdate};
}
# if the name changed get new values
<td><code>notes</code></td>
<td>Bemerkungen der Rechnung</td>
</tr>
+ <tr>
+ <td><code>orddate</code></td>
+ <td>Auftragsdatum</td>
+ </tr>
<tr>
<td><code>ordnumber</code></td>
<td>Auftragsnummer, wenn die Rechnung aus einem Auftrag erstellt wurde</td>
<td><code>payment_terms</code></td>
<td>Zahlungskonditionen</td>
</tr>
+ <tr>
+ <td><code>quodate</code></td>
+ <td>Angebotsdatum</td>
+ </tr>
<tr>
<td><code>quonumber</code></td>
<td>Angebotsnummer</td>
'Oct' => 'Okt',
'October' => 'Oktober',
'OpenDocument/OASIS' => 'OpenDocument/OASIS',
+ 'Order Date' => 'Auftragsdatum',
'Order Date missing!' => 'Auftragsdatum fehlt!',
'Order Number' => 'Auftragsnummer',
'Order Number missing!' => 'Auftragsnummer fehlt!',
'Queue' => 'Warteschlange',
'Queued' => 'In Warteschlange eingereiht.',
'Quotation' => 'Angebot',
+ 'Quotation Date' => 'Angebotsdatum',
'Quotation Date missing!' => 'Angebotsdatum fehlt!',
'Quotation Number missing!' => 'Angebotsnummer fehlt!',
'RFQ' => 'Anfrage',
'October' => 'Oktober',
'OpenDocument/OASIS' => 'OpenDocument/OASIS',
'Order' => 'Auftrag',
+ 'Order Date' => 'Auftragsdatum',
'Order Date missing!' => 'Auftragsdatum fehlt!',
'Order Number' => 'Auftragsnummer',
'Order Number missing!' => 'Auftragsnummer fehlt!',
'Queue' => 'Warteschlange',
'Queued' => 'In Warteschlange eingereiht.',
'Quotation' => 'Angebot',
+ 'Quotation Date' => 'Angebotsdatum',
'Quotation Date missing!' => 'Angebotsdatum fehlt!',
'Quotation Number' => 'Angebotsnummer',
'Quotation Number missing!' => 'Angebotsnummer fehlt!',
--- /dev/null
+-- @tag: ap_ar_orddate_quodate
+-- @description: Spalten für Angebots- und Auftragsdatum bei Einkaufs- und Verkaufsrechnungen
+-- @depends: release_2_4_1
+ALTER TABLE ar ADD COLUMN orddate date;
+ALTER TABLE ar ADD COLUMN quodate date;
+ALTER TABLE ap ADD COLUMN orddate date;
+ALTER TABLE ap ADD COLUMN quodate date;