Set client/group default payment type id

This commit is contained in:
Hillel Coren 2022-10-02 10:16:37 +03:00
parent 601e765172
commit 658177399d
2 changed files with 4 additions and 4 deletions

View File

@ -85,10 +85,7 @@ abstract class PaymentEntity extends Object
amount: 0.0,
transactionReference: '',
date: convertDateTimeToSqlDate(),
typeId: state?.company != null &&
(state.company.settings.defaultPaymentTypeId ?? '').isNotEmpty
? state.company.settings.defaultPaymentTypeId
: '',
typeId: settings.defaultPaymentTypeId ?? '',
clientId: client?.id ?? '',
privateNotes: '',
exchangeRate: 1,

View File

@ -88,6 +88,9 @@ abstract class SettingsEntity
clientSettings?.clientManualPaymentNotification ??
groupSettings?.clientManualPaymentNotification ??
companySettings?.clientManualPaymentNotification,
defaultPaymentTypeId: clientSettings?.defaultPaymentTypeId ??
groupSettings?.defaultPaymentTypeId ??
companySettings?.defaultPaymentTypeId,
);
}