SDHINVLIG: Prohibiting delivery lines in invoice creation

Use this entry point to take over during the read loop of delivery lines to invoice in order not to invoice some lines.

It is also called during the execution of the 'Invoice' button in delivery management.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

There is no open log file.

Call context

This entry point is called upon execution of the "Invoice" button in delivery management.  This button executes the invoice object. 

The entry point is therefore called in the invoice object from the AFFMASK gobjet action.

It is located in the read loop of the delivery lines.  It is called for each delivery line.

Available variables and masks

The delivery object screen classes are on line and loaded with the delivery to invoice. 

The invoice object screen classes are on line. The invoice header masks are already loaded from the delivery.

The IJL variable is loaded and corresponds to the index for the delivery line being processed in the [M :SDH1] mask.

The delivery line is invoiced if all is not returned ([M :SDH1]QTY(IJL) > [M :SDH1]RTNQTY(IJL) and if the variable WPE_SDHINVLIG=1.

Therefore, it is necessary to set WPE_SDHINVLIG to 0 in order not to invoice a delivery line.

NB: If a delivery line is not invoiced, no update is carried out for the delivery line and the order line. 

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…). It is usually the case for the file that contains the header but not for the file that contain the lines…

Table

Significant content

Table Title

SDELIVERY

Yes

Delivery header

SDELIVERYD

No

Delivery line

SORDER

No

Order headers

SORDERQ

No

Order line quantities

SORDERP

No

Order line prices

SORDERC

No

Order totals order A/R

BPARTNER

No

BP

BPCUSTOMER

Yes

Customers

BPDLVCUST

No

Ship-to customers

BPCUSTMVT

No

Customer transactions

FACILITY

No

Site

ITMMASTER

No

Products

ITMSALES 

No 

Sales product

ITMBPC

No

Product-customer

TABCUR

No

Currency table

ITMFACILIT

No

Product-site

ITMCATEG

No

Product category

ITMMVT

No

Product movements

SPRICLINK

No

Sales price list search

PRICSTRUCT

No

Price list structure

SALESREP

No

Sales representative

TABUNIT

No

Unit table

BPSUPPLIER

No

Supplier

STOREO

No

Reorder

STOALL

No

Allocations

STOJOU

No

Stock journal

STOCK

No

Stock

STOLOT

No

Lot number

STOSER

No

Serial number

SPREASON

No

Sales price list reason

TABCOUNTRY

No

Country table

SINVOICEV

No

Invoice valuation

SINVOICE

No

Invoice headers

SINVOICED

No

Invoices - Detail

TABSIVTYP

Yes

Invoice type

GTYPACCENT

No

Entry type

GACCCODE

No

Accounting codes

GACCOUNT

No

General ledger accounts

CONTSERV

No

Service contracts

SRETURND

No

Return detail

SERREQUEST

No

Service requests

HDKTASKINV

No

Consumptions to be invoiced

ACTIV

No

Activity codes

GAUTACE

No

Automatic journals

ACODNUM

No

Document sequence numbers

TABALLRUL

No

Allocation/issue rules

TABSTORUL

No

Stock management rules

STOWIPW

No

Stock being processed

SPACK

No

Packaging header

SPACKD

No

Packaging detail

BPCARRIER

No

Carriers

BPADDRESS

No

Addresses

SFOOTINV

No

Invoicing elements

TABMODELIV

No

Delivery mode table

TABCOUAFF

No

Sequence number assignment

ACCES

No

Access codes

 

ALISIVTYP: Loading of the invoice type

Use this entry point to take over when creating a proforma (or an invoice) to load in a specific way the invoice type.

It is called upon execution of the 'Proforma' and 'Invoice' buttons from the sales quote (for the 'Proforma' button), the orders and the deliveries.

It is also called upon entry of a proforma or an invoice in invoice management.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

There is no open log file.

Call context

This entry point is called upon execution of the "Invoice" button in sales quote, orders and deliveries.  This button executes the invoice object. 

This entry point is called upon execution of the "Invoice" button in the orders and deliveries management, when the SIVTYP general parameter (User invoice type, VEN chapter, site level) is not specified.  This button executes the invoice object. 

In both these cases, the entry point is called in the invoice object from the AFFMASK gobjet action. It is called before the proforma or invoice is initialized from the source document.

This entry point is also called upon entry of a proforma, an invoice, a credit memo when creating a new file.

In this case, the entry point is called in the invoice object from the RAZCRE gobjet action. It is called before entering the proforma, the invoice or the credit memo and before picking source documents. It is also called when entering an invoice or a direct credit memo.

Available variables and masks

In the case of the button, the screen classes of the origin object are on line and loaded with the quote, the order, the delivery to transform into a proforma. Same for invoices.

In all cases, the screen classes of the invoice object are on line but are not yet loaded with the source document.

However, the [M:SIH0]INVTYP field is loaded with the category of invoice to generate (5=Proforma, 1=Invoice, 2=Credit memo).

