Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes buyer_order date time validation error #23

Closed
wants to merge 1 commit into from

Conversation

MAKOMO
Copy link
Contributor

@MAKOMO MAKOMO commented Jan 16, 2024

Moves BuyerOrderReferencedDocument to accounting.py, align the date time property name to the one of SellerOrderReferenceDocument and make it use FormattedDateTimeField to fix Issue #22.

…ime property name to the one of SellerOrderReferenceDocument and make it use FormattedDateTimeField to fix Issue pretix#22
Copy link

codecov bot commented Jan 16, 2024

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (78b360d) 91.09% compared to head (80648e7) 89.93%.

Files Patch % Lines
drafthorse/models/elements.py 44.44% 20 Missing ⚠️
drafthorse/models/fields.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #23      +/-   ##
==========================================
- Coverage   91.09%   89.93%   -1.17%     
==========================================
  Files          17       17              
  Lines        1382     1431      +49     
==========================================
+ Hits         1259     1287      +28     
- Misses        123      144      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

def __init__(self, namespace, tag, value=None, format="102"):
super().__init__(namespace, tag)
self._value = value
self._format = format
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class looks good, but it is the kind of code that would profit from a few extra tests to make sure the format conversions are correct back and forth. would you mind adding those?

@MAKOMO
Copy link
Contributor Author

MAKOMO commented Jan 20, 2024

Replaced by the more general PR #27. Note that PR #27 also adds a test case. As I couldn't find one in the wild I 'constructed' one by adding to the ElektronischeAdresse.xml from the spec v2.2. Those v2.2 sample files come with an updated namespace for QualifiedDataType

xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"

while all zugferd_2p1_*.xml samples specify

xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:10" 

Maybe all sample files should be updated to the latest revision from the v2.2 spec.

@MAKOMO MAKOMO closed this Jan 20, 2024
raphaelm pushed a commit that referenced this pull request Mar 10, 2024
… and PR #23 and contains alignments to the v2.2 specification (#27)

* - corrects the NS_QDT name according to the zugferd22 specification
- extends elements.py:DateTimeElement to allow the adjustment of the inner DateTimes namespace
- updates references.py:ReferencedDocument to use NS_QDT for its DateTimeElement
- corrects profiles in reference.py for various attributes according to the zugferd22 schemata
- adds test zugferd_2p2_EN16931_ElektronischeAdresse2.xml as a variation of the official zugferd22 sample EN16931_ElektronischeAdresse.xml adding a FormattedIssueDateTime to the BuyerOrderReferencedDocument
- moves SellerOrderReferencedDocument from trade.py to references.py
- fixes DateTimeField namespace of AdvancePayment.received_date

* This commit also adds the class ProductInstance (IndividualTradeProductInstance) to product.py and adds the missing fields "id" (IDField) and "instance" (ProductInstance) to product.py:TradeProduct.

This commit also adds class PayerTradeParty (PayerTradeParty) to party.py and adds the missing field "payer" (PayerTradeParty) to trade.py:TradeSettlement.

This commit also removes the unused (and not needed) party.py:LineApplicableTradeTax class.

This commit also corrects profile and required tags according to the v2.2 specification as follows:

- references.py:LineAdditionalReferencedDocument
  .name profile COMFORT => BASIC (was COMFORT)
- tradelines.py:LineSettlement
  .trade_tax profile COMFORT => BASIC
  .period profile COMFORT => BASIC
  .allowance_charge profile COMFORT => BASIC
  .monetary_summation profile COMFORT => BASIC
  .additional_referenced_document profile EXTENDED => COMFORT
  .accounting_account profile EXTENDED => COMFORT
- product.py:ProductCharacteristic
  .type_code  required => optional
  .description profile EXTENDED => COMFORT
  .value profile EXTENDED => COMFORT
- product.py:ProductClassification
  .class_code required => optional; profile EXTENDED => COMFORT
  .value required => optional
- product.py:TradeProduct
  .name profile COMFORT => BASIC
  .characteristics EXTENDED => COMFORT
  .classifications EXTENDED => COMFORT
  .origins EXTENDED => COMFORT
- trade.py:TradeSettlement
  .tax_currency_code profile COMFORT => BASIC
  .invoicer profile COMFORT => EXTENDED
  .invoicee profile COMFORT => EXTENDED
  .payee profile COMFORT => BASIC
  .allowance_charge profile COMFORT => BASIC
  .service_charge profile COMFORT => EXTENDED
  .terms profile COMFORT => BASIC
  .accounting_account EXTENDED => BASIC
- accounting.py:ApplicableTradeTax
  .exemption_reason COMFORT => BASIC
  .category_code COMFORT => BASIC
  .exemption_reason_code EXTENDED => BASIC

* fixes profile annotations in TradeAllowanceCharge

* SpecifiedTradeAllowanceCharge:ReasonCode in COMFORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants