1 /* ************************************************************************** */
2 /* */
3 /* gsb_data_report */
4 /* */
5 /* Copyright (C) 2000-2008 Cédric Auger (cedric@grisbi.org) */
6 /* 2003-2008 Benjamin Drieu (bdrieu@april.org) */
7 /* 2008-2013 Pierre Biava (grisbi@pierre.biava.name) */
8 /* https://www.grisbi.org/ */
9 /* */
10 /* This program is free software; you can redistribute it and/or modify */
11 /* it under the terms of the GNU General Public License as published by */
12 /* the Free Software Foundation; either version 2 of the License, or */
13 /* (at your option) any later version. */
14 /* */
15 /* This program is distributed in the hope that it will be useful, */
16 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
17 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
18 /* GNU General Public License for more details. */
19 /* */
20 /* You should have received a copy of the GNU General Public License */
21 /* along with this program; if not, write to the Free Software */
22 /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
23 /* */
24 /* ************************************************************************** */
25
26 /**
27 * \file gsb_data_report.c
28 * work with the report structure, no GUI here
29 */
30
31
32 #ifdef HAVE_CONFIG_H
33 #include "config.h"
34 #endif
35
36 #include "include.h"
37 #include <string.h>
38
39 /*START_INCLUDE*/
40 #include "gsb_data_report.h"
41 #include "gsb_data_archive.h"
42 #include "gsb_data_fyear.h"
43 #include "gsb_data_report_amout_comparison.h"
44 #include "gsb_data_report_text_comparison.h"
45 #include "utils_dates.h"
46 #include "utils_str.h"
47 #include "erreur.h"
48 /*END_INCLUDE*/
49
50 /** \ReportStruct
51 * describe an report
52 * */
53 typedef struct _ReportStruct ReportStruct;
54
55 struct _ReportStruct {
56 /** @name general stuff */
57 gint report_number;
58 gchar *report_name;
59 gboolean compl_name_used; /* TRUE si utilisation d'un complément au nom du rapport */
60 gint compl_name_function; /* Date ou Date + heure système */
61 gint compl_name_position; /* Devant, derrière ou dessous le nom du rapport */
62 gchar *export_pdf_name; /* Nom du fichier pour l'export pdf */
63 gboolean search_report; /* type recherche à ne pas sauvegarder */
64
65 /** @name what we show of the transactions */
66 gint show_m; /**< 0=all the reports, 1=report not marked R, 2=report marked P,R or T */
67 gint show_p; /**< 0=report not marked P, 1=report marked P */
68 gint show_r; /**< 0=report not marked R, 1=report marked R */
69 gint show_t; /**< 0=report not marked T, 1=report marked T */
70 gint show_report_transactions;
71 gint show_report_transaction_amount;
72 gint show_report_date;
73 gint show_report_value_date;
74 gint show_report_payee;
75 gint show_report_category;
76 gint show_report_sub_category;
77 gint show_report_budget;
78 gint show_report_sub_budget;
79 gint show_report_note;
80 gint show_report_voucher;
81 gint show_report_bank_references;
82 gint show_report_transaction_number;
83 gint show_report_method_of_payment;
84 gint show_report_method_of_payment_content;
85 gint show_report_marked;
86 gint show_report_financial_year;
87
88 /** @name stuff showed in the report */
89 gint sorting_report; /**< 0=date, 1=tr number, 2=payee, 3=categ, 4=budget, 5=notes, 6=method payment, 7=method paym content, 8=voucher, 9=bank ref, 10=marked number */
90
91 gint not_detail_split; /* TRUE = ne pas détailler les opérations ventilées (onglet divers) */
92 gint split_credit_debit;
93
94 gint currency_general;
95 gint column_title_show;
96 gint column_title_type; /* 0 = botton, 1 = each section */
97 gint append_in_payee; /* TRUE : the name of the report will be in the payee list */
98 gint report_can_click; /* TRUE : we can click on the reports */
99 gint ignore_archives; /* TRUE ignore les opérations archivées choix manuel */
100
101
102 /** @name period part of the report */
103 /** exercices */
104 gint use_financial_year; /* TRUE : use the financial year, FALSE : use the dates */
105 gint financial_year_type; /* 0=all, 1=current, 2=last, 3=personnal */
106 GSList *financial_year_list; /* list of the numbers of financials years used */
107 gint financial_year_split; /* TRUE : split by financial year */
108
109 /** dates */
110 gint date_type; /* 0=all, 1=perso ... */
111 gint date_select_value; /* 0=date (default), 1=value date */
112 GDate *personal_date_start;
113 GDate *personal_date_end;
114
115 /** affichage */
116 gint period_split; /* TRUE : split by period */
117 gint period_split_type; /* 0=day, 1=week, 2=month, 3=year */
118 gint period_split_day; /* 0 = monday ... */
119
120 /** à compléter */
121 GSList *sorting_type; /* list of numbers : 1=categ,2=sub-categ,3=budget,4=sub-budget,5=account,6=payee */
122
123 /** @name account part of the report */
124 gint account_use_chosen;
125 GSList *account_numbers;
126 gint account_group_reports;
127 gint account_show_amount;
128 gint account_show_name;
129
130 /** @name transfer part of the report */
131 gint transfer_choice; /* 0: no transfer / 1: transfers only on liabilities and assets accounts/2:transfer outside the report/3:perso */
132 GSList *transfer_account_numbers;
133 gint transfer_reports_only;
134
135 /** @name category part of the report */
136 gint category_used; /* TRUE = Regrouper les opérations par catégorie */
137 gint category_detail_used; /* TRUE = Détailler les catégories utilisées (onglet Catégories) */
138 GSList *categ_select_struct; /* list of CategBudgetSel containing the selected categories and sub-categories */
139 gint category_show_sub_category;
140 gint category_show_category_amount;
141 gint category_show_sub_category_amount;
142 gint category_currency;
143 gint category_show_without_category;
144 gint category_show_name;
145
146 /** @name budget part of the report */
147 gint budget_used;
148 gint budget_detail_used;
149 GSList *budget_select_struct; /* list of CategBudgetSel containing the selected budgets and sub-budgets */
150 gint budget_show_sub_budget;
151 gint budget_show_budget_amount;
152 gint budget_show_sub_budget_amount;
153 gint budget_currency;
154 gint budget_show_without_budget;
155 gint budget_show_name;
156
157 /** @name payee part of the report */
158 gint payee_used;
159 gint payee_detail_used;
160 GSList *payee_numbers;
161 gint payee_show_payee_amount;
162 gint payee_currency;
163 gint payee_show_name;
164
165 /** @name text comparison part of the report */
166 gint text_comparison_used;
167 GSList *text_comparison_list;
168
169 /** @name amount comparison part of the report */
170 gint amount_comparison_used;
171 gint amount_comparison_currency;
172 GSList *amount_comparison_list;
173 gint amount_comparison_only_report_non_null;
174
175 /** @name method of payment part of the report */
176 gint method_of_payment_used;
177 GSList *method_of_payment_list;
178 };
179
180
181
182 /*START_STATIC*/
183 static void _gsb_data_report_free ( ReportStruct *report );
184 static GSList *gsb_data_report_copy_categ_budget_struct (GSList *orig_categ_budget_list);
185 static ReportStruct *gsb_data_report_get_structure ( gint report_number );
186 /*END_STATIC*/
187
188 /*START_EXTERN*/
189 /*END_EXTERN*/
190
191
192
193 /** contains a g_slist of ReportStruct */
194 static GSList *report_list = NULL;
195
196 /** a pointers to the last report used (to increase the speed) */
197 static ReportStruct *report_buffer;
198
199
200
201
202 /**
203 * set the reports global variables to NULL, usually when we init all the global variables
204 *
205 * \param none
206 *
207 * \return FALSE
208 * */
gsb_data_report_init_variables(void)209 gboolean gsb_data_report_init_variables ( void )
210 {
211 /* free memory used by report_list */
212 if ( report_list )
213 {
214 GSList* tmp_list = report_list;
215 while ( tmp_list )
216 {
217 ReportStruct *report = tmp_list -> data;
218 tmp_list = tmp_list -> next;
219 _gsb_data_report_free ( report );
220 }
221 }
222 g_slist_free ( report_list );
223 report_list = NULL;
224 return FALSE;
225 }
226
227
228 /**
229 * return a pointer on the g_slist of reports
230 * carrefull : it's not a copy, so we must not free or change it
231 *
232 * \param none
233 *
234 * \return a g_slist on the reports
235 * */
gsb_data_report_get_report_list(void)236 GSList *gsb_data_report_get_report_list ( void )
237 {
238 return report_list;
239 }
240
241
242
243
244 /**
245 * return a pointer on the report which the number is in the parameter.
246 * that report is stored in the buffer
247 *
248 * \param report_number
249 *
250 * \return a pointer to the report, NULL if not found
251 * */
gsb_data_report_get_structure(gint report_number)252 ReportStruct *gsb_data_report_get_structure ( gint report_number )
253 {
254 GSList *tmp_list;
255
256 /* check first if the report is in the buffer */
257
258 if ( report_buffer
259 &&
260 report_buffer -> report_number == report_number )
261 return (gpointer) report_buffer;
262
263 tmp_list = report_list;
264
265 while ( tmp_list )
266 {
267 ReportStruct *report;
268
269 report = tmp_list -> data;
270
271 if ( report -> report_number == report_number )
272 {
273 report_buffer = report;
274 return report;
275 }
276
277 tmp_list = tmp_list -> next;
278 }
279
280 /* here, we didn't find any report with that number */
281
282 return NULL;
283 }
284
285
286
287 /**
288 * get the number of the report and save the pointer in the buffer
289 * which will increase the speed later
290 *
291 * \param report_pointer a pointer to a report
292 *
293 * \return the number of the report
294 * */
gsb_data_report_get_report_number(gpointer report_pointer)295 gint gsb_data_report_get_report_number ( gpointer report_pointer )
296 {
297 ReportStruct *report;
298
299 report = report_pointer;
300
301 if ( !report )
302 return 0;
303
304 /* if we want the report number, usually it's to make other stuff after that
305 * so we will save the adr of the report to increase the speed after */
306
307 report_buffer = report;
308
309 return report -> report_number;
310 }
311
312
313 /** find and return the last number of report
314 *
315 * \param none
316 *
317 * \return last number of report
318 * */
gsb_data_report_max_number(void)319 gint gsb_data_report_max_number ( void )
320 {
321 GSList *tmp;
322 gint number_tmp = 0;
323
324 tmp = report_list;
325
326 while ( tmp )
327 {
328 ReportStruct *report;
329
330 report = tmp -> data;
331
332 if ( report -> report_number > number_tmp )
333 number_tmp = report -> report_number;
334
335 tmp = tmp -> next;
336 }
337 return number_tmp;
338 }
339
340
341
342 /**
343 * create a new report, give it a number, append it to the list
344 * and return the number
345 *
346 * \param name the name of the report (can be freed after, it's a copy) or NULL
347 *
348 * \return the number of the new report
349 * */
gsb_data_report_new(const gchar * name)350 gint gsb_data_report_new (const gchar *name)
351 {
352 gint report_number;
353
354 /* create the new report with a new number */
355
356 report_number = gsb_data_report_new_with_number ( gsb_data_report_max_number () + 1 );
357
358 /* append the name if necessary */
359
360 if (name)
361 gsb_data_report_set_report_name ( report_number,
362 name );
363
364 return report_number;
365 }
366
367
368 /**
369 * create a new report with a number, append it to the list
370 * and return the number
371 *
372 * \param number the number we want to give to that report
373 *
374 * \return the number of the new report
375 * */
gsb_data_report_new_with_number(gint number)376 gint gsb_data_report_new_with_number ( gint number )
377 {
378 ReportStruct *report;
379
380 report = g_malloc0 ( sizeof ( ReportStruct ));
381 report -> report_number = number;
382
383 report_list = g_slist_append ( report_list,
384 report );
385
386 report_buffer = report;
387
388 return report -> report_number;
389 }
390
391 /**
392 * This internal function is called to free the memory used by a ReportStruct structure
393 */
_gsb_data_report_free(ReportStruct * report)394 static void _gsb_data_report_free ( ReportStruct *report )
395 {
396 GSList* list_tmp;
397
398 if ( ! report )
399 return ;
400
401 /* remove first the comparison */
402 list_tmp = report -> text_comparison_list;
403 while ( list_tmp )
404 {
405 gsb_data_report_text_comparison_remove ( GPOINTER_TO_INT (list_tmp -> data));
406 list_tmp = list_tmp -> next;
407 }
408 g_slist_free (report->text_comparison_list);
409
410 list_tmp = report -> amount_comparison_list;
411 while ( list_tmp )
412 {
413 gsb_data_report_amount_comparison_remove ( GPOINTER_TO_INT (list_tmp -> data));
414 list_tmp = list_tmp -> next;
415 }
416 g_slist_free (report->amount_comparison_list);
417
418 g_slist_free (report -> financial_year_list);
419 g_slist_free (report -> sorting_type);
420 g_slist_free (report -> account_numbers);
421 g_slist_free (report -> transfer_account_numbers);
422 gsb_data_report_free_categ_budget_struct_list (report -> categ_select_struct);
423 report -> categ_select_struct = NULL;
424 gsb_data_report_free_categ_budget_struct_list (report -> budget_select_struct);
425 report -> budget_select_struct = NULL;
426 g_slist_free (report -> payee_numbers);
427 g_slist_free (report -> method_of_payment_list);
428
429 if ( report -> report_name )
430 g_free ( report -> report_name );
431 if ( report->export_pdf_name)
432 g_free ( report->export_pdf_name);
433 if ( report -> personal_date_start )
434 g_date_free ( report -> personal_date_start );
435 if ( report -> personal_date_end )
436 g_date_free ( report -> personal_date_end );
437
438 g_free (report);
439 if ( report_buffer == report )
440 report_buffer = NULL;
441 }
442
443 /**
444 * remove a report
445 *
446 * \param no_report the report we want to remove
447 *
448 * \return TRUE ok
449 * */
gsb_data_report_remove(gint no_report)450 gboolean gsb_data_report_remove ( gint no_report )
451 {
452 ReportStruct *report;
453 report = gsb_data_report_get_structure ( no_report );
454
455 if (!report)
456 return FALSE;
457
458 report_list = g_slist_remove ( report_list,
459 report );
460
461 _gsb_data_report_free ( report );
462 return TRUE;
463 }
464
465
466 /**
467 * return the number of the report found by its name
468 * that report is stored in the buffer
469 *
470 * \param name
471 *
472 * \return the number of the report or 0 if not found
473 * */
gsb_data_report_get_report_by_name(const gchar * name)474 gint gsb_data_report_get_report_by_name ( const gchar *name )
475 {
476 GSList *tmp_list;
477
478 if (!name)
479 return 0;
480
481 /* check first if the report is in the buffer */
482 if ( report_buffer
483 &&
484 !strcmp ( report_buffer -> report_name,
485 name ))
486 return report_buffer -> report_number;
487
488 tmp_list = report_list;
489
490 while ( tmp_list )
491 {
492 ReportStruct *report;
493
494 report = tmp_list -> data;
495
496 if ( !strcmp ( report -> report_name,
497 name ))
498 {
499 report_buffer = report;
500 return report -> report_number;
501 }
502 tmp_list = tmp_list -> next;
503 }
504 /* here, we didn't find any report with that name */
505 return 0;
506 }
507
508
509 /**
510 * get the report_name
511 *
512 * \param report_number the number of the report
513 *
514 * \return the report_name of the report, -1 if problem
515 * */
gsb_data_report_get_report_name(gint report_number)516 gchar *gsb_data_report_get_report_name ( gint report_number )
517 {
518 ReportStruct *report;
519
520 report = gsb_data_report_get_structure (report_number);
521
522 if ( !report )
523 return NULL;
524
525 return report -> report_name;
526 }
527
528 /**
529 * set the report_name
530 *
531 * \param report_number number of the report
532 * \param report_name
533 *
534 * \return TRUE if ok
535 * */
gsb_data_report_set_report_name(gint report_number,const gchar * report_name)536 gboolean gsb_data_report_set_report_name ( gint report_number,
537 const gchar *report_name )
538 {
539 ReportStruct *report;
540
541 report = gsb_data_report_get_structure (report_number);
542
543 if ( !report )
544 return FALSE;
545
546 if (report_name)
547 report -> report_name = my_strdup (report_name);
548 else
549 report -> report_name = NULL;
550
551 return TRUE;
552 }
553
554
555 /**
556 * get the show_report_transactions
557 *
558 * \param report_number the number of the report
559 *
560 * \return the show_report_transactions of the report, -1 if problem
561 * */
gsb_data_report_get_show_report_transactions(gint report_number)562 gint gsb_data_report_get_show_report_transactions ( gint report_number )
563 {
564 ReportStruct *report;
565
566 report = gsb_data_report_get_structure (report_number);
567
568 if ( !report )
569 return -1;
570
571 return report -> show_report_transactions;
572 }
573
574 /**
575 * set the show_report_transactions
576 *
577 * \param report_number number of the report
578 * \param show_report_transactions
579 *
580 * \return TRUE if ok
581 * */
gsb_data_report_set_show_report_transactions(gint report_number,gint show_report_transactions)582 gboolean gsb_data_report_set_show_report_transactions ( gint report_number,
583 gint show_report_transactions )
584 {
585 ReportStruct *report;
586
587 report = gsb_data_report_get_structure (report_number);
588
589 if ( !report )
590 return FALSE;
591
592 report -> show_report_transactions = show_report_transactions;
593
594 return TRUE;
595 }
596
597
598 /**
599 * get the show_report_transaction_amount
600 *
601 * \param report_number the number of the report
602 *
603 * \return the show_report_transaction_amount of the report, -1 if problem
604 * */
gsb_data_report_get_show_report_transaction_amount(gint report_number)605 gint gsb_data_report_get_show_report_transaction_amount ( gint report_number )
606 {
607 ReportStruct *report;
608
609 report = gsb_data_report_get_structure (report_number);
610
611 if ( !report )
612 return -1;
613
614 return report -> show_report_transaction_amount;
615 }
616
617 /**
618 * set the show_report_transaction_amount
619 *
620 * \param report_number number of the report
621 * \param show_report_transaction_amount
622 *
623 * \return TRUE if ok
624 * */
gsb_data_report_set_show_report_transaction_amount(gint report_number,gint show_report_transaction_amount)625 gboolean gsb_data_report_set_show_report_transaction_amount ( gint report_number,
626 gint show_report_transaction_amount )
627 {
628 ReportStruct *report;
629
630 report = gsb_data_report_get_structure (report_number);
631
632 if ( !report )
633 return FALSE;
634
635 report -> show_report_transaction_amount = show_report_transaction_amount;
636
637 return TRUE;
638 }
639
640
641 /**
642 * get the show_report_date
643 *
644 * \param report_number the number of the report
645 *
646 * \return the show_report_date of the report, -1 if problem
647 * */
gsb_data_report_get_show_report_date(gint report_number)648 gint gsb_data_report_get_show_report_date ( gint report_number )
649 {
650 ReportStruct *report;
651
652 report = gsb_data_report_get_structure (report_number);
653
654 if ( !report )
655 return -1;
656
657 return report -> show_report_date;
658 }
659
660 /**
661 * set the show_report_date
662 *
663 * \param report_number number of the report
664 * \param show_report_date
665 *
666 * \return TRUE if ok
667 * */
gsb_data_report_set_show_report_date(gint report_number,gint show_report_date)668 gboolean gsb_data_report_set_show_report_date ( gint report_number,
669 gint show_report_date )
670 {
671 ReportStruct *report;
672
673 report = gsb_data_report_get_structure (report_number);
674
675 if ( !report )
676 return FALSE;
677
678 report -> show_report_date = show_report_date;
679
680 return TRUE;
681 }
682
683 /**
684 * get the show_report_value_date
685 *
686 * \param report_number the number of the report
687 *
688 * \return the show_report_value_date of the report, -1 if problem
689 * */
gsb_data_report_get_show_report_value_date(gint report_number)690 gint gsb_data_report_get_show_report_value_date ( gint report_number )
691 {
692 ReportStruct *report;
693
694 report = gsb_data_report_get_structure (report_number);
695
696 if ( !report )
697 return -1;
698
699 return report -> show_report_value_date;
700 }
701
702 /**
703 * set the show_report_value_date
704 *
705 * \param report_number number of the report
706 * \param show_report_value_date
707 *
708 * \return TRUE if ok
709 * */
gsb_data_report_set_show_report_value_date(gint report_number,gint show_report_value_date)710 gboolean gsb_data_report_set_show_report_value_date ( gint report_number,
711 gint show_report_value_date )
712 {
713 ReportStruct *report;
714
715 report = gsb_data_report_get_structure (report_number);
716
717 if ( !report )
718 return FALSE;
719
720 report -> show_report_value_date = show_report_value_date;
721
722 return TRUE;
723 }
724
725
726 /**
727 * get the show_report_payee
728 *
729 * \param report_number the number of the report
730 *
731 * \return the show_report_payee of the report, -1 if problem
732 * */
gsb_data_report_get_show_report_payee(gint report_number)733 gint gsb_data_report_get_show_report_payee ( gint report_number )
734 {
735 ReportStruct *report;
736
737 report = gsb_data_report_get_structure (report_number);
738
739 if ( !report )
740 return -1;
741
742 return report -> show_report_payee;
743 }
744
745 /**
746 * set the show_report_payee
747 *
748 * \param report_number number of the report
749 * \param show_report_payee
750 *
751 * \return TRUE if ok
752 * */
gsb_data_report_set_show_report_payee(gint report_number,gint show_report_payee)753 gboolean gsb_data_report_set_show_report_payee ( gint report_number,
754 gint show_report_payee )
755 {
756 ReportStruct *report;
757
758 report = gsb_data_report_get_structure (report_number);
759
760 if ( !report )
761 return FALSE;
762
763 report -> show_report_payee = show_report_payee;
764
765 return TRUE;
766 }
767
768
769 /**
770 * get the show_report_category
771 *
772 * \param report_number the number of the report
773 *
774 * \return the show_report_category of the report, -1 if problem
775 * */
gsb_data_report_get_show_report_category(gint report_number)776 gint gsb_data_report_get_show_report_category ( gint report_number )
777 {
778 ReportStruct *report;
779
780 report = gsb_data_report_get_structure (report_number);
781
782 if ( !report )
783 return -1;
784
785 return report -> show_report_category;
786 }
787
788 /**
789 * set the show_report_category
790 *
791 * \param report_number number of the report
792 * \param show_report_category
793 *
794 * \return TRUE if ok
795 * */
gsb_data_report_set_show_report_category(gint report_number,gint show_report_category)796 gboolean gsb_data_report_set_show_report_category ( gint report_number,
797 gint show_report_category )
798 {
799 ReportStruct *report;
800
801 report = gsb_data_report_get_structure (report_number);
802
803 if ( !report )
804 return FALSE;
805
806 report -> show_report_category = show_report_category;
807
808 return TRUE;
809 }
810
811
812 /**
813 * get the show_report_sub_category
814 *
815 * \param report_number the number of the report
816 *
817 * \return the show_report_sub_category of the report, -1 if problem
818 * */
gsb_data_report_get_show_report_sub_category(gint report_number)819 gint gsb_data_report_get_show_report_sub_category ( gint report_number )
820 {
821 ReportStruct *report;
822
823 report = gsb_data_report_get_structure (report_number);
824
825 if ( !report )
826 return -1;
827
828 return report -> show_report_sub_category;
829 }
830
831 /**
832 * set the show_report_sub_category
833 *
834 * \param report_number number of the report
835 * \param show_report_sub_category
836 *
837 * \return TRUE if ok
838 * */
gsb_data_report_set_show_report_sub_category(gint report_number,gint show_report_sub_category)839 gboolean gsb_data_report_set_show_report_sub_category ( gint report_number,
840 gint show_report_sub_category )
841 {
842 ReportStruct *report;
843
844 report = gsb_data_report_get_structure (report_number);
845
846 if ( !report )
847 return FALSE;
848
849 report -> show_report_sub_category = show_report_sub_category;
850
851 return TRUE;
852 }
853
854
855 /**
856 * get the show_report_budget
857 *
858 * \param report_number the number of the report
859 *
860 * \return the show_report_budget of the report, -1 if problem
861 * */
gsb_data_report_get_show_report_budget(gint report_number)862 gint gsb_data_report_get_show_report_budget ( gint report_number )
863 {
864 ReportStruct *report;
865
866 report = gsb_data_report_get_structure (report_number);
867
868 if ( !report )
869 return -1;
870
871 return report -> show_report_budget;
872 }
873
874 /**
875 * set the show_report_budget
876 *
877 * \param report_number number of the report
878 * \param show_report_budget
879 *
880 * \return TRUE if ok
881 * */
gsb_data_report_set_show_report_budget(gint report_number,gint show_report_budget)882 gboolean gsb_data_report_set_show_report_budget ( gint report_number,
883 gint show_report_budget )
884 {
885 ReportStruct *report;
886
887 report = gsb_data_report_get_structure (report_number);
888
889 if ( !report )
890 return FALSE;
891
892 report -> show_report_budget = show_report_budget;
893
894 return TRUE;
895 }
896
897
898 /**
899 * get the show_report_sub_budget
900 *
901 * \param report_number the number of the report
902 *
903 * \return the show_report_sub_budget of the report, -1 if problem
904 * */
gsb_data_report_get_show_report_sub_budget(gint report_number)905 gint gsb_data_report_get_show_report_sub_budget ( gint report_number )
906 {
907 ReportStruct *report;
908
909 report = gsb_data_report_get_structure (report_number);
910
911 if ( !report )
912 return -1;
913
914 return report -> show_report_sub_budget;
915 }
916
917 /**
918 * set the show_report_sub_budget
919 *
920 * \param report_number number of the report
921 * \param show_report_sub_budget
922 *
923 * \return TRUE if ok
924 * */
gsb_data_report_set_show_report_sub_budget(gint report_number,gint show_report_sub_budget)925 gboolean gsb_data_report_set_show_report_sub_budget ( gint report_number,
926 gint show_report_sub_budget )
927 {
928 ReportStruct *report;
929
930 report = gsb_data_report_get_structure (report_number);
931
932 if ( !report )
933 return FALSE;
934
935 report -> show_report_sub_budget = show_report_sub_budget;
936
937 return TRUE;
938 }
939
940
941 /**
942 * get the show_report_note
943 *
944 * \param report_number the number of the report
945 *
946 * \return the show_report_note of the report, -1 if problem
947 * */
gsb_data_report_get_show_report_note(gint report_number)948 gint gsb_data_report_get_show_report_note ( gint report_number )
949 {
950 ReportStruct *report;
951
952 report = gsb_data_report_get_structure (report_number);
953
954 if ( !report )
955 return -1;
956
957 return report -> show_report_note;
958 }
959
960 /**
961 * set the show_report_note
962 *
963 * \param report_number number of the report
964 * \param show_report_note
965 *
966 * \return TRUE if ok
967 * */
gsb_data_report_set_show_report_note(gint report_number,gint show_report_note)968 gboolean gsb_data_report_set_show_report_note ( gint report_number,
969 gint show_report_note )
970 {
971 ReportStruct *report;
972
973 report = gsb_data_report_get_structure (report_number);
974
975 if ( !report )
976 return FALSE;
977
978 report -> show_report_note = show_report_note;
979
980 return TRUE;
981 }
982
983
984 /**
985 * get the show_report_voucher
986 *
987 * \param report_number the number of the report
988 *
989 * \return the show_report_voucher of the report, -1 if problem
990 * */
gsb_data_report_get_show_report_voucher(gint report_number)991 gint gsb_data_report_get_show_report_voucher ( gint report_number )
992 {
993 ReportStruct *report;
994
995 report = gsb_data_report_get_structure (report_number);
996
997 if ( !report )
998 return -1;
999
1000 return report -> show_report_voucher;
1001 }
1002
1003 /**
1004 * set the show_report_voucher
1005 *
1006 * \param report_number number of the report
1007 * \param show_report_voucher
1008 *
1009 * \return TRUE if ok
1010 * */
gsb_data_report_set_show_report_voucher(gint report_number,gint show_report_voucher)1011 gboolean gsb_data_report_set_show_report_voucher ( gint report_number,
1012 gint show_report_voucher )
1013 {
1014 ReportStruct *report;
1015
1016 report = gsb_data_report_get_structure (report_number);
1017
1018 if ( !report )
1019 return FALSE;
1020
1021 report -> show_report_voucher = show_report_voucher;
1022
1023 return TRUE;
1024 }
1025
1026
1027 /**
1028 * get the show_report_bank_references
1029 *
1030 * \param report_number the number of the report
1031 *
1032 * \return the show_report_bank_references of the report, -1 if problem
1033 * */
gsb_data_report_get_show_report_bank_references(gint report_number)1034 gint gsb_data_report_get_show_report_bank_references ( gint report_number )
1035 {
1036 ReportStruct *report;
1037
1038 report = gsb_data_report_get_structure (report_number);
1039
1040 if ( !report )
1041 return -1;
1042
1043 return report -> show_report_bank_references;
1044 }
1045
1046 /**
1047 * set the show_report_bank_references
1048 *
1049 * \param report_number number of the report
1050 * \param show_report_bank_references
1051 *
1052 * \return TRUE if ok
1053 * */
gsb_data_report_set_show_report_bank_references(gint report_number,gint show_report_bank_references)1054 gboolean gsb_data_report_set_show_report_bank_references ( gint report_number,
1055 gint show_report_bank_references )
1056 {
1057 ReportStruct *report;
1058
1059 report = gsb_data_report_get_structure (report_number);
1060
1061 if ( !report )
1062 return FALSE;
1063
1064 report -> show_report_bank_references = show_report_bank_references;
1065
1066 return TRUE;
1067 }
1068
1069
1070 /**
1071 * get the show_report_transaction_number
1072 *
1073 * \param report_number the number of the report
1074 *
1075 * \return the show_report_transaction_number of the report, -1 if problem
1076 * */
gsb_data_report_get_show_report_transaction_number(gint report_number)1077 gint gsb_data_report_get_show_report_transaction_number ( gint report_number )
1078 {
1079 ReportStruct *report;
1080
1081 report = gsb_data_report_get_structure (report_number);
1082
1083 if ( !report )
1084 return -1;
1085
1086 return report -> show_report_transaction_number;
1087 }
1088
1089 /**
1090 * set the show_report_transaction_number
1091 *
1092 * \param report_number number of the report
1093 * \param show_report_transaction_number
1094 *
1095 * \return TRUE if ok
1096 * */
gsb_data_report_set_show_report_transaction_number(gint report_number,gint show_report_transaction_number)1097 gboolean gsb_data_report_set_show_report_transaction_number ( gint report_number,
1098 gint show_report_transaction_number )
1099 {
1100 ReportStruct *report;
1101
1102 report = gsb_data_report_get_structure (report_number);
1103
1104 if ( !report )
1105 return FALSE;
1106
1107 report -> show_report_transaction_number = show_report_transaction_number;
1108
1109 return TRUE;
1110 }
1111
1112
1113 /**
1114 * get the show_report_method_of_payment
1115 *
1116 * \param report_number the number of the report
1117 *
1118 * \return the show_report_method_of_payment of the report, -1 if problem
1119 * */
gsb_data_report_get_show_report_method_of_payment(gint report_number)1120 gint gsb_data_report_get_show_report_method_of_payment ( gint report_number )
1121 {
1122 ReportStruct *report;
1123
1124 report = gsb_data_report_get_structure (report_number);
1125
1126 if ( !report )
1127 return -1;
1128
1129 return report -> show_report_method_of_payment;
1130 }
1131
1132 /**
1133 * set the show_report_method_of_payment
1134 *
1135 * \param report_number number of the report
1136 * \param show_report_method_of_payment
1137 *
1138 * \return TRUE if ok
1139 * */
gsb_data_report_set_show_report_method_of_payment(gint report_number,gint show_report_method_of_payment)1140 gboolean gsb_data_report_set_show_report_method_of_payment ( gint report_number,
1141 gint show_report_method_of_payment )
1142 {
1143 ReportStruct *report;
1144
1145 report = gsb_data_report_get_structure (report_number);
1146
1147 if ( !report )
1148 return FALSE;
1149
1150 report -> show_report_method_of_payment = show_report_method_of_payment;
1151
1152 return TRUE;
1153 }
1154
1155
1156 /**
1157 * get the show_report_method_of_payment_content
1158 *
1159 * \param report_number the number of the report
1160 *
1161 * \return the show_report_method_of_payment_content of the report, -1 if problem
1162 * */
gsb_data_report_get_show_report_method_of_payment_content(gint report_number)1163 gint gsb_data_report_get_show_report_method_of_payment_content ( gint report_number )
1164 {
1165 ReportStruct *report;
1166
1167 report = gsb_data_report_get_structure (report_number);
1168
1169 if ( !report )
1170 return -1;
1171
1172 return report -> show_report_method_of_payment_content;
1173 }
1174
1175 /**
1176 * set the show_report_method_of_payment_content
1177 *
1178 * \param report_number number of the report
1179 * \param show_report_method_of_payment_content
1180 *
1181 * \return TRUE if ok
1182 * */
gsb_data_report_set_show_report_method_of_payment_content(gint report_number,gint show_report_method_of_payment_content)1183 gboolean gsb_data_report_set_show_report_method_of_payment_content ( gint report_number,
1184 gint show_report_method_of_payment_content )
1185 {
1186 ReportStruct *report;
1187
1188 report = gsb_data_report_get_structure (report_number);
1189
1190 if ( !report )
1191 return FALSE;
1192
1193 report -> show_report_method_of_payment_content = show_report_method_of_payment_content;
1194
1195 return TRUE;
1196 }
1197
1198
1199 /**
1200 * get the show_report_marked
1201 *
1202 * \param report_number the number of the report
1203 *
1204 * \return the show_report_marked of the report, -1 if problem
1205 * */
gsb_data_report_get_show_report_marked(gint report_number)1206 gint gsb_data_report_get_show_report_marked ( gint report_number )
1207 {
1208 ReportStruct *report;
1209
1210 report = gsb_data_report_get_structure (report_number);
1211
1212 if ( !report )
1213 return -1;
1214
1215 return report -> show_report_marked;
1216 }
1217
1218 /**
1219 * set the show_report_marked
1220 *
1221 * \param report_number number of the report
1222 * \param show_report_marked
1223 *
1224 * \return TRUE if ok
1225 * */
gsb_data_report_set_show_report_marked(gint report_number,gint show_report_marked)1226 gboolean gsb_data_report_set_show_report_marked ( gint report_number,
1227 gint show_report_marked )
1228 {
1229 ReportStruct *report;
1230
1231 report = gsb_data_report_get_structure (report_number);
1232
1233 if ( !report )
1234 return FALSE;
1235
1236 report -> show_report_marked = show_report_marked;
1237
1238 return TRUE;
1239 }
1240
1241
1242 /**
1243 * get the show_report_financial_year
1244 *
1245 * \param report_number the number of the report
1246 *
1247 * \return the show_report_financial_year of the report, -1 if problem
1248 * */
gsb_data_report_get_show_report_financial_year(gint report_number)1249 gint gsb_data_report_get_show_report_financial_year ( gint report_number )
1250 {
1251 ReportStruct *report;
1252
1253 report = gsb_data_report_get_structure (report_number);
1254
1255 if ( !report )
1256 return -1;
1257
1258 return report -> show_report_financial_year;
1259 }
1260
1261 /**
1262 * set the show_report_financial_year
1263 *
1264 * \param report_number number of the report
1265 * \param show_report_financial_year
1266 *
1267 * \return TRUE if ok
1268 * */
gsb_data_report_set_show_report_financial_year(gint report_number,gint show_report_financial_year)1269 gboolean gsb_data_report_set_show_report_financial_year ( gint report_number,
1270 gint show_report_financial_year )
1271 {
1272 ReportStruct *report;
1273
1274 report = gsb_data_report_get_structure (report_number);
1275
1276 if ( !report )
1277 return FALSE;
1278
1279 report -> show_report_financial_year = show_report_financial_year;
1280
1281 return TRUE;
1282 }
1283
1284
1285 /**
1286 * get the sorting_report
1287 *
1288 * \param report_number the number of the report
1289 *
1290 * \return the sorting_report of the report, -1 if problem
1291 * */
gsb_data_report_get_sorting_report(gint report_number)1292 gint gsb_data_report_get_sorting_report ( gint report_number )
1293 {
1294 ReportStruct *report;
1295
1296 report = gsb_data_report_get_structure (report_number);
1297
1298 if ( !report )
1299 return -1;
1300
1301 return report -> sorting_report;
1302 }
1303
1304 /**
1305 * set the sorting_report
1306 *
1307 * \param report_number number of the report
1308 * \param sorting_report
1309 *
1310 * \return TRUE if ok
1311 * */
gsb_data_report_set_sorting_report(gint report_number,gint sorting_report)1312 gboolean gsb_data_report_set_sorting_report ( gint report_number,
1313 gint sorting_report )
1314 {
1315 ReportStruct *report;
1316
1317 report = gsb_data_report_get_structure (report_number);
1318
1319 if ( !report )
1320 return FALSE;
1321
1322 report -> sorting_report = sorting_report;
1323
1324 return TRUE;
1325 }
1326
1327
1328 /**
1329 * get the not_detail_split
1330 *
1331 * \param report_number the number of the report
1332 *
1333 * \return the not_detail_split of the report, -1 if problem
1334 * */
gsb_data_report_get_not_detail_split(gint report_number)1335 gint gsb_data_report_get_not_detail_split ( gint report_number )
1336 {
1337 ReportStruct *report;
1338
1339 report = gsb_data_report_get_structure (report_number);
1340
1341 if ( !report )
1342 return -1;
1343
1344 return report -> not_detail_split;
1345 }
1346
1347 /**
1348 * set the not_detail_split
1349 *
1350 * \param report_number number of the report
1351 * \param not_detail_split
1352 *
1353 * \return TRUE if ok
1354 * */
gsb_data_report_set_not_detail_split(gint report_number,gint not_detail_split)1355 gboolean gsb_data_report_set_not_detail_split ( gint report_number,
1356 gint not_detail_split )
1357 {
1358 ReportStruct *report;
1359
1360 report = gsb_data_report_get_structure (report_number);
1361
1362 if ( !report )
1363 return FALSE;
1364
1365 report -> not_detail_split = not_detail_split;
1366
1367 return TRUE;
1368 }
1369
1370
1371 /**
1372 * get the split_credit_debit
1373 *
1374 * \param report_number the number of the report
1375 *
1376 * \return the split_credit_debit of the report, -1 if problem
1377 * */
gsb_data_report_get_split_credit_debit(gint report_number)1378 gint gsb_data_report_get_split_credit_debit ( gint report_number )
1379 {
1380 ReportStruct *report;
1381
1382 report = gsb_data_report_get_structure (report_number);
1383
1384 if ( !report )
1385 return -1;
1386
1387 return report -> split_credit_debit;
1388 }
1389
1390 /**
1391 * set the split_credit_debit
1392 *
1393 * \param report_number number of the report
1394 * \param split_credit_debit
1395 *
1396 * \return TRUE if ok
1397 * */
gsb_data_report_set_split_credit_debit(gint report_number,gint split_credit_debit)1398 gboolean gsb_data_report_set_split_credit_debit ( gint report_number,
1399 gint split_credit_debit )
1400 {
1401 ReportStruct *report;
1402
1403 report = gsb_data_report_get_structure (report_number);
1404
1405 if ( !report )
1406 return FALSE;
1407
1408 report -> split_credit_debit = split_credit_debit;
1409
1410 return TRUE;
1411 }
1412
1413
1414 /**
1415 * get the currency_general
1416 *
1417 * \param report_number the number of the report
1418 *
1419 * \return the currency_general of the report, -1 if problem
1420 * */
gsb_data_report_get_currency_general(gint report_number)1421 gint gsb_data_report_get_currency_general ( gint report_number )
1422 {
1423 ReportStruct *report;
1424
1425 report = gsb_data_report_get_structure (report_number);
1426
1427 if ( !report )
1428 return -1;
1429
1430 return report -> currency_general;
1431 }
1432
1433 /**
1434 * set the currency_general
1435 *
1436 * \param report_number number of the report
1437 * \param currency_general
1438 *
1439 * \return TRUE if ok
1440 * */
gsb_data_report_set_currency_general(gint report_number,gint currency_general)1441 gboolean gsb_data_report_set_currency_general ( gint report_number,
1442 gint currency_general )
1443 {
1444 ReportStruct *report;
1445
1446 report = gsb_data_report_get_structure (report_number);
1447
1448 if ( !report )
1449 return FALSE;
1450
1451 report -> currency_general = currency_general;
1452
1453 return TRUE;
1454 }
1455
1456
1457 /**
1458 * get the column_title_show
1459 *
1460 * \param report_number the number of the report
1461 *
1462 * \return the column_title_show of the report, -1 if problem
1463 * */
gsb_data_report_get_column_title_show(gint report_number)1464 gint gsb_data_report_get_column_title_show ( gint report_number )
1465 {
1466 ReportStruct *report;
1467
1468 report = gsb_data_report_get_structure (report_number);
1469
1470 if ( !report )
1471 return -1;
1472
1473 return report -> column_title_show;
1474 }
1475
1476 /**
1477 * set the column_title_show
1478 *
1479 * \param report_number number of the report
1480 * \param column_title_show
1481 *
1482 * \return TRUE if ok
1483 * */
gsb_data_report_set_column_title_show(gint report_number,gint column_title_show)1484 gboolean gsb_data_report_set_column_title_show ( gint report_number,
1485 gint column_title_show )
1486 {
1487 ReportStruct *report;
1488
1489 report = gsb_data_report_get_structure (report_number);
1490
1491 if ( !report )
1492 return FALSE;
1493
1494 report -> column_title_show = column_title_show;
1495
1496 return TRUE;
1497 }
1498
1499
1500 /**
1501 * get the column_title_type
1502 *
1503 * \param report_number the number of the report
1504 *
1505 * \return the column_title_type of the report, -1 if problem
1506 * */
gsb_data_report_get_column_title_type(gint report_number)1507 gint gsb_data_report_get_column_title_type ( gint report_number )
1508 {
1509 ReportStruct *report;
1510
1511 report = gsb_data_report_get_structure (report_number);
1512
1513 if ( !report )
1514 return -1;
1515
1516 return report -> column_title_type;
1517 }
1518
1519 /**
1520 * set the column_title_type
1521 *
1522 * \param report_number number of the report
1523 * \param column_title_type
1524 *
1525 * \return TRUE if ok
1526 * */
gsb_data_report_set_column_title_type(gint report_number,gint column_title_type)1527 gboolean gsb_data_report_set_column_title_type ( gint report_number,
1528 gint column_title_type )
1529 {
1530 ReportStruct *report;
1531
1532 report = gsb_data_report_get_structure (report_number);
1533
1534 if ( !report )
1535 return FALSE;
1536
1537 report -> column_title_type = column_title_type;
1538
1539 return TRUE;
1540 }
1541
1542
1543 /**
1544 * get the append_in_payee
1545 *
1546 * \param report_number the number of the report
1547 *
1548 * \return the append_in_payee of the report, -1 if problem
1549 * */
gsb_data_report_get_append_in_payee(gint report_number)1550 gint gsb_data_report_get_append_in_payee ( gint report_number )
1551 {
1552 ReportStruct *report;
1553
1554 report = gsb_data_report_get_structure (report_number);
1555
1556 if ( !report )
1557 return -1;
1558
1559 return report -> append_in_payee;
1560 }
1561
1562 /**
1563 * set the append_in_payee
1564 *
1565 * \param report_number number of the report
1566 * \param append_in_payee
1567 *
1568 * \return TRUE if ok
1569 * */
gsb_data_report_set_append_in_payee(gint report_number,gint append_in_payee)1570 gboolean gsb_data_report_set_append_in_payee ( gint report_number,
1571 gint append_in_payee )
1572 {
1573 ReportStruct *report;
1574
1575 report = gsb_data_report_get_structure (report_number);
1576
1577 if ( !report )
1578 return FALSE;
1579
1580 report -> append_in_payee = append_in_payee;
1581
1582 return TRUE;
1583 }
1584
1585
1586 /**
1587 * get the report_can_click
1588 *
1589 * \param report_number the number of the report
1590 *
1591 * \return the report_can_click of the report, -1 if problem
1592 * */
gsb_data_report_get_report_can_click(gint report_number)1593 gint gsb_data_report_get_report_can_click ( gint report_number )
1594 {
1595 ReportStruct *report;
1596
1597 report = gsb_data_report_get_structure (report_number);
1598
1599 if ( !report )
1600 return -1;
1601
1602 return report -> report_can_click;
1603 }
1604
1605 /**
1606 * set the report_can_click
1607 *
1608 * \param report_number number of the report
1609 * \param report_can_click
1610 *
1611 * \return TRUE if ok
1612 * */
gsb_data_report_set_report_can_click(gint report_number,gint report_can_click)1613 gboolean gsb_data_report_set_report_can_click ( gint report_number,
1614 gint report_can_click )
1615 {
1616 ReportStruct *report;
1617
1618 report = gsb_data_report_get_structure (report_number);
1619
1620 if ( !report )
1621 return FALSE;
1622
1623 report -> report_can_click = report_can_click;
1624
1625 return TRUE;
1626 }
1627
1628
1629 /**
1630 * get the use_financial_year
1631 *
1632 * \param report_number the number of the report
1633 *
1634 * \return the use_financial_year of the report, -1 if problem
1635 * */
gsb_data_report_get_use_financial_year(gint report_number)1636 gint gsb_data_report_get_use_financial_year ( gint report_number )
1637 {
1638 ReportStruct *report;
1639
1640 report = gsb_data_report_get_structure (report_number);
1641
1642 if ( !report )
1643 return -1;
1644
1645 return report -> use_financial_year;
1646 }
1647
1648 /**
1649 * set the use_financial_year
1650 *
1651 * \param report_number number of the report
1652 * \param use_financial_year
1653 *
1654 * \return TRUE if ok
1655 * */
gsb_data_report_set_use_financial_year(gint report_number,gint use_financial_year)1656 gboolean gsb_data_report_set_use_financial_year ( gint report_number,
1657 gint use_financial_year )
1658 {
1659 ReportStruct *report;
1660
1661 report = gsb_data_report_get_structure (report_number);
1662
1663 if ( !report )
1664 return FALSE;
1665
1666 report -> use_financial_year = use_financial_year;
1667
1668 return TRUE;
1669 }
1670
1671
1672 /**
1673 * get the financial_year_type
1674 *
1675 * \param report_number the number of the report
1676 *
1677 * \return the financial_year_type of the report, -1 if problem
1678 * */
gsb_data_report_get_financial_year_type(gint report_number)1679 gint gsb_data_report_get_financial_year_type ( gint report_number )
1680 {
1681 ReportStruct *report;
1682
1683 report = gsb_data_report_get_structure (report_number);
1684
1685 if ( !report )
1686 return -1;
1687
1688 return report -> financial_year_type;
1689 }
1690
1691 /**
1692 * set the financial_year_type
1693 *
1694 * \param report_number number of the report
1695 * \param financial_year_type
1696 *
1697 * \return TRUE if ok
1698 * */
gsb_data_report_set_financial_year_type(gint report_number,gint financial_year_type)1699 gboolean gsb_data_report_set_financial_year_type ( gint report_number,
1700 gint financial_year_type )
1701 {
1702 ReportStruct *report;
1703
1704 report = gsb_data_report_get_structure (report_number);
1705
1706 if ( !report )
1707 return FALSE;
1708
1709 report -> financial_year_type = financial_year_type;
1710
1711 return TRUE;
1712 }
1713
1714
1715 /**
1716 * get the financial_year_split
1717 *
1718 * \param report_number the number of the report
1719 *
1720 * \return the financial_year_split of the report, -1 if problem
1721 * */
gsb_data_report_get_financial_year_split(gint report_number)1722 gint gsb_data_report_get_financial_year_split ( gint report_number )
1723 {
1724 ReportStruct *report;
1725
1726 report = gsb_data_report_get_structure (report_number);
1727
1728 if ( !report )
1729 return -1;
1730
1731 return report -> financial_year_split;
1732 }
1733
1734 /**
1735 * set the financial_year_split
1736 *
1737 * \param report_number number of the report
1738 * \param financial_year_split
1739 *
1740 * \return TRUE if ok
1741 * */
gsb_data_report_set_financial_year_split(gint report_number,gint financial_year_split)1742 gboolean gsb_data_report_set_financial_year_split ( gint report_number,
1743 gint financial_year_split )
1744 {
1745 ReportStruct *report;
1746
1747 report = gsb_data_report_get_structure (report_number);
1748
1749 if ( !report )
1750 return FALSE;
1751
1752 report -> financial_year_split = financial_year_split;
1753
1754 return TRUE;
1755 }
1756
1757
1758 /**
1759 * get the date_type
1760 *
1761 * \param report_number the number of the report
1762 *
1763 * \return the date_type of the report, -1 if problem
1764 * */
gsb_data_report_get_date_type(gint report_number)1765 gint gsb_data_report_get_date_type ( gint report_number )
1766 {
1767 ReportStruct *report;
1768
1769 report = gsb_data_report_get_structure (report_number);
1770
1771 if ( !report )
1772 return -1;
1773
1774 return report -> date_type;
1775 }
1776
1777 /**
1778 * set the date_type
1779 *
1780 * \param report_number number of the report
1781 * \param date_type
1782 *
1783 * \return TRUE if ok
1784 * */
gsb_data_report_set_date_type(gint report_number,gint date_type)1785 gboolean gsb_data_report_set_date_type ( gint report_number,
1786 gint date_type )
1787 {
1788 ReportStruct *report;
1789
1790 report = gsb_data_report_get_structure (report_number);
1791
1792 if ( !report )
1793 return FALSE;
1794
1795 report -> date_type = date_type;
1796
1797 return TRUE;
1798 }
1799
1800
1801 /**
1802 * get the personal_date_start
1803 *
1804 * \param report_number the number of the report
1805 *
1806 * \return the personal_date_start of the report, -1 if problem
1807 * */
gsb_data_report_get_personal_date_start(gint report_number)1808 GDate *gsb_data_report_get_personal_date_start ( gint report_number )
1809 {
1810 ReportStruct *report;
1811
1812 report = gsb_data_report_get_structure (report_number);
1813
1814 if ( !report )
1815 return NULL;
1816
1817 return report -> personal_date_start;
1818 }
1819
1820 /**
1821 * set the personal_date_start
1822 *
1823 * \param report_number number of the report
1824 * \param personal_date_start
1825 *
1826 * \return TRUE if ok
1827 * */
gsb_data_report_set_personal_date_start(gint report_number,GDate * personal_date_start)1828 gboolean gsb_data_report_set_personal_date_start ( gint report_number,
1829 GDate *personal_date_start )
1830 {
1831 ReportStruct *report;
1832
1833 report = gsb_data_report_get_structure (report_number);
1834
1835 if ( !report )
1836 return FALSE;
1837
1838 report -> personal_date_start = personal_date_start;
1839
1840 return TRUE;
1841 }
1842
1843 /**
1844 * get the personal_date_end
1845 *
1846 * \param report_number the number of the report
1847 *
1848 * \return the personal_date_end of the report, -1 if problem
1849 * */
gsb_data_report_get_personal_date_end(gint report_number)1850 GDate *gsb_data_report_get_personal_date_end ( gint report_number )
1851 {
1852 ReportStruct *report;
1853
1854 report = gsb_data_report_get_structure (report_number);
1855
1856 if ( !report )
1857 return NULL;
1858
1859 return report -> personal_date_end;
1860 }
1861
1862 /**
1863 * set the personal_date_end
1864 *
1865 * \param report_number number of the report
1866 * \param personal_date_end
1867 *
1868 * \return TRUE if ok
1869 * */
gsb_data_report_set_personal_date_end(gint report_number,GDate * personal_date_end)1870 gboolean gsb_data_report_set_personal_date_end ( gint report_number,
1871 GDate *personal_date_end )
1872 {
1873 ReportStruct *report;
1874
1875 report = gsb_data_report_get_structure (report_number);
1876
1877 if ( !report )
1878 return FALSE;
1879
1880 report -> personal_date_end = personal_date_end;
1881
1882 return TRUE;
1883 }
1884
1885
1886 /**
1887 * get the period_split
1888 *
1889 * \param report_number the number of the report
1890 *
1891 * \return the period_split of the report, -1 if problem
1892 * */
gsb_data_report_get_period_split(gint report_number)1893 gint gsb_data_report_get_period_split ( gint report_number )
1894 {
1895 ReportStruct *report;
1896
1897 report = gsb_data_report_get_structure (report_number);
1898
1899 if ( !report )
1900 return -1;
1901
1902 return report -> period_split;
1903 }
1904
1905 /**
1906 * set the period_split
1907 *
1908 * \param report_number number of the report
1909 * \param period_split
1910 *
1911 * \return TRUE if ok
1912 * */
gsb_data_report_set_period_split(gint report_number,gint period_split)1913 gboolean gsb_data_report_set_period_split ( gint report_number,
1914 gint period_split )
1915 {
1916 ReportStruct *report;
1917
1918 report = gsb_data_report_get_structure (report_number);
1919
1920 if ( !report )
1921 return FALSE;
1922
1923 report -> period_split = period_split;
1924
1925 return TRUE;
1926 }
1927
1928
1929 /**
1930 * get the period_split_type
1931 *
1932 * \param report_number the number of the report
1933 *
1934 * \return the period_split_type of the report, -1 if problem
1935 * */
gsb_data_report_get_period_split_type(gint report_number)1936 gint gsb_data_report_get_period_split_type ( gint report_number )
1937 {
1938 ReportStruct *report;
1939
1940 report = gsb_data_report_get_structure (report_number);
1941
1942 if ( !report )
1943 return -1;
1944
1945 return report -> period_split_type;
1946 }
1947
1948 /**
1949 * set the period_split_type
1950 *
1951 * \param report_number number of the report
1952 * \param period_split_type
1953 *
1954 * \return TRUE if ok
1955 * */
gsb_data_report_set_period_split_type(gint report_number,gint period_split_type)1956 gboolean gsb_data_report_set_period_split_type ( gint report_number,
1957 gint period_split_type )
1958 {
1959 ReportStruct *report;
1960
1961 report = gsb_data_report_get_structure (report_number);
1962
1963 if ( !report )
1964 return FALSE;
1965
1966 report -> period_split_type = period_split_type;
1967
1968 return TRUE;
1969 }
1970
1971
1972 /**
1973 * get the period_split_day
1974 *
1975 * \param report_number the number of the report
1976 *
1977 * \return the period_split_day of the report, -1 if problem
1978 * */
gsb_data_report_get_period_split_day(gint report_number)1979 GDateWeekday gsb_data_report_get_period_split_day ( gint report_number )
1980 {
1981 ReportStruct *report;
1982
1983 report = gsb_data_report_get_structure (report_number);
1984
1985 if ( !report )
1986 return G_DATE_BAD_WEEKDAY;
1987
1988 return report -> period_split_day + G_DATE_MONDAY;
1989 }
1990
1991 /**
1992 * set the period_split_day
1993 *
1994 * \param report_number number of the report
1995 * \param period_split_day
1996 *
1997 * \return TRUE if ok
1998 * */
gsb_data_report_set_period_split_day(gint report_number,gint period_split_day)1999 gboolean gsb_data_report_set_period_split_day ( gint report_number,
2000 gint period_split_day )
2001 {
2002 ReportStruct *report;
2003
2004 report = gsb_data_report_get_structure (report_number);
2005
2006 if ( !report )
2007 return FALSE;
2008
2009 report -> period_split_day = period_split_day;
2010
2011 return TRUE;
2012 }
2013
2014
2015 /**
2016 * get the account_use_chosen
2017 *
2018 * \param report_number the number of the report
2019 *
2020 * \return the account_use_chosen of the report, -1 if problem
2021 * */
gsb_data_report_get_account_use_chosen(gint report_number)2022 gint gsb_data_report_get_account_use_chosen ( gint report_number )
2023 {
2024 ReportStruct *report;
2025
2026 report = gsb_data_report_get_structure (report_number);
2027
2028 if ( !report )
2029 return -1;
2030
2031 return report -> account_use_chosen;
2032 }
2033
2034 /**
2035 * set the account_use_chosen
2036 *
2037 * \param report_number number of the report
2038 * \param account_use_chosen
2039 *
2040 * \return TRUE if ok
2041 * */
gsb_data_report_set_account_use_chosen(gint report_number,gint account_use_chosen)2042 gboolean gsb_data_report_set_account_use_chosen ( gint report_number,
2043 gint account_use_chosen )
2044 {
2045 ReportStruct *report;
2046
2047 report = gsb_data_report_get_structure (report_number);
2048
2049 if ( !report )
2050 return FALSE;
2051
2052 report -> account_use_chosen = account_use_chosen;
2053
2054 return TRUE;
2055 }
2056
2057
2058 /**
2059 * get the account_group_reports
2060 *
2061 * \param report_number the number of the report
2062 *
2063 * \return the account_group_reports of the report, -1 if problem
2064 * */
gsb_data_report_get_account_group_reports(gint report_number)2065 gint gsb_data_report_get_account_group_reports ( gint report_number )
2066 {
2067 ReportStruct *report;
2068
2069 report = gsb_data_report_get_structure (report_number);
2070
2071 if ( !report )
2072 return -1;
2073
2074 return report -> account_group_reports;
2075 }
2076
2077 /**
2078 * set the account_group_reports
2079 *
2080 * \param report_number number of the report
2081 * \param account_group_reports
2082 *
2083 * \return TRUE if ok
2084 * */
gsb_data_report_set_account_group_reports(gint report_number,gint account_group_reports)2085 gboolean gsb_data_report_set_account_group_reports ( gint report_number,
2086 gint account_group_reports )
2087 {
2088 ReportStruct *report;
2089
2090 report = gsb_data_report_get_structure (report_number);
2091
2092 if ( !report )
2093 return FALSE;
2094
2095 report -> account_group_reports = account_group_reports;
2096
2097 return TRUE;
2098 }
2099
2100
2101 /**
2102 * get the account_show_amount
2103 *
2104 * \param report_number the number of the report
2105 *
2106 * \return the account_show_amount of the report, -1 if problem
2107 * */
gsb_data_report_get_account_show_amount(gint report_number)2108 gint gsb_data_report_get_account_show_amount ( gint report_number )
2109 {
2110 ReportStruct *report;
2111
2112 report = gsb_data_report_get_structure (report_number);
2113
2114 if ( !report )
2115 return -1;
2116
2117 return report -> account_show_amount;
2118 }
2119
2120 /**
2121 * set the account_show_amount
2122 *
2123 * \param report_number number of the report
2124 * \param account_show_amount
2125 *
2126 * \return TRUE if ok
2127 * */
gsb_data_report_set_account_show_amount(gint report_number,gint account_show_amount)2128 gboolean gsb_data_report_set_account_show_amount ( gint report_number,
2129 gint account_show_amount )
2130 {
2131 ReportStruct *report;
2132
2133 report = gsb_data_report_get_structure (report_number);
2134
2135 if ( !report )
2136 return FALSE;
2137
2138 report -> account_show_amount = account_show_amount;
2139
2140 return TRUE;
2141 }
2142
2143
2144 /**
2145 * get the account_show_name
2146 *
2147 * \param report_number the number of the report
2148 *
2149 * \return the account_show_name of the report, -1 if problem
2150 * */
gsb_data_report_get_account_show_name(gint report_number)2151 gint gsb_data_report_get_account_show_name ( gint report_number )
2152 {
2153 ReportStruct *report;
2154
2155 report = gsb_data_report_get_structure (report_number);
2156
2157 if ( !report )
2158 return -1;
2159
2160 return report -> account_show_name;
2161 }
2162
2163 /**
2164 * set the account_show_name
2165 *
2166 * \param report_number number of the report
2167 * \param account_show_name
2168 *
2169 * \return TRUE if ok
2170 * */
gsb_data_report_set_account_show_name(gint report_number,gint account_show_name)2171 gboolean gsb_data_report_set_account_show_name ( gint report_number,
2172 gint account_show_name )
2173 {
2174 ReportStruct *report;
2175
2176 report = gsb_data_report_get_structure (report_number);
2177
2178 if ( !report )
2179 return FALSE;
2180
2181 report -> account_show_name = account_show_name;
2182
2183 return TRUE;
2184 }
2185
2186
2187 /**
2188 * get the transfer_choice
2189 *
2190 * \param report_number the number of the report
2191 *
2192 * \return the transfer_choice of the report, -1 if problem
2193 * */
gsb_data_report_get_transfer_choice(gint report_number)2194 gint gsb_data_report_get_transfer_choice ( gint report_number )
2195 {
2196 ReportStruct *report;
2197
2198 report = gsb_data_report_get_structure (report_number);
2199
2200 if ( !report )
2201 return -1;
2202
2203 return report -> transfer_choice;
2204 }
2205
2206 /**
2207 * set the transfer_choice
2208 *
2209 * \param report_number number of the report
2210 * \param transfer_choice
2211 *
2212 * \return TRUE if ok
2213 * */
gsb_data_report_set_transfer_choice(gint report_number,gint transfer_choice)2214 gboolean gsb_data_report_set_transfer_choice ( gint report_number,
2215 gint transfer_choice )
2216 {
2217 ReportStruct *report;
2218
2219 report = gsb_data_report_get_structure (report_number);
2220
2221 if ( !report )
2222 return FALSE;
2223
2224 report -> transfer_choice = transfer_choice;
2225
2226 return TRUE;
2227 }
2228
2229
2230 /**
2231 * get the transfer_reports_only
2232 *
2233 * \param report_number the number of the report
2234 *
2235 * \return the transfer_reports_only of the report, -1 if problem
2236 * */
gsb_data_report_get_transfer_reports_only(gint report_number)2237 gint gsb_data_report_get_transfer_reports_only ( gint report_number )
2238 {
2239 ReportStruct *report;
2240
2241 report = gsb_data_report_get_structure (report_number);
2242
2243 if ( !report )
2244 return -1;
2245
2246 return report -> transfer_reports_only;
2247 }
2248
2249 /**
2250 * set the transfer_reports_only
2251 *
2252 * \param report_number number of the report
2253 * \param transfer_reports_only
2254 *
2255 * \return TRUE if ok
2256 * */
gsb_data_report_set_transfer_reports_only(gint report_number,gint transfer_reports_only)2257 gboolean gsb_data_report_set_transfer_reports_only ( gint report_number,
2258 gint transfer_reports_only )
2259 {
2260 ReportStruct *report;
2261
2262 report = gsb_data_report_get_structure (report_number);
2263
2264 if ( !report )
2265 return FALSE;
2266
2267 report -> transfer_reports_only = transfer_reports_only;
2268
2269 return TRUE;
2270 }
2271
2272
2273 /**
2274 * get the category_used
2275 *
2276 * \param report_number the number of the report
2277 *
2278 * \return the category_used of the report, -1 if problem
2279 * */
gsb_data_report_get_category_used(gint report_number)2280 gint gsb_data_report_get_category_used ( gint report_number )
2281 {
2282 ReportStruct *report;
2283
2284 report = gsb_data_report_get_structure (report_number);
2285
2286 if ( !report )
2287 return -1;
2288
2289 return report -> category_used;
2290 }
2291
2292 /**
2293 * set the category_used
2294 *
2295 * \param report_number number of the report
2296 * \param category_used
2297 *
2298 * \return TRUE if ok
2299 * */
gsb_data_report_set_category_used(gint report_number,gint category_used)2300 gboolean gsb_data_report_set_category_used ( gint report_number,
2301 gint category_used )
2302 {
2303 ReportStruct *report;
2304
2305 report = gsb_data_report_get_structure (report_number);
2306
2307 if ( !report )
2308 return FALSE;
2309
2310 report -> category_used = category_used;
2311
2312 return TRUE;
2313 }
2314
2315
2316 /**
2317 * get the category_detail_used
2318 *
2319 * \param report_number the number of the report
2320 *
2321 * \return the category_detail_used of the report, -1 if problem
2322 * */
gsb_data_report_get_category_detail_used(gint report_number)2323 gint gsb_data_report_get_category_detail_used ( gint report_number )
2324 {
2325 ReportStruct *report;
2326
2327 report = gsb_data_report_get_structure (report_number);
2328
2329 if ( !report )
2330 return -1;
2331
2332 return report -> category_detail_used;
2333 }
2334
2335 /**
2336 * set the category_detail_used
2337 *
2338 * \param report_number number of the report
2339 * \param category_detail_used
2340 *
2341 * \return TRUE if ok
2342 * */
gsb_data_report_set_category_detail_used(gint report_number,gint category_detail_used)2343 gboolean gsb_data_report_set_category_detail_used ( gint report_number,
2344 gint category_detail_used )
2345 {
2346 ReportStruct *report;
2347
2348 report = gsb_data_report_get_structure (report_number);
2349
2350 if ( !report )
2351 return FALSE;
2352
2353 report -> category_detail_used = category_detail_used;
2354
2355 return TRUE;
2356 }
2357
2358
2359 /**
2360 * get the category_show_sub_category
2361 *
2362 * \param report_number the number of the report
2363 *
2364 * \return the category_show_sub_category of the report, -1 if problem
2365 * */
gsb_data_report_get_category_show_sub_category(gint report_number)2366 gint gsb_data_report_get_category_show_sub_category ( gint report_number )
2367 {
2368 ReportStruct *report;
2369
2370 report = gsb_data_report_get_structure (report_number);
2371
2372 if ( !report )
2373 return -1;
2374
2375 return report -> category_show_sub_category;
2376 }
2377
2378 /**
2379 * set the category_show_sub_category
2380 *
2381 * \param report_number number of the report
2382 * \param category_show_sub_category
2383 *
2384 * \return TRUE if ok
2385 * */
gsb_data_report_set_category_show_sub_category(gint report_number,gint category_show_sub_category)2386 gboolean gsb_data_report_set_category_show_sub_category ( gint report_number,
2387 gint category_show_sub_category )
2388 {
2389 ReportStruct *report;
2390
2391 report = gsb_data_report_get_structure (report_number);
2392
2393 if ( !report )
2394 return FALSE;
2395
2396 report -> category_show_sub_category = category_show_sub_category;
2397
2398 return TRUE;
2399 }
2400
2401
2402 /**
2403 * get the category_show_category_amount
2404 *
2405 * \param report_number the number of the report
2406 *
2407 * \return the category_show_category_amount of the report, -1 if problem
2408 * */
gsb_data_report_get_category_show_category_amount(gint report_number)2409 gint gsb_data_report_get_category_show_category_amount ( gint report_number )
2410 {
2411 ReportStruct *report;
2412
2413 report = gsb_data_report_get_structure (report_number);
2414
2415 if ( !report )
2416 return -1;
2417
2418 return report -> category_show_category_amount;
2419 }
2420
2421 /**
2422 * set the category_show_category_amount
2423 *
2424 * \param report_number number of the report
2425 * \param category_show_category_amount
2426 *
2427 * \return TRUE if ok
2428 * */
gsb_data_report_set_category_show_category_amount(gint report_number,gint category_show_category_amount)2429 gboolean gsb_data_report_set_category_show_category_amount ( gint report_number,
2430 gint category_show_category_amount )
2431 {
2432 ReportStruct *report;
2433
2434 report = gsb_data_report_get_structure (report_number);
2435
2436 if ( !report )
2437 return FALSE;
2438
2439 report -> category_show_category_amount = category_show_category_amount;
2440
2441 return TRUE;
2442 }
2443
2444
2445 /**
2446 * get the category_show_sub_category_amount
2447 *
2448 * \param report_number the number of the report
2449 *
2450 * \return the category_show_sub_category_amount of the report, -1 if problem
2451 * */
gsb_data_report_get_category_show_sub_category_amount(gint report_number)2452 gint gsb_data_report_get_category_show_sub_category_amount ( gint report_number )
2453 {
2454 ReportStruct *report;
2455
2456 report = gsb_data_report_get_structure (report_number);
2457
2458 if ( !report )
2459 return -1;
2460
2461 return report -> category_show_sub_category_amount;
2462 }
2463
2464 /**
2465 * set the category_show_sub_category_amount
2466 *
2467 * \param report_number number of the report
2468 * \param category_show_sub_category_amount
2469 *
2470 * \return TRUE if ok
2471 * */
gsb_data_report_set_category_show_sub_category_amount(gint report_number,gint category_show_sub_category_amount)2472 gboolean gsb_data_report_set_category_show_sub_category_amount ( gint report_number,
2473 gint category_show_sub_category_amount )
2474 {
2475 ReportStruct *report;
2476
2477 report = gsb_data_report_get_structure (report_number);
2478
2479 if ( !report )
2480 return FALSE;
2481
2482 report -> category_show_sub_category_amount = category_show_sub_category_amount;
2483
2484 return TRUE;
2485 }
2486
2487
2488
2489 /**
2490 * get the category_currency
2491 *
2492 * \param report_number the number of the report
2493 *
2494 * \return the category_currency of the report, -1 if problem
2495 * */
gsb_data_report_get_category_currency(gint report_number)2496 gint gsb_data_report_get_category_currency ( gint report_number )
2497 {
2498 ReportStruct *report;
2499
2500 report = gsb_data_report_get_structure (report_number);
2501
2502 if ( !report )
2503 return -1;
2504
2505 return report -> category_currency;
2506 }
2507
2508 /**
2509 * set the category_currency
2510 *
2511 * \param report_number number of the report
2512 * \param category_currency
2513 *
2514 * \return TRUE if ok
2515 * */
gsb_data_report_set_category_currency(gint report_number,gint category_currency)2516 gboolean gsb_data_report_set_category_currency ( gint report_number,
2517 gint category_currency )
2518 {
2519 ReportStruct *report;
2520
2521 report = gsb_data_report_get_structure (report_number);
2522
2523 if ( !report )
2524 return FALSE;
2525
2526 report -> category_currency = category_currency;
2527
2528 return TRUE;
2529 }
2530
2531
2532 /**
2533 * get the category_show_without_category
2534 *
2535 * \param report_number the number of the report
2536 *
2537 * \return the category_show_without_category of the report, -1 if problem
2538 * */
gsb_data_report_get_category_show_without_category(gint report_number)2539 gint gsb_data_report_get_category_show_without_category ( gint report_number )
2540 {
2541 ReportStruct *report;
2542
2543 report = gsb_data_report_get_structure (report_number);
2544
2545 if ( !report )
2546 return -1;
2547
2548 return report -> category_show_without_category;
2549 }
2550
2551 /**
2552 * set the category_show_without_category
2553 *
2554 * \param report_number number of the report
2555 * \param category_show_without_category
2556 *
2557 * \return TRUE if ok
2558 * */
gsb_data_report_set_category_show_without_category(gint report_number,gint category_show_without_category)2559 gboolean gsb_data_report_set_category_show_without_category ( gint report_number,
2560 gint category_show_without_category )
2561 {
2562 ReportStruct *report;
2563
2564 report = gsb_data_report_get_structure (report_number);
2565
2566 if ( !report )
2567 return FALSE;
2568
2569 report -> category_show_without_category = category_show_without_category;
2570
2571 return TRUE;
2572 }
2573
2574
2575 /**
2576 * get the category_show_name
2577 *
2578 * \param report_number the number of the report
2579 *
2580 * \return the category_show_name of the report, -1 if problem
2581 * */
gsb_data_report_get_category_show_name(gint report_number)2582 gint gsb_data_report_get_category_show_name ( gint report_number )
2583 {
2584 ReportStruct *report;
2585
2586 report = gsb_data_report_get_structure (report_number);
2587
2588 if ( !report )
2589 return -1;
2590
2591 return report -> category_show_name;
2592 }
2593
2594 /**
2595 * set the category_show_name
2596 *
2597 * \param report_number number of the report
2598 * \param category_show_name
2599 *
2600 * \return TRUE if ok
2601 * */
gsb_data_report_set_category_show_name(gint report_number,gint category_show_name)2602 gboolean gsb_data_report_set_category_show_name ( gint report_number,
2603 gint category_show_name )
2604 {
2605 ReportStruct *report;
2606
2607 report = gsb_data_report_get_structure (report_number);
2608
2609 if ( !report )
2610 return FALSE;
2611
2612 report -> category_show_name = category_show_name;
2613
2614 return TRUE;
2615 }
2616
2617
2618 /**
2619 * get the budget_used
2620 *
2621 * \param report_number the number of the report
2622 *
2623 * \return the budget_used of the report, -1 if problem
2624 * */
gsb_data_report_get_budget_used(gint report_number)2625 gint gsb_data_report_get_budget_used ( gint report_number )
2626 {
2627 ReportStruct *report;
2628
2629 report = gsb_data_report_get_structure (report_number);
2630
2631 if ( !report )
2632 return -1;
2633
2634 return report -> budget_used;
2635 }
2636
2637 /**
2638 * set the budget_used
2639 *
2640 * \param report_number number of the report
2641 * \param budget_used
2642 *
2643 * \return TRUE if ok
2644 * */
gsb_data_report_set_budget_used(gint report_number,gint budget_used)2645 gboolean gsb_data_report_set_budget_used ( gint report_number,
2646 gint budget_used )
2647 {
2648 ReportStruct *report;
2649
2650 report = gsb_data_report_get_structure (report_number);
2651
2652 if ( !report )
2653 return FALSE;
2654
2655 report -> budget_used = budget_used;
2656
2657 return TRUE;
2658 }
2659
2660
2661 /**
2662 * get the budget_detail_used
2663 *
2664 * \param report_number the number of the report
2665 *
2666 * \return the budget_detail_used of the report, -1 if problem
2667 * */
gsb_data_report_get_budget_detail_used(gint report_number)2668 gint gsb_data_report_get_budget_detail_used ( gint report_number )
2669 {
2670 ReportStruct *report;
2671
2672 report = gsb_data_report_get_structure (report_number);
2673
2674 if ( !report )
2675 return -1;
2676
2677 return report -> budget_detail_used;
2678 }
2679
2680 /**
2681 * set the budget_detail_used
2682 *
2683 * \param report_number number of the report
2684 * \param budget_detail_used
2685 *
2686 * \return TRUE if ok
2687 * */
gsb_data_report_set_budget_detail_used(gint report_number,gint budget_detail_used)2688 gboolean gsb_data_report_set_budget_detail_used ( gint report_number,
2689 gint budget_detail_used )
2690 {
2691 ReportStruct *report;
2692
2693 report = gsb_data_report_get_structure (report_number);
2694
2695 if ( !report )
2696 return FALSE;
2697
2698 report -> budget_detail_used = budget_detail_used;
2699
2700 return TRUE;
2701 }
2702
2703
2704 /**
2705 * get the budget_show_sub_budget
2706 *
2707 * \param report_number the number of the report
2708 *
2709 * \return the budget_show_sub_budget of the report, -1 if problem
2710 * */
gsb_data_report_get_budget_show_sub_budget(gint report_number)2711 gint gsb_data_report_get_budget_show_sub_budget ( gint report_number )
2712 {
2713 ReportStruct *report;
2714
2715 report = gsb_data_report_get_structure (report_number);
2716
2717 if ( !report )
2718 return -1;
2719
2720 return report -> budget_show_sub_budget;
2721 }
2722
2723 /**
2724 * set the budget_show_sub_budget
2725 *
2726 * \param report_number number of the report
2727 * \param budget_show_sub_budget
2728 *
2729 * \return TRUE if ok
2730 * */
gsb_data_report_set_budget_show_sub_budget(gint report_number,gint budget_show_sub_budget)2731 gboolean gsb_data_report_set_budget_show_sub_budget ( gint report_number,
2732 gint budget_show_sub_budget )
2733 {
2734 ReportStruct *report;
2735
2736 report = gsb_data_report_get_structure (report_number);
2737
2738 if ( !report )
2739 return FALSE;
2740
2741 report -> budget_show_sub_budget = budget_show_sub_budget;
2742
2743 return TRUE;
2744 }
2745
2746
2747 /**
2748 * get the budget_show_budget_amount
2749 *
2750 * \param report_number the number of the report
2751 *
2752 * \return the budget_show_budget_amount of the report, -1 if problem
2753 * */
gsb_data_report_get_budget_show_budget_amount(gint report_number)2754 gint gsb_data_report_get_budget_show_budget_amount ( gint report_number )
2755 {
2756 ReportStruct *report;
2757
2758 report = gsb_data_report_get_structure (report_number);
2759
2760 if ( !report )
2761 return -1;
2762
2763 return report -> budget_show_budget_amount;
2764 }
2765
2766 /**
2767 * set the budget_show_budget_amount
2768 *
2769 * \param report_number number of the report
2770 * \param budget_show_budget_amount
2771 *
2772 * \return TRUE if ok
2773 * */
gsb_data_report_set_budget_show_budget_amount(gint report_number,gint budget_show_budget_amount)2774 gboolean gsb_data_report_set_budget_show_budget_amount ( gint report_number,
2775 gint budget_show_budget_amount )
2776 {
2777 ReportStruct *report;
2778
2779 report = gsb_data_report_get_structure (report_number);
2780
2781 if ( !report )
2782 return FALSE;
2783
2784 report -> budget_show_budget_amount = budget_show_budget_amount;
2785
2786 return TRUE;
2787 }
2788
2789 /**
2790 * get the budget_show_sub_budget_amount
2791 *
2792 * \param report_number the number of the report
2793 *
2794 * \return the budget_show_sub_budget_amount of the report, -1 if problem
2795 * */
gsb_data_report_get_budget_show_sub_budget_amount(gint report_number)2796 gint gsb_data_report_get_budget_show_sub_budget_amount ( gint report_number )
2797 {
2798 ReportStruct *report;
2799
2800 report = gsb_data_report_get_structure (report_number);
2801
2802 if ( !report )
2803 return -1;
2804
2805 return report -> budget_show_sub_budget_amount;
2806 }
2807
2808 /**
2809 * set the budget_show_sub_budget_amount
2810 *
2811 * \param report_number number of the report
2812 * \param budget_show_sub_budget_amount
2813 *
2814 * \return TRUE if ok
2815 * */
gsb_data_report_set_budget_show_sub_budget_amount(gint report_number,gint budget_show_sub_budget_amount)2816 gboolean gsb_data_report_set_budget_show_sub_budget_amount ( gint report_number,
2817 gint budget_show_sub_budget_amount )
2818 {
2819 ReportStruct *report;
2820
2821 report = gsb_data_report_get_structure (report_number);
2822
2823 if ( !report )
2824 return FALSE;
2825
2826 report -> budget_show_sub_budget_amount = budget_show_sub_budget_amount;
2827
2828 return TRUE;
2829 }
2830
2831
2832
2833
2834 /**
2835 * get the budget_currency
2836 *
2837 * \param report_number the number of the report
2838 *
2839 * \return the budget_currency of the report, -1 if problem
2840 * */
gsb_data_report_get_budget_currency(gint report_number)2841 gint gsb_data_report_get_budget_currency ( gint report_number )
2842 {
2843 ReportStruct *report;
2844
2845 report = gsb_data_report_get_structure (report_number);
2846
2847 if ( !report )
2848 return -1;
2849
2850 return report -> budget_currency;
2851 }
2852
2853 /**
2854 * set the budget_currency
2855 *
2856 * \param report_number number of the report
2857 * \param budget_currency
2858 *
2859 * \return TRUE if ok
2860 * */
gsb_data_report_set_budget_currency(gint report_number,gint budget_currency)2861 gboolean gsb_data_report_set_budget_currency ( gint report_number,
2862 gint budget_currency )
2863 {
2864 ReportStruct *report;
2865
2866 report = gsb_data_report_get_structure (report_number);
2867
2868 if ( !report )
2869 return FALSE;
2870
2871 report -> budget_currency = budget_currency;
2872
2873 return TRUE;
2874 }
2875
2876
2877 /**
2878 * get the budget_show_without_budget
2879 *
2880 * \param report_number the number of the report
2881 *
2882 * \return the budget_show_without_budget of the report, -1 if problem
2883 * */
gsb_data_report_get_budget_show_without_budget(gint report_number)2884 gint gsb_data_report_get_budget_show_without_budget ( gint report_number )
2885 {
2886 ReportStruct *report;
2887
2888 report = gsb_data_report_get_structure (report_number);
2889
2890 if ( !report )
2891 return -1;
2892
2893 return report -> budget_show_without_budget;
2894 }
2895
2896 /**
2897 * set the budget_show_without_budget
2898 *
2899 * \param report_number number of the report
2900 * \param budget_show_without_budget
2901 *
2902 * \return TRUE if ok
2903 * */
gsb_data_report_set_budget_show_without_budget(gint report_number,gint budget_show_without_budget)2904 gboolean gsb_data_report_set_budget_show_without_budget ( gint report_number,
2905 gint budget_show_without_budget )
2906 {
2907 ReportStruct *report;
2908
2909 report = gsb_data_report_get_structure (report_number);
2910
2911 if ( !report )
2912 return FALSE;
2913
2914 report -> budget_show_without_budget = budget_show_without_budget;
2915
2916 return TRUE;
2917 }
2918
2919
2920 /**
2921 * get the budget_show_name
2922 *
2923 * \param report_number the number of the report
2924 *
2925 * \return the budget_show_name of the report, -1 if problem
2926 * */
gsb_data_report_get_budget_show_name(gint report_number)2927 gint gsb_data_report_get_budget_show_name ( gint report_number )
2928 {
2929 ReportStruct *report;
2930
2931 report = gsb_data_report_get_structure (report_number);
2932
2933 if ( !report )
2934 return -1;
2935
2936 return report -> budget_show_name;
2937 }
2938
2939 /**
2940 * set the budget_show_name
2941 *
2942 * \param report_number number of the report
2943 * \param budget_show_name
2944 *
2945 * \return TRUE if ok
2946 * */
gsb_data_report_set_budget_show_name(gint report_number,gint budget_show_name)2947 gboolean gsb_data_report_set_budget_show_name ( gint report_number,
2948 gint budget_show_name )
2949 {
2950 ReportStruct *report;
2951
2952 report = gsb_data_report_get_structure (report_number);
2953
2954 if ( !report )
2955 return FALSE;
2956
2957 report -> budget_show_name = budget_show_name;
2958
2959 return TRUE;
2960 }
2961
2962
2963 /**
2964 * get the payee_used
2965 *
2966 * \param report_number the number of the report
2967 *
2968 * \return the payee_used of the report, -1 if problem
2969 * */
gsb_data_report_get_payee_used(gint report_number)2970 gint gsb_data_report_get_payee_used ( gint report_number )
2971 {
2972 ReportStruct *report;
2973
2974 report = gsb_data_report_get_structure (report_number);
2975
2976 if ( !report )
2977 return -1;
2978
2979 return report -> payee_used;
2980 }
2981
2982 /**
2983 * set the payee_used
2984 *
2985 * \param report_number number of the report
2986 * \param payee_used
2987 *
2988 * \return TRUE if ok
2989 * */
gsb_data_report_set_payee_used(gint report_number,gint payee_used)2990 gboolean gsb_data_report_set_payee_used ( gint report_number,
2991 gint payee_used )
2992 {
2993 ReportStruct *report;
2994
2995 report = gsb_data_report_get_structure (report_number);
2996
2997 if ( !report )
2998 return FALSE;
2999
3000 report -> payee_used = payee_used;
3001
3002 return TRUE;
3003 }
3004
3005
3006 /**
3007 * get the payee_detail_used
3008 *
3009 * \param report_number the number of the report
3010 *
3011 * \return the payee_detail_used of the report, -1 if problem
3012 * */
gsb_data_report_get_payee_detail_used(gint report_number)3013 gint gsb_data_report_get_payee_detail_used ( gint report_number )
3014 {
3015 ReportStruct *report;
3016
3017 report = gsb_data_report_get_structure (report_number);
3018
3019 if ( !report )
3020 return -1;
3021
3022 return report -> payee_detail_used;
3023 }
3024
3025 /**
3026 * set the payee_detail_used
3027 *
3028 * \param report_number number of the report
3029 * \param payee_detail_used
3030 *
3031 * \return TRUE if ok
3032 * */
gsb_data_report_set_payee_detail_used(gint report_number,gint payee_detail_used)3033 gboolean gsb_data_report_set_payee_detail_used ( gint report_number,
3034 gint payee_detail_used )
3035 {
3036 ReportStruct *report;
3037
3038 report = gsb_data_report_get_structure (report_number);
3039
3040 if ( !report )
3041 return FALSE;
3042
3043 report -> payee_detail_used = payee_detail_used;
3044
3045 return TRUE;
3046 }
3047
3048
3049 /**
3050 * get the payee_show_payee_amount
3051 *
3052 * \param report_number the number of the report
3053 *
3054 * \return the payee_show_payee_amount of the report, -1 if problem
3055 * */
gsb_data_report_get_payee_show_payee_amount(gint report_number)3056 gint gsb_data_report_get_payee_show_payee_amount ( gint report_number )
3057 {
3058 ReportStruct *report;
3059
3060 report = gsb_data_report_get_structure (report_number);
3061
3062 if ( !report )
3063 return -1;
3064
3065 return report -> payee_show_payee_amount;
3066 }
3067
3068 /**
3069 * set the payee_show_payee_amount
3070 *
3071 * \param report_number number of the report
3072 * \param payee_show_payee_amount
3073 *
3074 * \return TRUE if ok
3075 * */
gsb_data_report_set_payee_show_payee_amount(gint report_number,gint payee_show_payee_amount)3076 gboolean gsb_data_report_set_payee_show_payee_amount ( gint report_number,
3077 gint payee_show_payee_amount )
3078 {
3079 ReportStruct *report;
3080
3081 report = gsb_data_report_get_structure (report_number);
3082
3083 if ( !report )
3084 return FALSE;
3085
3086 report -> payee_show_payee_amount = payee_show_payee_amount;
3087
3088 return TRUE;
3089 }
3090
3091
3092 /**
3093 * get the payee_currency
3094 *
3095 * \param report_number the number of the report
3096 *
3097 * \return the payee_currency of the report, -1 if problem
3098 * */
gsb_data_report_get_payee_currency(gint report_number)3099 gint gsb_data_report_get_payee_currency ( gint report_number )
3100 {
3101 ReportStruct *report;
3102
3103 report = gsb_data_report_get_structure (report_number);
3104
3105 if ( !report )
3106 return -1;
3107
3108 return report -> payee_currency;
3109 }
3110
3111 /**
3112 * set the payee_currency
3113 *
3114 * \param report_number number of the report
3115 * \param payee_currency
3116 *
3117 * \return TRUE if ok
3118 * */
gsb_data_report_set_payee_currency(gint report_number,gint payee_currency)3119 gboolean gsb_data_report_set_payee_currency ( gint report_number,
3120 gint payee_currency )
3121 {
3122 ReportStruct *report;
3123
3124 report = gsb_data_report_get_structure (report_number);
3125
3126 if ( !report )
3127 return FALSE;
3128
3129 report -> payee_currency = payee_currency;
3130
3131 return TRUE;
3132 }
3133
3134
3135 /**
3136 * get the payee_show_name
3137 *
3138 * \param report_number the number of the report
3139 *
3140 * \return the payee_show_name of the report, -1 if problem
3141 * */
gsb_data_report_get_payee_show_name(gint report_number)3142 gint gsb_data_report_get_payee_show_name ( gint report_number )
3143 {
3144 ReportStruct *report;
3145
3146 report = gsb_data_report_get_structure (report_number);
3147
3148 if ( !report )
3149 return -1;
3150
3151 return report -> payee_show_name;
3152 }
3153
3154 /**
3155 * set the payee_show_name
3156 *
3157 * \param report_number number of the report
3158 * \param payee_show_name
3159 *
3160 * \return TRUE if ok
3161 * */
gsb_data_report_set_payee_show_name(gint report_number,gint payee_show_name)3162 gboolean gsb_data_report_set_payee_show_name ( gint report_number,
3163 gint payee_show_name )
3164 {
3165 ReportStruct *report;
3166
3167 report = gsb_data_report_get_structure (report_number);
3168
3169 if ( !report )
3170 return FALSE;
3171
3172 report -> payee_show_name = payee_show_name;
3173
3174 return TRUE;
3175 }
3176
3177
3178 /**
3179 * get the text_comparison_used
3180 *
3181 * \param report_number the number of the report
3182 *
3183 * \return the text_comparison_used of the report, -1 if problem
3184 * */
gsb_data_report_get_text_comparison_used(gint report_number)3185 gint gsb_data_report_get_text_comparison_used ( gint report_number )
3186 {
3187 ReportStruct *report;
3188
3189 report = gsb_data_report_get_structure (report_number);
3190
3191 if ( !report )
3192 return -1;
3193
3194 return report -> text_comparison_used;
3195 }
3196
3197 /**
3198 * set the text_comparison_used
3199 *
3200 * \param report_number number of the report
3201 * \param text_comparison_used
3202 *
3203 * \return TRUE if ok
3204 * */
gsb_data_report_set_text_comparison_used(gint report_number,gint text_comparison_used)3205 gboolean gsb_data_report_set_text_comparison_used ( gint report_number,
3206 gint text_comparison_used )
3207 {
3208 ReportStruct *report;
3209
3210 report = gsb_data_report_get_structure (report_number);
3211
3212 if ( !report )
3213 return FALSE;
3214
3215 report -> text_comparison_used = text_comparison_used;
3216
3217 return TRUE;
3218 }
3219
3220
3221 /**
3222 * get the amount_comparison_used
3223 *
3224 * \param report_number the number of the report
3225 *
3226 * \return the amount_comparison_used of the report, -1 if problem
3227 * */
gsb_data_report_get_amount_comparison_used(gint report_number)3228 gint gsb_data_report_get_amount_comparison_used ( gint report_number )
3229 {
3230 ReportStruct *report;
3231
3232 report = gsb_data_report_get_structure (report_number);
3233
3234 if ( !report )
3235 return -1;
3236
3237 return report -> amount_comparison_used;
3238 }
3239
3240 /**
3241 * set the amount_comparison_used
3242 *
3243 * \param report_number number of the report
3244 * \param amount_comparison_used
3245 *
3246 * \return TRUE if ok
3247 * */
gsb_data_report_set_amount_comparison_used(gint report_number,gint amount_comparison_used)3248 gboolean gsb_data_report_set_amount_comparison_used ( gint report_number,
3249 gint amount_comparison_used )
3250 {
3251 ReportStruct *report;
3252
3253 report = gsb_data_report_get_structure (report_number);
3254
3255 if ( !report )
3256 return FALSE;
3257
3258 report -> amount_comparison_used = amount_comparison_used;
3259
3260 return TRUE;
3261 }
3262
3263
3264 /**
3265 * get the amount_comparison_currency
3266 *
3267 * \param report_number the number of the report
3268 *
3269 * \return the amount_comparison_currency of the report, -1 if problem
3270 * */
gsb_data_report_get_amount_comparison_currency(gint report_number)3271 gint gsb_data_report_get_amount_comparison_currency ( gint report_number )
3272 {
3273 ReportStruct *report;
3274
3275 report = gsb_data_report_get_structure (report_number);
3276
3277 if ( !report )
3278 return -1;
3279
3280 return report -> amount_comparison_currency;
3281 }
3282
3283 /**
3284 * set the amount_comparison_currency
3285 *
3286 * \param report_number number of the report
3287 * \param amount_comparison_currency
3288 *
3289 * \return TRUE if ok
3290 * */
gsb_data_report_set_amount_comparison_currency(gint report_number,gint amount_comparison_currency)3291 gboolean gsb_data_report_set_amount_comparison_currency ( gint report_number,
3292 gint amount_comparison_currency )
3293 {
3294 ReportStruct *report;
3295
3296 report = gsb_data_report_get_structure (report_number);
3297
3298 if ( !report )
3299 return FALSE;
3300
3301 report -> amount_comparison_currency = amount_comparison_currency;
3302
3303 return TRUE;
3304 }
3305
3306
3307 /**
3308 * get the amount_comparison_only_report_non_null
3309 *
3310 * \param report_number the number of the report
3311 *
3312 * \return the amount_comparison_only_report_non_null of the report, -1 if problem
3313 * */
gsb_data_report_get_amount_comparison_only_report_non_null(gint report_number)3314 gint gsb_data_report_get_amount_comparison_only_report_non_null ( gint report_number )
3315 {
3316 ReportStruct *report;
3317
3318 report = gsb_data_report_get_structure (report_number);
3319
3320 if ( !report )
3321 return -1;
3322
3323 return report -> amount_comparison_only_report_non_null;
3324 }
3325
3326 /**
3327 * set the amount_comparison_only_report_non_null
3328 *
3329 * \param report_number number of the report
3330 * \param amount_comparison_only_report_non_null
3331 *
3332 * \return TRUE if ok
3333 * */
gsb_data_report_set_amount_comparison_only_report_non_null(gint report_number,gint amount_comparison_only_report_non_null)3334 gboolean gsb_data_report_set_amount_comparison_only_report_non_null ( gint report_number,
3335 gint amount_comparison_only_report_non_null )
3336 {
3337 ReportStruct *report;
3338
3339 report = gsb_data_report_get_structure (report_number);
3340
3341 if ( !report )
3342 return FALSE;
3343
3344 report -> amount_comparison_only_report_non_null = amount_comparison_only_report_non_null;
3345
3346 return TRUE;
3347 }
3348
3349 /**
3350 * get the method_of_payment_used
3351 *
3352 * \param report_number the number of the report
3353 *
3354 * \return the method_of_payment_used of the report, -1 if problem
3355 * */
gsb_data_report_get_method_of_payment_used(gint report_number)3356 gint gsb_data_report_get_method_of_payment_used ( gint report_number )
3357 {
3358 ReportStruct *report;
3359
3360 report = gsb_data_report_get_structure (report_number);
3361
3362 if ( !report )
3363 return -1;
3364
3365 return report -> method_of_payment_used;
3366 }
3367
3368 /**
3369 * set the method_of_payment_used
3370 *
3371 * \param report_number number of the report
3372 * \param method_of_payment_used
3373 *
3374 * \return TRUE if ok
3375 * */
gsb_data_report_set_method_of_payment_used(gint report_number,gint method_of_payment_used)3376 gboolean gsb_data_report_set_method_of_payment_used ( gint report_number,
3377 gint method_of_payment_used )
3378 {
3379 ReportStruct *report;
3380
3381 report = gsb_data_report_get_structure (report_number);
3382
3383 if ( !report )
3384 return FALSE;
3385
3386 report -> method_of_payment_used = method_of_payment_used;
3387
3388 return TRUE;
3389 }
3390
3391
3392 /**
3393 * free the financial_year_list
3394 *
3395 * \param report_number number of the report
3396 *
3397 * \return
3398 * */
gsb_data_report_free_financial_year_list(gint report_number)3399 void gsb_data_report_free_financial_year_list ( gint report_number )
3400 {
3401 ReportStruct *report;
3402
3403 report = gsb_data_report_get_structure ( report_number );
3404
3405 if ( !report )
3406 return;
3407 if ( report -> financial_year_list )
3408 g_slist_free ( report -> financial_year_list );
3409 report -> financial_year_list = NULL;
3410 }
3411
3412
3413 /**
3414 * get the financial_year_list
3415 *
3416 * \param report_number the number of the report
3417 *
3418 * \return the financial_year_list of the report, -1 if problem
3419 * */
gsb_data_report_get_financial_year_list(gint report_number)3420 GSList *gsb_data_report_get_financial_year_list ( gint report_number )
3421 {
3422 ReportStruct *report;
3423
3424 report = gsb_data_report_get_structure (report_number);
3425
3426 if ( !report )
3427 return NULL;
3428
3429 return report -> financial_year_list;
3430 }
3431
3432 /**
3433 * set the financial_year_list
3434 *
3435 * \param report_number number of the report
3436 * \param financial_year_list
3437 *
3438 * \return TRUE if ok
3439 * */
gsb_data_report_set_financial_year_list(gint report_number,GSList * financial_year_list)3440 gboolean gsb_data_report_set_financial_year_list ( gint report_number,
3441 GSList *financial_year_list )
3442 {
3443 ReportStruct *report;
3444
3445 report = gsb_data_report_get_structure (report_number);
3446
3447 if ( !report )
3448 return FALSE;
3449
3450 report -> financial_year_list = financial_year_list;
3451
3452 return TRUE;
3453 }
3454
3455
3456 /**
3457 * get the sorting_type
3458 *
3459 * \param report_number the number of the report
3460 *
3461 * \return the sorting_type of the report, NULL if problem
3462 * */
gsb_data_report_get_sorting_type_list(gint report_number)3463 GSList *gsb_data_report_get_sorting_type_list ( gint report_number )
3464 {
3465 ReportStruct *report;
3466
3467 report = gsb_data_report_get_structure (report_number);
3468
3469 if ( !report )
3470 return NULL;
3471
3472 return report -> sorting_type;
3473 }
3474
3475 /**
3476 * set the sorting_type
3477 *
3478 * \param report_number number of the report
3479 * \param sorting_type
3480 *
3481 * \return TRUE if ok
3482 * */
gsb_data_report_set_sorting_type_list(gint report_number,GSList * sorting_type)3483 gboolean gsb_data_report_set_sorting_type_list ( gint report_number,
3484 GSList *sorting_type )
3485 {
3486 ReportStruct *report;
3487
3488 report = gsb_data_report_get_structure (report_number);
3489
3490 if ( !report )
3491 return FALSE;
3492
3493 report -> sorting_type = sorting_type;
3494
3495 return TRUE;
3496 }
3497
3498 /**
3499 * get the account_numbers
3500 *
3501 * \param report_number the number of the report
3502 *
3503 * \return the account_numbers of the report, -1 if problem
3504 * */
gsb_data_report_get_account_numbers_list(gint report_number)3505 GSList *gsb_data_report_get_account_numbers_list ( gint report_number )
3506 {
3507 ReportStruct *report;
3508
3509 report = gsb_data_report_get_structure (report_number);
3510
3511 if ( !report )
3512 return NULL;
3513
3514 return report -> account_numbers;
3515 }
3516
3517 /**
3518 * set the account_numbers
3519 *
3520 * \param report_number number of the report
3521 * \param account_numbers
3522 *
3523 * \return TRUE if ok
3524 * */
gsb_data_report_set_account_numbers_list(gint report_number,GSList * account_numbers)3525 gboolean gsb_data_report_set_account_numbers_list ( gint report_number,
3526 GSList *account_numbers )
3527 {
3528 ReportStruct *report;
3529
3530 report = gsb_data_report_get_structure (report_number);
3531
3532 if ( !report )
3533 return FALSE;
3534
3535 report -> account_numbers = account_numbers;
3536
3537 return TRUE;
3538 }
3539
3540 /**
3541 * get the transfer_account_numbers
3542 *
3543 * \param report_number the number of the report
3544 *
3545 * \return the transfer_account_numbers of the report, -1 if problem
3546 * */
gsb_data_report_get_transfer_account_numbers_list(gint report_number)3547 GSList *gsb_data_report_get_transfer_account_numbers_list ( gint report_number )
3548 {
3549 ReportStruct *report;
3550
3551 report = gsb_data_report_get_structure (report_number);
3552
3553 if ( !report )
3554 return NULL;
3555
3556 return report -> transfer_account_numbers;
3557 }
3558
3559 /**
3560 * set the transfer_account_numbers
3561 *
3562 * \param report_number number of the report
3563 * \param transfer_account_numbers
3564 *
3565 * \return TRUE if ok
3566 * */
gsb_data_report_set_transfer_account_numbers_list(gint report_number,GSList * transfer_account_numbers)3567 gboolean gsb_data_report_set_transfer_account_numbers_list ( gint report_number,
3568 GSList *transfer_account_numbers )
3569 {
3570 ReportStruct *report;
3571
3572 report = gsb_data_report_get_structure (report_number);
3573
3574 if ( !report )
3575 return FALSE;
3576
3577 report -> transfer_account_numbers = transfer_account_numbers;
3578
3579 return TRUE;
3580 }
3581
3582
3583 /**
3584 * return the list of CategBudgetSel
3585 * containing the selected categories and sub-categories
3586 *
3587 * \param report_number the number of the report
3588 *
3589 * \return the categ_select_struct of the report, -1 if problem
3590 * */
gsb_data_report_get_category_struct_list(gint report_number)3591 GSList *gsb_data_report_get_category_struct_list ( gint report_number )
3592 {
3593 ReportStruct *report;
3594
3595 report = gsb_data_report_get_structure (report_number);
3596
3597 if ( !report )
3598 return NULL;
3599
3600 return report -> categ_select_struct;
3601 }
3602
3603 /**
3604 * set the list of CategBudgetSel
3605 * this is a list of CategBudgetSel
3606 * if there were a previous category struct list, we free it before
3607 *
3608 * \param report_number number of the report
3609 * \param categ_select_struct
3610 *
3611 * \return TRUE if ok
3612 * */
gsb_data_report_set_category_struct_list(gint report_number,GSList * categ_select_struct)3613 gboolean gsb_data_report_set_category_struct_list ( gint report_number,
3614 GSList *categ_select_struct )
3615 {
3616 ReportStruct *report;
3617
3618 report = gsb_data_report_get_structure (report_number);
3619
3620 if ( !report )
3621 return FALSE;
3622
3623 if (report -> categ_select_struct)
3624 gsb_data_report_free_categ_budget_struct_list (report -> categ_select_struct);
3625
3626 report -> categ_select_struct = categ_select_struct;
3627
3628 return TRUE;
3629 }
3630
3631 /**
3632 * free the list of categories/budgets struct
3633 *
3634 * \param categ_budget_sel_list the list of CategBudgetSel to free
3635 *
3636 * \return TRUE if ok
3637 * */
gsb_data_report_free_categ_budget_struct_list(GSList * categ_budget_sel_list)3638 void gsb_data_report_free_categ_budget_struct_list (GSList *categ_budget_sel_list)
3639 {
3640 GSList *tmp_list;
3641
3642 tmp_list = categ_budget_sel_list;
3643 while (tmp_list)
3644 {
3645 CategBudgetSel *categ_budget_struct;
3646
3647 categ_budget_struct = tmp_list -> data;
3648 if (categ_budget_struct -> sub_div_numbers)
3649 g_slist_free (categ_budget_struct -> sub_div_numbers);
3650 g_free (categ_budget_struct);
3651 tmp_list = tmp_list -> next;
3652 }
3653 g_slist_free (categ_budget_sel_list);
3654 }
3655
3656 /**
3657 * coppy the list of categories/budgets struct
3658 *
3659 * \param orig_categ_budget_list the CategBudgetSel list to copy
3660 *
3661 * \return a new GSList of CategBudgetSel
3662 * */
gsb_data_report_copy_categ_budget_struct(GSList * orig_categ_budget_list)3663 GSList *gsb_data_report_copy_categ_budget_struct (GSList *orig_categ_budget_list)
3664 {
3665 GSList *tmp_list;
3666 GSList *new_list = NULL;
3667
3668 tmp_list = orig_categ_budget_list;
3669 while (tmp_list)
3670 {
3671 CategBudgetSel *categ_budget_struct;
3672 CategBudgetSel *new_categ_budget_struct;
3673
3674 categ_budget_struct = tmp_list -> data;
3675 new_categ_budget_struct = g_malloc0 (sizeof (CategBudgetSel));
3676 new_list = g_slist_append (new_list, new_categ_budget_struct);
3677
3678 new_categ_budget_struct -> div_number = categ_budget_struct -> div_number;
3679
3680 if (categ_budget_struct -> sub_div_numbers)
3681 new_categ_budget_struct -> sub_div_numbers = g_slist_copy (categ_budget_struct -> sub_div_numbers);
3682
3683 tmp_list = tmp_list -> next;
3684 }
3685 return new_list;
3686 }
3687
3688 /**
3689 * return the list of CategBudgetSel
3690 * containing the selected budgets and sub-budgets
3691 *
3692 * \param report_number the number of the report
3693 *
3694 * \return the categ_select_struct of the report, -1 if problem
3695 * */
gsb_data_report_get_budget_struct_list(gint report_number)3696 GSList *gsb_data_report_get_budget_struct_list ( gint report_number )
3697 {
3698 ReportStruct *report;
3699
3700 report = gsb_data_report_get_structure (report_number);
3701
3702 if ( !report )
3703 return NULL;
3704
3705 return report -> budget_select_struct;
3706 }
3707
3708 /**
3709 * set the list of budgets struct
3710 * this is a list of CategBudgetSel
3711 * if there were a previous budget struct list, we free it before
3712 *
3713 * \param report_number number of the report
3714 * \param categ_select_struct
3715 *
3716 * \return TRUE if ok
3717 * */
gsb_data_report_set_budget_struct_list(gint report_number,GSList * budget_select_struct)3718 gboolean gsb_data_report_set_budget_struct_list ( gint report_number,
3719 GSList *budget_select_struct )
3720 {
3721 ReportStruct *report;
3722
3723 report = gsb_data_report_get_structure (report_number);
3724
3725 if ( !report )
3726 return FALSE;
3727
3728 if (report -> budget_select_struct)
3729 gsb_data_report_free_categ_budget_struct_list (report -> budget_select_struct);
3730
3731 report -> budget_select_struct = budget_select_struct;
3732
3733 return TRUE;
3734 }
3735
3736
3737 /**
3738 * free the payee_numbers_list
3739 *
3740 * \param report_number number of the report
3741 *
3742 * \return
3743 * */
gsb_data_report_free_payee_numbers_list(gint report_number)3744 void gsb_data_report_free_payee_numbers_list ( gint report_number )
3745 {
3746 ReportStruct *report;
3747
3748 report = gsb_data_report_get_structure ( report_number );
3749
3750 if ( !report )
3751 return;
3752 if ( report -> payee_numbers )
3753 g_slist_free ( report -> payee_numbers );
3754
3755 report -> payee_numbers = NULL;
3756 }
3757
3758
3759 /**
3760 * get the payee_numbers
3761 *
3762 * \param report_number the number of the report
3763 *
3764 * \return the payee_numbers of the report, -1 if problem
3765 * */
gsb_data_report_get_payee_numbers_list(gint report_number)3766 GSList *gsb_data_report_get_payee_numbers_list ( gint report_number )
3767 {
3768 ReportStruct *report;
3769
3770 report = gsb_data_report_get_structure (report_number);
3771
3772 if ( !report )
3773 return NULL;
3774
3775 return report -> payee_numbers;
3776 }
3777
3778 /**
3779 * set the payee_numbers
3780 *
3781 * \param report_number number of the report
3782 * \param payee_numbers
3783 *
3784 * \return TRUE if ok
3785 * */
gsb_data_report_set_payee_numbers_list(gint report_number,GSList * payee_numbers)3786 gboolean gsb_data_report_set_payee_numbers_list ( gint report_number,
3787 GSList *payee_numbers )
3788 {
3789 ReportStruct *report;
3790
3791 report = gsb_data_report_get_structure (report_number);
3792
3793 if ( !report )
3794 return FALSE;
3795
3796 report -> payee_numbers = payee_numbers;
3797
3798 return TRUE;
3799 }
3800
3801 /**
3802 * get the text_comparison_list
3803 *
3804 * \param report_number the number of the report
3805 *
3806 * \return the text_comparison_list of the report, -1 if problem
3807 * */
gsb_data_report_get_text_comparison_list(gint report_number)3808 GSList *gsb_data_report_get_text_comparison_list ( gint report_number )
3809 {
3810 ReportStruct *report;
3811
3812 report = gsb_data_report_get_structure (report_number);
3813
3814 if ( !report )
3815 return NULL;
3816
3817 return report -> text_comparison_list;
3818 }
3819
3820 /**
3821 * set the text_comparison_list
3822 *
3823 * \param report_number number of the report
3824 * \param text_comparison_list
3825 *
3826 * \return TRUE if ok
3827 * */
gsb_data_report_set_text_comparison_list(gint report_number,GSList * text_comparison_list)3828 gboolean gsb_data_report_set_text_comparison_list ( gint report_number,
3829 GSList *text_comparison_list )
3830 {
3831 ReportStruct *report;
3832
3833 report = gsb_data_report_get_structure (report_number);
3834
3835 if ( !report )
3836 return FALSE;
3837
3838 report -> text_comparison_list = text_comparison_list;
3839
3840 return TRUE;
3841 }
3842
3843 /**
3844 * get the amount_comparison_list
3845 *
3846 * \param report_number the number of the report
3847 *
3848 * \return the amount_comparison_list of the report, -1 if problem
3849 * */
gsb_data_report_get_amount_comparison_list(gint report_number)3850 GSList *gsb_data_report_get_amount_comparison_list ( gint report_number )
3851 {
3852 ReportStruct *report;
3853
3854 report = gsb_data_report_get_structure (report_number);
3855
3856 if ( !report )
3857 return NULL;
3858
3859 return report -> amount_comparison_list;
3860 }
3861
3862 /**
3863 * set the amount_comparison_list
3864 *
3865 * \param report_number number of the report
3866 * \param amount_comparison_list
3867 *
3868 * \return TRUE if ok
3869 * */
gsb_data_report_set_amount_comparison_list(gint report_number,GSList * amount_comparison_list)3870 gboolean gsb_data_report_set_amount_comparison_list ( gint report_number,
3871 GSList *amount_comparison_list )
3872 {
3873 ReportStruct *report;
3874
3875 report = gsb_data_report_get_structure (report_number);
3876
3877 if ( !report )
3878 return FALSE;
3879
3880 report -> amount_comparison_list = amount_comparison_list;
3881
3882 return TRUE;
3883 }
3884
3885 /**
3886 * get the method_of_payment_list
3887 * this is a list of string of method of payment we want to see in the report
3888 *
3889 * \param report_number the number of the report
3890 *
3891 * \return the method_of_payment_list of the report, -1 if problem
3892 * */
gsb_data_report_get_method_of_payment_list(gint report_number)3893 GSList *gsb_data_report_get_method_of_payment_list ( gint report_number )
3894 {
3895 ReportStruct *report;
3896
3897 report = gsb_data_report_get_structure (report_number);
3898
3899 if ( !report )
3900 return NULL;
3901
3902 return report -> method_of_payment_list;
3903 }
3904
3905 /**
3906 * set the method_of_payment_list
3907 *
3908 * \param report_number number of the report
3909 * \param method_of_payment_list
3910 *
3911 * \return TRUE if ok
3912 * */
gsb_data_report_set_method_of_payment_list(gint report_number,GSList * method_of_payment_list)3913 gboolean gsb_data_report_set_method_of_payment_list ( gint report_number,
3914 GSList *method_of_payment_list )
3915 {
3916 ReportStruct *report;
3917
3918 report = gsb_data_report_get_structure (report_number);
3919
3920 if ( !report )
3921 return FALSE;
3922
3923 report -> method_of_payment_list = method_of_payment_list;
3924
3925 return TRUE;
3926 }
3927
3928
3929
3930 /**
3931 * dupplicate the report
3932 *
3933 * \param report_number
3934 *
3935 * \return number of the new report
3936 * */
gsb_data_report_dup(gint report_number)3937 gint gsb_data_report_dup ( gint report_number )
3938 {
3939 gint new_report_number;
3940 ReportStruct *report;
3941 ReportStruct *new_report;
3942 GSList *list_tmp;
3943
3944 new_report_number = gsb_data_report_new ( NULL );
3945
3946 report = gsb_data_report_get_structure (report_number);
3947
3948 if ( !report )
3949 return 0;
3950
3951 new_report = gsb_data_report_get_structure (new_report_number);
3952
3953 if ( !new_report )
3954 return 0;
3955
3956 memcpy ( new_report,
3957 report,
3958 sizeof ( ReportStruct ));
3959
3960 /* We have to overwrite report number to be sure this won't
3961 * duplicate old report number. */
3962 new_report -> report_number = new_report_number;
3963
3964 /* we had to duplicate the strings, dates and lists */
3965
3966 if( report -> report_name )
3967 new_report -> report_name = my_strdup ( report -> report_name );
3968 new_report -> financial_year_list = g_slist_copy ( report -> financial_year_list );
3969 new_report -> sorting_type = g_slist_copy ( report -> sorting_type );
3970 new_report -> account_numbers = g_slist_copy ( report -> account_numbers );
3971 new_report -> transfer_account_numbers = g_slist_copy ( report -> transfer_account_numbers );
3972 new_report -> categ_select_struct = gsb_data_report_copy_categ_budget_struct ( report -> categ_select_struct );
3973 new_report -> budget_select_struct = gsb_data_report_copy_categ_budget_struct ( report -> budget_select_struct );
3974 new_report -> payee_numbers = g_slist_copy ( report -> payee_numbers );
3975 new_report -> method_of_payment_list = g_slist_copy ( report -> method_of_payment_list );
3976
3977 new_report -> personal_date_start = gsb_date_copy ( report -> personal_date_start );
3978 new_report -> personal_date_end = gsb_date_copy ( report -> personal_date_end );
3979
3980 list_tmp = report -> text_comparison_list;
3981 new_report -> text_comparison_list = NULL;
3982
3983 while ( list_tmp )
3984 {
3985 gint text_comparison_number;
3986
3987 text_comparison_number = gsb_data_report_text_comparison_dup ( GPOINTER_TO_INT (list_tmp -> data));
3988 gsb_data_report_text_comparison_set_report_number ( text_comparison_number,
3989 new_report_number );
3990 new_report -> text_comparison_list = g_slist_append ( new_report -> text_comparison_list,
3991 GINT_TO_POINTER (text_comparison_number));
3992 list_tmp = list_tmp -> next;
3993 }
3994
3995 list_tmp = report -> amount_comparison_list;
3996 new_report -> amount_comparison_list = NULL;
3997
3998 while ( list_tmp )
3999 {
4000 gint amount_comparison_number;
4001
4002 amount_comparison_number = gsb_data_report_amount_comparison_dup ( GPOINTER_TO_INT (list_tmp -> data));
4003 gsb_data_report_amount_comparison_set_report_number ( amount_comparison_number,
4004 new_report_number );
4005 new_report -> amount_comparison_list = g_slist_append ( new_report -> amount_comparison_list,
4006 GINT_TO_POINTER (amount_comparison_number));
4007 list_tmp = list_tmp -> next;
4008 }
4009
4010 return new_report_number;
4011 }
4012
4013
4014
4015 /**
4016 * check the position of the 2 reports in the list and
4017 * return -1 if first report before second (and +1 else)
4018 *
4019 * \param report_number_1
4020 * \param report_number_2
4021 *
4022 * \return -1 if report_number_1 before, report_number_2, and +1 else, 0 if one of report doesn't exist
4023 * */
gsb_data_report_compare_position(gint report_number_1,gint report_number_2)4024 gint gsb_data_report_compare_position ( gint report_number_1,
4025 gint report_number_2 )
4026 {
4027 gint pos_1, pos_2;
4028 ReportStruct *report_1;
4029 ReportStruct *report_2;
4030
4031 report_1 = gsb_data_report_get_structure ( report_number_1 );
4032 report_2 = gsb_data_report_get_structure ( report_number_2 );
4033
4034 if (!report_1
4035 ||
4036 !report_2 )
4037 return 0;
4038
4039 pos_1 = g_slist_index (report_list, report_1);
4040 pos_2 = g_slist_index (report_list, report_2);
4041 if (pos_1 < pos_2)
4042 return -1;
4043 else
4044 return 1;
4045 }
4046
4047
4048 /**
4049 * change the position of an report in the list of reports
4050 *
4051 * \param report_number the report we want to move
4052 * \param dest_report_number the report before we want to move, or -1 to set at the end of list
4053 *
4054 * \return FALSE
4055 * */
gsb_data_report_move_report(gint report_number,gint dest_report_number)4056 gboolean gsb_data_report_move_report ( gint report_number,
4057 gint dest_report_number )
4058 {
4059 ReportStruct *report;
4060
4061 report = gsb_data_report_get_structure ( report_number );
4062
4063 if (!report )
4064 return FALSE;
4065
4066 /* first, remove the report from the list */
4067 report_list = g_slist_remove ( report_list,
4068 report );
4069
4070 if (dest_report_number != -1)
4071 {
4072 GSList *tmp_list;
4073
4074 tmp_list = report_list;
4075 while (tmp_list)
4076 {
4077 ReportStruct *report_tmp;
4078
4079 report_tmp = tmp_list -> data;
4080
4081 if ( report_tmp && report_tmp -> report_number == dest_report_number)
4082 {
4083 report_list = g_slist_insert_before ( report_list,
4084 tmp_list,
4085 report );
4086 return FALSE;
4087 }
4088 tmp_list = tmp_list -> next;
4089 }
4090 }
4091
4092 /* set the report at the end of list */
4093 report_list = g_slist_append ( report_list,
4094 report );
4095 return FALSE;
4096 }
4097
4098
4099 /**
4100 * get a category/budget and sub-category/budget number and check if they are selected
4101 * in the report
4102 *
4103 * \param list_struct_report a GSList of CategBudgetSel (either categ, either budget)
4104 * \param div_number categ or budget number
4105 * \param sub_div_number sub-categ or sub-budget number
4106 *
4107 * \return TRUE : the couple categ/sub-categ or budget/sub-budget exist, FALSE : it is not in that report
4108 * */
gsb_data_report_check_categ_budget_in_report(GSList * list_struct_report,gint div_number,gint sub_div_number)4109 gboolean gsb_data_report_check_categ_budget_in_report ( GSList *list_struct_report,
4110 gint div_number,
4111 gint sub_div_number )
4112 {
4113 GSList *tmp_list;
4114
4115 tmp_list = list_struct_report;
4116 while (tmp_list)
4117 {
4118 CategBudgetSel *categ_budget_struct = tmp_list -> data;
4119
4120 if (categ_budget_struct -> div_number == div_number)
4121 {
4122 /* found the categ, now check sub-categ */
4123 GSList *sub_categ_budget_list = categ_budget_struct -> sub_div_numbers;
4124
4125 if (g_slist_find (sub_categ_budget_list, GINT_TO_POINTER (sub_div_number)))
4126 return TRUE;
4127 else
4128 /* can return FALSE, needn't to check other categories */
4129 return FALSE;
4130 }
4131 tmp_list = tmp_list -> next;
4132 }
4133 return FALSE;
4134 }
4135
4136
4137 /**
4138 * get the date_select_value
4139 *
4140 * \param report_number the number of the report
4141 *
4142 * \return the date_select_value, -1 if problem
4143 * */
gsb_data_report_get_date_select_value(gint report_number)4144 gint gsb_data_report_get_date_select_value ( gint report_number )
4145 {
4146 ReportStruct *report;
4147
4148 report = gsb_data_report_get_structure ( report_number );
4149
4150 if ( !report )
4151 return -1;
4152
4153 return report -> date_select_value;
4154 }
4155
4156 /**
4157 * set the date_select_value
4158 *
4159 * \param report_number number of the report
4160 * \param date_select_value
4161 *
4162 * \return TRUE if ok
4163 * */
gsb_data_report_set_date_select_value(gint report_number,gint date_select_value)4164 gboolean gsb_data_report_set_date_select_value ( gint report_number,
4165 gint date_select_value )
4166 {
4167 ReportStruct *report;
4168
4169 report = gsb_data_report_get_structure ( report_number );
4170
4171 if ( !report )
4172 return FALSE;
4173
4174 report -> date_select_value = date_select_value;
4175
4176 return TRUE;
4177 }
4178
4179
4180 /**
4181 * get the show_m
4182 *
4183 * \param report_number the number of the report
4184 *
4185 * \return the show_m of the report, -1 if problem
4186 * */
gsb_data_report_get_show_m(gint report_number)4187 gint gsb_data_report_get_show_m ( gint report_number )
4188 {
4189 ReportStruct *report;
4190
4191 report = gsb_data_report_get_structure ( report_number );
4192
4193 if ( !report )
4194 return -1;
4195
4196 return report -> show_m;
4197 }
4198
4199
4200 /**
4201 * set the show_m
4202 *
4203 * \param report_number number of the report
4204 * \param show_m
4205 *
4206 * \return TRUE if ok
4207 * */
gsb_data_report_set_show_m(gint report_number,gint show_m)4208 gboolean gsb_data_report_set_show_m ( gint report_number,
4209 gint show_m )
4210 {
4211 ReportStruct *report;
4212
4213 report = gsb_data_report_get_structure ( report_number );
4214
4215 if ( !report )
4216 return FALSE;
4217
4218 report -> show_m = show_m;
4219
4220 return TRUE;
4221 }
4222
4223
4224 /**
4225 * get the show_p
4226 *
4227 * \param report_number the number of the report
4228 *
4229 * \return the show_p of the report, -1 if problem
4230 * */
gsb_data_report_get_show_p(gint report_number)4231 gint gsb_data_report_get_show_p ( gint report_number )
4232 {
4233 ReportStruct *report;
4234
4235 report = gsb_data_report_get_structure ( report_number );
4236
4237 if ( !report )
4238 return -1;
4239
4240 return report -> show_p;
4241 }
4242
4243 /**
4244 * set the show_p
4245 *
4246 * \param report_number number of the report
4247 * \param show_p
4248 *
4249 * \return TRUE if ok
4250 * */
gsb_data_report_set_show_p(gint report_number,gint show_p)4251 gboolean gsb_data_report_set_show_p ( gint report_number,
4252 gint show_p )
4253 {
4254 ReportStruct *report;
4255
4256 report = gsb_data_report_get_structure ( report_number );
4257
4258 if ( !report )
4259 return FALSE;
4260
4261 report -> show_p = show_p;
4262
4263 return TRUE;
4264 }
4265
4266
4267 /**
4268 * get the show_r
4269 *
4270 * \param report_number the number of the report
4271 *
4272 * \return the show_r of the report, -1 if problem
4273 * */
gsb_data_report_get_show_r(gint report_number)4274 gint gsb_data_report_get_show_r ( gint report_number )
4275 {
4276 ReportStruct *report;
4277
4278 report = gsb_data_report_get_structure ( report_number );
4279
4280 if ( !report )
4281 return -1;
4282
4283 return report -> show_r;
4284 }
4285
4286 /**
4287 * set the show_r
4288 *
4289 * \param report_number number of the report
4290 * \param show_r
4291 *
4292 * \return TRUE if ok
4293 * */
gsb_data_report_set_show_r(gint report_number,gint show_r)4294 gboolean gsb_data_report_set_show_r ( gint report_number,
4295 gint show_r )
4296 {
4297 ReportStruct *report;
4298
4299 report = gsb_data_report_get_structure ( report_number );
4300
4301 if ( !report )
4302 return FALSE;
4303
4304 report -> show_r = show_r;
4305
4306 return TRUE;
4307 }
4308
4309
4310 /**
4311 * get the show_t
4312 *
4313 * \param report_number the number of the report
4314 *
4315 * \return the show_t of the report, -1 if problem
4316 * */
gsb_data_report_get_show_t(gint report_number)4317 gint gsb_data_report_get_show_t ( gint report_number )
4318 {
4319 ReportStruct *report;
4320
4321 report = gsb_data_report_get_structure ( report_number );
4322
4323 if ( !report )
4324 return -1;
4325
4326 return report -> show_t;
4327 }
4328
4329
4330 /**
4331 * set the show_t
4332 *
4333 * \param report_number number of the report
4334 * \param show_t
4335 *
4336 * \return TRUE if ok
4337 * */
gsb_data_report_set_show_t(gint report_number,gint show_t)4338 gboolean gsb_data_report_set_show_t ( gint report_number,
4339 gint show_t )
4340 {
4341 ReportStruct *report;
4342
4343 report = gsb_data_report_get_structure ( report_number );
4344
4345 if ( !report )
4346 return FALSE;
4347
4348 report -> show_t = show_t;
4349
4350 return TRUE;
4351 }
4352
4353
4354 /**
4355 * free the account_numbers_list
4356 *
4357 * \param report_number number of the report
4358 *
4359 * \return
4360 * */
gsb_data_report_free_account_numbers_list(gint report_number)4361 void gsb_data_report_free_account_numbers_list ( gint report_number )
4362 {
4363 ReportStruct *report;
4364
4365 report = gsb_data_report_get_structure ( report_number );
4366
4367 if ( !report )
4368 return;
4369 if ( report -> account_numbers )
4370 g_slist_free ( report -> account_numbers );
4371 report -> account_numbers = NULL;
4372 }
4373
4374
4375 /**
4376 * free the transfert_account_numbers_list
4377 *
4378 * \param report_number number of the report
4379 *
4380 * \return
4381 * */
gsb_data_report_free_transfer_account_numbers_list(gint report_number)4382 void gsb_data_report_free_transfer_account_numbers_list ( gint report_number )
4383 {
4384 ReportStruct *report;
4385
4386 report = gsb_data_report_get_structure ( report_number );
4387
4388 if ( !report )
4389 return;
4390 if ( report -> account_numbers )
4391 g_slist_free ( report -> transfer_account_numbers );
4392 report -> transfer_account_numbers = NULL;
4393 }
4394
4395
4396 /**
4397 * free the method_of_payment_list
4398 *
4399 * \param report_number number of the report
4400 *
4401 * \return
4402 * */
gsb_data_report_free_method_of_payment_list(gint report_number)4403 void gsb_data_report_free_method_of_payment_list ( gint report_number )
4404 {
4405 ReportStruct *report;
4406
4407 report = gsb_data_report_get_structure ( report_number );
4408
4409 if ( !report )
4410 return;
4411
4412 if ( report->method_of_payment_list )
4413 g_slist_free ( report->method_of_payment_list );
4414
4415 report->method_of_payment_list = NULL;
4416 }
4417
4418
4419 /**
4420 * free the sorting_type_list
4421 *
4422 * \param report_number number of the report
4423 *
4424 * \return
4425 * */
gsb_data_report_free_sorting_type_list(gint report_number)4426 void gsb_data_report_free_sorting_type_list ( gint report_number )
4427 {
4428 ReportStruct *report;
4429
4430 report = gsb_data_report_get_structure ( report_number );
4431
4432 if ( !report )
4433 return;
4434
4435 if ( report->sorting_type )
4436 g_slist_free ( report->sorting_type );
4437
4438 report->sorting_type = NULL;
4439 }
4440
4441
4442 /**
4443 * get the ignore_archive 0 by default
4444 *
4445 * \param report_number the number of the report
4446 *
4447 * \return the ignore_archive of the report, -1 if problem
4448 * */
gsb_data_report_get_ignore_archives(gint report_number)4449 gint gsb_data_report_get_ignore_archives ( gint report_number )
4450 {
4451 ReportStruct *report;
4452
4453 report = gsb_data_report_get_structure ( report_number );
4454
4455 if ( !report )
4456 return -1;
4457
4458 return report -> ignore_archives;
4459 }
4460
4461
4462 /**
4463 * set the ignore_archive
4464 *
4465 * \param report_number number of the report
4466 * \param ignore_archive
4467 *
4468 * \return TRUE if ok
4469 * */
gsb_data_report_set_ignore_archives(gint report_number,gint ignore_archives)4470 gboolean gsb_data_report_set_ignore_archives ( gint report_number,
4471 gint ignore_archives )
4472 {
4473 ReportStruct *report;
4474
4475 report = gsb_data_report_get_structure ( report_number );
4476
4477 if ( !report )
4478 return FALSE;
4479
4480 report -> ignore_archives = ignore_archives;
4481
4482 return TRUE;
4483 }
4484
4485
4486 /**
4487 * cherche la valeur d'ignore_archives en fonction de l'état
4488 *
4489 * \param report_number de l'état dont on veut déterminer ignore_archives
4490 *
4491 * \return ignore_archives
4492 * */
gsb_data_report_test_ignore_archives(gint report_number)4493 gint gsb_data_report_test_ignore_archives ( gint report_number )
4494 {
4495 gint ignore_archives = 0; /* valeur par défaut */
4496
4497 if ( gsb_data_report_get_use_financial_year ( report_number ) )
4498 {
4499 gint fyear_number;
4500 gint previous_fyear_number;
4501 GSList *tmp_list;
4502
4503 /* get the current financial year */
4504 fyear_number = gsb_data_fyear_get_from_date ( gdate_today ( ) );
4505
4506 switch ( gsb_data_report_get_financial_year_type ( report_number ) )
4507 {
4508 case 1:
4509 /* want the current financial year */
4510 if ( fyear_number )
4511 ignore_archives = !gsb_data_archive_get_from_fyear ( fyear_number );
4512 break;
4513 case 2:
4514 /* want the previous financial year */
4515 previous_fyear_number = gsb_data_fyear_get_previous_financial_year ( fyear_number );
4516
4517 /* here, last_fyear_number is on the last financial year */
4518 if ( previous_fyear_number )
4519 ignore_archives = !gsb_data_archive_get_from_fyear ( previous_fyear_number );
4520 break;
4521 case 3:
4522 tmp_list = gsb_data_report_get_financial_year_list ( report_number );
4523
4524 while (tmp_list )
4525 {
4526 fyear_number = GPOINTER_TO_INT ( tmp_list->data );
4527
4528 if ( gsb_data_archive_get_from_fyear ( fyear_number ) )
4529 return 0;
4530
4531 tmp_list = tmp_list->next;
4532 }
4533 ignore_archives = 1;
4534 break;
4535 }
4536 }
4537 else
4538 {
4539 GDate *tmp_date;
4540 GDate *tmp_date2;
4541
4542 switch ( gsb_data_report_get_date_type (report_number))
4543 {
4544 case 0:
4545 /* toutes dates */
4546 ignore_archives = 0;
4547 break;
4548 case 1:
4549 /* plage perso */
4550 tmp_date = gsb_data_report_get_personal_date_start ( report_number );
4551 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4552 {
4553 ignore_archives = 0;
4554 break;
4555 }
4556
4557 tmp_date = gsb_data_report_get_personal_date_end ( report_number );
4558 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4559 {
4560 ignore_archives = 0;
4561 break;
4562 }
4563 ignore_archives = 1;
4564 break;
4565 case 2:
4566 /* cumul à ce jour */
4567 ignore_archives = 0;
4568 break;
4569 case 3:
4570 /* mois en cours */
4571 tmp_date2 = gdate_today ();
4572 g_date_set_day ( tmp_date2, 1 );
4573 if ( gsb_data_archive_get_from_date ( tmp_date2 ) )
4574 {
4575 ignore_archives = 0;
4576 g_date_free ( tmp_date2 );
4577 break;
4578 }
4579 tmp_date = gsb_date_get_last_day_of_month ( tmp_date2 );
4580 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4581 {
4582 ignore_archives = 0;
4583 g_date_free ( tmp_date );
4584 g_date_free ( tmp_date2 );
4585 break;
4586 }
4587 ignore_archives = 1;
4588
4589 g_date_free ( tmp_date );
4590 g_date_free ( tmp_date2 );
4591 break;
4592 case 4:
4593 /* année en cours */
4594 tmp_date = gdate_today ();
4595 g_date_set_day ( tmp_date, 1 );
4596 g_date_set_month ( tmp_date, 1 );
4597 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4598 {
4599 ignore_archives = 0;
4600 g_date_free ( tmp_date );
4601 break;
4602 }
4603 g_date_set_month ( tmp_date, 12 );
4604 g_date_set_day ( tmp_date, 31 );
4605 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4606 {
4607 ignore_archives = 0;
4608 g_date_free ( tmp_date );
4609 break;
4610 }
4611 ignore_archives = 1;
4612
4613 g_date_free ( tmp_date );
4614 break;
4615 case 5:
4616 /* cumul mensuel */
4617 tmp_date = gdate_today ();
4618 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4619 {
4620 ignore_archives = 0;
4621 g_date_free ( tmp_date );
4622 break;
4623 }
4624 g_date_set_day ( tmp_date, 1 );
4625 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4626 {
4627 ignore_archives = 0;
4628 g_date_free ( tmp_date );
4629 break;
4630 }
4631 ignore_archives = 1;
4632
4633 g_date_free ( tmp_date );
4634 break;
4635 case 6:
4636 /* cumul annuel */
4637 tmp_date = gdate_today ();
4638 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4639 {
4640 ignore_archives = 0;
4641 g_date_free ( tmp_date );
4642 break;
4643 }
4644 g_date_set_day ( tmp_date, 1 );
4645 g_date_set_month ( tmp_date, 1 );
4646 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4647 {
4648 ignore_archives = 0;
4649 g_date_free ( tmp_date );
4650 break;
4651 }
4652 ignore_archives = 1;
4653
4654 g_date_free ( tmp_date );
4655 break;
4656
4657 case 7:
4658 /* mois précédent */
4659 tmp_date2 = gdate_today ();
4660 g_date_subtract_months ( tmp_date2, 1 );
4661 g_date_set_day ( tmp_date2, 1 );
4662 if ( gsb_data_archive_get_from_date ( tmp_date2 ) )
4663 {
4664 ignore_archives = 0;
4665 g_date_free ( tmp_date2 );
4666 break;
4667 }
4668 tmp_date = gsb_date_get_last_day_of_month ( tmp_date2 );
4669 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4670 {
4671 ignore_archives = 0;
4672 g_date_free ( tmp_date );
4673 g_date_free ( tmp_date2 );
4674 break;
4675 }
4676 ignore_archives = 1;
4677
4678 g_date_free ( tmp_date );
4679 g_date_free ( tmp_date2 );
4680 break;
4681 case 8:
4682 /* année précédente */
4683 tmp_date = gdate_today ();
4684 g_date_subtract_years ( tmp_date, 1 );
4685 g_date_set_day ( tmp_date, 1 );
4686 g_date_set_month ( tmp_date, 1 );
4687 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4688 {
4689 ignore_archives = 0;
4690 g_date_free ( tmp_date );
4691 break;
4692 }
4693 g_date_set_month ( tmp_date, 12 );
4694 g_date_set_day ( tmp_date, 31 );
4695 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4696 {
4697 ignore_archives = 0;
4698 g_date_free ( tmp_date );
4699 break;
4700 }
4701 ignore_archives = 1;
4702
4703 g_date_free ( tmp_date );
4704 break;
4705 case 9:
4706 /* 30 derniers jours */
4707 tmp_date = gdate_today ();
4708 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4709 {
4710 ignore_archives = 0;
4711 g_date_free ( tmp_date );
4712 break;
4713 }
4714 g_date_subtract_days ( tmp_date, 30 );
4715 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4716 {
4717 ignore_archives = 0;
4718 g_date_free ( tmp_date );
4719 break;
4720 }
4721 ignore_archives = 1;
4722
4723 g_date_free ( tmp_date );
4724 break;
4725 case 10:
4726 /* 3 derniers mois */
4727 tmp_date = gdate_today ();
4728 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4729 {
4730 ignore_archives = 0;
4731 g_date_free ( tmp_date );
4732 break;
4733 }
4734 g_date_subtract_months ( tmp_date, 3 );
4735 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4736 {
4737 ignore_archives = 0;
4738 g_date_free ( tmp_date );
4739 break;
4740 }
4741 ignore_archives = 1;
4742
4743 g_date_free ( tmp_date );
4744 break;
4745 case 11:
4746 /* 6 derniers mois */
4747 tmp_date = gdate_today ();
4748 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4749 {
4750 ignore_archives = 0;
4751 g_date_free ( tmp_date );
4752 break;
4753 }
4754 g_date_subtract_months ( tmp_date, 6 );
4755 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4756 {
4757 ignore_archives = 0;
4758 g_date_free ( tmp_date );
4759 break;
4760 }
4761 ignore_archives = 1;
4762
4763 g_date_free ( tmp_date );
4764 break;
4765 case 12:
4766 /* 12 derniers mois */
4767 tmp_date = gdate_today ();
4768 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4769 {
4770 ignore_archives = 0;
4771 g_date_free ( tmp_date );
4772 break;
4773 }
4774 g_date_subtract_months ( tmp_date, 12 );
4775 if ( gsb_data_archive_get_from_date ( tmp_date ) )
4776 {
4777 ignore_archives = 0;
4778 g_date_free ( tmp_date );
4779 break;
4780 }
4781 ignore_archives = 1;
4782
4783 g_date_free ( tmp_date );
4784 break;
4785 }
4786 }
4787
4788 return ignore_archives;
4789 }
4790
4791 /**
4792 *
4793 *
4794 * \param
4795 *
4796 * \return
4797 **/
gsb_data_report_get_compl_name_function(gint report_number)4798 gint gsb_data_report_get_compl_name_function (gint report_number)
4799 {
4800 ReportStruct *report;
4801
4802 report = gsb_data_report_get_structure (report_number);
4803
4804 if (!report)
4805 return 0;
4806
4807 return report->compl_name_function;
4808 }
4809
4810 /**
4811 *
4812 *
4813 * \param
4814 *
4815 * \return
4816 **/
gsb_data_report_set_compl_name_function(gint report_number,gint compl_name_function)4817 gboolean gsb_data_report_set_compl_name_function (gint report_number,
4818 gint compl_name_function)
4819 {
4820 ReportStruct *report;
4821
4822 report = gsb_data_report_get_structure (report_number);
4823
4824 if (!report)
4825 return FALSE;
4826
4827 report->compl_name_function = compl_name_function;
4828
4829 return TRUE;
4830 }
4831
4832 /**
4833 *
4834 *
4835 * \param
4836 *
4837 * \return
4838 **/
gsb_data_report_get_compl_name_position(gint report_number)4839 gint gsb_data_report_get_compl_name_position (gint report_number)
4840 {
4841 ReportStruct *report;
4842
4843 report = gsb_data_report_get_structure (report_number);
4844
4845 if (!report)
4846 return 0;
4847
4848 return report->compl_name_position;
4849 }
4850
4851 /**
4852 *
4853 *
4854 * \param
4855 *
4856 * \return
4857 **/
gsb_data_report_set_compl_name_position(gint report_number,gint compl_name_position)4858 gboolean gsb_data_report_set_compl_name_position (gint report_number,
4859 gint compl_name_position)
4860 {
4861 ReportStruct *report;
4862
4863 report = gsb_data_report_get_structure (report_number);
4864
4865 if (!report)
4866 return FALSE;
4867
4868 report->compl_name_position = compl_name_position;
4869
4870 return TRUE;
4871 }
4872
4873 /**
4874 *
4875 *
4876 * \param
4877 *
4878 * \return
4879 **/
gsb_data_report_get_compl_name_used(gint report_number)4880 gboolean gsb_data_report_get_compl_name_used (gint report_number)
4881 {
4882 ReportStruct *report;
4883
4884 report = gsb_data_report_get_structure (report_number);
4885
4886 if (!report)
4887 return FALSE;
4888
4889 return report->compl_name_used;
4890 }
4891
4892 /**
4893 *
4894 *
4895 * \param
4896 *
4897 * \return
4898 **/
gsb_data_report_set_compl_name_used(gint report_number,gint compl_name_used)4899 gboolean gsb_data_report_set_compl_name_used (gint report_number,
4900 gint compl_name_used)
4901 {
4902 ReportStruct *report;
4903
4904 report = gsb_data_report_get_structure (report_number);
4905
4906 if (!report)
4907 return FALSE;
4908
4909 report->compl_name_used = compl_name_used;
4910
4911 return TRUE;
4912 }
4913
4914 /**
4915 * retourne le nom de fichier pour l'export pdf
4916 *
4917 * \param
4918 *
4919 * \return
4920 **/
gsb_data_report_get_export_pdf_name(gint report_number)4921 gchar *gsb_data_report_get_export_pdf_name (gint report_number)
4922 {
4923 ReportStruct *report;
4924
4925 report = gsb_data_report_get_structure (report_number);
4926
4927 if (!report)
4928 return NULL;
4929
4930 return report->export_pdf_name;
4931 }
4932
4933 /**
4934 * fixe le nom de fichier pour l'export pdf
4935 *
4936 * \param
4937 * \param
4938 *
4939 * \return
4940 **/
gsb_data_report_set_export_pdf_name(gint report_number,gchar * export_pdf_name)4941 gboolean gsb_data_report_set_export_pdf_name (gint report_number,
4942 gchar *export_pdf_name)
4943 {
4944 ReportStruct *report;
4945
4946 report = gsb_data_report_get_structure (report_number);
4947
4948 if (!report)
4949 return FALSE;
4950
4951 report->export_pdf_name = g_strdup (export_pdf_name);
4952
4953 return TRUE;
4954 }
4955
4956 /**
4957 *
4958 *
4959 * \param
4960 *
4961 * \return
4962 **/
gsb_data_report_renum_account_number_0(gint new_account_number)4963 void gsb_data_report_renum_account_number_0 (gint new_account_number)
4964 {
4965 GSList *tmp_list;
4966 gpointer ptr_new_account_number;
4967
4968 ptr_new_account_number = GINT_TO_POINTER (new_account_number);
4969 tmp_list = gsb_data_report_get_report_list ();
4970 while (tmp_list)
4971 {
4972 GSList *account_list;
4973 GSList *new_account_list = NULL;
4974 ReportStruct *report;
4975
4976 report = tmp_list->data;
4977
4978 account_list = report->account_numbers;
4979
4980 while (account_list)
4981 {
4982 gint account_number;
4983
4984 account_number = GPOINTER_TO_INT (account_list->data);
4985 if (account_number == 0)
4986 {
4987 new_account_list = g_slist_append (new_account_list, ptr_new_account_number);
4988 g_free (account_list->data);
4989 }
4990 else
4991 {
4992 new_account_list = g_slist_append (new_account_list, account_list->data);
4993 }
4994
4995 account_list = account_list->next;
4996 }
4997
4998 g_slist_free (report->account_numbers);
4999 report->account_numbers = new_account_list;
5000
5001 tmp_list = tmp_list->next;
5002 }
5003 }
5004
5005 /**
5006 *
5007 *
5008 * \param
5009 *
5010 * \return
5011 **/
gsb_data_report_get_search_report(gint report_number)5012 gboolean gsb_data_report_get_search_report (gint report_number)
5013 {
5014 ReportStruct *report;
5015
5016 report = gsb_data_report_get_structure (report_number);
5017
5018 if (!report)
5019 return FALSE;
5020 else
5021 return report->search_report;
5022 }
5023
5024 /**
5025 *
5026 *
5027 * \param
5028 *
5029 * \return
5030 **/
gsb_data_report_set_search_report(gint report_number)5031 void gsb_data_report_set_search_report (gint report_number)
5032 {
5033 ReportStruct *report;
5034
5035 report = gsb_data_report_get_structure (report_number);
5036
5037 if (!report)
5038 return;
5039
5040 report->search_report = TRUE;
5041 }
5042
5043 /**
5044 *
5045 *
5046 * \param
5047 *
5048 * \return
5049 **/
5050 /* Local Variables: */
5051 /* c-basic-offset: 4 */
5052 /* End: */
5053
5054
5055