generate/cbs2.gif Sale Transaction Line Item Cost Price (R-INCOST.MAC) generate/en72.jpg


 

The script file must be located in your CAPITAL program or data directory and must have the file name R-INCOST.MAC

Entry Values

Variable

Purpose

Mode

The operating mode.

0 = invoicing or stock transfers

1 = reserved

2 = sales order or requisition

3 = quotations

4 = back order control centre

5 = service manager

6 = hire manager

ProductCode

The product code of the item for which a cost price is required.

Quantity

The quantity being sold/shipped.

SellPrice

The current default item sell price.

Stock->X

Stock Control fields.

Staux000->X

Stock Control user defined fields (if applicable.)

Custrec->X

Customer fields.

Cuaux000->X

Customer user fields if applicable.

Smjobs->X

Service Manager or Hire Manager job fields when called from the Service Manager or Hire Manager. These fields will be available if the Mode is 5 or 6.

Smaux000->X

Service Manager or Hire Manager job fields if applicable when called from the Service Manager or Hire Manager. These fields will be available if the Mode is 5 or 6.

Return Values

The cost price as a number. If any other value is returned the script is ignored.

Comments

This script can be used to calculate a cost price for a sales related transaction or job card.

generate/notepad2.gifThis script is not called by the stock receipt or purchase order systems.

Example

* Check if the user defined field Speccost has

* the value of Y and if it does, return the cost

* price as Stock price field F plus 10%

* (10% = multiply field F by 1.1)

If Staux000->Speccost = "Y"

   Return Stock->F * 1.1

Endif

Return FALSE

____________________________

Related Topics:

Scripting Hooks

Script Programming



Help Topic Map