The WKFILSUP variable is a filter variable used to search for the invoice type in the TABSIVTYP table. This is the variable to use and load in the entry point to filter a specific type. The loading must be formed as follows: WKFILSUP="[TSV]SIVTYP='PRO'" where PRO corresponds to the desired type.

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…). It is usually the case for the file that contains the header but not for the file that contain the lines…

Table

Significant content

Table Title

BPARTNER

No

BP

BPCUSTOMER

No

Customers

BPDLVCUST

No

Ship-to customers

BPCUSTMVT

No

Customer transactions

FACILITY

No

Site

ITMMASTER

No

Products

ITMSALES 

No 

Sales product

ITMBPC

No

Product-customer

TABCUR

No

Currency table

ITMFACILIT

No

Product-site

ITMCATEG

No

Product category

ITMMVT

No

Product movements

SPRICLINK

No

Sales price list search

PRICSTRUCT

No

Price list structure

SALESREP

No

Sales representative

TABUNIT

No

Unit table

BPSUPPLIER

No

Supplier

STOREO

No

Reorder

STOALL

No

Allocations

STOJOU

No

Stock journal

STOCK

No

Stock

STOLOT

No

Lot number

STOSER

No

Serial number

SPREASON

No

Sales price list reason

TABCOUNTRY

No

Country table

SINVOICEV

No

Invoice valuation

SINVOICE

No

Invoice headers

SINVOICED

No

Invoices - Detail

TABSIVTYP

No

Invoice type

 FACGROUP

No

Site grouping

GTYPACCENT

No

Entry type

GACCCODE

No

Accounting codes

GACCOUNT

No

General ledger accounts

CONTSERV

No

Service contracts

SRETURND

No

Return detail

SERREQUEST

No

Service requests

HDKTASKINV

No

Consumptions to be invoiced

ACTIV

No

Activity codes

GAUTACE

No

Automatic journals

ACODNUM

No

Document sequence numbers

TABALLRUL

No

Allocation/issue rules

TABSTORUL

No

Stock management rules

STOWIPW

No

Stock being processed

SPACK

No

Packaging header

SPACKD

No

Packaging detail

BPCARRIER

No

Carriers

BPADDRESS

No

Addresses

SFOOTINV

No

Invoicing elements

TABMODELIV

No

Delivery mode table

TABCOUAFF

No

Sequence number assignment

ACCES

No

Access codes

 

ADD_TOT: Calculating the total amounts of an invoice

This entry point is called in invoice management.

It is used to take over during the processing of an invoice line when calculating the different amounts of an invoice. It can be used to calculate specific amounts.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

There is no open log file.

Call context

This entry point is called in invoice management:

. At line end (end without validation, creation, modification).

. When picking a delivery line, order, service contract, invoice and return (in the case of a credit memo entry).

. On the "Price calculation" button via the Action button on a line.

. When modifying the following fields of the invoice header if the user has requested a recalculation of the price list of all the lines:

.             Invoice date

.            Delivery address

.             Currency

.             Price type

. During modification of the following fields of the invoice header:

.             Delivery address: If the user did not ask for a price recalculation but the modification causes a modification of the tax rule, a recalculation of the prices, margins and totals of the lines is automatically performed.

.             Tax rule: A recalculation of the prices, the margin, and the line totals is carried out automatically.

.            Currency rate: A recalculation of the margin and the line totals is carried out automatically.

.             Currency: If the user did not request a recalculation of the price list, a recalculation of the prices, of the margins and line totals is carried out automatically.

. It is called when searching for groups upon invoice creation/modification for the lines modified by the search.

Available variables and masks

This entry point is called in the ADD_TOT sub-program of the SUBSIHB processing. This sub-program increments some header amounts of the invoice with amounts of the line being created/modified. Depending on the context, the call to the ADD_TOT sub-program is preceded by the call to the SUB_TOT sub-program (in the case of the modification of a line for example, the invoice amounts are decremented from the former line amounts then incremented with the new line amounts).

The various invoice management screens are on line and loaded with the invoice being created/modified.

The [M:SIH4] invoice line screen is loaded. It is indexed by the NLIG variable that therefore corresponds to nolign-1. NLIG corresponds to the index of the line being created/modified.

This entry point is called at the end of the sub-program. The different standard amounts of the invoice have been modified ([M:SIH4]PFMTOT).

This entry point can be used to update the specific amounts.

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…). It is usually the case for the file that contains the header but not for the file that contain the lines…

Table

Significant content

Table Title

BPARTNER

No

BP

BPCUSTOMER

No

Customers

BPDLVCUST

No

Ship-to customers

BPCUSTMVT

No

Customer transactions

FACILITY

No

Site

ITMMASTER

No

Products

ITMSALES 

No 

Sales product

ITMBPC

No

Product-customer

TABCUR

No

Currency table

ITMFACILIT

No

Product-site

ITMCATEG

No

Product category

ITMMVT

No

Product movements

