1
0
mirror of https://github.com/IRPTeam/IRP.git synced 2025-09-16 08:56:27 +02:00
* #IRP-686

* added test

---------

Co-authored-by: Andrey Vorobyov <andrey.vorobyov@mail.com>
Co-authored-by: GulnaraBasusta <160037415+GulnaraBasusta@users.noreply.github.com>
This commit is contained in:
Andrey Vorobyov
2025-06-19 09:32:32 +03:00
committed by GitHub
parent ca5b9f63e3
commit 52cb05d7ac
3 changed files with 112 additions and 31 deletions

View File

@@ -1531,6 +1531,7 @@ Function Strings(Lang) Export
Strings.Insert("Error_180", NStr("en = 'Only system record allowed'", Lang));
Strings.Insert("Error_181", NStr("en = 'Attribute already on form. Remove duplicate from set: [%1]'", Lang));
Strings.Insert("Error_182", NStr("en = 'Account [%1] [%2]. Lacking: %3 %2.'", Lang));
Strings.Insert("Error_183", NStr("en = 'Wrong linked row [%1]: Document date [%2] less than Basis date [%3]'", Lang));
Strings.Insert("Error_FillTotalAmount", NStr("en = 'Fill total amount. Row: [%1]'", Lang));

View File

@@ -13886,26 +13886,13 @@ Procedure FillCheckProcessing(Object, Cancel, LinkedFilter, RowIDInfoTable, Item
If Not LinkedRowsIntegrityIsEnable() Then
Return;
EndIf;
// check internal links
TempTablesManager = New TempTablesManager();
Query = New Query();
Query.TempTablesManager = New TempTablesManager();
Query.Text =
Query.TempTablesManager = TempTablesManager;
Query.Text =
"SELECT
| BasisesTable.RowID,
| BasisesTable.RowRef,
| BasisesTable.Basis,
| BasisesTable.BasisKey,
| BasisesTable.CurrentStep,
| BasisesTable.ItemKey,
| BasisesTable.Item,
| BasisesTable.Store
|INTO BasisesTable
|FROM
| &BasisesTable AS BasisesTable
|;
|
|////////////////////////////////////////////////////////////////////////////////
|SELECT
| RowIDInfo.Key,
| RowIDInfo.RowID,
| RowIDInfo.RowRef,
@@ -13926,7 +13913,74 @@ Procedure FillCheckProcessing(Object, Cancel, LinkedFilter, RowIDInfoTable, Item
| ItemList.Store
|INTO ItemList
|FROM
| &ItemList AS ItemList
| &ItemList AS ItemList";
Query.SetParameter("RowIDInfo", RowIDInfoTable);
Query.SetParameter("ItemList", ItemListTable);
Query.Execute();
// check dates
Query = New Query();
Query.TempTablesManager = TempTablesManager;
Query.Text =
"SELECT
| RowIDInfo.Key AS Key,
| RowIDInfo.Basis AS Basis,
| RowIDInfo.Basis.Date AS BasisDate
|INTO tmp_RowID
|FROM
| RowIDInfo AS RowIDInfo
|WHERE
| NOT RowIDInfo.Basis.Ref IS NULL
|;
|
|////////////////////////////////////////////////////////////////////////////////
|SELECT
| ItemList.Key AS Key,
| ItemList.LineNumber AS LineNumber,
| &DocDate AS Date
|INTO tmp_ItemList
|FROM
| ItemList AS ItemList
|;
|
|////////////////////////////////////////////////////////////////////////////////
|SELECT
| tmp_ItemList.LineNumber AS LineNumber,
| tmp_RowID.Basis AS Basis,
| tmp_ItemList.Date AS Date,
| tmp_RowID.BasisDate AS BasisDate
|FROM
| tmp_RowID AS tmp_RowID
| INNER JOIN tmp_ItemList AS tmp_ItemList
| ON tmp_ItemList.Key = tmp_RowID.Key
| AND tmp_ItemList.Date <= tmp_RowID.BasisDate";
Query.SetParameter("DocDate", Object.Date);
QueryResult = Query.Execute();
QueryTable = QueryResult.Unload();
For Each Row In QueryTable Do
Cancel = True;
CommonFunctionsClientServer.ShowUsersMessage(StrTemplate(R().Error_183,
Row.LineNumber, Row.Date, Row.BasisDate),
"ItemList[" + Format((Row.LineNumber - 1), "NZ=0; NG=0;") + "].IsInternalLinked", Object);
EndDo;
// check internal links
Query = New Query();
Query.TempTablesManager = TempTablesManager;
Query.Text =
"SELECT
| BasisesTable.RowID,
| BasisesTable.RowRef,
| BasisesTable.Basis,
| BasisesTable.BasisKey,
| BasisesTable.CurrentStep,
| BasisesTable.ItemKey,
| BasisesTable.Item,
| BasisesTable.Store
|INTO BasisesTable
|FROM
| &BasisesTable AS BasisesTable
|;
|
|////////////////////////////////////////////////////////////////////////////////
@@ -14013,8 +14067,6 @@ Procedure FillCheckProcessing(Object, Cancel, LinkedFilter, RowIDInfoTable, Item
BasisesTable = GetBasises(Object.Ref, LinkedFilter);
Query.SetParameter("BasisesTable", BasisesTable);
Query.SetParameter("RowIDInfo", RowIDInfoTable);
Query.SetParameter("ItemList", ItemListTable);
Is = Is(Object);
If Is.RRR Or Is.SR Or Is.PO Or Is.PI Or Is.SC Or Is.SI Then

View File

@@ -5015,14 +5015,42 @@ Scenario: _2060041 check link/unlink form in the PO - PI (use variable item key,
| 'Phone A' | 'Blue' | '5,000' |
| 'Router' | 'Router' | '1,000' |
And I close all client application windows
Scenario: _2060042 check link/unlink in first posting (PO date later than PI)
And I close all client application windows
* Create PO
Given I open hyperlink "e1cib/list/Document.PurchaseOrder"
And I click the button named "FormCreate"
* Fillling main info
And I select from the drop-down list named "Partner" by "Crystal" string
And I select from the drop-down list named "Agreement" by "Vendor, TRY" string
And I select "Approved" exact value from the drop-down list named "Status"
* Adding Items
And in the table "ItemList" I click the button named "ItemListAdd"
And I select "Boots" by string from the drop-down list named "ItemListItem" in "ItemList" table
And I select "38/18SD" by string from the drop-down list named "ItemListItemKey" in "ItemList" table
And I input "1 000,000" text in the field named "ItemListQuantity" of "ItemList" table
And I finish line editing in "ItemList" table
And in the table "ItemList" I click the button named "ItemListAdd"
And I select "Dress" by string from the drop-down list named "ItemListItem" in "ItemList" table
And I select "M/White" by string from the drop-down list named "ItemListItemKey" in "ItemList" table
And I input "100,000" text in the field named "ItemListQuantity" of "ItemList" table
And I finish line editing in "ItemList" table
And I move to the tab named "GroupOther"
And I input "10.06.2025 13:27:02" text in the field named "Date"
And I click the button named "FormPost"
* Create PI
And I click the button named "FormDocumentPurchaseInvoiceGenerate"
Then "Add linked document rows" window is opened
And I expand current line in "BasisesTree" table
And I click the button named "FormOk"
And I move to the tab named "GroupOther"
And I move to the tab named "GroupMore"
And I input "08.06.2025 16:22:10" text in the field named "Date"
And I click the button named "FormPost"
* Check
Then there are lines in TestClient message log
|'Wrong linked row [1]: Document date [08.06.2025 16:22:10] less than Basis date [10.06.2025 13:27:02]'|
|'Wrong linked row [2]: Document date [08.06.2025 16:22:10] less than Basis date [10.06.2025 13:27:02]'|
And I close all client application windows