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

fix: skip None instead of outputting empty elements #15

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,15 @@ pub struct ApplicableHeaderTradeSettlement <'invoice>{

#[derive(Serialize, Clone, Copy, Debug)]
pub struct ApplicableTradeTax <'invoice> {
#[serde(rename="ram:CalculatedAmount",serialize_with="format_f64_option")]
#[serde(rename="ram:CalculatedAmount",serialize_with="format_f64_option", skip_serializing_if = "Option::is_none")]
pub calculated_amount: Option<f64>,
#[serde(rename="ram:TypeCode")]
pub type_code: &'invoice str,
#[serde(rename="ram:BasisAmount",serialize_with="format_f64_option")]
#[serde(rename="ram:BasisAmount",serialize_with="format_f64_option", skip_serializing_if = "Option::is_none")]
pub basis_amount: Option<f64>,
#[serde(rename="ram:CategoryCode")]
pub category_code: VATCategoryCode,
#[serde(rename="ram:RateApplicablePercent",serialize_with="format_f64_option")]
#[serde(rename="ram:RateApplicablePercent",serialize_with="format_f64_option", skip_serializing_if = "Option::is_none")]
pub rate_applicable_percent: Option<f64>,

}
Expand Down Expand Up @@ -485,7 +485,7 @@ pub struct SpecifiedTradeSettlementHeaderMonetarySummation {
#[serde(rename="ram:TaxBasisTotalAmount",serialize_with="format_f64_option")]
pub tax_basis_total_amount: Option<f64>,
/// `BT-110`: The total VAT amount for the Invoice.
#[serde(rename="ram:TaxTotalAmount")]
#[serde(rename="ram:TaxTotalAmount", skip_serializing_if = "Option::is_none")]
pub tax_total_amount: Option<TaxTotalAmount>,
/// `BT-112`: The total amount of the Invoice with VAT.
#[serde(rename="ram:GrandTotalAmount",serialize_with="format_f64_option")]
Expand Down