SPRICLINK

No

Sales price list search

PRICSTRUCT

No

Price list structure

SALESREP

No

Sales representative

TABUNIT

No

Unit table

BPSUPPLIER

No

Supplier

STOREO

No

Reorder

STOALL

No

Allocations

STOJOU

No

Stock journal

STOCK

No

Stock

STOLOT

No

Lot number

STOSER

No

Serial number

SPREASON

No

Sales price list reason

TABCOUNTRY

No

Country table

SINVOICEV

No

Invoice valuation

SINVOICE

No

Invoice headers

SINVOICED

No

Invoices - Detail

TABSIVTYP

No

Invoice type

 FACGROUP

No

Site grouping

GTYPACCENT

No

Entry type

GACCCODE

No

Accounting codes

GACCOUNT

No

General ledger accounts

CONTSERV

No

Service contracts

SRETURND

No

Return detail

SERREQUEST

No

Service requests

HDKTASKINV

No

Consumptions to be invoiced

ACTIV

No

Activity codes

GAUTACE

No

Automatic journals

ACODNUM

No

Document sequence numbers

TABALLRUL

No

Allocation/issue rules

TABSTORUL

No

Stock management rules

STOWIPW

No

Stock being processed

SPACK

No

Packaging header

SPACKD

No

Packaging detail

BPCARRIER

No

Carriers

BPADDRESS

No

Addresses

SFOOTINV

No

Invoicing elements

TABMODELIV

No

Delivery mode table

TABCOUAFF

No

Sequence number assignment

ACCES

No

Access codes

 

SUB_TOT: Calculating the total amounts of an invoice

This entry point is called in invoice management.

It is used to take over during the processing of an invoice line when calculating the different amounts of an invoice. It can be used to calculate specific amounts.

Context and operating mode

Transaction

There is no transaction in progress.

Log file

There is no open log file.

Call context

This entry point is called in invoice management:

. At line end.

. On the "Price calculation" button via the Action button on a line.

. When searching for groups upon invoice creation/modification for the lines modified by the search.

Available variables and masks

This entry point is called in the SUB-TOT sub-program of the SUBSIHB processing. This sub-program decrements some header amounts of the invoice with amounts of the line being created/modified. Depending on the context, the call to the SUB_TOT sub-program is followed by the call to the ADD_TOT sub-program (in the case of the modification of a line for example, the invoice amounts are decremented from the former line amounts then incremented with the new line amounts).

The various invoice management screens are on line and loaded with the invoice being created/modified.

The [M:SIH4] invoice line screen is loaded. It is indexed by the variable NLIG that therefore corresponds to nolign-1 NLIG corresponds to the index of the line being created/modified.

This entry point is called at the end of the sub-program. The different standard amounts of the invoice have been modified ([M:SIH4]PFMTOT).

This entry point can be used to update the specific amounts.

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context (the current customer is loaded…). It is usually the case for the file that contains the header but not for the file that contain the lines…

Table

Significant content

Table Title

BPARTNER

No

BP

BPCUSTOMER

No

Customers

BPDLVCUST

No

Ship-to customers

BPCUSTMVT

No

Customer transactions

FACILITY

No

Site

ITMMASTER

No

Products

ITMSALES 

No 

Sales product

ITMBPC

No

Product-customer

TABCUR

No

Currency table

ITMFACILIT

No

Product-site

ITMCATEG

No

Product category

ITMMVT

No

Product movements

SPRICLINK

No

Sales price list search

PRICSTRUCT

No

Price list structure

SALESREP

No

Sales representative

TABUNIT

No

Unit table

BPSUPPLIER

No

Supplier

STOREO

No

Reorder

STOALL

No

Allocations

STOJOU

No

Stock journal

STOCK

No

Stock

STOLOT

No

Lot number

STOSER

No

Serial number

SPREASON

No

Sales price list reason

TABCOUNTRY

No

Country table

SINVOICEV

No

Invoice valuation

SINVOICE

No

Invoice headers

SINVOICED

No

Invoices - Detail

TABSIVTYP

No

Invoice type

 FACGROUP

No

Site grouping

GTYPACCENT

No

Entry type

GACCCODE

No

Accounting codes

GACCOUNT

No

General ledger accounts

CONTSERV

No

Service contracts

SRETURND

No

Return detail

SERREQUEST

No

Service requests

HDKTASKINV

No

Consumptions to be invoiced

ACTIV

No

Activity codes

GAUTACE

No

Automatic journals

ACODNUM

No

Document sequence numbers

TABALLRUL

No

Allocation/issue rules

TABSTORUL

No

Stock management rules

STOWIPW

No

Stock being processed

SPACK

No

Packaging header

SPACKD

No

Packaging detail

BPCARRIER

No

Carriers

BPADDRESS

No

Addresses

SFOOTINV

No

Invoicing elements

TABMODELIV

No

Shipment method table

TABCOUAFF

No

Sequence number assignment

ACCES

No

Access codes