not_shipped_qty => t8('not shipped'),
ordnumber => t8('Order'),
customer => t8('Customer'),
+ value_of_goods => t8('Value of goods'),
);
sub action_list {
my $report = SL::ReportGenerator->new(\%::myconfig, $::form);
$self->{report} = $report;
- my @columns = qw(reqdate customer ordnumber partnumber description qty shipped_qty not_shipped_qty delivered_qty);
+ my @columns = qw(reqdate customer ordnumber partnumber description qty shipped_qty not_shipped_qty delivered_qty value_of_goods);
my @sortable = qw(reqdate customer ordnumber partnumber description);
my %column_defs = (
obj_link => sub { $self->link_to($_[0]->order->customer) } },
);
+ # add value of goods in report
+ if ($main::auth->assert('sales_order_edit') && $::instance_conf->get_delivery_plan_show_value_of_goods) {
+ $column_defs{value_of_goods} = { sub => sub { $::form->format_amount(\%::myconfig, $_[0]->value_of_goods, 2) . ' ' . $_[0]->taxincluded } };
+ }
$column_defs{$_}->{text} = $sort_columns{$_} for keys %column_defs;
$report->set_options(
sub delivery_plan_query {
my $employee_id = SL::DB::Manager::Employee->current->id;
my $oe_owner = $_[0]->all_edit_right ? '' : " oe.eployee_id = $employee_id AND";
+ # check delivered state for delivery_orders (transferred out) if enabled
+ my $filter_delivered = $::instance_conf->get_delivery_plan_calculate_transferred_do ?
+ "AND (SELECT delivered from delivery_orders where id = doi.delivery_order_id)" : '';
[
'order.customer_id' => { gt => 0 },
'order.closed' => 0,
rl.to_table = 'delivery_orders' AND
rl.to_id = doi.delivery_order_id AND
oi.parts_id = doi.parts_id
+ $filter_delivered
) tuples GROUP BY parts_id, trans_id, qty
) partials
LEFT JOIN orderitems oi ON partials.parts_id = oi.parts_id AND partials.trans_id = oi.trans_id
UNION ALL
- -- 4. since the join over record_links fails for sales_orders wihtout any delivery order
+ -- 4. since the join over record_links fails for sales_orders without any delivery order
-- retrieve those without record_links at all
SELECT oi.id FROM orderitems oi, oe
WHERE
(oe.quotation = 'f' OR oe.quotation IS NULL) AND NOT oe.closed
) rl
LEFT JOIN delivery_order_items doi ON (rl.to_id = doi.delivery_order_id)
+ WHERE 1 = 1
+ $filter_delivered
GROUP BY rl.from_id, doi.parts_id
) agg ON (agg.oid = oi.trans_id AND agg.parts_id = oi.parts_id)
LEFT JOIN oe ON oe.id = oi.trans_id
datev_check_on_gl_transaction => { type => 'boolean', default => 'true' },
datev_check_on_purchase_invoice => { type => 'boolean', default => 'true' },
datev_check_on_sales_invoice => { type => 'boolean', default => 'true' },
+ delivery_plan_calculate_transferred_do => { type => 'boolean', default => 'false', not_null => 1 },
+ delivery_plan_show_value_of_goods => { type => 'boolean', default => 'false', not_null => 1 },
dunning_ar => { type => 'integer' },
dunning_ar_amount_fee => { type => 'integer' },
dunning_ar_amount_interest => { type => 'integer' },
return sum(map { AM->convert_unit($_->unit => $self->unit) * $_->qty } @doi_delivered);
}
+sub value_of_goods {
+ my ($self) = @_;
+
+ my $price_factor = $self->price_factor ? $self->price_factor : 1;
+
+ return ($self->qty * $self->sellprice * (1 - $self->discount ) / $price_factor);
+}
+
+sub taxincluded {
+ my ($self) = @_;
+
+ return SL::DB::Manager::Order->find_by(id => $self->trans_id)->taxincluded ? $::locale->text('WARN: Tax included value!') : '';
+}
1;
'CSV import: shipping addresses' => 'CSV-Import: Lieferadressen',
'CTI settings' => 'CTI-Einstellungen',
'Calculate' => 'Berechnen',
+ 'Calculate the value of goods for delivery plan (WARNING: Experimental (not taxincluded safe!)' => 'Warenverkaufswert anzeigen (Brutto / Netto), so wie im Auftrags-Beleg gespeichert. Benötigt das Recht: Verkaufs-Aufträge bearbeiten.',
'Calling #1 now' => 'Wähle jetzt #1',
'Can not create that quantity with current stock' => 'Diese Anzahl kann mit dem gegenwärtigen Lagerbestand nicht hergestellt werden.',
'Cancel' => 'Abbrechen',
'Delivery Order(s) for full qty created' => 'Lieferschein(e) mit kompletter Menge erstellt',
'Delivery Orders' => 'Lieferscheine',
'Delivery Plan' => 'Lieferplan',
+ 'Delivery Plan check for transferred delivery orders' => 'Lieferplan berücksichtig den Status des Lieferscheins (ausgelagert / nicht ausgelagert)',
'Delivery Plan for currently outstanding sales orders' => 'Lieferplan für offene Verkaufsaufträge',
'Delivery Terms' => 'Lieferbedingungen',
'Delivery terms' => 'Lieferbedingungen',
'Show Salesman' => 'Verkäufer anzeigen',
'Show TODO list' => 'Aufgabenliste anzeigen',
'Show Transfer via default' => 'Ein- / Auslagern über Standardlagerplatz anzeigen (zusätzlicher Knopf in Beleg Lieferschein)',
+ 'Show Value of Goods for Delivery Plan' => 'Warenverkaufswert im Lieferplan anzeigen.',
'Show administration link' => 'Link zur Administration anzeigen',
'Show all parts' => 'Alle Artikel anzeigen',
'Show by default' => 'Standardmäßig anzeigen',
'The dataset #1 has been created.' => 'Die Datenbank #1 wurde angelegt.',
'The dataset #1 has been deleted.' => 'Die Datenbank #1 wurde gelöscht.',
'The deductible amount' => 'Der abziehbare Skontobetrag',
+ 'The default delivery plan only checks if all delivery orders have been created not if the goods are transferred. This feature will check if all the goods are transferred. Caveat: Only the state of the delivery orders are checked not partial transferred delivery orders (in technical terms: the table inventory is not checked' => 'Standardmässig wird beim Lieferplan überprüft, ob es eine vollständige Liefermenge über alle Lieferscheine gibt. Dies ist dann die Statusbedingung für geliefert oder nicht geliefert. Mit dieser Erweiterung wird geprüft ob die Lieferbelege auch wirklich ausgelagert sind oder nicht. Teilausgelagerte Lieferscheine werden allerdings nicht berücksichtigt (Technischer Hintergrund: Keine Überprüfung der Lagertabelle inventory).',
'The default value depends on the variable type:' => 'Die Bedeutung des Standardwertes hängt vom Variablentypen ab:',
'The delivery order has not been marked as delivered. The warehouse contents have not changed.' => 'Der Lieferschein wurde nicht als geliefert markiert. Der Lagerinhalt wurde nicht verändert.',
'The delivery term has been created.' => 'Die Lieferbedingungen wurden angelegt.',
'Valid until' => 'gültig bis',
'Valid/Obsolete' => 'Gültig/ungültig',
'Value' => 'Wert',
+ 'Value of goods' => 'Warenverkaufswert',
'Variable' => 'Variable',
'Variable Description' => 'Datenfeldbezeichnung',
'Variable Name' => 'Datenfeldname (intern)',
'View warehouse content' => 'Lagerbestand ansehen',
'View/edit all employees sales documents' => 'Bearbeiten/ansehen der Verkaufsdokumente aller Mitarbeiter',
'Von Konto: ' => 'von Konto: ',
+ 'WARN: Tax included value!' => 'ACHTUNG: Steuer im Preis inbegriffen!',
'WHJournal' => 'Lagerbuchungen',
'Warehouse' => 'Lager',
'Warehouse From' => 'Quelllager',
--- /dev/null
+-- @tag: defaults_add_delivery_plan_config
+-- @description: Konfigurative Erweiterungen für den Lieferplan (od)
+-- @depends: release_3_1_0
+ALTER TABLE defaults ADD COLUMN delivery_plan_show_value_of_goods boolean NOT NULL DEFAULT FALSE;
+ALTER TABLE defaults ADD COLUMN delivery_plan_calculate_transferred_do boolean NOT NULL DEFAULT FALSE;
+
[% LxERP.t8('Any stock contents containing a best before date will be impossible to stock out otherwise.') %]
</td>
</tr>
+ <tr><td colspan="3"><hr /></td></tr>
+<tr>
+ <td align="right">[% LxERP.t8('Show Value of Goods for Delivery Plan') %]</td>
+ <td>
+ [% L.yes_no_tag('defaults.delivery_plan_show_value_of_goods', SELF.defaults.delivery_plan_show_value_of_goods) %]
+ </td>
+ <td>
+ [% LxERP.t8('Calculate the value of goods for delivery plan (WARNING: Experimental (not taxincluded safe!)') %]
+ </td>
+ </tr>
+ <tr>
+ <td align="right">[% LxERP.t8('Delivery Plan check for transferred delivery orders') %]</td>
+ <td>
+ [% L.yes_no_tag('defaults.delivery_plan_calculate_transferred_do', SELF.defaults.delivery_plan_calculate_transferred_do) %]
+ </td>
+ <td>
+ [% LxERP.t8('The default delivery plan only checks if all delivery orders have been created not if the goods are transferred. This feature will check if all the goods are transferred. Caveat: Only the state of the delivery orders are checked not partial transferred delivery orders (in technical terms: the table inventory is not checked') %]
+ </td>
+ </tr>
</table>
</div>