Class MergeOrderPositionsTask
java.lang.Object
ch.tocco.nice2.optional.order.api.action.invoice.tasks.AbstractOrderGeneratorTask
ch.tocco.nice2.optional.order.spi.action.invoice.tasks.MergeOrderPositionsTask
- All Implemented Interfaces:
OrderGeneratorTask
,PersistTask<Tuple3<Entity,
InvoicePropertiesContribution, Collection<OrderGeneratorBean>>, Tuple3<Entity, InvoicePropertiesContribution, Collection<OrderGeneratorBean>>>
this task merges Order_position entities if all relations and field on the detail form are the same,
except:
- nr
- quantity
- total_net
- total_vat
- total_gross
- relOrder (we only get Order_position entities from the same orders anyway)
while merging, the quantity and discount fields from two order positions are added up
-
Field Summary
Modifier and TypeFieldDescription -
Constructor Summary
ConstructorDescriptionMergeOrderPositionsTask
(SimpleMergeEntityService simpleMergeEntityService, RefreshTotalsService refreshTotalsService) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
recalculateOrderPositionTotals
(Entity orderPosition, Entity order, Entity settings) void
run
(CommandContext commandContext, Entity settings, InvoicePropertiesContribution properties, Collection<OrderGeneratorBean> beans) void
setContributions
(List<MergePositionTasksContribution> contributions) Methods inherited from class ch.tocco.nice2.optional.order.api.action.invoice.tasks.AbstractOrderGeneratorTask
run
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.exec.PersistTask
andThenDo, compose, compose2, composeWhen, discardResult, expand, expand, getDescription, ifElse, orWhen, orWhenNot, passWhen, passWhenNot, skipErrors, unwrap
-
Field Details
-
fieldsToCheck
-
relationsToCheck
-
-
Constructor Details
-
MergeOrderPositionsTask
public MergeOrderPositionsTask(SimpleMergeEntityService simpleMergeEntityService, RefreshTotalsService refreshTotalsService)
-
-
Method Details
-
run
public void run(CommandContext commandContext, Entity settings, InvoicePropertiesContribution properties, Collection<OrderGeneratorBean> beans) -
recalculateOrderPositionTotals
-
setContributions
-