Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Подписание УКД ucd736_05_01_02 UniversalCorrectionDocumentBuyerTitle #1151

Open
sait3d opened this issue Sep 3, 2024 · 2 comments

Comments

@sait3d
Copy link

sait3d commented Sep 3, 2024

Здравствуйте.
Пытаюсь подписать УКД
с помощью userDataContract тип
UniversalCorrectionDocumentBuyerTitle
при
GenerateTitleXml
Выходит ошибка полный текст:
InvalidOperationException: Тип Diadoc.Api.DataXml.ExtendedSignerDetails_CorrectionBuyerTitle не ожидался. Используйте атрибут XmlInclude или SoapInclude для задания типов, которые не известны как статические.

Сам блок подписи
Signers = new object[]
{
new Diadoc.Api.DataXml.ExtendedSignerDetails_BuyerTitle()
{
SignerOrganizationName = DocumentCreator,
Inn = Inn,// организации
FirstName = FirstName,
MiddleName = MiddleName,
LastName = LastName,
Position = Position,
SignerType = signerType,
// действие создание и подписание
SignerPowers = Diadoc.Api.DataXml.ExtendedSignerDetails_BuyerTitleSignerPowers.MadeAndSignOperation,
// сотрудник организации
SignerStatus = Diadoc.Api.DataXml.ExtendedSignerDetailsSignerStatus.AuthorizedPerson
}
}

Если не ExtendedSignerDetails_BuyerTitle то какой нужно использовать в УКД?

@sait3d
Copy link
Author

sait3d commented Oct 3, 2024

private static Diadoc.Api.DataXml.Ucd736.UniversalCorrectionDocumentBuyerTitle BuyerTitle736(
string DocumentCreator, string OperationContent, string Inn,
string FirstName, string MiddleName, string LastName, string Position)
{
Diadoc.Api.DataXml.Ucd736.ExtendedSignerDetailsBase736SignerType signerType = Diadoc.Api.DataXml.Ucd736.ExtendedSignerDetailsBase736SignerType.LegalEntity;
if (Inn.Length == 12)
{ // считаем индивидуальным предпринимателем
signerType = Diadoc.Api.DataXml.Ucd736.ExtendedSignerDetailsBase736SignerType.IndividualEntity;
}
Diadoc.Api.DataXml.Ucd736.UniversalCorrectionDocumentBuyerTitle res = new Diadoc.Api.DataXml.Ucd736.UniversalCorrectionDocumentBuyerTitle
{
DocumentCreator = DocumentCreator, // организация подписант
OperationContent = OperationContent, //"Принято без претензий"

			AcceptanceDate = DateTime.Today.ToShortDateString(),
			
			Signers = new object[]

{
new Diadoc.Api.DataXml.Ucd736.ExtendedSignerDetails_CorrectionBuyerTitle736()
{
SignerOrganizationName = DocumentCreator,
Inn = Inn,// организации
FirstName = FirstName,
MiddleName = MiddleName,
LastName = LastName,
Position = Position,
SignerType = signerType,

				SignerPowersBase="stringSignerPowersBase",
				SignerOrgPowersBase = "stringSignerOrgPowersBase",
				// сотрудник организации
			SignerStatus = Diadoc.Api.DataXml.Ucd736.ExtendedSignerDetails736SignerStatus.BuyerEmployee,
				// действие создание и подписание
			SignerPowers = Diadoc.Api.DataXml.Ucd736.ExtendedSignerDetails_CorrectionBuyerTitle736SignerPowers.ResponsibleForOperationAndSignerForInvoice
			}

}
};
return res;
}

@sait3d
Copy link
Author

sait3d commented Oct 3, 2024

Вот это рабочий вариант функции формирования контента для формирования Тайтла.
Diadoc.Api.DataXml.Ucd736.UniversalCorrectionDocumentBuyerTitle userDataContract = BuyerTitle736(OrgName, OperationContent, issuerInn,
firstName, middleName, lastName, jobTitle);
try
{
generatedTitle = diadocApi.GenerateTitleXml(
authToken,
BoxId,
TypeNamedId,
dFunction,
dVersion,
1, // titleIndex = 1 титул покупателя
userDataContract.SerializeToXml(),
false,
null,
messageId,
entityId
);
}
catch (Exception ex)
{
SqlLib.SaveObjectEvent(2, id_document, "Ошибка генерации титула УКД для подписи : " + ex.Message);
return false;

			}
			content = generatedTitle.Content;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant