refractor(df/locale):collections module (#1302)
This commit is contained in:
+14
-9
@@ -19,6 +19,9 @@ import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-
|
|||||||
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
||||||
import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';
|
import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Individual Collection Sheet
|
* Individual Collection Sheet
|
||||||
*/
|
*/
|
||||||
@@ -82,13 +85,15 @@ export class IndividualCollectionSheetComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe to format date.
|
* @param {DatePipe} datePipe Date Pipe to format date.
|
||||||
* @param {Dialog} dialog Dialog component.
|
* @param {Dialog} dialog Dialog component.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private collectionsService: CollectionsService,
|
private collectionsService: CollectionsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
public dialog: MatDialog,
|
public dialog: MatDialog,
|
||||||
private router: Router, ) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { officesData: any }) => {
|
this.route.data.subscribe((data: { officesData: any }) => {
|
||||||
this.officesData = data.officesData;
|
this.officesData = data.officesData;
|
||||||
});
|
});
|
||||||
@@ -276,8 +281,8 @@ export class IndividualCollectionSheetComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
previewCollectionSheet() {
|
previewCollectionSheet() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const collectionSheet = {
|
const collectionSheet = {
|
||||||
...this.collectionSheetForm.value,
|
...this.collectionSheetForm.value,
|
||||||
'transactionDate': this.datePipe.transform(this.collectionSheetForm.value.transactionDate, dateFormat),
|
'transactionDate': this.datePipe.transform(this.collectionSheetForm.value.transactionDate, dateFormat),
|
||||||
@@ -304,8 +309,8 @@ export class IndividualCollectionSheetComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.bulkDisbursementTransactionsData['bulkRepaymentTransactions'] = this.bulkRepaymentTransactions;
|
this.bulkDisbursementTransactionsData['bulkRepaymentTransactions'] = this.bulkRepaymentTransactions;
|
||||||
this.bulkDisbursementTransactionsData['bulkSavingsDueTransactions'] = this.bulkSavingsDueTransactions;
|
this.bulkDisbursementTransactionsData['bulkSavingsDueTransactions'] = this.bulkSavingsDueTransactions;
|
||||||
const finalSubmitData = {
|
const finalSubmitData = {
|
||||||
|
|||||||
Reference in New Issue
Block a user