Skip to content

Commit

Permalink
Add contract value in section104 export
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpung committed Nov 10, 2023
1 parent b61c7b7 commit a20b744
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,16 @@ public static Section104History ShareAdjustment(DateTime date, decimal oldQuanti
public string PrintToTextFile()
{
StringBuilder output = new();
output.AppendLine($"{Date.ToShortDateString()}\t{OldQuantity + QuantityChange} ({QuantityChange.ToSignedNumberString()})\t\t\t" +
string contractValueString;
contractValueString = (OldContractValue.Amount, ContractValueChange.Amount) switch
{
(0, 0) => "",
(0, not 0) => $"{ContractValueChange} ({ContractValueChange.ToSignedNumberString()})",
(not 0, not 0) => $"{OldContractValue + ContractValueChange} ({ContractValueChange.ToSignedNumberString()})",
};
output.AppendLine($"{Date.ToShortDateString()}\t{OldQuantity + QuantityChange} ({QuantityChange.ToSignedNumberString()})\t\t\t\t" +
$"{OldValue + ValueChange} ({ValueChange.ToSignedNumberString()})\t\t\t" +
$"{OldContractValue + ContractValueChange} ({ContractValueChange.ToSignedNumberString()})");
contractValueString);
if (Explanation != string.Empty)
{
output.AppendLine($"{Explanation}");
Expand Down

0 comments on commit a20b744

Please sign in to comment.