@@ -36,6 +36,7 @@ namespace lg2de.SimpleAccounting.Presentation
3636 "Major Code Smell" ,
3737 "S4055:Literals should not be passed as localized parameters" ,
3838 Justification = "pending translation" ) ]
39+ [ SuppressMessage ( "ReSharper" , "LocalizableElement" ) ]
3940 internal class ShellViewModel : Conductor < IScreen > , IDisposable
4041 {
4142 private const string GithubDomain = "github.com" ;
@@ -215,40 +216,42 @@ public AccountJournalViewModel SelectedAccountJournalEntry
215216 public ICommand TotalJournalReportCommand => new RelayCommand (
216217 _ =>
217218 {
218- var report = new TotalJournalReport (
219+ var report = this . reportFactory . CreateTotalJournal (
219220 this . currentModelJournal ,
220221 this . accountingData . Setup ,
221222 CultureInfo . CurrentUICulture ) ;
222- report . CreateReport ( ) ;
223- report . ShowPreview ( "Journal" ) ;
223+ const string title = "Journal" ;
224+ report . CreateReport ( title ) ;
225+ report . ShowPreview ( title ) ;
224226 } ,
225227 _ => this . FullJournal . Any ( ) ) ;
226228
227229 public ICommand AccountJournalReportCommand => new RelayCommand (
228230 _ =>
229231 {
230232 var report = this . reportFactory . CreateAccountJournal (
231- this . accountingData . Accounts . SelectMany ( a => a . Account ) ,
232233 this . currentModelJournal ,
233- this . accountingData . Setup ,
234- CultureInfo . CurrentUICulture ) ;
234+ this . accountingData . Accounts . SelectMany ( a => a . Account ) ,
235+ this . accountingData . Setup , CultureInfo . CurrentUICulture ) ;
235236 report . PageBreakBetweenAccounts =
236237 this . accountingData . Setup ? . Reports ? . AccountJournalReport ? . PageBreakBetweenAccounts ?? false ;
237- report . CreateReport ( ) ;
238- report . ShowPreview ( "Kontoblätter" ) ;
238+ const string title = "Kontoblätter" ;
239+ report . CreateReport ( title ) ;
240+ report . ShowPreview ( title ) ;
239241 } ,
240242 _ => this . FullJournal . Any ( ) ) ;
241243
242244 public ICommand TotalsAndBalancesReportCommand => new RelayCommand (
243245 _ =>
244246 {
245- var report = new TotalsAndBalancesReport (
247+ var report = this . reportFactory . CreateTotalsAndBalances (
246248 this . currentModelJournal ,
247249 this . accountingData . Accounts ,
248250 this . accountingData . Setup ,
249251 CultureInfo . CurrentUICulture ) ;
250- report . CreateReport ( ) ;
251- report . ShowPreview ( "Summen und Salden" ) ;
252+ const string title = "Summen und Salden" ;
253+ report . CreateReport ( title ) ;
254+ report . ShowPreview ( title ) ;
252255 } ,
253256 _ => this . FullJournal . Any ( ) ) ;
254257
@@ -269,27 +272,29 @@ public AccountJournalViewModel SelectedAccountJournalEntry
269272 accountGroups . Add ( new AccountingDataAccountGroup { Name = group . Name , Account = assertAccounts } ) ;
270273 }
271274
272- var report = new TotalsAndBalancesReport (
275+ var report = this . reportFactory . CreateTotalsAndBalances (
273276 this . currentModelJournal ,
274277 accountGroups ,
275278 this . accountingData . Setup ,
276279 CultureInfo . CurrentUICulture ) ;
277- this . accountingData . Setup . Reports ? . TotalsAndBalancesReport ? . ForEach ( report . Signatures . Add ) ;
278- report . CreateReport ( ) ;
279- report . ShowPreview ( "Bestandskontosalden" ) ;
280+ this . accountingData . Setup ? . Reports ? . TotalsAndBalancesReport ? . ForEach ( report . Signatures . Add ) ;
281+ const string title = "Bestandskontosalden" ;
282+ report . CreateReport ( title ) ;
283+ report . ShowPreview ( title ) ;
280284 } ,
281285 _ => this . FullJournal . Any ( ) ) ;
282286
283287 public ICommand AnnualBalanceReportCommand => new RelayCommand (
284288 _ =>
285289 {
286- var report = new AnnualBalanceReport (
290+ var report = this . reportFactory . CreateAnnualBalance (
287291 this . currentModelJournal ,
288292 this . accountingData . AllAccounts ,
289293 this . accountingData . Setup ,
290294 CultureInfo . CurrentUICulture ) ;
291- report . CreateReport ( ) ;
292- report . ShowPreview ( "Jahresbilanz" ) ;
295+ const string title = "Jahresbilanz" ;
296+ report . CreateReport ( title ) ;
297+ report . ShowPreview ( title ) ;
293298 } ,
294299 _ => this . FullJournal . Any ( ) ) ;
295300
@@ -645,6 +650,12 @@ internal async void OnCheckForUpdate(object _)
645650
646651 var stream = this . GetType ( ) . Assembly . GetManifestResourceStream (
647652 "lg2de.SimpleAccounting.UpdateApplication.ps1" ) ;
653+ if ( stream == null )
654+ {
655+ // script not found :(
656+ return ;
657+ }
658+
648659 using var reader = new StreamReader ( stream ) ;
649660 var script = reader . ReadToEnd ( ) ;
650661 string scriptPath = Path . Combine ( Path . GetTempPath ( ) , "UpdateApplication.ps1" ) ;
0 commit comments