Skip to content

Commit 00586ef

Browse files
Merge pull request #796 from Dirksche/maintenance/reducedIntellisenseWarnings_correctedSomeComments
Some maintenance work
2 parents 639ac5b + 4ceda2a commit 00586ef

9 files changed

+75
-47
lines changed

ZUGFeRD.Test/XRechnungUBLTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public void TestSkippingOfAllowanceChargeBasisAmount()
235235

236236
InvoiceDescriptor loadedInvoice = InvoiceDescriptor.Load(ms);
237237

238-
Tax tax = loadedInvoice.Taxes.FirstOrDefault(t => t.TypeCode == TaxTypes.LOC);
238+
Tax? tax = loadedInvoice.Taxes.FirstOrDefault(t => t.TypeCode == TaxTypes.LOC);
239239
Assert.IsNotNull(tax);
240240
Assert.AreEqual(basisAmount, tax.BasisAmount);
241241
Assert.AreEqual(percent, tax.Percent);

ZUGFeRD.Test/ZUGFeRDCrossVersionTests.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,8 @@ public void TestGrossPriceRepresentationForXRechnungAndNotXRechnungPositiveCase(
545545
{
546546
decimal grossPrice = 10.1m;
547547
decimal netPrice = 10.0m;
548-
decimal discountPercent = 10.0m;
548+
// Is currently unused, therefore commented out.
549+
//decimal discountPercent = 10.0m;
549550
decimal discountAmount = 0.1m;
550551

551552
InvoiceDescriptor desc = this._InvoiceProvider.CreateInvoice();
@@ -980,8 +981,9 @@ public void TestWithoutGrossQuantity(ZUGFeRDVersion version, ZUGFeRDFormats form
980981
[DataRow(ZUGFeRDVersion.Version23, ZUGFeRDFormats.CII, Profile.Extended)]
981982
public void TestNulledGlobalIDScheme(ZUGFeRDVersion version, ZUGFeRDFormats format, Profile profile)
982983
{
983-
decimal? desiredNetUnitQuantity = 20.0m;
984-
decimal? desiredGrossUnitQuantity = 23.0m;
984+
// Is currently unused, therefore commented out.
985+
//decimal? desiredNetUnitQuantity = 20.0m;
986+
//decimal? desiredGrossUnitQuantity = 23.0m;
985987

986988
InvoiceDescriptor desc = new InvoiceProvider().CreateInvoice();
987989

ZUGFeRD/InvoiceDescriptor.cs

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,8 +1169,8 @@ internal void _AddTradeCharge(decimal? basisAmount, CurrencyCodes currency, deci
11691169
/// </summary>
11701170
/// <param name="basisAmount">Base amount for calculation</param>
11711171
/// <param name="currency">Currency code</param>
1172-
/// <param name="actualAmount">Actual amount of allowance/charge</param>
1173-
/// <param name="reason">Reason for allowance/charge</param>
1172+
/// <param name="actualAmount">Actual amount of charge</param>
1173+
/// <param name="reason">Reason for charge</param>
11741174
/// <param name="taxTypeCode">Type of tax</param>
11751175
/// <param name="taxCategoryCode">Tax category</param>
11761176
/// <param name="taxPercent">Tax percentage</param>
@@ -1213,11 +1213,11 @@ internal void _AddTradeCharge(decimal? basisAmount, CurrencyCodes currency, deci
12131213
/// </summary>
12141214
/// <param name="basisAmount">Base amount (basis of allowance)</param>
12151215
/// <param name="currency">Curency of the allowance</param>
1216-
/// <param name="actualAmount">Actual allowance charge amount</param>
1217-
/// <param name="chargePercentage">Actual allowance charge percentage</param>
1216+
/// <param name="actualAmount">Actual allowance amount</param>
1217+
/// <param name="chargePercentage">Actual allowance percentage</param>
12181218
/// <param name="reason">Reason for the allowance</param>
1219-
/// <param name="taxTypeCode">VAT type code for document level allowance/ charge</param>
1220-
/// <param name="taxCategoryCode">VAT type code for document level allowance/ charge</param>
1219+
/// <param name="taxTypeCode">VAT type code for document level allowance</param>
1220+
/// <param name="taxCategoryCode">VAT type code for document level allowance</param>
12211221
/// <param name="taxPercent">VAT rate for the allowance</param>
12221222
/// <param name="reasonCode">Reason code for the allowance</param>
12231223
public void AddTradeAllowance(decimal? basisAmount, CurrencyCodes currency, decimal actualAmount, decimal? chargePercentage, string reason, TaxTypes taxTypeCode, TaxCategoryCodes taxCategoryCode, decimal taxPercent, AllowanceReasonCodes? reasonCode = null)
@@ -1253,15 +1253,16 @@ internal void _AddTradeAllowance(decimal? basisAmount, CurrencyCodes currency, d
12531253
/// BG-21
12541254
/// Allowance represents a discount whereas charge represents a surcharge.
12551255
/// </summary>
1256-
/// <param name="basisAmount">Base amount (basis of allowance)</param>
1257-
/// <param name="currency">Curency of the allowance</param>
1258-
/// <param name="actualAmount">Actual allowance charge amount</param>
1259-
/// <param name="chargePercentage">Actual allowance charge percentage</param>
1260-
/// <param name="reason">Reason for the allowance</param>
1261-
/// <param name="taxTypeCode">VAT type code for document level allowance/ charge</param>
1262-
/// <param name="taxCategoryCode">VAT type code for document level allowance/ charge</param>
1263-
/// <param name="taxPercent">VAT rate for the allowance</param>
1264-
/// <param name="reasonCode">Reason code for the allowance</param>
1256+
/// <param name="basisAmount">Base amount (basis of charge)</param>
1257+
/// <param name="currency">Curency of the charge</param>
1258+
/// <param name="actualAmount">Actual charge amount</param>
1259+
/// <param name="chargePercentage">Actual charge percentage</param>
1260+
/// <param name="reason">Reason for the charge</param>
1261+
/// <param name="taxTypeCode">VAT type code for document level charge</param>
1262+
/// <param name="taxCategoryCode">VAT type code for document level charge</param>
1263+
/// <param name="taxPercent">VAT rate for the charge</param>
1264+
/// <param name="reasonCode">Reason code for the chargee/param>
1265+
[Obsolete("This function has a typo in the function name. Please use `AddTradeCharge` instead.", true)]
12651266
public void AddTradeeCharge(decimal? basisAmount, CurrencyCodes currency, decimal actualAmount, decimal? chargePercentage, string reason, TaxTypes taxTypeCode, TaxCategoryCodes taxCategoryCode, decimal taxPercent, ChargeReasonCodes? reasonCode = null)
12661267
{
12671268
_AddTradeCharge(basisAmount, currency, actualAmount, chargePercentage, reason, taxTypeCode, taxCategoryCode, taxPercent, reasonCode);
@@ -1302,6 +1303,7 @@ public IList<TradeCharge> GetTradeCharges()
13021303
/// <param name="percentage">Optional percentage</param>
13031304
/// <param name="baseAmount">Optional base amount</param>
13041305
/// <param name="actualAmount">Optional actual amount</param>
1306+
/// <param name="maturityDate">Optional `DateTime?`</param>
13051307
public void AddTradePaymentTerms(string description, DateTime? dueDate = null,
13061308
PaymentTermsType? paymentTermsType = null, int? dueDays = null,
13071309
decimal? percentage = null, decimal? baseAmount = null, decimal? actualAmount = null, DateTime? maturityDate = null)
@@ -1517,6 +1519,7 @@ private static IInvoiceDescriptorWriter _SelectInvoiceDescriptorWriter(ZUGFeRDVe
15171519
/// <param name="version">ZUGFeRD version to use</param>
15181520
/// <param name="profile">ZUGFeRD profile to use</param>
15191521
/// <param name="format">Output format (CII or UBL)</param>
1522+
/// <param name="options">Optional `InvoiceFormatOptions`</param>
15201523
public void Save(Stream stream, ZUGFeRDVersion version = ZUGFeRDVersion.Version23, Profile profile = Profile.Basic, ZUGFeRDFormats format = ZUGFeRDFormats.CII, InvoiceFormatOptions options = null)
15211524
{
15221525
this.Profile = profile;
@@ -1532,6 +1535,7 @@ public void Save(Stream stream, ZUGFeRDVersion version = ZUGFeRDVersion.Version2
15321535
/// <param name="version">ZUGFeRD version to use</param>
15331536
/// <param name="profile">ZUGFeRD profile to use</param>
15341537
/// <param name="format">Output format (CII or UBL)</param>
1538+
/// <param name="options">Optional `InvoiceFormatOptions`</param>
15351539
public void Save(string filename, ZUGFeRDVersion version = ZUGFeRDVersion.Version23, Profile profile = Profile.Basic, ZUGFeRDFormats format = ZUGFeRDFormats.CII, InvoiceFormatOptions options = null)
15361540
{
15371541
this.Profile = profile;

ZUGFeRD/InvoiceDescriptor1Writer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ internal class InvoiceDescriptor1Writer : IInvoiceDescriptorWriter
3939
/// <param name="descriptor">The invoice object that should be saved</param>
4040
/// <param name="stream">The target stream for saving the invoice</param>
4141
/// <param name="format">Format of the target file</param>
42+
/// <param name="options">Optional `InvoiceFormatOptions` for custom formatting of invoice file</param>
4243
public override void Save(InvoiceDescriptor descriptor, Stream stream, ZUGFeRDFormats format = ZUGFeRDFormats.CII, InvoiceFormatOptions options = null)
4344
{
4445
if (!stream.CanWrite || !stream.CanSeek)

ZUGFeRD/InvoiceDescriptor20Writer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ internal class InvoiceDescriptor20Writer : IInvoiceDescriptorWriter
4242
/// <param name="descriptor">The invoice object that should be saved</param>
4343
/// <param name="stream">The target stream for saving the invoice</param>
4444
/// <param name="format">Format of the target file</param>
45+
/// <param name="options">Optional `InvoiceFormatOptions` for custom formatting of invoice file</param>
4546
public override void Save(InvoiceDescriptor descriptor, Stream stream, ZUGFeRDFormats format = ZUGFeRDFormats.CII, InvoiceFormatOptions options = null)
4647
{
4748
if (!stream.CanWrite || !stream.CanSeek)

ZUGFeRD/InvoiceDescriptor23CIIWriter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ internal class InvoiceDescriptor23CIIWriter : IInvoiceDescriptorWriter
4343
/// <param name="descriptor">The invoice object that should be saved</param>
4444
/// <param name="stream">The target stream for saving the invoice</param>
4545
/// <param name="format">Format of the target file</param>
46+
/// <param name="options">Optional `InvoiceFormatOptions` for custom formatting of invoice file</param>
4647
public override void Save(InvoiceDescriptor descriptor, Stream stream, ZUGFeRDFormats format = ZUGFeRDFormats.CII, InvoiceFormatOptions options = null)
4748
{
4849
if (!stream.CanWrite || !stream.CanSeek)

ZUGFeRD/InvoiceDescriptor23Writer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ namespace s2industries.ZUGFeRD
2929
{
3030
internal class InvoiceDescriptor23Writer : IInvoiceDescriptorWriter
3131
{
32-
private readonly Profile ALL_PROFILES = Profile.Minimum | Profile.BasicWL | Profile.Basic | Profile.Comfort | Profile.Extended | Profile.XRechnung1 | Profile.XRechnung;
32+
// Is currently unused, therefore commented out.
33+
//private readonly Profile ALL_PROFILES = Profile.Minimum | Profile.BasicWL | Profile.Basic | Profile.Comfort | Profile.Extended | Profile.XRechnung1 | Profile.XRechnung;
3334

3435

3536
/// <summary>
@@ -39,6 +40,7 @@ internal class InvoiceDescriptor23Writer : IInvoiceDescriptorWriter
3940
/// <param name="descriptor">The invoice object that should be saved</param>
4041
/// <param name="stream">The target stream for saving the invoice</param>
4142
/// <param name="format">Format of the target file</param>
43+
/// <param name="options">Optional `InvoiceFormatOptions`</param>
4244
public override void Save(InvoiceDescriptor descriptor, Stream stream, ZUGFeRDFormats format = ZUGFeRDFormats.CII, InvoiceFormatOptions options = null)
4345
{
4446
IInvoiceDescriptorWriter writer = null;

ZUGFeRD/TradeCurrencyExchange.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ public class TradeCurrencyExchange
4949
public DateTime? ConversionRateTimestamp { get; private set; }
5050

5151

52+
/// <summary>
53+
/// Constructor
54+
/// </summary>
55+
/// <param name="sourceCurrency"></param>
56+
/// <param name="targetCurrency"></param>
57+
/// <param name="conversionRate"></param>
5258
public TradeCurrencyExchange(CurrencyCodes sourceCurrency, CurrencyCodes targetCurrency, decimal conversionRate)
5359
{
5460
SourceCurrency = sourceCurrency;
@@ -57,6 +63,13 @@ public TradeCurrencyExchange(CurrencyCodes sourceCurrency, CurrencyCodes targetC
5763
} // !TradeCurrencyExchange()
5864

5965

66+
/// <summary>
67+
/// Constructor
68+
/// </summary>
69+
/// <param name="sourceCurrency"></param>
70+
/// <param name="targetCurrency"></param>
71+
/// <param name="conversionRate"></param>
72+
/// <param name="conversionRateTimestamp"></param>
6073
public TradeCurrencyExchange(CurrencyCodes sourceCurrency, CurrencyCodes targetCurrency, decimal conversionRate, DateTime conversionRateTimestamp)
6174
{
6275
SourceCurrency = sourceCurrency;

ZUGFeRD/TradeLineItem.cs

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,11 @@ public TradeLineItem(string lineId)
328328
///
329329
/// The amounts are per unit, not for the whole item.
330330
/// </summary>
331-
/// <param name="currency">Currency of the allowance or surcharge</param>
332-
/// <param name="basisAmount">Basis aount for the allowance or surcharge, typicalls the net amount of the item</param>
333-
/// <param name="actualAmount">The actual allowance or surcharge amount</param>
334-
/// <param name="reason">Reason for the allowance or surcharge</param>
335-
/// <param name="reasonCode">Reason code for the allowance or surcharge</param>
331+
/// <param name="currency">Currency of the allowance</param>
332+
/// <param name="basisAmount">Basis aount for the allowance, typicalls the net amount of the item</param>
333+
/// <param name="actualAmount">The actual allowance amount</param>
334+
/// <param name="reason">Reason for the allowance </param>
335+
/// <param name="reasonCode">Reason code for the allowance</param>
336336
public TradeLineItem AddTradeAllowance(CurrencyCodes currency, decimal? basisAmount, decimal actualAmount,
337337
string reason, AllowanceReasonCodes? reasonCode = null)
338338
{
@@ -353,11 +353,11 @@ public TradeLineItem AddTradeAllowance(CurrencyCodes currency, decimal? basisAmo
353353
///
354354
/// The amounts are per unit, not for the whole item.
355355
/// </summary>
356-
/// <param name="currency">Currency of the allowance or surcharge</param>
357-
/// <param name="basisAmount">Basis aount for the allowance or surcharge, typicalls the net amount of the item</param>
358-
/// <param name="actualAmount">The actual allowance or surcharge amount</param>
359-
/// <param name="reason">Reason for the allowance or surcharge</param>
360-
/// <param name="reasonCode">Reason code for the allowance or surcharge</param>
356+
/// <param name="currency">Currency of the surcharge</param>
357+
/// <param name="basisAmount">Basis aount for the surcharge, typicalls the net amount of the item</param>
358+
/// <param name="actualAmount">The actual surcharge amount</param>
359+
/// <param name="reason">Reason for the surcharge</param>
360+
/// <param name="reasonCode">Optional reason code for the surcharge</param>
361361
public TradeLineItem AddTradeCharge(CurrencyCodes currency, decimal? basisAmount, decimal actualAmount,
362362
string reason, ChargeReasonCodes? reasonCode = null)
363363
{
@@ -474,12 +474,13 @@ public TradeLineItem AddSpecifiedTradeAllowance(CurrencyCodes currency, decimal?
474474

475475

476476
/// <summary>
477-
/// As an allowance or charge on total item price, attaching it to the corresponding item.
477+
/// Adds a charge on total item price, attaching it to the corresponding item.
478478
/// </summary>
479-
/// <param name="currency">Currency of the allowance or surcharge</param>
480-
/// <param name="basisAmount">Basis aount for the allowance or surcharge, typicalls the net amount of the item</param>
481-
/// <param name="actualAmount">The actual allowance or surcharge amount</param>
482-
/// <param name="reason">Reason for the allowance or surcharge</param>
479+
/// <param name="currency">Currency of the surcharge</param>
480+
/// <param name="basisAmount">Basis aount for the surcharge, typicalls the net amount of the item</param>
481+
/// <param name="actualAmount">The actual surcharge amount</param>
482+
/// <param name="reason">Reason for the surcharge</param>
483+
/// <param name="reasonCode">Optional reason code for the surcharge</param>
483484
public TradeLineItem AddSpecifiedTradeCharge(CurrencyCodes currency, decimal? basisAmount, decimal actualAmount,
484485
string reason,
485486
ChargeReasonCodes? reasonCode = null)
@@ -497,13 +498,14 @@ public TradeLineItem AddSpecifiedTradeCharge(CurrencyCodes currency, decimal? ba
497498

498499

499500
/// <summary>
500-
/// As an allowance or charge on total item price, attaching it to the corresponding item.
501+
/// Adds an allowance on total item price, attaching it to the corresponding item.
501502
/// </summary>
502-
/// <param name="currency">Currency of the allowance or surcharge</param>
503-
/// <param name="basisAmount">Basis aount for the allowance or surcharge, typicalls the net amount of the item</param>
504-
/// <param name="actualAmount">The actual allowance or surcharge amount</param>
505-
/// <param name="chargePercentage">Actual allowance or surcharge charge percentage</param>
506-
/// <param name="reason">Reason for the allowance or surcharge</param>
503+
/// <param name="currency">Currency of the allowance</param>
504+
/// <param name="basisAmount">Basis aount for the allowance, typicalls the net amount of the item</param>
505+
/// <param name="actualAmount">The actual allowance amount</param>
506+
/// <param name="chargePercentage">Actual allowance charge percentage</param>
507+
/// <param name="reason">Reason for the allowance</param>
508+
/// <param name="reasonCode">Optional reason code for the allowance</param>
507509
public TradeLineItem AddSpecifiedTradeAllowance(CurrencyCodes currency, decimal? basisAmount, decimal actualAmount,
508510
decimal? chargePercentage, string reason,
509511
AllowanceReasonCodes? reasonCode = null)
@@ -522,13 +524,14 @@ public TradeLineItem AddSpecifiedTradeAllowance(CurrencyCodes currency, decimal?
522524

523525

524526
/// <summary>
525-
/// As an allowance or charge on total item price, attaching it to the corresponding item.
527+
/// Adds a charge on total item price, attaching it to the corresponding item.
526528
/// </summary>
527-
/// <param name="currency">Currency of the allowance or surcharge</param>
528-
/// <param name="basisAmount">Basis aount for the allowance or surcharge, typicalls the net amount of the item</param>
529-
/// <param name="actualAmount">The actual allowance or surcharge amount</param>
530-
/// <param name="chargePercentage">Actual allowance or surcharge charge percentage</param>
531-
/// <param name="reason">Reason for the allowance or surcharge</param>
529+
/// <param name="currency">Currency of the surcharge</param>
530+
/// <param name="basisAmount">Basis aount for the surcharge, typicalls the net amount of the item</param>
531+
/// <param name="actualAmount">The actual surcharge amount</param>
532+
/// <param name="chargePercentage">Actual surcharge charge percentage</param>
533+
/// <param name="reason">Reason for the surcharge</param>
534+
/// <param name="reasonCode">Optional reason code for the surcharge</param>
532535
public TradeLineItem AddSpecifiedTradeCharge(CurrencyCodes currency, decimal? basisAmount, decimal actualAmount,
533536
decimal? chargePercentage, string reason,
534537
ChargeReasonCodes? reasonCode = null)
@@ -730,6 +733,7 @@ public TradeLineItem SetContractReferencedDocument(string contractReferencedId,
730733
/// Please note that XRechnung/ FacturX allows a maximum of one such reference
731734
/// </summary>
732735
/// <param name="AccountID">The accounting reference identifier</param>
736+
/// <param name="AccountTypeCode">Type of the account - optional</param>
733737
public TradeLineItem AddReceivableSpecifiedTradeAccountingAccount(string AccountID, AccountingAccountTypeCodes? AccountTypeCode = null)
734738
{
735739
this.ReceivableSpecifiedTradeAccountingAccounts.Add(new ReceivableSpecifiedTradeAccountingAccount()

0 commit comments

Comments
 (0)