Skip to content

Commit

Permalink
Translate
Browse files Browse the repository at this point in the history
  • Loading branch information
DitriXNew committed May 11, 2023
1 parent 8f3e6ea commit ee781aa
Show file tree
Hide file tree
Showing 35 changed files with 151 additions and 90 deletions.
77 changes: 77 additions & 0 deletions IRP/src/CommonForms/CodeStringCheck/Form.form
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,52 @@
<textEdit>true</textEdit>
</extInfo>
</items>
<items xsi:type="form:FormField">
<name>isReturn</name>
<id>36</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<dataPath xsi:type="form:DataPath">
<segments>isReturn</segments>
</dataPath>
<extendedTooltip>
<name>isReturnExtendedTooltip</name>
<id>38</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<type>Label</type>
<autoMaxWidth>true</autoMaxWidth>
<autoMaxHeight>true</autoMaxHeight>
<extInfo xsi:type="form:LabelDecorationExtInfo">
<horizontalAlign>Left</horizontalAlign>
</extInfo>
</extendedTooltip>
<contextMenu>
<name>isReturnContextMenu</name>
<id>37</id>
<visible>true</visible>
<enabled>true</enabled>
<userVisible>
<common>true</common>
</userVisible>
<autoFill>true</autoFill>
</contextMenu>
<type>CheckBoxField</type>
<readOnly>true</readOnly>
<editMode>Enter</editMode>
<showInHeader>true</showInHeader>
<headerHorizontalAlign>Left</headerHorizontalAlign>
<showInFooter>true</showInFooter>
<extInfo xsi:type="form:CheckBoxFieldExtInfo">
<checkBoxType>CheckBox</checkBoxType>
</extInfo>
</items>
<items xsi:type="form:Decoration">
<name>DecorationInfo</name>
<id>12</id>
Expand Down Expand Up @@ -794,6 +840,31 @@
</edit>
</columns>
</attributes>
<attributes>
<name>isReturn</name>
<title>
<key>en</key>
<value>Is return</value>
</title>
<title>
<key>ru</key>
<value>Это возврат</value>
</title>
<title>
<key>tr</key>
<value>Bu iade</value>
</title>
<id>10</id>
<valueType>
<types>Boolean</types>
</valueType>
<view>
<common>true</common>
</view>
<edit>
<common>true</common>
</edit>
</attributes>
<formCommands>
<name>SearchByBarcode</name>
<title>
Expand Down Expand Up @@ -908,6 +979,12 @@
</numberQualifiers>
</valueType>
</parameters>
<parameters>
<name>isReturn</name>
<valueType>
<types>Boolean</types>
</valueType>
</parameters>
<commandInterface>
<navigationPanel/>
<commandBar/>
Expand Down
11 changes: 7 additions & 4 deletions IRP/src/CommonForms/CodeStringCheck/Module.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Procedure OnCreateAtServer(Cancel, StandardProcessing)
ItemKey = Parameters.ItemKey;
LineNumber = Parameters.LineNumber;
RowKey = Parameters.RowKey;
isReturn = Parameters.isReturn;
EndProcedure

&AtClient
Expand Down Expand Up @@ -81,15 +82,17 @@ Async Procedure SearchByBarcodeEnd(Result, AdditionalParameters = Undefined) Exp

AllBarcodesIsOk = True;
For Each StringCode In ArrayOfApprovedCodeStrings Do // String
RequestKMSettings = EquipmentFiscalPrinterClient.RequestKMSettings();
RequestKMSettings = EquipmentFiscalPrinterClient.RequestKMSettings(isReturn);
RequestKMSettings.Quantity = 1;
RequestKMSettings.MarkingCode = StringCode;

Result = Await EquipmentFiscalPrinterClient.CheckKM(Hardware, RequestKMSettings); // See EquipmentFiscalPrinterClient.ProcessingKMResult

If Not Result.Approved Then
AllBarcodesIsOk = False;
CommonFunctionsClientServer.ShowUsersMessage(CommonFunctionsServer.SerializeJSON(Result));
Log.Write("CodeStringCheck.CheckKM.Approved.False", Result, , , Hardware);
CommonFunctionsClientServer.ShowUsersMessage(StrTemplate(R().EqFP_ProblemWhileCheckCodeString, StringCode));
Done();
Return;
EndIf;
NewRow = CurrentCodes.Add();
Expand All @@ -100,7 +103,7 @@ Async Procedure SearchByBarcodeEnd(Result, AdditionalParameters = Undefined) Exp
If AllBarcodesIsOk And ArrayOfApprovedCodeStrings.Count() > 0 Then
Done();
EndIf;

EndProcedure

