WebDocs · Update SR
Update SR Documentation
Sales Return (SR) processing is embedded inside the XZOUT receipt workflow. When an XZOUT number is printed, the system fetches associated Sales Return documents, appends them to the receipt, and certifies the batch by salesman.
SR Attachment
Appends SR lines under their parent XZOUT receipt.
Salesman Certification
Shows certifying salesman from SR header remarks.
Multi-DB Lookup
Reads XZ/SR data across ERP and barcode databases.
Integration
This is not a standalone executable. Sales Return processing lives inside Printing.vb → xzout_receipt(). It runs automatically after XZOUT totals.
| File | Role |
|---|---|
Printing.vb | Contains SR query loop inside xzout_receipt(). |
Connection.vb | Provides dual SQL connections for ERP and barcode lookups. |
Workflow
| Trigger | Action |
|---|---|
| XZOUT batch starts | Loads XZ header, company, salesman, territory. |
| After SO listing | Queries xz_detail for SR-linked SOs. |
| SR records found | Writes “SALES RETURNS” header and loops each SR. |
| Each SR | Reads sr_detail qty returned, sr_header net amount, salesman name from remarks. |
| Print complete | Writes certifying salesman, ref number, timestamp. |
Database References
| Table | Purpose |
|---|---|
mcjim_all_prog.dbo.xz_detail | Maps XZOUT to SR numbers via s_so_number LIKE 'SR%'. |
erpdata_new.dbo.sr_detail | Returns qty via d_qty_returned. |
erpdata_new.dbo.sr_header | Returns net amount and remarks-based salesman code. |
erpdata_new.dbo.salesman | Resolves salesman name from code extracted from remarks. |
Notes
SR processing does not update any print flag. It only reads and prints.
Salesman name is extracted from s_int_remarks using prefix Salesman: .
If salesman lookup fails, fallback text is NO NAME SPECIFIED.
This flow is invoked from the same batch buttons as SO/XZOUT printing.