Skip to content

Rewizor

SRS

  • srs/830 - lista dokumentów sprzedazowych
    • srs/917` - Zmień status na wysłane
    • srs/918` - Zmień status na niewysłane
  • srs/828 - Lista dokumentów magazynowych
    • srs/915` - Zmień status na wysłane
    • srs/916` - Zmień status na niewysłane
  • srs/828 - Lista dokumentów zakupu
    • srs/917` - Zmień status na wysłane
    • srs/918` - Zmień status na niewysłane

Uprawnienia

  • erp_fk_epp - uprawnienia do integracji z Rewizor

DB

Lista dokumentów sprzedażowych

SQL
-- Lista dokumentów sprzedażowych

      SELECT top 2000
                x.invoiceID,
                x.invoiceID remoteid,
                x.invoiceFullNR + ' ' +
                case when cp.remoteid is not null then 'H'
                     else ''
                end   invoiceFullNR
                ,x.invoiceIssueDate
                ,x.saleDate
                ,x.financialSystemExport
                ,x.grossValue /*- ISNULL(corrected_IV.grossValue,0)*/ grossValue
                ,x.netValue   /*- ISNULL(corrected_IV.netValue,0)*/ netValue
                ,x.accDate
                ,x.accUsername
                ,x.warehouseID warehouseidPoz
                --,x.payerID
                ,dt.componentName
                ,x.status
                ,isModified --znacznik czy byla reczna modyfikacja pozycji
                ,x.addDate
                ,1 'mode'
                ,@datefrom datefrom
                ,@dateto dateto
                ,@warehouseid warehouseid
            FROM document.invoice x
            left join document.invoice cor_inv on x.correctInvoiceID = cor_inv.invoiceID
            --inner join [document].invoiceline il  on x.invoiceID=il.invoiceID
            left JOIN document.documentType dt  ON dt.documentType=x.invoiceCategory
            left join document.invoice corrected_IV on corrected_IV.invoiceID = x.prevCorrectionID
            left join (
            select distinct invoiceid,1 ismodified from document.invoiceLine il inner join accounting.customeAccounting ca
            on il.invoiceLineID = ca.remoteID) modified on  modified.invoiceid= x.invoiceid
            left join (select distinct remoteid from common.paymentschedule where status >-1) cp on x.invoiceid= cp.remoteid
        left join document.documentRelation br2 on br2.invoiceID = x.invoiceID and br2.documentRelationType = 5--aby odfiltrować paragony mające faktury
            where x.status>=0
                and (x.invoiceFullNR like '%' + @documentnr +'%' or @documentnr is null)
                and (x.invoiceIssueDate>= isnull(@datefrom,getdate()-1000) and  x.invoiceIssueDate    <=   isnull(@dateto,getdate()+1000)   )
                and dt.componentName in ('saleInvoice')
                and (@warehouseid is null or x.warehouseID = @warehouseid)
                and dt.isProforma = 0
                and br2.documentRelationID is null
                and case when x.invoiceFullNR like 'k%' and cor_inv.invoiceFullNR not like 'k%' and  cor_inv.sysGrossValue=0 then 1
                         when x.invoiceFullNR like 'k%' and x.sysGrossValue=0 then 0 else 1 end =1
            order by x.invoiceIssueDate , x.invoiceFullNR

Lista dokumentów magazynowych

SQL
-- Lista dokumentów magazynowych

            Select
                ROW_NUMBER() OVER ( order by addDate desc ) AS Row,
                documentID
                ,documentDate
                ,documentFullNR
                --,accDate
                --,accUsername
                ,warehouseID
                --,financialSystemExport
                ,addDate
                ,firmid
                ,firmNR
                ,componentName
                ,[itemValue]
                ,commisionID
                ,commisionFullNR
                ,organisationUnitID
                ,invoiceNR
                ,isModified --znacznik czy byla reczna modyfikacja pozycji
                ,"Podgląd" detail
        from view_prev

Lista dokumentów zakupowych

SQL
-- Lista dokumentów zakupowych