&AtClient
Expand Down Expand Up @@ -130,7 +133,7 @@ EndFunction
Async Procedure CheckKM(Command)
For Each SelectedID In Items.CurrentCodes.SelectedRows Do // Number
Row = CurrentCodes.FindByID(SelectedID);
RequestKMSettings = EquipmentFiscalPrinterClient.RequestKMSettings();
RequestKMSettings = EquipmentFiscalPrinterClient.RequestKMSettings(isReturn);
RequestKMSettings.Quantity = 1;
RequestKMSettings.MarkingCode = Row.StringCode;

Expand Down
8 changes: 4 additions & 4 deletions IRP/src/CommonModules/EquipmentFiscalPrinterClient/Module.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Async Function ProcessCheck(ConsolidatedRetailSales, DataSource) Export

If TypeOf(DataSource) = Type("DocumentRef.RetailSalesReceipt")
Or TypeOf(DataSource) = Type("DocumentRef.RetailReturnReceipt") Then

isReturn = TypeOf(DataSource) = Type("DocumentRef.RetailReturnReceipt");
CodeStringList = EquipmentFiscalPrinterServer.GetStringCode(DataSource);

If CodeStringList.Count() > 0 Then
Expand All @@ -242,7 +242,7 @@ Async Function ProcessCheck(ConsolidatedRetailSales, DataSource) Export

ArrayForApprove = New Array; // Array Of String
For Each CodeString In EquipmentFiscalPrinterServer.GetStringCode(DataSource) Do
RequestKMSettings = RequestKMSettings();
RequestKMSettings = RequestKMSettings(isReturn);
RequestKMSettings.MarkingCode = CodeString;
RequestKMSettings.Quantity = 1;
CheckResult = Device_CheckKM(Settings.ConnectedDriver, Settings.ConnectedDriver.DriverObject, RequestKMSettings, False);
Expand Down Expand Up @@ -497,12 +497,12 @@ EndFunction
// * MarkingCode - String -
// * PlannedStatus - Number -
// * Quantity - Number -
Function RequestKMSettings() Export
Function RequestKMSettings(isReturn = False) Export
Str = New Structure;
Str.Insert("GUID", String(New UUID()));
Str.Insert("WaitForResult", True);
Str.Insert("MarkingCode", "");
Str.Insert("PlannedStatus", 1);
Str.Insert("PlannedStatus", ?(isReturn, 3, 1));
Str.Insert("Quantity", 1);
Return Str;
EndFunction
Expand Down
20 changes: 20 additions & 0 deletions IRP/src/CommonModules/Log/Log.mdo
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="d43bb0be-c8b2-4b03-9eb0-d3f39140f603">
<name>Log</name>
<synonym>
<key>en</key>
<value>Log</value>
</synonym>
<synonym>
<key>ru</key>
<value>Логи</value>
</synonym>
<synonym>
<key>tr</key>
<value>Log</value>
</synonym>
<server>true</server>
<externalConnection>true</externalConnection>
<clientOrdinaryApplication>true</clientOrdinaryApplication>
<serverCall>true</serverCall>
</mdclass:CommonModule>
36 changes: 36 additions & 0 deletions IRP/src/CommonModules/Log/Module.bsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// @strict-types

// Write.
//
// Parameters:
// Name - String - Event name. Ex. "Send to API"
// Log - Arbitrary, String - Log data. String, or serializeble object, ex. Structure, Map, Array
// Level - Number - Level:
// 0 - Error
// 1 - Info
// 2 - Warning
// 3 - Note
// Step - String - Add part to event name. "Name.Step"
// Ref - Undefined - Ref to db data
Procedure Write(Name, Log, Level = 0, Step = "", Ref = Undefined) Export

If Level = 0 Then
EventLevel = EventLogLevel.Error;
ElsIf Level = 1 Then
EventLevel = EventLogLevel.Information;
ElsIf Level = 2 Then
EventLevel = EventLogLevel.Warning;
Else
EventLevel = EventLogLevel.Note;
EndIf;

If Not TypeOf(Log) = Type("String") Then
Try
Log = CommonFunctionsServer.SerializeJSON(Log);
Except
Log = String(Log);
EndTry;
EndIf;

WriteLogEvent(Name, EventLevel, , Ref, Log);
EndProcedure
1 change: 1 addition & 0 deletions IRP/src/Configuration/Configuration.mdo
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@
<commonModules>CommonModule.SerialLotNumberClientServer</commonModules>
<commonModules>CommonModule.SourceOfOriginClientServer</commonModules>
<commonModules>CommonModule.ControlCodeStringsClient</commonModules>
<commonModules>CommonModule.Log</commonModules>
<commonAttributes>CommonAttribute.Author</commonAttributes>
<commonAttributes>CommonAttribute.Branch</commonAttributes>
<commonAttributes>CommonAttribute.Description</commonAttributes>
Expand Down
3 changes: 2 additions & 1 deletion IRP/src/DataProcessors/PointOfSale/Forms/Form/Module.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ Procedure ItemListControlCodeStringStateClick() Export
Params.Insert("Item", CurrentData.Item);
Params.Insert("ItemKey", CurrentData.ItemKey);
Params.Insert("LineNumber", CurrentData.LineNumber);
Params.Insert("isReturn", isReturn);
Notify = New NotifyDescription("ItemListControlCodeStringStateOpeningEnd", ThisObject, Params);

