7f55550515dfd3c261350e2653c095f7007caf52
[kivitendo-erp.git] / templates / webpages / shop_order / show.html
1 [%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%]
2 [% L.stylesheet_tag('webshop') %]
3 [%- INCLUDE 'common/flash.html' %]
4 <h1>[% title %]</h1>
5
6   <div class="shop_table shop_main">
7     <div class="shop_table-row">
8       <div class="shop_table-cell">
9       <form method="post" action="controller.pl" id="customer">[% L.hidden_tag('create_customer','customer') %][% L.hidden_tag('import_id', IMPORT.id) %]
10         <div class="shop_table shop_table_address">
11           <div class="shop_table-row listheading">
12             <div class="shop_table-cell">[% 'Shop Customer Address' | $T8 %]</div>
13             <div class="shop_table-cell"></div>
14           </div>
15           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Greeting' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.customer_greeting) %]</div></div>
16           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Firstname' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.customer_firstname) %]</div></div>
17           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Lastname' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.customer_lastname) %]</div></div>
18           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Company' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.customer_company) %]</div></div>
19           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Department' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.customer_department) %]</div></div>
20             [% SET customer = IMPORT.customer_firstname _ ' ' _ IMPORT.customer_lastname %]
21           <hr>
22           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Greeting' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('customer_greeting', IMPORT.customer_greeting) %]</div></div>
23           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Customer' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('customer_name', customer) %]</div></div>
24           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Name 2' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('customer_company', IMPORT.customer_company) %]</div></div>
25           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Name 3' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('customer_department', IMPORT.customer_department) %]</div></div>
26           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Street' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('customer_street', IMPORT.customer_street) %]</div></div>
27           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Zipcode' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('customer_zipcode', IMPORT.customer_zipcode) %]</div></div>
28           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'City' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('customer_city', IMPORT.customer_city) %]</div></div>
29           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Country' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('customer_country', IMPORT.customer_country) %]</div></div>
30           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Phone' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('customer_phone', IMPORT.customer_phone) %]</div></div>
31           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Email' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('customer_email', IMPORT.customer_email) %]</div></div>
32           [% IF C_ADDRESS %]
33           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Customernumber' | $T8 %]</div><div class="shop_table-cell">[% C_ADDRESS.customernumber %]</div></div>
34           [% ELSE %]
35           <div>[% L.ajax_submit_tag("controller.pl?action=ShopOrder/apply_customer",  "#customer", LxERP.t8("Apply customer")) %]</div>
36           [% END %]
37         </div>
38       </form>
39       </div>
40       <div class="shop_table-cell">
41       <form method="post" action="controller.pl" id="billing">[% L.hidden_tag('create_customer','billing') %][% L.hidden_tag('import_id', IMPORT.id) %]
42         <div class="shop_table shop_table_address">
43           <div class="shop_table-row listheading">
44             <div class="shop_table-cell">[% 'Shop Billing Address' | $T8 %]</div>
45             <div class="shop_table-cell"></div>
46           </div>
47           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Greeting' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.billing_greeting) %]</div></div>
48           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Firstname' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.billing_firstname) %]</div></div>
49           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Lastname' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.billing_lastname) %]</div></div>
50           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Company' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.billing_company) %]</div></div>
51           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Department' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.billing_department) %]</div></div>
52             [% SET billing = IMPORT.billing_firstname _ ' ' _ IMPORT.billing_lastname %]
53           <hr>
54           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Greeting' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('billing_greeting', IMPORT.billing_greeting) %]</div></div>
55           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Customer' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('billing_name', billing) %]</div></div>
56           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Name 2' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('billing_company', IMPORT.billing_company) %]</div></div>
57           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Name 3' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('billing_department', IMPORT.billing_department) %]</div></div>
58           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Street' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('billing_street', IMPORT.billing_street) %]</div></div>
59           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Zipcode' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('billing_zipcode', IMPORT.billing_zipcode) %]</div></div>
60           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'City' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('billing_city', IMPORT.billing_city) %]</div></div>
61           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Country' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('billing_country', IMPORT.billing_country) %]</div></div>
62           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Phone' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('billing_phone', IMPORT.billing_phone) %]</div></div>
63           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Email' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('billing_email', IMPORT.billing_email) %]</div></div>
64           [% IF B_ADDRESS %]
65           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Customernumber' | $T8 %]</div><div class="shop_table-cell">[% B_ADDRESS.customernumber %]</div></div>
66           [% ELSE %]
67           <div>[% L.ajax_submit_tag("controller.pl?action=ShopOrder/apply_customer",  "#billing", LxERP.t8("Apply customer")) %]</div>
68           [% END %]
69         </div>
70       </form>
71       </div>
72       <div class="shop_table-cell">
73       <form method="post" action="controller.pl" id="delivery">[% L.hidden_tag('create_customer','delivery') %][% L.hidden_tag('import_id', IMPORT.id) %]
74         <div class="shop_table shop_table_address">
75           <div class="shop_table-row listheading">
76             <div class="shop_table-cell">[% 'Shop Delivery Address' | $T8 %]</div>
77             <div class="shop_table-cell"></div>
78           </div>
79           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Greeting' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.delivery_greeting) %]</div></div>
80           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Firstname' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.delivery_firstname) %]</div></div>
81           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Lastname' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.delivery_lastname) %]</div></div>
82           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Company' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.delivery_company) %]</div></div>
83           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Department' | $T8 %]</div><div class="shop_table-cell">[% HTML.escape(IMPORT.delivery_department) %]</div></div>
84             [% SET delivery = IMPORT.delivery_firstname _ ' ' _ IMPORT.delivery_lastname %]
85           <hr>
86           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Greeting' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('delivery_greeting', IMPORT.delivery_greeting) %]</div></div>
87           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Customer' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('delivery_name', delivery) %]</div></div>
88           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Name 2' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('delivery_company', IMPORT.delivery_company) %]</div></div>
89           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Name 3' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('delivery_department', IMPORT.delivery_department) %]</div></div>
90           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Street' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('delivery_street', IMPORT.delivery_street) %]</div></div>
91           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Zipcode' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('delivery_zipcode', IMPORT.delivery_zipcode) %]</div></div>
92           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'City' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('delivery_city', IMPORT.delivery_city) %]</div></div>
93           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Country' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('delivery_country', IMPORT.delivery_country) %]</div></div>
94           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Phone' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('delivery_phone', IMPORT.delivery_phone) %]</div></div>
95           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Email' | $T8 %]</div><div class="shop_table-cell">[% L.input_tag('delivery_email', IMPORT.delivery_email) %]</div></div>
96           [% IF D_ADDRESS %]
97           <div class="shop_table-row"><div class="shop_table-cell listheading">[% 'Customernumber' | $T8 %]</div><div class="shop_table-cell">[% D_ADDRESS.customernumber %]</div></div>
98           [% ELSE %]
99           <div>[% L.ajax_submit_tag("controller.pl?action=ShopOrder/apply_customer",  "#delivery", LxERP.t8("Apply customer")) %]</div>
100           [% END %]
101         </div>
102       </form>
103       </div>
104     </div>
105   </div>
106   <hr>
107   <table width="100%">
108     <tr>
109       <td width="35%">
110         <table>
111           <tr class="listheading">
112             <th colspan="2">[% 'Shop Headdata' | $T8 %]</th>
113           </tr>
114           <tr><td><b>[% 'Shop Ordernumber' | $T8 %]</b></td><td>[% HTML.escape(IMPORT.shop_ordernumber) %]</td></tr>
115           <tr><td><b>[% 'Shop Orderdate' | $T8 %]</b></td><td>[% HTML.escape(IMPORT.order_date.dmy('.')) _ ' ' _ HTML.escape(IMPORT.order_date.hms(':')) %]</td></tr>
116           <tr><td><b>[% 'Shop Host' | $T8 %]</b></td><td>[% HTML.escape(IMPORT.host) %]</td></tr>
117           <tr><td><b>[% 'Shop OrderIP' | $T8 %]</b></td><td>[% HTML.escape(IMPORT.remote_ip) %]</td></tr>
118           <tr><td><b>[% 'Shop Ordernotes' | $T8 %]</b></td><td>[% HTML.escape(IMPORT.shop_customer_comment) %]</td></tr>
119           <tr><td><b>[% 'Shop Orderamount' | $T8 %]</b></td><td>[% HTML.escape(IMPORT.amount_as_number) %]</td></tr>
120           <tr><td><b>[% 'Shipping costs' | $T8 %]</b></td><td>[% HTML.escape(IMPORT.shipping_costs_as_number) %]</td></tr>
121           <tr><td><b>[% 'Payment description' | $T8 %]</b></td><td>[% HTML.escape(IMPORT.payment_description) %]</td></tr>
122         </table>
123       </td>
124       <td style="padding-left: 20px; vertical-align: top;">
125         [% IF IMPORT.obsolete %]
126         <b>[% 'Shoporder deleted -- ' | $T8 %]</b><a href="controller.pl?action=ShopOrder/undelete_order&import_id=[% IMPORT.id %]">[% 'revert deleted' | $T8 %]</a>
127         [% ELSE %]
128         [% UNLESS IMPORT.transferred %]
129         [% IF PROPOSALS %]
130           <form method="post" action="controller.pl" id="create_order">
131             [% L.hidden_tag('import_id', IMPORT.id) %]
132             <div style="height: 125px; overflow:auto;">
133               <table>
134                 <tr class="listheading">
135                   <th colspan="7">Customer Proposals</td>
136                 </tr>
137                 [% FOREACH prop = PROPOSALS %][% IF prop.order_lock %][% SET orderlock_class = 'style="background:rgba(232, 32, 23, 0.2);"' %][% ELSE %][% SET orderlock_class = '' %][% END %]
138                 <tr class="listrow" [% orderlock_class %]>
139                   <td>[% IF !prop.order_lock %][% L.radio_button_tag('customer', value=prop.id) %][% END %]</td>
140                   <td><a href="controller.pl?action=CustomerVendor/edit&id=[% prop.id %]&db=customer&callback=[% HTML.url('controller.pl?action=ShopOrder/show&id=' _ IMPORT.id) %]">[% HTML.escape(prop.customernumber) %]</a></td>
141                   <td>[% IF !prop.notes == '' %]<span class="tooltipster-html" title="[% HTML.escape(prop.notes) %]"><span style="color:red;font-weight: bold;">[% HTML.escape(prop.name) %]</span>[% ELSE %][% HTML.escape(prop.name) %][% END %]</td>
142                   <td>[% HTML.escape(prop.street) %]</td>
143                   <td>[% HTML.escape(prop.zipcode) %]</td>
144                   <td>[% HTML.escape(prop.city) %]</td>
145                   <td>[% HTML.escape(prop.email) %]</td>
146                 </tr>
147                 [% END %]
148               </table>
149             </div>
150             <div id="transfer" style="float:left; display:none;">
151               [% # 'Customernumber: ' _ %]
152               [% L.ajax_submit_tag('controller.pl?action=ShopOrder/transfer', "#create_order", LxERP.t8('Create order')) %]
153             </div>
154             [% FOREACH prop = PROPOSALS %]
155             <div id="shop_update_customer_[% prop.id %]" class="div_hidden" style="display:none;">
156               [% L.ajax_submit_tag("controller.pl?action=ShopOrder/apply_customer&cv_id=" _ prop.id,  "#billing", LxERP.t8("Update customer using billing address")) %]
157             </div>
158             [% END %]
159           </form>
160         <a href="controller.pl?action=ShopOrder/delete_order&import_id=[% IMPORT.id %]">[% 'delete order' | $T8 %]</a>
161         [% END # PROPOSALS %]
162         [% ELSE %]
163         <div>
164           [% 'Transferred' | $T8 %]
165           <div id="recordlinks"></div>
166           <script type="text/javascript">
167             var url = 'controller.pl?action=RecordLinks/ajax_list&object_model=ShopOrder&object_id=[% IMPORT.id %]';
168             $('#recordlinks').load(url);
169           </script>
170         </div>
171         [% END %]
172         [% END %]
173       </td>
174     </tr>
175   </table>
176   <hr>
177   <div style="height: 250px; overflow:auto; margin:15px;">
178     <table width="99%">
179       <tr class="listheading">
180         <th>[% 'Position'          | $T8 %]</th>
181         <th>[% 'Partnumber'        | $T8 %]</th>
182         <th>[% 'Partdescriptipion' | $T8 %]</th>
183         <th>[% 'Qty'               | $T8 %]</th>
184         <th>[% 'Price'             | $T8 %]</th>
185         <th>[% 'Extended'          | $T8 %]</th>
186       </tr>
187       <tr class="listrow">
188       [% FOREACH pos = IMPORT.shop_order_items %]
189         <td>[% loop.count                                      %]</td>
190         <td>[% HTML.escape(pos.partnumber)                     %]</td>
191         <td>[% HTML.escape(pos.description)                    %]</td>
192         <td>[% pos.quantity_as_number                          %]</td>
193         <td>[% pos.price_as_number                             %]</td>
194         <td>[% LxERP.format_amount(pos.price * pos.quantity,2) %]</td>
195       </tr>
196       [% END %]
197     </table>
198   </div>
199   <hr>
200 <script type="text/javascript">
201 $("input[type=radio]").change(function(){
202       $('.div_hidden').css("display", 'none');
203       var cv_id = $("input[type=radio][id="+ this.id + "]").val();
204       $('#shop_update_customer_'+ cv_id).css("display", 'block');
205       $('#transfer').css("display", 'block');
206 });
207 </script>