comee_core 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 27037927222c47f336ab62f1a7663b4711e4e9d72569f8a22b6f9aa6456fc771
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 4c530f8a8f820da46cd03a5d8715256eae40c9b229ca22448b95a57c5ed847dc
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2bc9dbf09a3f5131dec303aca390b204e5556aac0e7aea017feddcb19142fdfdaf0902f0ee7e30ada6753347e55e58951a0c0a5fd178f846b46822d7c21d2404
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: a31dd17eb583fe4182b0c070a915acb8fb8fc56066569418af0865218c330fbb65c9bb3db73b8ccd22823b5fb4fc907eba9277efce4472140975cedacf3f44fa
         
     | 
| 
         @@ -16,6 +16,14 @@ module Comee 
     | 
|
| 
       16 
16 
     | 
    
         
             
                    render json: {success: false, error: e.message}, status: 422
         
     | 
| 
       17 
17 
     | 
    
         
             
                  end
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
      
 19 
     | 
    
         
            +
                  def generate_beo_xml
         
     | 
| 
      
 20 
     | 
    
         
            +
                    service = BeoService.new(publish_params[:ids])
         
     | 
| 
      
 21 
     | 
    
         
            +
                    data = service.preprocess_data(xml: true)
         
     | 
| 
      
 22 
     | 
    
         
            +
                    render json: {success: true, data: data}
         
     | 
| 
      
 23 
     | 
    
         
            +
                  rescue StandardError => e
         
     | 
| 
      
 24 
     | 
    
         
            +
                    render json: {success: false, error: e.message}, status: 422
         
     | 
| 
      
 25 
     | 
    
         
            +
                  end
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
       19 
27 
     | 
    
         
             
                  private
         
     | 
| 
       20 
28 
     | 
    
         | 
| 
       21 
29 
     | 
    
         
             
                  def publish_params
         
     | 
| 
         @@ -8,12 +8,12 @@ module Comee 
     | 
|
| 
       8 
8 
     | 
    
         
             
                    if @user.authenticate(change_password_params[:old_password])
         
     | 
| 
       9 
9 
     | 
    
         
             
                      if @user.update(password: change_password_params[:new_password],
         
     | 
| 
       10 
10 
     | 
    
         
             
                                      password_confirmation: change_password_params[:new_password_confirmation])
         
     | 
| 
       11 
     | 
    
         
            -
                        render json:  
     | 
| 
      
 11 
     | 
    
         
            +
                        render json: {success: true, data: serialize(@user)}
         
     | 
| 
       12 
12 
     | 
    
         
             
                      else
         
     | 
