private static void AddShiftPosition(ServiceDocument serviceDocument, Guid sourceWarehouseId, Guid destinationWarehouseId, List <WarehouseDocument> shiftDocumentsList, Guid itemId, decimal quantity, Guid unitId)
        {
            WarehouseDocument shift = (from doc in shiftDocumentsList
                                       where doc.WarehouseId == sourceWarehouseId &&
                                       doc.Attributes.Children.Where(a => a.DocumentFieldName == DocumentFieldName.ShiftDocumentAttribute_OppositeWarehouseId)
                                       .First().Value.Value.ToUpperInvariant() == destinationWarehouseId.ToUpperString()
                                       select doc).FirstOrDefault();

            if (shift == null) //tworzymy takiego szifta
            {
                using (DocumentCoordinator c = new DocumentCoordinator(false, false))
                {
                    string processType = serviceDocument.Attributes[DocumentFieldName.Attribute_ProcessType].Value.Value;
                    string template    = ProcessManager.Instance.GetDocumentTemplate(serviceDocument, "outcomeShift");
                    shift = (WarehouseDocument)c.CreateNewBusinessObject(BusinessObjectType.WarehouseDocument, template, null);
                    ProcessManager.Instance.AppendProcessAttributes(shift, processType, "outcomeShift", serviceDocument.Id, DocumentRelationType.ServiceToOutcomeShift);
                    DuplicableAttributeFactory.DuplicateAttributes(serviceDocument, shift);
                    serviceDocument.AddRelatedObject(shift);
                    shiftDocumentsList.Add(shift);
                    shift.WarehouseId = sourceWarehouseId;
                    var dstWarehouseId = shift.Attributes[DocumentFieldName.ShiftDocumentAttribute_OppositeWarehouseId];

                    if (dstWarehouseId == null)
                    {
                        dstWarehouseId = shift.Attributes.CreateNew();
                        dstWarehouseId.DocumentFieldName = DocumentFieldName.ShiftDocumentAttribute_OppositeWarehouseId;
                    }

                    dstWarehouseId.Value.Value = destinationWarehouseId.ToUpperString();
                }
            }

            //sprawdzamy czy moze juz jest pozycja na ten sam towar. jak jest to edytujemy quantity, jak nie to tworzymy nowa
            WarehouseDocumentLine line = shift.Lines.Children.Where(l => l.ItemId == itemId).FirstOrDefault();

            if (line == null)
            {
                line        = shift.Lines.CreateNew();
                line.ItemId = itemId;
                line.UnitId = unitId;
            }

            line.Quantity += quantity;
        }