GLN: Berücksichtigung in Belegmasken
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Thu, 11 Feb 2016 22:02:25 +0000 (23:02 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 12 Feb 2016 16:16:32 +0000 (17:16 +0100)
13 files changed:
SL/DB/Helper/FlattenToForm.pm
SL/DB/Manager/Customer.pm
SL/DB/Manager/Vendor.pm
SL/Form.pm
SL/IS.pm
bin/mozilla/io.pl
bin/mozilla/ir.pl
bin/mozilla/is.pl
bin/mozilla/oe.pl
templates/webpages/common/show_vc_details.html
templates/webpages/do/form_header.html
templates/webpages/io/ship_to.html
templates/webpages/oe/check_for_direct_delivery.html

index 09966e0..3cb7b5f 100644 (file)
@@ -28,7 +28,7 @@ sub flatten_to_form {
   $form->{vc} = $vc if ref($self) =~ m{^SL::DB::(?:.*Invoice|Order)};
 
   my @vc_fields          = (qw(account_number bank bank_code bic business city contact country creditlimit
-                               department_1 department_2 discount email fax homepage iban language name
+                               department_1 department_2 discount email fax gln homepage iban language name
                                payment_terms phone street taxnumber ustid zipcode),
                             "${vc}number",
                             ($vc eq 'customer')? 'c_vendor_id': 'v_customer_id');
index 30c32a9..4a1d8b0 100644 (file)
@@ -22,7 +22,7 @@ __PACKAGE__->add_filter_specs(
 sub _sort_spec {
   return ( default => [ 'name', 1 ],
            columns => { SIMPLE => 'ALL',
-                        map { ( $_ => "lower(customer.$_)" ) } qw(customernumber vendornumber name contact phone fax email street taxnumber business invnumber ordnumber quonumber)
+                        map { ( $_ => "lower(customer.$_)" ) } qw(customernumber vendornumber name contact phone fax email street gln taxnumber business invnumber ordnumber quonumber)
                       });
 }
 
index af4b029..443a41e 100644 (file)
@@ -24,7 +24,7 @@ sub _sort_spec {
     default => [ 'name', 1 ],
     columns => {
       SIMPLE => 'ALL',
-      map { ( $_ => "lower(vendor.$_)" ) } qw(account_number bank bank_code bcc bic cc city contact country department_1 department_2 depositor email fax greeting homepage iban language
+      map { ( $_ => "lower(vendor.$_)" ) } qw(account_number bank bank_code bcc bic cc city contact country department_1 department_2 depositor email fax gln greeting homepage iban language
                                               name notes phone street taxnumber user_password username ustid v_customer_id vendornumber zipcode)
     });
 }
index a1b4198..610f545 100644 (file)
@@ -1858,7 +1858,7 @@ sub add_shipto {
   my $shipto;
   my @values;
 
-  foreach my $item (qw(name department_1 department_2 street zipcode city country
+  foreach my $item (qw(name department_1 department_2 street zipcode city country gln
                        contact cp_gender phone fax email)) {
     if ($self->{"shipto$item"}) {
       $shipto = 1 if ($self->{$item} ne $self->{"shipto$item"});
@@ -1876,6 +1876,7 @@ sub add_shipto {
                        shiptozipcode = ?,
                        shiptocity = ?,
                        shiptocountry = ?,
+                       shiptogln = ?,
                        shiptocontact = ?,
                        shiptocp_gender = ?,
                        shiptophone = ?,
@@ -1892,6 +1893,7 @@ sub add_shipto {
                        shiptozipcode = ? AND
                        shiptocity = ? AND
                        shiptocountry = ? AND
+                       shiptogln = ? AND
                        shiptocontact = ? AND
                        shiptocp_gender = ? AND
                        shiptophone = ? AND
@@ -1903,9 +1905,9 @@ sub add_shipto {
       if(!$insert_check){
         $query =
           qq|INSERT INTO shipto (trans_id, shiptoname, shiptodepartment_1, shiptodepartment_2,
-                                 shiptostreet, shiptozipcode, shiptocity, shiptocountry,
+                                 shiptostreet, shiptozipcode, shiptocity, shiptocountry, shiptogln,
                                  shiptocontact, shiptocp_gender, shiptophone, shiptofax, shiptoemail, module)
-             VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|;
+             VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|;
         do_query($self, $dbh, $query, $id, @values, $module);
       }
     }
index 19c4188..c82e731 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -591,6 +591,7 @@ sub customer_details {
       $ref->{street} = $customer->street;
       $ref->{zipcode} = $customer->zipcode;
       $ref->{country} = $customer->country;
+      $ref->{gln} = $customer->gln;
     }
     my $contact = SL::DB::Manager::Contact->find_by(cp_id => $::form->{cp_id});
     if ($contact) {
index 26457a5..89eb6a2 100644 (file)
@@ -1643,11 +1643,10 @@ sub ship_to {
   map { $::form->{$_} = $::form->parse_amount(\%::myconfig, $::form->{$_}) } qw(exchangerate creditlimit creditremaining);
 
   # get details for customer/vendor
-  call_sub($::form->{vc} . "_details", qw(name department_1 department_2 street zipcode city country contact email phone fax), $::form->{vc} . "number");
-
+  call_sub($::form->{vc} . "_details", qw(name department_1 department_2 street zipcode city country gln contact email phone fax), $::form->{vc} . "number");
   $::form->{rowcount}--;
 
-  my @shipto_vars   = qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry
+  my @shipto_vars   = qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptogln
                          shiptocontact shiptocp_gender shiptophone shiptofax shiptoemail
                          shiptodepartment_1 shiptodepartment_2);
   my $previous_form = $::auth->save_form_in_session(skip_keys => [ @shipto_vars, qw(header shipto_id) ]);
index d8de820..259b9cb 100644 (file)
@@ -335,7 +335,7 @@ sub form_header {
     id action type media format queued printed emailed title vc discount
     title creditlimit creditremaining tradediscount business closedto locked shipped storno storno_id
     max_dunning_level dunning_amount
-    shiptoname shiptostreet shiptozipcode shiptocity shiptocountry  shiptocontact shiptophone shiptofax
+    shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptogln shiptocontact shiptophone shiptofax
     shiptoemail shiptodepartment_1 shiptodepartment_2 message email subject cc bcc taxaccounts cursor_fokus
     convert_from_do_ids convert_from_oe_ids show_details gldate useasnew
   ), @custom_hiddens,
index 457ba3f..02cabba 100644 (file)
@@ -385,7 +385,7 @@ sub form_header {
     id action type media format queued printed emailed title vc discount
     title creditlimit creditremaining tradediscount business closedto locked shipped storno storno_id
     max_dunning_level dunning_amount dunning_description
-    shiptoname shiptostreet shiptozipcode shiptocity shiptocountry  shiptocontact shiptophone shiptofax
+    shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptogln shiptocontact shiptophone shiptofax
     shiptoemail shiptodepartment_1 shiptodepartment_2  shiptocp_gender message email subject cc bcc taxaccounts cursor_fokus
     convert_from_do_ids convert_from_oe_ids convert_from_ar_ids useasnew
     invoice_id
index dc8f0c1..f7cf933 100644 (file)
@@ -477,7 +477,7 @@ sub form_header {
      qw(id action type vc formname media format proforma queued printed emailed
         title creditlimit creditremaining tradediscount business
         max_dunning_level dunning_amount shiptoname shiptostreet shiptozipcode
-        CFDD_shipto CFDD_shipto_id shiptocity shiptocountry shiptocontact shiptophone shiptofax
+        CFDD_shipto CFDD_shipto_id shiptocity shiptocountry shiptogln shiptocontact shiptophone shiptofax
         shiptodepartment_1 shiptodepartment_2 shiptoemail shiptocp_gender
         message email subject cc bcc taxpart taxservice taxaccounts cursor_fokus
         show_details useasnew),
index b1f502f..f374980 100644 (file)
    <td>[% HTML.escape(country) %]</td>
   </tr>
 
+  <tr>
+   <td align="right">[% 'GLN' | $T8 %]</td>
+   <td>[% HTML.escape(gln) %]</td>
+  </tr>
+
   <tr>
    <td align="right">[% 'Contact Person' | $T8 %]</td>
    <td>[% IF greeting %][% HTML.escape(greeting) %] [% END %][% HTML.escape(contact) %]</td>
     <td>[% HTML.escape(row.shiptocountry) %]</td>
    </tr>
 
+   <tr>
+    <td align="right">[% 'GLN' | $T8 %]</td>
+    <td>[% HTML.escape(row.shiptogln) %]</td>
+   </tr>
+
    <tr>
     <td align="right">[% 'Contact Person' | $T8 %]</td>
     <td>[% HTML.escape(row.shiptocontact) %]</td>
index 52b0e70..012c3d3 100644 (file)
@@ -92,6 +92,7 @@
   <input type="hidden" name="shiptocontact" value="[% HTML.escape(shiptocontact) %]">
   <input type="hidden" name="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
   <input type="hidden" name="shiptocountry" value="[% HTML.escape(shiptocountry) %]">
+  <input type="hidden" name="shiptogln" value="[% HTML.escape(shiptogln) %]">
   <input type="hidden" name="shiptodepartment_1" value="[% HTML.escape(shiptodepartment_1) %]">
   <input type="hidden" name="shiptodepartment_2" value="[% HTML.escape(shiptodepartment_2) %]">
   <input type="hidden" name="shiptoemail" value="[% HTML.escape(shiptoemail) %]">
index ca5560c..476aaeb 100644 (file)
@@ -9,6 +9,7 @@
       shiptozipcode:      "[% JavaScript.escape(vc_obj.zipcode) %]",
       shiptocity:         "[% JavaScript.escape(vc_obj.city) %]",
       shiptocountry:      "[% JavaScript.escape(vc_obj.country) %]",
+      shiptogln:          "[% JavaScript.escape(vc_obj.gln) %]",
       shiptocontact:      "[% JavaScript.escape(vc_obj.contact) %]",
       shiptocp_gender:    "[% JavaScript.escape(vc_obj.cp_gender) %]",
       shiptophone:        "[% JavaScript.escape(vc_obj.phone) %]",
@@ -25,6 +26,7 @@
       shiptozipcode:      "[% JavaScript.escape(shipto.shiptozipcode) %]",
       shiptocity:         "[% JavaScript.escape(shipto.shiptocity) %]",
       shiptocountry:      "[% JavaScript.escape(shipto.shiptocountry) %]",
+      shiptogln:          "[% JavaScript.escape(shipto.shiptogln) %]",
       shiptocontact:      "[% JavaScript.escape(shipto.shiptocontact) %]",
       shiptocp_gender:    "[% JavaScript.escape(shipto.shiptocp_gender) %]",
       shiptophone:        "[% JavaScript.escape(shipto.shiptophone) %]",
     <td>[% HTML.escape(country) %]</td>
     <td>[% L.input_tag("shiptocountry", shiptocountry, "size", "35") %]</td>
    </tr>
+   <tr>
+    <th align="right" nowrap>[% LxERP.t8('GLN') %]</th>
+    <td>[% HTML.escape(gln) %]</td>
+    <td>[% L.input_tag("shiptogln", shiptogln, "size", "35") %]</td>
+   </tr>
    <tr>
     <th align="right" nowrap>[% LxERP.t8('Contact') %]</th>
     <td>[% HTML.escape(contact) %]</td>
index b2a5b16..9070cab 100644 (file)
     <td valign="top">[% HTML.escape(CFDD_shiptocountry) %]</td>
    </tr>
 
+   <tr>
+    <th align="right" valign="top">[% 'GLN' | $T8 %]:</th>
+    <td valign="top">[% HTML.escape(CFDD_shiptogln) %]</td>
+   </tr>
+
    <tr>
     <th align="right" valign="top">[% 'Contact' | $T8 %]:</th>
     <td valign="top">[% HTML.escape(CFDD_shiptocontact) %]</td>