use SL::Locale::String qw(t8);
use constant {
- SALES_ORDER_TYPE => 'sales_order',
- PURCHASE_ORDER_TYPE => 'purchase_order',
- SALES_QUOTATION_TYPE => 'sales_quotation',
- REQUEST_QUOTATION_TYPE => 'request_quotation',
- PURCHASE_DELIVERY_ORDER_TYPE => 'purchase_delivery_order',
SALES_DELIVERY_ORDER_TYPE => 'sales_delivery_order',
+ PURCHASE_DELIVERY_ORDER_TYPE => 'purchase_delivery_order',
+ SUPPLIER_DELIVERY_ORDER_TYPE => 'supplier_delivery_order',
+ RMA_DELIVERY_ORDER_TYPE => 'rma_delivery_order',
};
-our @EXPORT_OK = qw(SALES_ORDER_TYPE PURCHASE_ORDER_TYPE SALES_QUOTATION_TYPE REQUEST_QUOTATION_TYPE);
+our @EXPORT_OK = qw(SALES_DELIVERY_ORDER_TYPE PURCHASE_DELIVERY_ORDER_TYPE SUPPLIER_DELIVERY_ORDER_TYPE RMA_DELIVERY_ORDER_TYPE);
use Rose::Object::MakeMethods::Generic scalar => [ qw(c) ];
my %type_data = (
- SALES_ORDER_TYPE() => {
- text => {
- delete => t8('The order has been deleted'),
- saved => t8('The order has been saved'),
- add => t8("Add Sales Order"),
- edit => t8("Edit Sales Order"),
- },
- show_menu => {
- save_and_quotation => 1,
- save_and_rfq => 0,
- save_and_sales_order => 0,
- save_and_purchase_order => 1,
- save_and_delivery_order => 1,
- save_and_ap_transaction => 0,
- delete => sub { $::instance_conf->get_sales_order_show_delete },
- },
- workflow => {
- to_order_type => "purchase_order",
- to_quotation_type => "sales_quotation",
- to_order_copy_shipto => 1,
- },
- properties => {
- customervendor => "customer",
- is_quotation => 0,
- is_customer => 1,
- nr_key => "ordnumber",
- },
- part_classification_query => [ "used_for_sale" => 1 ],
- right => "sales_order_edit",
- },
- PURCHASE_ORDER_TYPE() => {
- text =>{
- delete => t8('The order has been deleted'),
- saved => t8('The order has been saved'),
- add => t8("Add Purchase Order"),
- edit => t8("Edit Purchase Order"),
- },
- show_menu => {
- save_and_quotation => 0,
- save_and_rfq => 1,
- save_and_sales_order => 1,
- save_and_purchase_order => 0,
- save_and_delivery_order => 1,
- save_and_ap_transaction => 1,
- delete => sub { $::instance_conf->get_purchase_order_show_delete },
- },
- workflow => {
- to_order_type => "sales_order",
- to_quotation_type => "request_quotation",
- to_order_copy_shipto => 0,
- },
- properties => {
- customervendor => "vendor",
- is_quotation => 0,
- is_customer => 0,
- nr_key => "ordnumber",
- },
- part_classification_query => [ "used_for_purchase" => 1 ],
- right => "purchase_order_edit",
- },
- SALES_QUOTATION_TYPE() => {
+ SALES_DELIVERY_ORDER_TYPE() => {
text => {
- delete => t8('The quotation has been deleted'),
- saved => t8('The quotation has been saved'),
- add => t8("Add Quotation"),
- edit => t8("Edit Quotation"),
+ delete => t8('Delivery Order has been deleted'),
+ saved => t8('Delivery Order has been saved'),
+ add => t8("Add Sales Delivery Order"),
+ edit => t8("Edit Sales Delivery Order"),
},
show_menu => {
save_and_quotation => 0,
save_and_rfq => 0,
- save_and_sales_order => 1,
+ save_and_sales_order => 0,
save_and_purchase_order => 0,
save_and_delivery_order => 0,
save_and_ap_transaction => 0,
- delete => 1,
- },
- workflow => {
- to_order_type => "sales_order",
- to_quotation_type => "request_quotation",
- to_order_copy_shipto => 0,
+ save_and_invoice => 0,
+ delete => sub { $::instance_conf->get_sales_delivery_order_show_delete },
},
properties => {
customervendor => "customer",
- is_quotation => 1,
is_customer => 1,
- nr_key => "quonumber",
+ nr_key => "donumber",
+ transfer => 'out',
},
part_classification_query => [ "used_for_sale" => 1 ],
- right => "sales_quotation_edit",
+ right => "sales_delivery_order_edit",
},
- REQUEST_QUOTATION_TYPE() => {
+ PURCHASE_DELIVERY_ORDER_TYPE() => {
text => {
- delete => t8('The rfq has been deleted'),
- saved => t8('The rfq has been saved'),
- add => t8("Add Request for Quotation"),
- edit => t8("Edit Request for Quotation"),
+ delete => t8('Delivery Order has been deleted'),
+ saved => t8('Delivery Order has been saved'),
+ add => t8("Add Purchase Delivery Order"),
+ edit => t8("Edit Purchase Delivery Order"),
},
show_menu => {
save_and_quotation => 0,
save_and_rfq => 0,
save_and_sales_order => 0,
- save_and_purchase_order => 1,
+ save_and_purchase_order => 0,
save_and_delivery_order => 0,
save_and_ap_transaction => 0,
- delete => 1,
- },
- workflow => {
- to_order_type => "purchase_order",
- to_quotation_type => "request_quotation",
- to_order_copy_shipto => 0,
+ save_and_invoice => 0,
+ delete => sub { $::instance_conf->get_sales_delivery_order_show_delete },
},
properties => {
customervendor => "vendor",
- is_quotation => 1,
is_customer => 0,
- nr_key => "quonumber",
+ nr_key => "donumber",
+ transfer => 'in',
},
part_classification_query => [ "used_for_purchase" => 1 ],
- right => "request_quotation_edit",
+ right => "purchase_delivery_order_edit",
},
- SALES_DELIVERY_ORDER_TYPE() => {
+ SUPPLIER_DELIVERY_ORDER_TYPE() => {
text => {
delete => t8('Delivery Order has been deleted'),
saved => t8('Delivery Order has been saved'),
- add => t8("Add Sales Delivery Order"),
- edit => t8("Edit Sales Delivery Order"),
+ add => t8("Add Supplier Delivery Order"),
+ edit => t8("Edit Supplier Delivery Order"),
},
show_menu => {
save_and_quotation => 0,
save_and_purchase_order => 0,
save_and_delivery_order => 0,
save_and_ap_transaction => 0,
+ save_and_invoice => 0,
delete => sub { $::instance_conf->get_sales_delivery_order_show_delete },
},
properties => {
- customervendor => "customer",
- is_customer => 1,
+ customervendor => "vendor",
+ is_customer => 0,
nr_key => "donumber",
+ transfer => 'out',
},
- part_classification_query => [ "used_for_sale" => 1 ],
- right => "sales_delivery_order_edit",
+ part_classification_query => [ "used_for_purchase" => 1 ],
+ right => "purchase_delivery_order_edit",
},
- PURCHASE_DELIVERY_ORDER_TYPE() => {
+ RMA_DELIVERY_ORDER_TYPE() => {
text => {
delete => t8('Delivery Order has been deleted'),
saved => t8('Delivery Order has been saved'),
- add => t8("Add Purchase Delivery Order"),
- edit => t8("Edit Purchase Delivery Order"),
+ add => t8("Add RMA Delivery Order"),
+ edit => t8("Edit RMA Delivery Order"),
},
show_menu => {
save_and_quotation => 0,
save_and_purchase_order => 0,
save_and_delivery_order => 0,
save_and_ap_transaction => 0,
+ save_and_invoice => 0,
delete => sub { $::instance_conf->get_sales_delivery_order_show_delete },
},
properties => {
- customervendor => "vendor",
+ customervendor => "customer",
is_customer => 0,
nr_key => "donumber",
+ transfer => 'in',
},
- part_classification_query => [ "used_for_purchase" => 1 ],
- right => "purchase_delivery_order_edit",
+ part_classification_query => [ "used_for_sale" => 1 ],
+ right => "sales_delivery_order_edit",
},
-
);
sub new {
sub valid_types {
[
- SALES_ORDER_TYPE,
- PURCHASE_ORDER_TYPE,
- SALES_QUOTATION_TYPE,
- REQUEST_QUOTATION_TYPE,
SALES_DELIVERY_ORDER_TYPE,
PURCHASE_DELIVERY_ORDER_TYPE,
+ SUPPLIER_DELIVERY_ORDER_TYPE,
+ RMA_DELIVERY_ORDER_TYPE,
];
}
sub set_reqdate_by_type {
my ($self) = @_;
- my $extra_days = $self->type eq SALES_QUOTATION_TYPE ? $::instance_conf->get_reqdate_interval :
- $self->type eq SALES_ORDER_TYPE ? $::instance_conf->get_delivery_date_interval : 1;
-
- if ( ($self->type eq SALES_ORDER_TYPE && $::instance_conf->get_deliverydate_on)
- || ($self->type eq SALES_QUOTATION_TYPE && $::instance_conf->get_reqdate_on)
- && (!$self->order->reqdate)) {
- $self->c->order->reqdate(DateTime->today_local->next_workday(extra_days => $extra_days));
+ if (!$self->c->order->reqdate) {
+ $self->c->order->reqdate(DateTime->today_local->next_workday(extra_days => 1));
}
}
my ($self, $reqdate, $saved_reqdate) = @_;
if ($reqdate == $saved_reqdate) {
- my $extra_days = $self->type eq SALES_QUOTATION_TYPE ? $::instance_conf->get_reqdate_interval :
- $self->type eq SALES_ORDER_TYPE ? $::instance_conf->get_delivery_date_interval : 1;
-
- if ( ($self->type eq SALES_ORDER_TYPE && !$::instance_conf->get_deliverydate_on)
- || ($self->type eq SALES_QUOTATION_TYPE && !$::instance_conf->get_reqdate_on)) {
- return '';
- } else {
- return DateTime->today_local->next_workday(extra_days => $extra_days);
- }
+ return DateTime->today_local->next_workday(extra_days => 1);
} else {
return $reqdate;
}
'Add Purchase Order' => 'Lieferantenauftrag erfassen',
'Add Quotation' => 'Angebot erfassen',
'Add RFQ' => 'Preisanfrage erfassen',
+ 'Add RMA Delivery Order' => 'Retouren-Lieferschein erfassen',
'Add Request for Quotation' => 'Anfrage erfassen',
'Add Requirement Spec' => 'Pflichtenheft erfassen',
'Add Requirement Spec Template' => 'Pflichtenheftvorlage erfassen',
'Add Sales Order' => 'Auftrag erfassen',
'Add Service' => 'Dienstleistung erfassen',
'Add Storno Credit Note' => 'Gutschrift Storno hinzufügen',
+ 'Add Supplier Delivery Order' => 'Beistell-Lieferschein erfassen',
'Add Transaction' => 'Dialogbuchen',
'Add User' => 'Neuer Benutzer',
'Add User Group' => 'Neue Benutzergruppe',
'Edit Purchase Delivery Order' => 'Lieferschein (Einkauf) bearbeiten',
'Edit Purchase Order' => 'Lieferantenauftrag bearbeiten',
'Edit Quotation' => 'Angebot bearbeiten',
+ 'Edit RMA Delivery Order' => 'Retouren-Lieferschein bearbeiten',
'Edit Request for Quotation' => 'Anfrage bearbeiten',
'Edit SEPA strings' => 'Begriffe bei SEPA-Überweisungen bearbeiten',
'Edit Sales Delivery Order' => 'Lieferschein (Verkauf) bearbeiten',
'Edit Storno Credit Note' => 'Storno Gutschrift bearbeiten',
'Edit Storno Invoice' => 'Stornorechnung bearbeiten',
'Edit Storno Invoice for Advance Payment' => 'Storno-Anzahlungsrechnung bearbeiten',
+ 'Edit Supplier Delivery Order' => 'Beistell-Lieferschein bearbeiten',
'Edit User' => 'Benutzerdaten bearbeiten',
'Edit User Group' => 'Benutzergruppe bearbeiten',
'Edit Vendor' => 'Lieferant editieren',