For the complete documentation index, see llms.txt. This page is also available as Markdown.

Save Physical Verification of a Purchase Challan

Records the physical verification of goods received on a purchase challan (goods received before the supplier's bill). The warehouse scans or counts what is actually in the cartons, and Logic ERP keeps that count against each line of the challan – as the Physical Stock Verification Of PUV screen (Inventory menu) does for challans. Logic ERP compares it with the challan quantity: anything scanned that is not on the challan, or more than the challan quantity, goes into a difference list. This endpoint creates no new document and does not change stock.

It works exactly like Save Physical Verification of a Purchase Voucher, except for how the document is found; the differences are listed here in full so this page can be used on its own.

Endpoint

Name
Detail

Address

https://your-server/api/SavePhysicalVerificationPUChallan

Method

POST

Authorization

Basic Auth

The response and the common messages are explained in How Every API Call Works.

Field names are matched without regard to upper/lower case; fields not listed below are ignored.

Request fields

Field
Type
Required
Default
Meaning

DocCode

number

One of the two

0

Logic ERP's internal number of the purchase challan: Vouch_Code in Get Purchase Challans, or the LastSavedCode returned by Save a Purchase Challan. Recommended. When it is above 0, PUV_Bill_No is not used and the branch is not checked.

PUV_Bill_No

text

One of the two

empty

The supplier's bill or challan number as entered on the purchase challan (Bill_No in Get Purchase Challans). Used only when DocCode is 0. See the known issue below.

BranchCode

number

With PUV_Bill_No

0

The branch of the challan (Branch_Code in Get Branch Info). There is no branch short name field.

ListItems

list

No

empty

What was scanned or counted, one entry per scan. See the table below. An empty list changes no count but is still answered as saved.

Doc_Type

text

No

–

Ignored. This endpoint always works on purchase challans.

ListItems

Field
Type
Required
Default
Meaning

LogicUser_Code

text

Yes

–

The code that was scanned; what it must contain depends on the counting method below. An empty value stops the request.

Quantity

number

Depends

0

How many were counted for this code (lot code and item code counting). When the configuration counts in packs, the number is multiplied by the units per pack of the matching challan line.

AddlItemCode, Packing_Box_No, Item_Det_Code

–

No

–

Ignored. To scan an additional item code, send it in LogicUser_Code.

How the code is read

The API template names a configuration of the Physical Stock Verification Of PUV screen, which decides how LogicUser_Code is read. If the challan has already been counted, the method of that earlier count is used again.

Counting method

LogicUser_Code holds

Quantity

Lot code

The barcode printed on the lot label.

Send it – left out, nothing is counted. If the barcode also carries a piece number, that piece number is used as the quantity instead.

Lot code with piece number

The barcode of one piece.

Ignored – one piece per barcode; a piece already counted is skipped.

Item code

The item code (UserCode in Get Item Master), or an additional item code when your company uses them. Upper/lower case must match the item code on the challan; a code that differs only in case goes to the difference list.

The number counted; 1 or less (or left out) counts as 1.

Lot number

The lot number.

See the known issue below – nothing is counted.

Set code / set name

The code or name of an item set.

Ignored – each item of the set is counted by its quantity in the set. A set that is not found is skipped without a message.

If the configuration has a lot code prefix, every LogicUser_Code must start with it.

Rules Logic ERP applies

  • Which challan. With DocCode, that challan is used. With PUV_Bill_No, the first purchase challan in BranchCode with that number is used – from any year (challans are not kept by financial year).

  • Challan quantity. Each line is compared with the challan line's original quantity.

  • Configuration required. The API template must name a default configuration for this screen.

  • Counts add up. Each request adds to what has already been counted for the challan. Send each scan once.

  • Matching. A scan is set against the challan line with the same lot (or item) that still has quantity left; anything else goes to the difference list.

  • When the count is refused. Nothing is saved if the configuration requires a minimum percentage to be scanned and less was scanned (counting every request so far). Counting by packing box, and copying the challan quantity into the count, are refused.

  • All or nothing. The counts for all lines and the difference list are saved together. If any scan is refused, nothing from the request is saved.

Known issue – a refused count is answered "Physical Varification Done...". When the count is refused at the saving step, the answer is Status: false with the message Physical Varification Done... – the real reason is lost. Always read Status, not Message; if it is false, check the challan on the screen.

Known issue – a challan can be refused because of a purchase voucher. Before saving, Logic ERP checks whether the document has been used in a physical-stock debit note or in the Receipt Register – but it checks the purchase vouchers of the current year that happen to carry the same internal number as the challan. If such a voucher was used, the challan count is refused and answered Status: false with the message Physical Varification Done.... Record that challan's count on the screen.

Known issue – missing challan answered as success. If DocCode is 0 and PUV_Bill_No is empty, the answer is Status: true with the message Invalid Bill No. Please Check..., and nothing is saved.

Known issue – an unknown DocCode is accepted. DocCode is not checked: a number that is not a purchase challan is answered Status: true, and every scan is saved to the difference list of that number. Take DocCode from Get Purchase Challans.

Known issue – the "scan every line" option has no effect. A configuration that requires every challan line to be scanned before saving is not applied by this endpoint: a count with unscanned lines is saved. Check unscanned lines on the Physical Stock Verification Of PUV screen.

Known issue – PUV_Bill_No can pick the wrong challan. Challan numbers from suppliers often repeat, and the first challan found with that number in the branch is used, from any year. Use DocCode instead.

Known issue – counting by lot number saves nothing. When the configuration counts by lot number and the challan has not been counted before, no quantity is recorded although the request succeeds, and every line is saved as counted with zero. Count by lot code or item code instead.

Example request

Counting by lot code:

Test it

Send a request to the Logic ERP sandbox (a test company) from this page: open the block below, enter the sandbox user name and password (ask your Logic ERP support team), change the request if you like, and press Test it. This really saves in the sandbox, so use test values like the example. The example counts the sandbox's test challan; counts add up, so each send counts again.

Save Physical Verification of a Purchase Challan

post

Records the physical verification of goods received on a purchase challan (goods received before the supplier's bill). The warehouse scans or counts what is actually in the cartons, and Logic ERP keeps that count against each line of the challan – as the Physical Stock Verification Of PUV screen (Inventory menu) does for challans. Logic ERP compares it with the challan quantity: anything scanned that is not on the challan, or more than the challan quantity, goes into a difference list. This endpoint creates no new document and does not change stock.

Authorizations
AuthorizationstringRequired

The user name and password of your API site.

Body
BranchCodeintegerOptional

The branch of the challan (Branch_Code in Get Branch Info). There is no branch short name field.

DocCodeintegerOptional

Logic ERP's internal number of the purchase challan: Vouch_Code in Get Purchase Challans, or the LastSavedCode returned by Save a Purchase Challan. Recommended. When it is above 0, PUV_Bill_No is not used and the branch is not checked.

Responses
200

Always HTTP 200. Check Status and Message.

application/json
StatusbooleanOptional

true when the count was saved. Read this field, not Message.

MessagestringOptional

"Physical Varification Done..." when saved; otherwise the reason. Unexpected errors return technical text with the reason in it.

LastSavedCodeintegerOptional

Always 0.

request_IDstringOptional

Always empty for this endpoint.

post/SavePhysicalVerificationPUChallan
POST /api/SavePhysicalVerificationPUChallan HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 91

{
  "BranchCode": 2,
  "DocCode": 1423,
  "ListItems": [
    {
      "LogicUser_Code": "APITEST0001",
      "Quantity": 5
    }
  ]
}
{
  "Status": true,
  "Message": "text",
  "LastSavedCode": 1,
  "request_ID": "text"
}

Response

Field
Type
Meaning

Status

true / false

true when the count was saved. Read this field, not Message.

Message

text

"Physical Varification Done..." when saved; otherwise the reason. Unexpected errors return technical text with the reason in it.

LastSavedCode

number

Always 0.

request_ID

text

Always empty for this endpoint.

Example response

Messages you may see

Message
Meaning
What to do

No Purchase Voucher Selected

No challan found for PUV_Bill_No in the branch (not used for DocCode; the text says voucher for challans too).

Check the number and BranchCode, or send DocCode.

Invalid Bill No. Please Check... (with Status: true)

Neither DocCode nor PUV_Bill_No was sent. Nothing was saved.

Send one of them.

Default Configuration Not Selected...

The API template has no configuration for this screen.

Ask your Logic ERP team to set it.

Cannot Allow Box No Scanning. Please check Physical Verification Of PUV Config...

The configuration counts by packing box.

Use a configuration without box scanning.

Cannot Move Voucher Quantity to Physical Quantity. Please check Physical Verification Of PUV Config...

The configuration copies the challan quantity into the count.

Use a configuration without that option.

Barcode cannot be blank

An entry has an empty LogicUser_Code.

Send a code in every entry.

Invalid Item Code..

The code does not start with the configured lot code prefix.

Send the full code as printed.

Invalid Item Code.....: …

The item code does not exist in Logic ERP (item-code counting with invalid items not allowed).

Check the code.

Invalid Barcode...(…)

Piece counting: the barcode is not a lot-and-piece barcode.

Scan the piece label.

Lot Number does not exists / More than one Item exists against Lot

Lot-number counting: the lot number was not found, or belongs to several items.

Check the lot number.

Physical Varification Done... with Status: false

The count was refused when saving; the reason is not shown.

Check the challan on the screen.