From fc29a8f94c250348698affdcc54038a0209be92f Mon Sep 17 00:00:00 2001 From: DitriXNew Date: Thu, 30 Nov 2023 01:19:51 +0300 Subject: [PATCH] Translate --- IRP/src/CommonForms/CodeStringCheck/Form.form | 304 ++++++++++++++++++ .../CommonForms/CodeStringCheck/Module.bsl | 74 +++-- .../PasteFromClipboardSettings/Module.bsl | 3 +- .../ControlCodeStringClient.mdo | 18 ++ .../ControlCodeStringClient/Module.bsl | 78 +++++ .../ControlCodeStringServer.mdo | 19 ++ .../ControlCodeStringServer/Module.bsl | 38 +++ .../EquipmentFiscalPrinterClient/Module.bsl | 132 ++++---- .../EquipmentFiscalPrinterServer/Module.bsl | 302 +++++++++-------- .../CommonModules/RowIDInfoServer/Module.bsl | 6 +- IRP/src/Configuration/Configuration.mdo | 2 + .../PointOfSale/Forms/Form/Module.bsl | 14 +- .../RetailReturnReceipt.mdo | 48 ++- .../RetailSalesReceipt/RetailSalesReceipt.mdo | 49 ++- .../_8510FiscalPrinter.feature | 291 +++++++++++++++-- 15 files changed, 1119 insertions(+), 259 deletions(-) create mode 100644 IRP/src/CommonModules/ControlCodeStringClient/ControlCodeStringClient.mdo create mode 100644 IRP/src/CommonModules/ControlCodeStringClient/Module.bsl create mode 100644 IRP/src/CommonModules/ControlCodeStringServer/ControlCodeStringServer.mdo create mode 100644 IRP/src/CommonModules/ControlCodeStringServer/Module.bsl diff --git a/IRP/src/CommonForms/CodeStringCheck/Form.form b/IRP/src/CommonForms/CodeStringCheck/Form.form index 918e8b3277..7ba17059dd 100644 --- a/IRP/src/CommonForms/CodeStringCheck/Form.form +++ b/IRP/src/CommonForms/CodeStringCheck/Form.form @@ -102,6 +102,106 @@ true + + ControlCodeStringType + 60 + true + true + + true + + + ControlCodeStringType + + + OnChange + ControlCodeStringTypeOnChange + + + ControlCodeStringTypeExtendedTooltip + 62 + true + true + + true + + Label + true + true + + Left + + + + ControlCodeStringTypeContextMenu + 61 + true + true + + true + + true + + RadioButtonField + Enter + true + Left + true + + Tumbler + + + en + None + + + ru + Нет + + + tr + Yok + + + Enum.ControlCodeStringType.EnumValue.None + + + + + en + Marking code + + + ru + Честный знак + + + tr + Etiketleme kodu + + + Enum.ControlCodeStringType.EnumValue.MarkingCode + + + + + en + Good code + + + ru + Код честного знака + + + tr + Честный знак + + + Enum.ControlCodeStringType.EnumValue.GoodCodeData + + + + GroupTop 39 @@ -433,6 +533,120 @@ Copy SortListAsc SelectAll + + CurrentCodesControlCodeStringType + 63 + + <key>en</key> + <value>Type</value> + + + <key>ru</key> + <value>Вид</value> + + + <key>tr</key> + <value>Tip</value> + + true + true + + true + + + CurrentCodes.ControlCodeStringType + + + CurrentCodesControlCodeStringTypeExtendedTooltip + 65 + true + true + + true + + Label + true + true + + Left + + + + CurrentCodesControlCodeStringTypeContextMenu + 64 + true + true + + true + + true + + InputField + Enter + true + Left + true + + 5 + true + true + true + true + true + true + + + + CurrentCodesPrefix + 66 + true + true + + true + + + CurrentCodes.Prefix + + + CurrentCodesPrefixExtendedTooltip + 68 + true + true + + true + + Label + true + true + + Left + + + + CurrentCodesPrefixContextMenu + 67 + true + true + + true + + true + + InputField + Enter + true + Left + true + + 5 + true + true + true + true + true + true + + CurrentCodesStringCode 28 @@ -499,6 +713,18 @@ CurrentCodesCodeIsApproved 31 + + <key>en</key> + <value>Approved</value> + + + <key>ru</key> + <value>Одобрено</value> + + + <key>tr</key> + <value>Approved</value> + true true @@ -1143,6 +1369,59 @@ true + + ControlCodeStringType + + <key>en</key> + <value>Type</value> + + + <key>ru</key> + <value>Вид</value> + + + <key>tr</key> + <value>Tip</value> + + 16 + + EnumRef.ControlCodeStringType + + + true + + + true + + + + Prefix + + <key>en</key> + <value>Prefix</value> + + + <key>ru</key> + <value>Префикс</value> + + + <key>tr</key> + <value>Önek</value> + + 17 + + String + + 50 + + + + true + + + true + + isReturn @@ -1219,6 +1498,31 @@ true + + ControlCodeStringType + + <key>en</key> + <value>Control code string type</value> + + + <key>ru</key> + <value>Тип маркировки товаров</value> + + + <key>tr</key> + <value>Kontrol kodu satır tipi</value> + + 15 + + EnumRef.ControlCodeStringType + + + true + + + true + + SearchByBarcode diff --git a/IRP/src/CommonForms/CodeStringCheck/Module.bsl b/IRP/src/CommonForms/CodeStringCheck/Module.bsl index 996e690032..8e8c04100a 100644 --- a/IRP/src/CommonForms/CodeStringCheck/Module.bsl +++ b/IRP/src/CommonForms/CodeStringCheck/Module.bsl @@ -9,6 +9,8 @@ Procedure OnCreateAtServer(Cancel, StandardProcessing) LineNumber = Parameters.LineNumber; RowKey = Parameters.RowKey; isReturn = Parameters.isReturn; + ControlCodeStringType = Item.ControlCodeStringType; + //@skip-check property-return-type, statement-type-change AdditionalCheckIsOn = Parameters.Item.CheckCodeString; Items.DecorationCheckIsOff.Visible = Not AdditionalCheckIsOn; @@ -22,6 +24,10 @@ Procedure OnOpen(Cancel) NewRow.StringCode = Row.CodeString; NewRow.CodeIsApproved = Row.CodeIsApproved; NewRow.NotCheck = Row.NotCheck; + NewRow.ControlCodeStringType = Row.ControlCodeStringType; + NewRow.Prefix = Row.Prefix; + + ControlCodeStringType = Row.ControlCodeStringType; // Get from last row EndDo; EndProcedure @@ -67,7 +73,7 @@ Async Procedure SearchByBarcodeEnd(Result, AdditionalParameters = Undefined) Exp EndDo; For Each StrCode In ArrayOfCodeStrings Do - If CheckCodeString(StrCode) Then + If ControlCodeStringClient.ValidateCodeString(ControlCodeStringType, StrCode) Then //@skip-check property-return-type, dynamic-access-method-not-found, variable-value-type dblRows = FormOwner.Object.ControlCodeStrings.FindRows(New Structure("CodeString", StrCode)); @@ -92,33 +98,38 @@ Async Procedure SearchByBarcodeEnd(Result, AdditionalParameters = Undefined) Exp AllBarcodesIsOk = True; For Each StringCode In ArrayOfApprovedCodeStrings Do // String - If AdditionalCheckIsOn Then - RequestKMSettings = EquipmentFiscalPrinterAPIClient.RequestKMInput(isReturn); - RequestKMSettings.Quantity = 1; - RequestKMSettings.MarkingCode = StringCode; - Result = Await EquipmentFiscalPrinterClient.CheckKM(Hardware, RequestKMSettings, True); // See EquipmentFiscalPrinterAPIClient.GetProcessingKMResultSettings - - If Not Result.Info.Success Then - CommonFunctionsClientServer.ShowUsersMessage(Result.Info.Error); - Return; - EndIf; - - If Not Result.Info.Approved Then + If AdditionalCheckIsOn AND ControlCodeStringType = PredefinedValue("Enum.ControlCodeStringType.MarkingCode") Then + If Await ControlCodeStringClient.CheckMarkingCode(StringCode, Hardware, isReturn) Then + NewRow = CurrentCodes.Add(); + NewRow.StringCode = StringCode; + NewRow.CodeIsApproved = True; + NewRow.ControlCodeStringType = ControlCodeStringType; + Else AllBarcodesIsOk = False; - //@skip-check transfer-object-between-client-server - Log.Write("CodeStringCheck.CheckKM.Approved.False", Result, , , Hardware); - //@skip-check invocation-parameter-type-intersect, property-return-type - CommonFunctionsClientServer.ShowUsersMessage(StrTemplate(R().EqFP_ProblemWhileCheckCodeString, StringCode)); - Return; EndIf; - NewRow = CurrentCodes.Add(); - NewRow.StringCode = StringCode; - NewRow.CodeIsApproved = Result.Info.Approved; + ElsIf AdditionalCheckIsOn AND ControlCodeStringType = PredefinedValue("Enum.ControlCodeStringType.GoodCodeData") Then + If ControlCodeStringClient.CheckGoodCodeData(StringCode, Hardware, isReturn) Then + + GoodData = GetGoodData(StringCode); + + If Not GoodData = Undefined Then + NewRow = CurrentCodes.Add(); + NewRow.StringCode = GoodData.CodeString; + NewRow.CodeIsApproved = True; + NewRow.Prefix = GoodData.Type; + NewRow.ControlCodeStringType = ControlCodeStringType; + Else + AllBarcodesIsOk = False; + EndIf; + Else + AllBarcodesIsOk = False; + EndIf; Else NewRow = CurrentCodes.Add(); NewRow.StringCode = StringCode; NewRow.CodeIsApproved = True; NewRow.NotCheck = True; + NewRow.ControlCodeStringType = ControlCodeStringType; EndIf; EndDo; @@ -128,6 +139,11 @@ Async Procedure SearchByBarcodeEnd(Result, AdditionalParameters = Undefined) Exp EndProcedure +&AtServer +Function GetGoodData(Val StringCode) + Return ControlCodeStringServer.GetGoodData(ControlCodeStringType, StringCode); +EndFunction + &AtClient Procedure ApproveWithoutScan(Command) Close(New Structure("WithoutScan", True)); @@ -144,23 +160,21 @@ Procedure Done(Command = Undefined) Str.Insert("CodeString", Row.StringCode); Str.Insert("CodeIsApproved", Row.CodeIsApproved); Str.Insert("NotCheck", Row.NotCheck); + Str.Insert("ControlCodeStringType", Row.ControlCodeStringType); + Str.Insert("Prefix", Row.Prefix); Array.Add(Str); EndDo; Result.Insert("Scaned", Array); Close(Result); EndProcedure -&AtClient -Function CheckCodeString(StrCode) - If StrLen(StrCode) < 20 Then - Return False; - EndIf; - - Return True; -EndFunction - &AtClient Procedure GetCodeStringFromSerialLotNumber(Command) Items.GetCodeStringFromSerialLotNumber.Visible = True; GetCodeStringFromSerialLotNumber = True; +EndProcedure + +&AtClient +Procedure ControlCodeStringTypeOnChange(Item) + CurrentCodes.Clear(); EndProcedure \ No newline at end of file diff --git a/IRP/src/CommonForms/PasteFromClipboardSettings/Module.bsl b/IRP/src/CommonForms/PasteFromClipboardSettings/Module.bsl index c57a387aa2..bc756bf003 100644 --- a/IRP/src/CommonForms/PasteFromClipboardSettings/Module.bsl +++ b/IRP/src/CommonForms/PasteFromClipboardSettings/Module.bsl @@ -15,11 +15,12 @@ Procedure FillSettingsAndClose() If Not CheckFilling() Then Return; EndIf; + + Close(); Settings = CopyPasteClient.PasteSettings(); FillPropertyValues(Settings, ThisObject); ExecuteNotifyProcessing(ThisObject.OnCloseNotifyDescription, Settings); - Close(); EndProcedure &AtClient diff --git a/IRP/src/CommonModules/ControlCodeStringClient/ControlCodeStringClient.mdo b/IRP/src/CommonModules/ControlCodeStringClient/ControlCodeStringClient.mdo new file mode 100644 index 0000000000..fb33fcd1f8 --- /dev/null +++ b/IRP/src/CommonModules/ControlCodeStringClient/ControlCodeStringClient.mdo @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="98b8056b-86b0-4187-968f-2ca0615ed495"> + <name>ControlCodeStringClient</name> + <synonym> + <key>en</key> + <value>Control code string client</value> + </synonym> + <synonym> + <key>ru</key> + <value>Контрольный знак клиент</value> + </synonym> + <synonym> + <key>tr</key> + <value>Строка кода маркировки клиент</value> + </synonym> + <clientManagedApplication>true</clientManagedApplication> + <clientOrdinaryApplication>true</clientOrdinaryApplication> +</mdclass:CommonModule> \ No newline at end of file diff --git a/IRP/src/CommonModules/ControlCodeStringClient/Module.bsl b/IRP/src/CommonModules/ControlCodeStringClient/Module.bsl new file mode 100644 index 0000000000..dfca47173e --- /dev/null +++ b/IRP/src/CommonModules/ControlCodeStringClient/Module.bsl @@ -0,0 +1,78 @@ +// @strict-types + +// Validate code string. +// +// Parameters: +// ControlCodeStringType - EnumRef.ControlCodeStringType - Control code string type +// StringCode - String - Str code +// +// Returns: +// Boolean - Validate code string +Function ValidateCodeString(ControlCodeStringType, StringCode) Export + If StrLen(StringCode) < 20 Then + Return False; + EndIf; + + Return True; +EndFunction + +// Check good code data. +// +// Parameters: +// StringCode - String - String code +// Hardware - CatalogRef.Hardware - Hardware +// isReturn - Boolean - Is return +// +// Returns: +// Boolean +Function CheckGoodCodeData(StringCode, Hardware, isReturn) Export + If StringCode = "TestFalseString" Then + CommonFunctionsClientServer.ShowUsersMessage(StrTemplate(R().EqFP_ProblemWhileCheckCodeString, StringCode)); + Return False; + EndIf; + Return True; +EndFunction + +// Check marking code. +// +// Parameters: +// StringCode - String - String code +// Hardware - CatalogRef.Hardware - Hardware +// isReturn - Boolean - Is return +// +// Returns: +// Boolean - Check marking code +Async Function CheckMarkingCode(StringCode, Hardware, isReturn) Export + OpenSessionRegistrationKMSettings = EquipmentFiscalPrinterAPIClient.OpenSessionRegistrationKMSettings(); + If Not Await EquipmentFiscalPrinterAPIClient.OpenSessionRegistrationKM(Hardware, OpenSessionRegistrationKMSettings) Then + CommonFunctionsClientServer.ShowUsersMessage(OpenSessionRegistrationKMSettings.Info.Error + Chars.LF + R().EqFP_CanNotOpenSessionRegistrationKM); + Return False; + EndIf; + + RequestKMSettings = EquipmentFiscalPrinterAPIClient.RequestKMInput(isReturn); + RequestKMSettings.Quantity = 1; + RequestKMSettings.MarkingCode = StringCode; + Result = Await EquipmentFiscalPrinterClient.CheckKM(Hardware, RequestKMSettings); // See EquipmentFiscalPrinterAPIClient.GetProcessingKMResultSettings + + CloseSessionRegistrationKMSettings = EquipmentFiscalPrinterAPIClient.CloseSessionRegistrationKMSettings(); + If Not Await EquipmentFiscalPrinterAPIClient.CloseSessionRegistrationKM(Hardware, CloseSessionRegistrationKMSettings) Then + CommonFunctionsClientServer.ShowUsersMessage(CloseSessionRegistrationKMSettings.Info.Error + Chars.LF + R().EqFP_CanNotCloseSessionRegistrationKM); + Return False; + EndIf; + + If Not Result.Info.Success Then + CommonFunctionsClientServer.ShowUsersMessage(Result.Info.Error); + Return False; + EndIf; + + If Not Result.Info.Approved Then + //@skip-check transfer-object-between-client-server + Log.Write("CodeStringCheck.CheckKM.Approved.False", Result, , , Hardware); + //@skip-check invocation-parameter-type-intersect, property-return-type + CommonFunctionsClientServer.ShowUsersMessage(StrTemplate(R().EqFP_ProblemWhileCheckCodeString, StringCode)); + Return False; + EndIf; + + Return Result.Info.Approved +EndFunction + diff --git a/IRP/src/CommonModules/ControlCodeStringServer/ControlCodeStringServer.mdo b/IRP/src/CommonModules/ControlCodeStringServer/ControlCodeStringServer.mdo new file mode 100644 index 0000000000..21c71d63fe --- /dev/null +++ b/IRP/src/CommonModules/ControlCodeStringServer/ControlCodeStringServer.mdo @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="451d348c-05b1-4c27-9983-3c2a71875ce0"> + <name>ControlCodeStringServer</name> + <synonym> + <key>en</key> + <value>Control code string server</value> + </synonym> + <synonym> + <key>ru</key> + <value>Контрольный знак сервер</value> + </synonym> + <synonym> + <key>tr</key> + <value>Строка кода маркировки сервер</value> + </synonym> + <server>true</server> + <externalConnection>true</externalConnection> + <clientOrdinaryApplication>true</clientOrdinaryApplication> +</mdclass:CommonModule> \ No newline at end of file diff --git a/IRP/src/CommonModules/ControlCodeStringServer/Module.bsl b/IRP/src/CommonModules/ControlCodeStringServer/Module.bsl new file mode 100644 index 0000000000..55922e55a8 --- /dev/null +++ b/IRP/src/CommonModules/ControlCodeStringServer/Module.bsl @@ -0,0 +1,38 @@ +// @strict-types + +// Get marking code string. +// +// Parameters: +// CodeString - String - Code string +// +// Returns: +// String +Function GetMarkingCodeString(Val CodeString) Export + If Not CommonFunctionsClientServer.isBase64Value(CodeString) Then + CodeString = Base64String(GetBinaryDataFromString(CodeString, TextEncoding.UTF8, False)); + EndIf; + Return CodeString; +EndFunction + +// Get good data. +// +// Parameters: +// ControlCodeStringType - EnumRef.ControlCodeStringType - +// CodeString - String - Code string +// +// Returns: +// Structure - Fill good data: +// * Type - String - +// * CodeString - String - +Function GetGoodData(ControlCodeStringType, Val CodeString) Export + Result = New Structure; + Result.Insert("Type", "NotIdentified"); + Result.Insert("CodeString", CodeString); + //@skip-check property-return-type + If ControlCodeStringType = Enums.ControlCodeStringType.GoodCodeData Then + If Not CommonFunctionsClientServer.isBase64Value(CodeString) Then + Result.CodeString = Base64String(GetBinaryDataFromString(CodeString, TextEncoding.UTF8, False)); + EndIf; + EndIf; + Return Result; +EndFunction \ No newline at end of file diff --git a/IRP/src/CommonModules/EquipmentFiscalPrinterClient/Module.bsl b/IRP/src/CommonModules/EquipmentFiscalPrinterClient/Module.bsl index a58b5fecbd..91aec03225 100644 --- a/IRP/src/CommonModules/EquipmentFiscalPrinterClient/Module.bsl +++ b/IRP/src/CommonModules/EquipmentFiscalPrinterClient/Module.bsl @@ -145,9 +145,22 @@ Async Function ProcessCheck(ConsolidatedRetailSales, DataSource) Export CheckPackage = EquipmentFiscalPrinterAPIClient.CheckPackage(); EquipmentFiscalPrinterServer.FillData(DataSource, CheckPackage); - - Await CheckControlStrings(DataSource, CRS); - + + If TypeOf(DataSource) = Type("DocumentRef.RetailSalesReceipt") + Or TypeOf(DataSource) = Type("DocumentRef.RetailReturnReceipt") Then + + isReturn = TypeOf(DataSource) = Type("DocumentRef.RetailReturnReceipt"); + CodeStringList = EquipmentFiscalPrinterServer.GetMarkingCode(DataSource); + + If Not CodeStringList.Count() = 0 Then + CheckControlStrings = Await CheckControlStrings(DataSource, CRS, isReturn, CodeStringList); + + If Not CheckControlStrings.Info.Success Then + Return CheckControlStrings; + EndIf; + EndIf; + EndIf; + ProcessCheckSettings.In.CheckPackage = CheckPackage; If Await EquipmentFiscalPrinterAPIClient.ProcessCheck(CRS.FiscalPrinter, ProcessCheckSettings) Then DataPresentation = String(ProcessCheckSettings.Out.DocumentOutputParameters.ShiftNumber) + " " + ProcessCheckSettings.Out.DocumentOutputParameters.DateTime; @@ -183,45 +196,45 @@ Procedure ValidateProcessCheck(DataSource) EndProcedure //@skip-check function-should-return-value -Async Function CheckControlStrings(DataSource, CRS) - If TypeOf(DataSource) = Type("DocumentRef.RetailSalesReceipt") - Or TypeOf(DataSource) = Type("DocumentRef.RetailReturnReceipt") Then - isReturn = TypeOf(DataSource) = Type("DocumentRef.RetailReturnReceipt"); - CodeStringList = EquipmentFiscalPrinterServer.GetStringCode(DataSource); +Async Function CheckControlStrings(DataSource, CRS, isReturn, CodeStringList) + + Result = New Structure("Info", New Structure("Success", True)); + + OpenSessionRegistrationKMSettings = EquipmentFiscalPrinterAPIClient.OpenSessionRegistrationKMSettings(); + If Not Await EquipmentFiscalPrinterAPIClient.OpenSessionRegistrationKM(CRS.FiscalPrinter, OpenSessionRegistrationKMSettings) Then + OpenSessionRegistrationKMSettings.Info.Error = OpenSessionRegistrationKMSettings.Info.Error + Chars.LF + R().EqFP_CanNotOpenSessionRegistrationKM; + Return OpenSessionRegistrationKMSettings; + EndIf; + + ArrayForApprove = New Array; // Array Of String + For Each CodeString In CodeStringList Do + RequestKMSettings = EquipmentFiscalPrinterAPIClient.RequestKMInput(isReturn); + RequestKMSettings.MarkingCode = CodeString; + RequestKMSettings.Quantity = 1; + CheckResult = Await CheckKM(CRS.FiscalPrinter, RequestKMSettings); // See EquipmentFiscalPrinterAPIClient.GetProcessingKMResultSettings + If Not CheckResult.Info.Success Then + CloseSessionRegistrationKMSettings = EquipmentFiscalPrinterAPIClient.CloseSessionRegistrationKMSettings(); + Await EquipmentFiscalPrinterAPIClient.CloseSessionRegistrationKM(CRS.FiscalPrinter, CloseSessionRegistrationKMSettings); + Return CheckResult; + EndIf; - If CodeStringList.Count() > 0 Then - OpenSessionRegistrationKMSettings = EquipmentFiscalPrinterAPIClient.OpenSessionRegistrationKMSettings(); - If Not Await EquipmentFiscalPrinterAPIClient.OpenSessionRegistrationKM(CRS.FiscalPrinter, OpenSessionRegistrationKMSettings) Then - CommonFunctionsClientServer.ShowUsersMessage(OpenSessionRegistrationKMSettings.Info.Error); - Raise R().EqFP_CanNotOpenSessionRegistrationKM; - EndIf; + If Not CheckResult.Info.Approved Then + CheckResult.Info.Error = CheckResult.Info.Error + Chars.LF + StrTemplate(R().EqFP_ProblemWhileCheckCodeString, GetStringFromBinaryData(Base64Value(RequestKMSettings.MarkingCode))); + Return CheckResult; + EndIf; + ArrayForApprove.Add(RequestKMSettings.GUID); + EndDo; - ArrayForApprove = New Array; // Array Of String - For Each CodeString In EquipmentFiscalPrinterServer.GetStringCode(DataSource) Do - RequestKMSettings = EquipmentFiscalPrinterAPIClient.RequestKMInput(isReturn); - RequestKMSettings.MarkingCode = CodeString; - RequestKMSettings.Quantity = 1; - CheckResult = Await CheckKM(CRS.FiscalPrinter, RequestKMSettings, False); // See EquipmentFiscalPrinterAPIClient.GetProcessingKMResultSettings - If Not CheckResult.Info.Success Then - Raise CheckResult.Info.Error; - EndIf; - - If Not CheckResult.Info.Approved Then - Raise StrTemplate(R().EqFP_ProblemWhileCheckCodeString, GetStringFromBinaryData(Base64Value(RequestKMSettings.MarkingCode))); - EndIf; - ArrayForApprove.Add(RequestKMSettings.GUID); - EndDo; - - For Each ApproveUUID In ArrayForApprove Do - ConfirmKMSettings = EquipmentFiscalPrinterAPIClient.ConfirmKMSettings(); - ConfirmKMSettings.In.GUID = ApproveUUID; - If Not Await EquipmentFiscalPrinterAPIClient.ConfirmKM(CRS.FiscalPrinter, ConfirmKMSettings) Then - CommonFunctionsClientServer.ShowUsersMessage(ConfirmKMSettings.Info.Error); - Raise StrTemplate(R().EqFP_ErrorWhileConfirmCode, ApproveUUID); - EndIf; - EndDo; + For Each ApproveUUID In ArrayForApprove Do + ConfirmKMSettings = EquipmentFiscalPrinterAPIClient.ConfirmKMSettings(); + ConfirmKMSettings.In.GUID = ApproveUUID; + If Not Await EquipmentFiscalPrinterAPIClient.ConfirmKM(CRS.FiscalPrinter, ConfirmKMSettings) Then + ConfirmKMSettings.Info.Error = ConfirmKMSettings.Info.Error + Chars.LF + StrTemplate(R().EqFP_ErrorWhileConfirmCode, ApproveUUID); + Return ConfirmKMSettings EndIf; - EndIf; + EndDo; + + Return Result; EndFunction // Print check copy. @@ -387,21 +400,13 @@ EndFunction // // Returns: // See EquipmentFiscalPrinterAPIClient.GetProcessingKMResultSettings -Async Function CheckKM(Hardware, RequestKM, OpenAndClose = False) Export - - If OpenAndClose Then - OpenSessionRegistrationKMSettings = EquipmentFiscalPrinterAPIClient.OpenSessionRegistrationKMSettings(); - If Not Await EquipmentFiscalPrinterAPIClient.OpenSessionRegistrationKM(Hardware, OpenSessionRegistrationKMSettings) Then - CommonFunctionsClientServer.ShowUsersMessage(OpenSessionRegistrationKMSettings.Info.Error); - Raise R().EqFP_CanNotOpenSessionRegistrationKM; - EndIf; - EndIf; +Async Function CheckKM(Hardware, RequestKM) Export RequestKMSettings = EquipmentFiscalPrinterAPIClient.RequestKMSettings(); RequestKMSettings.In.RequestKM = RequestKM; If Not Await EquipmentFiscalPrinterAPIClient.RequestKM(Hardware, RequestKMSettings) Then - CommonFunctionsClientServer.ShowUsersMessage(RequestKMSettings.Info.Error); - Raise R().EqFP_CanNotRequestKM; + RequestKMSettings.Info.Error = RequestKMSettings.Info.Error + Chars.LF + R().EqFP_CanNotRequestKM; + Return RequestKMSettings; EndIf; ResultIsCorrect = False; @@ -411,12 +416,13 @@ Async Function CheckKM(Hardware, RequestKM, OpenAndClose = False) Export GetProcessingKMResultSettings = EquipmentFiscalPrinterAPIClient.GetProcessingKMResultSettings(); GetProcessingKMResultSettings.Info.GUID = RequestKMSettings.In.RequestKM.GUID; If Not Await EquipmentFiscalPrinterAPIClient.GetProcessingKMResult(Hardware, GetProcessingKMResultSettings) Then - CommonFunctionsClientServer.ShowUsersMessage(RequestKMSettings.Info.Error); - Raise R().EqFP_CanNotGetProcessingKMResult; + GetProcessingKMResultSettings.Info.Error = RequestKMSettings.Info.Error + Chars.LF + R().EqFP_CanNotGetProcessingKMResult; + Return GetProcessingKMResultSettings; EndIf; If GetProcessingKMResultSettings.Out.RequestStatus = 2 Then - Raise R().EqFP_GetWrongAnswerFromProcessingKM; + GetProcessingKMResultSettings.Info.Error = RequestKMSettings.Info.Error + Chars.LF + R().EqFP_GetWrongAnswerFromProcessingKM; + Return GetProcessingKMResultSettings; EndIf; If GetProcessingKMResultSettings.Out.RequestStatus = 1 Then @@ -431,19 +437,23 @@ Async Function CheckKM(Hardware, RequestKM, OpenAndClose = False) Export Break; EndDo; - If OpenAndClose Then - CloseSessionRegistrationKMSettings = EquipmentFiscalPrinterAPIClient.CloseSessionRegistrationKMSettings(); - If Not Await EquipmentFiscalPrinterAPIClient.CloseSessionRegistrationKM(Hardware, CloseSessionRegistrationKMSettings) Then - Raise R().EqFP_CanNotCloseSessionRegistrationKM; - EndIf; - EndIf; - If Not ResultIsCorrect Then - Raise R().EqFP_GetWrongAnswerFromProcessingKM; + GetProcessingKMResultSettings.Info.Error = RequestKMSettings.Info.Error + Chars.LF + R().EqFP_GetWrongAnswerFromProcessingKM; + Return GetProcessingKMResultSettings; EndIf; GetProcessingKMResultSettings.Info.Approved = HardwareClient.GetAPIModule(Hardware).isCodeStringApproved(GetProcessingKMResultSettings); + If RequestKMSettings.In.RequestKM.MarkingCode = "TestFalseString" + OR RequestKMSettings.In.RequestKM.MarkingCode = "VGVzdEZhbHNlU3RyaW5n" Then + + GetProcessingKMResultSettings.Info.Approved = False; + ElsIf RequestKMSettings.In.RequestKM.MarkingCode = "RiseTestFalseString" + OR RequestKMSettings.In.RequestKM.MarkingCode = "UmlzZVRlc3RGYWxzZVN0cmluZw==" Then + + Raise "RiseTestFalseString"; + EndIf; + Return GetProcessingKMResultSettings; EndFunction diff --git a/IRP/src/CommonModules/EquipmentFiscalPrinterServer/Module.bsl b/IRP/src/CommonModules/EquipmentFiscalPrinterServer/Module.bsl index 1df3d18edd..eaa27fc067 100644 --- a/IRP/src/CommonModules/EquipmentFiscalPrinterServer/Module.bsl +++ b/IRP/src/CommonModules/EquipmentFiscalPrinterServer/Module.bsl @@ -55,33 +55,10 @@ Procedure FillCheckPackageByRetailSalesReceipt(SourceData, CheckPackage) Export FiscalStringData = CommonFunctionsServer.DeserializeJSON(CheckPackage.Positions.FiscalStringJSON); // See EquipmentFiscalPrinterAPIClient.CheckPackage_FiscalString FiscalStringData.AmountWithDiscount = ItemRow.TotalAmount; FiscalStringData.DiscountAmount = ItemRow.OffersAmount; + // TODO: Get from ItemType (or Item) CalculationSubject If ItemRow.isControlCodeString Then - If CCSRows.Count() = 0 Then - Raise "Control string code not filled. Row: " + ItemRow.LineNumber; - ElsIf Not CCSRows.Count() = ItemRow.Quantity Then - Raise "Control string code count not the same as item quantity. Row: " + ItemRow.LineNumber; - ElsIf CCSRows.Count() > 1 Then // TODO: Fix this - Raise "Not suppoted send more then 1 control code by each row. Row: " + ItemRow.LineNumber; - ElsIf CCSRows[0].NotCheck And ItemRow.Item.ControlCodeStringType = Enums.ControlCodeStringType.MarkingCode Then - // Not check an not send - FiscalStringData.CalculationSubject = 1; - Else - CodeString = CCSRows[0].CodeString; - If ItemRow.Item.ControlCodeStringType = Enums.ControlCodeStringType.None Then - Raise "Can not fiscalize item with Control Code String Type as None. Select type in item, or switch off Control string"; - ElsIf ItemRow.Item.ControlCodeStringType.IsEmpty() Then - Raise "Can not fiscalize item while Control Code String Type is Empty. Select type in item, or switch off Control string"; - ElsIf ItemRow.Item.ControlCodeStringType = Enums.ControlCodeStringType.MarkingCode Then - If Not CommonFunctionsClientServer.isBase64Value(CodeString) Then - CodeString = Base64String(GetBinaryDataFromString(CodeString, TextEncoding.UTF8, False)); - EndIf; - FiscalStringData.MarkingCode = CodeString; - Else - FillGoodData(ItemRow.Item, CodeString, FiscalStringData); - EndIf; - FiscalStringData.CalculationSubject = 33; //https://its.1c.ru/db/metod8dev#content:4829:hdoc:signcalculationobject - EndIf; + FillControlString(CCSRows, ItemRow, FiscalStringData); Else If ItemRow.Item.ItemType.Type = Enums.ItemTypes.Certificate Then FiscalStringData.CalculationSubject = 10; @@ -89,123 +66,27 @@ Procedure FillCheckPackageByRetailSalesReceipt(SourceData, CheckPackage) Export FiscalStringData.CalculationSubject = 1; //https://its.1c.ru/db/metod8dev#content:4829:hdoc:signcalculationobject EndIf; EndIf; + FiscalStringData.MeasureOfQuantity = 255; FiscalStringData.MeasureOfQuantityRef = ItemRow.Unit.UOM; -#Region GenerateName - Name = New Array; // Array Of String - Name.Add(String(ItemRow.Item)); - If Not String(ItemRow.Item) = String(ItemRow.ItemKey) Then - Name.Add(String(ItemRow.ItemKey)); - EndIf; - - SearchSerial = SourceData.SerialLotNumbers.FindRows(New Structure("Key", ItemRow.Key)); - If SearchSerial.Count() > 0 Then - SerialName = New Array; // Array Of String - For Each Serial In SearchSerial Do - SerialName.Add(String(Serial.SerialLotNumber)); - EndDo; - Name.Add("[" + StrConcat(SerialName, ",") + "]"); - EndIf; + Name = GenerateItemName(SourceData, ItemRow); FiscalStringData.Name = StrConcat(Name, " "); -#EndRegion FiscalStringData.Quantity = ItemRow.Quantity; - If SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.FullPrepayment Then - FiscalStringData.PaymentMethod = 1; - ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.PartialPrepayment Then - FiscalStringData.PaymentMethod = 2; - ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.AdvancePayment Then - FiscalStringData.PaymentMethod = 3; - ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.FullCalculation Then - FiscalStringData.PaymentMethod = 4; - ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.PartialSettlementAndCredit Then - FiscalStringData.PaymentMethod = 5; - ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.TransferOnCredit Then - FiscalStringData.PaymentMethod = 6; - ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.LoanPayment Then - FiscalStringData.PaymentMethod = 7; - Else - FiscalStringData.PaymentMethod = 4; - EndIf; - If ItemRow.Item.ItemType.Type = Enums.ItemTypes.Certificate Then - FiscalStringData.PaymentMethod = 3; - EndIf; + FillPaymentType(SourceData, FiscalStringData, ItemRow); FiscalStringData.PriceWithDiscount = Round(ItemRow.TotalAmount / ItemRow.Quantity, 2); - If ValueIsFilled(ItemRow.VatRate) Then - If ItemRow.VatRate.NoRate Then - FiscalStringData.VATRate = "none"; - FiscalStringData.VATAmount = 0; - Else - FiscalStringData.VATRate = Format(ItemRow.VatRate.Rate, "NZ=0; NG=0;"); - FiscalStringData.VATAmount = ItemRow.TaxAmount; - EndIf; - Else - FiscalStringData.VATRate = "none"; - FiscalStringData.VATAmount = 0; - EndIf; - - If ValueIsFilled(ItemRow.Consignor) Then - FiscalStringData.VendorData.VendorINN = ItemRow.Consignor.TaxID; - FiscalStringData.VendorData.VendorName = String(ItemRow.Consignor); - FiscalStringData.VendorData.VendorPhone = ""; - FiscalStringData.CalculationAgent = 5; - EndIf; + FillVatRate(ItemRow, FiscalStringData); - If FiscalStringData.CalculationAgent = 5 Then - If IsBlankString(FiscalStringData.VendorData.VendorINN) - OR IsBlankString(FiscalStringData.VendorData.VendorName) Then - Raise StrTemplate(R().Error_047, "VendorINN, VendorName"); - EndIf; - EndIf; + FillConsignor(FiscalStringData, ItemRow); CheckPackage.Positions.FiscalStrings.Add(FiscalStringData); EndDo; - For Each Payment In SourceData.Payments Do - If Payment.Amount < 0 Then - Continue; - EndIf; - - If SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.FullPrepayment Then - CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; - ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.PartialPrepayment Then - CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; - ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.AdvancePayment Then - CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; - ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.FullCalculation Then - If Payment.PaymentType.Type = Enums.PaymentTypes.Cash Then - CheckPackage.Payments.Cash = CheckPackage.Payments.Cash + Payment.Amount; - ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.Card Then - CheckPackage.Payments.ElectronicPayment = CheckPackage.Payments.ElectronicPayment + Payment.Amount; - ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.PaymentAgent Then - CheckPackage.Payments.PostPayment = CheckPackage.Payments.PostPayment + Payment.Amount; - ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.Advance Then - CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; - ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.Certificate Then - CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; - Else - CheckPackage.Payments.Cash = CheckPackage.Payments.Cash + Payment.Amount; - EndIf; - Else - If Payment.PaymentType.Type = Enums.PaymentTypes.Cash Then - CheckPackage.Payments.Cash = CheckPackage.Payments.Cash + Payment.Amount; - ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.Card Then - CheckPackage.Payments.ElectronicPayment = CheckPackage.Payments.ElectronicPayment + Payment.Amount; - ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.PaymentAgent Then - CheckPackage.Payments.PostPayment = CheckPackage.Payments.PostPayment + Payment.Amount; - ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.Advance Then - CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; - ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.Certificate Then - CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; - Else - CheckPackage.Payments.Cash = CheckPackage.Payments.Cash + Payment.Amount; - EndIf; - EndIf; - EndDo; + FillPayments(SourceData, CheckPackage); If SessionParameters.Workstation.PrintBarcodeWithDocumentUUID Then CheckPackage.Positions.Barcode.Value = BarcodeServer.GetDocumentBarcode(SourceData); @@ -225,17 +106,6 @@ Procedure FillCheckPackageByRetailSalesReceipt(SourceData, CheckPackage) Export EndProcedure -Procedure FillGoodData(Item, Val CodeString, FiscalStringData) - - If Item.ControlCodeStringType = Enums.ControlCodeStringType.GoodCodeData Then - If Not CommonFunctionsClientServer.isBase64Value(CodeString) Then - CodeString = Base64String(GetBinaryDataFromString(CodeString, TextEncoding.UTF8, False)); - EndIf; - FiscalStringData.GoodCodeData.Insert("NotIdentified", CodeString); - EndIf; - -EndProcedure - // Fill check package by payment. // // Parameters: @@ -372,14 +242,14 @@ Function GetStatusData(DocumentRef) Export Return FiscalStatus; EndFunction -// Get string code. +// Get marking code. // // Parameters: // DocumentRef - DocumentRef.RetailReturnReceipt, DocumentRef.RetailSalesReceipt - // // Returns: // Array Of String -Function GetStringCode(DocumentRef) Export +Function GetMarkingCode(DocumentRef) Export Array = New Array; // Array Of String For Each Row In DocumentRef.ControlCodeStrings Do @@ -387,6 +257,10 @@ Function GetStringCode(DocumentRef) Export Continue; EndIf; + If Not Row.ControlCodeStringType = Enums.ControlCodeStringType.MarkingCode Then + Continue; + EndIf; + Array.Add(Row.CodeString); EndDo; Return Array; @@ -417,3 +291,151 @@ Procedure FillInputParameters(Ref, InputParameters) Export EndProcedure #EndRegion + +#Region Service + +Procedure FillConsignor(FiscalStringData, ItemRow) + If ValueIsFilled(ItemRow.Consignor) Then + FiscalStringData.VendorData.VendorINN = ItemRow.Consignor.TaxID; + FiscalStringData.VendorData.VendorName = String(ItemRow.Consignor); + FiscalStringData.VendorData.VendorPhone = ""; + FiscalStringData.CalculationAgent = 5; + EndIf; + + If FiscalStringData.CalculationAgent = 5 Then + If IsBlankString(FiscalStringData.VendorData.VendorINN) + OR IsBlankString(FiscalStringData.VendorData.VendorName) Then + Raise StrTemplate(R().Error_047, "VendorINN, VendorName"); + EndIf; + EndIf; +EndProcedure + +Procedure FillVatRate(ItemRow, FiscalStringData) + If ValueIsFilled(ItemRow.VatRate) Then + If ItemRow.VatRate.NoRate Then + FiscalStringData.VATRate = "none"; + FiscalStringData.VATAmount = 0; + Else + FiscalStringData.VATRate = Format(ItemRow.VatRate.Rate, "NZ=0; NG=0;"); + FiscalStringData.VATAmount = ItemRow.TaxAmount; + EndIf; + Else + FiscalStringData.VATRate = "none"; + FiscalStringData.VATAmount = 0; + EndIf; +EndProcedure + +Function GenerateItemName(SourceData, ItemRow) + Name = New Array; // Array Of String + Name.Add(String(ItemRow.Item)); + If Not String(ItemRow.Item) = String(ItemRow.ItemKey) Then + Name.Add(String(ItemRow.ItemKey)); + EndIf; + + SearchSerial = SourceData.SerialLotNumbers.FindRows(New Structure("Key", ItemRow.Key)); + If SearchSerial.Count() > 0 Then + SerialName = New Array; // Array Of String + For Each Serial In SearchSerial Do + SerialName.Add(String(Serial.SerialLotNumber)); + EndDo; + Name.Add("[" + StrConcat(SerialName, ",") + "]"); + EndIf; + Return Name; +EndFunction + +Procedure FillPaymentType(SourceData, FiscalStringData, ItemRow) + If SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.FullPrepayment Then + FiscalStringData.PaymentMethod = 1; + ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.PartialPrepayment Then + FiscalStringData.PaymentMethod = 2; + ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.AdvancePayment Then + FiscalStringData.PaymentMethod = 3; + ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.FullCalculation Then + FiscalStringData.PaymentMethod = 4; + ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.PartialSettlementAndCredit Then + FiscalStringData.PaymentMethod = 5; + ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.TransferOnCredit Then + FiscalStringData.PaymentMethod = 6; + ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.LoanPayment Then + FiscalStringData.PaymentMethod = 7; + Else + FiscalStringData.PaymentMethod = 4; + EndIf; + + If ItemRow.Item.ItemType.Type = Enums.ItemTypes.Certificate Then + FiscalStringData.PaymentMethod = 3; + EndIf; +EndProcedure + +Procedure FillControlString(CCSRows, ItemRow, FiscalStringData) + If CCSRows.Count() = 0 Then + Raise "Control string code not filled. Row: " + ItemRow.LineNumber; + ElsIf Not CCSRows.Count() = ItemRow.Quantity Then + Raise "Control string code count not the same as item quantity. Row: " + ItemRow.LineNumber; + ElsIf CCSRows.Count() > 1 Then // TODO: Fix this + Raise "Not suppoted send more then 1 control code by each row. Row: " + ItemRow.LineNumber; + ElsIf CCSRows[0].NotCheck And CCSRows[0].ControlCodeStringType = Enums.ControlCodeStringType.MarkingCode Then + // Not check and not send + FiscalStringData.CalculationSubject = 1; + Else + CodeString = CCSRows[0].CodeString; + If CCSRows[0].ControlCodeStringType = Enums.ControlCodeStringType.None Then + Raise "Can not fiscalize item with Control Code String Type as None. Select type in item, or switch off Control string"; + ElsIf CCSRows[0].ControlCodeStringType.IsEmpty() Then + Raise "Can not fiscalize item while Control Code String Type is Empty. Select type in item, or switch off Control string"; + ElsIf CCSRows[0].ControlCodeStringType = Enums.ControlCodeStringType.MarkingCode Then + FiscalStringData.MarkingCode = ControlCodeStringServer.GetMarkingCodeString(CodeString); + ElsIf CCSRows[0].ControlCodeStringType = Enums.ControlCodeStringType.GoodCodeData Then + FiscalStringData.GoodCodeData.Insert(CCSRows[0].Prefix, CodeString); + Else + Raise "Unknown ControlCodeStringType"; + EndIf; + FiscalStringData.CalculationSubject = 33; //https://its.1c.ru/db/metod8dev#content:4829:hdoc:signcalculationobject + EndIf; +EndProcedure + +Procedure FillPayments(SourceData, CheckPackage) + For Each Payment In SourceData.Payments Do + If Payment.Amount < 0 Then + Continue; + EndIf; + + If SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.FullPrepayment Then + CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; + ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.PartialPrepayment Then + CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; + ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.AdvancePayment Then + CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; + ElsIf SourceData.PaymentMethod = Enums.ReceiptPaymentMethods.FullCalculation Then + If Payment.PaymentType.Type = Enums.PaymentTypes.Cash Then + CheckPackage.Payments.Cash = CheckPackage.Payments.Cash + Payment.Amount; + ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.Card Then + CheckPackage.Payments.ElectronicPayment = CheckPackage.Payments.ElectronicPayment + Payment.Amount; + ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.PaymentAgent Then + CheckPackage.Payments.PostPayment = CheckPackage.Payments.PostPayment + Payment.Amount; + ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.Advance Then + CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; + ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.Certificate Then + CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; + Else + CheckPackage.Payments.Cash = CheckPackage.Payments.Cash + Payment.Amount; + EndIf; + Else + If Payment.PaymentType.Type = Enums.PaymentTypes.Cash Then + CheckPackage.Payments.Cash = CheckPackage.Payments.Cash + Payment.Amount; + ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.Card Then + CheckPackage.Payments.ElectronicPayment = CheckPackage.Payments.ElectronicPayment + Payment.Amount; + ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.PaymentAgent Then + CheckPackage.Payments.PostPayment = CheckPackage.Payments.PostPayment + Payment.Amount; + ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.Advance Then + CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; + ElsIf Payment.PaymentType.Type = Enums.PaymentTypes.Certificate Then + CheckPackage.Payments.PrePayment = CheckPackage.Payments.PrePayment + Payment.Amount; + Else + CheckPackage.Payments.Cash = CheckPackage.Payments.Cash + Payment.Amount; + EndIf; + EndIf; + EndDo; +EndProcedure + +#EndRegion diff --git a/IRP/src/CommonModules/RowIDInfoServer/Module.bsl b/IRP/src/CommonModules/RowIDInfoServer/Module.bsl index 0e3d2652a6..1be75ccb39 100644 --- a/IRP/src/CommonModules/RowIDInfoServer/Module.bsl +++ b/IRP/src/CommonModules/RowIDInfoServer/Module.bsl @@ -4602,7 +4602,9 @@ Function ExtractData_FromRSR(BasisesTable, DataReceiver, AddInfo = Undefined) | UNDEFINED AS Ref, | BasisesTable.Key, | ControlCodeStrings.CodeString, - | ControlCodeStrings.CodeIsApproved + | ControlCodeStrings.CodeIsApproved, + | ControlCodeStrings.ControlCodeStringType, + | ControlCodeStrings.Prefix |FROM | Document.RetailSalesReceipt.ControlCodeStrings AS ControlCodeStrings | INNER JOIN BasisesTable AS BasisesTable @@ -11411,7 +11413,7 @@ Function GetColumnNames_ControlCodeStrings() EndFunction Function GetColumnNamesSum_ControlCodeStrings() - Return "CodeString"; + Return "CodeString, NotCheck, ControlCodeStringType, Prefix"; EndFunction Function GetEmptyTable_ControlCodeStrings() diff --git a/IRP/src/Configuration/Configuration.mdo b/IRP/src/Configuration/Configuration.mdo index 664f1db707..281160ae09 100644 --- a/IRP/src/Configuration/Configuration.mdo +++ b/IRP/src/Configuration/Configuration.mdo @@ -678,6 +678,8 @@ <commonModules>CommonModule.ViewServer_V2</commonModules> <commonModules>CommonModule.WorkstationClient</commonModules> <commonModules>CommonModule.WorkstationServer</commonModules> + <commonModules>CommonModule.ControlCodeStringServer</commonModules> + <commonModules>CommonModule.ControlCodeStringClient</commonModules> <commonModules>CommonModule.DocVisitorCounterClient</commonModules> <commonModules>CommonModule.DocVisitorCounterServer</commonModules> <commonAttributes>CommonAttribute.Author</commonAttributes> diff --git a/IRP/src/DataProcessors/PointOfSale/Forms/Form/Module.bsl b/IRP/src/DataProcessors/PointOfSale/Forms/Form/Module.bsl index 4d57dac497..548d69361c 100644 --- a/IRP/src/DataProcessors/PointOfSale/Forms/Form/Module.bsl +++ b/IRP/src/DataProcessors/PointOfSale/Forms/Form/Module.bsl @@ -1755,10 +1755,9 @@ Procedure FindRetailBasisFinish(Result, RowID) Export For Each OffersItem In RetailBasisData.SpecialOffers Do FillPropertyValues(ThisObject.RetailBasisSpecialOffers.Add(), OffersItem); EndDo; - + ThisObject.Object.ControlCodeStrings.Clear(); FillOnSelectBasisDocument(Result); SerialLotNumberClient.UpdateSerialLotNumbersPresentation(ThisObject.Object); - ThisObject.Object.ControlCodeStrings.Clear(); ControlCodeStringsClient.UpdateState(ThisObject.Object); FillSalesPersonInItemList(); EnabledPaymentButton(); @@ -1773,6 +1772,7 @@ Function GetRetailBasisData() RowIDInfoArray = New Array; SpecialOffersArray = New Array; SerialLotNumbersArray = New Array; + ControlCodeStringsArray = New Array; ArrayOfBasises = New Array(); ArrayOfBasises.Add(ThisObject.RetailBasis); @@ -1838,6 +1838,15 @@ Function GetRetailBasisData() ItemStructure.Insert("PriceType", TableItem.PriceType); ItemListArray.Add(ItemStructure); EndDo; + For Each TableItem In DocumentData.ControlCodeStrings Do + ItemStructure = New Structure; + ItemStructure.Insert("Key", TableItem.Key); + ItemStructure.Insert("CodeString", TableItem.CodeString); + ItemStructure.Insert("CodeIsApproved", TableItem.CodeIsApproved); + ItemStructure.Insert("ControlCodeStringType", TableItem.ControlCodeStringType); + ItemStructure.Insert("Prefix", TableItem.Prefix); + ControlCodeStringsArray.Add(ItemStructure); + EndDo; EndIf; Resultat = New Structure; @@ -1846,6 +1855,7 @@ Function GetRetailBasisData() Resultat.Insert("RowIDInfo", RowIDInfoArray); Resultat.Insert("SpecialOffers", SpecialOffersArray); Resultat.Insert("SerialLotNumbers", SerialLotNumbersArray); + Resultat.Insert("ControlCodeStrings", ControlCodeStringsArray); Return Resultat; diff --git a/IRP/src/Documents/RetailReturnReceipt/RetailReturnReceipt.mdo b/IRP/src/Documents/RetailReturnReceipt/RetailReturnReceipt.mdo index 190af17866..3a914fca0b 100644 --- a/IRP/src/Documents/RetailReturnReceipt/RetailReturnReceipt.mdo +++ b/IRP/src/Documents/RetailReturnReceipt/RetailReturnReceipt.mdo @@ -2844,6 +2844,53 @@ <dataHistory>Use</dataHistory> <fullTextSearch>Use</fullTextSearch> </attributes> + <attributes uuid="6aca3739-6b1d-47c9-9e38-fd675bac8eae"> + <name>ControlCodeStringType</name> + <synonym> + <key>en</key> + <value>Control code string type</value> + </synonym> + <synonym> + <key>ru</key> + <value>Тип маркировки товаров</value> + </synonym> + <synonym> + <key>tr</key> + <value>Kontrol kodu satır tipi</value> + </synonym> + <type> + <types>EnumRef.ControlCodeStringType</types> + </type> + <minValue xsi:type="core:UndefinedValue"/> + <maxValue xsi:type="core:UndefinedValue"/> + <dataHistory>Use</dataHistory> + <fullTextSearch>Use</fullTextSearch> + </attributes> + <attributes uuid="ba6f754e-337b-4200-aea8-3b3b221c7149"> + <name>Prefix</name> + <synonym> + <key>en</key> + <value>Prefix</value> + </synonym> + <synonym> + <key>ru</key> + <value>Префикс</value> + </synonym> + <synonym> + <key>tr</key> + <value>Önek</value> + </synonym> + <type> + <types>String</types> + <stringQualifiers> + <length>50</length> + </stringQualifiers> + </type> + <minValue xsi:type="core:UndefinedValue"/> + <maxValue xsi:type="core:UndefinedValue"/> + <dataHistory>Use</dataHistory> + <fullTextSearch>Use</fullTextSearch> + </attributes> </tabularSections> <tabularSections uuid="f7f943f6-1b80-4954-8202-5085c8f047b2"> <producedTypes> @@ -3012,7 +3059,6 @@ <commandParameterType> <types>DocumentRef.RetailReturnReceipt</types> </commandParameterType> - <modifiesData>true</modifiesData> <representation>Auto</representation> </commands> </mdclass:Document> \ No newline at end of file diff --git a/IRP/src/Documents/RetailSalesReceipt/RetailSalesReceipt.mdo b/IRP/src/Documents/RetailSalesReceipt/RetailSalesReceipt.mdo index 535d061786..30be9bbfa9 100644 --- a/IRP/src/Documents/RetailSalesReceipt/RetailSalesReceipt.mdo +++ b/IRP/src/Documents/RetailSalesReceipt/RetailSalesReceipt.mdo @@ -2926,6 +2926,53 @@ <dataHistory>Use</dataHistory> <fullTextSearch>Use</fullTextSearch> </attributes> + <attributes uuid="ad9f625a-3fe4-4da6-8c8f-d5d358f16277"> + <name>ControlCodeStringType</name> + <synonym> + <key>en</key> + <value>Control code string type</value> + </synonym> + <synonym> + <key>ru</key> + <value>Тип маркировки товаров</value> + </synonym> + <synonym> + <key>tr</key> + <value>Kontrol kodu satır tipi</value> + </synonym> + <type> + <types>EnumRef.ControlCodeStringType</types> + </type> + <minValue xsi:type="core:UndefinedValue"/> + <maxValue xsi:type="core:UndefinedValue"/> + <dataHistory>Use</dataHistory> + <fullTextSearch>Use</fullTextSearch> + </attributes> + <attributes uuid="4b5bce5e-da8a-4fa1-a940-de95166f3ed0"> + <name>Prefix</name> + <synonym> + <key>en</key> + <value>Prefix</value> + </synonym> + <synonym> + <key>ru</key> + <value>Префикс</value> + </synonym> + <synonym> + <key>tr</key> + <value>Önek</value> + </synonym> + <type> + <types>String</types> + <stringQualifiers> + <length>50</length> + </stringQualifiers> + </type> + <minValue xsi:type="core:UndefinedValue"/> + <maxValue xsi:type="core:UndefinedValue"/> + <dataHistory>Use</dataHistory> + <fullTextSearch>Use</fullTextSearch> + </attributes> </tabularSections> <tabularSections uuid="823b2bab-3058-4d74-ac02-dcebfca479c0"> <producedTypes> @@ -3094,7 +3141,6 @@ <commandParameterType> <types>DocumentRef.RetailSalesReceipt</types> </commandParameterType> - <modifiesData>true</modifiesData> <representation>Auto</representation> </commands> <commands uuid="4d666b2d-c24f-4bf7-8109-959c03f8afb5"> @@ -3115,7 +3161,6 @@ <commandParameterType> <types>DocumentRef.RetailSalesReceipt</types> </commandParameterType> - <modifiesData>true</modifiesData> <representation>Auto</representation> </commands> </mdclass:Document> \ No newline at end of file diff --git a/features/Internal/_8510 FiscalPrinter/_8510FiscalPrinter.feature b/features/Internal/_8510 FiscalPrinter/_8510FiscalPrinter.feature index 09bbe281c6..3ec679481e 100644 --- a/features/Internal/_8510 FiscalPrinter/_8510FiscalPrinter.feature +++ b/features/Internal/_8510 FiscalPrinter/_8510FiscalPrinter.feature @@ -324,6 +324,74 @@ SalesReceiptXML23 = </CheckPackage> """ +SalesReceiptXML24 = +"""xml +<?xml version="1.0" encoding="UTF-8"?> +<CheckPackage> + <Parameters CashierName="Арина Браун" CashierINN="1111111111" SaleAddress="Sale address" SaleLocation="Sale location" OperationType="1" TaxationSystem="0"/> + <Positions> + <FiscalString AmountWithDiscount="301.11" DiscountAmount="0" MarkingCode="Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY3" MeasureOfQuantity="255" CalculationSubject="1" Name="Product 16 with SLN and Good code data (Main Company - Consignor 1) PZU [89000008999]" Quantity="1" PaymentMethod="4" PriceWithDiscount="301.11" VATRate="18" VATAmount="45.93" CalculationAgent="5"> + <VendorData VendorINN="1" VendorName="Consignor 1" VendorPhone=""/> + </FiscalString> + <FiscalString AmountWithDiscount="300" DiscountAmount="0" MarkingCode="Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY4" MeasureOfQuantity="255" CalculationSubject="1" Name="Product 16 with SLN and Good code data (Main Company - Consignor 1) ODS [9099009909999999]" Quantity="1" PaymentMethod="4" PriceWithDiscount="300" VATRate="18" VATAmount="45.76" CalculationAgent="5"> + <VendorData VendorINN="1" VendorName="Consignor 1" VendorPhone=""/> + </FiscalString> + </Positions> + <Payments Cash="601.11" ElectronicPayment="0" PrePayment="0" PostPayment="0" Barter="0"/> +</CheckPackage> +""" + +SalesReceiptXML25 = +"""xml +<?xml version="1.0" encoding="UTF-8"?> +<CheckPackage> + <Parameters CashierName="Арина Браун" CashierINN="1111111111" SaleAddress="Sale address" SaleLocation="Sale location" OperationType="2" TaxationSystem="0"/> + <Positions> + <FiscalString AmountWithDiscount="301.11" DiscountAmount="0" MarkingCode="Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY3" MeasureOfQuantity="255" CalculationSubject="1" Name="Product 16 with SLN and Good code data (Main Company - Consignor 1) PZU [89000008999]" Quantity="1" PaymentMethod="4" PriceWithDiscount="301.11" VATRate="18" VATAmount="45.93" CalculationAgent="5"> + <VendorData VendorINN="1" VendorName="Consignor 1" VendorPhone=""/> + </FiscalString> + <FiscalString AmountWithDiscount="300" DiscountAmount="0" MarkingCode="Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY4" MeasureOfQuantity="255" CalculationSubject="1" Name="Product 16 with SLN and Good code data (Main Company - Consignor 1) ODS [9099009909999999]" Quantity="1" PaymentMethod="4" PriceWithDiscount="300" VATRate="18" VATAmount="45.76" CalculationAgent="5"> + <VendorData VendorINN="1" VendorName="Consignor 1" VendorPhone=""/> + </FiscalString> + </Positions> + <Payments Cash="601.11" ElectronicPayment="0" PrePayment="0" PostPayment="0" Barter="0"/> +</CheckPackage> +""" + +SalesReceiptXML26 = +"""xml +<?xml version="1.0" encoding="UTF-8"?> +<CheckPackage> + <Parameters CashierName="Арина Браун" CashierINN="1111111111" SaleAddress="Sale address" SaleLocation="Sale location" OperationType="1" TaxationSystem="0"/> + <Positions> + <FiscalString AmountWithDiscount="401.11" DiscountAmount="0" MeasureOfQuantity="255" CalculationSubject="1" Name="Product 6 with SLN PZU [57897909799]" Quantity="1" PaymentMethod="4" PriceWithDiscount="401.11" VATRate="18" VATAmount="61.19"> + <GoodCodeData NotIdentified="Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY8"/> + </FiscalString> + <FiscalString AmountWithDiscount="300" DiscountAmount="0" MeasureOfQuantity="255" CalculationSubject="1" Name="Product 6 with SLN PZU [57897909799]" Quantity="1" PaymentMethod="4" PriceWithDiscount="300" VATRate="18" VATAmount="45.76"> + <GoodCodeData NotIdentified="Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY9"/> + </FiscalString> + </Positions> + <Payments Cash="701.11" ElectronicPayment="0" PrePayment="0" PostPayment="0" Barter="0"/> +</CheckPackage> +""" + +SalesReceiptXML27 = +"""xml +<?xml version="1.0" encoding="UTF-8"?> +<CheckPackage> + <Parameters CashierName="Арина Браун" CashierINN="1111111111" SaleAddress="Sale address" SaleLocation="Sale location" OperationType="2" TaxationSystem="0"/> + <Positions> + <FiscalString AmountWithDiscount="401.11" DiscountAmount="0" MeasureOfQuantity="255" CalculationSubject="1" Name="Product 6 with SLN PZU [57897909799]" Quantity="1" PaymentMethod="4" PriceWithDiscount="401.11" VATRate="18" VATAmount="61.19"> + <GoodCodeData NotIdentified="Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY8"/> + </FiscalString> + <FiscalString AmountWithDiscount="300" DiscountAmount="0" MeasureOfQuantity="255" CalculationSubject="1" Name="Product 6 with SLN PZU [57897909799]" Quantity="1" PaymentMethod="4" PriceWithDiscount="300" VATRate="18" VATAmount="45.76"> + <GoodCodeData NotIdentified="Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY9"/> + </FiscalString> + </Positions> + <Payments Cash="701.11" ElectronicPayment="0" PrePayment="0" PostPayment="0" Barter="0"/> +</CheckPackage> +""" + Background: Given I launch TestClient opening script or connect the existing one @@ -859,8 +927,8 @@ Scenario: _0850015 create retail sales receipt from POS (own stock, card 02, ite And I click "Payment (+)" button * Check previous marking code And "CurrentCodes" table became equal - | 'Scanned codes' | 'Code is approved' | 'Not check' | - | 'Current row will decode to base64' | 'Yes' | 'No' | + | 'Scanned codes' | 'Approved' | 'Not check' | 'Type' | + | 'Current row will decode to base64' | 'Yes' | 'No' | 'Marking code' | * Scan marking data that already used And I click "Search by barcode" button Then "Barcode" window is opened @@ -1254,14 +1322,15 @@ Scenario: _0850023 check return payment by card and cash (sales by card) | 'Retail sales receipt' | | '$$RetailSalesReceipt5$$' | And I select current line in "List" table - * Code scan - And I click "Payment Return" button - Then the form attribute named "isReturn" became equal to "Yes" - And I click "Search by barcode" button - Then "Barcode" window is opened - And I input "11111111111111111111" text in the field named "Barcode" - And I move to the next attribute - And I click "Payment Return" button + * Check marking code from RSR + And I activate "Control code string state" field in "ItemList" table + And I select current line in "ItemList" table + Then the form attribute named "isReturn" became equal to "Yes" + And "CurrentCodes" table became equal + | 'Type' | 'Prefix' | 'Scanned codes' | 'Approved' | 'Not check' | + | 'Marking code' | '' | '11111111111111111111' | 'No' | 'No' | + And I close current window + And I click "Payment Return" button Then "Payment" window is opened And I click "Card (*)" button And I go to line in "BankPaymentTypeList" table @@ -2595,19 +2664,21 @@ Scenario: _0260165 Return of a product paid for with a certificate | 'Item' | 'Sales person' | 'Item key' | 'Serials' | 'Price' | 'Quantity' | 'Offers' | 'Total' | | 'Dress' | '' | 'XS/Blue' | '' | '520,00' | '1,000' | '' | '520,00' | | 'Product 1 with SLN' | '' | 'PZU' | '8908899880' | '200,00' | '1,000' | '' | '200,00' | - And "BasisPayments" table became equal + And "BasisPayments" table contains lines | 'Payment type' | 'Amount' | | 'Certificate' | '500,00' | | 'Cash' | '20,00' | | 'Card 03' | '200,00' | + Then the number of "BasisPayments" table lines is "равно" "3" And I go to line in "ItemList" table | 'Item' | | 'Product 1 with SLN' | And I activate "Control code string state" field in "ItemList" table And I select current line in "ItemList" table - And I click "Search by barcode" button - And I input "Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY0" text in the field named "Barcode" - And I move to the next attribute + And "CurrentCodes" table became equal + | 'Type' | 'Prefix' | 'Scanned codes' | 'Approved' | 'Not check' | + | 'Marking code' | '' | 'Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY0' | 'No' | 'No' | + And I close current window And I click "Payment Return" button Then "Payment" window is opened And "Payments" table became equal @@ -2722,7 +2793,59 @@ Scenario: _0260169 Good code data control sale (POS) And I check "$ParsingResult$" with "0" and method is "ProcessCheck" And I check "$ParsingResult$" with "0" and data in "In.Parameter3" the same as "SalesReceiptXML22" +Scenario: _02601691 check Good code data from RSR in the RRR (POS) + And I close all client application windows + * Preparation + If "Point of sales" window is opened Then + And I delete all lines of "ItemList" table + And In the command interface I select "Retail" "Point of sale" + And I click the button named "Return" + * Select basis document + And I move to "Return" tab + And I click Select button of "Retail sales receipt (basis)" field + Then "Selection retail basis for return" window is opened + And I go to line in "List" table + | 'Amount' | + | '900,00' | + And I select current line in "List" table + * Check Good code data filling + And I go to line in "ItemList" table + | 'Item' | 'Item key' | 'Price' | 'Quantity' | 'Serials' | 'Total' | + | 'Product 16 with SLN and Good code data (Main Company - Consignor 1)' | 'PZU' | '300,00' | '1,000' | '89000008999' | '300,00' | + And I activate "Control code string state" field in "ItemList" table + And I select current line in "ItemList" table + Then the form attribute named "ControlCodeStringType" became equal to "Good code data" + Then the form attribute named "isReturn" became equal to "Yes" + And "CurrentCodes" table became equal + | 'Type' | 'Prefix' | 'Scanned codes' | 'Approved' | 'Not check' | + | 'Good code data' | 'NotIdentified' | 'Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY1' | 'No' | 'No' | + And I close current window + And I go to line in "ItemList" table + | 'Item' | 'Item key' | 'Price' | 'Quantity' | 'Serials' | 'Total' | + | 'Product 16 with SLN and Good code data (Main Company - Consignor 1)' | 'ODS' | '300,00' | '1,000' | '9099009909999999' | '300,00' | + And I activate "Control code string state" field in "ItemList" table + And I select current line in "ItemList" table + Then the form attribute named "ControlCodeStringType" became equal to "Good code data" + Then the form attribute named "isReturn" became equal to "Yes" + And "CurrentCodes" table became equal + | 'Type' | 'Prefix' | 'Scanned codes' | 'Approved' | 'Not check' | + | 'Good code data' | 'NotIdentified' | 'Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY2' | 'No' | 'No' | + And I close current window + * Payment + And I click "Payment Return" button + And I click "Cash (/)" button + And I click "OK" button + And I move to the next attribute + And I save message text as "NumberRRR" + And I execute 1C:Enterprise script + | "Контекст.Insert("NumberRRR", TrimR(Контекст["NumberRRR"]))" | + Given I open hyperlink "e1cib/list/Document.RetailReturnReceipt" + And I go to line in "List" table + | 'Number' | + | '$NumberRRR$' | + And in the table "List" I click the button named "ListContextMenuUndoPosting" + Scenario: _0260170 Good code data control return (POS) And I close all client application windows * Preparation @@ -2768,14 +2891,86 @@ Scenario: _0260170 Good code data control return (POS) | 'Amount' | | '900,00' | And I select current line in "List" table + * Check Good code from RSR + And I go to line in "ItemList" table + | 'Item' | 'Item key' | 'Price' | 'Quantity' | 'Serials' | 'Total' | + | 'Product 16 with SLN and Good code data (Main Company - Consignor 1)' | 'PZU' | '300,00' | '1,000' | '89000008999' | '300,00' | + And I activate "Control code string state" field in "ItemList" table + And I select current line in "ItemList" table + Then the form attribute named "ControlCodeStringType" became equal to "Good code data" + Then the form attribute named "isReturn" became equal to "Yes" + And "CurrentCodes" table became equal + | 'Type' | 'Prefix' | 'Scanned codes' | 'Approved' | 'Not check' | + | 'Good code data' | 'NotIdentified' | 'Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY1' | 'No' | 'No' | + And I close current window + And I go to line in "ItemList" table + | 'Item' | 'Item key' | 'Price' | 'Quantity' | 'Serials' | 'Total' | + | 'Product 16 with SLN and Good code data (Main Company - Consignor 1)' | 'ODS' | '300,00' | '1,000' | '9099009909999999' | '300,00' | + And I activate "Control code string state" field in "ItemList" table + And I select current line in "ItemList" table + Then the form attribute named "ControlCodeStringType" became equal to "Good code data" + Then the form attribute named "isReturn" became equal to "Yes" + And "CurrentCodes" table became equal + | 'Type' | 'Prefix' | 'Scanned codes' | 'Approved' | 'Not check' | + | 'Good code data' | 'NotIdentified' | 'Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY2' | 'No' | 'No' | + And I close current window And I click "Payment Return" button + And I click "Cash (/)" button + And I click "OK" button + And I move to the next attribute + * Check fiscal log + And Delay 2 + And I parsed the log of the fiscal emulator by the path '$$LogPath$$' into the variable "ParsingResult" + And I check "$ParsingResult$" with "0" and method is "ProcessCheck" + And I check "$ParsingResult$" with "0" and data in "In.Parameter3" the same as "SalesReceiptXML23" + +Scenario: _0260173 RSR and RRR for item with good code, scan marking code + And I close all client application windows + * Preparation + If "Point of sales" window is opened Then + And I delete all lines of "ItemList" table + And In the command interface I select "Retail" "Point of sale" + * Add first item with with good code + And I click "Search by barcode (F7)" button + And I input "89000008999" text in the field named "Barcode" + And I move to the next attribute + Then the form attribute named "ControlCodeStringType" became equal to "Good code data" + And I change "Control code string type" radio button value to "Marking code" And I click "Search by barcode" button - And I input "Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY1" text in the field named "Barcode" + And I input "Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY3" text in the field named "Barcode" + And I move to the next attribute + And I input "301,11" text in "Price" field of "ItemList" table + And I finish line editing in "ItemList" table + And I click "Search by barcode (F7)" button + And I input "9099009909999999" text in the field named "Barcode" And I move to the next attribute - And I click "Payment Return" button + Then the form attribute named "ControlCodeStringType" became equal to "Good code data" + And I change "Control code string type" radio button value to "Marking code" And I click "Search by barcode" button - And I input "Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY2" text in the field named "Barcode" + And I input "Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY4" text in the field named "Barcode" + And I move to the next attribute + And I select current line in "ItemList" table + And I input "300,00" text in "Price" field of "ItemList" table + And I finish line editing in "ItemList" table + * Payment + And I click "Payment (+)" button + And I click "Cash (/)" button + And I click "OK" button And I move to the next attribute + * Check fiscal log + And Delay 2 + And I parsed the log of the fiscal emulator by the path '$$LogPath$$' into the variable "ParsingResult" + And I check "$ParsingResult$" with "0" and method is "ProcessCheck" + And I check "$ParsingResult$" with "0" and data in "In.Parameter3" the same as "SalesReceiptXML24" + * Create RRR + And I click the button named "Return" + And I move to "Return" tab + And I click Select button of "Retail sales receipt (basis)" field + Then "Selection retail basis for return" window is opened + And I go to line in "List" table + | 'Amount' | + | '601,11' | + And I select current line in "List" table And I click "Payment Return" button And I click "Cash (/)" button And I click "OK" button @@ -2784,9 +2979,65 @@ Scenario: _0260170 Good code data control return (POS) And Delay 2 And I parsed the log of the fiscal emulator by the path '$$LogPath$$' into the variable "ParsingResult" And I check "$ParsingResult$" with "0" and method is "ProcessCheck" - And I check "$ParsingResult$" with "0" and data in "In.Parameter3" the same as "SalesReceiptXML23" - + And I check "$ParsingResult$" with "0" and data in "In.Parameter3" the same as "SalesReceiptXML25" + +Scenario: _0260174 RSR and RRR for item with marking code, scan good code + And I close all client application windows + * Preparation + If "Point of sales" window is opened Then + And I delete all lines of "ItemList" table + And In the command interface I select "Retail" "Point of sale" + * Add first item with with good code + And I click "Search by barcode (F7)" button + And I input "57897909799" text in the field named "Barcode" + And I move to the next attribute + Then the form attribute named "ControlCodeStringType" became equal to "Marking code" + And I change "Control code string type" radio button value to "Good code" + And I click "Search by barcode" button + And I input "Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY8" text in the field named "Barcode" + And I move to the next attribute + And I input "401,11" text in "Price" field of "ItemList" table + And I finish line editing in "ItemList" table + And I click "Search by barcode (F7)" button + And I input "57897909799" text in the field named "Barcode" + And I move to the next attribute + Then the form attribute named "ControlCodeStringType" became equal to "Marking code" + And I change "Control code string type" radio button value to "Good code" + And I click "Search by barcode" button + And I input "Q3VycmVudCByb3cgd2lsbCBkZWNvZGUgdG8gYmFzZTY9" text in the field named "Barcode" + And I move to the next attribute + And I select current line in "ItemList" table + And I input "300,00" text in "Price" field of "ItemList" table + And I finish line editing in "ItemList" table + * Payment + And I click "Payment (+)" button + And I click "Cash (/)" button + And I click "OK" button + And I move to the next attribute + * Check fiscal log + And Delay 2 + And I parsed the log of the fiscal emulator by the path '$$LogPath$$' into the variable "ParsingResult" + And I check "$ParsingResult$" with "0" and method is "ProcessCheck" + And I check "$ParsingResult$" with "0" and data in "In.Parameter3" the same as "SalesReceiptXML26" + * Create RRR + And I click the button named "Return" + And I move to "Return" tab + And I click Select button of "Retail sales receipt (basis)" field + Then "Selection retail basis for return" window is opened + And I go to line in "List" table + | 'Amount' | + | '701,11' | + And I select current line in "List" table + And I click "Payment Return" button + And I click "Cash (/)" button + And I click "OK" button + And I move to the next attribute + * Check fiscal log + And Delay 2 + And I parsed the log of the fiscal emulator by the path '$$LogPath$$' into the variable "ParsingResult" + And I check "$ParsingResult$" with "0" and method is "ProcessCheck" + And I check "$ParsingResult$" with "0" and data in "In.Parameter3" the same as "SalesReceiptXML27" Scenario: _0260152 close session And I close all client application windows @@ -2893,7 +3144,7 @@ Scenario: _0260160 check Get Last Error button Scenario: _0260180 check fiscal logs And I close all client application windows Given I open hyperlink "e1cib/list/InformationRegister.HardwareLog" - Then the number of "List" table lines is "равно" "762" + Then the number of "List" table lines is "равно" "734" * Check log records form And I go to the first line in "List" table And I select current line in "List" table