SELECT top 2000
        x.invoiceID,
        x.invoiceFullNR + ' ' +
        case when cp.remoteid is not null then 'H'
                else ''
        end purchaseFullNR
        ,x.invoiceFullNR2
        ,x.invoiceIssueDate
        ,x.saleDate
        ,x.financialSystemExport
        ,x.sysGrossValue /*- ISNULL(corrected_IV.grossValue,0)*/ grossValue
        ,x.sysNetValue   /*- ISNULL(corrected_IV.netValue,0)*/ netValue
        ,x.accDate
        ,x.accUsername
        ,x.warehouseID
        ,x.issuerID
        ,dt.componentName
        ,isModified --znacznik czy byla reczna modyfikacja pozycji
        ,x.[status]
        ,x.addDate
    FROM document.invoice x
    --inner join [document].invoiceline il  on x.invoiceID=il.invoiceID
    left JOIN document.documentType dt  ON dt.documentType=x.invoiceCategory
    left join document.invoice corrected_IV on corrected_IV.invoiceID = x.prevCorrectionID
    left join (
    select distinct invoiceid,1 ismodified from document.invoiceLine il inner join accounting.customeAccounting ca
    on il.invoiceLineID = ca.remoteID) modified on  modified.invoiceid= x.invoiceid
    left join (select distinct remoteid from common.paymentschedule where status >-1) cp on x.invoiceid= cp.remoteid

    where x.status>=0
        and (@documentnr is null or x.invoiceFullNR like '%' + @documentnr +'%' or x.invoiceFullNR2 like '%' + @documentnr +'%')
        and (x.invoiceIssueDate>= isnull(@datefrom,getdate()-1000) and  x.invoiceIssueDate    <=   isnull(@dateto,getdate()+1000)   )
        --and (x.invoiceID= @id or @id is null)
        and (@exported is null or ((@exported = 1 and x.financialSystemExport is not null) or (@exported = 0 and x.financialSystemExport is null)))
        and dt.componentName in ('orderInvoice') --UWAGA tylko ZAKUP
        and (@warehouseID is null or x.warehouseID = @warehouseid)
        --and (@documentType is null or x.invoiceCategory = @documentType)
        --and (x.invoiceFullNR not like 'p%')
        --and case when x.invoiceFullNR like 'k%' and x.sysGrossValue=0 then 0 else 1 end =1
    order by x.invoiceIssueDate , x.invoiceFullNR

Oznaczenie listy dokumentów sprzedażowych

  • [accounting].[sales_exportToFinancialSystem] - lista dokumentów sprzedażowych oznaczona jako wysłana
  • [accounting].[sales_revertExportToFinancialSystem] - lista dokumentów sprzedażowych oznaczona jako niewysłane

Oznaczenie dokumentów magazynowych

  • [accounting].[warehouse_exportToFinancialSystem] - lista dokumentów magazynowych oznaczona jako wysłana
  • [accounting].[warehouse_revertExportToFinancialSystem] - lista dokumentów magazynowych oznaczona jako niewysłane

Oznaczenie listy dokumentów zakupowych

  • [accounting].[sales_exportToFinancialSystem] - lista dokumentów zakupowych oznaczona jako wysłana
  • [accounting].[sales_revertExportToFinancialSystem] - lista dokumentów zakupowych oznaczona jako niewysłane

Proces

Eksportuj

  1. Wybrać z menu API -> Finanse-EPP ->Dekrety Sprzedaży/Magazyn/Zakup FK (2 pkt.)
  2. Kliknąć przycisk Magazyn niewysłanych
  3. Zaznaczyć interesujące nas dokumenty
  4. Kliknąć przycisk Zmień status na wysłane > Dokumenty oznacza się jako wycofanie wysłania do księgowości dla dokumentów magazynowych/zakupu

Cofnij eksport

  1. Wybrać z menu API -> Finanse-EPP ->Dekrety Sprzedaży/Magazyn/Zakup (2 pkt.)
  2. Kliknąć przycisk Magazyn wysłanych
  3. Zaznaczyć interesujące nas dokumenty
  4. Kliknąć przycisk Zmień status na niewysłane > Dokumenty oznacza się jako wyeksportowanego do FK