Skip to content

Commit

Permalink
add PDW exclusiveness elibri extension
Browse files Browse the repository at this point in the history
  • Loading branch information
porbas committed May 18, 2017
1 parent 416c0eb commit 78b6214
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions lib/elibri_onix_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def render_products!
export_sale_restrictions!(product) if product.respond_to?(:sale_restricted?) && product.sale_restricted? #PR.21
end
remove_tag_if_empty!(:PublishingDetail)

#P.23 - related products
if product.respond_to?(:facsimiles) && product.facsimiles.present?
export_related_products!(product)
Expand Down Expand Up @@ -377,18 +377,18 @@ def export_epub_details!(product)
tag(:ProductFormDetail, onix_code)
end
end

if product.respond_to?(:digital?) && product.digital?
if product.epub_technical_protection
comment_dictionary "Zabezpieczenie", :EpubTechnicalProtection, :indent => 10, :kind => :onix_epub_details
tag(:EpubTechnicalProtection, product.epub_technical_protection_onix_code)
end

if product.epub_fragment_info?
tag(:EpubUsageConstraint) do
comment "Rodzaj ograniczenia - w tym przypadku zawsze dotyczy dostępności fragmentu książki", :indent => 12, :kind => :onix_epub_details
tag(:EpubUsageType, Elibri::ONIX::Dict::Release_3_0::EpubUsageType::PREVIEW)

comment_dictionary "Jaka jest decyzja wydawcy?", :EpubUsageStatus, :indent => 12, :kind => :onix_epub_details
tag(:EpubUsageStatus, product.epub_publication_preview_usage_status_onix_code)
if product.epub_publication_preview_usage_status_onix_code == Elibri::ONIX::Dict::Release_3_0::EpubUsageStatus::LIMITED
Expand Down Expand Up @@ -1078,6 +1078,7 @@ def export_elibri_extensions!(product)
comment 'Vat w procentach'
tag("elibri:Vat", product.vat) if product.vat.present?
tag("elibri:PKWiU", product.pkwiu) if product.pkwiu.present?
tag("elibri:PDWExclusiveness", product.pdw_exclusiveness) if product.pdw_exclusiveness.present?
tag("elibri:preview_exists", product.preview_exists?.to_s)
if product.digital?
if product.epub_sale_not_restricted? || product.epub_sale_restricted_to.nil?
Expand Down
2 changes: 1 addition & 1 deletion lib/elibri_onix_generator/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module ElibriOnixGenerator
VERSION = "0.1.13"
VERSION = "0.3.0"
end

0 comments on commit 78b6214

Please sign in to comment.