Accounts payable are commitments represented by the purchase of goods, services, salaries, taxes, leasing, loans, contributions, machinery, inputs for production, and more.
The Accounts Payable routine of the Microsiga Protheus system controls all documents, also called bills, that the company pays and which can be: trade notes, checks, promissory notes, prepayments, advance payments, invoices, etc. The data registered contribute to decision making on all company commitments that involve the disbursement of resources, being also attributed to the following criteria:
The types of bills identify the amount pertaining to a determined income or expense. You must define them in table 05 (Bill Types) of the Configurator module or in the Bill Types routine. |
You can add a bill to the portfolio payable manually (by personally typing bills) or automatically (from incoming invoices, provided that the Purchases and/or Stock and Costs modules are integrated with the Financial module).
To automatically generate the bill, the Purchases and/or Stock and Costs modules must be deployed and integrated, because the process depends on the receipt of incoming documents and purchase orders.
To configure installments alphabetically, set the content of parameter MV_1DUP to the letter A. Yet, to divide installments numerically, select option 1. |
Grouping the bills by nature generates results in a structured and organized manner (reports), which is a powerful management tool.
Use the breakdown option to generate multiple bills from a single bill, all with the same value (installment) or the value divided by the number of installments (total).
Invoicing, when integrated, generates bills payable through the Commission Update routine. These bills are displayed by default with option COM. Set parameter MV_3DUPREF to define their prefix.
The system tracks the suppliers history details like maximum balance, average and maximum arrears and control of balances payable as value due, overdue and others.
When paying bills, the system offers company X bank features, such as automatic payments and printing checks. You can post bills payable either manually or automatically, by unit or by batches received from banks.
You can control bills regarded for cash flow purposes, because when you add accounts payable, the system updates this flow and makes accounting entries through parameter settings and standardized entries.
Study the chart below to become acquainted with the features of this routine:
Before you start the addition process, press key [F12\] to set routine parameters, following these criteria:
Field: | Description |
Display Acctg. Entry? | Select Yes or No to indicate whether to display accounting entry when booking online. Yes. |
Book Prov. Bills? | Select Yes or No to indicate whether to book provisional bills. No. |
Ent. accts in apportionment? | Select Yes or No whether to display fields for entry of debit and credit accounts in bill apportionment. Yes. |
Online Booking? | Select Yes or No to indicate whether to book transactions online; that is, one at a time (adding a bill, posting, generating a check, deleting, etc.) or offline, with all entries not made online are booked in one batch process. No. |
Gen. check f/ Adv.? | Select Yes or No to indicate whether to generate check for advance payment bills. Thus, the system enables field Check when you add the advance payment and when you enter its number, the bank transaction occurs. Yes. |
Apportion value? | Enter value for accounts payable apportionment. It offers options Gross (bill value plus taxes) and Net (value without taxes). Gross. |
Group Accounting Entry? | Select Yes or No to indicate whether to group accounting entries of apportionment in a single line, if accounts, cost center, item and value class are the same in the entries. No. |
Display apportionment deletion? | Select Yes or No to display apportionment screen when deleting the bill. Yes. |
Bank Trans. w/out check? | Enter whether to generate bank transaction when field Gen. Check f/ Adv. is filled out with option No. It offers these options:
Example: No. |
Gen. apportionment? | For situations involving multiple natures, enter whether to generate apportionment as nature/cost center. For tax values, it is applied only if value apportionment option is filled out as net. It offers options Bill and Bill/Taxes. Bill. |
Add Apportionment of a bill from a module other than Financials. | Select the bill and go to option Edit, access tab Accounting and find the field Apportionment (E2_RATEIO). When you select Yes or No, the apportionment screen is displayed. No. Note: The bill cannot be booked for this situation. |
In the main page of the routine, the following options are available:
|
|
\\ *Addition* Expandir origem #INCLUDE "Protheus.ch" USER FUNCTION FIN050INC() LOCAL aArray := \{\} \\ PRIVATE lMsErroAuto := .F. \\ //Structure for PA ( Advance Payment ) aArray := \{ \{ "E2_PREFIXO" , "PAG" , NIL \},; \{ "E2_NUM" , "0001" , NIL \},; \{ "E2_TIPO" , "PA" , NIL \},; \{ "E2_NATUREZ" , "001" , NIL \},; \{ "E2_FORNECE" , "0001" , NIL \},; \{ "E2_EMISSAO" , CtoD("17/02/2012"), NIL \},; \{ "E2_VENCTO" , CtoD("17/02/2012"), NIL \},; \{ "E2_VENCREA" , CtoD("17/02/2012"), NIL \},; \{ "E2_VALOR" , 5000 , NIL \},; \{ "AUTBANCO" , "001", NIL \},; \{ "AUTAGENCIA" , "1234", NIL \},; \{ "AUTCONTA" , "123456", NIL \} \} \\ //Structure for other bills aArray := \{ \{ "E2_PREFIXO" , "PAG" , NIL \},; \{ "E2_NUM" , "0001" , NIL \},; \{ "E2_TIPO" , "NF" , NIL \},; \{ "E2_NATUREZ" , "001" , NIL \},; \{ "E2_FORNECE" , "0001" , NIL \},; \{ "E2_EMISSAO" , CtoD("17/02/2012"), NIL \},; \{ "E2_VENCTO" , CtoD("17/02/2012"), NIL \},; \{ "E2_VENCREA" , CtoD("17/02/2012"), NIL \},; \{ "E2_VALOR" , 5000 , NIL \} \} \\ MsExecAuto( \{ |x,y,z| FINA050(x,y,z)\}, aArray,, 3) // 3 - Inclusion, 4 - Edition, 5 - Deletion \\ \\ If lMsErroAuto MostraErro() Else Alert("Bill included successfully") Endif \\ Return *Editing* Expandir origem #INCLUDE "Protheus.ch" USER FUNCTION FIN050ALT() LOCAL aArray := \{\} \\ PRIVATE lMsErroAuto := .F. \\ aArray := \{ \{ "E2_PREFIXO" , "PAG" , NIL \},; \{ "E2_NUM" , "0001" , NIL \},; \{ "E2_VALOR" , 2000 , NIL \} \} \\ DbSelectArea("SE2") DbSetOrder(1) DbSeek(xFilial("SE2")+"PAG"+"0001 "+" "+"NF") //Edition must have SE2 record positioned \\ MsExecAuto( \{ |x,y,z| FINA050(x,y,z)\}, aArray,, 4) // 3 - Inclusion, 4 - Edition, 5 - Deletion \\ If lMsErroAuto MostraErro() Else Alert("Bill edited successfully") Endif \\ Return *Deletion* Expandir origem #INCLUDE "Protheus.ch" USER FUNCTION FIN050EXC() LOCAL aArray := \{\} \\ PRIVATE lMsErroAuto := .F. \\ DbSelectArea("SE2") DbSetOrder(1) DbSeek(xFilial("SE2")+"PAG"+"0001 "+" "+"NF") //Deletion must have SE2 record positioned \\ aArray := \{ \{ "E2_PREFIXO" , SE2->E2_PREFIXO , NIL \},; \{ "E2_NUM" , SE2->E2_NUM , NIL \} \} \\ MsExecAuto( \{ |x,y,z| FINA050(x,y,z)\}, aArray,, 5) // 3 - Inclusion, 4 - Edition, 5 - Deletion \\ If lMsErroAuto MostraErro() Else Alert("Bill deleted successfully") Endif \\ Return \\ *Addition with VA (Accessory Values)* Expandir origem #INCLUDE "Protheus.ch" USER FUNCTION FIN050VA() LOCAL aArray := \{\} LOCAL nOpc := 3 // 3-Addition, 4 Editing \\ // Accessory value data. LOCAL aVAAut := \{\} LOCAL cValAce1 := "000001" // Va Code LOCAL nValAce1 := 200 // Va Code LOCAL cValAce2 := "000012" LOCAL nValAce2 := 4 \\ PRIVATE lMsErroAuto := .F. \\ aArray := \{ \{ "E2_PREFIXO" , "PAG" , NIL \},; \{ "E2_NUM" , "0001" , NIL \},; \{ "E2_TIPO" , "NF" , NIL \},; \{ "E2_NATUREZ" , "001" , NIL \},; \{ "E2_FORNECE" , "0001" , NIL \},; \{ "E2_EMISSAO" , CtoD("17/02/2012"), NIL \},; \{ "E2_VENCTO" , CtoD("17/02/2012"), NIL \},; \{ "E2_VENCREA" , CtoD("17/02/2012"), NIL \},; \{ "E2_VALOR" , 5000 , NIL \} \} \\ // Array with accessory value aAdd(aVAAut, \{cValAce1, nValAce1\}) aAdd(aVAAut, \{cValAce2, nValAce2\}) \\ MsExecAuto( \{ |a,b,c,d,e,f,g,h,i,j,k,l| FINA050(a, b, c, d, e, f, g, h, i, j, k, l)\}, aArray,, nOpc,,,,,,,,, aVAAut) \\ If lMsErroAuto MostraErro() Else If nOpc == 3 Alert("Bill successfully added!") Else Alert("Bill edited successfully") EndIf Endif \\ Return *Addition with PA with check* Expandir origem #INCLUDE "Protheus.ch" USER FUNCTION FIN050INCPA() LOCAL aArray := \{\} \\ PRIVATE lMsErroAuto := .F. \\ aArray := \{ \{ "E2_PREFIXO", "PAG" , NIL \},; \{ "E2_NUM" , "0001" , NIL \},; \{ "E2_TIPO" , "PA" , NIL \},; \{ "E2_NATUREZ" , "001" , NIL \},; \{ "E2_FORNECE" , "0001" , NIL \},; \{ "E2_EMISSAO" , CtoD("17/02/2012"), NIL \},; \{ "E2_VENCTO" , CtoD("17/02/2012"), NIL \},; \{ "E2_VENCREA" , CtoD("17/02/2012"), NIL \},; \{ "E2_VALOR" , 5000 , NIL \},; \{ "AUTBANCO" , "FIN" , NIL \},; \{ "AUTAGENCIA" , "00015" , NIL \},; \{ "AUTCONTA" , "0000000001" , NIL \},; \{ "AUTMOED" , "1" , NIL \},; \{ "AUTCHEQUE" , "124569" , NIL \}\} \\ MsExecAuto( \{ |x,y,z| FINA050(x,y,z)\}, aArray,, 3) // 3 - Addition \\ If lMsErroAuto MostraErro() Else Alert("Bill successfully added") Endif \\ Return *Addition with project apportionment (PMS)* Expandir origem USER FUNCTION F050IPMS() Local cPref := "FIN" Local cNum := "210408001" Local cPar := "1" Local cTipo := "NF" Local cNaturez := "FGRV01" Local cFornec := "FGRV04" Local cLoja := "01" Local nValor := 1000 Local aGrvSe2 := \{\} Local aInfProj := \{\} Local aInfAFR := \{\} \\ PRIVATE lMsErroAuto := .F. \\ PREPARE COMPANY ENVIRONMENT "T1" BRANCH "D MG 01 " MODULE "FIN" TABLES "SE2","SE5","SA2","AFR","AF9","AF8" \\ aAdd(aInfAFR, \{"AFR_PROJET", PadR("PMSU000023", TamSX3("AF9_PROJET")\[1\]), Nil\}) aAdd(aInfAFR, \{"AFR_TAREFA", "01.02", Nil\}) aAdd(aInfAFR, \{"AFR_TIPOD", PadR("0004", TamSx3("AFR_TIPOD")\[1\]), Nil\}) aAdd(aInfAFR, \{"AFR_VALOR1", nValor, Nil\}) aAdd(aInfAFR, \{"AFR_REVISA", StrZero(4, TamSX3("AFR_REVISA")\[1\]), Nil\}) aAdd(aInfAFR, \{"AFR_PREFIX", cPref, Nil\}) aAdd(aInfAFR, \{"AFR_NUM", cNum, Nil\}) aAdd(aInfAFR, \{"AFR_PARCEL", cPar, Nil\}) aAdd(aInfAFR, \{"AFR_TIPO", cTipo, Nil\}) aAdd(aInfAFR, \{"AFR_FORNEC", cFornec, Nil\}) aAdd(aInfAFR, \{"AFR_LOJA", cLoja, Nil\}) aAdd(aInfAFR, \{"AFR_DATA", Date(), Nil\}) aAdd(aInfAFR, \{"AFR_VENREA", Date(), Nil\}) aAdd(aInfProj, aInfAFR) \\ aGrvSe2 := \{ \{ "E2_PREFIXO" , cPref , NIL \},; \{ "E2_NUM" , cNum , NIL \},; \{ "E2_TIPO" , cTipo , NIL \},; \{ "E2_NATUREZ" , cNaturez , NIL \},; \{ "E2_FORNECE" , cFornec , NIL \},; \{ "E2_LOJA" , cLoja , NIL \},; \{ "E2_EMISSAO" , Date() , NIL \},; \{ "E2_VENCTO" , Date() , NIL \},; \{ "E2_VENCREA" , Date() , NIL \},; \{ "E2_VALOR" , nValor , NIL \},; \{ "E2_PROJPMS" , "2" , NIL \},; \{ "E2_HIST" , "Project Addition" , NIL \},; \{"AUTRATAFR" , aInfProj ,Nil \} \} \\ MsExecAuto( \{ |x,y,z| FINA050(x,y,z)\}, aGrvSe2,, 3) // 3 - Addition, 4 - Editing, 5 - Deletion \\ If lMsErroAuto MostraErro() Else Conout("Bill successfully added!") Endif \\ Return *Bills payable withholding code* Expandir origem #INCLUDE "Protheus.ch" \\ /*When there is any type of operation involving the entry of value in field E2_CODRET, you need to use function SetFuName("FINA050") before running MSExecAuto(), because a validation exists in X3_VALID -(EXISTCPO("SX5","37"+M->E2_CODRET) .AND. Iif(FUNNAME() $ "FINA050|FINA750",FA050Natur(),.T.)) of this field that will only calculate the tax by withholding code if FunName() is found in "FINA050".*/ \\ USER FUNCTION F050CODRET() LOCAL aArray := \{\} \\ PRIVATE lMsErroAuto := .F. \\ //Structure for other bills aArray := \{ \{ "E2_PREFIXO" , "PAG" , NIL \},; \{ "E2_NUM" , "0001" , NIL \},; \{ "E2_TIPO" , "NF" , NIL \},; \{ "E2_NATUREZ" , "001" , NIL \},; \{ "E2_FORNECE" , "0001" , NIL \},; \{ "E2_EMISSAO" , CtoD("17/02/2012"), NIL \},; \{ "E2_VENCTO" , CtoD("17/02/2012"), NIL \},; \{ "E2_VENCREA" , CtoD("17/02/2012"), NIL \},; \{ "E2_VALOR" , 5000 , NIL \},; \{ "E2_DIRF" , "1", NIL \},; \{ "E2_CODRET" , "3208" , NIL \}\} \\ SetFunName("FINA050") MsExecAuto( \{ |x,y,z| FINA050(x,y,z)\}, aArray,, 3) // 3 - Addition, 4 - Editing, 5 - Deletion \\ \\ If lMsErroAuto MostraErro() Else Alert("Bill successfully added") Endif \\ Return |