Skip to content

Commit

Permalink
Translate
Browse files Browse the repository at this point in the history
  • Loading branch information
DitriXNew committed Mar 15, 2024
1 parent 37f31e0 commit 9a809c6
Show file tree
Hide file tree
Showing 19 changed files with 1,340 additions and 97 deletions.
2 changes: 0 additions & 2 deletions IRP/src/Catalogs/FixedAssets/Forms/ItemForm/Module.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Procedure OnCreateAtServer(Cancel, StandardProcessing)
SetVisibilityAvailability(Object, ThisObject);
EndIf;

LocalizationEvents.CreateMainFormItemDescription(ThisObject, "GroupDescriptions");
LocalizationEvents.FillDescription(Parameters.FillingText, Object);
AddAttributesAndPropertiesServer.OnCreateAtServer(ThisObject);
ExtensionServer.AddAttributesFromExtensions(ThisObject, Object.Ref, Items.GroupMainPages);
CatalogsServer.OnCreateAtServerObject(ThisObject, Object, Cancel, StandardProcessing);
Expand Down
2 changes: 1 addition & 1 deletion IRP/src/CommonModules/DocCashReceiptClient/Module.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ Procedure PaymentListOrderStartChoice(Object, Form, Item, ChoiceData, StandardPr

Parameters = New Structure();
Parameters.Insert("Filter", New Structure());
If ValueIsFilled(CurrentData.Payee) Then
If ValueIsFilled(CurrentData.Payer) Then
Parameters.Filter.Insert("LegalName", CurrentData.Payer);
EndIf;
Parameters.Filter.Insert("Company", Object.Company);
Expand Down
104 changes: 103 additions & 1 deletion IRP/src/CommonModules/DocumentsGenerationServer/Module.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ Function GetDocumentTable_PurchaseDocument_ForPayment(ArrayOfBasisDocuments, Doc
| R1021B_VendorsTransactions.Agreement AS StandardAgreement,
| VALUE(Catalog.Agreements.EmptyRef) AS Agreement,
| R1021B_VendorsTransactions.LegalName AS LegalName,
| R1021B_VendorsTransactions.Order AS Order,
| R1021B_VendorsTransactions.Project AS Project,
| R1021B_VendorsTransactions.AmountBalance AS Amount
|FROM
| AccumulationRegister.R1021B_VendorsTransactions.Balance(, (Company, Branch, Currency, Agreement, Partner, LegalName) IN
Expand Down Expand Up @@ -162,6 +164,8 @@ Function GetDocumentTable_PurchaseDocument_ForPayment(ArrayOfBasisDocuments, Doc
| tmp.Partner AS Partner,
| tmp.Agreement AS Agreement,
| tmp.LegalName AS LegalName,
| tmp.Order AS Order,
| tmp.Project AS Project,
| tmp.Amount AS Amount
|INTO QueryTable_StandardAgreements
|FROM
Expand All @@ -179,6 +183,8 @@ Function GetDocumentTable_PurchaseDocument_ForPayment(ArrayOfBasisDocuments, Doc
| R1021B_VendorsTransactions.Partner,
| R1021B_VendorsTransactions.Agreement,
| R1021B_VendorsTransactions.LegalName AS Payee,
| R1021B_VendorsTransactions.Order AS Order,
| R1021B_VendorsTransactions.Project AS Project,
| R1021B_VendorsTransactions.AmountBalance AS Amount
|FROM
| AccumulationRegister.R1021B_VendorsTransactions.Balance(, Basis IN
Expand All @@ -203,6 +209,8 @@ Function GetDocumentTable_PurchaseDocument_ForPayment(ArrayOfBasisDocuments, Doc
| PartnerTransactionsBalance.Partner,
| PartnerTransactionsBalance.Agreement,
| PartnerTransactionsBalance.LegalName,
| PartnerTransactionsBalance.Order,
| PartnerTransactionsBalance.Project,
| PartnerTransactionsBalance.AmountBalance
|FROM
| AccumulationRegister.R1021B_VendorsTransactions.Balance(, (Company, Branch, Currency, Agreement, Partner, LegalName) IN
Expand Down Expand Up @@ -232,6 +240,8 @@ Function GetDocumentTable_PurchaseDocument_ForPayment(ArrayOfBasisDocuments, Doc
| QueryTable_StandardAgreements.Partner,
| QueryTable_StandardAgreements.Agreement,
| QueryTable_StandardAgreements.LegalName,
| QueryTable_StandardAgreements.Order,
| QueryTable_StandardAgreements.Project,
| QueryTable_StandardAgreements.Amount
|FROM
| QueryTable_StandardAgreements AS QueryTable_StandardAgreements";
Expand Down Expand Up @@ -262,6 +272,8 @@ Function GetDocumentTable_SalesDocument_ForReceipt(ArrayOfBasisDocuments, Docume
| R2021B_CustomersTransactionsBalance.Agreement AS StandardAgreement,
| VALUE(Catalog.Agreements.EmptyRef) AS Agreement,
| R2021B_CustomersTransactionsBalance.LegalName AS LegalName,
| R2021B_CustomersTransactionsBalance.Order AS Order,
| R2021B_CustomersTransactionsBalance.Project AS Project,
| R2021B_CustomersTransactionsBalance.AmountBalance AS Amount
|FROM
| AccumulationRegister.R2021B_CustomersTransactions.Balance(, (Company, Branch, Currency, Agreement, Partner, LegalName) IN
Expand Down Expand Up @@ -305,6 +317,8 @@ Function GetDocumentTable_SalesDocument_ForReceipt(ArrayOfBasisDocuments, Docume
| tmp.Partner AS Partner,
| tmp.Agreement AS Agreement,
| tmp.LegalName AS LegalName,
| tmp.Order AS Order,
| tmp.Project AS Project,
| tmp.Amount AS Amount
|INTO QueryTable_StandardAgreements
|FROM
Expand All @@ -322,6 +336,8 @@ Function GetDocumentTable_SalesDocument_ForReceipt(ArrayOfBasisDocuments, Docume
| R2021B_CustomersTransactionsBalance.Partner,
| R2021B_CustomersTransactionsBalance.Agreement,
| R2021B_CustomersTransactionsBalance.LegalName AS Payer,
| R2021B_CustomersTransactionsBalance.Order AS Order,
| R2021B_CustomersTransactionsBalance.Project AS Project,
| R2021B_CustomersTransactionsBalance.AmountBalance AS Amount
|FROM
| AccumulationRegister.R2021B_CustomersTransactions.Balance(, Basis IN
Expand All @@ -346,6 +362,8 @@ Function GetDocumentTable_SalesDocument_ForReceipt(ArrayOfBasisDocuments, Docume
| R2021B_CustomersTransactionsBalance.Partner,
| R2021B_CustomersTransactionsBalance.Agreement,
| R2021B_CustomersTransactionsBalance.LegalName,
| R2021B_CustomersTransactionsBalance.Order,
| R2021B_CustomersTransactionsBalance.Project,
| R2021B_CustomersTransactionsBalance.AmountBalance
|FROM
| AccumulationRegister.R2021B_CustomersTransactions.Balance(, (Company, Branch, Currency, Agreement, Partner, LegalName) IN
Expand Down Expand Up @@ -375,6 +393,8 @@ Function GetDocumentTable_SalesDocument_ForReceipt(ArrayOfBasisDocuments, Docume
| QueryTable_StandardAgreements.Partner,
| QueryTable_StandardAgreements.Agreement,
| QueryTable_StandardAgreements.LegalName,
| QueryTable_StandardAgreements.Order,
| QueryTable_StandardAgreements.Project,
| QueryTable_StandardAgreements.Amount
|FROM
| QueryTable_StandardAgreements AS QueryTable_StandardAgreements";
Expand Down Expand Up @@ -479,6 +499,8 @@ Function GetDocumentTable_SalesReturn_ForPayment(ArrayOfBasisDocuments, AddInfo
| R2021B_CustomersTransactionsBalance.Agreement AS StandardAgreement,
| VALUE(Catalog.Agreements.EmptyRef) AS Agreement,
| R2021B_CustomersTransactionsBalance.LegalName AS LegalName,
| R2021B_CustomersTransactionsBalance.Order AS Order,
| R2021B_CustomersTransactionsBalance.Project AS Project,
| R2021B_CustomersTransactionsBalance.AmountBalance AS Amount
|FROM
| AccumulationRegister.R2021B_CustomersTransactions.Balance(, (Company, Branch, Currency, Agreement, Partner, LegalName) IN
Expand Down Expand Up @@ -526,6 +548,8 @@ Function GetDocumentTable_SalesReturn_ForPayment(ArrayOfBasisDocuments, AddInfo
| tmp.Partner AS Partner,
| tmp.Agreement AS Agreement,
| tmp.LegalName AS LegalName,
| tmp.Order AS Order,
| tmp.Project AS Project,
| tmp.Amount AS Amount
|INTO QueryTable_StandardAgreements
|FROM
Expand All @@ -543,6 +567,8 @@ Function GetDocumentTable_SalesReturn_ForPayment(ArrayOfBasisDocuments, AddInfo
| R2021B_CustomersTransactionsBalance.Partner,
| R2021B_CustomersTransactionsBalance.Agreement,
| R2021B_CustomersTransactionsBalance.LegalName AS Payee,
| R2021B_CustomersTransactionsBalance.Order AS Order,
| R2021B_CustomersTransactionsBalance.Project AS Project,
| -R2021B_CustomersTransactionsBalance.AmountBalance AS Amount
|FROM
| AccumulationRegister.R2021B_CustomersTransactions.Balance(, Basis IN
Expand All @@ -567,6 +593,8 @@ Function GetDocumentTable_SalesReturn_ForPayment(ArrayOfBasisDocuments, AddInfo
| R2021B_CustomersTransactionsBalance.Partner,
| R2021B_CustomersTransactionsBalance.Agreement,
| R2021B_CustomersTransactionsBalance.LegalName,
| R2021B_CustomersTransactionsBalance.Order,
| R2021B_CustomersTransactionsBalance.Project,
| -R2021B_CustomersTransactionsBalance.AmountBalance
|FROM
| AccumulationRegister.R2021B_CustomersTransactions.Balance(, (Company, Branch, Currency, Agreement, Partner, LegalName) IN
Expand Down Expand Up @@ -596,6 +624,8 @@ Function GetDocumentTable_SalesReturn_ForPayment(ArrayOfBasisDocuments, AddInfo
| QueryTable_StandardAgreements.Partner,
| QueryTable_StandardAgreements.Agreement,
| QueryTable_StandardAgreements.LegalName,
| QueryTable_StandardAgreements.Order,
| QueryTable_StandardAgreements.Project,
| -QueryTable_StandardAgreements.Amount
|FROM
| QueryTable_StandardAgreements AS QueryTable_StandardAgreements";
Expand Down Expand Up @@ -625,6 +655,8 @@ Function GetDocumentTable_PurchaseReturn_ForReceipt(ArrayOfBasisDocuments, AddIn
| R1021B_VendorsTransactions.Agreement AS StandardAgreement,
| VALUE(Catalog.Agreements.EmptyRef) AS Agreement,
| R1021B_VendorsTransactions.LegalName AS LegalName,
| R1021B_VendorsTransactions.Order AS Order,
| R1021B_VendorsTransactions.Project AS Project,
| R1021B_VendorsTransactions.AmountBalance AS Amount
|FROM
| AccumulationRegister.R1021B_VendorsTransactions.Balance(, (Company, Branch, Currency, Agreement, Partner, LegalName) IN
Expand Down Expand Up @@ -671,6 +703,8 @@ Function GetDocumentTable_PurchaseReturn_ForReceipt(ArrayOfBasisDocuments, AddIn
| tmp.Partner AS Partner,
| tmp.Agreement AS Agreement,
| tmp.LegalName AS LegalName,
| tmp.Order AS Order,
| tmp.Project AS Project,
| tmp.Amount AS Amount
|INTO QueryTable_StandardAgreements
|FROM
Expand All @@ -688,6 +722,8 @@ Function GetDocumentTable_PurchaseReturn_ForReceipt(ArrayOfBasisDocuments, AddIn
| R1021B_VendorsTransactions.Partner,
| R1021B_VendorsTransactions.Agreement,
| R1021B_VendorsTransactions.LegalName AS Payer,
| R1021B_VendorsTransactions.Order AS Order,
| R1021B_VendorsTransactions.Project AS Project,
| -R1021B_VendorsTransactions.AmountBalance AS Amount
|FROM
| AccumulationRegister.R1021B_VendorsTransactions.Balance(, Basis IN
Expand All @@ -712,6 +748,8 @@ Function GetDocumentTable_PurchaseReturn_ForReceipt(ArrayOfBasisDocuments, AddIn
| PartnerTransactionsBalance.Partner,
| PartnerTransactionsBalance.Agreement,
| PartnerTransactionsBalance.LegalName,
| PartnerTransactionsBalance.Order,
| PartnerTransactionsBalance.Project,
| -PartnerTransactionsBalance.AmountBalance
|FROM
| AccumulationRegister.R1021B_VendorsTransactions.Balance(, (Company, Branch, Currency, Agreement, Partner, LegalName) IN
Expand Down Expand Up @@ -741,6 +779,8 @@ Function GetDocumentTable_PurchaseReturn_ForReceipt(ArrayOfBasisDocuments, AddIn
| QueryTable_StandardAgreements.Partner,
| QueryTable_StandardAgreements.Agreement,
| QueryTable_StandardAgreements.LegalName,
| QueryTable_StandardAgreements.Order,
| QueryTable_StandardAgreements.Project,
| -QueryTable_StandardAgreements.Amount
|FROM
| QueryTable_StandardAgreements AS QueryTable_StandardAgreements";
Expand All @@ -750,4 +790,66 @@ Function GetDocumentTable_PurchaseReturn_ForReceipt(ArrayOfBasisDocuments, AddIn
Return QueryResult.Unload();
EndFunction

#EndRegion
Function CreateDocumentAmountTable() Export
AmountsTable = New ValueTable();
AmountsTable.Columns.Add("Company");
AmountsTable.Columns.Add("Branch");
AmountsTable.Columns.Add("Currency");
AmountsTable.Columns.Add("Partner");
AmountsTable.Columns.Add("LegalName");
AmountsTable.Columns.Add("Agreement");
AmountsTable.Columns.Add("Order");
AmountsTable.Columns.Add("Project");
AmountsTable.Columns.Add("Amount");

Return AmountsTable;
EndFunction

Procedure FillDocumentAmountTable(DocumentAmountTable, ArrayOfocuments, Order_ColumnName = "") Export
For Each DocRef In ArrayOfocuments Do
DocHeader = New Structure();
DocHeader.Insert("Company" , DocRef.Company);
DocHeader.Insert("Branch" , DocRef.Branch);
DocHeader.Insert("Currency" , DocRef.Currency);
DocHeader.Insert("Partner" , DocRef.Partner);
DocHeader.Insert("LegalName" , DocRef.LegalName);
DocHeader.Insert("Agreement" , DocRef.Agreement);

For Each Row In DocRef.ItemList Do
NewRow = DocumentAmountTable.Add();
FillPropertyValues(NewRow, DocHeader);
If ValueIsFilled(Order_ColumnName) Then
_Order = Row[Order_ColumnName];
If ValueIsFilled(_Order) Then
NewRow.Order = _Order;
EndIf;
EndIf;
NewRow.Project = Row.Project;
NewRow.Amount = Row.TotalAmount;
EndDo;
EndDo;
EndProcedure

Function CalculateDocumentAmount(DocumentAmountTable, Filter, NetAmount, TotalAmount) Export

Result = New Structure("NetAmount, TotalAmount, Skip", NetAmount, TotalAmount, False);

DocumentAmount = Undefined;

DocumentAmountRows = DocumentAmountTable.Copy(Filter);
If DocumentAmountRows.Count() Then
DocumentAmount = DocumentAmountRows.Total("Amount");
Result.TotalAmount = Min(DocumentAmount, Result.TotalAmount);
Result.NetAmount = Min(DocumentAmount, Result.NetAmount);
Return Result;
Else
If DocumentAmountTable.Count() Then
Result.Skip = True;
Return Result;
EndIf;
EndIf;

Return Result;
EndFunction

#EndRegion
53 changes: 47 additions & 6 deletions IRP/src/CommonModules/JorDocumentsClient/Module.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,25 @@ Function GetDocQueryText(QueryParameters, Parameters, TableName,

If Parameters.Property("Type") Then
QueryParameters.Insert("Type", Parameters.Type);
QueryParameters.Insert("Type_PurchaseInvoice", Type("DocumentRef.PurchaseInvoice"));
QueryParameters.Insert("Type_SalesInvoice" , Type("DocumentRef.SalesInvoice"));
ArrayOfConditions.Add(" AND Obj.Type = &Type");
ArrayOfConditions.Add(" AND Obj.Type <> &Type_PurchaseInvoice");
ArrayOfConditions.Add(" AND Obj.Type <> &Type_SalesInvoice");

If Parameters.Type = Type("DocumentRef.SalesOrder")
Or Parameters.Type = Type("DocumentRef.PurchaseOrder") Then
QueryParameters.Insert("OnlyOrders", True);
Else
QueryParameters.Insert("OnlyOrders", False);
EndIf;
Else
QueryParameters.Insert("Type_PurchaseOrder", Type("DocumentRef.PurchaseOrder"));
QueryParameters.Insert("Type_SalesOrder" , Type("DocumentRef.SalesOrder"));
ArrayOfConditions.Add(" AND Obj.Type <> &Type_PurchaseOrder");
ArrayOfConditions.Add(" AND Obj.Type <> &Type_SalesOrder");

QueryParameters.Insert("OnlyOrders", False);
EndIf;

If Parameters.Property("RefInList") Then
Expand Down Expand Up @@ -350,7 +363,9 @@ EndFunction
Function GetDocWithBalanceQueryText()
QueryText_DocWithBalance =
"SELECT ALLOWED
| CustomersTransactions.Basis AS Ref,
| CASE WHEN &OnlyOrders THEN
| CustomersTransactions.Order
| ELSE CustomersTransactions.Basis END AS Ref,
| CustomersTransactions.Company AS Company,
| CustomersTransactions.Partner AS Partner,
| CustomersTransactions.LegalName AS LegalName,
Expand All @@ -369,7 +384,18 @@ Function GetDocWithBalanceQueryText()
|FROM
| AccumulationRegister.R2021B_CustomersTransactions.Balance(&Period,
| CurrencyMovementType = VALUE(ChartOfCharacteristicTypes.CurrencyMovementType.SettlementCurrency)
| AND (Basis, Company, Partner, LegalName, Agreement, Currency) IN
| AND ((Basis, Company, Partner, LegalName, Agreement, Currency) IN
| (SELECT
| Doc.Ref,
| Doc.Company,
| Doc.Partner,
| Doc.LegalName,
| Doc.Agreement,
| Doc.Currency
| FROM
| Doc AS Doc)
| OR
| (Order, Company, Partner, LegalName, Agreement, Currency) IN
| (SELECT
| Doc.Ref,
| Doc.Company,
Expand All @@ -378,7 +404,7 @@ Function GetDocWithBalanceQueryText()
| Doc.Agreement,
| Doc.Currency
| FROM
| Doc AS Doc)) AS CustomersTransactions
| Doc AS Doc))) AS CustomersTransactions
|WHERE
| CASE
| WHEN &IsReturnTransactionType
Expand All @@ -393,7 +419,9 @@ Function GetDocWithBalanceQueryText()
|UNION ALL
|
|SELECT
| VendorsTransactions.Basis,
| CASE WHEN &OnlyOrders THEN
| VendorsTransactions.Order
| ELSE VendorsTransactions.Basis END AS Ref,
| VendorsTransactions.Company,
| VendorsTransactions.Partner,
| VendorsTransactions.LegalName,
Expand All @@ -411,7 +439,7 @@ Function GetDocWithBalanceQueryText()
|FROM
| AccumulationRegister.R1021B_VendorsTransactions.Balance(&Period,
| CurrencyMovementType = VALUE(ChartOfCharacteristicTypes.CurrencyMovementType.SettlementCurrency)
| AND (Basis, Company, Partner, LegalName, Agreement, Currency) IN
| AND ((Basis, Company, Partner, LegalName, Agreement, Currency) IN
| (SELECT
| Doc.Ref,
| Doc.Company,
Expand All @@ -420,7 +448,20 @@ Function GetDocWithBalanceQueryText()
| Doc.Agreement,
| Doc.Currency
| FROM
| Doc AS Doc)) AS VendorsTransactions
| Doc AS Doc)
| OR
| (Order, Company, Partner, LegalName, Agreement, Currency) IN
| (SELECT
| Doc.Ref,
| Doc.Company,
| Doc.Partner,
| Doc.LegalName,
| Doc.Agreement,
| Doc.Currency
| FROM
| Doc AS Doc))
|
|) AS VendorsTransactions
|WHERE
| CASE
| WHEN &IsReturnTransactionType
Expand Down
Loading

0 comments on commit 9a809c6

Please sign in to comment.