Script: Set account payable to posted / cancelled

This script sets a creditor to posted or cancelled again, without carrying over data to the accounting system.

Product line

Standard

|

Expert

Operating mode

CLOUD ABO

|

ON-PREMISES

Modules

Services & CRM

Budget & Phases

Purchases

Resource Planning

Business Intelligence

Created: 25.05.2012
Updated: 11.10.2024 | Corrected indentation in script text.

Content

This script cancels or posts a account payable without carrying over data to the accounting system. This can be useful, for example, if a account payable is to appear as posted in Vertec afterwards, but the accounting period is already completed.

During the posting process, certain values are fixed in the Vertec. This script simulates this process. If the creditor is already posted, it is cancelled, otherwise posted.

Version

All Vertec versions.

Execute

On the creditor you want to put on posted.

Scripting

SetCreditorToBooked.py

Script text

# coding: windows-1252
#
#---Description: Set borrower posted to posted (without accounting)
# Class: Creditor
#   ObjectScript: Y
#   ContainerScript: N
#   EventType: None
#   EventClass:
#   EventMembers:
#   ExtendedRights: N
#---If the member posted on the creditor is changed, instead of the default function post,
# Posting some information is missing on the postings. With this script the script is
# Stored in rows saved and reinstated after repositioning.
#---12.04.2012, RS: created.
#---23.10.2013, MW: Handle outlays and expenses, instead of just outlays.

from vtcapp import getpropertyvalue, evalocl

def main():
    account payable = argobject
    if creditor.booked:
        creditor.booked = False
    else:
        # Read and set information
        creditor.bhExpense accountExpenses = creditor.expense accountExpenses
        creditor.bhExpense accountExpenses = creditor.expense accountExpenses
        creditor.bhKrediCode = creditor.krediCode
        creditor.bhCollectingAccount = creditor.collectingAccount

        expensesbase=creditor.eval('expenses->union(expenses).oclastype(ExpensesBase)')
        for expenditure base in expenditure base:
            expenditurebase.verrMWSTCodeEK = expenditurebase.MWSTCodeEK
            expenditurebase.verrVATrateEK = expenditurebase.VATrateEK
            expenditurebase.creditsexpenditureaccount = expenditurebase.expense account

        creditor.booked = True

main()
Bitte wählen Sie Ihren Standort