Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision de7d54fb

Von Werner Hahn vor etwa 7 Jahren hinzugefügt

  • ID de7d54fb457390cdb2d5f3a26287a535942b5422
  • Vorgänger 8b2313ef
  • Nachfolger 7b03930b

Shopmodul: Shop - Steuer des Artikels wird übertragen

Conflicts:
SL/ShopConnector/Shopware.pm

Conflicts:
SL/ShopConnector/Shopware.pm

Unterschiede anzeigen:

SL/Controller/Shop.pm
9 9
use SL::DB::Default;
10 10
use SL::DB::Manager::Shop;
11 11
use SL::DB::Pricegroup;
12
use SL::DB::TaxZone;
12 13

  
13 14
use Rose::Object::MakeMethods::Generic (
14
  scalar                  => [ qw(connectors price_types price_sources) ],
15
  scalar                  => [ qw(connectors price_types price_sources taxzone_id) ],
15 16
  'scalar --get_set_init' => [ qw(shop) ]
16 17
);
17 18

  
......
140 141
  };
141 142

  
142 143
  $self->price_sources( $pricesources );
144

  
145
  #Buchungsgruppen for calculate the tax for an article
146
  my $taxkey_ids;
147
  my $taxzones = SL::DB::Manager::TaxZone->get_all_sorted();
148

  
149
  foreach my $tz( @$taxzones ) {
150
    push( @{ $taxkey_ids }, { id => $tz->id, name => $tz->description } );
151
  }
152
  $self->taxzone_id( $taxkey_ids );
153

  
143 154
};
144 155

  
145 156

  
SL/DB/MetaSetup/Shop.pm
22 22
  price_source      => { type => 'text' },
23 23
  pricetype         => { type => 'text' },
24 24
  sortkey           => { type => 'integer' },
25
  taxzone_id        => { type => 'integer' },
25 26
  url               => { type => 'text' },
26 27
);
27 28

  
SL/ShopConnector/Shopware.pm
31 31
  my $ordnumber = $self->config->last_order_number + 1;
32 32
  my $otf = $self->config->orders_to_fetch;
33 33

  
34

  
35 34
  my $i;
36 35
  for ($i=1;$i<=$otf;$i++) {
37 36

  
......
235 234
  my $url = $self->url;
236 235

  
237 236
  my $data = $self->connector->get("http://$url/api/categories");
237

  
238 238
  my $data_json = $data->content;
239 239
  my $import = SL::JSON::decode_json($data_json);
240 240
  my @daten = @{$import->{data}};
......
281 281

  
282 282
  my ($import,$data,$data_json);
283 283
  if( $shop_part->last_update){
284
    my $partnumber = $::form->escape($part->{partnumber});#shopware don't accept "/" in articlenumber
284
    my $partnumber = $::form->escape($part->{partnumber});#shopware don't accept / in articlenumber
285 285
    $data = $self->connector->get("http://$url/api/articles/$partnumber?useNumberAsId=true");
286 286
    $data_json = $data->content;
287 287
    $import = SL::JSON::decode_json($data_json);
288
    $main::lxdebug->dump(0, 'WH:IMPORT ',\$import);
289

  
290
#  }
288
  }
291 289

  
292 290
  # get the right price
293 291
  my ( $price_src_str, $price_src_id ) = split(/\//,$shop_part->active_price_source);
......
388 386
  my $del_imgString = SL::JSON::to_json(\%del_img);
389 387
  #my $delImg = $self->connector->put("http://$url/api/articles/$part->{partnumber}?useNumberAsId=true",Content => $del_imgString);
390 388
    #update
391
    my $partnumber = $::form->escape($part->{partnumber});#shopware dosn't accept / in articlenumber
389
    my $partnumber = $::form->escape($part->{partnumber});#shopware don't accept / in articlenumber
392 390
    my $upload = $self->connector->put("http://$url/api/articles/$partnumber?useNumberAsId=true",Content => $dataString);
393
    $main::lxdebug->dump(0, 'WH:iUPLOAD ',\$upload);
394

  
395 391
    my $data_json = $upload->content;
396 392
    $upload_content = SL::JSON::decode_json($data_json);
397 393
  }else{
......
412 408
  my ($self,$partnumber) = @_;
413 409

  
414 410
  my $url = $self->url;
415
  $partnumber = $::form->escape($partnumber);#shopware don't accept / in articlenumber
411
  my $partnumber = $::form->escape($partnumber);#shopware don't accept / in articlenumber
416 412
  my $data = $self->connector->get("http://$url/api/articles/$partnumber?useNumberAsId=true");
417 413
  my $data_json = $data->content;
418 414
  return SL::JSON::decode_json($data_json);
sql/Pg-upgrade2/shops3.sql
1
-- @tag: shops3
2
-- @description: Alter table shops more columns for configuration
3
-- @charset: UTF-8
4
-- @depends: release_3_4_0 shops
5
-- @ignore: 0
6

  
7
ALTER TABLE shops ADD COLUMN taxzone_id integer;
templates/webpages/shops/form.html
5 5
[% SET size=34 %]
6 6

  
7 7
<h1>[% HTML.escape(title) %]</h1>
8
[% # Dumper.dump_html(SELF.shop) %]
8
[% #Dumper.dump_html(SELF.shop) %]
9 9
<form action="controller.pl" method="post">
10 10

  
11 11
[%- INCLUDE 'common/flash.html' %]
......
29 29
    <th align="right">[% 'Price Source' | $T8 %]</th>
30 30
    <td>[% L.select_tag('shop.price_source', SELF.price_sources, value_key = 'id', title_key = 'name', with_empty = 0, default = SELF.shop.price_source, default_value_key='id' ) %]</td>
31 31
  </tr>
32
  <tr>
33
    <th align="right">[% 'Bookinggroup/Tax' | $T8 %]</th>
34
    <td>[% L.select_tag('shop.taxzone_id', SELF.taxzone_id, value_key = 'id', title_key = 'name', with_empty = 0, default = SELF.shop.taxzone_id, default_value_key='id' ) %]</td>
35
  </tr>
32 36
  <tr>
33 37
    <th align="right">[% 'URL' | $T8 %]</th>
34 38
    <td>[%- L.input_tag("shop.url", SELF.shop.url, size=size) %]</td>

Auch abrufbar als: Unified diff