| 
       13 
     | 
    
         
            -
                        render json: { 
     | 
| 
      
 13 
     | 
    
         
            +
                        render json: {success: false, error: @user.errors.full_messages[0]}, status: 422
         
     | 
| 
       14 
14 
     | 
    
         
             
                      end
         
     | 
| 
       15 
15 
     | 
    
         
             
                    else
         
     | 
| 
       16 
     | 
    
         
            -
                      render json: {error: "Old password  
     | 
| 
      
 16 
     | 
    
         
            +
                      render json: {success: false, error: "Old password doesn't match!"}, status: 422
         
     | 
| 
       17 
17 
     | 
    
         
             
                    end
         
     | 
| 
       18 
18 
     | 
    
         
             
                  end
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
         @@ -10,21 +10,42 @@ module Comee 
     | 
|
| 
       10 
10 
     | 
    
         
             
                    @ids = ids
         
     | 
| 
       11 
11 
     | 
    
         
             
                  end
         
     | 
| 
       12 
12 
     | 
    
         | 
| 
       13 
     | 
    
         
            -
                  def  
     | 
| 
      
 13 
     | 
    
         
            +
                  def preprocess_data(xml: false)
         
     | 
| 
       14 
14 
     | 
    
         
             
                    @ids.each do |id|
         
     | 
| 
       15 
     | 
    
         
            -
                      @line_items =  
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
      
 15 
     | 
    
         
            +
                      @line_items = if xml
         
     | 
| 
      
 16 
     | 
    
         
            +
                                      shipment_items = Comee::Core::ShipmentItem.includes(sales_order_item: :sales_order)
         
     | 
| 
      
 17 
     | 
    
         
            +
                                                                                .where(sales_order_item: {sales_order_id: id})
         
     | 
| 
      
 18 
     | 
    
         
            +
                                      sales_order_item_ids = shipment_items.map { |item| item.sales_order_item_id }
         
     | 
| 
      
 19 
     | 
    
         
            +
                                      Comee::Core::SalesOrderItem.where(id: sales_order_item_ids)
         
     | 
| 
      
 20 
     | 
    
         
            +
                                    else
         
     | 
| 
      
 21 
     | 
    
         
            +
                                      Comee::Core::ShipmentInstructionItem.includes(shipment_item: {sales_order_item: :sales_order})
         
     | 
| 
      
 22 
     | 
    
         
            +
                                                                          .where(shipment_instruction_id: id)
         
     | 
| 
      
 23 
     | 
    
         
            +
                                    end
         
     | 
| 
      
 24 
     | 
    
         
            +
                      sales_order_ids = if xml
         
     | 
| 
      
 25 
     | 
    
         
            +
                                          @line_items.map(&:sales_order_id)
         
     | 
| 
      
 26 
     | 
    
         
            +
                                        else
         
     | 
| 
      
 27 
     | 
    
         
            +
                                          @line_items.map { |item| item.shipment_item.sales_order_item.sales_order.id }
         
     | 
| 
      
 28 
     | 
    
         
            +
                                        end
         
     | 
| 
       18 
29 
     | 
    
         
             
                      @customs_details = Comee::Core::CustomsDetail.includes(sales_order: :customer_order).where(sales_order_id: sales_order_ids)
         
     | 
| 
       19 
30 
     | 
    
         
             
                      @transportation_routes = []
         
     | 
| 
       20 
31 
     | 
    
         
             
                      @position_data = []
         
     | 
| 
       21 
32 
     | 
    
         | 
| 
       22 
     | 
    
         
            -
                      packaging_types = @line_items.map  
     | 
| 
      
 33 
     | 
    
         
            +
                      packaging_types = @line_items.map do |line_item|
         
     | 
| 
      
 34 
     | 
    
         
            +
                        if xml
         
     | 
| 
      
 35 
     | 
    
         
            +
                          Comee::Core::ShipmentItem.find_by(sales_order_item_id: line_item.id).package_type.split(" ")[0]
         
     | 
| 
      
 36 
     | 
    
         
            +
                        else
         
     | 
| 
      
 37 
     | 
    
         
            +
                          line_item.shipment_item.package_type.split(" ")[0]
         
     | 
| 
      
 38 
     | 
    
         
            +
                        end
         
     | 
| 
      
 39 
     | 
    
         
            +
                      end.uniq
         
     | 
| 
       23 
40 
     | 
    
         | 
| 
       24 
41 
     | 
    
         
             
                      @no_of_packages = packaging_types.count
         
     | 
| 
       25 
42 
     | 
    
         
             
                      @package_type = packaging_types.count == 1 && packaging_types.first == "PX" ? "PX" : "PK"
         
     | 
| 
       26 
43 
     | 
    
         
             
                      @total_weight = @line_items.sum do |line_item|
         
     | 
| 
       27 
     | 
    
         
            -
                         
     | 
| 
      
 44 
     | 
    
         
            +
                        if xml
         
     | 
| 
      
 45 
     | 
    
         
            +
                          (line_item.quantity * line_item.product.weight).round(2)
         
     | 
| 
      
 46 
     | 
    
         
            +
                        else
         
     | 
| 
      
 47 
     | 
    
         
            +
                          (line_item.shipment_item.sales_order_item.quantity * line_item.shipment_item.sales_order_item.product.weight).round(2)
         
     | 
| 
      
 48 
     | 
    
         
            +
                        end
         
     | 
| 
       28 
49 
     | 
    
         
             
                      end
         
     | 
| 
       29 
50 
     | 
    
         | 
| 
       30 
51 
     | 
    
         
             
                      raise(StandardError, "No customs detail filed for sales order") unless @customs_details.present?
         
     | 
| 
         @@ -34,36 +55,37 @@ module Comee 
     | 
|
| 
       34 
55 
     | 
    
         
             
                        @transportation_routes << tr["route"][0, 2]
         
     | 
| 
       35 
56 
     | 
    
         
             
                      end
         
     | 
| 
       36 
57 
     | 
    
         | 
| 
       37 
     | 
    
         
            -
                      prepare_data
         
     | 
| 
      
 58 
     | 
    
         
            +
                      @data = xml ? generate_xml : prepare_data
         
     | 
| 
       38 
59 
     | 
    
         
             
                    end
         
     | 
| 
       39 
60 
     | 
    
         | 
| 
       40 
     | 
    
         
            -
                    JSON(@data)
         
     | 
| 
      
 61 
     | 
    
         
            +
                    xml ? @data : JSON(@data)
         
     | 
| 
       41 
62 
     | 
    
         
             
                  end
         
     | 
| 
       42 
63 
     | 
    
         | 
| 
       43 
64 
     | 
    
         
             
                  def position_data
         
     | 
| 
       44 
65 
     | 
    
         
             
                    position_items = []
         
     | 
| 
       45 
66 
     | 
    
         
             
                    @line_items.each_with_index do |line_item, index|
         
     | 
| 
       46 
     | 
    
         
            -
                       
     | 
| 
      
 67 
     | 
    
         
            +
                      si = line_item.shipment_item
         
     | 
| 
      
 68 
     | 
    
         
            +
                      customs_detail = @customs_details.find_by(sales_order_id: si.sales_order_item.sales_order_id)
         
     | 
| 
       47 
69 
     | 
    
         
             
                      mp = Comee::Core::MasterPrice.includes(:country_of_origin).find_by(primary: true,
         
     | 
| 
       48 
     | 
    
         
            -
                                                                                         product_id:  
     | 
| 
      
 70 
     | 
    
         
            +
                                                                                         product_id: si
         
     | 
| 
       49 
71 
     | 
    
         
             
                                                                                         .sales_order_item.product.id)
         
     | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
       51 
73 
     | 
    
         
             
                      position_items << {
         
     | 
| 
       52 
74 
     | 
    
         
             
                        "warePositionsnummer": index + 1,
         
     | 
| 
       53 
     | 
    
         
            -
                        "wareWarennummerKN8":  
     | 
| 
       54 
     | 
    
         
            -
                        "wareWarenbezeichnung":  
     | 
| 
      
 75 
     | 
    
         
            +
                        "wareWarennummerKN8": si.sales_order_item.product.hs_code,
         
     | 
| 
      
 76 
     | 
    
         
            +
                        "wareWarenbezeichnung": si.sales_order_item.product.hs_description,
         
     | 
| 
       55 
77 
     | 
    
         
             
                        "wareRegistriernummerFremdsystem": customs_detail.sales_order.customer_order.order_number,
         
     | 
| 
       56 
78 
     | 
    
         
             
                        "wareUrsprungsbundesland": mp.state_of_origin,
         
     | 
| 
       57 
     | 
    
         
            -
                        "wareEigenmasse":  
     | 
| 
      
 79 
     | 
    
         
            +
                        "wareEigenmasse": si.sales_order_item.product.weight * si.sales_order_item.quantity,
         
     | 
| 
       58 
80 
     | 
    
         
             
                        "wareRohmasse": index.zero? ? @total_weight : 0,
         
     | 
| 
       59 
81 
     | 
    
         
             
                        "ausfuhrLand": "DE",
         
     | 
| 
       60 
82 
     | 
    
         
             
                        "ursprungsland": mp.country_of_origin.code,
         
     | 
| 
       61 
83 
     | 
    
         
             
                        "beantragtesVerfahren": "10",
         
     | 
| 
       62 
84 
     | 
    
         
             
                        "vorhergehendesVerfahren": "00",
         
     | 
| 
       63 
85 
     | 
    
         
             
                        "zusatzlichesVerfahren": "F61",
         
     | 
| 
       64 
     | 
    
         
            -
                        "aussenhandelsstatistikMenge":  
     | 
| 
       65 
     | 
    
         
            -
                        "aussenhandelsstatistikWert": ( 
     | 
| 
       66 
     | 
    
         
            -
                                                         
     | 
| 
      
 86 
     | 
    
         
            +
                        "aussenhandelsstatistikMenge": si.sales_order_item.quantity,
         
     | 
| 
      
 87 
     | 
    
         
            +
                        "aussenhandelsstatistikWert": (si.sales_order_item.quantity *
         
     | 
| 
      
 88 
     | 
    
         
            +
                                                        si.sales_order_item.price * 1.05).round(2),
         
     | 
| 
       67 
89 
     | 
    
         
             
                        "packstuck": [
         
     | 
| 
       68 
90 
     | 
    
         
             
                          {
         
     | 
| 
       69 
91 
     | 
    
         
             
                            "packstuckNummer": index + 1,
         
     | 
| 
         @@ -79,7 +101,7 @@ module Comee 
     | 
|
| 
       79 
101 
     | 
    
         
             
                  end
         
     | 
| 
       80 
102 
     | 
    
         | 
| 
       81 
103 
     | 
    
         
             
                  def prepare_data
         
     | 
| 
       82 
     | 
    
         
            -
                     
     | 
| 
      
 104 
     | 
    
         
            +
                    {
         
     | 
| 
       83 
105 
     | 
    
         
             
                      "dataIdentifier": "",
         
     | 
| 
       84 
106 
     | 
    
         
             
                      "kundenNumber": "",
         
     | 
| 
       85 
107 
     | 
    
         
             
                      "mandantId": "",
         
     | 
| 
         @@ -155,7 +177,7 @@ module Comee 
     | 
|
| 
       155 
177 
     | 
    
         
             
                  def send_customs_details
         
     | 
| 
       156 
178 
     | 
    
         
             
                    response = HTTParty.post("#{@atlas_base_url}/PutData", headers: {'Content-Type': "application/json",
         
     | 
| 
       157 
179 
     | 
    
         
             
                                                                                     'token': @atlas_token,
         
     | 
| 
       158 
     | 
    
         
            -
                                                                                     'bearertoken': bearer_token}, body:  
     | 
| 
      
 180 
     | 
    
         
            +
                                                                                     'bearertoken': bearer_token}, body: preprocess_data)
         
     | 
| 
       159 
181 
     | 
    
         
             
                    unless [200, 201].include?(response.code)
         
     | 
| 
       160 
182 
     | 
    
         
             
                      raise(StandardError,
         
     | 
| 
       161 
183 
     | 
    
         
             
                            "Failed to send POST request with token: #{response.code} - #{response.body}")
         
     | 
| 
         @@ -164,6 +186,133 @@ module Comee 
     | 
|
| 
       164 
186 
     | 
    
         
             
                    JSON.parse(response.body)
         
     | 
| 
       165 
187 
     | 
    
         
             
                  end
         
     | 
| 
       166 
188 
     | 
    
         | 
| 
      
 189 
     | 
    
         
            +
                  def xml_position_data(xml)
         
     | 
| 
      
 190 
     | 
    
         
            +
                    @line_items.each_with_index do |line_item, index|
         
     | 
| 
      
 191 
     | 
    
         
            +
                      customs_detail = @customs_details.find_by(sales_order_id: line_item.sales_order_id)
         
     | 
| 
      
 192 
     | 
    
         
            +
                      mp = Comee::Core::MasterPrice.includes(:country_of_origin).find_by(primary: true,
         
     | 
| 
      
 193 
     | 
    
         
            +
                                                                                         product_id: line_item.product.id)
         
     | 
| 
      
 194 
     | 
    
         
            +
             
     | 
| 
      
 195 
     | 
    
         
            +
                      xml.Position do
         
     | 
| 
      
 196 
     | 
    
         
            +
                        xml.Positionsnummer (index + 1).to_s
         
     | 
| 
      
 197 
     | 
    
         
            +
                        xml.Warenbezeichnung line_item.product.hs_description
         
     | 
| 
      
 198 
     | 
    
         
            +
                        xml.Registriernummer_Fremdsystem customs_detail.sales_order.customer_order.order_number
         
     | 
| 
      
 199 
     | 
    
         
            +
                        xml.Kennnummer_der_Sendung @customs_details.map(&:sales_order).map(&:customer_order).map(&:consignee).join(" ")
         
     | 
| 
      
 200 
     | 
    
         
            +
                        xml.Ursprungsbundesland mp.state_of_origin
         
     | 
| 
      
 201 
     | 
    
         
            +
                        xml.Ursprungsland mp.country_of_origin.code
         
     | 
| 
      
 202 
     | 
    
         
            +
                        xml.Eigenmasse line_item.product.weight * line_item.quantity
         
     | 
| 
      
 203 
     | 
    
         
            +
                        xml.Rohmasse index.zero? ? @total_weight : 0
         
     | 
| 
      
 204 
     | 
    
         
            +
                        xml.Gefahrgutnummer_UNDG
         
     | 
| 
      
 205 
     | 
    
         
            +
                        xml.Warennummer_KN8 line_item.product.hs_code
         
     | 
| 
      
 206 
     | 
    
         
            +
                        xml.Verfahren do
         
     | 
| 
      
 207 
     | 
    
         
            +
                          xml.angemeldetes "10"
         
     | 
| 
      
 208 
     | 
    
         
            +
                          xml.vorangegangenes "00"
         
     | 
| 
      
 209 
     | 
    
         
            +
                          xml.weiteres "F61"
         
     | 
| 
      
 210 
     | 
    
         
            +
                          xml.Ausfuhrerstattung
         
     | 
| 
      
 211 
     | 
    
         
            +
                        end
         
     | 
| 
      
 212 
     | 
    
         
            +
                        xml.Aussenhandelsstatistik do
         
     | 
| 
      
 213 
     | 
    
         
            +
                          xml.Menge line_item.quantity
         
     | 
| 
      
 214 
     | 
    
         
            +
                          xml.Wert (line_item.quantity *
         
     | 
| 
      
 215 
     | 
    
         
            +
                                                        line_item.price * 1.05).round(2)
         
     | 
| 
      
 216 
     | 
    
         
            +
                        end
         
     | 
| 
      
 217 
     | 
    
         
            +
                        xml.Vorpapier do
         
     | 
| 
      
 218 
     | 
    
         
            +
                          xml.Typ
         
     | 
| 
      
 219 
     | 
    
         
            +
                          xml.Referenz
         
     | 
| 
      
 220 
     | 
    
         
            +
                          xml.Zusatz
         
     | 
| 
      
 221 
     | 
    
         
            +
                        end
         
     | 
| 
      
 222 
     | 
    
         
            +
                        xml.Packstuecke do
         
     | 
| 
      
 223 
     | 
    
         
            +
                          xml.Anzahl index.zero? ? @no_of_packages : 0
         
     | 
| 
      
 224 
     | 
    
         
            +
                          xml.Nummer index + 1
         
     | 
| 
      
 225 
     | 
    
         
            +
                          xml.Verpackungsart @package_type
         
     | 
| 
      
 226 
     | 
    
         
            +
                          xml.Zeichen_Nummern customs_detail.sales_order.customer_order.order_number
         
     | 
| 
      
 227 
     | 
    
         
            +
                        end
         
     | 
| 
      
 228 
     | 
    
         
            +
                        xml.Unterlage do
         
     | 
| 
      
 229 
     | 
    
         
            +
                          xml.Qualifizierung
         
     | 
| 
      
 230 
     | 
    
         
            +
                          xml.Typ
         
     | 
| 
      
 231 
     | 
    
         
            +
                          xml.Referenz
         
     | 
| 
      
 232 
     | 
    
         
            +
                          xml.Zusatz
         
     | 
| 
      
 233 
     | 
    
         
            +
                          xml.Detail
         
     | 
| 
      
 234 
     | 
    
         
            +
                          xml.Datum_der_Ausstellung
         
     | 
| 
      
 235 
     | 
    
         
            +
                          xml.Datum_des_Gueltigkeitsendes
         
     | 
| 
      
 236 
     | 
    
         
            +
                          xml.Wert
         
     | 
| 
      
 237 
     | 
    
         
            +
                          xml.Masseinheit
         
     | 
| 
      
 238 
     | 
    
         
            +
                          xml.Aschreibungsmenge
         
     | 
| 
      
 239 
     | 
    
         
            +
                        end
         
     | 
| 
      
 240 
     | 
    
         
            +
                      end
         
     | 
| 
      
 241 
     | 
    
         
            +
                    end
         
     | 
| 
      
 242 
     | 
    
         
            +
                  end
         
     | 
| 
      
 243 
     | 
    
         
            +
             
     | 
| 
      
 244 
     | 
    
         
            +
                  def generate_xml
         
     | 
| 
      
 245 
     | 
    
         
            +
                    Nokogiri::XML::Builder.new(encoding: "Windows-1252") do |xml|
         
     | 
| 
      
 246 
     | 
    
         
            +
                      xml.BEO_ATLAS("xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
         
     | 
| 
      
 247 
     | 
    
         
            +
                                    "xmlns:xsd" => "http://www.w3.org/2001/XMLSchema") do
         
     | 
| 
      
 248 
     | 
    
         
            +
                        xml.Nachricht do
         
     | 
| 
      
 249 
     | 
    
         
            +
                          xml.Zollnummer_Sender "4789741"
         
     | 
| 
      
 250 
     | 
    
         
            +
                          xml.Nachrichten_Typ "DEXPDF"
         
     | 
| 
      
 251 
     | 
    
         
            +
                          xml.BEO_Atlas_KundenID
         
     | 
| 
      
 252 
     | 
    
         
            +
                          xml.Anwendung
         
     | 
| 
      
 253 
     | 
    
         
            +
                          xml.Name "Maveko_korrigiert"
         
     | 
| 
      
 254 
     | 
    
         
            +
                        end
         
     | 
| 
      
 255 
     | 
    
         
            +
                        xml.Kopf do
         
     | 
| 
      
 256 
     | 
    
         
            +
                          xml.EORI_Number "DE47897410000"
         
     | 
| 
      
 257 
     | 
    
         
            +
                          xml.Art_der_Ausfuhranmeldung @customs_details[0].export_declaration_type
         
     | 
| 
      
 258 
     | 
    
         
            +
                          xml.Ausfuhrland "DE"
         
     | 
| 
      
 259 
     | 
    
         
            +
                          xml.Bestimmungsland @customs_details[0].destination_country
         
     | 
| 
      
 260 
     | 
    
         
            +
                          xml.Container @customs_details[0].containerized == true ? 1 : 0
         
     | 
| 
      
 261 
     | 
    
         
            +
                          xml.send("Beteiligten-Konstellation", @customs_details[0].participant_constellation.split(" ")[0])
         
     | 
| 
      
 262 
     | 
    
         
            +
                          xml.send("Gesamt-Rohmasse", @total_weight)
         
     | 
| 
      
 263 
     | 
    
         
            +
                          xml.Kennnummer_der_Sendung @customs_details.map(&:sales_order).map(&:customer_order).map(&:consignee).join(" ")
         
     | 
| 
      
 264 
     | 
    
         
            +
                          xml.Bezugsnummer @customs_details.map(&:sales_order).map(&:customer_order).map(&:order_number).join(" ")
         
     | 
| 
      
 265 
     | 
    
         
            +
                          xml.inlandischerVerkehrszweig @customs_details[0].mode_of_transport
         
     | 
| 
      
 266 
     | 
    
         
            +
                          xml.verkehrszweigAnDerGrenze @customs_details[0].mode_of_transport_at_border
         
     | 
| 
      
 267 
     | 
    
         
            +
                          xml.Befoerderungsmittel_an_der_Grenze do
         
     | 
| 
      
 268 
     | 
    
         
            +
                            xml.Art @customs_details[0].mode_of_transport_type
         
     | 
| 
      
 269 
     | 
    
         
            +
                            xml.Kennzeichen "UNBEKANNT"
         
     | 
| 
      
 270 
     | 
    
         
            +
                          end
         
     | 
| 
      
 271 
     | 
    
         
            +
                          xml.Befoerderungsmittel_am_Abgang do
         
     | 
| 
      
 272 
     | 
    
         
            +
                            xml.sequenznummer "1"
         
     | 
| 
      
 273 
     | 
    
         
            +
                            xml.Art @customs_details[0].type_of_identification.split(" ")[0]
         
     | 
| 
      
 274 
     | 
    
         
            +
                            xml.Kennzeichen @customs_details[0].additional_identifier.split(" ")[0]
         
     | 
| 
      
 275 
     | 
    
         
            +
                            xml.Staatszugehoerigkeit @customs_details[0].nationality.split(" ")[0]
         
     | 
| 
      
 276 
     | 
    
         
            +
                          end
         
     | 
| 
      
 277 
     | 
    
         
            +
                          xml.Ausfuhrzollstelle do
         
     | 
| 
      
 278 
     | 
    
         
            +
                            xml.Dienststellennummer @customs_details[0].export_customs_office.split(" ")[0]
         
     | 
| 
      
 279 
     | 
    
         
            +
                          end
         
     | 
| 
      
 280 
     | 
    
         
            +
                          xml.Vorgesehene_Ausgangszollstelle do
         
     | 
| 
      
 281 
     | 
    
         
            +
                            xml.Dienststellennummer @customs_details[0].customs_office_of_exit.split(" ")[0]
         
     | 
| 
      
 282 
     | 
    
         
            +
                          end
         
     | 
| 
      
 283 
     | 
    
         
            +
                          xml.Geschaeftsvorgang do
         
     | 
| 
      
 284 
     | 
    
         
            +
                            xml.Art "11"
         
     | 
| 
      
 285 
     | 
    
         
            +
                            xml.Rechnungspreis @customs_details[0].sales_order.total_price.round(2)
         
     | 
| 
      
 286 
     | 
    
         
            +
                            xml.Waehrung "EUR"
         
     | 
| 
      
 287 
     | 
    
         
            +
                          end
         
     | 
| 
      
 288 
     | 
    
         
            +
                          xml.Befoerderungsroute do
         
     | 
| 
      
 289 
     | 
    
         
            +
                            @transportation_routes.each do |tr|
         
     | 
| 
      
 290 
     | 
    
         
            +
                              xml.Land tr
         
     | 
| 
      
 291 
     | 
    
         
            +
                            end
         
     | 
| 
      
 292 
     | 
    
         
            +
                          end
         
     | 
| 
      
 293 
     | 
    
         
            +
                          xml.Empfaenger do
         
     | 
| 
      
 294 
     | 
    
         
            +
                            xml.Identifikationsart
         
     | 
| 
      
 295 
     | 
    
         
            +
                            xml.TIN
         
     | 
| 
      
 296 
     | 
    
         
            +
                            xml.Niederlassungsnummer
         
     | 
| 
      
 297 
     | 
    
         
            +
                            xml.Name @customs_details[0].sales_order.customer_order.client.name
         
     | 
| 
      
 298 
     | 
    
         
            +
                            xml.Strasse @address[0]
         
     | 
| 
      
 299 
     | 
    
         
            +
                            xml.PLZ @address[-1]
         
     | 
| 
      
 300 
     | 
    
         
            +
                            xml.Ort "#{@address[1].split(' ')[-3]} #{@address[1].split(' ')[-2]}"
         
     | 
| 
      
 301 
     | 
    
         
            +
                            xml.Land @address[1].split(" ")[-1]
         
     | 
| 
      
 302 
     | 
    
         
            +
                          end
         
     | 
| 
      
 303 
     | 
    
         
            +
                          xml.Lieferbedingung do
         
     | 
| 
      
 304 
     | 
    
         
            +
                            xml.send("Incoterm-Code", @customs_details[0].delivery_term_code[0, 3])
         
     | 
| 
      
 305 
     | 
    
         
            +
                            xml.Ort "Hamburg"
         
     | 
| 
      
 306 
     | 
    
         
            +
                            xml.Land "DE"
         
     | 
| 
      
 307 
     | 
    
         
            +
                          end
         
     | 
| 
      
 308 
     | 
    
         
            +
                        end
         
     | 
| 
      
 309 
     | 
    
         
            +
                        xml.Waren do
         
     | 
| 
      
 310 
     | 
    
         
            +
                          xml_position_data(xml)
         
     | 
| 
      
 311 
     | 
    
         
            +
                        end
         
     | 
| 
      
 312 
     | 
    
         
            +
                      end
         
     | 
| 
      
 313 
     | 
    
         
            +
                    end.to_xml
         
     | 
| 
      
 314 
     | 
    
         
            +
                  end
         
     | 
| 
      
 315 
     | 
    
         
            +
             
     | 
| 
       167 
316 
     | 
    
         
             
                  private
         
     | 
| 
       168 
317 
     | 
    
         | 
| 
       169 
318 
     | 
    
         
             
                  def bearer_token
         
     | 
    
        data/config/routes.rb
    CHANGED
    
    
    
        data/lib/comee/core/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: comee_core
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.3. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Henock L.
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2024-06- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2024-06-27 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: active_model_serializers
         
     |