Revision 0dd53254
Von Kivitendo Admin vor mehr als 8 Jahren hinzugefügt
SL/DB/Helper/ALL.pm | ||
---|---|---|
110 | 110 |
use SL::DB::SepaExportMessageId; |
111 | 111 |
use SL::DB::Shipto; |
112 | 112 |
use SL::DB::Shop; |
113 |
use SL::DB::ShopOrder; |
|
114 |
use SL::DB::ShopOrderItem; |
|
113 | 115 |
use SL::DB::ShopPart; |
114 | 116 |
use SL::DB::Status; |
115 | 117 |
use SL::DB::Tax; |
SL/DB/Helper/Mappings.pm | ||
---|---|---|
190 | 190 |
schema_info => 'schema_info', |
191 | 191 |
shipto => 'shipto', |
192 | 192 |
shops => 'shop', |
193 |
shop_orders => 'shop_order', |
|
194 |
shop_order_items => 'shop_order_item', |
|
193 | 195 |
shop_parts => 'shop_part', |
194 | 196 |
status => 'status', |
195 | 197 |
tax => 'tax', |
SL/DB/Manager/ShopOrder.pm | ||
---|---|---|
1 |
# This file has been auto-generated only because it didn't exist. |
|
2 |
# Feel free to modify it at will; it will not be overwritten automatically. |
|
3 |
|
|
4 |
package SL::DB::Manager::ShopOrder; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use SL::DB::Helper::Manager; |
|
9 |
use base qw(SL::DB::Helper::Manager); |
|
10 |
|
|
11 |
sub object_class { 'SL::DB::ShopOrder' } |
|
12 |
|
|
13 |
__PACKAGE__->make_manager_methods; |
|
14 |
|
|
15 |
1; |
SL/DB/Manager/ShopOrderItem.pm | ||
---|---|---|
1 |
# This file has been auto-generated only because it didn't exist. |
|
2 |
# Feel free to modify it at will; it will not be overwritten automatically. |
|
3 |
|
|
4 |
package SL::DB::Manager::ShopOrderItem; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use SL::DB::Helper::Manager; |
|
9 |
use base qw(SL::DB::Helper::Manager); |
|
10 |
|
|
11 |
sub object_class { 'SL::DB::ShopOrderItem' } |
|
12 |
|
|
13 |
__PACKAGE__->make_manager_methods; |
|
14 |
|
|
15 |
1; |
SL/DB/MetaSetup/ShopOrder.pm | ||
---|---|---|
1 |
# This file has been auto-generated. Do not modify it; it will be overwritten |
|
2 |
# by rose_auto_create_model.pl automatically. |
|
3 |
package SL::DB::ShopOrder; |
|
4 |
|
|
5 |
use strict; |
|
6 |
|
|
7 |
use base qw(SL::DB::Object); |
|
8 |
|
|
9 |
__PACKAGE__->meta->table('shop_orders'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
amount => { type => 'numeric', precision => 15, scale => 5 }, |
|
13 |
billing_city => { type => 'text' }, |
|
14 |
billing_company => { type => 'text' }, |
|
15 |
billing_country => { type => 'text' }, |
|
16 |
billing_department => { type => 'text' }, |
|
17 |
billing_email => { type => 'text' }, |
|
18 |
billing_fax => { type => 'text' }, |
|
19 |
billing_firstname => { type => 'text' }, |
|
20 |
billing_greeting => { type => 'text' }, |
|
21 |
billing_lastname => { type => 'text' }, |
|
22 |
billing_phone => { type => 'text' }, |
|
23 |
billing_street => { type => 'text' }, |
|
24 |
billing_vat => { type => 'text' }, |
|
25 |
billing_zipcode => { type => 'text' }, |
|
26 |
customer_city => { type => 'text' }, |
|
27 |
customer_company => { type => 'text' }, |
|
28 |
customer_country => { type => 'text' }, |
|
29 |
customer_department => { type => 'text' }, |
|
30 |
customer_email => { type => 'text' }, |
|
31 |
customer_fax => { type => 'text' }, |
|
32 |
customer_firstname => { type => 'text' }, |
|
33 |
customer_greeting => { type => 'text' }, |
|
34 |
customer_lastname => { type => 'text' }, |
|
35 |
customer_newsletter => { type => 'boolean' }, |
|
36 |
customer_phone => { type => 'text' }, |
|
37 |
customer_street => { type => 'text' }, |
|
38 |
customer_vat => { type => 'text' }, |
|
39 |
customer_zipcode => { type => 'text' }, |
|
40 |
delivery_city => { type => 'text' }, |
|
41 |
delivery_company => { type => 'text' }, |
|
42 |
delivery_country => { type => 'text' }, |
|
43 |
delivery_department => { type => 'text' }, |
|
44 |
delivery_email => { type => 'text' }, |
|
45 |
delivery_fax => { type => 'text' }, |
|
46 |
delivery_firstname => { type => 'text' }, |
|
47 |
delivery_greeting => { type => 'text' }, |
|
48 |
delivery_lastname => { type => 'text' }, |
|
49 |
delivery_phone => { type => 'text' }, |
|
50 |
delivery_street => { type => 'text' }, |
|
51 |
delivery_vat => { type => 'text' }, |
|
52 |
delivery_zipcode => { type => 'text' }, |
|
53 |
host => { type => 'text' }, |
|
54 |
id => { type => 'serial', not_null => 1 }, |
|
55 |
itime => { type => 'timestamp', default => 'now()' }, |
|
56 |
kivi_customer_id => { type => 'integer' }, |
|
57 |
mtime => { type => 'timestamp' }, |
|
58 |
netamount => { type => 'numeric', precision => 15, scale => 5 }, |
|
59 |
oe_transid => { type => 'integer' }, |
|
60 |
order_date => { type => 'timestamp' }, |
|
61 |
payment_description => { type => 'text' }, |
|
62 |
payment_id => { type => 'integer' }, |
|
63 |
remote_ip => { type => 'text' }, |
|
64 |
sepa_account_holder => { type => 'text' }, |
|
65 |
sepa_bic => { type => 'text' }, |
|
66 |
sepa_iban => { type => 'text' }, |
|
67 |
shipping_costs => { type => 'numeric', precision => 15, scale => 5 }, |
|
68 |
shipping_costs_id => { type => 'integer' }, |
|
69 |
shipping_costs_net => { type => 'numeric', precision => 15, scale => 5 }, |
|
70 |
shop_c_billing_id => { type => 'integer' }, |
|
71 |
shop_c_billing_number => { type => 'text' }, |
|
72 |
shop_c_delivery_id => { type => 'integer' }, |
|
73 |
shop_c_delivery_number => { type => 'text' }, |
|
74 |
shop_customer_comment => { type => 'text' }, |
|
75 |
shop_customer_id => { type => 'integer' }, |
|
76 |
shop_customer_number => { type => 'text' }, |
|
77 |
shop_data => { type => 'text' }, |
|
78 |
shop_id => { type => 'integer' }, |
|
79 |
shop_ordernumber => { type => 'text' }, |
|
80 |
shop_trans_id => { type => 'integer', not_null => 1 }, |
|
81 |
tax_included => { type => 'boolean' }, |
|
82 |
transfer_date => { type => 'date' }, |
|
83 |
transferred => { type => 'boolean', default => 'false' }, |
|
84 |
); |
|
85 |
|
|
86 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
87 |
|
|
88 |
__PACKAGE__->meta->allow_inline_column_values(1); |
|
89 |
|
|
90 |
1; |
|
91 |
; |
SL/DB/MetaSetup/ShopOrderItem.pm | ||
---|---|---|
1 |
# This file has been auto-generated. Do not modify it; it will be overwritten |
|
2 |
# by rose_auto_create_model.pl automatically. |
|
3 |
package SL::DB::ShopOrderItem; |
|
4 |
|
|
5 |
use strict; |
|
6 |
|
|
7 |
use base qw(SL::DB::Object); |
|
8 |
|
|
9 |
__PACKAGE__->meta->table('shop_order_items'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
description => { type => 'text' }, |
|
13 |
id => { type => 'serial', not_null => 1 }, |
|
14 |
partnumber => { type => 'text' }, |
|
15 |
price => { type => 'numeric', precision => 15, scale => 5 }, |
|
16 |
quantity => { type => 'numeric', precision => 25, scale => 5 }, |
|
17 |
shop_id => { type => 'integer' }, |
|
18 |
shop_order_id => { type => 'integer' }, |
|
19 |
shop_trans_id => { type => 'integer', not_null => 1 }, |
|
20 |
tax_rate => { type => 'numeric', precision => 15, scale => 2 }, |
|
21 |
); |
|
22 |
|
|
23 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
24 |
|
|
25 |
__PACKAGE__->meta->foreign_keys( |
|
26 |
shop_order => { |
|
27 |
class => 'SL::DB::ShopOrder', |
|
28 |
key_columns => { shop_order_id => 'id' }, |
|
29 |
}, |
|
30 |
); |
|
31 |
|
|
32 |
1; |
|
33 |
; |
SL/DB/ShopOrder.pm | ||
---|---|---|
1 |
# This file has been auto-generated only because it didn't exist. |
|
2 |
# Feel free to modify it at will; it will not be overwritten automatically. |
|
3 |
|
|
4 |
package SL::DB::ShopOrder; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use SL::DB::MetaSetup::ShopOrder; |
|
9 |
use SL::DB::Manager::ShopOrder; |
|
10 |
|
|
11 |
__PACKAGE__->meta->add_relationships( |
|
12 |
shop_order_items => { |
|
13 |
class => 'SL::DB::ShopOrderItem', |
|
14 |
column_map => { id => 'shop_order_id' }, |
|
15 |
type => 'one to many', |
|
16 |
}, |
|
17 |
); |
|
18 |
|
|
19 |
__PACKAGE__->meta->initialize; |
|
20 |
|
|
21 |
1; |
SL/DB/ShopOrderItem.pm | ||
---|---|---|
1 |
# This file has been auto-generated only because it didn't exist. |
|
2 |
# Feel free to modify it at will; it will not be overwritten automatically. |
|
3 |
|
|
4 |
package SL::DB::ShopOrderItem; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use SL::DB::MetaSetup::ShopOrderItem; |
|
9 |
use SL::DB::Manager::ShopOrderItem; |
|
10 |
|
|
11 |
__PACKAGE__->meta->initialize; |
|
12 |
|
|
13 |
1; |
SL/Shop.pm | ||
---|---|---|
3 | 3 |
use strict; |
4 | 4 |
|
5 | 5 |
use parent qw(Rose::Object); |
6 |
use SL::ShopConnector::ALL; |
|
6 | 7 |
|
7 | 8 |
# __PACKAGE__->run_before('check_auth'); |
8 | 9 |
|
sql/Pg-upgrade2/shop_orders.sql | ||
---|---|---|
1 |
-- @tag: shop_orders |
|
2 |
-- @description: Erstellen der Tabellen shop_orders und shop_order_items |
|
3 |
-- @depends: release_3_3_0 |
|
4 |
|
|
5 |
CREATE TABLE shop_orders ( |
|
6 |
id SERIAL PRIMARY KEY, |
|
7 |
shop_trans_id integer NOT NULL, --id vom shop |
|
8 |
shop_ordernumber TEXT, --Bestellnummer vom Shop |
|
9 |
shop_data text, -- store whole order as json |
|
10 |
shop_customer_comment text, --Bestellkommentar des Kunden |
|
11 |
amount numeric(15,5), --Bruttogesamtbetrag |
|
12 |
netamount numeric(15,5),--Nettogesamtbetrag |
|
13 |
order_date timestamp, --Bestelldatum und Zeit |
|
14 |
shipping_costs numeric(15,5), |
|
15 |
shipping_costs_net numeric(15,5), |
|
16 |
shipping_costs_id integer, |
|
17 |
tax_included boolean, |
|
18 |
payment_id integer, --Bezahlart |
|
19 |
payment_description TEXT, --Bezahlart |
|
20 |
shop_id integer, --welcher shop bei mehreren |
|
21 |
host TEXT, --Hostname vom Shop |
|
22 |
remote_ip text, --IP Besteller |
|
23 |
transferred boolean DEFAULT FALSE, -- übernommen |
|
24 |
transfer_date date, -- Zeit wann übernommen |
|
25 |
kivi_customer_id integer, -- Kundenid von Tbl customer wenn übernommen |
|
26 |
oe_transid integer, -- id to |
|
27 |
-- Bestell-, Rechnungs- und Lieferadresse. !!Manche Shops bieten sowas!! |
|
28 |
-- In der Regel ist aber die Rechnungsadresse die Kundenadresse |
|
29 |
-- Bestelldaten des Kunden |
|
30 |
shop_customer_id integer, |
|
31 |
shop_customer_number TEXT, |
|
32 |
customer_lastname TEXT, |
|
33 |
customer_firstname TEXT, |
|
34 |
customer_company TEXT, |
|
35 |
customer_street TEXT, |
|
36 |
customer_zipcode TEXT, |
|
37 |
customer_city TEXT, |
|
38 |
customer_country TEXT, |
|
39 |
customer_greeting TEXT, |
|
40 |
customer_department TEXT, |
|
41 |
customer_vat TEXT, |
|
42 |
customer_phone TEXT, |
|
43 |
customer_fax TEXT, |
|
44 |
customer_email TEXT, |
|
45 |
customer_newsletter boolean, |
|
46 |
-- Rechnungsadresse |
|
47 |
shop_c_billing_id integer, |
|
48 |
shop_c_billing_number TEXT, |
|
49 |
billing_lastname TEXT, |
|
50 |
billing_firstname TEXT, |
|
51 |
billing_company TEXT, |
|
52 |
billing_street TEXT, |
|
53 |
billing_zipcode TEXT, |
|
54 |
billing_city TEXT, |
|
55 |
billing_country TEXT, |
|
56 |
billing_greeting TEXT, |
|
57 |
billing_department TEXT, |
|
58 |
billing_vat TEXT, |
|
59 |
billing_phone TEXT, |
|
60 |
billing_fax TEXT, |
|
61 |
billing_email TEXT, |
|
62 |
|
|
63 |
-- SEPA |
|
64 |
sepa_account_holder TEXT, |
|
65 |
sepa_iban TEXT, |
|
66 |
sepa_bic TEXT, |
|
67 |
|
|
68 |
-- Lieferadresse |
|
69 |
shop_c_delivery_id integer, |
|
70 |
shop_c_delivery_number TEXT, |
|
71 |
delivery_lastname TEXT, |
|
72 |
delivery_firstname TEXT, |
|
73 |
delivery_company TEXT, |
|
74 |
delivery_street TEXT, |
|
75 |
delivery_zipcode TEXT, |
|
76 |
delivery_city TEXT, |
|
77 |
delivery_country TEXT, |
|
78 |
delivery_greeting TEXT, |
|
79 |
delivery_department TEXT, |
|
80 |
delivery_vat TEXT, |
|
81 |
delivery_phone TEXT, |
|
82 |
delivery_fax TEXT, |
|
83 |
delivery_email TEXT, |
|
84 |
|
|
85 |
itime timestamp DEFAULT now(), |
|
86 |
mtime timestamp |
|
87 |
); |
|
88 |
|
|
89 |
CREATE TABLE shop_order_items ( |
|
90 |
id SERIAL PRIMARY KEY, |
|
91 |
shop_trans_id INTEGER NOT NULL, --id vom shop in shop-db? -> could use $order_item->shop_order->shop_trans_id instead |
|
92 |
shop_order_id INTEGER REFERENCES shop_orders (id) ON DELETE CASCADE, |
|
93 |
description TEXT, -- Artikelbezeichnung |
|
94 |
partnumber TEXT, |
|
95 |
shop_id INTEGER, --kann als Sortorder benutzt werden |
|
96 |
tax_rate NUMERIC(15,2), |
|
97 |
quantity NUMERIC(25,5), -- qty in invoice and orderitems is real, doi is numeric(25,5) |
|
98 |
price NUMERIC(15,5) |
|
99 |
); |
Auch abrufbar als: Unified diff
Shop - ShopOrder und ShopOrderItem
Tabellen für importierte Shopaufträge und Artikel