OpenForm("CommonForm.CodeStringCheck", Params, ThisObject, , , , Notify, FormWindowOpeningMode.LockOwnerWindow);
Expand All @@ -702,7 +703,7 @@ Procedure ItemListControlCodeStringStateOpeningEnd(Result, AddInfo) Export
EndDo;

ControlCodeStringsClient.UpdateState(Object);

Modified = True;
EndProcedure

#Region SpecialOffers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ Procedure Filling(FillingData, FillingText, StandardProcessing)
ControllerClientServer_V2.SetReadOnlyProperties(ThisObject, FillingData);
ThisObject.ProductionPlanning = FillingData.ProductionPlanning;
ThisObject.Company = FillingData.Company;
ThisObject.Branch = FillingData.Branch;
ThisObject.BusinessUnit = FillingData.BusinessUnit;
EndIf;
EndIf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ Procedure ItemListControlCodeStringStateClick() Export
Params.Insert("Item", CurrentData.Item);
Params.Insert("ItemKey", CurrentData.ItemKey);
Params.Insert("LineNumber", CurrentData.LineNumber);
Params.Insert("isReturn", True);
Notify = New NotifyDescription("ItemListControlCodeStringStateOpeningEnd", ThisObject, Params);

OpenForm("CommonForm.CodeStringCheck", Params, ThisObject, , , , Notify, FormWindowOpeningMode.LockOwnerWindow);
Expand All @@ -835,7 +836,7 @@ Procedure ItemListControlCodeStringStateOpeningEnd(Result, AddInfo) Export
EndDo;

ControlCodeStringsClient.UpdateState(Object);

Modified = True;
EndProcedure

#EndRegion
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@ Procedure ItemListControlCodeStringStateClick() Export
Params.Insert("Item", CurrentData.Item);
Params.Insert("ItemKey", CurrentData.ItemKey);
Params.Insert("LineNumber", CurrentData.LineNumber);
Params.Insert("isReturn", False);
Notify = New NotifyDescription("ItemListControlCodeStringStateOpeningEnd", ThisObject, Params);

OpenForm("CommonForm.CodeStringCheck", Params, ThisObject, , , , Notify, FormWindowOpeningMode.LockOwnerWindow);
Expand All @@ -852,7 +853,7 @@ Procedure ItemListControlCodeStringStateOpeningEnd(Result, AddInfo) Export
EndDo;

ControlCodeStringsClient.UpdateState(Object);

Modified = True;
EndProcedure

#EndRegion
7 changes: 0 additions & 7 deletions Unit/src/Catalogs/ItemKeys/ItemKeys.mdo
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
</types>
</typeExtension>
</extension>
<type/>
</attributes>
<attributes uuid="e24992d8-4e4b-48fb-9e33-1ecff27521fe">
<name>Unit</name>
Expand All @@ -34,7 +33,6 @@
</types>
</typeExtension>
</extension>
<type/>
</attributes>
<attributes uuid="bed58c0a-067f-4c6d-a9b1-484e01981e58">
<name>Specification</name>
Expand All @@ -47,7 +45,6 @@
</types>
</typeExtension>
</extension>
<type/>
</attributes>
<attributes uuid="0b3eea57-92cf-4afb-a48a-9f29dd8414ea">
<name>AffectPricingMD5</name>
Expand All @@ -63,7 +60,6 @@
</stringQualifiers>
</typeExtension>
</extension>
<type/>
</attributes>
<attributes uuid="6bdf1e79-77a8-4713-9f71-1a618a8163dd">
<name>UniqueMD5</name>
Expand All @@ -79,7 +75,6 @@
</stringQualifiers>
</typeExtension>
</extension>
<type/>
</attributes>
<attributes uuid="0335ab5b-d050-46e0-8d7b-232875676960">
<name>ItemKeyID</name>
Expand All @@ -95,7 +90,6 @@
</stringQualifiers>
</typeExtension>
</extension>
<type/>
</attributes>
<tabularSections uuid="e308f718-cb1d-42a1-9be7-d3fe7b6113f7">
<producedTypes>
Expand All @@ -119,7 +113,6 @@
</stringQualifiers>
</typeExtension>
</extension>
<type/>
</attributes>
</tabularSections>
<forms uuid="3fc2847e-aa4b-4477-acfb-df076db489fd">
Expand Down
Loading

0 comments on commit ee781aa

Please sign in to comment.