Refunds
This commit is contained in:
parent
54534d55b9
commit
291984b684
|
|
@ -61,6 +61,7 @@ class EntityAction extends EnumClass {
|
|||
static const EntityAction clientPortal = _$clientPortal;
|
||||
static const EntityAction newPayment = _$newPayment;
|
||||
static const EntityAction settings = _$settings;
|
||||
static const EntityAction refund = _$refund;
|
||||
static const EntityAction pdf = _$pdf;
|
||||
static const EntityAction more = _$more;
|
||||
static const EntityAction start = _$start;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ const EntityAction _$viewQuote = const EntityAction._('viewQuote');
|
|||
const EntityAction _$clientPortal = const EntityAction._('clientPortal');
|
||||
const EntityAction _$newPayment = const EntityAction._('newPayment');
|
||||
const EntityAction _$settings = const EntityAction._('settings');
|
||||
const EntityAction _$refund = const EntityAction._('refund');
|
||||
const EntityAction _$pdf = const EntityAction._('pdf');
|
||||
const EntityAction _$more = const EntityAction._('more');
|
||||
const EntityAction _$start = const EntityAction._('start');
|
||||
|
|
@ -88,6 +89,8 @@ EntityAction _$valueOf(String name) {
|
|||
return _$newPayment;
|
||||
case 'settings':
|
||||
return _$settings;
|
||||
case 'refund':
|
||||
return _$refund;
|
||||
case 'pdf':
|
||||
return _$pdf;
|
||||
case 'more':
|
||||
|
|
@ -131,6 +134,7 @@ final BuiltSet<EntityAction> _$values =
|
|||
_$clientPortal,
|
||||
_$newPayment,
|
||||
_$settings,
|
||||
_$refund,
|
||||
_$pdf,
|
||||
_$more,
|
||||
_$start,
|
||||
|
|
|
|||
|
|
@ -301,10 +301,13 @@ abstract class PaymentEntity extends Object
|
|||
actions.add(EntityAction.edit);
|
||||
}
|
||||
|
||||
if (userCompany.canEditEntity(this) &&
|
||||
client != null &&
|
||||
client.hasEmailAddress) {
|
||||
actions.add(EntityAction.sendEmail);
|
||||
if (userCompany.canEditEntity(this)) {
|
||||
if (client != null &&
|
||||
client.hasEmailAddress) {
|
||||
actions.add(EntityAction.sendEmail);
|
||||
}
|
||||
|
||||
actions.add(EntityAction.refund);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -266,16 +266,6 @@ class FilterPaymentsByEntity implements PersistUI {
|
|||
|
||||
void handlePaymentAction(
|
||||
BuildContext context, List<BaseEntity> payments, EntityAction action) {
|
||||
assert(
|
||||
[
|
||||
EntityAction.restore,
|
||||
EntityAction.archive,
|
||||
EntityAction.delete,
|
||||
EntityAction.toggleMultiselect
|
||||
].contains(action) ||
|
||||
payments.length == 1,
|
||||
'Cannot perform this action on more than one payment');
|
||||
|
||||
if (payments.isEmpty) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,12 @@ class EntityDataTableSource extends DataTableSource {
|
|||
),
|
||||
ActionMenuButton(
|
||||
entityActions: entity.getActions(
|
||||
userCompany: state.userCompany, includeEdit: true),
|
||||
userCompany: state.userCompany,
|
||||
includeEdit: true,
|
||||
client: entity is BelongsToClient
|
||||
? state.clientState
|
||||
.map[(entity as BelongsToClient)?.clientId]
|
||||
: null),
|
||||
isSaving: false,
|
||||
entity: entity,
|
||||
onSelected: (context, action) =>
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ IconData getEntityActionIcon(EntityAction entityAction) {
|
|||
return Icons.stop;
|
||||
case EntityAction.settings:
|
||||
return Icons.settings;
|
||||
case EntityAction.refund:
|
||||
return Icons.remove_circle_outline;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue