09.06.2007, 05:00 | #1 |
Участник
|
Фактуры. Помогите с запросом.
Здравия всем...
Вот такой вот запросик при обработке фактур занимает сейчас секунд 30 минимум при выполнении... Местонахождение - classes\FactureCalcSettlement_RU\calcFactureAmounts line 50 X++: // Process line markups while select sum(LineAmount), sum(VAT), sum(TaxAmount),sum(Qty), maxOf(ItemName) from factureTrans group by TaxCode, Dimension, ExchRate,InventTransId, InternalInvoiceId,InvoiceId,NumberSequenceGroup,markupRefRecId exists join custVendInvoiceTrans exists join markupTrans where factureTrans.FactureId == _factureJour.FactureId && factureTrans.Module == module && factureTrans.FactureLineType == FactureLineType_RU::Markup && markupTrans.RecId == factureTrans.MarkupRefRecId && markupTrans.TransTableId == custVendInvoiceTrans.TableId && custVendInvoiceTrans.RecId == markupTrans.TransRecId && custVendInvoiceTrans.SalesPurchId == _custVendInvoiceJour.Num && custVendInvoiceTrans.InvoiceNum == _custVendInvoiceJour.InvoiceId && custVendInvoiceTrans.InvoiceDate == _custVendInvoiceJour.InvoiceDate && (module == FactureModule_RU::Cust || (module == FactureModule_RU::Vend && custVendInvoiceTrans.PurchInternalInvoiceId == _custVendInvoiceJour.PurchInternalInvoiceId)) && custVendInvoiceTrans.NumberSequenceGroupId == _custVendInvoiceJour.NumberSequenceGroupId { this.addFactureTransAmounts(factureAmounts, factureTrans, _factureJour); } X++: // Process line markups while select sum(LineAmount), sum(VAT), sum(TaxAmount),sum(Qty), maxOf(ItemName) from factureTrans group by TaxCode, Dimension, ExchRate,InventTransId, InternalInvoiceId,InvoiceId,NumberSequenceGroup,markupRefRecId where factureTrans.FactureId == _factureJour.FactureId && factureTrans.Module == module && factureTrans.FactureLineType == FactureLineType_RU::Markup exists join markupTrans where markupTrans.RecId == factureTrans.MarkupRefRecId && markupTrans.TransTableId == custVendInvoiceTrans.TableId exists join custVendInvoiceTrans where custVendInvoiceTrans.RecId == markupTrans.TransRecId && custVendInvoiceTrans.SalesPurchId == _custVendInvoiceJour.Num && custVendInvoiceTrans.InvoiceNum == _custVendInvoiceJour.InvoiceId && custVendInvoiceTrans.InvoiceDate == _custVendInvoiceJour.InvoiceDate && (module == FactureModule_RU::Cust || (module == FactureModule_RU::Vend && custVendInvoiceTrans.PurchInternalInvoiceId == _custVendInvoiceJour.PurchInternalInvoiceId)) && custVendInvoiceTrans.NumberSequenceGroupId == _custVendInvoiceJour.NumberSequenceGroupId { this.addFactureTransAmounts(factureAmounts, factureTrans, _factureJour); } |
|
|
Похожие темы | ||||
Тема | Ответов | |||
Помогите с запросом | 4 | |||
Помогите с запросом | 40 | |||
Помогите с запросом.. | 2 | |||
Помогите с SQL запросом | 8 | |||
Пожалуйста, помогите с запросом | 19 |
|