0% found this document useful (0 votes)
115 views611 pages

431

The document details the structure and properties of an object table in a database, including fields, permissions, and various event triggers for inserting, modifying, deleting, and renaming records. It outlines the validation processes for different fields such as item numbers, descriptions, and pricing, as well as the relationships with other records and setups. Additionally, it includes multilingual captions for user interface elements and specific calculations related to inventory management.

Uploaded by

Yudiana Marrero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
115 views611 pages

431

The document details the structure and properties of an object table in a database, including fields, permissions, and various event triggers for inserting, modifying, deleting, and renaming records. It outlines the validation processes for different fields such as item numbers, descriptions, and pricing, as well as the relationships with other records and setups. Additionally, it includes multilingual captions for user interface elements and specific calculations related to inventory management.

Uploaded by

Yudiana Marrero
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 611

OBJECT Table 27 Item

{
OBJECT-PROPERTIES
{
Date=27/07/23;
Time=10:35:48;
Modified=Yes;
Version List=NAVW114.01,NAVES14.01,LSW113.02.00.800,AITANASTD1.07,AITMOB
1.0,AITANA,006,007,013,OS,044,062,073,077,083,096,119,139,174,204,396,428,431,522,5
32,545,573,MRW,MRW009,MRW999,MW-2824,,#457313;
}
PROPERTIES
{
Permissions=TableData 337=d,
TableData 5940=rm,
TableData 5941=rm;
DataCaptionFields=No.,Description;
OnInsert=VAR
MealPlanSetup@1100225001 : Record 10012100;
BEGIN
IF "No." = '' THEN BEGIN
//LS -
IF "No. Series" <> '' THEN
NoSeriesMgt.InitSeries("No. Series",xRec."No.
Series",0D,"No.","No. Series")
ELSE BEGIN
IF NOT MealPlanSetup.GET THEN
CLEAR(MealPlanSetup);
IF MealPlanSetup."Meal Planning Module in Use" THEN BEGIN
IF "Recipe Item Type" = "Recipe Item Type"::Recipe THEN BEGIN
IF MealPlanSetup."Item Recipe Nos." <> '' THEN
NoSeriesMgt.InitSeries(MealPlanSetup."Item Recipe
Nos.",xRec."No. Series",0D,"No.","No. Series");
END;
END;

IF "No. Series" = '' THEN BEGIN


IF NOT(RetailSetup.GET) THEN
CLEAR(RetailSetup);
IF NOT Store.GET(RetailSetup."Local Store No.") THEN
CLEAR(Store);
IF Store."Item Nos." <> '' THEN
NoSeriesMgt.InitSeries(Store."Item Nos.",xRec."No.
Series",0D,"No.","No. Series")
ELSE BEGIN
//LS +
GetInvtSetup;
InvtSetup.TESTFIELD("Item Nos.");
NoSeriesMgt.InitSeries(InvtSetup."Item Nos.",xRec."No.
Series",0D,"No.","No. Series");
"Costing Method" := InvtSetup."Default Costing Method";
END;
END; //LS
END; //LS
END; //LS

DimMgt.UpdateDefaultDim(
DATABASE::Item,"No.",
"Global Dimension 1 Code","Global Dimension 2 Code");
UpdateReferencedIds;
SetLastDateTimeModified;
OnInsertItem; //LS

//-MRW
fxItemDefaultValues;
//+MRW
END;

OnModify=BEGIN
//-MRW
fxItemModifyPermission;
//+MRW

UpdateReferencedIds;
SetLastDateTimeModified;
PlanningAssignment.ItemChange(Rec,xRec);

OnModifyItem; //LS
END;

OnDelete=BEGIN
ApprovalsMgmt.OnCancelItemApprovalRequest(Rec);

CheckJournalsAndWorksheets(0);
CheckDocuments(0);

MoveEntries.MoveItemEntries(Rec);

ServiceItem.RESET;
ServiceItem.SETRANGE("Item No.","No.");
IF ServiceItem.FIND('-') THEN
REPEAT
ServiceItem.VALIDATE("Item No.",'');
ServiceItem.MODIFY(TRUE);
UNTIL ServiceItem.NEXT = 0;

DeleteRelatedData;
OnDeleteItem; //LS
END;

OnRename=VAR
SalesLine@1000 : Record 37;
PurchaseLine@1001 : Record 39;
TransferLine@1003 : Record 5741;
ItemAttributeValueMapping@1002 : Record 7505;
UserSetup@1100225000 : Record 91;
BEGIN
//-MRW
IF UserSetup.GET(USERID) THEN;
IF NOT UserSetup."Renombrar productos" THEN
ERROR(Text50003);
//+MRW

SalesLine.RenameNo(SalesLine.Type::Item,xRec."No.","No.");
PurchaseLine.RenameNo(PurchaseLine.Type::Item,xRec."No.","No.");
TransferLine.RenameNo(xRec."No.","No.");
DimMgt.RenameDefaultDim(DATABASE::Item,xRec."No.","No.");
ApprovalsMgmt.OnRenameRecordInApprovalRequest(xRec.RECORDID,RECORDID);

ItemAttributeValueMapping.RenameItemAttributeValueMapping(xRec."No.","No.");
SetLastDateTimeModified;
OnRenameItem; //LS
END;

CaptionML=[ENU=Item;
ESP=Producto];
LookupPageID=Page32;
DrillDownPageID=Page31;
}
FIELDS
{
{ 1 ; ;No. ;Code20 ;OnValidate=BEGIN
IF "No." <>
xRec."No." THEN BEGIN
GetInvtSetup;

NoSeriesMgt.TestManual(InvtSetup."Item Nos.");
"No. Series" :=
'';
IF xRec."No." =
'' THEN
"Costing
Method" := InvtSetup."Default Costing Method";
END;

ValidateItemNo; //LS
END;

AltSearchField=Search
Description;
CaptionML=[ENU=No.;
ESP=N�] }
{ 2 ; ;No. 2 ;Code20 ;CaptionML=[ENU=No. 2;
ESP=N� 2] }
{ 3 ; ;Description ;Text100 ;OnValidate=VAR

ItemVariant@1100225000 : Record 5401;

Miscellanious@1100225001 : Codeunit 50004;


BEGIN

Miscellanious.CheckDimensionsFromSource(DATABASE::Item,"No.",1); //-013

IF ("Search
Description" = UPPERCASE(xRec.Description)) OR ("Search Description" = '') THEN
"Search
Description" := COPYSTR(Description,1,MAXSTRLEN("Search Description"));

IF "Created From
Nonstock Item" THEN BEGIN

NonstockItem.SETCURRENTKEY("Item No.");
NonstockItem.SETRANGE("Item No.","No.");
IF
NonstockItem.FINDFIRST THEN
IF
NonstockItem.Description = '' THEN BEGIN

NonstockItem.Description := Description;

NonstockItem.MODIFY;
END;
END;

//LS-5893-

ItemVariant.SETRANGE("Item No.","No.");
IF
ItemVariant.FINDSET THEN
// AGV-000 ==>

ItemVariant.MODIFYALL(Description,Rec.Description);
// REPEAT
// IF
ItemVariant.Description = xRec.Description THEN BEGIN
//
ItemVariant.Description := Description;
//
ItemVariant.MODIFY(TRUE);
// END;
// UNTIL
ItemVariant.NEXT = 0;
// AGV-000 <==
//LS-5893+

//-MRW
IF Description <>
'' THEN BEGIN
Barcode.RESET;

Barcode.SETRANGE("Item No.","No.");
IF
Barcode.FINDFIRST THEN

Barcode.MODIFYALL(Description, Rec.Description);
// AGV-000 ==>
// REPEAT
//
Barcode.Description := Description;
//
Barcode.MODIFY;
// UNTIL
Barcode.NEXT = 0;
// AGV-000 <==
ItemCross.RESET;

ItemCross.SETRANGE("Item No.","No.");

ItemCross.SETRANGE("Cross-Reference Type",ItemCross."Cross-Reference Type"::"Bar


Code");
IF
ItemCross.FINDFIRST THEN

ItemCross.MODIFYALL(Description, Rec.Description);
// AGV-000 ==>
// REPEAT
//
ItemCross.Description := Description;
//
ItemCross.MODIFY;
// UNTIL
ItemCross.NEXT = 0;
// AGV-000 <==
"Search
Description" := Description;
END;

//+MRW
END;

CaptionML=[ENU=Description;
ESP=Descripci�n] }
{ 4 ; ;Search Description ;Code100 ;CaptionML=[ENU=Search
Description;
ESP=Descripci�n
alias] }
{ 5 ; ;Description 2 ;Text50 ;CaptionML=[ENU=Description 2;
ESP=Descripci�n 2] }
{ 6 ; ;Assembly BOM ;Boolean ;FieldClass=FlowField;
CalcFormula=Exist("BOM
Component" WHERE (Parent Item No.=FIELD(No.)));
CaptionML=[ENU=Assembly BOM;
ESP=L.M. de
ensamblado];
Editable=No }
{ 8 ; ;Base Unit of Measure;Code10 ;TableRelation="Unit of Measure";
OnValidate=VAR

UnitOfMeasure@1000 : Record 204;


BEGIN

UpdateUnitOfMeasureId;

IF "Base Unit of
Measure" <> xRec."Base Unit of Measure" THEN BEGIN

TestNoOpenEntriesExist(FIELDCAPTION("Base Unit of Measure"));

TestSoldNotPosted(FIELDCAPTION("Base Unit of Measure")); //LS

"Sales Unit of
Measure" := "Base Unit of Measure";
////"Purch. Unit
of Measure" := "Base Unit of Measure"; //LS-6900
IF "Base Unit of
Measure" <> '' THEN BEGIN
// If we can't
find a Unit of Measure with a GET,
// then try
with International Standard Code, as some times it's used as Code
IF NOT
UnitOfMeasure.GET("Base Unit of Measure") THEN BEGIN

UnitOfMeasure.SETRANGE("International Standard Code","Base Unit of Measure");


IF NOT
UnitOfMeasure.FINDFIRST THEN

ERROR(UnitOfMeasureNotExistErr,"Base Unit of Measure");


"Base Unit of
Measure" := UnitOfMeasure.Code;
END;

IF NOT
ItemUnitOfMeasure.GET("No.","Base Unit of Measure") THEN BEGIN

ItemUnitOfMeasure.INIT;
//-MRW
//IF
ISTEMPORARY THEN
//
ItemUnitOfMeasure."Item No." := "No."
//ELSE
//
ItemUnitOfMeasure.VALIDATE("Item No.","No.");

ItemUnitOfMeasure."Item No." := "No.";


//+MRW

ItemUnitOfMeasure.VALIDATE(Code,"Base Unit of Measure");

ItemUnitOfMeasure."Qty. per Unit of Measure" := 1;


//
ItemUnitOfMeasure.INSERT; //LS

ItemUnitOfMeasure.INSERT(TRUE); //LS
END ELSE BEGIN
IF
ItemUnitOfMeasure."Qty. per Unit of Measure" <> 1 THEN

ERROR(BaseUnitOfMeasureQtyMustBeOneErr,"Base Unit of
Measure",ItemUnitOfMeasure."Qty. per Unit of Measure");
END;
END;
VALIDATE("Purch.
Unit of Measure","Base Unit of Measure"); //LS-6900
END;
END;

ValidateTableRelation=No;
CaptionML=[ENU=Base Unit of
Measure;
ESP=Unidad medida
base] }
{ 9 ; ;Price Unit Conversion;Integer ;CaptionML=[ENU=Price Unit
Conversion;
ESP=Factor conversi�n
precio] }
{ 10 ; ;Type ;Option ;OnValidate=BEGIN
IF
ExistsItemLedgerEntry THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",ItemLedgEntryTable
CaptionTxt);

CheckJournalsAndWorksheets(FIELDNO(Type));

CheckDocuments(FIELDNO(Type));
IF
IsNonInventoriableType THEN BEGIN

CALCFIELDS("Assembly BOM");

TESTFIELD("Assembly BOM",FALSE);

CALCFIELDS("Stockkeeping Unit Exists");

TESTFIELD("Stockkeeping Unit Exists",FALSE);

VALIDATE("Assembly Policy","Assembly Policy"::"Assemble-to-Stock");

VALIDATE("Replenishment System","Replenishment System"::Purchase);

VALIDATE(Reserve,Reserve::Never);

VALIDATE("Inventory Posting Group",'');


VALIDATE("Item
Tracking Code",'');
VALIDATE("Costing
Method","Costing Method"::FIFO);

VALIDATE("Production BOM No.",'');


VALIDATE("Routing
No.",'');

VALIDATE("Reordering Policy","Reordering Policy"::" ");


VALIDATE("Order
Tracking Policy","Order Tracking Policy"::None);

VALIDATE("Overhead Rate",0);

VALIDATE("Indirect Cost %",0);


END;
END;

CaptionML=[ENU=Type;
ESP=Tipo];

OptionCaptionML=[ENU=Inventory,Service,Non-Inventory;

ESP=Inventario,Servicio,Fuera de inventario];

OptionString=Inventory,Service,Non-Inventory }
{ 11 ; ;Inventory Posting Group;Code20 ;TableRelation="Inventory Posting
Group";
OnValidate=VAR
SalesSetup@1100225002 : Record 311;

AttributeSetup@1100225001 : Record 10000784;

AttributeValues@1100225000 : Record 10000786;


BEGIN
//IF "Inventory
Posting Group" <> '' THEN
IF "Inventory
Posting Group" <> '' THEN BEGIN

TESTFIELD(Type,Type::Inventory);

//MRW mluque
Valido el Cod. grupo producto para condicionar las vistas en base al nuevo Grupo
contable inventario.
VALIDATE("Product
Group Code");
END;

//<073
SalesSetup.GET;
IF "Inventory
Posting Group" <> SalesSetup."G. Invent. Segmentacion" THEN BEGIN
//Borro las
vistas en caso de que el grupo contable inventario no sea el correspondiente para
la segmentaci�n.

AttributeSetup.SETRANGE("Item Link",TRUE);

AttributeSetup.SETRANGE("Customer - Item View",TRUE);


IF NOT
AttributeSetup.FINDSET THEN

ERROR(TextErrorAttribSetup,AttributeSetup."Customer - Item View");

//Delete current
attribute values

AttributeValues.SETCURRENTKEY("Link Type","Attribute Code","Link Field 1");

AttributeValues.SETRANGE("Attribute Code",AttributeSetup.Code);

AttributeValues.SETRANGE("Link Type",AttributeValues."Link Type"::Item);

AttributeValues.SETRANGE("Link Field 1","No.");

AttributeValues.DELETEALL;
END;
//073>
END;

CaptionML=[ENU=Inventory Posting
Group;
ESP=Grupo registro
inventario] }
{ 12 ; ;Shelf No. ;Code10 ;CaptionML=[ENU=Shelf No.;
ESP=N� estante] }
{ 14 ; ;Item Disc. Group ;Code20 ;TableRelation="Item Discount
Group";
CaptionML=[ENU=Item Disc. Group;
ESP=Grupo dto.
producto] }
{ 15 ; ;Allow Invoice Disc. ;Boolean ;InitValue=Yes;
CaptionML=[ENU=Allow Invoice
Disc.;
ESP=Permitir dto.
factura] }
{ 16 ; ;Statistics Group ;Integer ;CaptionML=[ENU=Statistics Group;
ESP=N� grupo
estad�stico] }
{ 17 ; ;Commission Group ;Integer ;CaptionML=[ENU=Commission Group;
ESP=N� grupo
comisi�n] }
{ 18 ; ;Unit Price ;Decimal ;OnValidate=BEGIN
CalcPriceInclVATNow
:= TRUE; //LS

VALIDATE("Price/Profit Calculation");
CalcPriceInclVATNow
:= FALSE; //LS

//-MRW
IF "Unit Price" <>
0 THEN BEGIN
SalesPrice.RESET;

SalesPrice.SETRANGE("Item No.","No.");

SalesPrice.SETRANGE("Sales Type",SalesPrice."Sales Type"::"Customer Price Group");

SalesPrice.SETRANGE("Sales Code",'PVP');
IF
SalesPrice.FINDFIRST THEN BEGIN

SalesPrice."Unit Price" := "Unit Price";

SalesPrice.MODIFY;
END;
END;
//+MRW

//+#457313
ClasifPrecio();
//-#457313
END;

CaptionML=[ENU=Unit Price;
ESP=Precio venta];
MinValue=0;
AutoFormatType=2 }
{ 19 ; ;Price/Profit Calculation;Option ;OnValidate=BEGIN
//LS-5893-
IF "Price Includes
VAT" AND
("Price/Profit
Calculation" < "Price/Profit Calculation"::"No Relationship")
THEN BEGIN

VATPostingSetup.GET("VAT Bus. Posting Gr. (Price)","VAT Prod. Posting Group");


CASE
VATPostingSetup."VAT Calculation Type" OF

VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT":

VATPostingSetup."VAT %" := 0;

VATPostingSetup."VAT Calculation Type"::"Sales Tax":


ERROR(
Text006,

VATPostingSetup.FIELDCAPTION("VAT Calculation Type"),

VATPostingSetup."VAT Calculation Type");


END;
END ELSE

CLEAR(VATPostingSetup);
//LS-5893+

CASE "Price/Profit
Calculation" OF
"Price/Profit
Calculation"::"Profit=Price-Cost":
IF "Unit Price"
<> 0 THEN
IF "Unit
Cost" = 0 THEN
"Profit
%" := 0
ELSE
"Profit
%" :=
ROUND(
100 *
(1 - "Unit Cost" /

("Unit Price" / (1 + CalcVAT))),0.00001)


ELSE
"Profit %" :=
0;
"Price/Profit
Calculation"::"Price=Cost+Profit":
IF "Profit %" <
100 THEN BEGIN
GetGLSetup;
"Unit
Price" :=
ROUND(
("Unit
Cost" / (1 - "Profit %" / 100)) *
(1 +
CalcVAT),

GLSetup."Unit-Amount Rounding Precision");


CalcPriceInclVATNow := TRUE; //LS
END;
END;

//LS -
CalcPriceInclVAT;
UpdateItemPrice;
ItemControl."Update
Cost Price History"(Rec);
CalcPriceInclVATNow
:= FALSE;
//LS +
END;

CaptionML=[ENU=Price/Profit
Calculation;
ESP=C�lculo
precio/bf� bruto];

OptionCaptionML=[ENU="Profit=Price-Cost,Price=Cost+Profit,No Relationship";

ESP="Beneficio=Precio-Coste,Precio=Coste+Beneficio,Sin relaci�n"];
OptionString=Profit=Price-
Cost,Price=Cost+Profit,No Relationship }
{ 20 ; ;Profit % ;Decimal ;OnValidate=BEGIN

VALIDATE("Price/Profit Calculation");
END;

CaptionML=[ENU=Profit %;
ESP=% Bf� bruto];
DecimalPlaces=0:5 }
{ 21 ; ;Costing Method ;Option ;OnValidate=BEGIN
IF "Costing Method"
= xRec."Costing Method" THEN
EXIT;

IF "Costing Method"
<> "Costing Method"::FIFO THEN

TESTFIELD(Type,Type::Inventory);

IF "Costing Method"
= "Costing Method"::Specific THEN BEGIN
TESTFIELD("Item
Tracking Code");

ItemTrackingCode.GET("Item Tracking Code");


IF NOT
ItemTrackingCode."SN Specific Tracking" THEN
ERROR(
Text018,

ItemTrackingCode.FIELDCAPTION("SN Specific Tracking"),

FORMAT(TRUE),ItemTrackingCode.TABLECAPTION,ItemTrackingCode.Code,
FIELDCAPTION("Costing Method"),"Costing Method");
END;

TestNoEntriesExist(FIELDCAPTION("Costing Method"));

ItemCostMgt.UpdateUnitCost(Rec,'','',0,0,FALSE,FALSE,TRUE,FIELDNO("Costing
Method"));
END;

CaptionML=[ENU=Costing Method;
ESP=Valoraci�n
existencias];

OptionCaptionML=[ENU=FIFO,LIFO,Specific,Average,Standard;

ESP=FIFO,LIFO,Especial,Medio,Est�ndar];

OptionString=FIFO,LIFO,Specific,Average,Standard }
{ 22 ; ;Unit Cost ;Decimal ;OnValidate=BEGIN
IF "Costing Method"
= "Costing Method"::Standard THEN

VALIDATE("Standard Cost","Unit Cost")


// ELSE //LS
ELSE BEGIN //LS

TestNoEntriesExist(FIELDCAPTION("Unit Cost"));
//LS -

VALIDATE("Price/Profit Calculation");
END;
//LS +
END;

CaptionML=[ENU=Unit Cost;
ESP=Coste unitario];
MinValue=0;
AutoFormatType=2 }
{ 24 ; ;Standard Cost ;Decimal ;OnValidate=VAR
IsHandled@1000 :
Boolean;
BEGIN
IsHandled := FALSE;

OnBeforeValidateStandardCost(Rec,xRec,CurrFieldNo,IsHandled);
IF IsHandled THEN
EXIT;

IF ("Costing
Method" = "Costing Method"::Standard) AND (CurrFieldNo <> 0) THEN
IF NOT GUIALLOWED
THEN BEGIN
"Standard Cost"
:= xRec."Standard Cost";
EXIT;
END ELSE
IF NOT
CONFIRM(
Text020 +
Text021 +

Text022,FALSE,

FIELDCAPTION("Standard Cost"))
THEN BEGIN
"Standard
Cost" := xRec."Standard Cost";
EXIT;
END;

ItemCostMgt.UpdateUnitCost(Rec,'','',0,0,FALSE,FALSE,TRUE,FIELDNO("Standard
Cost"));
END;

CaptionML=[ENU=Standard Cost;
ESP=Coste est�ndar];
MinValue=0;
AutoFormatType=2 }
{ 25 ; ;Last Direct Cost ;Decimal ;CaptionML=[ENU=Last Direct Cost;
ESP=�ltimo coste
directo];
MinValue=0;
AutoFormatType=2 }
{ 28 ; ;Indirect Cost % ;Decimal ;OnValidate=BEGIN
IF "Indirect Cost
%" > 0 THEN

TESTFIELD(Type,Type::Inventory);

ItemCostMgt.UpdateUnitCost(Rec,'','',0,0,FALSE,FALSE,TRUE,FIELDNO("Indirect Cost
%"));
END;

CaptionML=[ENU=Indirect Cost %;
ESP=% Coste
indirecto];
DecimalPlaces=0:5;
MinValue=0 }
{ 29 ; ;Cost is Adjusted ;Boolean ;InitValue=Yes;
CaptionML=[ENU=Cost is Adjusted;
ESP=Coste ajustado];
Editable=Yes }
{ 30 ; ;Allow Online Adjustment;Boolean ;InitValue=Yes;
CaptionML=[ENU=Allow Online
Adjustment;
ESP=Permitir ajuste
online];
Editable=No }
{ 31 ; ;Vendor No. ;Code20 ;TableRelation=Vendor;
OnValidate=BEGIN
IF (xRec."Vendor
No." <> "Vendor No.") AND
("Vendor No." <>
'')
THEN
IF
Vend.GET("Vendor No.") THEN
"Lead Time
Calculation" := Vend."Lead Time Calculation";
END;

ValidateTableRelation=Yes;
TestTableRelation=Yes;
CaptionML=[ENU=Vendor No.;
ESP=N� proveedor] }
{ 32 ; ;Vendor Item No. ;Text20 ;CaptionML=[ENU=Vendor Item No.;
ESP=C�d. producto
proveedor] }
{ 33 ; ;Lead Time Calculation;DateFormula ;OnValidate=BEGIN

LeadTimeMgt.CheckLeadTimeIsNotNegative("Lead Time Calculation");


END;

AccessByPermission=TableData
120=R;
CaptionML=[ENU=Lead Time
Calculation;
ESP=Plazo entrega
(d�as)] }
{ 34 ; ;Reorder Point ;Decimal ;AccessByPermission=TableData
244=R;
CaptionML=[ENU=Reorder Point;
ESP=Punto pedido];
DecimalPlaces=0:5 }
{ 35 ; ;Maximum Inventory ;Decimal ;AccessByPermission=TableData
244=R;
CaptionML=[ENU=Maximum
Inventory;
ESP=Stock m�ximo];
DecimalPlaces=0:5 }
{ 36 ; ;Reorder Quantity ;Decimal ;AccessByPermission=TableData
244=R;
CaptionML=[ENU=Reorder Quantity;
ESP=Cantidad a
pedir];
DecimalPlaces=0:5 }
{ 37 ; ;Alternative Item No.;Code20 ;TableRelation=Item;
CaptionML=[ENU=Alternative Item
No.;
ESP=N� producto
alternativo] }
{ 38 ; ;Unit List Price ;Decimal ;CaptionML=[ENU=Unit List Price;
ESP=Precio
referencia];
MinValue=0;
AutoFormatType=2 }
{ 39 ; ;Duty Due % ;Decimal ;CaptionML=[ENU=Duty Due %;
ESP=% Tasa aduana];
DecimalPlaces=0:5;
MinValue=0;
MaxValue=100 }
{ 40 ; ;Duty Code ;Code10 ;CaptionML=[ENU=Duty Code;
ESP=C�d. tasa aduana]
}
{ 41 ; ;Gross Weight ;Decimal ;CaptionML=[ENU=Gross Weight;
ESP=Peso bruto];
DecimalPlaces=0:5;
MinValue=0 }
{ 42 ; ;Net Weight ;Decimal ;CaptionML=[ENU=Net Weight;
ESP=Peso neto];
DecimalPlaces=0:5;
MinValue=0 }
{ 43 ; ;Units per Parcel ;Decimal ;CaptionML=[ENU=Units per Parcel;
ESP=Unidades por
lote];
DecimalPlaces=0:5;
MinValue=0 }
{ 44 ; ;Unit Volume ;Decimal ;CaptionML=[ENU=Unit Volume;
ESP=Volumen];
DecimalPlaces=0:5;
MinValue=0 }
{ 45 ; ;Durability ;Code10 ;CaptionML=[ENU=Durability;
ESP=Duraci�n] }
{ 46 ; ;Freight Type ;Code10 ;CaptionML=[ENU=Freight Type;
ESP=Tipo flete] }
{ 47 ; ;Tariff No. ;Code20 ;TableRelation="Tariff Number";
OnValidate=VAR
TariffNumber@1000 :
Record 260;
BEGIN
IF "Tariff No." =
'' THEN
EXIT;

IF (NOT
TariffNumber.WRITEPERMISSION) OR
(NOT
TariffNumber.READPERMISSION)
THEN
EXIT;

IF
TariffNumber.GET("Tariff No.") THEN
EXIT;

TariffNumber.INIT;

TariffNumber."No." := "Tariff No.";

TariffNumber.INSERT;
END;

ValidateTableRelation=No;
CaptionML=[ENU=Tariff No.;
ESP=C�d. arancelario]
}
{ 48 ; ;Duty Unit Conversion;Decimal ;CaptionML=[ENU=Duty Unit
Conversion;
ESP=Unidad conversi�n
aduana];
DecimalPlaces=0:5 }
{ 49 ; ;Country/Region Purchased Code;Code10;
TableRelation=Country/Region;
CaptionML=[ENU=Country/Region
Purchased Code;
ESP=C�d. pa�s/regi�n
originario] }
{ 50 ; ;Budget Quantity ;Decimal ;CaptionML=[ENU=Budget Quantity;
ESP=Cantidad
presupuesto];
DecimalPlaces=0:5 }
{ 51 ; ;Budgeted Amount ;Decimal ;CaptionML=[ENU=Budgeted Amount;
ESP=Importe pptdo.];
AutoFormatType=1 }
{ 52 ; ;Budget Profit ;Decimal ;CaptionML=[ENU=Budget Profit;
ESP=Bf� bruto
presupuesto];
AutoFormatType=1 }
{ 53 ; ;Comment ;Boolean ;FieldClass=FlowField;
CalcFormula=Exist("Comment Line"
WHERE (Table Name=CONST(Item),

No.=FIELD(No.)));
CaptionML=[ENU=Comment;
ESP=Comentario];
Editable=No }
{ 54 ; ;Blocked ;Boolean ;OnValidate=VAR

UserSetup@1100225000 : Record 91;


BEGIN
IF NOT Blocked THEN
"Block Reason" :=
'';

//-MRW
IF
UserSetup.GET(USERID) THEN;
IF NOT
UserSetup."Modificar Bloqueado producto" THEN
ERROR(Text50004);
//+MRW
END;

CaptionML=[ENU=Blocked;
ESP=Bloqueado] }
{ 55 ; ;Cost is Posted to G/L;Boolean ;FieldClass=FlowField;
CalcFormula=-Exist("Post Value
Entry to G/L" WHERE (Item No.=FIELD(No.)));
CaptionML=[ENU=Cost is Posted to
G/L;
ESP=Coste registrado
en C/G];
Editable=No }
{ 56 ; ;Block Reason ;Text250 ;OnValidate=BEGIN

TESTFIELD(Blocked,TRUE);
END;

CaptionML=[ENU=Block Reason;
ESP=Raz�n del
bloqueo] }
{ 61 ; ;Last DateTime Modified;DateTime ;CaptionML=[ENU=Last DateTime
Modified;
ESP=DateTime de
�ltima modificaci�n];
Editable=No }
{ 62 ; ;Last Date Modified ;Date ;CaptionML=[ENU=Last Date
Modified;
ESP=Fecha �lt.
modificaci�n];
Editable=No }
{ 63 ; ;Last Time Modified ;Time ;CaptionML=[ENU=Last Time
Modified;
ESP=�lt. hora
modificaci�n];
Editable=No }
{ 64 ; ;Date Filter ;Date ;FieldClass=FlowFilter;
CaptionML=[ENU=Date Filter;
ESP=Filtro fecha] }
{ 65 ; ;Global Dimension 1 Filter;Code20 ;FieldClass=FlowFilter;
TableRelation="Dimension
Value".Code WHERE (Global Dimension No.=CONST(1));
CaptionML=[ENU=Global Dimension
1 Filter;
ESP=Filtro dimensi�n
global 1];
CaptionClass='1,3,1' }
{ 66 ; ;Global Dimension 2 Filter;Code20 ;FieldClass=FlowFilter;
TableRelation="Dimension
Value".Code WHERE (Global Dimension No.=CONST(2));
CaptionML=[ENU=Global Dimension
2 Filter;
ESP=Filtro dimensi�n
global 2];
CaptionClass='1,3,2' }
{ 67 ; ;Location Filter ;Code10 ;FieldClass=FlowFilter;
TableRelation=Location;
CaptionML=[ENU=Location Filter;
ESP=Filtro almac�n] }
{ 68 ; ;Inventory ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Item Ledger
Entry".Quantity WHERE (Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Lot No.=FIELD(Lot No. Filter),

Serial No.=FIELD(Serial No. Filter)));


CaptionML=[ENU=Inventory;
ESP=Inventario];
DecimalPlaces=0:5;
Editable=No }
{ 69 ; ;Net Invoiced Qty. ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Item Ledger
Entry"."Invoiced Quantity" WHERE (Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Lot No.=FIELD(Lot No. Filter),

Serial No.=FIELD(Serial No. Filter)));


CaptionML=[ENU=Net Invoiced
Qty.;
ESP=Unidades
facturadas];
DecimalPlaces=0:5;
Editable=No }
{ 70 ; ;Net Change ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Item Ledger
Entry".Quantity WHERE (Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Posting Date=FIELD(Date Filter),

Variant Code=FIELD(Variant Filter),

Lot No.=FIELD(Lot No. Filter),

Serial No.=FIELD(Serial No. Filter)));


CaptionML=[ENU=Net Change;
ESP=Saldo periodo];
DecimalPlaces=0:5;
Editable=No }
{ 71 ; ;Purchases (Qty.) ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Item Ledger
Entry"."Invoiced Quantity" WHERE (Entry Type=CONST(Purchase),

Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),


Variant Code=FIELD(Variant Filter),

Posting Date=FIELD(Date Filter),

Lot No.=FIELD(Lot No. Filter),

Serial No.=FIELD(Serial No. Filter)));


CaptionML=[ENU=Purchases (Qty.);
ESP=Compras (cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 72 ; ;Sales (Qty.) ;Decimal ;FieldClass=FlowField;
CalcFormula=-Sum("Value
Entry"."Invoiced Quantity" WHERE (Item Ledger Entry Type=CONST(Sale),

Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Posting Date=FIELD(Date Filter)));


CaptionML=[ENU=Sales (Qty.);
ESP=Ventas (cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 73 ; ;Positive Adjmt. (Qty.);Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Item Ledger
Entry"."Invoiced Quantity" WHERE (Entry Type=CONST(Positive Adjmt.),

Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Posting Date=FIELD(Date Filter),

Lot No.=FIELD(Lot No. Filter),

Serial No.=FIELD(Serial No. Filter)));


CaptionML=[ENU=Positive Adjmt.
(Qty.);
ESP=Ajuste positivo
(cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 74 ; ;Negative Adjmt. (Qty.);Decimal ;FieldClass=FlowField;
CalcFormula=-Sum("Item Ledger
Entry"."Invoiced Quantity" WHERE (Entry Type=CONST(Negative Adjmt.),

Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Posting Date=FIELD(Date Filter),

Lot No.=FIELD(Lot No. Filter),

Serial No.=FIELD(Serial No. Filter)));


CaptionML=[ENU=Negative Adjmt.
(Qty.);
ESP=Ajuste negativo
(cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 77 ; ;Purchases (LCY) ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Value
Entry"."Purchase Amount (Actual)" WHERE (Item Ledger Entry Type=CONST(Purchase),

Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Posting Date=FIELD(Date Filter)));


CaptionML=[ENU=Purchases (LCY);
ESP=Compras (DL)];
Editable=No;
AutoFormatType=1 }
{ 78 ; ;Sales (LCY) ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Value
Entry"."Sales Amount (Actual)" WHERE (Item Ledger Entry Type=CONST(Sale),

Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),


Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Posting Date=FIELD(Date Filter)));


CaptionML=[ENU=Sales (LCY);
ESP=Ventas (DL)];
Editable=No;
AutoFormatType=1 }
{ 79 ; ;Positive Adjmt. (LCY);Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Value
Entry"."Cost Amount (Actual)" WHERE (Item Ledger Entry Type=CONST(Positive Adjmt.),

Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Posting Date=FIELD(Date Filter)));


CaptionML=[ENU=Positive Adjmt.
(LCY);
ESP=Ajuste positivo
(DL)];
Editable=No;
AutoFormatType=1 }
{ 80 ; ;Negative Adjmt. (LCY);Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Value
Entry"."Cost Amount (Actual)" WHERE (Item Ledger Entry Type=CONST(Negative Adjmt.),

Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Posting Date=FIELD(Date Filter)));


CaptionML=[ENU=Negative Adjmt.
(LCY);
ESP=Ajuste negativo
(DL)];
Editable=No;
AutoFormatType=1 }
{ 83 ; ;COGS (LCY) ;Decimal ;FieldClass=FlowField;
CalcFormula=-Sum("Value
Entry"."Cost Amount (Actual)" WHERE (Item Ledger Entry Type=CONST(Sale),
Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Posting Date=FIELD(Date Filter)));


CaptionML=[ENU=COGS (LCY);
ESP=Coste ventas
(DL)];
Editable=No;
AutoFormatType=1 }
{ 84 ; ;Qty. on Purch. Order;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Purchase
Line"."Outstanding Qty. (Base)" WHERE (Document Type=CONST(Order),

Type=CONST(Item),

No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Expected Receipt Date=FIELD(Date Filter)));


AccessByPermission=TableData
120=R;
CaptionML=[ENU=Qty. on Purch.
Order;
ESP=Cant. en pedidos
compra];
DecimalPlaces=0:5;
Editable=No }
{ 85 ; ;Qty. on Sales Order ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Sales
Line"."Outstanding Qty. (Base)" WHERE (Document Type=CONST(Order),

Type=CONST(Item),

No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),


Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter)));


AccessByPermission=TableData
110=R;
CaptionML=[ENU=Qty. on Sales
Order;
ESP=Cant. en pedidos
venta];
DecimalPlaces=0:5;
Editable=No }
{ 87 ; ;Price Includes VAT ;Boolean ;OnValidate=VAR

VATPostingSetup@1000 : Record 325;


SalesSetup@1001 :
Record 311;
BEGIN
IF "Price Includes
VAT" THEN BEGIN
SalesSetup.GET;
IF
SalesSetup."VAT Bus. Posting Gr. (Price)" <> '' THEN
"VAT Bus.
Posting Gr. (Price)" := SalesSetup."VAT Bus. Posting Gr. (Price)";

VATPostingSetup.GET("VAT Bus. Posting Gr. (Price)","VAT Prod. Posting Group");


END;

VALIDATE("Price/Profit Calculation");

//+#457313
ClasifPrecio();
//-#457313
END;

CaptionML=[ENU=Price Includes
VAT;
ESP=Precio IVA
incluido] }
{ 89 ; ;Drop Shipment Filter;Boolean ;FieldClass=FlowFilter;
AccessByPermission=TableData
223=R;
CaptionML=[ENU=Drop Shipment
Filter;
ESP=Filtro env�o
directo] }
{ 90 ; ;VAT Bus. Posting Gr. (Price);Code20;TableRelation="VAT Business
Posting Group";
OnValidate=BEGIN

VALIDATE("Price/Profit Calculation");
END;

CaptionML=[ENU=VAT Bus. Posting


Gr. (Price);
ESP=Gr.regis. IVA
negocio (precio)] }
{ 91 ; ;Gen. Prod. Posting Group;Code20 ;TableRelation="Gen. Product
Posting Group";
OnValidate=BEGIN
IF xRec."Gen. Prod.
Posting Group" <> "Gen. Prod. Posting Group" THEN BEGIN
IF CurrFieldNo <>
0 THEN
IF
ProdOrderExist THEN
IF NOT
CONFIRM(
Text024
+

Text022,FALSE,

FIELDCAPTION("Gen. Prod. Posting Group"))


THEN BEGIN
"Gen. Prod.
Posting Group" := xRec."Gen. Prod. Posting Group";
EXIT;
END;

IF
GenProdPostingGrp.ValidateVatProdPostingGroup(GenProdPostingGrp,"Gen. Prod. Posting
Group") THEN
VALIDATE("VAT
Prod. Posting Group",GenProdPostingGrp."Def. VAT Prod. Posting Group");
END;

VALIDATE("Price/Profit Calculation");
END;

CaptionML=[ENU=Gen. Prod.
Posting Group;
ESP=Grupo registro
prod. gen.] }
{ 92 ; ;Picture ;MediaSet ;CaptionML=[ENU=Picture;
ESP=Imagen] }
{ 93 ; ;Transferred (Qty.) ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Item Ledger
Entry"."Invoiced Quantity" WHERE (Entry Type=CONST(Transfer),

Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Posting Date=FIELD(Date Filter),


Lot No.=FIELD(Lot No. Filter),

Serial No.=FIELD(Serial No. Filter)));


CaptionML=[ENU=Transferred
(Qty.);
ESP=Transferencias
(cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 94 ; ;Transferred (LCY) ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Value
Entry"."Sales Amount (Actual)" WHERE (Item Ledger Entry Type=CONST(Transfer),

Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Posting Date=FIELD(Date Filter)));


CaptionML=[ENU=Transferred
(LCY);
ESP=Transferencias
(DL)];
Editable=No;
AutoFormatType=1 }
{ 95 ; ;Country/Region of Origin Code;Code10;
TableRelation=Country/Region;
CaptionML=[ENU=Country/Region of
Origin Code;
ESP=C�d. pa�s/regi�n
de origen] }
{ 96 ; ;Automatic Ext. Texts;Boolean ;CaptionML=[ENU=Automatic Ext.
Texts;
ESP=Texto adicional
autom�tico] }
{ 97 ; ;No. Series ;Code20 ;TableRelation="No. Series";
CaptionML=[ENU=No. Series;
ESP=Nos. serie];
Editable=No }
{ 98 ; ;Tax Group Code ;Code20 ;TableRelation="Tax Group";
OnValidate=BEGIN
UpdateTaxGroupId;
END;

CaptionML=[ENU=Tax Group Code;


ESP=C�d. grupo
impuesto] }
{ 99 ; ;VAT Prod. Posting Group;Code20 ;TableRelation="VAT Product
Posting Group";
OnValidate=BEGIN

VALIDATE("Price/Profit Calculation");
END;

CaptionML=[ENU=VAT Prod. Posting


Group;
ESP=Grupo registro
IVA prod.] }
{ 100 ; ;Reserve ;Option ;InitValue=Optional;
OnValidate=BEGIN
IF Reserve <>
Reserve::Never THEN

TESTFIELD(Type,Type::Inventory);
END;

AccessByPermission=TableData
120=R;
CaptionML=[ENU=Reserve;
ESP=Reserva];

OptionCaptionML=[ENU=Never,Optional,Always;

ESP=Nunca,Opcional,Siempre];

OptionString=Never,Optional,Always }
{ 101 ; ;Reserved Qty. on Inventory;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(32),

Source Subtype=CONST(0),

Reservation Status=CONST(Reservation),

Serial No.=FIELD(Serial No. Filter),

Lot No.=FIELD(Lot No. Filter),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter)));


AccessByPermission=TableData
120=R;
CaptionML=[ENU=Reserved Qty. on
Inventory;
ESP=Cant. reservada
en stock];
DecimalPlaces=0:5;
Editable=No }
{ 102 ; ;Reserved Qty. on Purch. Orders;Decimal;
FieldClass=FlowField;
CalcFormula=Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(39),

Source Subtype=CONST(1),

Reservation Status=CONST(Reservation),
Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Expected Receipt Date=FIELD(Date Filter)));


AccessByPermission=TableData
120=R;
CaptionML=[ENU=Reserved Qty. on
Purch. Orders;
ESP=Cant. reserv.
pedidos compra];
DecimalPlaces=0:5;
Editable=No }
{ 103 ; ;Reserved Qty. on Sales Orders;Decimal;
FieldClass=FlowField;
CalcFormula=-Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(37),

Source Subtype=CONST(1),

Reservation Status=CONST(Reservation),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter)));


AccessByPermission=TableData
110=R;
CaptionML=[ENU=Reserved Qty. on
Sales Orders;
ESP=Cant. reserv.
pedidos venta];
DecimalPlaces=0:5;
Editable=No }
{ 105 ; ;Global Dimension 1 Code;Code20 ;TableRelation="Dimension
Value".Code WHERE (Global Dimension No.=CONST(1));
OnValidate=BEGIN

ValidateShortcutDimCode(1,"Global Dimension 1 Code");


END;

CaptionML=[ENU=Global Dimension
1 Code;
ESP=C�d. dimensi�n
global 1];
CaptionClass='1,1,1' }
{ 106 ; ;Global Dimension 2 Code;Code20 ;TableRelation="Dimension
Value".Code WHERE (Global Dimension No.=CONST(2));
OnValidate=BEGIN

ValidateShortcutDimCode(2,"Global Dimension 2 Code");


END;

CaptionML=[ENU=Global Dimension
2 Code;
ESP=C�d. dimensi�n
global 2];
CaptionClass='1,1,2' }
{ 107 ; ;Res. Qty. on Outbound Transfer;Decimal;
FieldClass=FlowField;
CalcFormula=-Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(5741),

Source Subtype=CONST(0),

Reservation Status=CONST(Reservation),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter)));


AccessByPermission=TableData
5740=R;
CaptionML=[ENU=Res. Qty. on
Outbound Transfer;
ESP=Cant. res. en
transfer. salida];
DecimalPlaces=0:5;
Editable=No }
{ 108 ; ;Res. Qty. on Inbound Transfer;Decimal;
FieldClass=FlowField;
CalcFormula=Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(5741),

Source Subtype=CONST(1),

Reservation Status=CONST(Reservation),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Expected Receipt Date=FIELD(Date Filter)));


AccessByPermission=TableData
5740=R;
CaptionML=[ENU=Res. Qty. on
Inbound Transfer;
ESP=Cant. res. en
transfer. entrada];
DecimalPlaces=0:5;
Editable=No }
{ 109 ; ;Res. Qty. on Sales Returns;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(37),

Source Subtype=CONST(5),
Reservation Status=CONST(Reservation),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter)));


AccessByPermission=TableData
6660=R;
CaptionML=[ENU=Res. Qty. on
Sales Returns;
ESP=Cantidad
reservada en devoluciones de ventas];
DecimalPlaces=0:5;
Editable=No }
{ 110 ; ;Res. Qty. on Purch. Returns;Decimal;FieldClass=FlowField;
CalcFormula=-Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(39),

Source Subtype=CONST(5),

Reservation Status=CONST(Reservation),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Expected Receipt Date=FIELD(Date Filter)));


AccessByPermission=TableData
6650=R;
CaptionML=[ENU=Res. Qty. on
Purch. Returns;
ESP=Cantidad
reservada en devoluciones de compras];
DecimalPlaces=0:5;
Editable=No }
{ 120 ; ;Stockout Warning ;Option ;CaptionML=[ENU=Stockout Warning;
ESP=Advertencia falta
stock];

OptionCaptionML=[ENU=Default,No,Yes;

ESP=Predeterminado,No,S�];
OptionString=Default,No,Yes }
{ 121 ; ;Prevent Negative Inventory;Option ;CaptionML=[ENU=Prevent Negative
Inventory;
ESP=Evitar inventario
negativo];

OptionCaptionML=[ENU=Default,No,Yes;

ESP=Predeterminado,No,S�];
OptionString=Default,No,Yes }
{ 200 ; ;Cost of Open Production Orders;Decimal;
FieldClass=FlowField;
CalcFormula=Sum("Prod. Order
Line"."Cost Amount" WHERE (Status=FILTER(Planned|Firm Planned|Released),
Item No.=FIELD(No.)));
CaptionML=[ENU=Cost of Open
Production Orders;
ESP=Coste de las
�rdenes de producci�n abiertas] }
{ 521 ; ;Application Wksh. User
ID;Code128 ;DataClassification=EndUserIdentifiableInformation;
CaptionML=[ENU=Application Wksh.
User ID;
ESP=Id. usuario hoja
horas de aplicaci�n] }
{ 910 ; ;Assembly Policy ;Option ;OnValidate=BEGIN
IF "Assembly
Policy" = "Assembly Policy"::"Assemble-to-Order" THEN

TESTFIELD("Replenishment System","Replenishment System"::Assembly);


IF
IsNonInventoriableType THEN

TESTFIELD("Assembly Policy","Assembly Policy"::"Assemble-to-Stock");


END;

AccessByPermission=TableData
90=R;
CaptionML=[ENU=Assembly Policy;
ESP=Directiva de
ensamblado];
OptionCaptionML=[ENU=Assemble-
to-Stock,Assemble-to-Order;
ESP=Ensamblar
para stock,Ensamblar para pedido];
OptionString=Assemble-to-
Stock,Assemble-to-Order }
{ 929 ; ;Res. Qty. on Assembly Order;Decimal;FieldClass=FlowField;
CalcFormula=Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(900),

Source Subtype=CONST(1),

Reservation Status=CONST(Reservation),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Expected Receipt Date=FIELD(Date Filter)));


AccessByPermission=TableData
90=R;
CaptionML=[ENU=Res. Qty. on
Assembly Order;
ESP=Ctd. recursos en
pedido de ensamblado];
DecimalPlaces=0:5;
Editable=No }
{ 930 ; ;Res. Qty. on Asm. Comp.;Decimal ;FieldClass=FlowField;
CalcFormula=-Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(901),

Source Subtype=CONST(1),

Reservation Status=CONST(Reservation),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter)));


AccessByPermission=TableData
90=R;
CaptionML=[ENU=Res. Qty. on
Asm. Comp.;
ESP=Cant. recursos en
comp. de ensamblado];
DecimalPlaces=0:5;
Editable=No }
{ 977 ; ;Qty. on Assembly Order;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Assembly
Header"."Remaining Quantity (Base)" WHERE (Document Type=CONST(Order),

Item No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Due Date=FIELD(Date Filter)));


CaptionML=[ENU=Qty. on Assembly
Order;
ESP=Cant. en pedido
de ensamblado];
DecimalPlaces=0:5;
Editable=No }
{ 978 ; ;Qty. on Asm. Component;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Assembly
Line"."Remaining Quantity (Base)" WHERE (Document Type=CONST(Order),

Type=CONST(Item),

No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Due Date=FIELD(Date Filter)));


CaptionML=[ENU=Qty. on Asm.
Component;
ESP=Cant.
componentes];
DecimalPlaces=0:5;
Editable=No }
{ 1001; ;Qty. on Job Order ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Job Planning
Line"."Remaining Qty. (Base)" WHERE (Status=CONST(Order),

Type=CONST(Item),

No.=FIELD(No.),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Planning Date=FIELD(Date Filter)));


CaptionML=[ENU=Qty. on Job
Order;
ESP=Cant. en pedido
de proyecto];
DecimalPlaces=0:5;
Editable=No }
{ 1002; ;Res. Qty. on Job Order;Decimal ;FieldClass=FlowField;
CalcFormula=-Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(1003),

Source Subtype=CONST(2),

Reservation Status=CONST(Reservation),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter)));


AccessByPermission=TableData
167=R;
CaptionML=[ENU=Res. Qty. on Job
Order;
ESP=Cant. rec. pedida
en proyectos];
DecimalPlaces=0:5;
Editable=No }
{ 1217; ;GTIN ;Code14 ;CaptionML=[ENU=GTIN;
ESP=GTIN];
Numeric=Yes }
{ 1700; ;Default Deferral Template Code;Code10;
TableRelation="Deferral
Template"."Deferral Code";
CaptionML=[ENU=Default Deferral
Template Code;
ESP=C�digo de
plantilla de fraccionamiento predeterminada] }
{ 5400; ;Low-Level Code ;Integer ;CaptionML=[ENU=Low-Level Code;
ESP=C�d. nivel m�s
bajo];
Editable=No }
{ 5401; ;Lot Size ;Decimal ;AccessByPermission=TableData
5405=R;
CaptionML=[ENU=Lot Size;
ESP=Tama�o lote];
DecimalPlaces=0:5;
MinValue=0 }
{ 5402; ;Serial Nos. ;Code20 ;TableRelation="No. Series";
OnValidate=BEGIN
IF "Serial Nos." <>
'' THEN
TESTFIELD("Item
Tracking Code");
END;

CaptionML=[ENU=Serial Nos.;
ESP=N� serializaci�n]
}
{ 5403; ;Last Unit Cost Calc. Date;Date ;CaptionML=[ENU=Last Unit Cost
Calc. Date;
ESP=�lt. fecha calc.
coste unitario];
Editable=No }
{ 5404; ;Rolled-up Material Cost;Decimal ;CaptionML=[ENU=Rolled-up
Material Cost;
ESP=Coste material
distribuido];
DecimalPlaces=2:5;
Editable=No;
AutoFormatType=2 }
{ 5405; ;Rolled-up Capacity Cost;Decimal ;CaptionML=[ENU=Rolled-up
Capacity Cost;
ESP=Coste capacidad
distribuida];
DecimalPlaces=2:5;
Editable=No;
AutoFormatType=2 }
{ 5407; ;Scrap % ;Decimal ;AccessByPermission=TableData
5405=R;
CaptionML=[ENU=Scrap %;
ESP=% Rechazo];
DecimalPlaces=0:2;
MinValue=0;
MaxValue=100 }
{ 5409; ;Inventory Value Zero;Boolean ;OnValidate=BEGIN

CheckForProductionOutput("No.");
END;

CaptionML=[ENU=Inventory Value
Zero;
ESP=Inventario valor
cero] }
{ 5410; ;Discrete Order Quantity;Integer ;CaptionML=[ENU=Discrete Order
Quantity;
ESP=Cantidad pedido
discreta];
MinValue=0 }
{ 5411; ;Minimum Order Quantity;Decimal ;AccessByPermission=TableData
244=R;
CaptionML=[ENU=Minimum Order
Quantity;
ESP=Cantidad m�nima
pedido];
DecimalPlaces=0:5;
MinValue=0 }
{ 5412; ;Maximum Order Quantity;Decimal ;AccessByPermission=TableData
244=R;
CaptionML=[ENU=Maximum Order
Quantity;
ESP=Cantidad m�xima
pedido];
DecimalPlaces=0:5;
MinValue=0 }
{ 5413; ;Safety Stock Quantity;Decimal ;AccessByPermission=TableData
244=R;
CaptionML=[ENU=Safety Stock
Quantity;
ESP=Stock de
seguridad];
DecimalPlaces=0:5;
MinValue=0 }
{ 5414; ;Order Multiple ;Decimal ;AccessByPermission=TableData
244=R;
CaptionML=[ENU=Order Multiple;
ESP=M�ltiplos de
pedido];
DecimalPlaces=0:5;
MinValue=0 }
{ 5415; ;Safety Lead Time ;DateFormula ;AccessByPermission=TableData
244=R;
CaptionML=[ENU=Safety Lead Time;
ESP=Plazo de
seguridad] }
{ 5417; ;Flushing Method ;Option ;AccessByPermission=TableData
5405=R;
CaptionML=[ENU=Flushing Method;
ESP=M�todo de baja];

OptionCaptionML=[ENU=Manual,Forward,Backward,Pick + Forward,Pick + Backward;

ESP=Manual,Adelante,Atr�s,Pick + Adelante,Pick + Atr�s];

OptionString=Manual,Forward,Backward,Pick + Forward,Pick + Backward }


{ 5419; ;Replenishment System;Option ;OnValidate=BEGIN
IF "Replenishment
System" <> "Replenishment System"::Assembly THEN

TESTFIELD("Assembly Policy","Assembly Policy"::"Assemble-to-Stock");


IF "Replenishment
System" <> "Replenishment System"::Purchase THEN

TESTFIELD(Type,Type::Inventory);
END;

AccessByPermission=TableData
244=R;
CaptionML=[ENU=Replenishment
System;
ESP=Sistema
reposici�n];

OptionCaptionML=[ENU=Purchase,Prod. Order,,Assembly;

ESP=Compra,Prod. Pedido,,Ensamblado];
OptionString=Purchase,Prod.
Order,,Assembly }
{ 5420; ;Scheduled Receipt (Qty.);Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Prod. Order
Line"."Remaining Qty. (Base)" WHERE (Status=FILTER(Firm Planned|Released),

Item No.=FIELD(No.),

Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Due Date=FIELD(Date Filter)));


CaptionML=[ENU=Scheduled Receipt
(Qty.);
ESP=Recepci�n
programada (cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 5421; ;Scheduled Need (Qty.);Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Prod. Order
Component"."Remaining Qty. (Base)" WHERE (Status=FILTER(Planned..Released),

Item No.=FIELD(No.),

Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Due Date=FIELD(Date Filter)));


CaptionML=[ENU=Scheduled Need
(Qty.);
ESP=Necesidad
programada (cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 5422; ;Rounding Precision ;Decimal ;InitValue=1;
OnValidate=BEGIN
IF "Rounding
Precision" <= 0 THEN

FIELDERROR("Rounding Precision",Text027);
END;

AccessByPermission=TableData
5405=R;
CaptionML=[ENU=Rounding
Precision;
ESP=Precisi�n
redondeo];
DecimalPlaces=0:5 }
{ 5423; ;Bin Filter ;Code20 ;FieldClass=FlowFilter;
TableRelation=Bin.Code WHERE
(Location Code=FIELD(Location Filter));
CaptionML=[ENU=Bin Filter;
ESP=Filtro ubicaci�n]
}
{ 5424; ;Variant Filter ;Code10 ;FieldClass=FlowFilter;
TableRelation="Item
Variant".Code WHERE (Item No.=FIELD(No.));
CaptionML=[ENU=Variant Filter;
ESP=Filtro
variante] }
{ 5425; ;Sales Unit of Measure;Code10 ;TableRelation=IF
(No.=FILTER(<>'')) "Item Unit of Measure".Code WHERE (Item No.=FIELD(No.))
ELSE "Unit of
Measure";
CaptionML=[ENU=Sales Unit of
Measure;
ESP=Unidad medida
venta] }
{ 5426; ;Purch. Unit of Measure;Code10 ;TableRelation=IF
(No.=FILTER(<>'')) "Item Unit of Measure".Code WHERE (Item No.=FIELD(No.))
ELSE "Unit of
Measure";
OnValidate=VAR

ItemUnitofMeasure@1100225003 : Record 5404;

ReplenCreatePurchOrder@1100225002 : Codeunit 10012204;

BOUtils@1100225001 : Codeunit 99001452;


Quantity@1100225000
: Decimal;
BEGIN
IF
BOUtils.IsReplenishmentPermitted THEN BEGIN //LS-8045
//LS-6900-
IF
ItemUnitofMeasure.GET("No.","Purch. Unit of Measure") THEN
Quantity :=
ItemUnitofMeasure."Qty. per Unit of Measure"
ELSE
Quantity := 0;

ReplenCreatePurchOrder.UpdateOrderMultiple(Rec,"Purch. Unit of Measure",Quantity);


//LS-6900+
END;
END;

CaptionML=[ENU=Purch. Unit of
Measure;
ESP=Unidad medida
compra] }
{ 5428; ;Time Bucket ;DateFormula ;OnValidate=BEGIN

CalendarMgt.CheckDateFormulaPositive("Time Bucket");
END;

AccessByPermission=TableData
244=R;
CaptionML=[ENU=Time Bucket;
ESP=Ciclo] }
{ 5429; ;Reserved Qty. on Prod. Order;Decimal;
FieldClass=FlowField;
CalcFormula=Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(5406),

Source Subtype=FILTER(1..3),

Reservation Status=CONST(Reservation),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Expected Receipt Date=FIELD(Date Filter)));


AccessByPermission=TableData
5405=R;
CaptionML=[ENU=Reserved Qty. on
Prod. Order;
ESP=Cant. reserv. en
ord. producc.];
DecimalPlaces=0:5;
Editable=No }
{ 5430; ;Res. Qty. on Prod. Order Comp.;Decimal;
FieldClass=FlowField;
CalcFormula=-Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(5407),

Source Subtype=FILTER(1..3),

Reservation Status=CONST(Reservation),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter)));


AccessByPermission=TableData
5405=R;
CaptionML=[ENU=Res. Qty. on
Prod. Order Comp.;
ESP=Cant. res. en
comp. producc.];
DecimalPlaces=0:5;
Editable=No }
{ 5431; ;Res. Qty. on Req. Line;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(246),

Source Subtype=FILTER(0),

Reservation Status=CONST(Reservation),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Expected Receipt Date=FIELD(Date Filter)));


AccessByPermission=TableData
244=R;
CaptionML=[ENU=Res. Qty. on Req.
Line;
ESP=Cant. res. en
l�n. demanda];
DecimalPlaces=0:5;
Editable=No }
{ 5440; ;Reordering Policy ;Option ;OnValidate=BEGIN
"Include Inventory"
:=
"Reordering
Policy" IN ["Reordering Policy"::"Lot-for-Lot",

"Reordering Policy"::"Maximum Qty.",

"Reordering Policy"::"Fixed Reorder Qty."];

IF "Reordering
Policy" <> "Reordering Policy"::" " THEN

TESTFIELD(Type,Type::Inventory);
END;

AccessByPermission=TableData
244=R;
CaptionML=[ENU=Reordering
Policy;
ESP=Directiva
reaprov.];
OptionCaptionML=[ENU=" ,Fixed
Reorder Qty.,Maximum Qty.,Order,Lot-for-Lot";
ESP=" ,Cant.
fija reaprov.,Cant. m�xima,Pedido,Lote a lote"];
OptionString=[ ,Fixed Reorder
Qty.,Maximum Qty.,Order,Lot-for-Lot] }
{ 5441; ;Include Inventory ;Boolean ;AccessByPermission=TableData
244=R;
CaptionML=[ENU=Include
Inventory;
ESP=Incluir
inventario] }
{ 5442; ;Manufacturing Policy;Option ;AccessByPermission=TableData
244=R;
CaptionML=[ENU=Manufacturing
Policy;
ESP=Directiva
fabricaci�n];
OptionCaptionML=[ENU=Make-to-
Stock,Make-to-Order;
ESP=Fab-contra-
stock,Fab-contra-pedido];
OptionString=Make-to-Stock,Make-
to-Order }
{ 5443; ;Rescheduling Period ;DateFormula ;OnValidate=BEGIN

CalendarMgt.CheckDateFormulaPositive("Rescheduling Period");
END;

AccessByPermission=TableData
244=R;
CaptionML=[ENU=Rescheduling
Period;
ESP=Periodo de
reprogramaci�n] }
{ 5444; ;Lot Accumulation Period;DateFormula;OnValidate=BEGIN

CalendarMgt.CheckDateFormulaPositive("Lot Accumulation Period");


END;

AccessByPermission=TableData
244=R;
CaptionML=[ENU=Lot Accumulation
Period;
ESP=Periodo de
acumulaci�n de lotes] }
{ 5445; ;Dampener Period ;DateFormula ;OnValidate=BEGIN

CalendarMgt.CheckDateFormulaPositive("Dampener Period");
END;

AccessByPermission=TableData
244=R;
CaptionML=[ENU=Dampener Period;
ESP=Periodo
amortiguador] }
{ 5446; ;Dampener Quantity ;Decimal ;AccessByPermission=TableData
244=R;
CaptionML=[ENU=Dampener
Quantity;
ESP=Cantidad
amortiguador];
DecimalPlaces=0:5;
MinValue=0 }
{ 5447; ;Overflow Level ;Decimal ;AccessByPermission=TableData
244=R;
CaptionML=[ENU=Overflow Level;
ESP=Nivel
desbordamiento];
DecimalPlaces=0:5;
MinValue=0 }
{ 5449; ;Planning Transfer Ship. (Qty).;Decimal;
FieldClass=FlowField;
CalcFormula=Sum("Requisition
Line"."Quantity (Base)" WHERE (Replenishment System=CONST(Transfer),

Type=CONST(Item),

No.=FIELD(No.),

Variant Code=FIELD(Variant Filter),

Transfer-from Code=FIELD(Location Filter),

Transfer Shipment Date=FIELD(Date Filter)));


CaptionML=[ENU=Planning Transfer
Ship. (Qty).;
ESP=Env�o de
transferencia de planificaci�n (ctd.)];
Editable=No }
{ 5450; ;Planning Worksheet (Qty.);Decimal;FieldClass=FlowField;
CalcFormula=Sum("Requisition
Line"."Quantity (Base)" WHERE (Planning Line Origin=CONST(Planning),

Type=CONST(Item),

No.=FIELD(No.),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Due Date=FIELD(Date Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter)));


CaptionML=[ENU=Planning
Worksheet (Qty.);
ESP=Hoja
planificaci�n (ctd.)];
Editable=No }
{ 5700; ;Stockkeeping Unit Exists;Boolean ;FieldClass=FlowField;
CalcFormula=Exist("Stockkeeping
Unit" WHERE (Item No.=FIELD(No.)));
CaptionML=[ENU=Stockkeeping Unit
Exists;
ESP=Existe ud. de
almacenam.];
Editable=No }
{ 5701; ;Manufacturer Code ;Code10 ;TableRelation=Manufacturer;
CaptionML=[ENU=Manufacturer
Code;
ESP=C�d. marca] }
{ 5702; ;Item Category Code ;Code20 ;TableRelation="Item Category"
WHERE (Blocked=CONST(No));
OnValidate=VAR

ItemAttributeManagement@1000 : Codeunit 7500;


BEGIN
ItemAttributeManagement.InheritAttributesFromItemCategory(Rec,"Item Category
Code",xRec."Item Category Code");

UpdateItemCategoryId;
//LS-5257-
IF "Item Category
Code" <> xRec."Item Category Code" THEN BEGIN

CopyFromItemCategory;

CopyFromReplenProfile;
IF NOT
ProductGrp.GET("Item Category Code","Product Group Code") THEN

VALIDATE("Product Group Code",'')


ELSE

VALIDATE("Product Group Code");

UpdateVendorItemLibrary;

UpdateAttribViews; //<073
END;
//LS-5257+
END;

CaptionML=[ENU=Item Category
Code;
ESP=C�d. categor�a
producto] }
{ 5703; ;Created From Nonstock Item;Boolean ;AccessByPermission=TableData
5718=R;
CaptionML=[ENU=Created From
Catalog Item;
ESP=Creado desde
producto de cat�logo];
Editable=No }
{ 5704; ;Product Group Code ;Code10 ;TableRelation=IF (Item Category
Code=FILTER(<>'')) "Product Group".Code WHERE (Item Category Code=FIELD(Item
Category Code),

Blocked=CONST(No))

ELSE "Product Group".Code WHERE (Blocked=CONST(No));


OnValidate=VAR

ProductGroup@1100225000 : Record 5723;


BEGIN
//LS-5257-

ProductGroup.SETRANGE(Code,"Product Group Code");


IF
ProductGroup.FIND('-') THEN BEGIN
// INC-999 ==>
IF
ProductGroup.Blocked THEN

ProductGroup.FIELDERROR(Blocked);
// INC-999 <==
"Item Category
Code" := ProductGroup."Item Category Code";
"Qty not in
Decimal" := ProductGroup."Qty not in Decimal";
IF
ItemCategory.GET("Item Category Code") THEN
"Division Code"
:= ItemCategory."Division Code";

CopyFromItemCategory;

CopyFromProductGroup(ProductGroup);

AddDefaultDistr(ItemCategory,ProductGroup);
END;

CopyFromReplenProfile;

UpdateVendorItemLibrary;

UpdateItemUnitsOfMeasures; //LS
//LS-5257+

//-MRW
Configuraci�n Vistas en base a Division, grupo y categor�a. 21/08/2017/
//-MRW Solo
aplicable a Productos con grupo contable inventario TERMINADO
//Obligo a rellenar
el grupo contable inventario primero
IF "Inventory
Posting Group" = '' THEN
ERROR('Debe
rellenar primero el Grupo contable inventario del producto');

UpdateAttribViews; //<073
END;

ValidateTableRelation=No;
ObsoleteReason=Product Groups
became first level children of Item Categories.;
CaptionML=[ENU=Product Group
Code;
ESP=C�d. grupo
producto] }
{ 5706; ;Substitutes Exist ;Boolean ;FieldClass=FlowField;
CalcFormula=Exist("Item
Substitution" WHERE (Type=CONST(Item),

No.=FIELD(No.)));
CaptionML=[ENU=Substitutes
Exist;
ESP=Existe
sustitutivo];
Editable=No }
{ 5707; ;Qty. in Transit ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Transfer
Line"."Qty. in Transit (Base)" WHERE (Derived From Line No.=CONST(0),
Item No.=FIELD(No.),

Transfer-to Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Receipt Date=FIELD(Date Filter)));


CaptionML=[ENU=Qty. in Transit;
ESP=Cant. en
tr�nsito];
DecimalPlaces=0:5;
Editable=No }
{ 5708; ;Trans. Ord. Receipt (Qty.);Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Transfer
Line"."Outstanding Qty. (Base)" WHERE (Derived From Line No.=CONST(0),

Item No.=FIELD(No.),

Transfer-to Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Receipt Date=FIELD(Date Filter)));


CaptionML=[ENU=Trans. Ord.
Receipt (Qty.);
ESP=Recep. ped.
transfer. (cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 5709; ;Trans. Ord. Shipment (Qty.);Decimal;FieldClass=FlowField;
CalcFormula=Sum("Transfer
Line"."Outstanding Qty. (Base)" WHERE (Derived From Line No.=CONST(0),

Item No.=FIELD(No.),

Transfer-from Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Shipment Date=FIELD(Date Filter)));


CaptionML=[ENU=Trans. Ord.
Shipment (Qty.);
ESP=Env�o ped.
transfer. (cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 5776; ;Qty. Assigned to ship;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Warehouse
Shipment Line"."Qty. Outstanding (Base)" WHERE (Item No.=FIELD(No.),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Due Date=FIELD(Date Filter)));


CaptionML=[ENU=Qty. Assigned to
ship;
ESP=Cant. asignada a
enviar];
DecimalPlaces=0:5;
Editable=No }
{ 5777; ;Qty. Picked ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Warehouse
Shipment Line"."Qty. Picked (Base)" WHERE (Item No.=FIELD(No.),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Due Date=FIELD(Date Filter)));


CaptionML=[ENU=Qty. Picked;
ESP=Cant preparada
pedido];
DecimalPlaces=0:5;
Editable=No }
{ 5900; ;Service Item Group ;Code10 ;TableRelation="Service Item
Group".Code;
OnValidate=VAR
ResSkill@1000 :
Record 5956;
BEGIN
IF xRec."Service
Item Group" <> "Service Item Group" THEN BEGIN
IF NOT
ResSkillMgt.ChangeRelationWithGroup(

ResSkill.Type::Item,
"No.",

ResSkill.Type::"Service Item Group",


"Service
Item Group",

xRec."Service Item Group")


THEN
"Service Item
Group" := xRec."Service Item Group";
END ELSE

ResSkillMgt.RevalidateRelation(

ResSkill.Type::Item,
"No.",

ResSkill.Type::"Service Item Group",


"Service Item
Group")
END;

CaptionML=[ENU=Service Item
Group;
ESP=Grupo prod.
servicio] }
{ 5901; ;Qty. on Service Order;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Service
Line"."Outstanding Qty. (Base)" WHERE (Document Type=CONST(Order),

Type=CONST(Item),

No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Needed by Date=FIELD(Date Filter)));


CaptionML=[ENU=Qty. on Service
Order;
ESP=Cant. en ped.
servicio];
DecimalPlaces=0:5;
Editable=No }
{ 5902; ;Res. Qty. on Service Orders;Decimal;FieldClass=FlowField;
CalcFormula=-Sum("Reservation
Entry"."Quantity (Base)" WHERE (Item No.=FIELD(No.),

Source Type=CONST(5902),

Source Subtype=CONST(1),

Reservation Status=CONST(Reservation),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter)));


AccessByPermission=TableData
5900=R;
CaptionML=[ENU=Res. Qty. on
Service Orders;
ESP=Cant. res. en
pedidos serv.];
DecimalPlaces=0:5;
Editable=No }
{ 6500; ;Item Tracking Code ;Code10 ;TableRelation="Item Tracking
Code";
OnValidate=BEGIN
IF "Item Tracking
Code" <> '' THEN
TESTFIELD(Type,Type::Inventory);
IF "Item Tracking
Code" = xRec."Item Tracking Code" THEN
EXIT;

IF NOT
ItemTrackingCode.GET("Item Tracking Code") THEN

CLEAR(ItemTrackingCode);

IF NOT
ItemTrackingCode2.GET(xRec."Item Tracking Code") THEN

CLEAR(ItemTrackingCode2);

IF
(ItemTrackingCode."SN Specific Tracking" <> ItemTrackingCode2."SN Specific
Tracking") OR

(ItemTrackingCode."Lot Specific Tracking" <> ItemTrackingCode2."Lot Specific


Tracking")
THEN

TestNoEntriesExist(FIELDCAPTION("Item Tracking Code"));

IF "Costing Method"
= "Costing Method"::Specific THEN BEGIN

TestNoEntriesExist(FIELDCAPTION("Item Tracking Code"));

TESTFIELD("Item
Tracking Code");

ItemTrackingCode.GET("Item Tracking Code");


IF NOT
ItemTrackingCode."SN Specific Tracking" THEN
ERROR(
Text018,

ItemTrackingCode.FIELDCAPTION("SN Specific Tracking"),

FORMAT(TRUE),ItemTrackingCode.TABLECAPTION,ItemTrackingCode.Code,

FIELDCAPTION("Costing Method"),"Costing Method");


END;

TestNoOpenDocumentsWithTrackingExist;
//LS -
IF "Item Tracking
Code" = '' THEN BEGIN

CALCFIELDS("Options Exist");
IF "Options
Exist" = TRUE THEN

ERROR(Text10012700_01);
END;
//LS +
END;

CaptionML=[ENU=Item Tracking
Code;
ESP=C�d. seguim.
prod.] }
{ 6501; ;Lot Nos. ;Code20 ;TableRelation="No. Series";
OnValidate=BEGIN
IF "Lot Nos." <> ''
THEN
TESTFIELD("Item
Tracking Code");
END;

CaptionML=[ENU=Lot Nos.;
ESP=N� serie lote] }
{ 6502; ;Expiration Calculation;DateFormula ;CaptionML=[ENU=Expiration
Calculation;
ESP=C�lculo
caducidad] }
{ 6503; ;Lot No. Filter ;Code50 ;FieldClass=FlowFilter;
CaptionML=[ENU=Lot No. Filter;
ESP=Filtro n� lote] }
{ 6504; ;Serial No. Filter ;Code50 ;FieldClass=FlowFilter;
CaptionML=[ENU=Serial No.
Filter;
ESP=Filtro n�
serie] }
{ 6650; ;Qty. on Purch. Return;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Purchase
Line"."Outstanding Qty. (Base)" WHERE (Document Type=CONST(Return Order),

Type=CONST(Item),

No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Expected Receipt Date=FIELD(Date Filter)));


AccessByPermission=TableData
6660=R;
CaptionML=[ENU=Qty. on Purch.
Return;
ESP=Cant. en
devoluciones de compras];
DecimalPlaces=0:5;
Editable=No }
{ 6660; ;Qty. on Sales Return;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Sales
Line"."Outstanding Qty. (Base)" WHERE (Document Type=CONST(Return Order),
Type=CONST(Item),

No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter)));


AccessByPermission=TableData
6650=R;
CaptionML=[ENU=Qty. on Sales
Return;
ESP=Cant. en
devoluciones de ventas];
DecimalPlaces=0:5;
Editable=No }
{ 7171; ;No. of Substitutes ;Integer ;FieldClass=FlowField;
CalcFormula=Count("Item
Substitution" WHERE (Type=CONST(Item),

No.=FIELD(No.)));
CaptionML=[ENU=No. of
Substitutes;
ESP=N� de
sustitutos];
Editable=No }
{ 7300; ;Warehouse Class Code;Code10 ;TableRelation="Warehouse Class";
CaptionML=[ENU=Warehouse Class
Code;
ESP=C�d. clase
almac�n] }
{ 7301; ;Special Equipment Code;Code10 ;TableRelation="Special
Equipment";
CaptionML=[ENU=Special Equipment
Code;
ESP=C�d. equipo
especial] }
{ 7302; ;Put-away Template Code;Code10 ;TableRelation="Put-away Template
Header";
CaptionML=[ENU=Put-away Template
Code;
ESP=C�d. plantilla
ubicar] }
{ 7307; ;Put-away Unit of Measure Code;Code10;
TableRelation=IF
(No.=FILTER(<>'')) "Item Unit of Measure".Code WHERE (Item No.=FIELD(No.))
ELSE "Unit of
Measure";
AccessByPermission=TableData
7340=R;
CaptionML=[ENU=Put-away Unit of
Measure Code;
ESP=C�d. ud. medida
ubicaci�n] }
{ 7380; ;Phys Invt Counting Period Code;Code10;
TableRelation="Phys. Invt.
Counting Period";
OnValidate=VAR

PhysInvtCountPeriod@1000 : Record 7381;

PhysInvtCountPeriodMgt@1001 : Codeunit 7380;


BEGIN
IF ("Phys Invt
Counting Period Code" <> '') AND
("Phys Invt
Counting Period Code" <> xRec."Phys Invt Counting Period Code")
THEN BEGIN

PhysInvtCountPeriod.GET("Phys Invt Counting Period Code");

PhysInvtCountPeriod.TESTFIELD("Count Frequency per Year");


IF xRec."Phys
Invt Counting Period Code" <> '' THEN
IF CurrFieldNo
<> 0 THEN
IF NOT
CONFIRM(

Text7380,
FALSE,

FIELDCAPTION("Phys Invt Counting Period Code"),

FIELDCAPTION("Next Counting Start Date"),

FIELDCAPTION("Next Counting End Date"))


THEN

ERROR(Text7381);

IF "Last Counting
Period Update" = 0D THEN

PhysInvtCountPeriodMgt.CalcPeriod(
"Last
Counting Period Update","Next Counting Start Date","Next Counting End Date",

PhysInvtCountPeriod."Count Frequency per Year");


END ELSE BEGIN
IF CurrFieldNo <>
0 THEN
IF NOT
CONFIRM(Text003,FALSE,FIELDCAPTION("Phys Invt Counting Period Code")) THEN

ERROR(Text7381);
"Next Counting
Start Date" := 0D;
"Next Counting
End Date" := 0D;
"Last Counting
Period Update" := 0D;
END;
END;

CaptionML=[ENU=Phys Invt
Counting Period Code;
ESP=C�d. perio.
recuento inv. f�s.] }
{ 7381; ;Last Counting Period Update;Date ;AccessByPermission=TableData
7380=R;
CaptionML=[ENU=Last Counting
Period Update;
ESP=�lt. actual.
periodo recuento];
Editable=No }
{ 7383; ;Last Phys. Invt. Date;Date ;FieldClass=FlowField;
CalcFormula=Max("Phys. Inventory
Ledger Entry"."Posting Date" WHERE (Item No.=FIELD(No.),

Phys Invt Counting Period Type=FILTER(' '|Item)));


CaptionML=[ENU=Last Phys. Invt.
Date;
ESP=�lt. fecha
invent. f�sico];
Editable=No }
{ 7384; ;Use Cross-Docking ;Boolean ;InitValue=Yes;
AccessByPermission=TableData
7302=R;
CaptionML=[ENU=Use Cross-
Docking;
ESP=Utilizar tr�nsito
directo] }
{ 7385; ;Next Counting Start Date;Date ;CaptionML=[ENU=Next Counting
Start Date;
ESP=Siguiente fecha
de inicio del recuento];
Editable=No }
{ 7386; ;Next Counting End Date;Date ;CaptionML=[ENU=Next Counting End
Date;
ESP=Siguiente fecha
de fin del recuento];
Editable=No }
{ 7700; ;Identifier Code ;Code20 ;FieldClass=FlowField;
CalcFormula=Lookup("Item
Identifier".Code WHERE (Item No.=FIELD(No.)));
CaptionML=[ENU=Identifier Code;
ESP=C�digo
identificador];
Editable=No }
{ 8000; ;Id ;GUID ;CaptionML=[ENU=Id;
ESP=Id.] }
{ 8001; ;Unit of Measure Id ;GUID ;TableRelation="Unit of
Measure".Id;
OnValidate=BEGIN

UpdateUnitOfMeasureCode;
END;
CaptionML=[ENU=Unit of Measure
Id;
ESP=Id. de unidad de
medida] }
{ 8002; ;Tax Group Id ;GUID ;TableRelation="Tax Group".Id;
OnValidate=BEGIN
UpdateTaxGroupCode;
END;

CaptionML=[ENU=Tax Group Id;


ESP=Id. de grupo
impositivo] }
{ 8003; ;Sales
Blocked ;Boolean ;DataClassification=CustomerContent;
CaptionML=[ENU=Sales Blocked;
ESP=Ventas
bloqueadas] }
{ 8004; ;Purchasing
Blocked ;Boolean ;DataClassification=CustomerContent;
CaptionML=[ENU=Purchasing
Blocked;
ESP=Compras
bloqueadas] }
{ 8005; ;Item Category Id ;GUID ;TableRelation="Item
Category".Id;
OnValidate=BEGIN

UpdateItemCategoryCode;
END;

DataClassification=SystemMetadata;
CaptionML=[ENU=Item Category Id;
ESP=Id. de categor�a
de producto] }
{ 10700; ;Cost Regulation % ;Decimal ;CaptionML=[ENU=Cost Regulation
%;
ESP=% Coste
territorio nacional];
DecimalPlaces=2:2;
MinValue=0;
MaxValue=100 }
{ 50000; ;Item
Class ;Option ;DataClassification=ToBeClassified;
CaptionML=ESP=Clase de producto;

OptionCaptionML=[ENU=" ,Consumable,No Item ledger Entry";

ESP=" ,Consumible,Sin movimiento producto"];


OptionString=[ ,Consumable,No
Item ledger Entry];
Description=431 }
{ 50001; ;Magento Code ;Integer ;OnValidate=BEGIN
//-007
END;

DataClassification=ToBeClassified;
CaptionML=ESP=C�d. Magento;
BlankZero=Yes;
Description=-007 }
{ 50002; ;Magento Picture
Filename;Text100 ;DataClassification=ToBeClassified;
CaptionML=ESP=Nombre Imagen
Magento;
Description=-007 }
{ 50003; ;Magento Update Stock;Boolean ;FieldClass=FlowField;
CalcFormula=Lookup("Item Update
Management"."Update Magento" WHERE (Item No.=FIELD(No.)));
CaptionML=ESP=Actualizar Stock
Magento;
Description=-007;
Editable=No }
{ 50004; ;Magento Skip
Stock ;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=Omitir Stock
Magento;
Description=-007 }
{ 50005; ;Qty. on Sales Order ECI;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Sales
Line"."Outstanding Qty. (Base)" WHERE (Document Type=CONST(Order),

Type=CONST(Item),

No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter),

Sell-to Customer No.=FILTER(CL0050000..CL0054999)));


AccessByPermission=TableData
110=R;
CaptionML=[ENU=Qty. on Sales
Order;
ESP=Cdad. en pedidos
venta ECI];
DecimalPlaces=0:5;
Description=-MRW;
Editable=No }
{ 50006; ;Qty. on Sales Order FNAC;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Sales
Line"."Outstanding Qty. (Base)" WHERE (Document Type=CONST(Order),

Type=CONST(Item),

No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),


Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter),

Sell-to Customer No.=FILTER(CL0055000..CL0055005)));


AccessByPermission=TableData
110=R;
CaptionML=[ENU=Qty. on Sales
Order;
ESP=Cdad. en pedidos
venta FNAC];
DecimalPlaces=0:5;
Description=-MRW;
Editable=No }
{ 50007; ;Qty. on Sales Order AMAZON;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Sales
Line"."Outstanding Qty. (Base)" WHERE (Document Type=CONST(Order),

Type=CONST(Item),

No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter),

Sell-to Customer No.=FILTER(CL0005675|CL0005840)));


AccessByPermission=TableData
110=R;
CaptionML=[ENU=Qty. on Sales
Order;
ESP=Cdad. en pedidos
venta AMAZON];
DecimalPlaces=0:5;
Description=-MRW;
Editable=No }
{ 50008; ;CREA Code ;Code20 ;TableRelation="MRW Codes".Code
WHERE (Type=CONST(CREA));

DataClassification=ToBeClassified;
CaptionML=[ENU=CREA Code;
ESP=C�digo CREA];
Description=-MRW-999,077 }
{ 50009; ;Create
Date ;Date ;DataClassification=ToBeClassified;
CaptionML=[ENU=Fecha alta;
ESP=Fecha alta];
Description=-MRW-999;
Editable=No }
{ 50010; ;Create User ID ;Code50 ;TableRelation=User."User Name";
OnValidate=VAR
UserMgt@1000 :
Codeunit 418;
BEGIN
END;

OnLookup=VAR
UserMgt@1000 :
Codeunit 418;
BEGIN
END;

ValidateTableRelation=No;
TestTableRelation=No;

DataClassification=ToBeClassified;
CaptionML=[ENU=User ID;
ESP=Id. usuario
alta];
Description=-MRW-999;
Editable=No }
{ 50011; ;Language Code ;Code10 ;TableRelation=Language.Code;
OnValidate=BEGIN
//-MRW
fxgetMaxiCode;
//+MRW
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=C�d Idioma;
ESP=C�d Idioma];
Description=-MRW-999 }

{ 50012; ;Status ;Option ;DataClassification=ToBeClassified;


CaptionML=[ENU=Estado;
ESP=Estado];

OptionCaptionML=ESP=Dise�o,Prelanzamiento,Campa�a,Estandard,Descatalogado,Baja,Edic
ion Limitada,On Hold,Descartado;

OptionString=Design,Prerelease,Campaign,Standart,Extint,Unsubscribe,Limited
Edition,On Hold,Discarded;
Description=-MRW-999 }
{ 50013; ;Purchaser Code ;Code10
;TableRelation=Salesperson/Purchaser;

DataClassification=ToBeClassified;
CaptionML=[ENU=Purchaser Code;
ESP=Gestor producto];
Description=-MRW-999 }
{ 50014; ;Assembly BOM Point of Use;Boolean ;FieldClass=FlowField;
CalcFormula=Exist("BOM
Component" WHERE (No.=FIELD(No.),
Type=CONST(Item)));
CaptionML=[ENU=Assembly BOM;
ESP=Lista Punto de
Uso];
Description=-MRW-999;
Editable=No }
{ 50015; ;Ventas en
multiplos ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Ventas en
multiplos B2B;
ESP=Ventas en
multiplos B2B];
Description=-MRW-999 }
{ 50016; ;Release
Date ;Date ;DataClassification=ToBeClassified;
CaptionML=[ENU=Fecha
Lanzamiento;
ESP=Fecha
Lanzamiento];
Description=-MRW-999 }
{ 50017; ;Magento Reserve Item
B2B;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Producto Reserva
Magento B2B;
ESP=Producto Reserva
Magento B2B];
Description=-MRW-999 }
{ 50018; ;Magento Reserve Item
B2C;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Producto Reserva
Magento B2C;
ESP=Producto Reserva
Magento B2C];
Description=-MRW-999 }
{ 50019; ;Imprimir EAN
envio ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Imprimir EAN
env�o;
ESP=Imprimir EAN
env�o];
Description=-MRW-999 }

{ 50020; ;CopyDescrip ;Text150 ;DataClassification=ToBeClassified;


CaptionML=[ENU=Copy;
ESP=Copy];
Description=-MRW-999 }
{ 50021; ;Collection No. ;Code20 ;TableRelation="MRW Codes".Code
WHERE (Type=CONST(Collection));
OnValidate=BEGIN
//-MRW
fxgetMaxiCode;
//+MRW
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Collection No.;
ESP=N� colecci�n];
Description=-MRW-999 }
{ 50022; ;Collection Year ;Code20 ;TableRelation="MRW Codes".Code
WHERE (Type=CONST(Year));
OnValidate=BEGIN
//-MRW
fxgetMaxiCode;
//+MRW
END;

DataClassification=ToBeClassified;
CaptionML=ESP=A�o colecci�n;
Description=-MRW-999 }
{ 50023; ;Inventario a Fecha ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Item Ledger
Entry".Quantity WHERE (Item No.=FIELD(No.),

Global Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Global Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Lot No.=FIELD(Lot No. Filter),

Serial No.=FIELD(Serial No. Filter),

Posting Date=FIELD(Date Filter)));


CaptionML=[ENU=Inventory;
ESP=Inventario a
Fecha];
DecimalPlaces=0:5;
Description=-MRW-999;
Editable=No }
{ 50024; ;Topic ;Code20 ;TableRelation="MRW Codes".Code
WHERE (Type=CONST(Topic));
OnValidate=BEGIN
//-MRW
fxgetMaxiCode;
//+MRW
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Tem�tica;
ESP=Tem�tica];
Description=-MRW-999 }
{ 50025; ;Item Type ;Code20 ;TableRelation="MRW Codes".Code
WHERE (Type=CONST(Type));
OnValidate=BEGIN
//-MRW
fxgetMaxiCode;
//+MRW
END;
DataClassification=ToBeClassified;
CaptionML=[ENU=Tipo Producto;
ESP=Tipo Producto];
Description=-MRW-999 }
{ 50026; ;Stock Risk ;Code20 ;TableRelation="MRW Codes".Code
WHERE (Type=CONST(Stock Risk));
OnValidate=BEGIN
//-MRW
fxgetMaxiCode;
//+MRW
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Riesgo de Stock;
ESP=Riesgo de Stock];
Description=-MRW-999 }
{ 50027; ;Periodicity ;Code20 ;TableRelation="MRW Codes".Code
WHERE (Type=CONST(Periodicity));
OnValidate=BEGIN
//-MRW
fxgetMaxiCode;
//+MRW
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Estacionalidad;
ESP=Estacionalidad];
Description=-MRW-999 }
{ 50028; ;Item Information ;Code20 ;TableRelation="MRW Codes".Code
WHERE (Type=CONST(Information));
OnValidate=BEGIN
//-MRW
fxgetMaxiCode;
//+MRW
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Informaci�n
Producto;
ESP=Informaci�n
Producto];
Description=-MRW-999 }

{ 50029; ;Maxicode ;Code50 ;DataClassification=ToBeClassified;


CaptionML=[ENU=Maxic�digo;
ESP=Maxic�digo];
Description=-MRW-999 }
{ 50030; ;Uds ventas en
multiplos;Integer ;DataClassification=ToBeClassified;
CaptionML=[ENU=Uds ventas en
multiplos B2B;
ESP=Uds ventas en
multiplos B2B];
Description=-MRW-999 }
{ 50031; ;VAT Prod. Posting Group SC;Code10 ;TableRelation="VAT Product
Posting Group";

DataClassification=ToBeClassified;
CaptionML=[ENU=VAT Prod. Posting
Group Self Consum;
ESP=Grupo registro
IVA prod. autoconsumo];
Description=044 }
{ 50032; ;CubiScan
Imported ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Importado de
CubiScan;
ESP=Importado de
CubiScan];
Description=MRW;
Editable=No }
{ 50033; ;Expedition Box
Item ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Expedition Box
Item;
ESP=Prod. caja
expedici�n];
Description=062 }
{ 50034; ;Design Lines ;Code20 ;TableRelation="MRW Codes".Code
WHERE (Type=CONST(DesignLine));

DataClassification=ToBeClassified;
CaptionML=[ENU=Lineas dise�o;
ESP=Lineas dise�o];
Description=-MRW }
{ 50035; ;Mix Strategy ;Code20 ;TableRelation="MRW Codes".Code
WHERE (Type=CONST(MixStrategy));

DataClassification=ToBeClassified;
Description=-MRW }
{ 50036; ;Send to
TrustedShops;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Enviar a
Trustedshops;
ESP=Enviar a
Trustedshops];
Description=MRW009 }
{ 50037; ;Initial
Cost ;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Coste Inicial;
ESP=Coste Inicial];
Description=MRW030 }

{ 50038; ;Expansion ;Boolean ;DataClassification=ToBeClassified;


CaptionML=[ENU=Expansion;
ESP=Expansi�n];
Description=MRW999 }
{ 50039; ;Magento Is Visible ;Boolean ;OnValidate=BEGIN
//<073
IF "Magento Code"
<> 0 THEN BEGIN
IF "Magento Is
Visible" THEN
MagentoItem(4,0)
ELSE
MagentoItem(5,0);
END;
//073>

//<396
IF "Item Created in
Magento 2" THEN BEGIN
IF "Magento Is
Visible" THEN

MagentoItem(4,1)
ELSE

MagentoItem(5,1);
END;
//396>
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Visible en
Magento;
ESP=Visible en
Magento];
Description=073 }
{ 50040; ;is
continuous ;Boolean ;DataClassification=ToBeClassified;
Description=MW-2824 }
{ 50041; ;Custom
Item ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Custom Item;
ESP=Producto
personalizado];
Description=083 }
{ 50042; ;Packing unit measure code;Code10 ;TableRelation="Item Unit of
Measure".Code WHERE (Item No.=FIELD(No.));

DataClassification=ToBeClassified;
CaptionML=[ENU=Packing unit
measure code;
ESP=C�d. ud. medida
Packing];
Description=-STD026 }
{ 50043; ;Qty. on Sales Quote ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Sales
Line"."Outstanding Qty. (Base)" WHERE (Document Type=CONST(Quote),

Type=CONST(Item),

No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),


Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter)));


AccessByPermission=TableData
110=R;
CaptionML=[ENU=Qty. on Sales
Quote;
ESP=Cdad. en ofertas
venta];
DecimalPlaces=0:5;
Description=096;
Editable=No }
{ 50044; ;Ecoembes Code ;Code20 ;TableRelation=Ecoembes;

DataClassification=ToBeClassified;
CaptionML=[ENU=Ecoembes Code;
ESP=C�d. Ecoembes];
Description=119 }
{ 50045; ;Base UOM Barcode ;Code20 ;FieldClass=FlowField;

CalcFormula=Lookup(Barcodes."Barcode No." WHERE (Item No.=FIELD(No.),

Unit of Measure Code=FIELD(Base Unit of Measure)));


CaptionML=[ENU=Base UOM Barcode;
ESP=C�d. Barras
base];
Description=174;
Editable=No }
{ 50046; ;Item Created in
Splio;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Item created in
Splio;
ESP=Producto creado
en Splio];
Description=204 }

{ 50047; ;FSC ;Text100 ;DataClassification=ToBeClassified;


CaptionML=ESP=FSC;
Description=428 }
{ 50048; ;IGIC
% ;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=IGIC %;
ESP=% IGIC];
Description=522 }
{ 50049; ;Send Item Info To
Franchise;Boolean;DataClassification=ToBeClassified;
CaptionML=[ENU=Send Item Info To
Franchise;
ESP=Enviar
informaci�n producto a franquicia];
Description=532 }
{ 50050; ;Item Created in Magento
2;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=Producto creado en
Magento 2;
Description=396;
Editable=No }
{ 50055; ;Deposit Item ;Boolean ;OnValidate=VAR

DepositItemInventoryErr@1000000000 : TextConst 'ENU=Item inventory must be 0 to be


able to mark it as deposit;ESP=El inventario del producto debe de ser 0 para poder
marcarlo como de dep�sito';

ItemManagement@1100225000 : Codeunit 50034;


BEGIN
//<545
//
Rec.CALCFIELDS(Inventory);
// IF Rec."Deposit
Item" AND (Rec.Inventory <> 0) THEN
IF Rec."Deposit
Item" AND ItemManagement.ItemHasStock(Rec) THEN

ERROR(DepositItemInventoryErr);
//545>
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Deposit Item;
ESP=Producto
Dep�sito];
Description=545 }
{ 50057; ;Ecoembes -
Carton/Paper;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Carton / Paper;
ESP=Cart�n / Papel
(Kg)];
DecimalPlaces=2:5;
Description=573 }
{ 50058; ;Ecoembes -
Plastic ;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Plastic;
ESP=Pl�stico (Kg)];
DecimalPlaces=2:5;
Description=573 }
{ 50059; ;Ecoembes -
Metal/Aluminium;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Metal /
Aluminium;
ESP=Metal / Aluminio
(Kg)];
DecimalPlaces=2:5;
Description=573 }
{ 50060; ;Ecoembes -
Foam ;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Foam;
ESP=Espuma (Kg)];
DecimalPlaces=2:5;
Description=573 }
{ 50061; ;Ecoembes -
Others ;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Others;
ESP=Otros (Kg)];
DecimalPlaces=2:5;
Description=573 }
{ 50062; ;Target ;Code20 ;TableRelation="MRW Codes".Code
WHERE (Type=CONST(Target));

DataClassification=ToBeClassified }

{ 50063; ;Precio ;Option ;DataClassification=ToBeClassified;

OptionCaptionML=ESP=IMPULSO,VOLUMEN,VALOR;

OptionString=IMPULSO,VOLUMEN,VALOR;
Editable=No }
{ 50064; ;Nicho ;Code20 ;TableRelation="MRW Codes".Code
WHERE (Type=CONST(Nicho));

DataClassification=ToBeClassified }
{ 90000;No;B2C
Availability ;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=B2C Availability;
ESP=Disponibilidad
B2C];
Description=INC-007 Stock
Magento }
{ 90001;No;B2B
Availability ;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=B2B Availability;
ESP=Disponibilidad
B2B];
Description=INC-007 Stock
Magento }
{ 90002; ;AGV Qty. on Sales Order;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Sales
Line"."Outstanding Qty. (Base)" WHERE (Document Type=CONST(Order),

Status=CONST(Released),

Type=CONST(Item),

No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Drop Shipment=FIELD(Drop Shipment Filter),

Variant Code=FIELD(Variant Filter),

Shipment Date=FIELD(Date Filter)));


AccessByPermission=TableData
110=R;
CaptionML=[ENU=Qty. on Released
Sales Order;
ESP=Cant. en pedidos
venta lanzados];
DecimalPlaces=0:5;
Editable=No }
{ 90003; ;AGV Trans. Ord. Ship. (Qty.);Decimal;
FieldClass=FlowField;
CalcFormula=Sum("Transfer
Line"."Outstanding Qty. (Base)" WHERE (Derived From Line No.=CONST(0),

Status=CONST(Released),

Item No.=FIELD(No.),

Transfer-from Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Shipment Date=FIELD(Date Filter)));


CaptionML=[ENU=Trans. Ord.
Shipment Released (Qty.);
ESP=Env�o ped.
transfer. lanzado (cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 90010; ;AGV Available Stock ;Decimal ;FieldClass=FlowField;
CalcFormula=Lookup("AGV Item
Extension"."AGV Stock" WHERE (AGV Item No.=FIELD(No.)));
CaptionML=[ENU=Available Stock;
ESP=Stock
disponible];
DecimalPlaces=0:0;
Description=AGV-000;
Editable=No }
{ 90011; ;AGV Stock Last datetime;DateTime ;FieldClass=FlowField;
CalcFormula=Lookup("AGV Item
Extension"."AGV Stock Last datetime" WHERE (AGV Item No.=FIELD(No.)));
CaptionML=[ENU=Stock Last
datetime;
ESP=Fecha/hora �ltimo
c�lculo de stock];
Description=AGV-000;
Editable=No }
{ 90012; ;AGV Visible On Franchise;Boolean ;FieldClass=FlowField;
CalcFormula=Lookup("AGV Item
Extension"."AGV Visible on Item Franchise" WHERE (AGV Item No.=FIELD(No.)));
CaptionML=[ENU=Visible On
Franchise;
ESP=Visible en
franquicias];
Description=AGV-000;
Editable=No }
{ 90013; ;AGV Visible On Magento;Boolean ;FieldClass=FlowField;
CalcFormula=Lookup("AGV Item
Extension"."AGV Visible on Magento" WHERE (AGV Item No.=FIELD(No.)));
CaptionML=[ENU=Visible On
Magento;
ESP=Visible en
Magento];
Description=AGV-000;
Editable=No }
{ 90014; ;AGV Visible On Magento 2;Boolean ;CaptionML=[ENU=Visible On
Magento 2;
ESP=Visible en
Magento 2];
Description=AGV-000;
Editable=Yes }
{ 90015; ;AGV Last datetime modified;DateTime;FieldClass=FlowField;
CalcFormula=Lookup("AGV Item
Extension"."AGV Datetime last modification" WHERE (AGV Item No.=FIELD(No.)));
CaptionML=[ENU=Last datetime
modified;
ESP=Fecha/hora �ltima
modificaci�n];
Description=AGV-000;
Editable=No }
{ 90020; ;AGV Watermark Qty. ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Item Ledger
Entry".Quantity WHERE (Item No.=FIELD(No.),

Location Code=FIELD(Location Filter),

Posting Date=FIELD(Date Filter),

AGV WaterMark Group=FIELD(AGV WaterMark Filter),

Entry Type=FIELD(AGV Entry Type Filter),

Source Type=FIELD(AGV Source Type Filter)));


CaptionML=[ENU=Inventory;
ESP=Inventario];
DecimalPlaces=0:5;
Description=CS-09;
Editable=No }
{ 90021; ;AGV WaterMark Filter;Code50 ;FieldClass=FlowFilter;
TableRelation="MRW Codes".Code
WHERE (Type=FILTER(WaterMark group));
CaptionML=[ENU=WaterMark Group;
ESP=Grupo WaterMark];
Description=CS-09;
Editable=No }
{ 90022; ;AGV Entry Type Filter;Option ;FieldClass=FlowFilter;
CaptionML=[ENU=Entry Type;
ESP=Tipo movimiento];

OptionCaptionML=[ENU=Purchase,Sale,Positive Adjmt.,Negative
Adjmt.,Transfer,Consumption,Output, ,Assembly Consumption,Assembly Output;

ESP=Compra,Venta,Ajuste positivo,Ajuste negativo,Transferencia,Consumo,Salida desde


fab., ,Consumo ensamblado,Salida ensamblado];

OptionString=Purchase,Sale,Positive Adjmt.,Negative
Adjmt.,Transfer,Consumption,Output, ,Assembly Consumption,Assembly Output;
Description=CS-09;
Editable=No }
{ 90023; ;AGV Source Type Filter;Option ;FieldClass=FlowFilter;
CaptionML=[ENU=Source Type;
ESP=Tipo procedencia
mov.];
OptionCaptionML=[ENU=" ,Customer,Vendor,Item";

ESP=" ,Cliente,Proveedor,Producto"];

OptionString=[ ,Customer,Vendor,Item];
Description=CS-09;
Editable=No }
{ 10000700;;Date
Created ;Date ;DataClassification=ToBeClassified;
CaptionML=[ENU=Date Created;
ESP=Fecha Creaci�n];
Editable=No }
{ 10000701;;Created by
User ;Code50 ;DataClassification=ToBeClassified;
CaptionML=[ENU=Created by User;
ESP=Creado por
Usuario];
Editable=No }
{ 10000702;;Division Code ;Code10 ;TableRelation=Division WHERE
(Blocked=CONST(No));
OnValidate=BEGIN
//LS
VALIDATE("Product
Group Code",'');
VALIDATE("Item
Category Code",'');

UpdateVendorItemLibrary;

UpdatePhysInvCountingPeriod; //LS-3723

UpdateAttribViews; //<073
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Division Code;
ESP=C�d. Divisi�n] }
{ 10000704;;Special Group Code ;Code10 ;FieldClass=FlowField;
CalcFormula=Lookup("Item/Special
Group Link"."Special Group Code" WHERE (Item No.=FIELD(No.)));
OnLookup=VAR

ItemSpecialGr@1200000001 : Record 10000736;

ItemSpecialGrPage@1200000000 : Page 10000819;


BEGIN
//LS

CLEAR(ItemSpecialGrPage);
ItemSpecialGr.RESET;

ItemSpecialGr.SETRANGE(ItemSpecialGr."Item No.","No.");

ItemSpecialGrPage.SETTABLEVIEW(ItemSpecialGr);

ItemSpecialGrPage.RUNMODAL;
CALCFIELDS("Special
Group Code");
END;

CaptionML=[ENU=Special Group
Code;
ESP="C�d. Grupo
especial "];
Editable=No }
{ 10000705;;Store Filter ;Code10 ;FieldClass=FlowFilter;
TableRelation=Store;
OnValidate=VAR
Stores@1000000000 :
Record 99001470;

InvFilter@1000000001 : Code[250];
BEGIN
//LS
IF GETFILTER("Store
Filter") = '' THEN

SETRANGE("Location Filter");

CombineStoreLocationFilter(Rec);
END;

CaptionML=[ENU=Store Filter;
ESP=Filtro Tienda] }
{ 10000707;;Modifying Date of
Status;Date ;DataClassification=ToBeClassified;
CaptionML=[ENU=Modifying Date of
Status;
ESP=Fecha
modificaci�n de estado];
Editable=No }
{ 10000710;;Last Modified by
User;Code50 ;DataClassification=ToBeClassified;
CaptionML=[ENU=Last Modified by
User;
ESP=Usuario �ltima
modificaci�n];
Editable=No }
{ 10000711;;Item Error Check Code;Code10 ;TableRelation="Item Error
Check";

DataClassification=ToBeClassified;
CaptionML=[ENU=Item Error Check
Code;
ESP=C�d. Error
Verificaci�n Producto] }
{ 10000712;;Item Error Check
Status;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=Item Error Check
Status;
ESP=Estado Verif.
Error Producto];

OptionCaptionML=ENU=Unchecked,Passed,Failed;

OptionString=Unchecked,Passed,Failed }
{ 10000713;;Suggested Qty. on
POS;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Suggested Qty. on
POS;
ESP=Cdad. Sugerida en
TPV] }
{ 10000714;;Item Capacity Value;Decimal ;InitValue=1;

DataClassification=ToBeClassified;
CaptionML=[ENU=Item Capacity
Value;
ESP=Valor Capacidad
Producto] }
{ 10000715;;Qty not in
Decimal ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Qty not in
Decimal;
ESP=Cdad. no en
Decimal] }
{ 10000906;;Warranty
Card ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Warranty Card;
ESP=Ficha Garant�a] }
{ 10000909;;Def. Ordered
by ;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=Def. Ordered by;
ESP=Ordenado por (por
defecto)];

OptionCaptionML=ENU=Store,Central;
OptionString=Store,Central }
{ 10000910;;Def. Ordering
Method;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=Def. Ordering
Method;
ESP=Modo de orden por
defecto];
OptionCaptionML=ENU=By
hand,Calculate;
OptionString=By hand,Calculate }
{ 10000911;;Original Vendor No.;Code20 ;TableRelation=Vendor;
ValidateTableRelation=Yes;
TestTableRelation=Yes;

DataClassification=ToBeClassified;
CaptionML=[ENU=Original Vendor
No.;
ESP=No. proveedor
original] }
{ 10000912;;Original Vendor Item
No.;Text20 ;DataClassification=ToBeClassified;
CaptionML=[ENU=Original Vendor
Item No.;
ESP=No. original de
producto seg�n Proveedor] }
{ 10001200;;BOM Method ;Option ;OnValidate=BEGIN
//LS
CASE "BOM Method"
OF
"BOM Method"::"No
Exploding" : "Explode BOM in Statem. Posting" := FALSE;
"BOM
Method"::"Explode at Posting" : "Explode BOM in Statem. Posting" := TRUE;
"BOM
Method"::"Explode at Entry" : "Explode BOM in Statem. Posting" := FALSE;
"BOM
Method"::Produce : "Explode BOM in Statem. Posting" := FALSE;
END;
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=BOM Method;
ESP=M�todo LM];
OptionCaptionML=[ENU=No
Exploding,Explode at Entry,Explode at Posting,Produce;
ESP=No
Expandir,Expandir Cantidades,Expandir Cantidad y Precio,Producir];
OptionString=No
Exploding,Explode at Entry,Explode at Posting,Produce }
{ 10001201;;BOM Receipt
Print ;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=BOM Receipt
Print;
ESP=Impr. Recibo LM];

OptionCaptionML=[ENU=Normal,Compressed;

ESP=Normal,Comprimido];
OptionString=Normal,Compressed }
{ 10001202;;Recipe Version Code;Code20 ;TableRelation="BOM Version";
OnValidate=VAR

BomComp@1200070000 : Record 90;

BomVerComp@1200070001 : Record 10001213;

NxtLine@1200070002 : Integer;
BEGIN
//LS
IF xRec."Recipe
Version Code" <> '' THEN BEGIN
BomComp.RESET;

BomComp.SETRANGE("Parent Item No.","No.");

BomComp.SETRANGE("Recipe Version Code",xRec."Recipe Version Code");

BomComp.DELETEALL(TRUE);
END;

IF "Recipe Version
Code" <> '' THEN BEGIN
BomComp.RESET;

BomComp.SETRANGE("Parent Item No.","No.");


IF
BomComp.FIND('+') THEN
NxtLine :=
BomComp."Line No." + 10000
ELSE
NxtLine :=
10000;

BomVerComp.SETRANGE("Parent Item No.","No.");

BomVerComp.SETRANGE("Recipe Version Code","Recipe Version Code");


IF
BomVerComp.FINDFIRST THEN
REPEAT
BomComp.INIT;

BomComp."Parent Item No." := "No.";


BomComp."Line
No." := NxtLine;

BomComp.VALIDATE(Type,BomVerComp.Type);

BomComp.VALIDATE("No.",BomVerComp."No.");
BomComp."BOM
Component Type" := BomVerComp."BOM Component Type";

BomComp."Wastage %" := BomVerComp."Wastage %";

BomComp."Quantity per" := BomVerComp."Quantity per";


//LS -

BomComp."Exclude from Menu Requisition" := BomVerComp."Exclude from Menu


Requisition";
BomComp."Qty.
per Recipe No.of Portions" := BomVerComp."Qty. per Recipe No.of Portions";

BomComp.Exclusion := BomVerComp."Pop-up Exclusion";


//LS +

BomComp.VALIDATE("Unit of Measure Code",BomVerComp."Unit of Measure Code");

BomComp."Recipe Version Code" := BomVerComp."Recipe Version Code";


BomComp."BOM
Recipe Version Code" := BomVerComp."BOM Recipe Version Code";

BomComp."Excluded from Portion Weight" := BomVerComp."Excluded from Portion


Weight";

BomComp."Unaff. by Multipl. Factor" := BomVerComp."Unaff. by Multipl. Factor";

BomComp."Item
No." := BomVerComp."No.";

BomComp.VALIDATE("Quantity per"); //LS

BomComp.INSERT(TRUE);
NxtLine :=
NxtLine + 10000;
UNTIL
BomVerComp.NEXT = 0;
END;
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Recipe Version
Code;
ESP=C�d. Versi�n
Receta] }
{ 10001203;;Recipe Item
Type ;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=Recipe Item Type;
ESP=Tipo Producto
LM];

OptionCaptionML=[ENU=" ,Ingredient,Recipe";

ESP=" ,Ingrediente,Receta"];

OptionString=[ ,Ingredient,Recipe] }
{ 10001204;;BOM Cost Price Distribution;Option;OnValidate=VAR

lRetailBOMComp@1100409000 : Codeunit 99001472;


BEGIN
//LS -
IF (xRec."BOM Cost
Price Distribution" <> "BOM Cost Price Distribution") AND
("BOM Cost Price
Distribution" = "BOM Cost Price Distribution"::Quantity) AND
("BOM Type" =
"BOM Type"::Prepack)
THEN

lRetailBOMComp.UpdBOMWeight("No.");
//LS +

PlanningAssignment.RoutingReplace(Rec,xRec."Routing No.");

IF "Routing No." <>


xRec."Routing No." THEN

ItemCostMgt.UpdateUnitCost(Rec,'','',0,0,FALSE,FALSE,TRUE,FIELDNO("Routing No."));
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=BOM Cost Price
Distribution;
ESP=Distribuci�n
Precio Coste LM];

OptionCaptionML=[ENU=Quantity,Defined;

ESP=Cdad,Definida];
OptionString=Quantity,Defined }
{ 10001205;;BOM
Type ;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=BOM Type;
ESP=Tipo LM];

OptionCaptionML=[ENU=" ,Recipe,Prepack";

ESP=" ,Receta,Pre-embalado"];

OptionString=[ ,Recipe,Prepack] }
{ 10001206;;BOM Receiving
Explode;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=BOM Receiving
Explode;
ESP=Desglose Recep.
LM];

OptionCaptionML=[ENU=" ,Store,Whse,Both";

ESP=" ,Tienda,Almac�n,Ambos"];
OptionString=[ ,Store,Whse,Both]
}
{ 10001300;;Depth ;Decimal ;OnValidate=BEGIN
//-MRW

fxCalcVolume(Height,Width,Depth);
//+MRW
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Depth (cm);
ESP=Largo (cm)] }
{ 10001301;;Width ;Decimal ;OnValidate=BEGIN
//-MRW

fxCalcVolume(Height,Width,Depth);
//+MRW
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Width (cm);
ESP=Ancho (cm)] }
{ 10001302;;Height ;Decimal ;OnValidate=BEGIN
//-MRW

fxCalcVolume(Height,Width,Depth);
//+MRW
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Height (cm);
ESP=Altura (cm)] }
{ 10001303;;External Item No. ;Code20 ;TableRelation="External Item";

DataClassification=ToBeClassified;
CaptionML=[ENU=External Item
No.;
ESP=No. Producto
Externo] }
{ 10001304;;Extern. Size+Crust ;Code10 ;TableRelation="External
Size+Crust";

DataClassification=ToBeClassified;
CaptionML=[ENU=Extern.
Size+Crust;
ESP=Tama�o+Corteza
Extern.] }
{ 10001400;;Variant Framework Code;Code20 ;TableRelation="Variant Framework
Setup"."Framework Code";
OnValidate=VAR
"Variant
reg"@1200000000 : Record 10001414;

ISText001@1200000001 : TextConst 'ENU=Change of variant framework denied';

ExtVariantDim@1200070000 : Record 10001412;

VariantSetup@1200070001 : Record 10001417;

RegVariants@1200070002 : Codeunit 10001405;

UpdateNCPrimaryVariantDimension_l@1100409000 : Boolean;
BEGIN
//LS

UpdateNCPrimaryVariantDimension_l := FALSE;
IF ("Variant
Framework Code" = '') OR
("Variant
Framework Code" <> xRec."Variant Framework Code")
THEN BEGIN
"Variant
reg".SETRANGE("Variant reg"."Item No.","No.");

UpdateNCPrimaryVariantDimension_l := TRUE;
IF "Variant
reg".FIND('-') THEN BEGIN
IF
CONFIRM(Text10000000,FALSE) THEN
REPEAT
"Variant
reg".DELETE(TRUE);
COMMIT;
UNTIL
"Variant reg".NEXT() = 0
ELSE
BEGIN
"Variant
Framework Code" := xRec."Variant Framework Code";

MESSAGE(Text10000001);
EXIT;
END;
END;

"Variant
reg".SETRANGE("Variant reg"."Item No.","No.");
IF "Variant
reg".ISEMPTY THEN BEGIN

ExtVariantDim.RESET;

ExtVariantDim.SETCURRENTKEY(ExtVariantDim.Item);

ExtVariantDim.SETRANGE(ExtVariantDim.Item,"No.");
IF
ExtVariantDim.FIND('-') THEN REPEAT

ExtVariantDim.DELETE(TRUE);
UNTIL
ExtVariantDim.NEXT = 0;
END;

IF ("Variant
Framework Code" <> '') AND

(VariantSetup.GET("Variant Framework Code"))


THEN BEGIN
IF
(VariantSetup."Registration Type" = VariantSetup."Registration Type"::Automatic) OR

(VariantSetup."Registration Type" = VariantSetup."Registration Type"::"2")


THEN

RegVariants.RUN(Rec);
END;
END;

{ //LS
IF
UpdateNCPrimaryVariantDimension_l THEN BEGIN
CLEAR("xNC Primary
Variant Dimension");
VALIDATE("xNC
Primary Variant Dimension");
END;
} //LS
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Variant Framework
Code;
ESP=C�d. Estructura
Variantes] }
{ 10001401;;Season Code ;Code10 ;TableRelation=Season;
OnValidate=VAR

Seasons@1200070001 : Record 10001400;

ItemSpecialGroupLink@1200070000 : Record 10000736;


BEGIN
//LS
IF "Season Code" =
'' THEN BEGIN
IF xRec."Season
Code" <> '' THEN BEGIN

Seasons.GET(xRec."Season Code");
IF
Seasons."Special Group Code" <> '' THEN
IF
ItemSpecialGroupLink.GET("No.",Seasons."Special Group Code") THEN

ItemSpecialGroupLink.DELETE(TRUE);
END;
END ELSE BEGIN
IF xRec."Season
Code" = '' THEN BEGIN

Seasons.GET("Season Code");
IF
Seasons."Special Group Code" <> '' THEN BEGIN

ItemSpecialGroupLink.INIT;

ItemSpecialGroupLink."Item No." := "No.";

ItemSpecialGroupLink."Special Group Code" := Seasons."Special Group Code";


IF
ItemSpecialGroupLink.INSERT(TRUE) THEN;
END;
END ELSE BEGIN
IF
xRec."Special Group Code" <> "Special Group Code" THEN BEGIN

Seasons.GET(xRec."Season Code");
IF
Seasons."Special Group Code" <> '' THEN
IF
ItemSpecialGroupLink.GET("No.",Seasons."Special Group Code") THEN

ItemSpecialGroupLink.DELETE(TRUE);

Seasons.GET("Season Code");
IF
Seasons."Special Group Code" <> '' THEN BEGIN

ItemSpecialGroupLink.INIT;

ItemSpecialGroupLink."Item No." := "No.";

ItemSpecialGroupLink."Special Group Code" := Seasons."Special Group Code";


IF
ItemSpecialGroupLink.INSERT(TRUE) THEN;
END;
END;
END;

//LS-8785-

Seasons.GET("Season Code");
IF
(Seasons."Update Item Lifecycle Start" = Seasons."Update Item Lifecycle
Start"::Yes) OR

((Seasons."Update Item Lifecycle Start" = Seasons."Update Item Lifecycle


Start"::"Yes (If field is empty)") AND
("Lifecycle
Starting Date" = 0D))
THEN

VALIDATE("Lifecycle Starting Date",Seasons."Starting Date");

IF
(Seasons."Update Item Lifecycle End" = Seasons."Update Item Lifecycle End"::Yes) OR

((Seasons."Update Item Lifecycle End" = Seasons."Update Item Lifecycle End"::"Yes


(If field is empty)") AND
("Lifecycle
Ending Date" = 0D))
THEN

VALIDATE("Lifecycle Ending Date",Seasons."Ending Date");


//LS-8785+
END;
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Season Code;
ESP=C�d. Temporada] }
{ 10001402;;Lifecycle Length ;DateFormula ;OnValidate=BEGIN
//LS
IF
FORMAT("Lifecycle Length") = '' THEN BEGIN
"Lifecycle
Starting Date" := 0D;
"Lifecycle Ending
Date" := 0D;
END ELSE BEGIN
IF "Lifecycle
Starting Date" <> 0D THEN
"Lifecycle
Ending Date" := CALCDATE("Lifecycle Length","Lifecycle Starting Date");
END;
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Lifecycle Length;
ESP=Longitud Ciclo
Vida] }
{ 10001403;;Lifecycle Starting Date;Date ;OnValidate=BEGIN
//LS
IF "Lifecycle
Starting Date" = 0D THEN
"Lifecycle Ending
Date" := 0D
ELSE
IF
FORMAT("Lifecycle Length") <> '' THEN
"Lifecycle
Ending Date" := CALCDATE("Lifecycle Length","Lifecycle Starting Date");
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Lifecycle
Starting Date;
ESP=Fecha inicial
Ciclo Vida] }
{ 10001404;;Lifecycle Ending Date;Date ;OnValidate=BEGIN
//LS
IF "Lifecycle
Ending Date" = 0D THEN
IF
FORMAT("Lifecycle Length") <> '' THEN
"Lifecycle
Starting Date" := 0D;
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Lifecycle Ending
Date;
ESP=Fecha Final Ciclo
Vida] }
{ 10001405;;Error Check Internal
Usage;Boolean;DataClassification=ToBeClassified;
CaptionML=[ENU=Error Check
Internal Usage;
ESP=Uso Interno
Verificaci�n Errores] }
{ 10001406;;Attrib 1 Code ;Text30 ;OnValidate=BEGIN
//LS

AttributeUtils_g.SoftAttributeMgmt("No.",'','',0,1,"Attrib 1 Code",'');
END;

OnLookup=VAR

AttributeSetup@1200070000 : Record 10000788;


lAnswer@1100409001 :
Text[250];

lActionReturned@1100409002 : Action;
BEGIN
//LS
AttributeSetup.GET;
lAnswer :=
AttributeUtils_g.LookupOptionValues(0,AttributeSetup."Item Attrib. 1
Code",lActionReturned);
IF lActionReturned =
ACTION::LookupOK THEN
VALIDATE("Attrib 1
Code",COPYSTR(lAnswer,1,30));
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Attrib 1 Code;
ESP=C�d. Atrib. 1];
CaptionClass='98,27,10001406' }
{ 10001407;;Attrib 2 Code ;Text30 ;OnValidate=BEGIN
//LS

AttributeUtils_g.SoftAttributeMgmt("No.",'','',0,2,"Attrib 2 Code",'');
END;

OnLookup=VAR

AttributeSetup@1100409002 : Record 10000788;


lAnswer@1100409001 :
Text[250];

lActionReturned@1100409000 : Action;
BEGIN
//LS
AttributeSetup.GET;
lAnswer :=
AttributeUtils_g.LookupOptionValues(0,AttributeSetup."Item Attrib. 2
Code",lActionReturned);
IF lActionReturned =
ACTION::LookupOK THEN
VALIDATE("Attrib 2
Code",COPYSTR(lAnswer,1,30));
//LS +
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Attrib 2 Code;
ESP=C�d. Atrib. 2];
CaptionClass='98,27,10001407' }
{ 10001408;;Attrib 3 Code ;Text30 ;OnValidate=BEGIN
//LS

AttributeUtils_g.SoftAttributeMgmt("No.",'','',0,3,"Attrib 3 Code",'');
END;

OnLookup=VAR

AttributeSetup@1100409002 : Record 10000788;


lAnswer@1100409001 :
Text[250];

lActionReturned@1100409000 : Action;
BEGIN
//LS
AttributeSetup.GET;
lAnswer :=
AttributeUtils_g.LookupOptionValues(0,AttributeSetup."Item Attrib. 3
Code",lActionReturned);
IF lActionReturned =
ACTION::LookupOK THEN
VALIDATE("Attrib 3
Code",COPYSTR(lAnswer,1,30));
//LS +
END;
DataClassification=ToBeClassified;
CaptionML=[ENU=Attrib 3 Code;
ESP=C�d. Atrib. 3];
CaptionClass='98,27,10001408' }
{ 10001409;;Attrib 4 Code ;Text30 ;OnValidate=BEGIN
//LS

AttributeUtils_g.SoftAttributeMgmt("No.",'','',0,4,"Attrib 4 Code",'');
END;

OnLookup=VAR

AttributeSetup@1200070000 : Record 10000788;


lAnswer@1100409001 :
Text[250];

lActionReturned@1100409000 : Action;
BEGIN
//LS
AttributeSetup.GET;
lAnswer :=
AttributeUtils_g.LookupOptionValues(0,AttributeSetup."Item Attrib. 4
Code",lActionReturned);
IF lActionReturned =
ACTION::LookupOK THEN
VALIDATE("Attrib 4
Code",COPYSTR(lAnswer,1,30));
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Attrib 4 Code;
ESP=C�d. Atrib. 4];
CaptionClass='98,27,10001409' }
{ 10001410;;Attrib 5 Code ;Text30 ;OnValidate=BEGIN
//LS

AttributeUtils_g.SoftAttributeMgmt("No.",'','',0,5,"Attrib 5 Code",'');
END;

OnLookup=VAR

AttributeSetup@1100409002 : Record 10000788;


lAnswer@1100409001 :
Text[250];

lActionReturned@1100409000 : Action;
BEGIN
//LS
AttributeSetup.GET;
lAnswer :=
AttributeUtils_g.LookupOptionValues(0,AttributeSetup."Item Attrib. 5
Code",lActionReturned);
IF lActionReturned =
ACTION::LookupOK THEN
VALIDATE("Attrib 5
Code",COPYSTR(lAnswer,1,30));
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Attrib 5 Code;
ESP=C�d. Atrib. 5];
CaptionClass='98,27,10001410' }
{ 10001411;;ABC
Sales ;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=ABC Sales;
ESP=Ventas ABC];
OptionCaptionML=[ENU=" ,A,B,C";
ESP=" ,A,B,C"];
OptionString=[ ,A,B,C] }
{ 10001412;;ABC
Profit ;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=ABC Profit;
ESP=Beneficio ABC];
OptionCaptionML=[ENU=" ,A,B,C";
ESP=" ,A,B,C"];
OptionString=[ ,A,B,C] }
{ 10012100;;Wastage
% ;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Wastage %;
ESP=P�rdidas %] }
{ 10012101;;Included in Other Recipes;Boolean ;FieldClass=FlowField;
CalcFormula=Exist("BOM
Component" WHERE (No.=FIELD(No.)));
CaptionML=[ENU=Included in Other
Recipes;
ESP=Incluido(a) en
Otras Recetas];
Editable=No }
{ 10012106;;Excluded from Portion Weight;Boolean;

DataClassification=ToBeClassified;
CaptionML=[ENU=Excluded from
Portion Weight;
ESP=No incluido en
Peso Producto] }
{ 10012107;;Unaff. by Multipl.
Factor;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Unaff. by
Multipl. Factor;
ESP=No afectado por
Factor Multipl.] }
{ 10012108;;Portion Weight ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("BOM
Component"."Net Weight" WHERE (Parent Item No.=FIELD(No.),

Excluded from Portion Weight=CONST(No)));


CaptionML=[ENU=Portion Weight;
ESP=Peso Porci�n];
Editable=No }
{ 10012109;;Portion Cost ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("BOM
Component".Cost WHERE (Parent Item No.=FIELD(No.)));
CaptionML=[ENU=Portion Cost;
ESP=Coste Porci�n];
DecimalPlaces=2:2;
Editable=No }
{ 10012110;;Exclude from Menu Requisition;Boolean;

DataClassification=ToBeClassified;
CaptionML=[ENU=Exclude from Menu
Requisition;
ESP=Excluir de Men�
Requisici�n] }
{ 10012111;;Recipe No. of
Portions;Integer ;DataClassification=ToBeClassified;
CaptionML=[ENU=Recipe No. of
Portions;
ESP=No. Porciones
Receta];
MinValue=0 }
{ 10012112;;Max. Modifiers No
Price;Integer ;DataClassification=ToBeClassified;
CaptionML=[ENU=Max. Modifiers No
Price;
ESP=Modificadores
M�x. Sin Precio] }
{ 10012113;;Max. Ingr. Removed No Price;Integer;

DataClassification=ToBeClassified;
CaptionML=[ENU=Max. Ingr.
Removed No Price;
ESP=Max. Ingr.
Eliminados Sin Precio] }
{ 10012114;;Max. Ingr. +
Modifiers;Integer ;DataClassification=ToBeClassified;
CaptionML=[ENU=Max. Ingr. +
Modifiers;
ESP=Ingr. M�x. +
Modificadores] }
{ 10012116;;Production Time
(Min.);Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Production Time
(Min.);
ESP=Tiempo Producci�n
(Min.)];
MinValue=0;
MaxValue=999 }
{ 10012117;;Display Ingredients in Monitor;Boolean;

DataClassification=ToBeClassified;
CaptionML=[ENU=Display
Ingredients in Monitor;
ESP=Mostrar
ingredientes en Monitor] }
{ 10012118;;Display Instruct. in Monitor;Boolean;

DataClassification=ToBeClassified;
CaptionML=[ENU=Display Instruct.
in Monitor;
ESP=Mostrar Instruc.
en Monitor] }
{ 10012120;;Recipe Main Ingredient;Code10 ;TableRelation="Recipe
Grouping".Code WHERE (Type=CONST(Recipe Main Ingredients));
DataClassification=ToBeClassified;
CaptionML=[ENU=Recipe Main
Ingredient;
ESP=Ingrediente
Principal Receta] }
{ 10012121;;Recipe Style ;Code10 ;TableRelation="Recipe
Grouping".Code WHERE (Type=CONST(Recipe Styles));

DataClassification=ToBeClassified;
CaptionML=[ENU=Recipe Style;
ESP=Estilo Receta] }
{ 10012122;;Recipe Category ;Code10 ;TableRelation="Recipe
Grouping".Code WHERE (Type=CONST(Recipe Categories));

DataClassification=ToBeClassified;
CaptionML=[ENU=Recipe Category;
ESP=Tipo Receta] }
{ 10012123;;Available as
Dish ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Available as
Dish;
ESP=Disponible como
Plato] }
{ 10012124;;UOM Pop-up on POS ;Boolean ;OnValidate=VAR

ItemUnitOfMeasure@1100409000 : Record 5404;

ItemUnitOfMeasure2@1100409001 : Record 5404;

FirstSortOrderNo@1100409002 : Integer;

LastSortOrderNo@1100409003 : Integer;
BEGIN
//LS -
IF "UOM Pop-up on
POS" THEN BEGIN

ItemUnitOfMeasure.RESET;

ItemUnitOfMeasure.SETCURRENTKEY("Item No.","Qty. per Unit of Measure");

ItemUnitOfMeasure.SETRANGE("Item No.","No.");

ItemUnitOfMeasure.SETFILTER(Order,'0');
IF
ItemUnitOfMeasure.FINDFIRST THEN BEGIN

FirstSortOrderNo := 0;
LastSortOrderNo
:= 0;

ItemUnitOfMeasure2.RESET;

ItemUnitOfMeasure2.SETRANGE("Item No.","No.");
IF
ItemUnitOfMeasure2.FINDSET THEN REPEAT
IF
(FirstSortOrderNo = 0) AND (ItemUnitOfMeasure2.Order > 0) THEN
FirstSortOrderNo := ItemUnitOfMeasure2.Order;
IF
ItemUnitOfMeasure2.Order > LastSortOrderNo THEN

LastSortOrderNo := ItemUnitOfMeasure2.Order;
UNTIL
ItemUnitOfMeasure2.NEXT = 0;
IF
ItemUnitOfMeasure2.GET("No.","Sales Unit of Measure") THEN
IF
ItemUnitOfMeasure2.Order = 0 THEN BEGIN
IF
FirstSortOrderNo > 2 THEN

ItemUnitOfMeasure2.Order := ROUND(FirstSortOrderNo / 2,1)


ELSE BEGIN

LastSortOrderNo := LastSortOrderNo + 100;

ItemUnitOfMeasure2.Order := LastSortOrderNo;
END;

ItemUnitOfMeasure2.MODIFY(TRUE);
END;

ItemUnitOfMeasure.RESET;

ItemUnitOfMeasure.SETCURRENTKEY("Item No.","Qty. per Unit of Measure");

ItemUnitOfMeasure.SETRANGE("Item No.","No.");

ItemUnitOfMeasure.SETFILTER(Order,'0');
IF
ItemUnitOfMeasure.FINDSET THEN REPEAT

LastSortOrderNo := LastSortOrderNo + 100;

ItemUnitOfMeasure.Order := LastSortOrderNo;

ItemUnitOfMeasure.MODIFY(TRUE);
UNTIL
ItemUnitOfMeasure.NEXT = 0;
END;
END;
//LS +
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=UOM Pop-up on
POS;
ESP=Vent. Emgts. UM
en TPV] }
{ 10012201;;Replenishment Calculation Type;Option;

DataClassification=ToBeClassified;
CaptionML=[ENU=Replenishment
Calculation Type;
ESP=Tipo C�lculo
Reaprovisionamiento];
OptionCaptionML=[ENU=Automatic -
From Data Profile,Average Usage,Manual Estimate,Stock Levels,Like for Like,Demand
Plan;
ESP=Autom�tico
- De Perfil Datos,Uso Medio,Estimaci�n Manual,Niveles Existencias,Lote por
Lote,Plan Demanda];
OptionString=Automatic - From
Data Profile,Average Usage,Manual Estimate,Stock Levels,Like for Like,Demand Plan }
{ 10012202;;Manual Estimated Daily Sale;Decimal;

DataClassification=ToBeClassified;
CaptionML=[ENU=Manual Estimated
Daily Sale;
ESP=Estimaci�n Manual
Venta Diaria];
DecimalPlaces=0:5 }
{ 10012203;;Store Stock Cover Reqd (Days);Decimal;

DataClassification=ToBeClassified;
CaptionML=[ENU=Store Stock Cover
Reqd (Days);
ESP=Cobertura
Requerida Stock Tienda (D�as)];
DecimalPlaces=0:2 }
{ 10012204;;Wareh Stock Cover Reqd (Days);Decimal;

DataClassification=ToBeClassified;
CaptionML=[ENU=Wareh Stock Cover
Reqd (Days);
ESP=Cobertura Stock
Almac�n Requerida (D�as)];
DecimalPlaces=0:2 }
{ 10012205;;Replenishment Sales Profile;Code10;TableRelation="Replen. Sales
Profile";

DataClassification=ToBeClassified;
CaptionML=[ENU=Replenishment
Sales Profile;
ESP=Perfil Reaprov.
Ventas] }
{ 10012208;;Replenishment Grade Code;Code10 ;TableRelation="Replen. Grade";

DataClassification=ToBeClassified;
CaptionML=[ENU=Replenishment
Grade Code;
ESP=C�d. Grado
Reaprov.] }
{ 10012209;;Exclude from Replenishment;Boolean;OnValidate=BEGIN

ToggleExcludeFromReplenishment("Exclude from Replenishment");


END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Exclude from
Replenishment;
ESP=Inactivo para
Reaprov.] }
{ 10012211;;Transfer
Multiple ;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Transfer
Multiple;
ESP=Transferencia
M�ltiple];
DecimalPlaces=0:5;
MinValue=0 }
{ 10012214;;Store Forward Sales Profile;Code10;TableRelation="Replen. Forw
Sales Profile";

DataClassification=ToBeClassified;
CaptionML=[ENU=Store Forward
Sales Profile;
ESP=Perfil Pron�stico
Ventas Tienda] }
{ 10012215;;Wareh. Forward Sales Profile;Code10;
TableRelation="Replen. Forw
Sales Profile";

DataClassification=ToBeClassified;
CaptionML=[ENU=Wareh. Forward
Sales Profile;
ESP=Perfil Pron�stico
Ventas Almac�n] }
{ 10012216;;Purch. Order
Delivery;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=Purch. Order
Delivery;
ESP=Entrega Orden
Compra];
OptionCaptionML=[ENU=To
Warehouse,To Store;
ESP=A Almac�n,A
Tienda];
OptionString=To Warehouse,To
Store }
{ 10012217;;Replenish as Item No.;Code20 ;TableRelation=Item;

DataClassification=ToBeClassified;
CaptionML=[ENU=Replenish as Item
No.;
ESP=Reaprov. como No.
Producto] }
{ 10012218;;Profit Goal
% ;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Profit Goal %;
ESP=Objetivo
Beneficio %] }
{ 10012219;;Buyer Group Filter ;Code10 ;FieldClass=FlowFilter;
TableRelation="Buyer Group";
CaptionML=[ENU=Buyer Group
Filter;
ESP=Filtro Grupo
Comprador] }
{ 10012220;;Replen. Data Profile;Code10 ;TableRelation="Replen. Data
Profile";
OnValidate=VAR
ReplenDataProfLinks@10012000 : Record 10012375;
BEGIN
//LS
IF "Replen. Data
Profile" <> xRec."Replen. Data Profile" THEN
IF xRec."Replen.
Data Profile" <> '' THEN BEGIN

ReplenDataProfLinks.RESET;

ReplenDataProfLinks.SETRANGE("Data Profile Code",xRec."Replen. Data Profile");

ReplenDataProfLinks.SETRANGE(Type,ReplenDataProfLinks.Type::Item);

ReplenDataProfLinks.SETRANGE(Key1,"No.");
IF
ReplenDataProfLinks.FINDFIRST THEN

ReplenDataProfLinks.DELETE;
END;
IF "Replen. Data
Profile" <> '' THEN BEGIN

CLEAR(ReplenDataProfLinks);

ReplenDataProfLinks."Data Profile Code" := Rec."Replen. Data Profile";

ReplenDataProfLinks.Type := ReplenDataProfLinks.Type::Item;

ReplenDataProfLinks.Key1 := "No.";
IF
ReplenDataProfLinks.INSERT THEN;
END;
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Replen. Data
Profile;
ESP=Perfil Datos
Reaprov.] }
{ 10012221;;Like for Like Replen. Method;Option;

DataClassification=ToBeClassified;
CaptionML=[ENU=Like for Like
Replen. Method;
ESP=M�todo Reaprov.
Like4Like];

OptionCaptionML=[ENU=" ,Transfer,PO to Store,PO w/XDock";

ESP=" ,Transfer,Ped.Compra a Tienda,Ped.Compra alm/Tr�n.Directo"];


OptionString=[ ,Transfer,PO to
Store,PO w/XDock] }
{ 10012222;;Like for Like Process Method;Option;

DataClassification=ToBeClassified;
CaptionML=[ENU=Like for Like
Process Method;
ESP=M�todo Proceso
Like4Like];
OptionCaptionML=[ENU=" ,Replen.
Job,Manual";
ESP=" ,Trab.
Reaprov.,Manual"];
OptionString=[ ,Replen.
Job,Manual] }
{ 10012223;;Replenish as Item No - Method;Option;

DataClassification=ToBeClassified;
CaptionML=[ENU=Replenish as Item
No - Method;
ESP=Reaprov. como No.
Prod. - M�todo];

OptionCaptionML=[ENU=Total,Substitute;

ESP=Total,Substituto];
OptionString=Total,Substitute }
{ 10012224;;Replen. Transfer Rule Code;Code10 ;TableRelation="Replen. Transfer
Rule Header";

DataClassification=ToBeClassified;
CaptionML=[ENU=Replen. Transfer
Rule Code;
ESP=C�d. Regla
Distribuci�n Reaprov.] }
{ 10012225;;Select Lowest Price
Vendor;Boolean;DataClassification=ToBeClassified;
CaptionML=[ENU=Select Lowest
Price Vendor;
ESP=Seleccionar
Proveedor con precio m�s bajo] }
{ 10012226;;Effective Inv. Sales
Order;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=Effective Inv.
Sales Order;
ESP=Pedido Ventas
Inv. Efectivo];

OptionCaptionML=[ENU=Include,Exclude,Coverage;

ESP=Incluir,Excluir,Cobertura];

OptionString=Include,Exclude,Coverage }
{ 10012227;;Effective Inv. Purchase Ord.;Option;

DataClassification=ToBeClassified;
CaptionML=[ENU=Effective Inv.
Purchase Ord.;
ESP=Pedido Compra
Inv. Efectivo];

OptionCaptionML=[ENU=Include,Exclude,Coverage;

ESP=Incluir,Excluir,Cobertura];
OptionString=Include,Exclude,Coverage }
{ 10012228;;Effective Inv. Transfer Inb.;Option;

DataClassification=ToBeClassified;
CaptionML=[ENU=Effective Inv.
Transfer Inb.;
ESP=Entrada. Transf.
Inv. Efectivo];

OptionCaptionML=[ENU=Include,Exclude,Coverage;

ESP=Incluir,Excluir,Cobertura];

OptionString=Include,Exclude,Coverage }
{ 10012229;;Effective Inv. Transfer Outb.;Option;

DataClassification=ToBeClassified;
CaptionML=[ENU=Effective Inv.
Transfer Outb.;
ESP=Salidas Transf.
Inv. Efectivo];

OptionCaptionML=[ENU=Include,Exclude,Coverage;

ESP=Incluir,Excluir,Cobertura];

OptionString=Include,Exclude,Coverage }
{ 10012230;;Replen Item Store Recs;Integer ;FieldClass=FlowField;
CalcFormula=Count("Replen. Item
Store Rec" WHERE (Item No.=FIELD(No.)));
CaptionML=[ENU=Item Store
Records;
ESP=Regs. Tienda
Producto] }
{ 10012231;;Replen Item Quantities;Integer ;FieldClass=FlowField;
CalcFormula=Count("Replen. Item
Quantity" WHERE (Item No.=FIELD(No.)));
CaptionML=[ENU=Item Quantities;
ESP=Cantidades Prod.]
}
{ 10012232;;Replen Sales Hist. Adj.;Integer ;FieldClass=FlowField;
CalcFormula=Count("Replen. Sales
Hist. Adj." WHERE (Item No.=FIELD(No.)));
CaptionML=[ENU=Sales History
Adjustments;
ESP=Ajustes Hist.
Ventas] }
{ 10012233;;Planned Sales Demand;Integer ;FieldClass=FlowField;
CalcFormula=Count("Replen.
Planned Sales Demand" WHERE (Item No.=FIELD(No.),

Status=CONST(Enabled)));
CaptionML=[ENU=Planned Sales
Demand;
ESP=Demanda Planeada
de Ventas] }
{ 10012234;;Planned Stock Demand;Integer ;FieldClass=FlowField;
CalcFormula=Count("Replen.
Planned Stock Demand" WHERE (Item No.=FIELD(No.)));
CaptionML=[ENU=Planned Stock
Demand;
ESP=Demanda Exis.
Planeada] }
{ 10012235;;Unavailable Stock ;Integer ;FieldClass=FlowField;
CalcFormula=Count("Replen.
Unavailable Stock" WHERE (Item No.=FIELD(No.)));
CaptionML=[ENU=Unavailable
Stock;
ESP=Existencias No
Disponibles] }
{ 10012236;;Out of Stock Days ;Integer ;FieldClass=FlowField;
CalcFormula=Count("Replen. Out
of Stock Log" WHERE (Item No.=FIELD(No.)));
CaptionML=[ENU=Out of Stock
Days;
ESP=D�as Sin Stock] }
{ 10012237;;Confidence Factor Code;Code10 ;TableRelation="Replen.
Confidence Factor";

DataClassification=ToBeClassified;
CaptionML=[ENU=Confidence Factor
Code;
ESP=C�digo Confianza
Factor] }
{ 10012600;;Fuel
Item ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Fuel Item;
ESP=Producto
Combustible] }
{ 10012700;;Options Exist ;Boolean ;FieldClass=FlowField;
CalcFormula=Exist("Item Option
Value" WHERE (No.=FIELD(No.)));
CaptionML=[ENU=Options Exist;
ESP=Existe Opci�n] }
{ 99000750;;Routing No. ;Code20 ;TableRelation="Routing Header";
OnValidate=BEGIN
IF "Routing No." <>
'' THEN

TESTFIELD(Type,Type::Inventory);

PlanningAssignment.RoutingReplace(Rec,xRec."Routing No.");

IF "Routing No." <>


xRec."Routing No." THEN

ItemCostMgt.UpdateUnitCost(Rec,'','',0,0,FALSE,FALSE,TRUE,FIELDNO("Routing No."));
END;

CaptionML=[ENU=Routing No.;
ESP=N� ruta] }
{ 99000751;;Production BOM No. ;Code20 ;TableRelation="Production BOM
Header";
OnValidate=VAR
MfgSetup@1000 :
Record 99000765;
ProdBOMHeader@1001 : Record 99000771;

ItemUnitOfMeasure@1003 : Record 5404;


BEGIN
IF "Production BOM
No." <> '' THEN

TESTFIELD(Type,Type::Inventory);

PlanningAssignment.BomReplace(Rec,xRec."Production BOM No.");

IF "Production BOM
No." <> xRec."Production BOM No." THEN

ItemCostMgt.UpdateUnitCost(Rec,'','',0,0,FALSE,FALSE,TRUE,FIELDNO("Production BOM
No."));

IF ("Production BOM
No." <> '') AND ("Production BOM No." <> xRec."Production BOM No.") THEN BEGIN

ProdBOMHeader.GET("Production BOM No.");

ItemUnitOfMeasure.GET("No.",ProdBOMHeader."Unit of Measure Code");


IF
ProdBOMHeader.Status = ProdBOMHeader.Status::Certified THEN BEGIN
MfgSetup.GET;
IF
MfgSetup."Dynamic Low-Level Code" THEN

CODEUNIT.RUN(CODEUNIT::"Calculate Low-Level Code",Rec);


END;
END;
END;

CaptionML=[ENU=Production BOM
No.;
ESP=N� L.M.
producci�n] }
{ 99000752;;Single-Level Material Cost;Decimal;CaptionML=[ENU=Single-Level
Material Cost;
ESP=Coste material a
un nivel];
Editable=No;
AutoFormatType=2 }
{ 99000753;;Single-Level Capacity Cost;Decimal;CaptionML=[ENU=Single-Level
Capacity Cost;
ESP=Coste capacidad a
un nivel];
Editable=No;
AutoFormatType=2 }
{ 99000754;;Single-Level Subcontrd. Cost;Decimal;
CaptionML=[ENU=Single-Level
Subcontrd. Cost;
ESP=Coste subcontrat.
a un nivel];
Editable=No;
AutoFormatType=2 }
{ 99000755;;Single-Level Cap. Ovhd Cost;Decimal;
CaptionML=[ENU=Single-Level Cap.
Ovhd Cost;
ESP=Costes gen. cap.
a un nivel];
Editable=No;
AutoFormatType=2 }
{ 99000756;;Single-Level Mfg. Ovhd Cost;Decimal;
CaptionML=[ENU=Single-Level Mfg.
Ovhd Cost;
ESP=Coste gen. fab. a
un nivel];
Editable=No;
AutoFormatType=2 }
{ 99000757;;Overhead Rate ;Decimal ;OnValidate=BEGIN
IF "Overhead Rate"
<> 0 THEN

TESTFIELD(Type,Type::Inventory);
END;

AccessByPermission=TableData
5405=R;
CaptionML=[ENU=Overhead Rate;
ESP=Tasa costes
generales];
AutoFormatType=2 }
{ 99000758;;Rolled-up Subcontracted Cost;Decimal;
AccessByPermission=TableData
5405=R;
CaptionML=[ENU=Rolled-up
Subcontracted Cost;
ESP=Coste
subcontratado distrib.];
Editable=No;
AutoFormatType=2 }
{ 99000759;;Rolled-up Mfg. Ovhd Cost;Decimal ;CaptionML=[ENU=Rolled-up Mfg.
Ovhd Cost;
ESP=Costes gen. fabr.
distrib.];
Editable=No;
AutoFormatType=2 }
{ 99000760;;Rolled-up Cap. Overhead Cost;Decimal;
CaptionML=[ENU=Rolled-up Cap.
Overhead Cost;
ESP=Costes gen. de
cap. distrib.];
Editable=No;
AutoFormatType=2 }
{ 99000761;;Planning Issues (Qty.);Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Planning
Component"."Expected Quantity (Base)" WHERE (Item No.=FIELD(No.),

Due Date=FIELD(Date Filter),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),


Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Planning Line Origin=CONST(" ")));


CaptionML=[ENU=Planning Issues
(Qty.);
ESP=Planif. resul.
(Cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 99000762;;Planning Receipt (Qty.);Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Requisition
Line"."Quantity (Base)" WHERE (Type=CONST(Item),

No.=FIELD(No.),

Due Date=FIELD(Date Filter),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter)));


CaptionML=[ENU=Planning Receipt
(Qty.);
ESP=Planif. recep.
(Cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 99000765;;Planned Order Receipt (Qty.);Decimal;
FieldClass=FlowField;
CalcFormula=Sum("Prod. Order
Line"."Remaining Qty. (Base)" WHERE (Status=CONST(Planned),

Item No.=FIELD(No.),

Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Due Date=FIELD(Date Filter)));


CaptionML=[ENU=Planned Order
Receipt (Qty.);
ESP=Recep. (cant)
O.P. planif.];
DecimalPlaces=0:5;
Editable=No }
{ 99000766;;FP Order Receipt (Qty.);Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Prod. Order
Line"."Remaining Qty. (Base)" WHERE (Status=CONST(Firm Planned),

Item No.=FIELD(No.),
Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Due Date=FIELD(Date Filter)));


CaptionML=[ENU=FP Order Receipt
(Qty.);
ESP=Recep. (cant.)
O.P. p.f.];
DecimalPlaces=0:5;
Editable=No }
{ 99000767;;Rel. Order Receipt (Qty.);Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Prod. Order
Line"."Remaining Qty. (Base)" WHERE (Status=CONST(Released),

Item No.=FIELD(No.),

Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Due Date=FIELD(Date Filter)));


CaptionML=[ENU=Rel. Order
Receipt (Qty.);
ESP=Recep. (cant.)
O.P. lanz.];
DecimalPlaces=0:5;
Editable=No }
{ 99000768;;Planning Release (Qty.);Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Requisition
Line"."Quantity (Base)" WHERE (Type=CONST(Item),

No.=FIELD(No.),

Starting Date=FIELD(Date Filter),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter)));


CaptionML=[ENU=Planning Release
(Qty.);
ESP=Planif. lanzam.
(Cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 99000769;;Planned Order Release (Qty.);Decimal;
FieldClass=FlowField;
CalcFormula=Sum("Prod. Order
Line"."Remaining Qty. (Base)" WHERE (Status=CONST(Planned),

Item No.=FIELD(No.),

Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Starting Date=FIELD(Date Filter)));


CaptionML=[ENU=Planned Order
Release (Qty.);
ESP=Lanz. (cant.)
O.P. planif.];
DecimalPlaces=0:5;
Editable=No }
{ 99000770;;Purch. Req. Receipt (Qty.);Decimal;FieldClass=FlowField;
CalcFormula=Sum("Requisition
Line"."Quantity (Base)" WHERE (Type=CONST(Item),

No.=FIELD(No.),

Variant Code=FIELD(Variant Filter),

Location Code=FIELD(Location Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Due Date=FIELD(Date Filter),

Planning Line Origin=CONST(" ")));


CaptionML=[ENU=Purch. Req.
Receipt (Qty.);
ESP=Hoja demanda
recib. (cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 99000771;No;Purch. Req. Release (Qty.);Decimal;
FieldClass=FlowField;
CalcFormula=Sum("Requisition
Line"."Quantity (Base)" WHERE (Type=CONST(Item),

No.=FIELD(No.),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Order Date=FIELD(Date Filter)));


CaptionML=[ENU=Purch. Req.
Release (Qty.);
ESP=Hoja demanda
lanzada (cant.)];
DecimalPlaces=0:5;
Editable=No }
{ 99000773;;Order Tracking Policy;Option ;OnValidate=VAR
ReservEntry@1000 :
Record 337;

ActionMessageEntry@1001 : Record 99000849;

TempReservationEntry@1002 : TEMPORARY Record 337;


BEGIN
IF "Order Tracking
Policy" <> "Order Tracking Policy"::None THEN

TESTFIELD(Type,Type::Inventory);
IF xRec."Order
Tracking Policy" = "Order Tracking Policy" THEN
EXIT;
IF "Order Tracking
Policy" > xRec."Order Tracking Policy" THEN BEGIN

MESSAGE(Text99000000 +
Text99000001,

SELECTSTR("Order Tracking Policy",Text99000002));


END ELSE BEGIN

ActionMessageEntry.SETCURRENTKEY("Reservation Entry");

ReservEntry.SETCURRENTKEY("Item No.","Variant Code","Location Code","Reservation


Status");

ReservEntry.SETRANGE("Item No.","No.");

ReservEntry.SETRANGE("Reservation Status",ReservEntry."Reservation
Status"::Tracking,ReservEntry."Reservation Status"::Surplus);
IF
ReservEntry.FIND('-') THEN
REPEAT

ActionMessageEntry.SETRANGE("Reservation Entry",ReservEntry."Entry No.");

ActionMessageEntry.DELETEALL;
IF "Order
Tracking Policy" = "Order Tracking Policy"::None THEN
IF
ReservEntry.TrackingExists THEN BEGIN

TempReservationEntry := ReservEntry;

TempReservationEntry."Reservation Status" := TempReservationEntry."Reservation


Status"::Surplus;

TempReservationEntry.INSERT;
END ELSE
ReservEntry.DELETE;
UNTIL
ReservEntry.NEXT = 0;

IF
TempReservationEntry.FIND('-') THEN
REPEAT

ReservEntry := TempReservationEntry;

ReservEntry.MODIFY;
UNTIL
TempReservationEntry.NEXT = 0;
END;
END;

CaptionML=[ENU=Order Tracking
Policy;
ESP=Directiva seguim.
ped.];

OptionCaptionML=[ENU=None,Tracking Only,Tracking & Action Msg.;

ESP=Ninguna,Seguimiento,Seguim. y mens. acci�n];


OptionString=None,Tracking
Only,Tracking & Action Msg. }
{ 99000774;;Prod. Forecast Quantity (Base);Decimal;
FieldClass=FlowField;
CalcFormula=Sum("Production
Forecast Entry"."Forecast Quantity (Base)" WHERE (Item No.=FIELD(No.),

Production Forecast Name=FIELD(Production Forecast Name),

Forecast Date=FIELD(Date Filter),

Location Code=FIELD(Location Filter),

Component Forecast=FIELD(Component Forecast)));


CaptionML=[ENU=Prod. Forecast
Quantity (Base);
ESP=Cant. prev.
producci�n (base)];
DecimalPlaces=0:5 }
{ 99000775;;Production Forecast Name;Code10 ;FieldClass=FlowFilter;
TableRelation="Production
Forecast Name";
CaptionML=[ENU=Production
Forecast Name;
ESP=Nombre previsi�n
producci�n] }
{ 99000776;;Component Forecast ;Boolean ;FieldClass=FlowFilter;
CaptionML=[ENU=Component
Forecast;
ESP=Prev.
componentes] }
{ 99000777;;Qty. on Prod. Order;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Prod. Order
Line"."Remaining Qty. (Base)" WHERE (Status=FILTER(Planned..Released),
Item No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Due Date=FIELD(Date Filter)));


CaptionML=[ENU=Qty. on Prod.
Order;
ESP=Cant. en orden
producc.];
DecimalPlaces=0:5;
Editable=No }
{ 99000778;;Qty. on Component Lines;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Prod. Order
Component"."Remaining Qty. (Base)" WHERE (Status=FILTER(Planned..Released),

Item No.=FIELD(No.),

Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Filter),

Shortcut Dimension 2 Code=FIELD(Global Dimension 2 Filter),

Location Code=FIELD(Location Filter),

Variant Code=FIELD(Variant Filter),

Due Date=FIELD(Date Filter)));


CaptionML=[ENU=Qty. on Component
Lines;
ESP=Cant. l�nea
componentes];
DecimalPlaces=0:5;
Editable=No }
{ 99000875;;Critical ;Boolean ;CaptionML=[ENU=Critical;
ESP=Cr�tico] }
{ 99001463;;Item Family Code ;Code10 ;TableRelation="Item
Family".Code;
OnValidate=VAR
Item3@1000 : Record
27;
ItemFamily@1001 :
Record 99001564;
BEGIN
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Item Family Code;
ESP=C�d. Familia
producto] }
{ 99001470;;Unit Price Including VAT;Decimal ;OnValidate=VAR

BackOfficeSetup@1000 : Record 10000700;


Store@1001 : Record
99001470;
BEGIN
//LS
IF NOT "Price
Includes VAT" THEN BEGIN
IF NOT
VATPostingSetup.GET("VAT Bus. Posting Gr. (Price)","VAT Prod. Posting Group") THEN

VATPostingSetup.INIT;
CASE
VATPostingSetup."VAT Calculation Type" OF

VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT":

VATPostingSetup."VAT %" := 0;

VATPostingSetup."VAT Calculation Type"::"Sales Tax":


ERROR(

Text99001507,

FIELDCAPTION("Unit Price Including VAT"),

VATPostingSetup.FIELDCAPTION("VAT Calculation Type"),

VATPostingSetup."VAT Calculation Type");


END;
GetGLSetup;
"Unit Price" :=
ROUND("Unit Price Including VAT" / (1 + (VATPostingSetup."VAT %" / 100)),
GLSetup."Unit-
Amount Rounding Precision");
END ELSE
"Unit Price" :=
"Unit Price Including VAT";

VALIDATE("Price/Profit Calculation");
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Unit Price
Including VAT;
ESP=Precio Unitario
IVA Incl.];
Description=LS;
Editable=Yes;
AutoFormatType=2 }
{ 99001471;;POS Cost
Calculation;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=POS Cost
Calculation;
ESP=C�lculo coste
TPV];
OptionCaptionML=[ENU=Item
Based,Product Group Based,Item Cat. Based;
ESP=Basado en
producto,Basado en grupo producto,Basado en Categor�a Producto];
OptionString=Item Based,Product
Group Based,Item Cat. Based }
{ 99001479;;No Stock
Posting ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=No Stock Posting;
ESP=Stock No
Registrado] }
{ 99001480;;Zero Price
Valid ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Zero Price Valid;
ESP=Admitir Cero como
precio] }
{ 99001483;;Qty. Becomes
Negative;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Qty. Becomes
Negative;
ESP=Cantidad se hace
negativa] }
{ 99001484;;No Discount Allowed;Boolean ;OnValidate=VAR

PeriodicDiscount@1100409000 : Record 99001453;

OfferCode@1200070001 : Code[20];

OfferType@1200070000 : 'Multibuy,Mix&Match,Disc. Offer';


BEGIN
//LS
IF "No Discount
Allowed" THEN BEGIN
IF
FindActiveOffer(OfferCode,OfferType) > 0 THEN

ERROR(Text99001513,Rec.FIELDCAPTION("No Discount
Allowed"),"No.",FORMAT(OfferType),OfferCode);

InformationSubcode.SETCURRENTKEY("Trigger Function","Trigger Code");

InformationSubcode.SETRANGE("Trigger Function",InformationSubcode."Trigger
Function"::Item);

InformationSubcode.SETRANGE("Trigger Code","No.");

InformationSubcode.SETRANGE("Price Type",InformationSubcode."Price Type"::Percent);


IF
InformationSubcode.FIND('-') THEN

ERROR(Text99001514,FIELDCAPTION("No Discount
Allowed"),"No.",InformationSubcode.TABLECAPTION,

InformationSubcode.Code,InformationSubcode.Subcode);
END;
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=No Discount
Allowed;
ESP=Dto. No
Permitido] }
{ 99001487;;Keying in
Price ;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=Keying in Price;
ESP=Insertar precios
manualmente];
OptionCaptionML=[ENU=Not
Mandatory,Must Key in New Price,Must Key in Higher/Equal Price,Must Key in
Lower/Equal Price,Must not Key in Price;
ESP=No
obligatorio,Introducir cuando nuevo precio,Introducir cuando precio
Mayor/Igual,Introducir cuando precio Inferior/Igual,No introducir];
OptionString=Not Mandatory,Must
Key in New Price,Must Key in Higher/Equal Price,Must Key in Lower/Equal Price,Must
not Key in Price }
{ 99001490;;Scale Item ;Boolean ;OnValidate=VAR
UOM@1000 : Record
204;
BEGIN
//LS
IF "Scale Item"
THEN BEGIN

UOM.SETRANGE("Weight Unit Of Measure",TRUE);


IF UOM.FIND('-')
THEN
IF "Sales Unit
of Measure" = '' THEN
"Sales Unit
of Measure" := UOM.Code
ELSE
IF "Sales
Unit of Measure" <> UOM.Code THEN

ERROR(STRSUBSTNO(Text99001502,FIELDCAPTION("Sales Unit of Measure")

,UOM.FIELDCAPTION(UOM."Weight Unit Of Measure")

,UOM.TABLECAPTION));
END;
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Scale Item;
ESP=Producto
pesado] }
{ 99001491;;Keying in
Quantity ;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=Keying in
Quantity;
ESP=Insertar
cantidades manualmente];
OptionCaptionML=[ENU=Not
Mandatory,Must Key in Quantity,Must not Key in Quantity;
ESP=No
obligatorio,Introducir cantidad,No introducir cantidad];
OptionString=Not Mandatory,Must
Key in Quantity,Must not Key in Quantity }
{ 99001492;;Skip Compression When Scanned;Boolean;

DataClassification=ToBeClassified;
CaptionML=[ENU=Skip Compression
When Scanned;
ESP=Omitir Compresi�n
al Escanear] }
{ 99001493;;Skip Compression When Printed;Boolean;

DataClassification=ToBeClassified;
CaptionML=[ENU=Skip Compression
When Printed;
ESP=Omitir Compresi�n
en Impresi�n] }
{ 99001501;No;xTime Filter ;Time ;FieldClass=FlowFilter;
CaptionML=[ENU=xTime Filter;
ESP=Filtro Hora] }
{ 99001502;;POS Filter ;Code10 ;FieldClass=FlowFilter;
TableRelation="POS
Terminal".No.;
CaptionML=[ENU=POS Filter;
ESP=Filtro TPV] }
{ 99001503;;Staff Filter ;Code20 ;FieldClass=FlowFilter;
TableRelation=Staff;
CaptionML=[ENU=Staff Filter;
ESP=Filtro
Empleado] }
{ 99001512;;Qty. Sold (POS) ;Decimal ;FieldClass=FlowField;
CalcFormula=-Sum("Trans. Sales
Entry".Quantity WHERE (Item No.=FIELD(No.),

Date=FIELD(Date Filter),

Store No.=FIELD(Store Filter)));


CaptionML=[ENU=Qty. Sold (POS);
ESP=Cantidad Vendida
(TPV)];
DecimalPlaces=0:2;
Editable=No }
{ 99001513;;Sales Amount (POS) ;Decimal ;FieldClass=FlowField;
CalcFormula=-Sum("Trans. Sales
Entry"."Net Amount" WHERE (Item No.=FIELD(No.),

Date=FIELD(Date Filter),

Store No.=FIELD(Store Filter)));


CaptionML=[ENU=Sales Amount
(POS);
ESP=Valor venta
(TPV)];
DecimalPlaces=2:2;
Editable=No }
{ 99001514;;Disc. Amount (POS) ;Decimal ;FieldClass=FlowField;
CalcFormula=-Sum("Trans. Sales
Entry"."Discount Amount" WHERE (Item No.=FIELD(No.),

Date=FIELD(Date Filter),

Store No.=FIELD(Store Filter)));


CaptionML=[ENU=Disc. Amount
(POS);
ESP=Valor descuento
(TPV)];
DecimalPlaces=2:2;
Editable=No }
{ 99001515;;Cost Amount (POS) ;Decimal ;FieldClass=FlowField;
CalcFormula=-Sum("Trans. Sales
Entry"."Cost Amount" WHERE (Item No.=FIELD(No.),

Date=FIELD(Date Filter),

Store No.=FIELD(Store Filter)));


CaptionML=[ENU=Cost Amount
(POS);
ESP=Valor coste
(TPV)];
DecimalPlaces=2:2;
Editable=No }
{ 99001516;;VAT Amount (POS) ;Decimal ;FieldClass=FlowField;
CalcFormula=-Sum("Trans. Sales
Entry"."VAT Amount" WHERE (Item No.=FIELD(No.),

Date=FIELD(Date Filter),

Store No.=FIELD(Store Filter)));


CaptionML=[ENU=VAT Amount (POS);
ESP=Valor IVA
(TPV)] }
{ 99001523;;Barcode Mask ;Code22 ;OnValidate=VAR
BarcodeMgt@1001 :
Codeunit 99001450;
BEGIN
//LS
IF "Barcode Mask"
<> '' THEN

BarcodeMgt.CheckItemMask("Barcode Mask",Rec);
END;

OnLookup=VAR
BarcodeMask@1000 :
Record 99001459;
BEGIN
//LS
BarcodeMask.RESET;
IF
PAGE.RUNMODAL(PAGE::"Barcode Mask List",BarcodeMask) = ACTION::LookupOK THEN
VALIDATE("Barcode
Mask",BarcodeMask.Mask);
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Barcode Mask;
ESP=M�scara C�d.
barras] }
{ 99001524;;Use EAN Standard
Barc.;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Use EAN Standard
Barc.;
ESP=Usar C�d. barras
standard EAN] }
{ 99001540;;Qty. per Base Comp. Unit;Decimal ;OnValidate=BEGIN
//LS
VALIDATE("Comp.
Price Incl. VAT");
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Qty. per Base
Comp. Unit;
ESP=Ctdad. por unidad
comparaci�n sobre base] }
{ 99001541;;Base Comp. Unit Code;Code10 ;TableRelation="Comparison Unit
of Measure".Code;
OnValidate=BEGIN
//LS
VALIDATE("Comp.
Price Incl. VAT");
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Base Comp. Unit
Code;
ESP=C�d. unidad
comparaci�n sobre base] }
{ 99001542;;Comparison Unit Code;Code10 ;TableRelation="Conversion
Value"."Comparison Unit Code" WHERE (Base Unit Code=FIELD(Base Comp. Unit Code));
OnValidate=BEGIN
//LS
VALIDATE("Comp.
Price Incl. VAT");
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Comparison Unit
Code;
ESP=C�d. unidad
comparaci�n] }
{ 99001543;;Comp. Price Incl. VAT;Decimal ;OnValidate=VAR

ComparisonUnitFactor@1000 : Record 99001529;


BEGIN
//LS
IF "Qty. per Base
Comp. Unit" <> 0 THEN BEGIN
IF
ComparisonUnitFactor.GET("Base Comp. Unit Code","Comparison Unit Code") THEN
IF
ComparisonUnitFactor."Conversion Factor" <> 0 THEN
"Comp. Price
Incl. VAT" :=
ROUND(
"Unit
Price Including VAT" /

(ComparisonUnitFactor."Conversion Factor" * "Qty. per Base Comp. Unit"))


ELSE
"Comp. Price
Incl. VAT" := 0
ELSE
"Comp. Price
Incl. VAT" := 0;
END ELSE
"Comp. Price
Incl. VAT" := 0;
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Comp. Price Incl.
VAT;
ESP=Precio comparado
IVA incl.];
Editable=No }
{ 99001544;;Explode BOM in Statem. Posting;Boolean;

DataClassification=ToBeClassified;
CaptionML=[ENU=Explode BOM in
Statem. Posting;
ESP=Expandir lista de
materiales en extracto] }
{ 99001553;;Disable Dispense
Printing;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Disable Dispense
Printing;
ESP=Desactivar impr.
reparto] }
{ 99001554;;Dispense Printer Group;Code10 ;TableRelation="POS Dispense
Printer Groups".ID;

DataClassification=ToBeClassified;
CaptionML=[ENU=Dispense Printer
Group;
ESP=Grupo impresoras
TPV] }
{ 99001560;;Print Variants Shelf Labels;Boolean;

DataClassification=ToBeClassified;
CaptionML=[ENU=Print Variants
Shelf Labels;
ESP=Impr. etiquetas
estanter�a de variantes] }
{ 99008500;;Common Item No. ;Code20 ;OnValidate=VAR
lItem@1100225002 :
Record 27;

lItemVariant@1100225001 : Record 5401;


lBOUtils@1100225000
: Codeunit 99001452;
BEGIN
//LS
IF
(lBOUtils.IsFranchisePermitted) AND ("Common Item No." <> '') THEN BEGIN

lItemVariant.RESET;

lItemVariant.SETRANGE("Item No.","No.");
IF
lItemVariant.FIND('-') THEN

ERROR(STRSUBSTNO(Text10014600_03));
lItem.RESET;

lItem.SETCURRENTKEY(lItem."Common Item No.");

lItem.SETRANGE("Common Item No.","Common Item No.");

lItem.SETFILTER("No.",'<>%1',"No.");
IF
lItem.FIND('-') THEN

ERROR(STRSUBSTNO(Text10014600_01,lItem."No."));

lItemVariant.RESET;

lItemVariant.SETCURRENTKEY("Common Item No.");

lItemVariant.SETRANGE("Common Item No.","Common Item No.");

lItemVariant.SETFILTER("Item No.",'<>%1',"No.");
IF
lItemVariant.FIND('-') THEN

ERROR(STRSUBSTNO(Text10014600_02,lItemVariant."Item No.",lItemVariant.Code));
END;
END;

CaptionML=[ENU=Common Item No.;


ESP=N� producto
com�n] }
{ 99008970;;xWarranty Period ;DateFormula ;OnValidate=VAR
lText001@1100409000
: TextConst 'ENU=%1 %2 Invalid.';
BEGIN
//LS
{
IF
CALCDATE("Warranty Period",TODAY) < TODAY THEN BEGIN

MESSAGE(lText001,FIELDCAPTION("Warranty Period"),"Warranty Period");


"Warranty Period"
:= xRec."Warranty Period";
END;
}
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Warranty Period;
ESP=Periodo
Garant�a];
Description=LS }
{ 99008971;;Tare
Weight ;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Tare Weight;
ESP=Tara];
DecimalPlaces=0:5;
MinValue=0;
Description=NAV-6264 }
{ 99009500;;Lifecycle Curve Code;Code20 ;TableRelation="Lifecycle Curve";
OnValidate=VAR

LifecycleCurve@10014500 : Record 10012379;


BEGIN
//LS-8785 New
IF
LifecycleCurve.GET("Lifecycle Curve Code") THEN
IF
LifecycleCurve."No. of Periods" > 0 THEN BEGIN
IF
LifecycleCurve."Period Type" = LifecycleCurve."Period Type"::Day THEN

EVALUATE("Lifecycle Length",'<' + FORMAT(LifecycleCurve."No. of Periods") + 'D>')


ELSE
IF
LifecycleCurve."Period Type" = LifecycleCurve."Period Type"::Week THEN

EVALUATE("Lifecycle Length",'<' + FORMAT(LifecycleCurve."No. of Periods") + 'W>')


ELSE

EVALUATE("Lifecycle Length",'<' + FORMAT(LifecycleCurve."No. of Periods") + 'M>');

VALIDATE("Lifecycle Length");
END;
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Lifecycle Curve
Code;
ESP=C¢d. Curva Ciclo
Vida] }
}
KEYS
{
{ ;No. ;Clustered=Yes }
{ ;Search Description }
{ ;Inventory Posting Group }
{ ;Shelf No. }
{ ;Vendor No. }
{ ;Gen. Prod. Posting Group }
{ ;Low-Level Code }
{ ;Production BOM No. }
{ ;Routing No. }
{ ;Vendor Item No.,Vendor No. }
{ ;Common Item No. }
{ ;Service Item Group }
{ ;Cost is Adjusted,Allow Online Adjustment }
{ ;Description }
{ ;Base Unit of Measure }
{ ;Type }
{ ;Item Category Code }
{ ;Product Group Code }
{ ;Item Category Code,Product Group Code }
{ ;Item Family Code }
{ ;Season Code }
{ ;Lifecycle Starting Date,Lifecycle Ending Date }
{ ;Division Code,Item Category Code,Product Group Code }
{ ;Date Created }
{ ;Vendor No.,Vendor Item No. }
{ ;ABC Sales }
{ ;ABC Profit }
{ No ;External Item No.,Extern. Size+Crust }
{ ;Phys Invt Counting Period Code,Next Counting Start Date }
}
FIELDGROUPS
{
{ 1 ;DropDown ;No.,Description,Base Unit of Measure,Unit Price }
{ 2 ;Brick ;No.,Description,Inventory,Unit Price,Base Unit of
Measure,Description 2,Picture }
}
CODE
{
VAR
Text000@1000 : TextConst 'ENU=You cannot delete %1 %2 because there is at
least one outstanding Purchase %3 that includes this item.;ESP=No puede borrar %1
%2 porque hay al menos una compra pendiente %3 que incluye este producto.';
CannotDeleteItemIfSalesDocExistErr@1001 : TextConst '@@@=1: Type, 2 Item No.
and 3 : Type of document Order,Invoice;ENU=You cannot delete %1 %2 because there is
at least one outstanding Sales %3 that includes this item.;ESP=No puede borrar %1
%2 porque hay al menos una venta pendiente %3 que incluye este producto.';
CannotDeleteItemIfSalesDocExistInvoicingErr@1041 : TextConst '@@@=1: Type, 2:
Item No., 3: Description of document, 4: Document number;ENU=You cannot delete %1
%2 because at least one sales document (%3 %4) includes the item.;ESP=No puede
eliminar %1 %2 porque hay al menos un documento de ventas (%3 %4) que incluye este
producto.';
Text002@1002 : TextConst 'ENU=You cannot delete %1 %2 because there are one
or more outstanding production orders that include this item.;ESP=No se puede
eliminar el %1 %2 porque hay ordenes de producci�n pendientes para este producto.';
Text003@1057 : TextConst 'ENU=Do you want to change %1?;ESP=�Confirma que
desea cambiar %1?';
Text004@1064 : TextConst 'ENU=You cannot delete %1 %2 because there are one
or more certified Production BOM that include this item.;ESP=No puede eliminar %1
%2 porque una o m�s LM producci�n incluyen este producto.';
CannotDeleteItemIfProdBOMVersionExistsErr@1084 : TextConst '@@@=%1 -
Tablecaption, %2 - No.;ENU=You cannot delete %1 %2 because there are one or more
certified production BOM version that include this item.;ESP=No puede eliminar %1
%2 porque una o m�s versiones de la L.M. de producci�n certificada incluyen este
producto.';
Text006@1003 : TextConst 'ENU=Prices including VAT cannot be calculated when
%1 is %2.;ESP=No se pueden calcular precios IVA incluido cuando %1 es %2.';
Text007@1004 : TextConst 'ENU=You cannot change %1 because there are one or
more ledger entries for this item.;ESP=No se puede cambiar el producto %1 porque
tiene movimientos pendientes.';
Text008@1005 : TextConst 'ENU=You cannot change %1 because there is at least
one outstanding Purchase %2 that include this item.;ESP=No puede cambiar %1 porque
existe al menos un %2 compra pendiente que incluye este producto.';
Text014@1006 : TextConst 'ENU=You cannot delete %1 %2 because there are one
or more production order component lines that include this item with a remaining
quantity that is not 0.;ESP=No puede eliminar %1 %2 porque una o m�s l�ns. comp.
pedido producci�n que incluyen este producto tienen una cantidad pendiente que no
es 0.';
Text016@1008 : TextConst 'ENU=You cannot delete %1 %2 because there are one
or more outstanding transfer orders that include this item.;ESP=No puede borrar %1
%2 porque hay uno o m�s pedidos de transfer. pendientes que incluyen este
producto.';
Text017@1009 : TextConst 'ENU=You cannot delete %1 %2 because there is at
least one outstanding Service %3 that includes this item.;ESP=No puede borrar el %1
%2 porque hay al menos un documento de tipo %3 de servicio pendiente que incluyen
este producto.';
Text018@1010 : TextConst 'ENU=%1 must be %2 in %3 %4 when %5 is %6.;ESP=%1
debe ser %2 en %3 %4 cuando %5 es %6.';
Text019@1011 : TextConst 'ENU=You cannot change %1 because there are one or
more open ledger entries for this item.;ESP=No puede cambiar %1 porque hay uno o
m�s movs. pendientes para este producto.';
Text020@1012 : TextConst 'ENU="There may be orders and open ledger entries
for the item. ";ESP="El producto tiene pedidos o movimientos pendientes. "';
Text021@1013 : TextConst 'ENU=If you change %1 it may affect new orders and
entries.\\;ESP=Si cambia el %1 puede afectar a los pedidos y movimientos
nuevos.\\';
Text022@1014 : TextConst 'ENU=Do you want to change %1?;ESP=�Confirma que
desea cambiar %1?';
GLSetup@1053 : Record 98;
InvtSetup@1015 : Record 313;
Text023@1066 : TextConst 'ENU=You cannot delete %1 %2 because there is at
least one %3 that includes this item.;ESP=No puede eliminar %1 %2 porque hay al
menos un(a) %3 que incluye este producto.';
Text024@1072 : TextConst 'ENU=If you change %1 it may affect existing
production orders.\;ESP=Un cambio en %1 podr�a afectar a las �rdenes de producci�n
existentes.\';
Text025@1055 : TextConst 'ENU=%1 must be an integer because %2 %3 is set up
to use %4.;ESP=%1 debe ser un n�mero entero porque %2 %3 est� configurado para usar
%4.';
Text026@1077 : TextConst 'ENU=%1 cannot be changed because the %2 has work in
process (WIP). Changing the value may offset the WIP account.;ESP=%1 no se puede
modificar porque %2 tiene un trabajo en curso (WIP). El cambio de los valores
podr�a provocar un desfase en la cuenta WIP.';
Text027@1100225077 : TextConst '@@@=starts with "Rounding Precision";ENU=must
be greater than 0.;ESP=debe ser mayor que 0.';
Text028@1100225076 : TextConst 'ENU=You cannot perform this action because
entries for item %1 are unapplied in %2 by user %3.;ESP=No puede realizar esta
acci�n porque los movs. para el producto %1 no se han desliquidado en %2 por parte
del usuario %3.';
Text029@1100225075 : TextConst 'ENU=Exclude all Item Store Records
automatically?';
Text030@1100225074 : TextConst 'ENU=Remove Exclude from all Item Store
Records automatically?';
Text7380@1058 : TextConst '@@@=If you change the Phys Invt Counting Period
Code, the Next Counting Start Date and Next Counting End Date are calculated.\Do
you still want to change the Phys Invt Counting Period Code?;ENU=If you change the
%1, the %2 and %3 are calculated.\Do you still want to change the %1?;ESP=Si cambia
el %1, se calculan el %2 y el %3.\�Desea cambiar el %1?';
Text7381@1056 : TextConst 'ENU=Cancelled.;ESP=Cancelado.';
Text99000000@1017 : TextConst 'ENU=The change will not affect existing
entries.\;ESP=El cambio no afectar� movimientos existentes.\';
CommentLine@1018 : Record 97;
Text99000001@1019 : TextConst 'ENU=If you want to generate %1 for existing
entries, you must run a regenerative planning.;ESP=Si quiere generar %1 para mov.
existentes, debe ejecutar planificaci�n regenerativa.';
ItemVend@1020 : Record 99;
Text99000002@1021 : TextConst 'ENU=tracking,tracking and action
messages;ESP=seguimiento,seguim. y mensajes acci�n';
SalesPrice@1022 : Record 7002;
SalesLineDisc@1059 : Record 7004;
SalesPrepmtPct@1051 : Record 459;
PurchPrice@1060 : Record 7012;
PurchLineDisc@1061 : Record 7014;
PurchPrepmtPct@1076 : Record 460;
ItemTranslation@1023 : Record 30;
BOMComp@1024 : Record 90;
VATPostingSetup@1027 : Record 325;
ExtTextHeader@1028 : Record 279;
GenProdPostingGrp@1029 : Record 251;
ItemUnitOfMeasure@1030 : Record 5404;
ItemVariant@1031 : Record 5401;
ItemJnlLine@1007 : Record 83;
ProdOrderLine@1032 : Record 5406;
ProdOrderComp@1033 : Record 5407;
PlanningAssignment@1035 : Record 99000850;
SKU@1036 : Record 5700;
ItemTrackingCode@1037 : Record 6502;
ItemTrackingCode2@1038 : Record 6502;
ServInvLine@1039 : Record 5902;
ItemSub@1040 : Record 5715;
ItemCategory@1100225071 : Record 5722;
TransLine@1042 : Record 5741;
Vend@1016 : Record 23;
NonstockItem@1034 : Record 5718;
ProdBOMHeader@1062 : Record 99000771;
ProdBOMLine@1063 : Record 99000772;
ItemIdent@1065 : Record 7704;
RequisitionLine@1067 : Record 246;
ItemBudgetEntry@1075 : Record 7134;
ItemAnalysisViewEntry@1074 : Record 7154;
ItemAnalysisBudgViewEntry@1073 : Record 7156;
TroubleshSetup@1050 : Record 5945;
ServiceItem@1068 : Record 5940;
ServiceContractLine@1069 : Record 5964;
ServiceItemComponent@1070 : Record 5941;
ProductGrp@1100225073 : Record 5723;
Barcode@1100225072 : Record 99001451;
NoSeriesMgt@1043 : Codeunit 396;
MoveEntries@1044 : Codeunit 361;
DimMgt@1045 : Codeunit 408;
CatalogItemMgt@1046 : Codeunit 5703;
ItemCostMgt@1047 : Codeunit 5804;
ResSkillMgt@1071 : Codeunit 5931;
CalendarMgt@1054 : Codeunit 7600;
AttributeUtils_g@1100225078 : Codeunit 10000752;
LeadTimeMgt@1025 : Codeunit 5404;
ApprovalsMgmt@1085 : Codeunit 1535;
HasInvtSetup@1049 : Boolean;
GLSetupRead@1052 : Boolean;
CannotChangeFieldErr@1079 : TextConst '@@@="%1 = Field Caption, %2 = Item
Table Name, %3 = Item No., %4 = Table Name";ENU=You cannot change the %1 field on
%2 %3 because at least one %4 exists for this item.;ESP=No puede cambiar el campo
%1 en %2 %3 porque existe como m�nimo una %4 de este producto.';
BaseUnitOfMeasureQtyMustBeOneErr@1081 : TextConst '@@@="%1 Name of Unit of
measure (e.g. BOX, PCS, KG...), %2 Qty. of %1 per base unit of measure ";ENU=The
quantity per base unit of measure must be 1. %1 is set up with %2 per unit of
measure.\\You can change this setup in the Item Units of Measure window.;ESP=La
cantidad por unidad de medida base debe ser 1. %1 est� configurado con %2 por
unidad de medida.\\Puede cambiar esta configuraci�n en la ventana Unidades de
medida.';
OpenDocumentTrackingErr@1082 : TextConst 'ENU="You cannot change ""Item
Tracking Code"" because there is at least one open document that includes this item
with specified tracking: Source Type = %1, Document No. = %2.";ESP="No puede
cambiar la opci�n ""C�d. seguim. prod."" porque hay al menos un documento que
incluye este art�culo con el seguimiento especificado. Tipo de origen = %1, N.� de
documento = %2."';
RetailSetup@1100225019 : Record 10000700;
ItemPrice@1100225018 : Record 7002;
ItemControl@1100225017 : Codeunit 10000711;
BackOfficeSetup@1100225016 : Record 10000700;
DiscountOfferLine@1100225015 : Record 99001503;
InformationSubcode@1100225014 : Record 99001483;
PeriodicDiscount@1100225013 : Record 99001453;
PeriodicDiscountLines@1100225012 : Record 99001454;
Store@1100225011 : Record 99001470;
ShowItemErrorCheckMessage@1100225010 : Boolean;
ItemStatusLink@1100225009 : Record 10001404;
EventLink@1100225008 : Record 10001402;
CalcPriceInclVATNow@1100225007 : Boolean;
InfoComp@1100225006 : Record 79;
OpenDialog@1100225003 : Boolean;
Window@1100225002 : Dialog;
Text10000000@1100225054 : TextConst 'ENU=Are you sure?\Current Item Variant
Framework and Variants will be deleted.;ESP=�Est� seguro?\La Estructura Variantes
actual y sus Variantes se borrar�n.';
Text10000001@1100225053 : TextConst 'ENU=Variant Framework not
changed.;ESP=Estructura de Variantes no cambiada.';
Text99001500@1100225052 : TextConst 'ENU=The item is only used for %1 sales
on the POS terminals\;ESP=El producto s�lo se usa para ventas %1 en los TPVs\';
Text99001501@1100225051 : TextConst 'ENU=and has to be blocked at all
times.;ESP=y debe bloquearse en todas las ocasiones.';
Text99001502@1100225050 : TextConst 'ENU=The %1 must be the %2 from the %3
table;ESP=El(La) %1 debe ser el(la) %2 para la tabla %3';
Text99001503@1100225049 : TextConst 'ENU=The system has blocked the
item,\;ESP=El sistema ha bloqueado el producto,\';
Text99001504@1100225048 : TextConst 'ENU=because it will only be used for %1
sales on the POS terminals.;ESP=porque s�lo se usar� para %1 ventas en los
terminals TPV.';
Text99001505@1100225047 : TextConst 'ENU=The existing items in %1 %2 have %3
%4\while this %5 has %3 %6.\;ESP=Los productos existentes en %1 %2 tienen %3 %4\
mientras que este(a) %5 tiene %3 %6.\';
Text99001506@1100225046 : TextConst 'ENU=All items in the same %1 need to
have the same %3.;ESP=Todos los productos en el(la) mismo(a) %1 necesitan tener
el(la) mismo(a) %3.';
Text99001507@1100225045 : TextConst 'ENU=%1 cannot be calculated when %2 is
%3.;ESP=%1 no puede calcularse cuando %2 es %3.';
Text99001508@1100225044 : TextConst 'ENU=You cannot put the Item in a %1
since it has %2 enabled;ESP=No puede poner el Producto en un(a) %1 ya que tiene %2
activo(a)';
Text99001509@1100225043 : TextConst 'ENU=%1 %2 belongs to enabled %3 %4. It
cannot have a %5 at the same time.;ESP=%1 %2 pertenece a un(a) %3 %4 activo(a). No
puede tener un(a) %5 al mismo tiempo.';
Text99001510@1100225042 : TextConst 'ENU=The %1 is %2. Therefore stock
posting should generally be performed.\;ESP=EL(La) %1 es %2. Por tanto,
generalmente se deber�a registrar en existencias.\';
Text99001511@1100225041 : TextConst 'ENU=Are you sure you do not want to have
the sales for this %3 posted to stock?;ESP=�Est� seguro de que no desea tener las
ventas para este(a) %3 registradas en existencias?';
Text99001512@1100225040 : TextConst 'ENU=The %1 sales will be posted to
stock.;ESP=Las ventas de %1 se registrar�n en existencias.';
Text99001513@1100225039 : TextConst 'ENU=You cannot enable %1 for Item %2
since it is member of %3 %4.;ESP=No puede activar %1 para el Producto %2 ya que es
un miembro de %3 %4.';
Text99001514@1100225038 : TextConst 'ENU=You cannot enable %1 for Item %2
since it has a discount associated with %3 %4 %5;ESP=No puede activar %1 para el
Producto %2 ya que tiene un descuento asociado con %3 %4 %5';
Text99001515@1100225037 : TextConst 'ENU=You cannot use field %1 because the
%2 is already blocked.;ESP=No puede usar el campo %1 porque el %2 ya est�
bloqueado.';
Text99001516@1100225036 : TextConst 'ENU=%1 cannot be true when %2 is
%3.;ESP=%1 no puede ser S� cuando %2 es %3.';
Text99001517@1100225035 : TextConst 'ENU=You cannot block because this item
is a part of %1 %2.;ESP=No puede bloquear porque este producto es una parte de %1
%2.';
Text99001518@1100225034 : TextConst 'ENU=You cannot block because this item
is linked to %1 %2.;ESP=No puede bloquear porque este producto est� vinculado a %1
%2.';
Text99001519@1100225033 : TextConst 'ENU=You cannot delete because this item
is a part of %1 %2.;ESP=No puede borrar porque este producto es una parte de %1
%2.';
Text99001520@1100225032 : TextConst 'ENU=You cannot delete because this item
is linked to %1 %2.;ESP=No puede borrar porque este producto est� asociado a %1
%2.';
Text99001521@1100225031 : TextConst 'ENU=Press the Esc button to reset to the
old value.;ESP=Presione el Bot�n Esc para redefinir al valor antiguo.';
Text99001522@1100225030 : TextConst 'ENU=%1 %2 is a member of %3 %4. \All
items in the same %3 need to have the same %5.\;ESP=%1 %2 es un miembro de %3 %4. \
Todos los productos en el(la) mismo(a) %3 necesitan tener el(la) mismo(a) %5.\';
Text99001523@1100225029 : TextConst 'ENU=Do you want to change %5 for all %3
items?;ESP=�Desea cambiar %5 para todos los %3 productos?';
Text99001524@1100225028 : TextConst 'ENU=The value was not changed.;ESP=El
valor no ha cambiado.';
Text99001525@1100225027 : TextConst 'ENU=This %1 is used as %2 for %3
%4.;ESP=Este(a) %1 se usa como %2 para %3 %4.';
Text99001526@1100225026 : TextConst 'ENU=Size, Color and Style Groups were
not changed since Item %1 has Item Variants based on these groups.;ESP=Los Grupos
de Tama�o, Color y Estilo no se han cambiado ya que el Producto %1 tiene Variantes
basadas en estos grupos.';
Text99001527@1100225025 : TextConst 'ENU=This Change will affects Retail
Prices.\\\Do you want to update these as well?;ESP=Este Cambio afecta los Precios
Com. Minorista.\\\�Desea actualizarlos igualmente?';
Text99001528@1100225024 : TextConst 'ENU=An enabled Offer exists for this
Item.\Manual update could me necessary.;ESP=Existe una oferta activa para este
Producto.\Podr�a ser necesaria una actualizaci�n manual.';
Text99001529@1100225023 : TextConst 'ENU=Barcode %1 already exists. It is not
possible to create an Item with the same number as an existing barcode.;ESP=El C�d.
Barras %1 ya existe. No es posible crear un Producto con el mismo n�mero que un
c�d. barras existente.';
Text99001530@1100225022 : TextConst 'ENU=Item No. %1 - FAILED error
check!;ESP=No. Producto %1 - �FALL� en la verificaci�n errores!';
Text99001531@1100225021 : TextConst 'ENU=Please run Function -Basic Error
Check to see error messages.;ESP=Por favor ejecute la Funci�n -Verificaci�n B�sica
Errores para ver los mensajes de error.';
Text99001532@1100225020 : TextConst 'ENU=Item No. %1 - PASSED error
check!;ESP=No. Producto %1 - �PAS� en la verificaci�n errores!';
Text99001533@1100225005 : TextConst 'ENU=Definition of check codeunit missing
for item error check %1.;ESP=Definici�n de verificaci�n en falta en codeunit para
verificaci�n errores producto %1.';
Text99001534@1100225004 : TextConst 'ENU="%1 %2 and %3 = %4 has already been
linked to %5 = %6 %7.";ESP="%1 %2 y %3 = %4 ya ha sido vinculado a %5 = %6 %7."';
Text99001535@1100225001 : TextConst 'ENU=%1 and %2 must both be set;ESP=%1 y
%2 debe definirse';
Text99001450@1100225000 : TextConst 'ENU=Do you want to change the %1 for the
other items in the same %2?;ESP=�Desea cambiar el(la) %1 para los otros productos
en el(la) mismo(a) %2?';
Text10014600_01@1100225057 : TextConst 'ENU=Common Item No. exists in Item
record %1;ESP=Existe un No. Prod. Com�n en el registro Producto %1';
Text10014600_02@1100225056 : TextConst 'ENU=Common Item No. exists in Item
Variant record %1 %2;ESP=Existe No. Prod. Com�n en el regirstro de Variante
Producto %1 %2';
Text10014600_03@1100225055 : TextConst 'ENU=Items with Variant records should
have a blank Common Item No.;ESP=Los Productos con Registros de Variantes deben
tener un No. Prod. Com�n en blanco.';
UseDefaultUOMfromProdGr@1100225058 : TextConst 'ENU=Do you want to update %1
and %2 with default values from %3 %4?';
Text10012700_01@1100225060 : TextConst 'ENU="Item Tracking Code must be set
for library item with options. ";ESP="Debe declarar un C�d. Trazabilidad Prod. para
el producto librer�a con opciones. "';
Text10012700_02@1100225059 : TextConst 'ENU=You cannot delete because this
item exists in %1.;ESP=No puede borrar porque este producto existe en %1.';
SelectItemErr@1100225065 : TextConst 'ENU=You must select an existing
item.;ESP=Debe seleccionar un producto existente.';
CreateNewItemTxt@1100225064 : TextConst '@@@="%1 is the name to be used to
create the customer. ";ENU=Create a new item card for %1.;ESP=Cree una nueva ficha
de producto para %1.';
ItemNotRegisteredTxt@1100225063 : TextConst 'ENU=This item is not registered.
To continue, choose one of the following options:;ESP=Este producto no est�
registrado. Para continuar, elija una de las opciones siguientes:';
SelectItemTxt@1100225062 : TextConst 'ENU=Select an existing
item.;ESP=Seleccione un producto existente.';
UnitOfMeasureNotExistErr@1100225061 : TextConst '@@@="%1 = Code of Unit of
measure";ENU=The Unit of Measure with Code %1 does not exist.;ESP=No existe la
unidad de medida con el c�digo %1.';
ItemLedgEntryTableCaptionTxt@1100225081 : TextConst 'ENU=Item Ledger
Entry;ESP=Mov. producto';
Text50003@1100225070 : TextConst 'ESP=No tiene permisos para renombrar
productos';
Text50004@1100225069 : TextConst 'ESP=No tiene permisos para cambia el campo
Bloqueado';
Text50000@1100225068 : TextConst 'ENU=Process Error. Check LOG.;ESP=Error
durante proceso. Revisar LOG.';
TextOpenWindow@1100225067 : TextConst 'ENU=Synchronizing with Magento\
%1;ESP=Sincronizando con Magento\%1';
TextErrorAttribSetup@1100225066 : TextConst 'ENU=%1 setup mus be set on
attrib setup.;ESP=Seleccionar en conf. atributo tipo producto algun valor con
configuraci�n %1';
ItemCross@1100225079 : Record 5717;
Text50001@1100225080 : TextConst 'ESP=Est� seguro que desea eliminar el
producto %1 de Magento?';
[LineStart(92)]
LOCAL PROCEDURE DeleteRelatedData@12();
VAR
BinContent@1002 : Record 7302;
ItemCrossReference@1001 : Record 5717;
SocialListeningSearchTopic@1000 : Record 871;
MyItem@1003 : Record 9152;
ItemAttributeValueMapping@1004 : Record 7505;
BEGIN
ItemBudgetEntry.SETCURRENTKEY("Analysis Area","Budget Name","Item No.");
ItemBudgetEntry.SETRANGE("Item No.","No.");
ItemBudgetEntry.DELETEALL(TRUE);

ItemSub.RESET;
ItemSub.SETRANGE(Type,ItemSub.Type::Item);
ItemSub.SETRANGE("No.","No.");
ItemSub.DELETEALL;

ItemSub.RESET;
ItemSub.SETRANGE("Substitute Type",ItemSub."Substitute Type"::Item);
ItemSub.SETRANGE("Substitute No.","No.");
ItemSub.DELETEALL;

SKU.RESET;
SKU.SETCURRENTKEY("Item No.");
SKU.SETRANGE("Item No.","No.");
SKU.DELETEALL;

CatalogItemMgt.NonstockItemDel(Rec);
CommentLine.SETRANGE("Table Name",CommentLine."Table Name"::Item);
CommentLine.SETRANGE("No.","No.");
//CommentLine.DELETEALL; //LS

ItemVend.SETCURRENTKEY("Item No.");
ItemVend.SETRANGE("Item No.","No.");
ItemVend.DELETEALL;

SalesPrice.SETRANGE("Item No.","No.");
//SalesPrice.DELETEALL; //LS

SalesLineDisc.SETRANGE(Type,SalesLineDisc.Type::Item);
SalesLineDisc.SETRANGE(Code,"No.");
//SalesLineDisc.DELETEALL; //LS

SalesPrepmtPct.SETRANGE("Item No.","No.");
SalesPrepmtPct.DELETEALL;

PurchPrice.SETRANGE("Item No.","No.");
PurchPrice.DELETEALL;

PurchLineDisc.SETRANGE("Item No.","No.");
PurchLineDisc.DELETEALL;

PurchPrepmtPct.SETRANGE("Item No.","No.");
PurchPrepmtPct.DELETEALL;

ItemTranslation.SETRANGE("Item No.","No.");
ItemTranslation.DELETEALL;
ItemUnitOfMeasure.SETRANGE("Item No.","No.");
//ItemUnitOfMeasure.DELETEALL; //LS

ItemVariant.SETRANGE("Item No.","No.");
//ItemVariant.DELETEALL; //LS

ExtTextHeader.SETRANGE("Table Name",ExtTextHeader."Table Name"::Item);


ExtTextHeader.SETRANGE("No.","No.");
ExtTextHeader.DELETEALL(TRUE);

ItemAnalysisViewEntry.SETRANGE("Item No.","No.");
ItemAnalysisViewEntry.DELETEALL;

ItemAnalysisBudgViewEntry.SETRANGE("Item No.","No.");
ItemAnalysisBudgViewEntry.DELETEALL;

PlanningAssignment.SETRANGE("Item No.","No.");
PlanningAssignment.DELETEALL;

BOMComp.RESET;
BOMComp.SETRANGE("Parent Item No.","No.");
//BOMComp.DELETEALL; //LS

TroubleshSetup.RESET;
TroubleshSetup.SETRANGE(Type,TroubleshSetup.Type::Item);
TroubleshSetup.SETRANGE("No.","No.");
TroubleshSetup.DELETEALL;

ResSkillMgt.DeleteItemResSkills("No.");
DimMgt.DeleteDefaultDim(DATABASE::Item,"No.");

ItemIdent.RESET;
ItemIdent.SETCURRENTKEY("Item No.");
ItemIdent.SETRANGE("Item No.","No.");
ItemIdent.DELETEALL;

ServiceItemComponent.RESET;
ServiceItemComponent.SETRANGE(Type,ServiceItemComponent.Type::Item);
ServiceItemComponent.SETRANGE("No.","No.");
ServiceItemComponent.MODIFYALL("No.",'');

BinContent.SETCURRENTKEY("Item No.");
BinContent.SETRANGE("Item No.","No.");
BinContent.DELETEALL;

ItemCrossReference.SETRANGE("Item No.","No.");
ItemCrossReference.DELETEALL;

MyItem.SETRANGE("Item No.","No.");
MyItem.DELETEALL;

IF NOT SocialListeningSearchTopic.ISEMPTY THEN BEGIN

SocialListeningSearchTopic.FindSearchTopic(SocialListeningSearchTopic."Source
Type"::Item,"No.");
SocialListeningSearchTopic.DELETEALL;
END;
ItemAttributeValueMapping.RESET;
ItemAttributeValueMapping.SETRANGE("Table ID",DATABASE::Item);
ItemAttributeValueMapping.SETRANGE("No.","No.");
ItemAttributeValueMapping.DELETEALL;

OnAfterDeleteRelatedData(Rec);
END;

[External]
[LineStart(206)]
PROCEDURE AssistEdit@2() : Boolean;
BEGIN
GetInvtSetup;
InvtSetup.TESTFIELD("Item Nos.");
IF NoSeriesMgt.SelectSeries(InvtSetup."Item Nos.",xRec."No. Series","No.
Series") THEN BEGIN
NoSeriesMgt.SetSeries("No.");
EXIT(TRUE);
END;
END;

[External]
[LineStart(214)]
PROCEDURE FindItemVend@5(VAR ItemVend@1000 : Record 99;LocationCode@1002 :
Code[10]);
VAR
GetPlanningParameters@1004 : Codeunit 99000855;
BEGIN
TESTFIELD("No.");
ItemVend.RESET;
ItemVend.SETRANGE("Item No.","No.");
ItemVend.SETRANGE("Vendor No.",ItemVend."Vendor No.");
ItemVend.SETRANGE("Variant Code",ItemVend."Variant Code");

IF NOT ItemVend.FIND('+') THEN BEGIN


ItemVend."Item No." := "No.";
ItemVend."Vendor Item No." := '';
GetPlanningParameters.AtSKU(SKU,"No.",ItemVend."Variant
Code",LocationCode);
IF ItemVend."Vendor No." = '' THEN
ItemVend."Vendor No." := SKU."Vendor No.";
IF ItemVend."Vendor Item No." = '' THEN
ItemVend."Vendor Item No." := SKU."Vendor Item No.";
ItemVend."Lead Time Calculation" := SKU."Lead Time Calculation";
END;
IF FORMAT(ItemVend."Lead Time Calculation") = '' THEN BEGIN
GetPlanningParameters.AtSKU(SKU,"No.",ItemVend."Variant
Code",LocationCode);
ItemVend."Lead Time Calculation" := SKU."Lead Time Calculation";
IF FORMAT(ItemVend."Lead Time Calculation") = '' THEN
IF Vend.GET(ItemVend."Vendor No.") THEN
ItemVend."Lead Time Calculation" := Vend."Lead Time Calculation";
END;
ItemVend.RESET;
END;

[External]
[LineStart(240)]
PROCEDURE ValidateShortcutDimCode@8(FieldNumber@1000 : Integer;VAR
ShortcutDimCode@1001 : Code[20]);
BEGIN
DimMgt.ValidateDimValueCode(FieldNumber,ShortcutDimCode);
DimMgt.SaveDefaultDim(DATABASE::Item,"No.",FieldNumber,ShortcutDimCode);
MODIFY;
END;

[External]
[LineStart(245)]
PROCEDURE TestNoEntriesExist@1006(CurrentFieldName@1000 : Text[100]);
VAR
ItemLedgEntry@1001 : Record 32;
PurchaseLine@1002 : Record 39;
IsHandled@1100225000 : Boolean;
BEGIN
IF "No." = '' THEN
EXIT;
ItemLedgEntry.SETCURRENTKEY("Item No.");
ItemLedgEntry.SETRANGE("Item No.","No.");
IF NOT ItemLedgEntry.ISEMPTY THEN
ERROR(Text007,CurrentFieldName);

IsHandled := FALSE;
OnBeforeTestNoPurchLinesExist(Rec,CurrentFieldName,IsHandled);
IF IsHandled THEN
EXIT;

PurchaseLine.SETCURRENTKEY("Document Type",Type,"No.");
PurchaseLine.SETFILTER(
"Document Type",'%1|%2',
PurchaseLine."Document Type"::Order,
PurchaseLine."Document Type"::"Return Order");
PurchaseLine.SETRANGE(Type,PurchaseLine.Type::Item);
PurchaseLine.SETRANGE("No.","No.");
// IF PurchaseLine.FINDFIRST THEN
// ERROR(Text008,CurrentFieldName,PurchaseLine."Document Type");
END;

[External]
[LineStart(268)]
PROCEDURE TestNoOpenEntriesExist@4(CurrentFieldName@1000 : Text[100]);
VAR
ItemLedgEntry@1001 : Record 32;
BEGIN
ItemLedgEntry.SETCURRENTKEY("Item No.",Open);
ItemLedgEntry.SETRANGE("Item No.","No.");
ItemLedgEntry.SETRANGE(Open,TRUE);
IF NOT ItemLedgEntry.ISEMPTY THEN
ERROR(
Text019,
CurrentFieldName);
END;

[LineStart(277)]
LOCAL PROCEDURE TestNoOpenDocumentsWithTrackingExist@42();
VAR
TrackingSpecification@1000 : Record 336;
ReservationEntry@1001 : Record 337;
RecRef@1004 : RecordRef;
SourceType@1002 : Integer;
SourceID@1003 : Code[20];
BEGIN
IF ItemTrackingCode2.Code = '' THEN
EXIT;

TrackingSpecification.SETRANGE("Item No.","No.");
IF TrackingSpecification.FINDFIRST THEN BEGIN
SourceType := TrackingSpecification."Source Type";
SourceID := TrackingSpecification."Source ID";
END ELSE BEGIN
ReservationEntry.SETRANGE("Item No.","No.");
ReservationEntry.SETFILTER("Item Tracking",'<>%1',ReservationEntry."Item
Tracking"::None);
IF ReservationEntry.FINDFIRST THEN BEGIN
SourceType := ReservationEntry."Source Type";
SourceID := ReservationEntry."Source ID";
END;
END;

IF SourceType = 0 THEN
EXIT;

RecRef.OPEN(SourceType);
ERROR(OpenDocumentTrackingErr,RecRef.CAPTION,SourceID);
END;

[External]
[LineStart(300)]
PROCEDURE ItemSKUGet@11(VAR Item@1000 : Record 27;LocationCode@1001 :
Code[10];VariantCode@1002 : Code[10]);
VAR
SKU@1003 : Record 5700;
BEGIN
IF Item.GET("No.") THEN BEGIN
IF SKU.GET(LocationCode,Item."No.",VariantCode) THEN
Item."Shelf No." := SKU."Shelf No.";
END;
END;

[LineStart(306)]
LOCAL PROCEDURE GetInvtSetup@14();
BEGIN
IF NOT HasInvtSetup THEN BEGIN
InvtSetup.GET;
HasInvtSetup := TRUE;
END;
END;

[External]
[LineStart(312)]
PROCEDURE IsMfgItem@1() : Boolean;
BEGIN
EXIT("Replenishment System" = "Replenishment System"::"Prod. Order");
END;

[External]
[LineStart(315)]
PROCEDURE IsAssemblyItem@24() : Boolean;
BEGIN
EXIT("Replenishment System" = "Replenishment System"::Assembly);
END;

[External]
[LineStart(318)]
PROCEDURE HasBOM@18() : Boolean;
BEGIN
CALCFIELDS("Assembly BOM");
EXIT("Assembly BOM" OR ("Production BOM No." <> ''));
END;

[LineStart(322)]
LOCAL PROCEDURE GetGLSetup@6();
BEGIN
IF NOT GLSetupRead THEN
GLSetup.GET;
GLSetupRead := TRUE;
END;

[LineStart(327)]
LOCAL PROCEDURE ProdOrderExist@7() : Boolean;
BEGIN
ProdOrderLine.SETCURRENTKEY(Status,"Item No.");
ProdOrderLine.SETFILTER(Status,'..%1',ProdOrderLine.Status::Released);
ProdOrderLine.SETRANGE("Item No.","No.");
IF NOT ProdOrderLine.ISEMPTY THEN
EXIT(TRUE);

EXIT(FALSE);
END;

[External]
[LineStart(336)]
PROCEDURE CheckSerialNoQty@15(ItemNo@1000 : Code[20];FieldName@1001 :
Text[30];Quantity@1002 : Decimal);
VAR
ItemRec@1003 : Record 27;
ItemTrackingCode3@1004 : Record 6502;
BEGIN
IF Quantity = ROUND(Quantity,1) THEN
EXIT;
IF NOT ItemRec.GET(ItemNo) THEN
EXIT;
IF ItemRec."Item Tracking Code" = '' THEN
EXIT;
IF NOT ItemTrackingCode3.GET(ItemRec."Item Tracking Code") THEN
EXIT;
IF ItemTrackingCode3."SN Specific Tracking" THEN
ERROR(Text025,
FieldName,
TABLECAPTION,
ItemNo,
ItemTrackingCode3.FIELDCAPTION("SN Specific Tracking"));
END;

[LineStart(352)]
LOCAL PROCEDURE CheckForProductionOutput@17(ItemNo@1000 : Code[20]);
VAR
ItemLedgEntry@1001 : Record 32;
BEGIN
CLEAR(ItemLedgEntry);
ItemLedgEntry.SETCURRENTKEY("Item No.","Entry Type","Variant Code","Drop
Shipment","Location Code","Posting Date");
ItemLedgEntry.SETRANGE("Item No.",ItemNo);
ItemLedgEntry.SETRANGE("Entry Type",ItemLedgEntry."Entry Type"::Output);
IF NOT ItemLedgEntry.ISEMPTY THEN
ERROR(Text026,FIELDCAPTION("Inventory Value Zero"),TABLECAPTION);
END;

[External]
[LineStart(360)]
PROCEDURE CheckBlockedByApplWorksheet@19();
VAR
ApplicationWorksheet@1000 : Page 521;
BEGIN
IF "Application Wksh. User ID" <> '' THEN
ERROR(Text028,"No.",ApplicationWorksheet.CAPTION,"Application Wksh. User
ID");
END;

[External]
[LineStart(364)]
PROCEDURE ShowTimelineFromItem@20(VAR Item@1000 : Record 27);
VAR
ItemAvailByTimeline@1001 : Page 5540;
BEGIN
ItemAvailByTimeline.SetItem(Item);
ItemAvailByTimeline.RUN;
END;

[External]
[LineStart(368)]
PROCEDURE ShowTimelineFromSKU@21(ItemNo@1000 : Code[20];LocationCode@1001 :
Code[10];VariantCode@1002 : Code[10]);
VAR
Item@1003 : Record 27;
BEGIN
Item.GET(ItemNo);
Item.SETRANGE("No.",Item."No.");
Item.SETRANGE("Variant Filter",VariantCode);
Item.SETRANGE("Location Filter",LocationCode);
ShowTimelineFromItem(Item);
END;

[LineStart(375)]
PROCEDURE CreateVariants@1000000007();
VAR
RegVariants@1000000001 : Codeunit 10001405;
VariantSetup@1000000000 : Record 10001417;
VariantsReg@1000000002 : Record 10001414;
BEGIN
//LS
// Register automatic Variants
IF VariantSetup.READPERMISSION() THEN
IF "Variant Framework Code" = '' THEN BEGIN
VariantsReg.SETRANGE(VariantsReg."Item No.","No.");
IF NOT VariantsReg.FIND('-') THEN BEGIN
IF "Variant Framework Code" = '' THEN
"Variant Framework Code" :=
RegVariants.ReturnFrameworkCode(Rec,FALSE);

IF VariantSetup.GET("Variant Framework Code") THEN


IF (VariantSetup."Registration Type" = VariantSetup."Registration
Type"::Automatic) OR
(VariantSetup."Registration Type" = VariantSetup."Registration
Type"::"2")
THEN
RegVariants.RUN(Rec);
END;
END;
END;

[LineStart(393)]
PROCEDURE AddItemPrice@1000000002();
VAR
PriceGroup@1000000000 : Record 6;
StoreGroup@1100409000 : Record 10000779;
BEGIN
//LS
//AddItemPrice

// We want to insert a default item price when we create an item. The price
is based on
// the default price group in the retail setup table.

RetailSetup.GET;
IF RetailSetup."Default Price Group" <> '' THEN BEGIN
ItemPrice.INIT;
ItemPrice."Item No." := "No.";
ItemPrice."Sales Type" := ItemPrice."Sales Type"::"Customer Price Group";
ItemPrice.VALIDATE("Sales Code",RetailSetup."Default Price Group");
ItemPrice.SetItemCardUpdate;
IF ItemPrice.INSERT(TRUE) THEN;
END;
END;

[LineStart(410)]
PROCEDURE UpdateItemPrice@1000000001();
VAR
StoreGroup@1100409000 : Record 10000779;
xItemPrice@1200070000 : Record 7002;
BEGIN
//LS
IF NOT RetailSetup.GET THEN
EXIT;

ItemPrice.RESET;
ItemPrice.SETRANGE(ItemPrice."Item No.","No.");
IF ItemPrice.FIND('-') THEN REPEAT
xItemPrice := ItemPrice;
IF (RetailSetup."Default Price Group" <> '') AND
(ItemPrice."Sales Type" = ItemPrice."Sales Type"::"Customer Price
Group") AND
(ItemPrice."Sales Code" = RetailSetup."Default Price Group")
THEN BEGIN
IF (ItemPrice."VAT Bus. Posting Gr. (Price)" = "VAT Bus. Posting Gr.
(Price)") AND
(ItemPrice."Starting Date" = 0D) AND
(ItemPrice."Ending Date" = 0D) AND
(ItemPrice."Currency Code" = '') AND
(ItemPrice."Variant Code" = '') AND
((ItemPrice."Unit of Measure Code" = '') OR (ItemPrice."Unit of
Measure Code" = "Sales Unit of Measure")) AND
(ItemPrice."Minimum Quantity" = 0)
THEN BEGIN
ItemPrice."Unit Price" := "Unit Price";
ItemPrice."Unit Price Including VAT" := "Unit Price Including VAT";
ItemPrice."Price Includes VAT" := "Price Includes VAT";
END;
END;
IF CalcPriceInclVATNow THEN
ItemPrice."Calculate Prices"(Rec,0)
ELSE
ItemPrice."Calculate Prices"(Rec,99001450);
IF (ItemPrice."Unit Price" <> xItemPrice."Unit Price") OR
(ItemPrice."Unit Price Including VAT" <> xItemPrice."Unit Price
Including VAT") OR
(ItemPrice."Markup %" <> xItemPrice."Markup %") OR
(ItemPrice."Profit %" <> xItemPrice."Profit %") OR
(ItemPrice."Profit (LCY)" <> xItemPrice."Profit (LCY)")
THEN BEGIN
ItemPrice.SetItemCardUpdate;
//+#454270
//ItemPrice.MODIFY(TRUE);
ItemPrice.MODIFY;
UpdateSalesPriceMgmt(ItemPrice,0);
//-#454270
END;
UNTIL ItemPrice.NEXT = 0;
END;

[LineStart(455)]
PROCEDURE OnInsertItem@100();
VAR
BarcodesRec@1100409000 : Record 99001451;
ReplenSetup@1100409003 : Record 10012200;
BOUtil@1100409001 : Codeunit 99001452;
BEGIN
//LS
//OnInsertItem

IF NOT BackOfficeSetup.GET THEN


EXIT;
IF NOT BackOfficeSetup."LS Retail in Use" THEN
EXIT;

"Price Includes VAT" := BackOfficeSetup."Def. Price Includes VAT";


"VAT Bus. Posting Gr. (Price)" := BackOfficeSetup."Def. VAT Bus. Post Gr.
(Price)";

IF BOUtil.IsReplenishmentPermitted THEN BEGIN


IF ReplenSetup.GET THEN BEGIN
"Effective Inv. Sales Order" := ReplenSetup."Effective Inv. Sales Order";
"Effective Inv. Purchase Ord." := ReplenSetup."Effective Inv. Purchase
Ord.";
"Effective Inv. Transfer Inb." := ReplenSetup."Effective Inv. Transfer
Inb.";
"Effective Inv. Transfer Outb." := ReplenSetup."Effective Inv. Transfer
Outb.";
END;
END;

IF BarcodesRec.GET("No.") THEN
ERROR(Text99001529,"No.");

AddItemPrice;
AddItemStatusLink;
"Date Created" := TODAY;
"Created by User" := USERID;
CheckExternalItemNo;
//LS-8457 CreateAction(0);
END;

[LineStart(486)]
PROCEDURE OnModifyItem@101();
VAR
LinkedItem@1001 : Record 99001452;
BarcodeMgt@1004 : Codeunit 99001450;
BEGIN
//LS
//OnModifyItem

IF NOT BackOfficeSetup.GET THEN


EXIT;
IF NOT BackOfficeSetup."LS Retail in Use" THEN
EXIT;

IF "Barcode Mask" <> '' THEN


BarcodeMgt.CheckItemMaskRetailVariants(Rec);

"Last Date Modified" := TODAY;


"Last Modified by User" := USERID;

ItemControl."Update ItemInStore"(Rec);
UpdateButtons;

//LS-8457//
// IF NOT SkipCreateModifyAction THEN
// CreateAction(1);
// SkipCreateModifyAction := FALSE;
//LS-8457//

ShowItemErrorCheckMessage := "Error Check Internal Usage";


"Error Check Internal Usage" := FALSE;
ItemErrorCheckFunction;
CheckExternalItemNo;
END;

[LineStart(515)]
PROCEDURE OnDeleteItem@102();
VAR
ItemCrossReference@1000 : Record 5717;
LinkedItem@1001 : Record 99001452;
ItemPOSTxtHdr@1004 : Record 99001534;
MixMatchLine@1005 : Record 99001454;
TableSpecInfoCode@1007 : Record 99001479;
ItemSectionLoc@1009 : Record 99001533;
ShelfLabelSetup@1010 : Record 99001572;
ItemLabelSetup@1100409004 : Record 99001549;
ItemVariant@1012 : Record 5401;
PosTableSpecPrintStp@1013 : Record 99001552;
ItemInStores@1100409003 : Record 10000704;
VarFramework@1100409002 : Record 10001412;
ItemAttributes@1100409001 : Record 10000786;
Buttonsel@1100409000 : Record 99008906;
Barcodes@1200070000 : Record 99001451;
ItemSpecialGroupLink@1200070001 : Record 10000736;
BOMVersionComp@10012000 : Record 10001213;
DayPlanLine@10012001 : Record 10012105;
RecipeItemNutrition@10012002 : Record 10012112;
ReplenDataProfLinks@10012003 : Record 10012375;
VendItemLib@1100409005 : Record 10012706;
TransOrdEnt@1100409006 : Record 10012704;
DefaultRestaurantMenuType@1000000000 : Record 10012152;
BEGIN
//LS
//OnDeleteItem

PeriodicDiscountLines.RESET;
PeriodicDiscountLines.SETRANGE("No.","No.");
IF PeriodicDiscountLines.FIND('-') THEN BEGIN
PeriodicDiscount.GET(PeriodicDiscountLines."Offer No.");
ERROR(
Text99001519,PeriodicDiscount.Type,
PeriodicDiscountLines."Offer No.");
END;

LinkedItem.RESET;
LinkedItem.SETCURRENTKEY("Linked Item No.");
LinkedItem.SETRANGE("Linked Item No.","No.");
IF LinkedItem.FIND('-') THEN
ERROR(
Text99001520,
LinkedItem.FIELDCAPTION("Linked Item No."),LinkedItem."Linked Item No.");

ItemCrossReference.RESET;
ItemCrossReference.SETCURRENTKEY("Item No.");
ItemCrossReference.SETRANGE("Item No.","No.");
ItemCrossReference.DELETEALL(TRUE);

LinkedItem.RESET;
LinkedItem.SETCURRENTKEY("Item No.");
LinkedItem.SETRANGE("Item No.","No.");
LinkedItem.DELETEALL(TRUE);

TableSpecInfoCode.RESET;
TableSpecInfoCode.SETRANGE("Table ID",DATABASE::Item);
TableSpecInfoCode.SETRANGE(Value,"No.");
TableSpecInfoCode.DELETEALL(TRUE);

ItemSectionLoc.RESET;
ItemSectionLoc.SETRANGE("Item No.","No.");
ItemSectionLoc.DELETEALL(TRUE);
ItemPOSTxtHdr.RESET;
ItemPOSTxtHdr.SETRANGE("Item No.","No.");
ItemPOSTxtHdr.DELETEALL(TRUE);

ShelfLabelSetup.RESET;
ShelfLabelSetup.SETRANGE("Item No.","No.");
ShelfLabelSetup.DELETEALL(TRUE);

ItemLabelSetup.RESET;
ItemLabelSetup.SETRANGE("Item No.","No.");
ItemLabelSetup.DELETEALL(TRUE);

Barcodes.RESET;
Barcodes.SETCURRENTKEY("Item No.");
Barcodes.SETRANGE("Item No.","No.");
Barcodes.DELETEALL(TRUE);

ItemVariant.RESET;
ItemVariant.SETRANGE("Item No.",Rec."No.");
ItemVariant.DELETEALL(TRUE);

PosTableSpecPrintStp.RESET;
PosTableSpecPrintStp.SETRANGE("Table No.",DATABASE::Item);
PosTableSpecPrintStp.SETRANGE(Key,Rec."No.");
PosTableSpecPrintStp.DELETEALL(TRUE);

CommentLine.SETRANGE("Table Name",CommentLine."Table Name"::Item);


CommentLine.SETRANGE("No.","No.");
CommentLine.DELETEALL(TRUE);

ItemUnitOfMeasure.SETRANGE("Item No.","No.");
IF ItemUnitOfMeasure.FIND('-') THEN
REPEAT
//LS-8457 ItemUnitOfMeasure.CreateAction(2);
ItemUnitOfMeasure.DELETE;
UNTIL ItemUnitOfMeasure.NEXT = 0;

SalesPrice.SETRANGE("Item No.","No.");
IF SalesPrice.FIND('-') THEN
REPEAT
//LS-8457 SalesPrice.CreateAction(2);
SalesPrice.DELETE;
UNTIL SalesPrice.NEXT = 0;

SalesLineDisc.SETRANGE(Type,SalesLineDisc.Type::Item);
SalesLineDisc.SETRANGE(Code,"No.");
SalesLineDisc.DELETEALL(TRUE);

ItemInStores.SETRANGE(ItemInStores."Item No.","No.");
ItemInStores.DELETEALL(TRUE);

IF "No." <> '' THEN BEGIN


VarFramework.SETCURRENTKEY(VarFramework.Item);
VarFramework.SETRANGE(VarFramework.Item,"No.");
VarFramework.DELETEALL(TRUE);
END;

IF "No." <> '' THEN BEGIN


ItemAttributes.SETRANGE("Link Type",ItemAttributes."Link Type"::Item);
ItemAttributes.SETRANGE("Link Field 1","No.");
ItemAttributes.DELETEALL(TRUE);
END;

IF "No." <> '' THEN BEGIN


Buttonsel.SETRANGE(Buttonsel.Command,'PLU_K');
Buttonsel.SETRANGE(Buttonsel.Parameter,"No.");
Buttonsel.DELETEALL(TRUE);
END;

ItemSpecialGroupLink.RESET;
ItemSpecialGroupLink.SETRANGE("Item No.","No.");
ItemSpecialGroupLink.DELETEALL(TRUE);

BOMComp.RESET;
BOMComp.SETRANGE("Parent Item No.","No.");
//LS-11034 BOMComp.DELETEALL(TRUE);
BOMComp.DELETEALL; //LS-11034

BOMVersionComp.RESET;
BOMVersionComp.SETRANGE("No.","No.");
IF BOMVersionComp.FINDFIRST THEN
ERROR(Text023,TABLENAME,"No.",BOMVersionComp.TABLENAME);

DayPlanLine.RESET;
DayPlanLine.SETRANGE("Recipe/Item No.","No.");
IF DayPlanLine.FINDFIRST THEN
ERROR(Text023,TABLENAME,"No.",DayPlanLine.TABLENAME);

BOMVersionComp.RESET;
BOMVersionComp.SETRANGE("Parent Item No.","No.");
BOMVersionComp.DELETEALL(TRUE);

RecipeItemNutrition.RESET;
RecipeItemNutrition.SETRANGE("Item No.","No.");
RecipeItemNutrition.DELETEALL(TRUE);

ItemControl."Item Delete Cleanup"(Rec);

//LS-8457 CreateAction(2);

ItemStatusLink.RESET;
ItemStatusLink.SETRANGE("Item No.","No.");
ItemStatusLink.DELETEALL(TRUE);

EventLink.RESET;
EventLink.SETRANGE("Item No.","No.");
EventLink.DELETEALL(TRUE);

IF "Replen. Data Profile" <> '' THEN BEGIN


ReplenDataProfLinks.RESET;
ReplenDataProfLinks.SETRANGE("Data Profile Code","Replen. Data Profile");
ReplenDataProfLinks.SETRANGE(Type,ReplenDataProfLinks.Type::Item);
ReplenDataProfLinks.SETRANGE(Key2,"No.");
IF ReplenDataProfLinks.FINDFIRST THEN
ReplenDataProfLinks.DELETE;
END;
IF VendItemLib.GET("No.") AND VendItemLib."Item Created" THEN BEGIN
VendItemLib."Item Created" := FALSE;
VendItemLib.MODIFY(TRUE);
END;
DefaultRestaurantMenuType.RESET;

DefaultRestaurantMenuType.SETRANGE(Type,DefaultRestaurantMenuType.Type::Item);
DefaultRestaurantMenuType.SETRANGE("No.","No.");
DefaultRestaurantMenuType.DELETEALL(TRUE);
END;

[LineStart(681)]
PROCEDURE OnRenameItem@103();
VAR
ActionsMgt@1000 : Codeunit 99001451;
BEGIN
//LS
//OnRenameItem

"Last Date Modified" := TODAY;


//LS-8457 CreateAction(3);
END;

[LineStart(688)]
PROCEDURE CopyFromProductGroup@104(ProductGroup@1200070005 : Record 5723);
VAR
DistributionGroup@1003 : Record 99001500;
DistributionSubGroup@1004 : Record 99001499;
Variant@1200070000 : Record 5401;
ItemTemplateMgt@1000000001 : Codeunit 10000712;
ItemTemplateCode@1000000000 : Code[10];
DistGroupCode@1005 : Code[10];
DistSubGroupCode@1006 : Code[10];
SizeVariant@1200070001 : Boolean;
ColorVariant@1200070002 : Boolean;
StyleVariant@1200070003 : Boolean;
BEGIN
//LS-5257
//CopyFromProductGroup

IF NOT BackOfficeSetup.GET THEN


EXIT;
IF NOT BackOfficeSetup."LS Retail in Use" THEN
EXIT;

ItemCategory.GET(ProductGroup."Item Category Code");

IF ProductGroup."Item Template Code" <> '' THEN


ItemTemplateCode := ProductGroup."Item Template Code"
ELSE
ItemTemplateCode := ItemCategory."Item Template Code";
IF ItemTemplateMgt.OkToApplyTemplate(ItemTemplateCode,Rec) THEN
ItemTemplateMgt.ApplyTemplate(ItemTemplateCode,Rec);

IF ProductGroup."Item Error Check Code" = '' THEN


ProductGroup."Item Error Check Code" := ItemCategory."Item Error Check
Code";

"Barcode Mask" := ProductGroup."Barcode Mask";


"Use EAN Standard Barc." := ProductGroup."Use EAN Standard Barc.";
VALIDATE("Variant Framework Code",ProductGroup."Variant Framework Code");
"Item Error Check Code" := ProductGroup."Item Error Check Code";
IF NOT "No Discount Allowed" THEN
"No Discount Allowed" := ProductGroup."Not Discountable";
//LS-5383
// // ItemGrSectionLoc.RESET;
// // ItemGrSectionLoc.SETRANGE("Product Group Code","Product Group Code");
// // IF ItemGrSectionLoc.FIND('-') THEN BEGIN
// // ItemSectionLoc.RESET;
// // ItemSectionLoc.SETRANGE("Item No.","No.");
// // IF NOT ItemSectionLoc.FIND('-') THEN
// // REPEAT
// // ItemSectionLoc.INIT;
// // ItemSectionLoc."Item No." := "No.";
// // ItemSectionLoc."Store No." := ItemGrSectionLoc."Store No.";
// // ItemSectionLoc."Section Code" := ItemGrSectionLoc."Section Code";
// // ItemSectionLoc."Shelf Code" := ItemGrSectionLoc."Shelf Code";
// // ItemSectionLoc.INSERT(TRUE);
// // UNTIL ItemGrSectionLoc.NEXT = 0;
// // END;
//LS-5383

CopyItemGroupSectionsToItem; //LS-5383

DistributionGroup.SETRANGE("No Filter",TRUE);
////IF DistributionGroup.FIND('-') THEN //LS-5383
IF DistributionGroup.FINDFIRST THEN //LS-5383
DistGroupCode := DistributionGroup."Group Code";

DistributionSubGroup.SETRANGE("No Filter",TRUE);
////IF DistributionSubGroup.FIND('-') THEN //LS-5383
IF DistributionSubGroup.FINDFIRST THEN //LS-5383
DistSubGroupCode := DistributionSubGroup."Subgroup Code";

//LS-5383
// // DefaultItemGroupLabels.SETRANGE("Product Group",ProductGroup.Code);
// //
DefaultItemGroupLabels.SETRANGE(Type,DefaultItemGroupLabels.Type::"Shelf Label");
// // IF DefaultItemGroupLabels.FIND('-') THEN REPEAT
// // IF NOT ShelfLabelSetup.GET("No.",DefaultItemGroupLabels."Store Group
Code",DefaultItemGroupLabels."Label Code") THEN BEGIN
// // ShelfLabelSetup.INIT;
// // ShelfLabelSetup."Item No." := "No.";
// // ShelfLabelSetup."Store Group Code" := DefaultItemGroupLabels."Store
Group Code";
// // ShelfLabelSetup."Label Code" := DefaultItemGroupLabels."Label Code";
// // IF DefaultItemGroupLabels.Quantity <> 0 THEN
// // ShelfLabelSetup.Quantity := DefaultItemGroupLabels.Quantity
// // ELSE
// // ShelfLabelSetup.Quantity := 1;
// // ShelfLabelSetup."Red Flag Label Code" := DefaultItemGroupLabels."Red
Flag Label Code";
// // ShelfLabelSetup.INSERT(TRUE);
// // END;
// // UNTIL DefaultItemGroupLabels.NEXT = 0;
// //
// // DefaultItemGroupLabels.SETRANGE(Type,DefaultItemGroupLabels.Type::"Item
Label");
// // IF DefaultItemGroupLabels.FIND('-') THEN REPEAT
// // IF NOT ItemLabelSetup.GET("No.",DefaultItemGroupLabels."Store Group
Code") THEN BEGIN
// // ItemLabelSetup.INIT;
// // ItemLabelSetup."Item No." := "No.";
// // ItemLabelSetup."Store Group Code" := DefaultItemGroupLabels."Store
Group Code";
// // ItemLabelSetup."Label Code" := DefaultItemGroupLabels."Label
Code"; //LS
// // ItemLabelSetup.INSERT(TRUE);
// // END;
// // UNTIL DefaultItemGroupLabels.NEXT = 0;
//LS-5383
CopyShelfAndItemLabelsFromProductGroup; //LS-5383
UpdateVendorItemLibrary;
UpdateAttributes;
UpdatePhysInvCountingPeriod; //LS-3723
END;

[LineStart(779)]
PROCEDURE CheckItemFamily@106(FieldChanged@1000 : 'Price,Cost';FieldNumber@1001
: Integer;NewValue@1002 : Decimal);
VAR
ItemFamily@1003 : Record 99001564;
Item3@1004 : Record 27;
Confirmation@1006 : Action;
BEGIN
END;

[LineStart(782)]
PROCEDURE CheckItemFamilyMethodCalc@107(FieldChanged@1000 :
'Method,Calculation';NewOption@1001 : Integer);
VAR
ItemFamily@1002 : Record 99001564;
Item3@1003 : Record 27;
Confirmation@1005 : Action;
BEGIN
END;

[LineStart(785)]
PROCEDURE ValidateItemNo@108();
VAR
ItemCrossReference@1000 : Record 5717;
BEGIN
//LS
//ValidateItemNo
IF Barcode.GET("No.") THEN
ERROR(
Text99001525,
FIELDCAPTION("No."),Barcode.TABLECAPTION,TABLECAPTION,Barcode."Item
No.");
END;

[LineStart(793)]
PROCEDURE CalcPriceInclVAT@109();
VAR
BackOfficeSetup@1000 : Record 10000700;
Store@1001 : Record 99001470;
DiscOfferLine@99001450 : Record 99001503;
tmpPrice@99001451 : Decimal;
BEGIN
//LS
IF NOT CalcPriceInclVATNow THEN
EXIT;

IF NOT "Price Includes VAT" THEN BEGIN


IF NOT VATPostingSetup.GET("VAT Bus. Posting Gr. (Price)","VAT Prod.
Posting Group") THEN
VATPostingSetup.INIT;
"Unit Price Including VAT" := "Unit Price" * (1 + VATPostingSetup."VAT %" /
100);
END ELSE
"Unit Price Including VAT" := "Unit Price";

VALIDATE("Comp. Price Incl. VAT");


END;

[LineStart(807)]
PROCEDURE HasLinkedItems@111(UOM@1002 : Code[10];SalesType@1200070000 :
Code[20]) : Boolean;
VAR
LinkedItem@1000 : Record 99001452;
ReturnValue@1001 : Boolean;
BEGIN
//LS
LinkedItem.SETCURRENTKEY("Item No.");
LinkedItem.SETRANGE("Item No.",Rec."No.");
IF (UOM = '') OR ((UOM = "Sales Unit of Measure") AND ("Sales Unit of
Measure" = "Base Unit of Measure")) THEN
LinkedItem.SETFILTER("Unit of Measure",'%1|%2','',"Sales Unit of Measure")
//LS
ELSE
LinkedItem.SETRANGE("Unit of Measure",UOM);
LinkedItem.SETFILTER("Sales Type",'%1|%2','',SalesType); //LS
EXIT(LinkedItem.FIND('-'));
END;

[LineStart(818)]
PROCEDURE DefaultBarcode@10012001() : Code[22];
VAR
Barcodes@1000 : Record 99001451;
BEGIN
//LS
//DefaultBarcode

Barcodes.SETCURRENTKEY("Item No.","Barcode No.");


Barcodes.SETRANGE("Item No.","No.");
Barcodes.SETRANGE("Unit of Measure Code","Base Unit of Measure");
Barcodes.SETRANGE("Show for Item",TRUE);
IF Barcodes.FIND('-') THEN
EXIT(Barcodes."Barcode No.")
ELSE BEGIN
Barcodes.SETRANGE("Show for Item",FALSE);
IF Barcodes.FIND('-') THEN
EXIT(Barcodes."Barcode No.");
END;
EXIT('');
END;
[LineStart(835)]
PROCEDURE DefaultUoMBarcode@1100409009(pUoM@1100409000 : Code[10]) : Code[20];
VAR
lBarcodes@1100409001 : Record 99001451;
BEGIN
//LS
IF pUoM = '' THEN
EXIT(DefaultBarcode);

lBarcodes.SETCURRENTKEY("Item No.","Barcode No.");


lBarcodes.SETRANGE("Item No.","No.");
lBarcodes.SETRANGE(lBarcodes."Unit of Measure Code",pUoM);
lBarcodes.SETRANGE("Show for Item",TRUE);
IF lBarcodes.FIND('-') THEN
EXIT(lBarcodes."Barcode No.")
ELSE BEGIN
lBarcodes.SETRANGE("Show for Item",FALSE);
IF lBarcodes.FIND('-') THEN
EXIT(lBarcodes."Barcode No.");
END;
EXIT('');
END;

[External]
[LineStart(853)]
PROCEDURE CheckJournalsAndWorksheets@22(CurrFieldNo@1001 : Integer);
BEGIN
CheckItemJnlLine(CurrFieldNo);
CheckStdCostWksh(CurrFieldNo);
CheckReqLine(CurrFieldNo);
END;

[LineStart(858)]
LOCAL PROCEDURE CheckItemJnlLine@44(CurrFieldNo@1000 : Integer);
BEGIN
ItemJnlLine.SETRANGE("Item No.","No.");
IF NOT ItemJnlLine.ISEMPTY THEN BEGIN
IF CurrFieldNo = 0 THEN
ERROR(Text023,TABLECAPTION,"No.",ItemJnlLine.TABLECAPTION);
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",ItemJnlLine.TABLEC
APTION);
END;
END;

[LineStart(867)]
LOCAL PROCEDURE CheckStdCostWksh@45(CurrFieldNo@1000 : Integer);
VAR
StdCostWksh@1001 : Record 5841;
BEGIN
StdCostWksh.RESET;
StdCostWksh.SETRANGE(Type,StdCostWksh.Type::Item);
StdCostWksh.SETRANGE("No.","No.");
IF NOT StdCostWksh.ISEMPTY THEN
IF CurrFieldNo = 0 THEN
ERROR(Text023,TABLECAPTION,"No.",StdCostWksh.TABLECAPTION);
END;
[LineStart(875)]
LOCAL PROCEDURE CheckReqLine@46(CurrFieldNo@1000 : Integer);
BEGIN
RequisitionLine.SETCURRENTKEY(Type,"No.");
RequisitionLine.SETRANGE(Type,RequisitionLine.Type::Item);
RequisitionLine.SETRANGE("No.","No.");
IF NOT RequisitionLine.ISEMPTY THEN BEGIN
IF CurrFieldNo = 0 THEN
ERROR(Text023,TABLECAPTION,"No.",RequisitionLine.TABLECAPTION);
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",RequisitionLine.TA
BLECAPTION);
END;
END;

[External]
[LineStart(886)]
PROCEDURE CheckDocuments@23(CurrFieldNo@1002 : Integer);
BEGIN
IF "No." = '' THEN
EXIT;

CheckBOM(CurrFieldNo);
CheckPurchLine(CurrFieldNo);
CheckSalesLine(CurrFieldNo);
CheckProdOrderLine(CurrFieldNo);
CheckProdOrderCompLine(CurrFieldNo);
CheckPlanningCompLine(CurrFieldNo);
CheckTransLine(CurrFieldNo);
CheckServLine(CurrFieldNo);
CheckProdBOMLine(CurrFieldNo);
CheckServContractLine(CurrFieldNo);
CheckAsmHeader(CurrFieldNo);
CheckAsmLine(CurrFieldNo);
CheckJobPlanningLine(CurrFieldNo);

OnAfterCheckDocuments(Rec,xRec,CurrFieldNo);
END;

[LineStart(906)]
LOCAL PROCEDURE CheckBOM@25(CurrFieldNo@1000 : Integer);
BEGIN
BOMComp.RESET;
BOMComp.SETCURRENTKEY(Type,"No.");
BOMComp.SETRANGE(Type,BOMComp.Type::Item);
BOMComp.SETRANGE("No.","No.");
IF NOT BOMComp.ISEMPTY THEN BEGIN
IF CurrFieldNo = 0 THEN
ERROR(Text023,TABLECAPTION,"No.",BOMComp.TABLECAPTION);
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",BOMComp.TABLECAPTI
ON);
END;
END;

[LineStart(918)]
LOCAL PROCEDURE CheckPurchLine@26(CurrFieldNo@1000 : Integer);
VAR
PurchaseLine@1001 : Record 39;
BEGIN
PurchaseLine.SETCURRENTKEY(Type,"No.");
PurchaseLine.SETRANGE(Type,PurchaseLine.Type::Item);
PurchaseLine.SETRANGE("No.","No.");
IF PurchaseLine.FINDFIRST THEN BEGIN
IF CurrFieldNo = 0 THEN
ERROR(Text000,TABLECAPTION,"No.",PurchaseLine."Document Type");
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",PurchaseLine.TABLE
CAPTION);
END;
END;

[LineStart(929)]
LOCAL PROCEDURE CheckSalesLine@28(CurrFieldNo@1000 : Integer);
VAR
SalesLine@1001 : Record 37;
IdentityManagement@1002 : Codeunit 9801;
BEGIN
SalesLine.SETCURRENTKEY(Type,"No.");
SalesLine.SETRANGE(Type,SalesLine.Type::Item);
SalesLine.SETRANGE("No.","No.");
IF SalesLine.FINDFIRST THEN BEGIN
IF CurrFieldNo = 0 THEN BEGIN
IF IdentityManagement.IsInvAppId THEN

ERROR(CannotDeleteItemIfSalesDocExistInvoicingErr,TABLECAPTION,Description,
SalesLine.GetDocumentTypeDescription,SalesLine."Document No.");

ERROR(CannotDeleteItemIfSalesDocExistErr,TABLECAPTION,"No.",SalesLine."Document
Type");
END;
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",SalesLine.TABLECAP
TION);
END;
END;

[LineStart(944)]
LOCAL PROCEDURE CheckProdOrderLine@39(CurrFieldNo@1000 : Integer);
BEGIN
IF ProdOrderExist THEN BEGIN
IF CurrFieldNo = 0 THEN
ERROR(Text002,TABLECAPTION,"No.");
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",ProdOrderLine.TABL
ECAPTION);
END;
END;

[LineStart(952)]
LOCAL PROCEDURE CheckProdOrderCompLine@31(CurrFieldNo@1000 : Integer);
BEGIN
ProdOrderComp.SETCURRENTKEY(Status,"Item No.");
ProdOrderComp.SETFILTER(Status,'..%1',ProdOrderComp.Status::Released);
ProdOrderComp.SETRANGE("Item No.","No.");
IF NOT ProdOrderComp.ISEMPTY THEN BEGIN
IF CurrFieldNo = 0 THEN
ERROR(Text014,TABLECAPTION,"No.");
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",ProdOrderComp.TABL
ECAPTION);
END;
END;

[LineStart(963)]
LOCAL PROCEDURE CheckPlanningCompLine@38(CurrFieldNo@1000 : Integer);
VAR
PlanningComponent@1005 : Record 99000829;
BEGIN
PlanningComponent.SETCURRENTKEY("Item No.","Variant Code","Location
Code","Due Date","Planning Line Origin");
PlanningComponent.SETRANGE("Item No.","No.");
IF NOT PlanningComponent.ISEMPTY THEN BEGIN
IF CurrFieldNo = 0 THEN
ERROR(Text023,TABLECAPTION,"No.",PlanningComponent.TABLECAPTION);
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",PlanningComponent.
TABLECAPTION);
END;
END;

[LineStart(973)]
LOCAL PROCEDURE CheckTransLine@37(CurrFieldNo@1000 : Integer);
BEGIN
TransLine.SETCURRENTKEY("Item No.");
TransLine.SETRANGE("Item No.","No.");
IF NOT TransLine.ISEMPTY THEN BEGIN
IF CurrFieldNo = 0 THEN
ERROR(Text016,TABLECAPTION,"No.");
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",TransLine.TABLECAP
TION);
END;
END;

[LineStart(983)]
LOCAL PROCEDURE CheckServLine@36(CurrFieldNo@1000 : Integer);
BEGIN
ServInvLine.RESET;
ServInvLine.SETCURRENTKEY(Type,"No.");
ServInvLine.SETRANGE(Type,ServInvLine.Type::Item);
ServInvLine.SETRANGE("No.","No.");
IF NOT ServInvLine.ISEMPTY THEN BEGIN
IF CurrFieldNo = 0 THEN
ERROR(Text017,TABLECAPTION,"No.",ServInvLine."Document Type");
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",ServInvLine.TABLEC
APTION);
END;
END;

[LineStart(995)]
LOCAL PROCEDURE CheckProdBOMLine@30(CurrFieldNo@1000 : Integer);
VAR
ProductionBOMVersion@1001 : Record 99000779;
BEGIN
ProdBOMLine.RESET;
ProdBOMLine.SETCURRENTKEY(Type,"No.");
ProdBOMLine.SETRANGE(Type,ProdBOMLine.Type::Item);
ProdBOMLine.SETRANGE("No.","No.");
IF ProdBOMLine.FIND('-') THEN BEGIN
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",ProdBOMLine.TABLEC
APTION);
IF CurrFieldNo = 0 THEN
REPEAT
IF ProdBOMHeader.GET(ProdBOMLine."Production BOM No.") AND
(ProdBOMHeader.Status = ProdBOMHeader.Status::Certified)
THEN
ERROR(Text004,TABLECAPTION,"No.");
IF ProductionBOMVersion.GET(ProdBOMLine."Production BOM
No.",ProdBOMLine."Version Code") AND
(ProductionBOMVersion.Status =
ProductionBOMVersion.Status::Certified)
THEN
ERROR(CannotDeleteItemIfProdBOMVersionExistsErr,TABLECAPTION,"No.");
UNTIL ProdBOMLine.NEXT = 0;
END;
END;

[LineStart(1016)]
LOCAL PROCEDURE CheckServContractLine@35(CurrFieldNo@1000 : Integer);
BEGIN
ServiceContractLine.RESET;
ServiceContractLine.SETRANGE("Item No.","No.");
IF NOT ServiceContractLine.ISEMPTY THEN BEGIN
IF CurrFieldNo = 0 THEN
ERROR(Text023,TABLECAPTION,"No.",ServiceContractLine.TABLECAPTION);
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",ServiceContractLin
e.TABLECAPTION);
END;
END;

[LineStart(1026)]
LOCAL PROCEDURE CheckAsmHeader@32(CurrFieldNo@1000 : Integer);
VAR
AsmHeader@1004 : Record 900;
BEGIN
AsmHeader.SETCURRENTKEY("Document Type","Item No.");
AsmHeader.SETRANGE("Item No.","No.");
IF NOT AsmHeader.ISEMPTY THEN BEGIN
IF CurrFieldNo = 0 THEN
ERROR(Text023,TABLECAPTION,"No.",AsmHeader.TABLECAPTION);
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",AsmHeader.TABLECAP
TION);
END;
END;

[LineStart(1036)]
LOCAL PROCEDURE CheckAsmLine@27(CurrFieldNo@1000 : Integer);
VAR
AsmLine@1003 : Record 901;
BEGIN
AsmLine.SETCURRENTKEY(Type,"No.");
AsmLine.SETRANGE(Type,AsmLine.Type::Item);
AsmLine.SETRANGE("No.","No.");
IF NOT AsmLine.ISEMPTY THEN BEGIN
IF CurrFieldNo = 0 THEN
ERROR(Text023,TABLECAPTION,"No.",AsmLine.TABLECAPTION);
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",AsmLine.TABLECAPTI
ON);
END;
END;

[External]
[LineStart(1047)]
PROCEDURE PreventNegativeInventory@33() : Boolean;
VAR
InventorySetup@1000 : Record 313;
BEGIN
CASE "Prevent Negative Inventory" OF
"Prevent Negative Inventory"::Yes:
EXIT(TRUE);
"Prevent Negative Inventory"::No:
EXIT(FALSE);
"Prevent Negative Inventory"::Default:
BEGIN
InventorySetup.GET;
EXIT(InventorySetup."Prevent Negative Inventory");
END;
END;
END;

[LineStart(1060)]
LOCAL PROCEDURE CheckJobPlanningLine@34(CurrFieldNo@1000 : Integer);
VAR
JobPlanningLine@1001 : Record 1003;
BEGIN
JobPlanningLine.SETCURRENTKEY(Type,"No.");
JobPlanningLine.SETRANGE(Type,JobPlanningLine.Type::Item);
JobPlanningLine.SETRANGE("No.","No.");
IF NOT JobPlanningLine.ISEMPTY THEN BEGIN
IF CurrFieldNo = 0 THEN
ERROR(Text023,TABLECAPTION,"No.",JobPlanningLine.TABLECAPTION);
IF CurrFieldNo = FIELDNO(Type) THEN

ERROR(CannotChangeFieldErr,FIELDCAPTION(Type),TABLECAPTION,"No.",JobPlanningLine.TA
BLECAPTION);
END;
END;

[LineStart(1071)]
LOCAL PROCEDURE CalcVAT@40() : Decimal;
BEGIN
IF "Price Includes VAT" THEN BEGIN
VATPostingSetup.GET("VAT Bus. Posting Gr. (Price)","VAT Prod. Posting
Group");
CASE VATPostingSetup."VAT Calculation Type" OF
VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT":
VATPostingSetup."VAT+EC %" := 0;
VATPostingSetup."VAT Calculation Type"::"Sales Tax":
ERROR(
Text006,
VATPostingSetup.FIELDCAPTION("VAT Calculation Type"),
VATPostingSetup."VAT Calculation Type");
END;
END ELSE
CLEAR(VATPostingSetup);

EXIT(VATPostingSetup."VAT %" / 100);


END;

[External]
[LineStart(1088)]
PROCEDURE CalcUnitPriceExclVAT@41() : Decimal;
BEGIN
GetGLSetup;
IF 1 + CalcVAT = 0 THEN
EXIT(0);
EXIT(ROUND("Unit Price" / (1 + CalcVAT),GLSetup."Unit-Amount Rounding
Precision"));
END;

[LineStart(1094)]
PROCEDURE FindActiveOffer@1100409000(VAR OfferCode@1000 : Code[20];VAR
OfferType@1001 : 'Multibuy,Mix&Match,Disc. Offer') counter : Integer;
VAR
PeriodicDiscount@1100409000 : Record 99001453;
PeriodicDiscountLines@1100409001 : Record 99001454;
BEGIN
//LS
//FindActiveOffer

counter := 0;
PeriodicDiscount.SETCURRENTKEY(Status);
PeriodicDiscount.SETRANGE(Status,PeriodicDiscount.Status::Enabled);
PeriodicDiscountLines.SETCURRENTKEY("Offer No.",Type,"No.","Variant
Code","Unit of Measure");
IF PeriodicDiscount.FIND('-') THEN REPEAT
PeriodicDiscountLines.SETRANGE("Offer No.",PeriodicDiscount."No.");
PeriodicDiscountLines.SETRANGE(Type,PeriodicDiscountLines.Type::Item);
PeriodicDiscountLines.SETRANGE("No.","No.");
IF PeriodicDiscountLines.FIND('-') THEN BEGIN
OfferCode := PeriodicDiscount."No.";
OfferType := PeriodicDiscount.Type;
counter += 1;
END;
UNTIL PeriodicDiscount.NEXT = 0;
END;

[LineStart(1113)]
PROCEDURE AddDefaultDistr@1100409001(ItemCategory_p@1200070000 : Record
5722;ProductGroup_p@1200070001 : Record 5723);
VAR
StoreGroup_l@1100409000 : Record 10000779;
ItemDistribution_l@1100409001 : Record 10000704;
BEGIN
//LS
//AddDefaultDistr
ItemDistribution_l.SETRANGE("Item No.","No.");
IF ItemDistribution_l.FINDFIRST THEN
EXIT;

IF ProductGroup_p."Def. Item Distr. Code" <> '' THEN BEGIN


ItemDistribution_l."Item No." := "No.";
ItemDistribution_l.Type := ProductGroup_p."Def. Item Distr. Type";
ItemDistribution_l.Code := ProductGroup_p."Def. Item Distr. Code";
ItemDistribution_l.AssignItemFieldsOnInsert(Rec);
ItemDistribution_l.INSERT;
//LS-8457 ItemDistribution_l.CreateAction(0);
EXIT;
END;
IF ItemCategory_p."Def. Item Distr. Code" <> '' THEN BEGIN
ItemDistribution_l."Item No." := "No.";
ItemDistribution_l.Type := ItemCategory_p."Def. Item Distr. Type";
ItemDistribution_l.Code := ItemCategory_p."Def. Item Distr. Code";
ItemDistribution_l.AssignItemFieldsOnInsert(Rec);
ItemDistribution_l.INSERT;
//LS-8457 ItemDistribution_l.CreateAction(0);
EXIT;
END;
StoreGroup_l.SETRANGE("No Filter",TRUE);
IF StoreGroup_l.FIND('-') THEN BEGIN
ItemDistribution_l.Code := StoreGroup_l.Code;
ItemDistribution_l."Item No." := "No.";
ItemDistribution_l.AssignItemFieldsOnInsert(Rec);
ItemDistribution_l.INSERT;
//LS-8457 ItemDistribution_l.CreateAction(0);
END;
END;

[LineStart(1147)]
PROCEDURE UpdateButtons@1200070001();
VAR
prodgroups@1200070000 : Record 5723;
menuprofile@1200070001 : Record 99008901;
Buttonsel@1200070002 : Record 99008906;
NextButton@1200070003 : Integer;
Menuheader@1200070004 : Record 99008905;
BEGIN
//LS
//UpdateButtons
IF prodgroups.GET("Item Category Code","Product Group Code") THEN
IF prodgroups."POS Menu Link" <> '' THEN BEGIN
IF menuprofile.FIND('-') THEN REPEAT
IF Menuheader.GET(menuprofile.ID,prodgroups."POS Menu Link") THEN BEGIN
Buttonsel.RESET;
Buttonsel.SETRANGE(Buttonsel."Profile ID",menuprofile.ID);
Buttonsel.SETRANGE(Buttonsel."Menu ID",prodgroups."POS Menu Link");

IF Buttonsel.FIND('+') THEN
NextButton := Buttonsel."Key No." + 1
ELSE
NextButton := 1;

Buttonsel.SETRANGE(Command,'PLU_K');
Buttonsel.SETRANGE(Buttonsel.Parameter,"No.");
IF NOT Buttonsel.FIND('-') THEN BEGIN
Buttonsel.INIT;
Buttonsel."Profile ID" := menuprofile.ID;
Buttonsel."Menu ID" := prodgroups."POS Menu Link";
Buttonsel."Key No." := NextButton;
Buttonsel.VALIDATE(Command,'PLU_K');
Buttonsel.VALIDATE(Parameter,"No.");
Buttonsel.VALIDATE(Buttonsel.Description,Description);
Buttonsel.INSERT(TRUE);
END;
END;
UNTIL menuprofile.NEXT() = 0;
END;
END;

[LineStart(1179)]
PROCEDURE SetSkipCreateActionSwitch@1100409003();
VAR
ActionsMgt@10014500 : Codeunit 99001451;
BEGIN
//LS
//LS-8457 SkipCreateModifyAction := TRUE;
ActionsMgt.SetSkipCreatePreAction(Rec); //LS-8457
END;

[LineStart(1184)]
PROCEDURE CopyFromItemCategory@1200070002();
BEGIN
//LS-5257
//CopyFromItemCategory

IF ItemCategory.GET("Item Category Code") THEN BEGIN


IF NOT "No Discount Allowed" THEN
"No Discount Allowed" := ItemCategory."Not Discountable";
IF ItemCategory.GET("Item Category Code") THEN
IF "Division Code" = '' THEN
"Division Code" := ItemCategory."Division Code";
UpdateAttributes;
END;
END;

[LineStart(1197)]
PROCEDURE ItemErrorCheckFunction@1200070003();
VAR
ItemCheck@1200070000 : Record 10001405;
BEGIN
//LS
//ItemErrorCheckFunction
IF "Item Error Check Code" <> '' THEN BEGIN
ItemCheck.GET("Item Error Check Code");

IF ItemCheck."Check Codeunit Object ID" <> 0 THEN


CODEUNIT.RUN(ItemCheck."Check Codeunit Object ID",Rec)
ELSE
MESSAGE(Text99001533,"Item Error Check Code");

IF ShowItemErrorCheckMessage THEN BEGIN


IF "Item Error Check Status" = "Item Error Check Status"::Failed THEN
MESSAGE(Text99001530+'\'+ Text99001531,"No.");
IF "Item Error Check Status" = "Item Error Check Status"::Passed THEN
MESSAGE(Text99001532,"No.");
END;

END;
END;

[LineStart(1217)]
LOCAL PROCEDURE CopyFromReplenProfile@10012000();
VAR
ReplenItemProfile@10012000 : Record 10012216;
NeedToCopyFromProfile@10012001 : Boolean;
ReplenSetup@10012002 : Record 10012200;
BEGIN
//LS
//CopyFromReplenProfile
IF NOT ReplenSetup.READPERMISSION THEN
EXIT;
IF ReplenSetup.GET THEN BEGIN
IF NOT ReplenSetup."Autom. Insert from Item Profil" THEN
EXIT;
END
ELSE
EXIT;

IF ("Item Category Code" <> '') OR ("Product Group Code" <> '') THEN BEGIN
ReplenItemProfile.RESET;
ReplenItemProfile.SETCURRENTKEY("Item Category Code","Product Group
Code","Sort ID");
ReplenItemProfile.SETFILTER("Item Category Code",'%1',"Item Category
Code");
ReplenItemProfile.SETRANGE("Product Group Code","Product Group Code");
NeedToCopyFromProfile := FALSE;
IF ReplenItemProfile.FINDLAST THEN
NeedToCopyFromProfile := TRUE
ELSE BEGIN
ReplenItemProfile.SETFILTER("Item Category Code",'%1','');
IF ReplenItemProfile.FINDLAST THEN
NeedToCopyFromProfile := TRUE
ELSE BEGIN
ReplenItemProfile.SETFILTER("Item Category Code",'%1',"Item Category
Code");
ReplenItemProfile.SETFILTER("Product Group Code",'%1','');
IF ReplenItemProfile.FINDLAST THEN
NeedToCopyFromProfile := TRUE;
END;
END;
IF NeedToCopyFromProfile THEN BEGIN
"Replenishment Calculation Type" := ReplenItemProfile."Replenishment
Calculation Type";
"Replenishment Sales Profile" := ReplenItemProfile."Replenishment Sales
Profile";
"Store Forward Sales Profile" := ReplenItemProfile."Store Forward Sales
Profile";
"Store Stock Cover Reqd (Days)" := ReplenItemProfile."Store Stock Cover
Reqd (Days)";
"Wareh Stock Cover Reqd (Days)" := ReplenItemProfile."Wareh Stock Cover
Reqd (Days)";
"Manual Estimated Daily Sale" := ReplenItemProfile."Manual Estimated
Daily Usage";
"Maximum Inventory" := ReplenItemProfile."Maximum Inventory";
"Reorder Quantity" := ReplenItemProfile."Reorder Quantity";
"Reorder Point" := ReplenItemProfile."Reorder Point";
"Order Multiple" := ReplenItemProfile."Purchase Order Multiple";
"Transfer Multiple" := ReplenItemProfile."Transfer Multiple";
"Replenishment Grade Code" := ReplenItemProfile."Replenishment Grade
Code";
"Wareh. Forward Sales Profile" := ReplenItemProfile."Wareh. Forward Sales
Profile";
"Purch. Order Delivery" := ReplenItemProfile."Purchase Order Delivery";
END;
END;
END;

[LineStart(1266)]
PROCEDURE UpdateVendorItemLibrary@1100409004();
VAR
lVendorItemLibrary@1100409000 : Record 10012706;
BEGIN
//LS
IF lVendorItemLibrary.GET("No.") THEN BEGIN
lVendorItemLibrary."Division Code" := "Division Code";
lVendorItemLibrary."Item Category Code" := "Item Category Code";
lVendorItemLibrary."Product Group Code" := "Product Group Code";
lVendorItemLibrary."Item Family Code" := "Item Family Code";
lVendorItemLibrary.MODIFY(TRUE);
END;
END;

[LineStart(1276)]
PROCEDURE ItemLedgerEntryExists@1100409007() : Boolean;
VAR
ItemLedgEntry@1100409006 : Record 32;
EntryExists@1100409000 : Boolean;
BEGIN
//LS
ItemLedgEntry.SETCURRENTKEY("Item No.");
ItemLedgEntry.SETRANGE("Item No.","No.");
IF ItemLedgEntry.ISEMPTY THEN
EntryExists := FALSE
ELSE
EntryExists := TRUE;

EXIT(EntryExists);
END;

[LineStart(1287)]
PROCEDURE CheckExternalItemNo@1100409008();
VAR
lItem@1100409000 : Record 27;
BEGIN
//LS
IF ("External Item No." = '') AND ("Extern. Size+Crust" = '') THEN
EXIT;
IF ("External Item No." = '') OR ("Extern. Size+Crust" = '') THEN
ERROR(Text99001535,FIELDCAPTION("External Item No."),FIELDCAPTION("Extern.
Size+Crust"));

lItem.RESET;
lItem.SETCURRENTKEY("External Item No.","Extern. Size+Crust");
lItem.SETRANGE("External Item No.","External Item No.");
lItem.SETRANGE("Extern. Size+Crust","Extern. Size+Crust");
lItem.SETFILTER("No.",'<>%1',"No.");
IF lItem.FINDFIRST THEN
ERROR(Text99001534,FIELDCAPTION("External Item No."),"External Item No.",
FIELDCAPTION("Extern. Size+Crust"),"Extern. Size+Crust",
TABLECAPTION,lItem."No.",lItem.Description);
END;

[LineStart(1304)]
PROCEDURE CalcPhysInventory@1100409032(ItemNo_p@1100409000 :
Code[20];VariantCode_p@1100409001 : Code[10];LocationCode_p@1100409002 :
Code[20]) : Decimal;
VAR
Item_l@1100409003 : Record 27;
BEGIN
//LS
Item_l.RESET;
Item_l.GET(ItemNo_p);
IF VariantCode_p <> '' THEN
Item_l.SETFILTER("Variant Filter",VariantCode_p);
Item_l.SETFILTER("Location Filter",LocationCode_p);
Item_l.CALCFIELDS(Inventory);
EXIT(Item_l.Inventory);
END;

[LineStart(1314)]
PROCEDURE AddItemStatusLink@1100409010();
VAR
ItemStatus_l@1100409000 : Record 10001403;
ItemStatusLink_l@1100409001 : Record 10001404;
DefaultStatusCode@1100409002 : Code[10];
Text001_l@1100409003 : TextConst 'ENU=Default Status';
BEGIN
//LS

ItemStatusLink_l.SETRANGE("Item No.","No.");
IF ItemStatusLink_l.FINDFIRST THEN
EXIT;

ItemStatus_l.SETRANGE("Default for new Items",TRUE);


IF NOT(ItemStatus_l.FINDFIRST) THEN
EXIT;

WITH ItemStatusLink_l DO BEGIN


INIT;
"Item No." := "No.";
"Starting Date" := WORKDATE;
"Status Code" := ItemStatus_l.Code;
"Block Sale on POS" := ItemStatus_l."Block Sale on POS";
"Block Purchasing" := ItemStatus_l."Block Purchasing";
"Block Transferring" := ItemStatus_l."Block Transferring";
"Block Discount" := ItemStatus_l."Block Discount";
"Block Promotion Price" := ItemStatus_l."Block Promotion Price";
"Block Periodic Discount" := ItemStatus_l."Block Periodic Discount";
"Block Manual Price Change" := ItemStatus_l."Block Manual Price Change";
"Status Description" := ItemStatus_l.Description;
"Block Sale in Sales Order" := ItemStatus_l."Block Sale in Sales Order";
"Block Sales Return" := ItemStatus_l."Block Sales Return";
"Block Negative Adjustment" := ItemStatus_l."Block Negative Adjustment";
"Block Positive Adjustment" := ItemStatus_l."Block Positive Adjustment";
"Block Purchase Return" := ItemStatus_l."Block Purchase Return";
Comment := Text001_l;
IF NOT(INSERT(TRUE)) THEN;
END;
END;

[LineStart(1347)]
LOCAL PROCEDURE TestSoldNotPosted@1000000000(CurrentFieldName@1000000003 :
Text[100]);
VAR
TransSalesEntry_l@1000000002 : Record 99001473;
BOUtils_l@1000000001 : Codeunit 99001452;
Text001_l@1000000004 : TextConst 'ENU=You cannot change %1 because there are
one or more unposted %2 for this item.';
QtySoldNotPst_l@1000000000 : Decimal;
BEGIN
//LS
QtySoldNotPst_l := BOUtils_l.ReturnQtySoldNotPosted("No.",'','','','');
IF QtySoldNotPst_l <> 0 THEN
ERROR(Text001_l,CurrentFieldName,TransSalesEntry_l.TABLECAPTION);
END;

[LineStart(1353)]
LOCAL PROCEDURE UpdateItemUnitsOfMeasures@1200070007();
VAR
ProdGrUnitofMeasure@1200070000 : Record 10016620;
ItemUnitofMeasure@1200070001 : Record 5404;
ChangeProductGroup@1200070003 : Boolean;
BEGIN
//LS
ChangeProductGroup := (xRec."Product Group Code" <> '') AND ("Product Group
Code" <> xRec."Product Group Code");
ChangeProductGroup := ChangeProductGroup OR ("Base Unit of Measure" <> '');

ProdGrUnitofMeasure.SETRANGE("Product Group Code","Product Group Code");


IF ProdGrUnitofMeasure.FINDSET THEN BEGIN
IF ChangeProductGroup THEN
IF NOT
CONFIRM(STRSUBSTNO(UseDefaultUOMfromProdGr,ItemUnitofMeasure.TABLECAPTION,FIELDCAPT
ION("Base Unit of Measure"),ProductGrp.TABLECAPTION,"Product Group Code"),FALSE)
THEN
EXIT;

REPEAT
IF NOT ItemUnitofMeasure.GET("No.",ProdGrUnitofMeasure."Unit of Measure
Code") THEN BEGIN
ItemUnitofMeasure.VALIDATE("Item No.","No.");
ItemUnitofMeasure.Code := ProdGrUnitofMeasure."Unit of Measure Code";
ItemUnitofMeasure.INSERT(TRUE);
END;
ItemUnitofMeasure.VALIDATE("Qty. per Unit of
Measure",ProdGrUnitofMeasure."Qty. per Unit of Measure");
ItemUnitofMeasure."POS Selection" := ProdGrUnitofMeasure."POS Selection";
ItemUnitofMeasure.Order := ProdGrUnitofMeasure.Order;
ItemUnitofMeasure.MODIFY(TRUE);
UNTIL ProdGrUnitofMeasure.NEXT = 0;

UpdateBaseUnitOfMeasure;
UpdatePurchUnitOfMeasure;
UpdateSalesUnitOfMeasure;
END;
END;

[LineStart(1381)]
LOCAL PROCEDURE UpdateBaseUnitOfMeasure@1200070016();
VAR
ProdGrUnitofMeasure@1200070000 : Record 10016620;
BEGIN
//LS
ProdGrUnitofMeasure.SETRANGE("Product Group Code","Product Group Code");
ProdGrUnitofMeasure.SETRANGE("Unit of Measure Type",ProdGrUnitofMeasure."Unit
of Measure Type"::"Base Unit of Measure");
IF ProdGrUnitofMeasure.FINDFIRST THEN
VALIDATE("Base Unit of Measure",ProdGrUnitofMeasure."Unit of Measure
Code");
END;

[LineStart(1388)]
LOCAL PROCEDURE UpdatePurchUnitOfMeasure@1200070018();
VAR
ProdGrUnitofMeasure@1200070000 : Record 10016620;
BEGIN
//LS
ProdGrUnitofMeasure.SETRANGE("Product Group Code","Product Group Code");
ProdGrUnitofMeasure.SETRANGE("Unit of Measure Type",ProdGrUnitofMeasure."Unit
of Measure Type"::"Purch. Unit of Measure");
IF ProdGrUnitofMeasure.FINDFIRST THEN
"Purch. Unit of Measure" := ProdGrUnitofMeasure."Unit of Measure Code";
END;

[LineStart(1395)]
LOCAL PROCEDURE UpdateSalesUnitOfMeasure@1200070017() : Boolean;
VAR
ProdGrUnitofMeasure@1200070000 : Record 10016620;
BEGIN
//LS
ProdGrUnitofMeasure.SETRANGE("Product Group Code","Product Group Code");
ProdGrUnitofMeasure.SETRANGE("Unit of Measure Type",ProdGrUnitofMeasure."Unit
of Measure Type"::"Sales Unit of Measure");
IF ProdGrUnitofMeasure.FINDFIRST THEN
"Sales Unit of Measure" := ProdGrUnitofMeasure."Unit of Measure Code";
END;
[LineStart(1402)]
LOCAL PROCEDURE UpdateAttributes@1200070000();
VAR
AttributeValue@1200070000 : Record 10000786;
BEGIN
//LS
AttributeValue.RESET;
AttributeValue.SETRANGE("Link Type",AttributeValue."Link Type"::Item);
AttributeValue.SETRANGE("Link Field 1","No.");
IF AttributeValue.FINDSET THEN
REPEAT
AttributeValue."Division Code" := "Division Code";
AttributeValue."Item Category Code" := "Item Category Code";
AttributeValue."Product Group Code" := "Product Group Code";
AttributeValue.MODIFY(TRUE);
UNTIL AttributeValue.NEXT = 0;
END;

[LineStart(1415)]
LOCAL PROCEDURE
ToggleExcludeFromReplenishment@1200070004(Exclude_p@1200070000 : Boolean);
VAR
ReplenItemStoreRec@1200070002 : Record 10012206;
ExcludeText@1200070001 : Text;
BEGIN
ReplenItemStoreRec.RESET;
ReplenItemStoreRec.SETRANGE("Item No.","No.");
ReplenItemStoreRec.SETRANGE("Exclude from Replenishment",NOT Exclude_p);
IF ReplenItemStoreRec.ISEMPTY THEN
EXIT;
IF Exclude_p THEN
ExcludeText := Text029
ELSE
ExcludeText := Text030;
IF CONFIRM(ExcludeText,TRUE) THEN
ReplenItemStoreRec.MODIFYALL("Exclude from Replenishment",Exclude_p);
END;

[LineStart(1428)]
PROCEDURE CombineStoreLocationFilter@1200070005(VAR Item_p@1200070000 : Record
27);
VAR
BOUtils@1200070003 : Codeunit 99001452;
StoreFilter@1200070002 : Code[250];
LocationFilter@1200070001 : Code[250];
BEGIN
//CombineStoreLocationFilter
StoreFilter := Item_p.GETFILTER("Store Filter");
LocationFilter := Item_p.GETFILTER("Location Filter");
BOUtils.CreateStoreLocationFilter(StoreFilter,LocationFilter);
IF StoreFilter = '' THEN
Item_p.SETRANGE("Store Filter")
ELSE
Item_p.SETFILTER("Store Filter",StoreFilter);
IF LocationFilter = '' THEN
Item_p.SETRANGE("Location Filter")
ELSE
Item_p.SETFILTER("Location Filter",LocationFilter);
END;
[External]
[LineStart(1442)]
PROCEDURE GetItemNo@10(ItemText@1000 : Text) : Code[20];
VAR
ItemNo@1001 : Text[50];
BEGIN
TryGetItemNo(ItemNo,ItemText,TRUE);
EXIT(COPYSTR(ItemNo,1,MAXSTRLEN("No.")));
END;

[External]
[LineStart(1446)]
PROCEDURE TryGetItemNo@9(VAR ReturnValue@1007 : Text[50];ItemText@1000 :
Text;DefaultCreate@1006 : Boolean) : Boolean;
BEGIN
InvtSetup.GET;
EXIT(TryGetItemNoOpenCard(ReturnValue,ItemText,DefaultCreate,TRUE,NOT
InvtSetup."Skip Prompt to Create Item"));
END;

[External]
[LineStart(1450)]
PROCEDURE TryGetItemNoOpenCard@43(VAR ReturnValue@1007 : Text;ItemText@1000 :
Text;DefaultCreate@1006 : Boolean;ShowItemCard@1008 :
Boolean;ShowCreateItemOption@1011 : Boolean) : Boolean;
VAR
Item@1001 : Record 27;
SalesLine@1004 : Record 37;
FindRecordMgt@1009 : Codeunit 703;
ItemNo@1002 : Code[20];
ItemWithoutQuote@1005 : Text;
ItemFilterContains@1003 : Text;
FoundRecordCount@1010 : Integer;
BEGIN
ReturnValue := COPYSTR(ItemText,1,MAXSTRLEN(ReturnValue));
IF ItemText = '' THEN
EXIT(DefaultCreate);

FoundRecordCount :=
FindRecordMgt.FindRecordByDescription(ReturnValue,SalesLine.Type::Item,ItemText);

IF FoundRecordCount = 1 THEN
EXIT(TRUE);

ReturnValue := COPYSTR(ItemText,1,MAXSTRLEN(ReturnValue));
IF FoundRecordCount = 0 THEN BEGIN
IF NOT DefaultCreate THEN
EXIT(FALSE);

IF NOT GUIALLOWED THEN


ERROR(SelectItemErr);

IF Item.WRITEPERMISSION THEN
IF ShowCreateItemOption THEN
CASE STRMENU(

STRSUBSTNO('%1,%2',STRSUBSTNO(CreateNewItemTxt,CONVERTSTR(ItemText,',','.')),Select
ItemTxt),1,ItemNotRegisteredTxt)
OF
0:
ERROR('');
1:
BEGIN
ReturnValue :=
CreateNewItem(COPYSTR(ItemText,1,MAXSTRLEN(Item.Description)),ShowItemCard);
EXIT(TRUE);
END;
END
ELSE
EXIT(FALSE);
END;

IF NOT GUIALLOWED THEN


ERROR(SelectItemErr);

IF FoundRecordCount > 0 THEN BEGIN


ItemWithoutQuote := CONVERTSTR(ItemText,'''','?');
ItemFilterContains := '''@*' + ItemWithoutQuote + '*''';
Item.FILTERGROUP(-1);
Item.SETFILTER("No.",ItemFilterContains);
Item.SETFILTER(Description,ItemFilterContains);
Item.SETFILTER("Base Unit of Measure",ItemFilterContains);
END;

IF ShowItemCard THEN
ItemNo := PickItem(Item)
ELSE BEGIN
ReturnValue := '';
EXIT(TRUE);
END;

IF ItemNo <> '' THEN BEGIN


ReturnValue := ItemNo;
EXIT(TRUE);
END;

IF NOT DefaultCreate THEN


EXIT(FALSE);
ERROR('');
END;

[LineStart(1513)]
LOCAL PROCEDURE CreateNewItem@3(ItemName@1000 : Text[50];ShowItemCard@1001 :
Boolean) : Code[20];
VAR
Item@1005 : Record 27;
ItemTemplate@1006 : Record 1301;
ItemCard@1002 : Page 30;
BEGIN
IF NOT ItemTemplate.NewItemFromTemplate(Item) THEN
ERROR(SelectItemErr);

Item.Description := ItemName;
Item.MODIFY(TRUE);
COMMIT;
IF NOT ShowItemCard THEN
EXIT(Item."No.");
Item.SETRANGE("No.",Item."No.");
ItemCard.SETTABLEVIEW(Item);
IF NOT (ItemCard.RUNMODAL = ACTION::OK) THEN
ERROR(SelectItemErr);

EXIT(Item."No.");
END;

[External]
[LineStart(1529)]
PROCEDURE PickItem@51(VAR Item@1000 : Record 27) : Code[20];
VAR
ItemList@1001 : Page 31;
BEGIN
IF Item.FILTERGROUP = -1 THEN
ItemList.SetTempFilteredItemRec(Item);

IF Item.FINDFIRST THEN;
ItemList.SETTABLEVIEW(Item);
ItemList.SETRECORD(Item);
ItemList.LOOKUPMODE := TRUE;
IF ItemList.RUNMODAL = ACTION::LookupOK THEN
ItemList.GETRECORD(Item)
ELSE
CLEAR(Item);

EXIT(Item."No.");
END;

[LineStart(1544)]
LOCAL PROCEDURE SetLastDateTimeModified@16();
BEGIN
"Last DateTime Modified" := CURRENTDATETIME;
"Last Date Modified" := DT2DATE("Last DateTime Modified");
"Last Time Modified" := DT2TIME("Last DateTime Modified");
END;

[External]
[LineStart(1549)]
PROCEDURE SetLastDateTimeFilter@29(DateFilter@1001 : DateTime);
VAR
DateFilterCalc@1004 : Codeunit 358;
SyncDateTimeUtc@1002 : DateTime;
CurrentFilterGroup@1003 : Integer;
BEGIN
SyncDateTimeUtc := DateFilterCalc.ConvertToUtcDateTime(DateFilter);
CurrentFilterGroup := FILTERGROUP;
SETFILTER("Last Date Modified",'>=%1',DT2DATE(SyncDateTimeUtc));
FILTERGROUP(-1);
SETFILTER("Last Date Modified",'>%1',DT2DATE(SyncDateTimeUtc));
SETFILTER("Last Time Modified",'>%1',DT2TIME(SyncDateTimeUtc));
FILTERGROUP(CurrentFilterGroup);
END;

[LineStart(1558)]
PROCEDURE ReturnTenantMediaForPicture@1100225002(VAR
TenantMediaOut@1000000000 : Record 2000000184);
VAR
TenantMediaSet@1000000001 : Record 2000000183;
BEGIN
//LS-5264
CLEAR(TenantMediaOut);
TenantMediaSet.SETFILTER(ID,FORMAT(Picture));
IF TenantMediaSet.FINDFIRST THEN BEGIN
TenantMediaOut.SETRANGE(ID,FORMAT(TenantMediaSet."Media ID"));
IF TenantMediaOut.FINDFIRST THEN
TenantMediaOut.CALCFIELDS(Content);
END;
END;

[LineStart(1568)]
LOCAL PROCEDURE CopyItemGroupSectionsToItem@10014500();
VAR
ItemGrSectionLoc@1000000001 : Record 99001532;
ItemSectionLoc@1000000000 : Record 99001533;
BEGIN
//LS
//LS-5383 new
ItemGrSectionLoc.RESET;
ItemGrSectionLoc.SETRANGE("Product Group Code","Product Group Code");
IF ItemGrSectionLoc.FINDSET THEN BEGIN
ItemSectionLoc.RESET;
ItemSectionLoc.SETRANGE("Item No.","No.");
IF ItemSectionLoc.ISEMPTY THEN
REPEAT
ItemSectionLoc.INIT;
ItemSectionLoc."Item No." := "No.";
ItemSectionLoc."Store No." := ItemGrSectionLoc."Store No.";
ItemSectionLoc."Section Code" := ItemGrSectionLoc."Section Code";
ItemSectionLoc."Shelf Code" := ItemGrSectionLoc."Shelf Code";
ItemSectionLoc.INSERT(TRUE);
UNTIL ItemGrSectionLoc.NEXT = 0;
END;
END;

[LineStart(1587)]
LOCAL PROCEDURE CopyShelfAndItemLabelsFromProductGroup@10014501();
VAR
ShelfLabelSetup@1000000004 : Record 99001572;
ItemLabelSetup@1000000003 : Record 99001549;
DefaultItemGroupLabels@1000000001 : Record 99001517;
BEGIN
//LS
//LS-5383 new
DefaultItemGroupLabels.SETRANGE("Product Group","Product Group Code");
DefaultItemGroupLabels.SETRANGE(Type,DefaultItemGroupLabels.Type::"Shelf
Label");
IF DefaultItemGroupLabels.FINDSET THEN
REPEAT
IF NOT ShelfLabelSetup.GET("No.",DefaultItemGroupLabels."Store Group
Code",DefaultItemGroupLabels."Label Code") THEN BEGIN
ShelfLabelSetup.INIT;
ShelfLabelSetup."Item No." := "No.";
ShelfLabelSetup."Store Group Code" := DefaultItemGroupLabels."Store
Group Code";
ShelfLabelSetup."Label Code" := DefaultItemGroupLabels."Label Code";
IF DefaultItemGroupLabels.Quantity <> 0 THEN
ShelfLabelSetup.Quantity := DefaultItemGroupLabels.Quantity
ELSE
ShelfLabelSetup.Quantity := 1;
ShelfLabelSetup."Red Flag Label Code" := DefaultItemGroupLabels."Red
Flag Label Code";
ShelfLabelSetup.INSERT(TRUE);
END;
UNTIL DefaultItemGroupLabels.NEXT = 0;

DefaultItemGroupLabels.SETRANGE(Type,DefaultItemGroupLabels.Type::"Item
Label");
IF DefaultItemGroupLabels.FINDSET THEN
REPEAT
IF NOT ItemLabelSetup.GET("No.",DefaultItemGroupLabels."Store Group
Code",DefaultItemGroupLabels."Label Code") THEN BEGIN
ItemLabelSetup.INIT;
ItemLabelSetup."Item No." := "No.";
ItemLabelSetup."Store Group Code" := DefaultItemGroupLabels."Store
Group Code";
ItemLabelSetup."Label Code" := DefaultItemGroupLabels."Label Code";
ItemLabelSetup.INSERT(TRUE);
END;
UNTIL DefaultItemGroupLabels.NEXT = 0;
END;

[LineStart(1620)]
LOCAL PROCEDURE UpdatePhysInvCountingPeriod@1200070009();
VAR
Division@1200070000 : Record 10000787;
ItemCategory@1200070001 : Record 5722;
ProductGroup@1200070002 : Record 5723;
TempCurrFieldNo@1200070003 : Integer;
BEGIN
//LS-3723
TempCurrFieldNo := CurrFieldNo;
CurrFieldNo := 0;
IF "Product Group Code" <> '' THEN
IF ProductGroup.GET("Item Category Code","Product Group Code") THEN
IF ProductGroup."Phys Invt Counting Period Code" <> '' THEN BEGIN
VALIDATE("Phys Invt Counting Period Code",ProductGroup."Phys Invt
Counting Period Code");
CurrFieldNo := TempCurrFieldNo;
EXIT;
END;

IF "Item Category Code" <> '' THEN


IF ItemCategory.GET("Item Category Code") THEN
IF ItemCategory."Phys Invt Counting Period Code" <> '' THEN BEGIN
VALIDATE("Phys Invt Counting Period Code",ItemCategory."Phys Invt
Counting Period Code");
CurrFieldNo := TempCurrFieldNo;
EXIT;
END;

IF "Division Code" <> '' THEN


IF Division.GET("Division Code") THEN
IF Division."Phys Invt Counting Period Code" <> '' THEN BEGIN
VALIDATE("Phys Invt Counting Period Code",Division."Phys Invt Counting
Period Code");
CurrFieldNo := TempCurrFieldNo;
EXIT;
END;
END;

[External]
[LineStart(1648)]
PROCEDURE UpdateReplenishmentSystem@54() : Boolean;
BEGIN
CALCFIELDS("Assembly BOM");

IF "Assembly BOM" THEN BEGIN


IF NOT ("Replenishment System" IN ["Replenishment
System"::Assembly,"Replenishment System"::"Prod. Order"])
THEN BEGIN
VALIDATE("Replenishment System","Replenishment System"::Assembly);
EXIT(TRUE);
END
END ELSE
IF "Replenishment System" = "Replenishment System"::Assembly THEN BEGIN
IF "Assembly Policy" <> "Assembly Policy"::"Assemble-to-Order" THEN BEGIN
VALIDATE("Replenishment System","Replenishment System"::Purchase);
EXIT(TRUE);
END
END
END;

[External]
[LineStart(1665)]
PROCEDURE UpdateUnitOfMeasureId@55();
VAR
UnitOfMeasure@1000 : Record 204;
BEGIN
IF "Base Unit of Measure" = '' THEN BEGIN
CLEAR("Unit of Measure Id");
EXIT;
END;

IF NOT UnitOfMeasure.GET("Base Unit of Measure") THEN


EXIT;

"Unit of Measure Id" := UnitOfMeasure.Id;


END;

[External]
[LineStart(1676)]
PROCEDURE UpdateItemCategoryId@63();
VAR
ItemCategory@1000 : Record 5722;
GraphMgtGeneralTools@1001 : Codeunit 5465;
BEGIN
IF ISTEMPORARY THEN
EXIT;

IF NOT GraphMgtGeneralTools.IsApiEnabled THEN


EXIT;

IF "Item Category Code" = '' THEN BEGIN


CLEAR("Item Category Id");
EXIT;
END;

IF NOT ItemCategory.GET("Item Category Code") THEN


EXIT;

"Item Category Id" := ItemCategory.Id;


END;

[External]
[LineStart(1693)]
PROCEDURE UpdateTaxGroupId@47();
VAR
TaxGroup@1000 : Record 321;
BEGIN
IF "Tax Group Code" = '' THEN BEGIN
CLEAR("Tax Group Id");
EXIT;
END;

IF NOT TaxGroup.GET("Tax Group Code") THEN


EXIT;

"Tax Group Id" := TaxGroup.Id;


END;

[LineStart(1704)]
LOCAL PROCEDURE UpdateUnitOfMeasureCode@48();
VAR
UnitOfMeasure@1001 : Record 204;
BEGIN
IF NOT ISNULLGUID("Unit of Measure Id") THEN BEGIN
UnitOfMeasure.SETRANGE(Id,"Unit of Measure Id");
UnitOfMeasure.FINDFIRST;
END;

"Base Unit of Measure" := UnitOfMeasure.Code;


END;

[LineStart(1712)]
LOCAL PROCEDURE UpdateTaxGroupCode@13();
VAR
TaxGroup@1001 : Record 321;
BEGIN
IF NOT ISNULLGUID("Tax Group Id") THEN BEGIN
TaxGroup.SETRANGE(Id,"Tax Group Id");
TaxGroup.FINDFIRST;
END;

VALIDATE("Tax Group Code",TaxGroup.Code);


END;

[LineStart(1720)]
LOCAL PROCEDURE UpdateItemCategoryCode@62();
VAR
ItemCategory@1000 : Record 5722;
BEGIN
IF ISNULLGUID("Item Category Id") THEN BEGIN
ItemCategory.SETRANGE(Id,"Item Category Id");
ItemCategory.FINDFIRST;
END;

"Item Category Code" := ItemCategory.Code;


END;

[External]
[LineStart(1728)]
PROCEDURE UpdateReferencedIds@61();
VAR
GraphMgtGeneralTools@1000 : Codeunit 5465;
BEGIN
IF ISTEMPORARY THEN
EXIT;

IF NOT GraphMgtGeneralTools.IsApiEnabled THEN


EXIT;

UpdateUnitOfMeasureId;
UpdateTaxGroupId;
UpdateItemCategoryId;
END;

[External]
[LineStart(1739)]
PROCEDURE GetReferencedIds@49(VAR TempField@1000 : TEMPORARY Record
2000000041);
VAR
DataTypeManagement@1001 : Codeunit 701;
BEGIN
DataTypeManagement.InsertFieldToBuffer(TempField,DATABASE::Item,FIELDNO("Unit
of Measure Id"));
DataTypeManagement.InsertFieldToBuffer(TempField,DATABASE::Item,FIELDNO("Tax
Group Id"));
DataTypeManagement.InsertFieldToBuffer(TempField,DATABASE::Item,FIELDNO("Item
Category Id"));
END;

[External]
[LineStart(1744)]
PROCEDURE IsServiceType@53() : Boolean;
BEGIN
EXIT(Type = Type::Service);
END;

[External]
[LineStart(1747)]
PROCEDURE IsNonInventoriableType@50() : Boolean;
BEGIN
EXIT(Type IN [Type::"Non-Inventory",Type::Service]);
END;

[External]
[LineStart(1750)]
PROCEDURE IsInventoriableType@52() : Boolean;
BEGIN
EXIT(NOT IsNonInventoriableType);
END;

[Integration]
[LineStart(1753)]
LOCAL PROCEDURE OnAfterCheckDocuments@74(VAR Item@1000 : Record 27;VAR
xItem@1001 : Record 27;VAR CurrentFieldNo@1002 : Integer);
BEGIN
END;

[Integration]
[LineStart(1756)]
LOCAL PROCEDURE OnAfterDeleteRelatedData@57(Item@1000 : Record 27);
BEGIN
END;

[Integration]
[LineStart(1759)]
LOCAL PROCEDURE OnBeforeTestNoPurchLinesExist@60(Item@1000 : Record
27;CurrentFieldName@1001 : Text[100];VAR IsHandled@1002 : Boolean);
BEGIN
END;

[Integration]
[LineStart(1762)]
LOCAL PROCEDURE OnBeforeValidateStandardCost@56(VAR Item@1000 : Record
27;xItem@1001 : Record 27;CallingFieldNo@1002 : Integer;VAR IsHandled@1003 :
Boolean);
BEGIN
END;

[External]
[LineStart(1765)]
PROCEDURE ExistsItemLedgerEntry@58() : Boolean;
VAR
ItemLedgEntry@1000 : Record 32;
BEGIN
ItemLedgEntry.RESET;
ItemLedgEntry.SETCURRENTKEY("Item No.");
ItemLedgEntry.SETRANGE("Item No.","No.");
EXIT(NOT ItemLedgEntry.ISEMPTY);
END;

[LineStart(1771)]
LOCAL PROCEDURE fxItemDefaultValues@1000000003();
BEGIN

//-MRW Valores por defecto (no usando Init Value)


"Date Created" := TODAY;
"Created by User" := USERID;
"Create Date" := TODAY;
"Create User ID" := USERID;
VALIDATE("Base Unit of Measure",'UD');
Blocked := TRUE;
"Stockout Warning" := "Stockout Warning"::Yes;
"Prevent Negative Inventory" := "Prevent Negative Inventory"::Yes;
"Magento Skip Stock" := FALSE;
"Costing Method" := "Costing Method"::Average;
"Price/Profit Calculation" := "Price/Profit Calculation"::"Profit=Price-
Cost";
"Allow Invoice Disc." := TRUE;
"Item Disc. Group" := '';
VALIDATE("Sales Unit of Measure",'UD');
VALIDATE("Country/Region of Origin Code",'ES');
//+MRW
END;

[LineStart(1791)]
LOCAL PROCEDURE fxCalcVolume@1000000004(alto@1000000000 :
Decimal;ancho@1000000001 : Decimal;hondo@1000000002 : Decimal);
BEGIN

"Unit Volume" := (alto * ancho * hondo) / 1000;


END;

[LineStart(1795)]
PROCEDURE fxgetMaxiCode@1000000005();
VAR
error@1000000001 : Boolean;
BEGIN
CLEAR(Maxicode);
error := FALSE;

IF ("Item Type" = '') OR ("Stock Risk" = '') OR (Periodicity = '') THEN BEGIN
Maxicode := COPYSTR('Faltan datos de riesgo para MAXICODIGO',1,50);
error := TRUE;
END;
IF (Topic = '') THEN BEGIN
Maxicode := COPYSTR('Faltan la tem�tica para MAXICODIGO',1,50);
error := TRUE;
END;
IF ("Collection Year" = '') THEN BEGIN
Maxicode := COPYSTR('Faltan el a�o de campa�a para MAXICODIGO',1,50);
error := TRUE;
END;
IF ("Collection No." = '') THEN BEGIN
Maxicode := COPYSTR('Faltan indicar campa�a para MAXICODIGO',1,50);
error := TRUE;
END;
IF ("Language Code" = '') THEN BEGIN
Maxicode := COPYSTR('Faltan indicar el idioma para MAXICODIGO',1,50);
error := TRUE;
END;

IF NOT error THEN


Maxicode := "Item Type" +
"Stock Risk" +
Periodicity +
"Item Information" + '/' +
Topic + '/' +
"Collection Year" +
"Collection No." + '/' +
"Language Code" + '/' +
"No.";
END;

[LineStart(1831)]
LOCAL PROCEDURE fxItemModifyPermission@1000000006();
VAR
UserSetup@1000000000 : Record 91;
Text50099@1000000001 : TextConst 'ESP=No tiene permisos para modificar el
campo %1';
BEGIN
//-MRW
IF UserSetup.GET(USERID) THEN;

IF (xRec.Description <> '') AND (Description <> xRec.Description) AND NOT


(UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION(Description));

IF (xRec."Description 2"<> '') AND ("Description 2" <> xRec."Description 2")


AND NOT (UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION("Description 2"));

IF (xRec."Division Code"<> '') AND ("Division Code" <> xRec."Division Code")


AND NOT (UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION("Division Code"));

IF (xRec."Item Category Code"<> '') AND ("Item Category Code" <> xRec."Item
Category Code") AND NOT (UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION("Item Category Code"));

IF (xRec."Product Group Code"<> '') AND ("Product Group Code" <>


xRec."Product Group Code") AND NOT (UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION("Product Group Code"));

IF (xRec."Search Description"<> '') AND ("Search Description" <> xRec."Search


Description") AND NOT (UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION("Search Description"));

IF (xRec."Release Date" <> 0D) AND ("Release Date" <> xRec."Release Date")
AND NOT (UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION("Release Date"));

IF (xRec.CopyDescrip <> '') AND (CopyDescrip <> xRec.CopyDescrip) AND NOT


(UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION(CopyDescrip));

IF (xRec."Collection No." <> '') AND ("Collection No." <> xRec."Collection


No.") AND NOT (UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION("Collection No."));

IF (xRec."Collection Year" <> '') AND ("Collection Year" <> xRec."Collection


Year") AND NOT (UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION("Collection Year"));

IF (xRec.Topic <> '') AND (Topic <> xRec.Topic) AND NOT (UserSetup."Modificar
maestro producto") THEN
ERROR(Text50099,FIELDCAPTION(Topic));

IF (xRec."CREA Code" <> '') AND ("CREA Code" <> xRec."CREA Code") AND NOT
(UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION("CREA Code"));

IF (xRec."Language Code" <> '') AND ("Language Code" <> xRec."Language Code")
AND NOT (UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION("Language Code"));

IF (xRec."Item Type" <> '') AND ("Item Type" <> xRec."Item Type") AND NOT
(UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION("Item Type"));
IF (xRec."Stock Risk" <> '') AND ("Stock Risk" <> xRec."Stock Risk") AND NOT
(UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION("Stock Risk"));

IF (xRec.Periodicity <> '') AND (Periodicity <> xRec.Periodicity) AND NOT


(UserSetup."Modificar maestro producto") THEN
ERROR(Text50099,FIELDCAPTION(Periodicity));

//Bloqueamos el producto en base a si alguien cambia la cat/div/grupo


//IF ("Division Code" <> xRec."Division Code") OR
// ("Item Category Code" <> xRec."Item Category Code") OR
// ("Product Group Code" <> xRec."Product Group Code")
//THEN
// Blocked := TRUE;
//+MRW
END;

[LineStart(1891)]
PROCEDURE MagentoItem@1100225000(Action@1100225000 :
Integer;Enviroment@1000000001 : '1,2');
VAR
MagentoLogEntry@1100225002 : Record 50002;
Magento@1100225001 : Codeunit 50003;
Magento2Setup@1000000000 : Record 50118;
BEGIN
//<073
//Action
// 1 - Create,2 - Modify,3 - Delete,4 - Show,5 - Hide
IF NOT (Action IN [1,2,3,4,5]) THEN
EXIT;

//<073 25/01/2019 Confirmar eliminaci�n


IF Action = 3 THEN
IF NOT CONFIRM(Text50001,FALSE,"No.") THEN
EXIT;
//073> 25/01/2019 Confirmar eliminaci�n

IF Enviroment = Enviroment::"1" THEN BEGIN//<396


MagentoLogEntry.INIT;
MagentoLogEntry.Operation := MagentoLogEntry.Operation::Item;
MagentoLogEntry.Action := Action;
MagentoLogEntry.Code := "No.";
MagentoLogEntry."Magento Environment":= MagentoLogEntry."Magento
Environment"::"Magento 1"; //<396
MagentoLogEntry.INSERT(TRUE);
COMMIT;

IF MagentoExecute(MagentoLogEntry) THEN BEGIN


IF Action IN [1,2] THEN BEGIN
//-Stock
IF NOT "Magento Skip Stock" THEN
MagentoStock;
MagentoPrices;
END;
END;
//073>
END;//396>
//<396
//MAGENTO 2
IF Enviroment = Enviroment::"2" THEN BEGIN//<396
Magento2Setup.GET();
IF Magento2Setup."Magento 2 Enabled" THEN BEGIN
CLEAR(MagentoLogEntry);
MagentoLogEntry.INIT;
MagentoLogEntry.Operation := MagentoLogEntry.Operation::Item;
MagentoLogEntry.Action := Action;
MagentoLogEntry.Code := "No.";
MagentoLogEntry."Magento Environment":= MagentoLogEntry."Magento
Environment"::"Magento 2"; //<396
MagentoLogEntry.INSERT(TRUE);
COMMIT;
IF MagentoExecute(MagentoLogEntry) THEN BEGIN
IF Action IN [1,2] THEN BEGIN
MagentoPricesM2;
//IF NOT "Magento Skip Stock" THEN
//MagentoStock; ESTOC en M2 va por sftp.
END;
END;
END;
END;
//396>
END;

[LineStart(1949)]
PROCEDURE MagentoPicture@1100225004(Action@1100225000 : Integer);
VAR
MagentoLogEntry@1100225002 : Record 50002;
Magento@1100225001 : Codeunit 50003;
BEGIN
//<073
//Action
// 1 - Create,2 - Modify,3 - Delete
IF NOT (Action IN [1,2,3]) THEN
EXIT;
//<073 25/01/2019 Confirmar eliminaci�n

MagentoLogEntry.INIT;
MagentoLogEntry.Operation := MagentoLogEntry.Operation::Picture;
MagentoLogEntry.Action := Action;
MagentoLogEntry.Code := "No.";
MagentoLogEntry."Magento Environment":= MagentoLogEntry."Magento
Environment"::"Magento 1"; //<396
MagentoLogEntry.INSERT(TRUE);
COMMIT;

MagentoExecute(MagentoLogEntry);
//073>
END;

[LineStart(1968)]
PROCEDURE MagentoStock@1100225005();
VAR
MagentoLogEntry@1100225001 : Record 50002;
Magento@1100225000 : Codeunit 50003;
ItemUpdateManagement@1000000000 : Record 50003;
BEGIN
//<073
MagentoLogEntry.INIT;
MagentoLogEntry.Operation := MagentoLogEntry.Operation::Stock;
MagentoLogEntry.Code := "No.";
MagentoLogEntry."Magento Environment":= MagentoLogEntry."Magento
Environment"::"Magento 1"; //<396
MagentoLogEntry.INSERT(TRUE);
COMMIT;

MagentoExecute(MagentoLogEntry);

ItemUpdateManagement.ItemStockStatusMagento2("No."); //396
//073>
END;

[LineStart(1982)]
PROCEDURE MagentoPrices@1100225006();
VAR
MagentoLogEntry@1100225001 : Record 50002;
Magento@1100225000 : Codeunit 50003;
BEGIN
//<073
MagentoLogEntry.INIT;
MagentoLogEntry.Operation := MagentoLogEntry.Operation::Price;
MagentoLogEntry.Code := "No.";
MagentoLogEntry."Magento Environment":= MagentoLogEntry."Magento
Environment"::"Magento 1"; //<396
MagentoLogEntry.INSERT(TRUE);
COMMIT;

MagentoExecute(MagentoLogEntry);
//073>
END;

[LineStart(1994)]
PROCEDURE MagentoPricesM2@1000000018();
VAR
MagentoLogEntry@1100225001 : Record 50002;
Magento@1100225000 : Codeunit 50003;
Magento2Setup@1000000000 : Record 50118;
BEGIN
//<396
Magento2Setup.GET();
IF Magento2Setup."Magento 2 Enabled" THEN BEGIN
CLEAR(MagentoLogEntry);
MagentoLogEntry.INIT;
MagentoLogEntry.Operation := MagentoLogEntry.Operation::Price;
MagentoLogEntry.Code := "No.";
MagentoLogEntry."Magento Environment":= MagentoLogEntry."Magento
Environment"::"Magento 2";
MagentoLogEntry.INSERT(TRUE);
COMMIT;
MagentoExecute(MagentoLogEntry);
END;
//396>
END;

[LineStart(2009)]
PROCEDURE MagentoExecute@1100225010(VAR MagentoLogEntry@1100225001 : Record
50002) : Boolean;
VAR
Magento@1100225000 : Codeunit 50003;
BEGIN
//<073
CLEARLASTERROR;
MagentoOpenDialog(FORMAT(MagentoLogEntry.Operation));
IF NOT Magento.RUN(MagentoLogEntry) THEN BEGIN
MagentoLogEntry.Error := TRUE;
MagentoLogEntry.Description := COPYSTR(GETLASTERRORTEXT,1,250);
MagentoLogEntry.MODIFY;
COMMIT;
MagentoCloseDialog;
//MESSAGE(Text50000);
MESSAGE(FORMAT(MagentoLogEntry."Magento Environment") + ' ' + Text50000);
EXIT(FALSE);
END;
MagentoCloseDialog;
EXIT(TRUE);
//073>
END;

[LineStart(2027)]
LOCAL PROCEDURE MagentoOpenDialog@7141743(TextAction@7141743 : Text);
BEGIN
//<073
IF NOT GUIALLOWED THEN
EXIT;

IF OpenDialog THEN
EXIT;

Window.OPEN(STRSUBSTNO(TextOpenWindow,TextAction));
OpenDialog := TRUE;
//073>
END;

[LineStart(2039)]
LOCAL PROCEDURE MagentoCloseDialog@7141744();
BEGIN
//<073
IF NOT GUIALLOWED THEN
EXIT;

OpenDialog := FALSE;
Window.CLOSE;
//073>
END;

[LineStart(2048)]
LOCAL PROCEDURE UpdateAttribViews@1100225001();
VAR
RelProduct@1100225004 : Record 50027;
SalesSetup@1100225003 : Record 311;
AttributeSetup@1100225002 : Record 10000784;
AttributeValues@1100225001 : Record 10000786;
Counter@1100225000 : Integer;
MSG01@1100225007 : TextConst 'ESP=Este proceso borrar� todas las vistas
actuales e introducir� las correspondientes a la configuraci�n del producto. �Desea
continuar?';
ERR01@1100225006 : TextConst 'ESP=Proceso cancelado por el usuario.';
TextError@1100225005 : TextConst 'ENU=La combinaci�n indicada de Division,
Categor�a y Grupo no existe en la relaci�n de segmentaci�n de productos. Por favor,
p�ngase en contacto con IT;ESP=La combinaci�n indicada de Division, Categor�a y
Grupo no existe en la relaci�n de segmentaci�n de productos. Por favor, p�ngase en
contacto con IT';
TextDeleteCurrentViews@1100225008 : TextConst 'ENU=View set as attribute.
Delete?;ESP=Existen vistas configuradas. Eliminar?';
BEGIN
SalesSetup.GET;
IF "Inventory Posting Group" = SalesSetup."G. Invent. Segmentacion" THEN
BEGIN
IF "Item Disc. Group" <> 'PVD' THEN BEGIN //Cambio provisional. PENDIENTE
REVISAR
InfoComp.GET;
//<073
AttributeSetup.SETRANGE("Item Link",TRUE);
AttributeSetup.SETRANGE("Customer - Item View",TRUE);
IF NOT AttributeSetup.FINDSET THEN
EXIT; //073 24/01/2019
//ERROR(TextErrorAttribSetup,AttributeSetup."Customer - Item View");
//073>

IF InfoComp."Activar Segmentacion Vistas" AND (("Division Code" <> '') OR


("Item Category Code"<>'') OR ("Product Group Code"<>'')) THEN BEGIN
//<073
RelProduct.RESET;
RelProduct.SETRANGE(Division,"Division Code");
RelProduct.SETRANGE(Category,"Item Category Code");
RelProduct.SETRANGE(Group,"Product Group Code");
IF RelProduct.FINDSET THEN BEGIN
Counter := 10000;
//Delete current attribute values
AttributeValues.SETCURRENTKEY("Link Type","Attribute Code","Link
Field 1");
AttributeValues.SETRANGE("Attribute Code",AttributeSetup.Code);
AttributeValues.SETRANGE("Link Type",AttributeValues."Link
Type"::Item);
AttributeValues.SETRANGE("Link Field 1","No.");
IF NOT AttributeValues.ISEMPTY THEN
IF (GUIALLOWED) AND (NOT CONFIRM(MSG01)) THEN
ERROR(ERR01)
ELSE AttributeValues.DELETEALL;
CLEAR(AttributeValues);

REPEAT
//<073
Counter += 10000;
AttributeValues.INIT;
AttributeValues."Link Type" := AttributeValues."Link Type"::Item;
AttributeValues.VALIDATE("Link Field 1","No.");
AttributeValues.VALIDATE("Attribute Code",AttributeSetup.Code);
AttributeValues.VALIDATE("Attribute Value",RelProduct.Descripcion);
AttributeValues.Sequence := Counter;
AttributeValues.INSERT(TRUE);
UNTIL RelProduct.NEXT = 0;
END ELSE BEGIN
IF GUIALLOWED THEN
IF (("Division Code" <> '') AND ("Item Category Code" <> '') AND
("Product Group Code" <> '')) THEN BEGIN
//If not attribute set error
AttributeValues.RESET;
AttributeValues.SETCURRENTKEY("Link Type","Attribute Code","Link
Field 1");
AttributeValues.SETRANGE("Attribute Code",AttributeSetup.Code);
AttributeValues.SETRANGE("Link Type",AttributeValues."Link
Type"::Item);
AttributeValues.SETRANGE("Link Field 1","No.");
IF AttributeValues.ISEMPTY THEN
ERROR(TextError);
END;
END;
//073>
//<073
//Delete current attribute values
// AttributeValues.SETCURRENTKEY("Attribute Type","Attribute Code","Link
Field 1");
// AttributeValues.SETRANGE("Attribute Code",AttributeSetup.Code);
// AttributeValues.SETRANGE("Attribute Type",AttributeValues."Attribute
Type"::Item);
// AttributeValues.SETRANGE("Link Field 1","No.");
// IF NOT AttributeValues.ISEMPTY THEN
// IF GUIALLOWED AND CONFIRM(TextDeleteCurrentViews,FALSE) THEN
// AttributeValues.DELETEALL;
//073>
END;
END;
END;
//+MRW
END;

[LineStart(2120)]
PROCEDURE UpdateSalesPriceMgmt@1000000009(SalesPrice@1100225001 : Record
7002;ActionToDo@1100225003 : Integer);
VAR
Item@1100225004 : Record 27;
MigrationUpdateMgmt@1100225000 : Record 50132;
CompanyInfo@1100225002 : Record 79;
DateNow@1100225005 : Date;
TimeNow@1100225006 : Time;
DateTimeNow@1100225007 : DateTime;
BEGIN
//+#454270
IF SalesPrice.ISTEMPORARY THEN
EXIT;
CompanyInfo.GET;
IF CompanyInfo."URL Mig. WS" <> '' THEN
EXIT;

CLEAR(MigrationUpdateMgmt);
//MigrationUpdateMgmt.SETCURRENTKEY("Table No.","Item No.","Item No.","Sales
Type","Sales Code","Starting Date","Currency Code","Variant Code","Minimum
Quantity");
MigrationUpdateMgmt.SETRANGE("Table No.", DATABASE::"Sales Price");
MigrationUpdateMgmt.SETRANGE("Item No.", SalesPrice."Item No.");
MigrationUpdateMgmt.SETRANGE("Sales Type", SalesPrice."Sales Type");
MigrationUpdateMgmt.SETRANGE("Sales Code", SalesPrice."Sales Code");
MigrationUpdateMgmt.SETRANGE("Starting Date", SalesPrice."Starting Date");
MigrationUpdateMgmt.SETRANGE("Currency Code", SalesPrice."Currency Code");
MigrationUpdateMgmt.SETRANGE("Variant Code", SalesPrice."Variant Code");
MigrationUpdateMgmt.SETRANGE("Unit of Measure Code", SalesPrice."Unit of
Measure Code");
MigrationUpdateMgmt.SETRANGE("Minimum Quantity", SalesPrice."Minimum
Quantity");
IF NOT MigrationUpdateMgmt.FINDFIRST THEN BEGIN
MigrationUpdateMgmt.INIT;
MigrationUpdateMgmt."Unique ID" := CREATEGUID;
MigrationUpdateMgmt.VALIDATE("Item No.", SalesPrice."Item No.");
MigrationUpdateMgmt.VALIDATE("Sales Type", SalesPrice."Sales Type");
MigrationUpdateMgmt.VALIDATE("Sales Code", SalesPrice."Sales Code");
MigrationUpdateMgmt.VALIDATE("Starting Date", SalesPrice."Starting Date");
MigrationUpdateMgmt.VALIDATE("Currency Code", SalesPrice."Currency Code");
MigrationUpdateMgmt.VALIDATE("Variant Code", SalesPrice."Variant Code");
MigrationUpdateMgmt.VALIDATE("Unit of Measure Code", SalesPrice."Unit of
Measure Code");
MigrationUpdateMgmt.VALIDATE("Minimum Quantity", SalesPrice."Minimum
Quantity");
MigrationUpdateMgmt.VALIDATE("Table No.", DATABASE::"Sales Price");
MigrationUpdateMgmt.INSERT;
END;
UpdateCompanyFields(MigrationUpdateMgmt, TRUE);
MigrationUpdateMgmt."Created Date Time" := CURRENTDATETIME;
MigrationUpdateMgmt."Action ToDo" := ActionToDo;
MigrationUpdateMgmt.MODIFY;

VALIDATE("Last DateTime Modified", CURRENTDATETIME);


VALIDATE("Last Date Modified", DT2DATE(Item."Last DateTime Modified"));
VALIDATE("Last Time Modified", DT2TIME(Item."Last DateTime Modified"));
MODIFY(TRUE);
END;

[LineStart(2164)]
PROCEDURE UpdateCompanyFields@1100225012(VAR MigrationUpdateMgmt@1100225000 :
Record 50132;Value@1100225001 : Boolean);
BEGIN
//+#454270
MigrationUpdateMgmt."Update Company 1" := Value;
MigrationUpdateMgmt."Update Company 2" := Value;
MigrationUpdateMgmt."Update Company 3" := Value;
MigrationUpdateMgmt."Update Company 4" := Value;
MigrationUpdateMgmt."Update Company 5" := Value;
MigrationUpdateMgmt."Update Company 6" := Value;
MigrationUpdateMgmt."Update Company 7" := Value;
MigrationUpdateMgmt."Update Company 8" := Value;
MigrationUpdateMgmt."Update Company 9" := Value;
MigrationUpdateMgmt."Update Company 10" := Value;
MigrationUpdateMgmt."Update Company 11" := Value;
MigrationUpdateMgmt."Update Company 12" := Value;
MigrationUpdateMgmt."Update Company 13" := Value;
MigrationUpdateMgmt."Update Company 14" := Value;
MigrationUpdateMgmt."Update Company 15" := Value;
MigrationUpdateMgmt."Update Company 16" := Value;
MigrationUpdateMgmt."Update Company 17" := Value;
MigrationUpdateMgmt."Update Company 18" := Value;
MigrationUpdateMgmt."Update Company 19" := Value;
MigrationUpdateMgmt."Update Company 20" := Value;
END;

[LineStart(2187)]
PROCEDURE ClasifPrecio@1000000008();
VAR
UnitPriceInclVAT@1000000000 : Decimal;
VATPostingSetup@1000000001 : Record 325;
BEGIN

UnitPriceInclVAT := Rec."Unit Price";


IF NOT Rec."Price Includes VAT" THEN BEGIN
VATPostingSetup.GET("VAT Bus. Posting Gr. (Price)","VAT Prod. Posting
Group");
CASE VATPostingSetup."VAT Calculation Type" OF
VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT":
VATPostingSetup."VAT %" := 0;
VATPostingSetup."VAT Calculation Type"::"Sales Tax":
ERROR(
Text99001507,
FIELDCAPTION("Unit Price Including VAT"),
VATPostingSetup.FIELDCAPTION("VAT Calculation Type"),
VATPostingSetup."VAT Calculation Type");
END;
GetGLSetup;
UnitPriceInclVAT := ROUND(UnitPriceInclVAT * (1 + (VATPostingSetup."VAT
%" / 100)),
GLSetup."Unit-Amount Rounding Precision");
END;

CASE TRUE OF
(UnitPriceInclVAT < 10) : Rec.Precio := Rec.Precio::IMPULSO;
((UnitPriceInclVAT >=10) AND (UnitPriceInclVAT <= 25)) : Rec.Precio :=
Rec.Precio::VOLUMEN;
(UnitPriceInclVAT > 25) : Rec.Precio := Rec.Precio::VALOR;
END;
END;

BEGIN
{
LS = changes made by LS Retail
LS-5257 ZBZ Adjust Item Category and Product Group
LS-5264 FO Added function ReturnTenantMediaForPicture
LS-3723 GH Update "Phys Invt Counting Period Code" according to defaults set
in hierarchy (Div,Cat,Pro)
LS-5383 CC Correction to function CopyFromProductGroup
LS-5893 GH Correct LS markings
LS-6228 GEG fix on Production Time Max limit
LS-5549 ThJ Use "Retail Item List" as default LookupPageID and
DrillDownPageID
LS-6866 CC Added Status filter to Planned Sales Demand flowfield
LS-6900 CC Synching Order Multiple field with Purchase UoM.
LS-6264 EMA New field "Tare Weight" created
LS-7933 ZBZ Skip Maintaining SQL Indexes for Unused Keys
LS-8045 CC Added Replenishment permission check before updating Order
Multiple with Purch. UoM.
LS-8457 ZBZ Create preactions by using EventSubscriber functions
LS-9177 BLL User fields DataClassification set to
EndUserIdentifiableInformation
LS-8785 CM Added new field, Lifecycle Curve Code; Update Lifecycle Starting
Date and Lifecycle Ending Date based on Season.
LS-11034 GSK No need to run delete trigger on Bom components when removing
the parent item. TRUE was removed due to falure in MS TEST's.

-STD026 AITANA 05/07/2011. Gesti�n Packing

-007 apicazo 14/05/2015. PI0007_MRW_9999. Magento


-013 xtrullols 28/10/2015. PI0013_MRW_9999. Obligatorietat de dimensions

-999 jrodriguez 04/04/2016. Init value "Costing Method" = Average


-999 jrodriguez 08/04/2016. New field "CREA Code"
-999 jrodriguez 08/04/2016. Init value "Stockout Warning" & "Evitar negatyvie
stock" = Default
-999 jrodriguez 12/04/2016. New field "Create Date", "Create User ID",
Language Code, Status
-999 jrodriguez 19/04/2016. crear la funcion fxItemDefauktValues
-999 jrodriguez 12/04/2016. New field "Purchaser Code" , "Lista puntos de
uso"
-999 jrodriguez 23/05/2016. New field "Venta en multiplos" --> Si se activa
se pasa info a Magento para vender en multiplos de unidades
-999 jrodriguez 26/08/2016. New field "Release Date" , es de control interno,
no se pasa a ning�n lado
-999 jrodriguez 29/08/2016. New field "Magento Reserve Item B2B" y "Magento
Reserve Item B2C", sirve para indicar en Magento que ese producto es de reserva
-999 jrodriguez 27/10/2016. New field "Copy", "Campaign", "Campaign Year" es
informativo de nuestros productos para filtrar en informes.
-999 jrodriguez 11/01/2017. New field "Uds ventas en multiplos" --> Si se
informa se sube a Magento las unidades m�nimas de venta

-MRW Configuraci�n Vistas en base a Division, grupo y categor�a. 21/08/2017


MRW009 mluque 09/03/2018 Env�o de pedidos a TrustedShops
MRW999 dperez 02/10/2018 Crear campo Expansi�n
MRW999 dperez 20/05/2019 Cambiar Caption de C�d. fabricante (por C�d. marca)
y a�adir Status Descartado

044 OS.XT. 25/11/2016. Gesti�n IVA de autoconsumo (regalos)


062 OS.MM. 19/12/2017. SP20171219_MRW. Propuesta de cajas para picking.
073 OS.AP. 14/05/2018. MRW_SP20180514. Optimizaciones y mejores procesos
Magento.
083 OS.XT. 06/11/2018. MRW_SP20181106_XT. (MRWxxx-Productos Personalizados).
Recibir productos personalizados por WEB, serie y LM
077 dperez 17/12/2018 Gesti�n proyectos. A�adir Table Relation a C�digo CREA
para usar tambi�n en proyectos.
073 dperez 24/01/2019 Cuando no hay vistas configuradas en la empresa salir
073 dperez 25/01/2019 Confirmar elimnaci�n del producto en Magento
096 OS.MM. 29/01/2019. MRW_SP20190129_MM. Camp calculat amb quantitat en
ofertes.
139 OS.MM. 20/06/2019. MRW_SP20190620_MM. Cambiar nombre de campo "N�
campa�a".
174 OS.XT. 24/10/2019. MRW_SP20191024_XT. C�digo de barras en producto
flowfield y item journal line no flowfield
204 OS.SM. 20/02/2020. MRW_SP20200220_SM. Connectivitat API SPLIO
396 OS.SMF.15/03/2021. AN_Magento2. Integraci�n Magento 2.
428 OS.MM. 29/01/2021. MRW_SP20210129_MM. Camp FSC a productes.
431 OS.ACE.04/02/2021. Integraci�n con Canarias
522 OS.XT. 25/05/2021. AN_InformeIgic. Informe IGIC para franquicias
532 OS.XT. 15/06/2021. MRW_SP20210615_XT. Poder enviar descripcions de
Magento juntament amb la informaci� de producte a franqu�cies.
545 OS.OA. 13/08/2021. AN_CMP001_MRW. Dep�sitos proveedor
573 OS.MM. 13/12/2021. Campos Ecoembres en la ficha de producto.

INC-007 fotal 25/07/2022: Stock Magento, a�adir campos de B2B y B2C para no
recalcular stock de manera infinita al abrir la lista de productos.
}
END.
}
}

OBJECT Table 5741 Transfer Line


{
OBJECT-PROPERTIES
{
Date=13/11/23;
Time=11:21:20;
Modified=Yes;
Version
List=NAVW114.01,LSW113.0.00.775,AITANA,007,MRW023,OS,377,431,528,#585464;
}
PROPERTIES
{
OnInsert=VAR
TransLine2@1000 : Record 5741;
BEGIN
TestStatusOpen;
IF NOT GlobalSkipLineNoInsert THEN BEGIN //<528
//LS-7685 IF "Line No." = 0 THEN BEGIN //LS
TransLine2.RESET;
TransLine2.SETFILTER("Document No.",TransHeader."No.");
IF TransLine2.FINDLAST THEN
"Line No." := TransLine2."Line No." + 10000;
//LS-7685 END; //LS
END; //<528
ReserveTransferLine.VerifyQuantity(Rec,xRec);
END;

OnModify=BEGIN
IF ItemExists(xRec."Item No.") THEN
ReserveTransferLine.VerifyChange(Rec,xRec);
END;

OnDelete=VAR
ItemChargeAssgntPurch@1000 : Record 5805;
lFcDeliveryTrans@1100409000 : Record 10012611;
ItemUpdateManagement@7141743 : Record 50003;
BEGIN
TestStatusOpen;

TESTFIELD("Quantity Shipped","Quantity Received");


TESTFIELD("Qty. Shipped (Base)","Qty. Received (Base)");
CALCFIELDS("Reserved Qty. Inbnd. (Base)","Reserved Qty. Outbnd.
(Base)");
TESTFIELD("Reserved Qty. Inbnd. (Base)",0);
TESTFIELD("Reserved Qty. Outbnd. (Base)",0);

ReserveTransferLine.DeleteLine(Rec);
WhseValidateSourceLine.TransLineDelete(Rec);
ItemChargeAssgntPurch.SETCURRENTKEY(
"Applies-to Doc. Type","Applies-to Doc. No.","Applies-to Doc. Line
No.");
ItemChargeAssgntPurch.SETRANGE("Applies-to Doc.
Type",ItemChargeAssgntPurch."Applies-to Doc. Type"::"Transfer Receipt");
ItemChargeAssgntPurch.SETRANGE("Applies-to Doc. No.","Document
No.");
ItemChargeAssgntPurch.SETRANGE("Applies-to Doc. Line No.","Line
No.");
ItemChargeAssgntPurch.DELETEALL(TRUE);

//LS-7709//
//LS -
// Item.GET("Item No.");
// IF Item."Fuel Item" THEN BEGIN
// lFcDeliveryTrans.SETCURRENTKEY("Document Type","Document
No.","Line No.");
// lFcDeliveryTrans.SETRANGE("Document
Type",lFcDeliveryTrans."Document Type"::"2");
// lFcDeliveryTrans.SETRANGE("Document No.", "Document No.");
// lFcDeliveryTrans.SETRANGE("Line No.", "Line No.");
// lFcDeliveryTrans.SETRANGE(Received, FALSE);
// IF lFcDeliveryTrans.FINDSET(TRUE,TRUE) THEN
// REPEAT
// lFcDeliveryTrans."Document Type" :=
lFcDeliveryTrans."Document Type"::"0";
// lFcDeliveryTrans."Document No." := '';
// lFcDeliveryTrans."Line No." := 0;
// lFcDeliveryTrans.MODIFY(TRUE);
// UNTIL lFcDeliveryTrans.NEXT = 0;
// END;
//LS +
//LS-7709//

//-007
// AGV-000 ==>
// ItemUpdateManagement.ItemStatus("Item No.","Variant Code",TRUE);
// AGV-000 <==
//+007
END;

OnRename=BEGIN
ERROR(Text001,TABLECAPTION);
END;

CaptionML=[ENU=Transfer Line;
ESP=L¡n. transferencia];
LookupPageID=Page5749;
DrillDownPageID=Page5749;
}
FIELDS
{
{ 1 ; ;Document No. ;Code20 ;CaptionML=[ENU=Document No.;
ESP=N§ documento] }
{ 2 ; ;Line No. ;Integer ;CaptionML=[ENU=Line No.;
ESP=N§ l¡nea] }
{ 3 ; ;Item No. ;Code20 ;TableRelation=Item WHERE
(Type=CONST(Inventory),
Blocked=CONST(No));
OnValidate=VAR

TempTransferLine@1000 : TEMPORARY Record 5741;

ItemStatusLink@1100409000 : Record 10001404;

BOUtils@1200070000 : Codeunit 99001452;


ReturnValue@1001 :
Text[50];
BEGIN
TESTFIELD("Quantity
Shipped",0);
IF CurrFieldNo <> 0
THEN
TestStatusOpen;

Item.TryGetItemNo(ReturnValue,"Item No.",TRUE);
"Item No." :=
COPYSTR(ReturnValue,1,MAXSTRLEN("Item No."));

ReserveTransferLine.VerifyChange(Rec,xRec);

CALCFIELDS("Reserved Qty. Inbnd. (Base)");


TESTFIELD("Reserved
Qty. Inbnd. (Base)",0);

WhseValidateSourceLine.TransLineVerifyChange(Rec,xRec);

TempTransferLine :=
Rec;
INIT;
"Item No." :=
TempTransferLine."Item No.";
IF "Item No." = ''
THEN
EXIT;

//LS -
IF
BOUtils.IsBlockTransfering("Item No.",'',"Variant Code",'',"Transfer-from
Code",TODAY,ItemStatusLink) THEN
ERROR(
Text10000700,

FIELDCAPTION("Item No."),"Item No.",

ItemStatusLink."Item No.",ItemStatusLink."Variant Dimension 1


Code",ItemStatusLink."Variant Code",

ItemStatusLink."Store Group Code",ItemStatusLink."Location


Code",ItemStatusLink."Starting Date");
//LS +

GetTransHeader;
GetItem;

GetDefaultBin("Transfer-from Code","Transfer-to Code");


Item.TESTFIELD(Blocked,FALSE);

Item.TESTFIELD(Type,Item.Type::Inventory);

Description :=
Item.Description;
"Description 2" :=
Item."Description 2";
VALIDATE("Gen.
Prod. Posting Group",Item."Gen. Prod. Posting Group");
VALIDATE("Inventory
Posting Group",Item."Inventory Posting Group");

VALIDATE(Quantity,xRec.Quantity);
VALIDATE("Unit of
Measure Code",Item."Base Unit of Measure");
VALIDATE("Gross
Weight",Item."Gross Weight");
VALIDATE("Net
Weight",Item."Net Weight");
VALIDATE("Unit
Volume",Item."Unit Volume");
VALIDATE("Units per
Parcel",Item."Units per Parcel");
Division :=
Item."Division Code"; //LS
"Item Category
Code" := Item."Item Category Code";

CreateDim(DATABASE::Item,"Item No.");

DimMgt.UpdateGlobalDimFromDimSetID("Dimension Set ID","Shortcut Dimension 1


Code","Shortcut Dimension 2 Code");
END;

ValidateTableRelation=No;
CaptionML=[ENU=Item No.;
ESP=N� producto] }
{ 4 ; ;Quantity ;Decimal ;OnValidate=VAR

IsHandled@1100225000 : Boolean;

ItemUpdateManagement@7141743 : Record 50003;


BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;
IF Quantity <> 0
THEN
TESTFIELD("Item
No.");
"Quantity
(Base)" := CalcBaseQty(Quantity);
IF ((Quantity *
"Quantity Shipped") < 0) OR
(ABS(Quantity) <
ABS("Quantity Shipped"))
THEN

FIELDERROR(Quantity,STRSUBSTNO(Text002,FIELDCAPTION("Quantity Shipped")));
IF (("Quantity
(Base)" * "Qty. Shipped (Base)") < 0) OR
(ABS("Quantity
(Base)") < ABS("Qty. Received (Base)"))
THEN

FIELDERROR("Quantity (Base)",STRSUBSTNO(Text002,FIELDCAPTION("Qty. Shipped


(Base)")));
InitQtyInTransit;
InitOutstandingQty;
InitQtyToShip;
InitQtyToReceive;

CheckItemAvailable(FIELDNO(Quantity));

ReserveTransferLine.VerifyQuantity(Rec,xRec);

UpdateWithWarehouseShipReceive;

IsHandled := FALSE;

OnValidateQuantityOnBeforeTransLineVerifyChange(Rec,xRec,IsHandled);
IF NOT IsHandled
THEN

WhseValidateSourceLine.TransLineVerifyChange(Rec,xRec);

//-007
IF (xRec.Quantity
<> Quantity) THEN

ItemUpdateManagement.ItemStatus("Item No.","Variant Code",TRUE);


//+007
END;

CaptionML=[ENU=Quantity;
ESP=Cantidad];
DecimalPlaces=0:5;
MinValue=0 }
{ 5 ; ;Unit of Measure ;Text50 ;OnValidate=BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;
END;

CaptionML=[ENU=Unit of Measure;
ESP=Unidad medida] }
{ 6 ; ;Qty. to Ship ;Decimal ;OnValidate=BEGIN

GetLocation("Transfer-from Code");
IF CurrFieldNo <> 0
THEN BEGIN
IF
Location."Require Shipment" AND
("Qty. to
Ship" <> 0)
THEN

CheckWarehouse("Transfer-from Code",FALSE);

WhseValidateSourceLine.TransLineVerifyChange(Rec,xRec);
END;

IF "Qty. to Ship" >


"Outstanding Quantity" THEN
IF "Outstanding
Quantity" > 0 THEN
ERROR(
Text005,
"Outstanding
Quantity")
ELSE
ERROR(Text006);
"Qty. to Ship
(Base)" := CalcBaseQty("Qty. to Ship");

IF ("In-Transit
Code" = '') AND ("Quantity Shipped" = "Quantity Received") THEN
VALIDATE("Qty. to
Receive","Qty. to Ship");
//LS-8656//
// IF "InStore
Document Status" >= "InStore Document Status"::Valid THEN BEGIN
// IF NOT
InStoreFunc.IsTransferSplitAllowed THEN
// IF ("Quantity
Shipped" <> Quantity) AND ("Qty. to Ship" <> Quantity) THEN
//
ERROR(LSText002,Quantity);
// END;
//LS-8656//
END;

CaptionML=[ENU=Qty. to Ship;
ESP=Cantidad a
enviar];
DecimalPlaces=0:5;
MinValue=0 }
{ 7 ; ;Qty. to Receive ;Decimal ;OnValidate=BEGIN

GetLocation("Transfer-to Code");
IF CurrFieldNo <> 0
THEN BEGIN
IF
Location."Require Receive" AND
("Qty. to
Receive" <> 0)
THEN

CheckWarehouse("Transfer-to Code",TRUE);

WhseValidateSourceLine.TransLineVerifyChange(Rec,xRec);
END;

GetTransferHeaderNoVerification;

IF NOT
TransHeader."Direct Transfer" AND ("Direct Transfer" = xRec."Direct Transfer") THEN
IF "Qty. to
Receive" > "Qty. in Transit" THEN
IF "Qty. in
Transit" > 0 THEN
ERROR(
Text008,
"Qty. in
Transit")
ELSE

ERROR(Text009);
"Qty. to Receive
(Base)" := CalcBaseQty("Qty. to Receive");

//LS-8656//
// IF "InStore
Document Status" = "InStore Document Status"::"2" THEN BEGIN
// IF ("Qty. to
Receive" <> "Qty. in Transit") THEN
//
ERROR(LSText001,"Qty. in Transit");
// END;
//LS-8656//
END;

CaptionML=[ENU=Qty. to Receive;
ESP=Cantidad a
recibir];
DecimalPlaces=0:5;
MinValue=0 }
{ 8 ; ;Quantity Shipped ;Decimal ;OnValidate=BEGIN
"Qty. Shipped
(Base)" := CalcBaseQty("Quantity Shipped");
InitQtyInTransit;
InitOutstandingQty;
InitQtyToShip;
InitQtyToReceive;
END;

CaptionML=[ENU=Quantity Shipped;
ESP=Cantidad
enviada];
DecimalPlaces=0:5;
Editable=Yes }
{ 9 ; ;Quantity Received ;Decimal ;OnValidate=BEGIN
"Qty. Received
(Base)" := CalcBaseQty("Quantity Received");
InitQtyInTransit;
InitOutstandingQty;
InitQtyToReceive;
END;
CaptionML=[ENU=Quantity
Received;
ESP=Cantidad
recibida];
DecimalPlaces=0:5;
Editable=No }
{ 10 ; ;Status ;Option ;CaptionML=[ENU=Status;
ESP=Estado];

OptionCaptionML=[ENU=Open,Released;

ESP=Abierto,Lanzado];
OptionString=Open,Released;
Editable=No }
{ 11 ; ;Shortcut Dimension 1 Code;Code20 ;TableRelation="Dimension
Value".Code WHERE (Global Dimension No.=CONST(1));
OnValidate=BEGIN

ValidateShortcutDimCode(1,"Shortcut Dimension 1 Code");


END;

CaptionML=[ENU=Shortcut
Dimension 1 Code;
ESP=C¢d. dim. acceso
dir. 1];
CaptionClass='1,2,1' }
{ 12 ; ;Shortcut Dimension 2 Code;Code20 ;TableRelation="Dimension
Value".Code WHERE (Global Dimension No.=CONST(2));
OnValidate=BEGIN

ValidateShortcutDimCode(2,"Shortcut Dimension 2 Code");


END;

CaptionML=[ENU=Shortcut
Dimension 2 Code;
ESP=C¢d. dim. acceso
dir. 2];
CaptionClass='1,2,2' }
{ 13 ; ;Description ;Text100 ;TableRelation=Item WHERE
(Type=CONST(Inventory),

Blocked=CONST(No));
OnValidate=VAR
Item@1001 : Record
27;
ReturnValue@1003 :
Text[50];

ItemDescriptionIsNo@1000 : Boolean;
BEGIN
IF
(STRLEN(Description) <= MAXSTRLEN(Item."No.")) AND ("Item No." <> '') THEN

ItemDescriptionIsNo := Item.GET(Description);

IF ("Item No." <>


'') AND (NOT ItemDescriptionIsNo) AND (Description <> '') THEN BEGIN

Item.SETFILTER(Description,'''@' + CONVERTSTR(Description,'''','?') + '''');


IF NOT
Item.FINDFIRST THEN
EXIT;
IF Item."No." =
"Item No." THEN
EXIT;
IF
CONFIRM(AnotherItemWithSameDescrQst,FALSE,Item."No.",Item.Description) THEN
VALIDATE("Item
No.",Item."No.");
EXIT;
END;

IF
Item.TryGetItemNoOpenCard(ReturnValue,Description,FALSE,TRUE,TRUE) THEN
CASE ReturnValue
OF
'':

Description := xRec.Description;
"Item No.":

Description := xRec.Description;
ELSE BEGIN

CurrFieldNo := FIELDNO("Item No.");

VALIDATE("Item No.",COPYSTR(ReturnValue,1,MAXSTRLEN(Item."No.")));
END;
END;

IF "Item No." <> ''


THEN
GetItem;
END;

ValidateTableRelation=No;
CaptionML=[ENU=Description;
ESP=Descripci¢n] }
{ 14 ; ;Gen. Prod. Posting Group;Code20 ;TableRelation="Gen. Product
Posting Group";
OnValidate=BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;
END;

CaptionML=[ENU=Gen. Prod.
Posting Group;
ESP=Grupo registro
prod. gen.] }
{ 15 ; ;Inventory Posting Group;Code20 ;TableRelation="Inventory Posting
Group";
OnValidate=BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;
END;
CaptionML=[ENU=Inventory Posting
Group;
ESP=Grupo registro
inventario] }
{ 16 ; ;Quantity (Base) ;Decimal ;OnValidate=BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;
TESTFIELD("Qty. per
Unit of Measure",1);

VALIDATE(Quantity,"Quantity (Base)");
END;

CaptionML=[ENU=Quantity (Base);
ESP=Cantidad (base)];
DecimalPlaces=0:5;
MinValue=0;
Description=OS, }
{ 17 ; ;Outstanding Qty. (Base);Decimal ;CaptionML=[ENU=Outstanding Qty.
(Base);
ESP=Cant. pendiente
(base)];
DecimalPlaces=0:5;
Editable=No }
{ 18 ; ;Qty. to Ship (Base) ;Decimal ;OnValidate=BEGIN
TESTFIELD("Qty. per
Unit of Measure",1);
VALIDATE("Qty. to
Ship","Qty. to Ship (Base)");
END;

CaptionML=[ENU=Qty. to Ship
(Base);
ESP=Cant. a enviar
(base)];
DecimalPlaces=0:5;
MinValue=0 }
{ 19 ; ;Qty. Shipped (Base) ;Decimal ;CaptionML=[ENU=Qty. Shipped
(Base);
ESP=Cant. enviada
(base)];
DecimalPlaces=0:5;
Editable=Yes }
{ 20 ; ;Qty. to Receive (Base);Decimal ;OnValidate=BEGIN
TESTFIELD("Qty. per
Unit of Measure",1);
VALIDATE("Qty. to
Receive","Qty. to Receive (Base)");
END;

CaptionML=[ENU=Qty. to Receive
(Base);
ESP=Cant. a recibir
(base)];
DecimalPlaces=0:5;
MinValue=0 }
{ 21 ; ;Qty. Received (Base);Decimal ;CaptionML=[ENU=Qty. Received
(Base);
ESP=Cant. recibida
(base)];
DecimalPlaces=0:5;
Editable=No }
{ 22 ; ;Qty. per Unit of Measure;Decimal ;InitValue=1;
CaptionML=[ENU=Qty. per Unit of
Measure;
ESP=Cant. por unidad
medida];
DecimalPlaces=0:5;
Editable=No }
{ 23 ; ;Unit of Measure Code;Code10 ;TableRelation="Item Unit of
Measure".Code WHERE (Item No.=FIELD(Item No.));
OnValidate=VAR

UnitOfMeasure@1000 : Record 204;


UOMMgt@1001 :
Codeunit 5402;
BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;
TESTFIELD("Quantity
Shipped",0);
TESTFIELD("Qty.
Shipped (Base)",0);
TESTFIELD("Quantity
Received",0);
TESTFIELD("Qty.
Received (Base)",0);

ReserveTransferLine.VerifyChange(Rec,xRec);

WhseValidateSourceLine.TransLineVerifyChange(Rec,xRec);
IF "Unit of Measure
Code" = '' THEN
"Unit of Measure"
:= ''
ELSE BEGIN
IF NOT
UnitOfMeasure.GET("Unit of Measure Code") THEN

UnitOfMeasure.INIT;
"Unit of Measure"
:= UnitOfMeasure.Description;
END;
GetItem;
VALIDATE("Qty. per
Unit of Measure",UOMMgt.GetQtyPerUnitOfMeasure(Item,"Unit of Measure Code"));
"Gross Weight" :=
Item."Gross Weight" * "Qty. per Unit of Measure";
"Net Weight" :=
Item."Net Weight" * "Qty. per Unit of Measure";
"Unit Volume" :=
Item."Unit Volume" * "Qty. per Unit of Measure";
"Units per
Parcel" := ROUND(Item."Units per Parcel" / "Qty. per Unit of
Measure",UOMMgt.QtyRndPrecision);
VALIDATE(Quantity);
END;

CaptionML=[ENU=Unit of Measure
Code;
ESP=C¢d. unidad
medida] }
{ 24 ; ;Outstanding Quantity;Decimal ;CaptionML=[ENU=Outstanding
Quantity;
ESP=Cantidad
pendiente];
DecimalPlaces=0:5;
Editable=No }
{ 25 ; ;Gross Weight ;Decimal ;CaptionML=[ENU=Gross Weight;
ESP=Peso bruto];
DecimalPlaces=0:5 }
{ 26 ; ;Net Weight ;Decimal ;CaptionML=[ENU=Net Weight;
ESP=Peso neto];
DecimalPlaces=0:5 }
{ 27 ; ;Unit Volume ;Decimal ;CaptionML=[ENU=Unit Volume;
ESP=Volumen];
DecimalPlaces=0:5 }
{ 30 ; ;Variant Code ;Code10 ;TableRelation="Item
Variant".Code WHERE (Item No.=FIELD(Item No.));
OnValidate=VAR
ItemVariant@1000 :
Record 5401;

ItemStatusLink@1100409000 : Record 10001404;


BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;

//LS -
IF
BOUtils.IsBlockTransfering("Item No.",'',"Variant Code",'',"Transfer-from
Code",TODAY,ItemStatusLink) THEN
ERROR(
Text10000700,

FIELDCAPTION("Item No."),"Item No.",

ItemStatusLink."Item No.",ItemStatusLink."Variant Dimension 1


Code",ItemStatusLink."Variant Code",

ItemStatusLink."Store Group Code",ItemStatusLink."Location


Code",ItemStatusLink."Starting Date");
//LS +

ReserveTransferLine.VerifyChange(Rec,xRec);

WhseValidateSourceLine.TransLineVerifyChange(Rec,xRec);

IF "Variant Code" =
'' THEN
EXIT;
GetDefaultBin("Transfer-from Code","Transfer-to Code");

ItemVariant.GET("Item No.","Variant Code");


Description :=
ItemVariant.Description;
"Description 2" :=
ItemVariant."Description 2";

CheckItemAvailable(FIELDNO("Variant Code"));
END;

CaptionML=[ENU=Variant Code;
ESP=C¢d. variante] }
{ 31 ; ;Units per Parcel ;Decimal ;CaptionML=[ENU=Units per Parcel;
ESP=Unidades por
lote];
DecimalPlaces=0:5 }
{ 32 ; ;Description 2 ;Text50 ;CaptionML=[ENU=Description 2;
ESP=Descripci¢n 2] }
{ 33 ; ;In-Transit Code ;Code10 ;TableRelation=Location WHERE
(Use As In-Transit=CONST(Yes));
OnValidate=BEGIN
TESTFIELD("Quantity
Shipped",0);
END;

CaptionML=[ENU=In-Transit Code;
ESP=C¢d. en
tr nsito];
Editable=No }
{ 34 ; ;Qty. in Transit ;Decimal ;CaptionML=[ENU=Qty. in Transit;
ESP=Cant. en
tr nsito];
DecimalPlaces=0:5;
Editable=No }
{ 35 ; ;Qty. in Transit (Base);Decimal ;CaptionML=[ENU=Qty. in Transit
(Base);
ESP=Cant. en tr nsito
(base)];
DecimalPlaces=0:5;
Editable=No }
{ 36 ; ;Transfer-from Code ;Code10 ;TableRelation=Location;
OnValidate=VAR

ItemStatusLink@1100409000 : Record 10001404;


BEGIN
TESTFIELD("Quantity
Shipped",0);
IF CurrFieldNo <> 0
THEN
TestStatusOpen;
IF "Transfer-from
Code" <> xRec."Transfer-from Code" THEN BEGIN
"Transfer-from
Bin Code" := '';

GetDefaultBin("Transfer-from Code",'');
END;
CheckItemAvailable(FIELDNO("Transfer-from Code"));

ReserveTransferLine.VerifyChange(Rec,xRec);

UpdateWithWarehouseShipReceive;

WhseValidateSourceLine.TransLineVerifyChange(Rec,xRec);

//LS-8656
UpdateInStoreDocStatus(); //LS
//LS -
IF
BOUtils.IsBlockTransfering("Item No.",'',"Variant Code",'',"Transfer-from
Code",TODAY,ItemStatusLink) THEN
ERROR(
Text10000700,

FIELDCAPTION("Item No."),"Item No.",

ItemStatusLink."Item No.",ItemStatusLink."Variant Dimension 1


Code",ItemStatusLink."Variant Code",

ItemStatusLink."Store Group Code",ItemStatusLink."Location


Code",ItemStatusLink."Starting Date");
//LS +
END;

CaptionML=[ENU=Transfer-from
Code;
ESP=Transfer. desde-c
¢d.];
Editable=No }
{ 37 ; ;Transfer-to Code ;Code10 ;TableRelation=Location;
OnValidate=BEGIN
TESTFIELD("Quantity
Shipped",0);
IF CurrFieldNo <> 0
THEN
TestStatusOpen;
IF "Transfer-to
Code" <> xRec."Transfer-to Code" THEN BEGIN
"Transfer-To Bin
Code" := '';

GetDefaultBin('',"Transfer-to Code");
END;

ReserveTransferLine.VerifyChange(Rec,xRec);

UpdateWithWarehouseShipReceive;

WhseValidateSourceLine.TransLineVerifyChange(Rec,xRec);

//LS-8656
UpdateInStoreDocStatus(); //LS
END;
CaptionML=[ENU=Transfer-to Code;
ESP=Transfer. a-c
¢d.];
Editable=No }
{ 38 ; ;Shipment Date ;Date ;OnValidate=BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;

TransferRoute.CalcReceiptDate("Shipment Date","Receipt Date",


"Shipping
Time","Outbound Whse. Handling Time","Inbound Whse. Handling Time",
"Transfer-from
Code","Transfer-to Code","Shipping Agent Code","Shipping Agent Service Code");

CheckItemAvailable(FIELDNO("Shipment Date"));
DateConflictCheck;
END;

CaptionML=[ENU=Shipment Date;
ESP=Fecha env¡o] }
{ 39 ; ;Receipt Date ;Date ;OnValidate=BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;

TransferRoute.CalcShipmentDate("Shipment Date","Receipt Date",


"Shipping
Time","Outbound Whse. Handling Time","Inbound Whse. Handling Time",
"Transfer-from
Code","Transfer-to Code","Shipping Agent Code","Shipping Agent Service Code");

CheckItemAvailable(FIELDNO("Shipment Date"));
DateConflictCheck;
END;

CaptionML=[ENU=Receipt Date;
ESP=Fecha recepci
¢n] }
{ 40 ; ;Derived From Line No.;Integer ;TableRelation="Transfer
Line"."Line No." WHERE (Document No.=FIELD(Document No.));
CaptionML=[ENU=Derived From Line
No.;
ESP=Proviene de n§
l¡nea] }
{ 41 ; ;Shipping Agent Code ;Code10 ;TableRelation="Shipping Agent";
OnValidate=BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;
IF "Shipping Agent
Code" <> xRec."Shipping Agent Code" THEN

VALIDATE("Shipping Agent Service Code",'');


END;

AccessByPermission=TableData
5790=R;
CaptionML=[ENU=Shipping Agent
Code;
ESP=C¢d.
transportista] }
{ 42 ; ;Shipping Agent Service Code;Code10 ;TableRelation="Shipping Agent
Services".Code WHERE (Shipping Agent Code=FIELD(Shipping Agent Code));
OnValidate=BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;

TransferRoute.GetShippingTime(
"Transfer-from
Code","Transfer-to Code",
"Shipping Agent
Code","Shipping Agent Service Code",
"Shipping Time");

TransferRoute.CalcReceiptDate("Shipment Date","Receipt Date",


"Shipping
Time","Outbound Whse. Handling Time","Inbound Whse. Handling Time",
"Transfer-from
Code","Transfer-to Code","Shipping Agent Code","Shipping Agent Service Code");

CheckItemAvailable(FIELDNO("Shipping Agent Service Code"));


DateConflictCheck;
END;

CaptionML=[ENU=Shipping Agent
Service Code;
ESP=C¢d. servicio
transportista] }
{ 43 ; ;Appl.-to Item Entry ;Integer ;OnValidate=VAR

ItemLedgEntry@1000 : Record 32;

ItemTrackingLines@1001 : Page 6510;


BEGIN
IF "Appl.-to Item
Entry" <> 0 THEN BEGIN

TESTFIELD(Quantity);

ItemLedgEntry.GET("Appl.-to Item Entry");

ItemLedgEntry.TESTFIELD(Positive,TRUE);
IF
(ItemLedgEntry."Lot No." <> '') OR (ItemLedgEntry."Serial No." <> '') THEN

ERROR(MustUseTrackingErr,ItemTrackingLines.CAPTION,FIELDCAPTION("Appl.-to Item
Entry"));
IF ABS("Qty. to
Ship (Base)") > ItemLedgEntry.Quantity THEN

ERROR(ShippingMoreUnitsThanReceivedErr,ItemLedgEntry.Quantity,ItemLedgEntry."Docume
nt No.");

ItemLedgEntry.TESTFIELD("Location Code","Transfer-from Code");


IF NOT
ItemLedgEntry.Open THEN

MESSAGE(LedgEntryWillBeOpenedMsg,"Appl.-to Item Entry");


END;
END;

OnLookup=BEGIN

SelectItemEntry(FIELDNO("Appl.-to Item Entry"));


END;

AccessByPermission=TableData
27=R;
CaptionML=[ENU=Appl.-to Item
Entry;
ESP=Liq. por n§ orden
producto] }
{ 50 ; ;Reserved Quantity Inbnd.;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Reservation
Entry".Quantity WHERE (Source ID=FIELD(Document No.),

Source Ref. No.=FIELD(Line No.),

Source Type=CONST(5741),

Source Subtype=CONST(1),

Source Prod. Order Line=FIELD(Derived From Line No.),

Reservation Status=CONST(Reservation)));
CaptionML=[ENU=Reserved Quantity
Inbnd.;
ESP=Cant. reservada
entrada];
DecimalPlaces=0:5;
Editable=No }
{ 51 ; ;Reserved Quantity Outbnd.;Decimal ;FieldClass=FlowField;
CalcFormula=-Sum("Reservation
Entry".Quantity WHERE (Source ID=FIELD(Document No.),

Source Ref. No.=FIELD(Line No.),

Source Type=CONST(5741),

Source Subtype=CONST(0),

Source Prod. Order Line=FIELD(Derived From Line No.),

Reservation Status=CONST(Reservation)));
CaptionML=[ENU=Reserved Quantity
Outbnd.;
ESP=Cant. reservada
salida];
DecimalPlaces=0:5;
Editable=No }
{ 52 ; ;Reserved Qty. Inbnd. (Base);Decimal;FieldClass=FlowField;
CalcFormula=Sum("Reservation
Entry"."Quantity (Base)" WHERE (Source ID=FIELD(Document No.),
Source Ref. No.=FIELD(Line No.),

Source Type=CONST(5741),

Source Subtype=CONST(1),

Source Prod. Order Line=FIELD(Derived From Line No.),

Reservation Status=CONST(Reservation)));
CaptionML=[ENU=Reserved Qty.
Inbnd. (Base);
ESP=Cant. reservada
entrada (base)];
DecimalPlaces=0:5;
Editable=No }
{ 53 ; ;Reserved Qty. Outbnd. (Base);Decimal;
FieldClass=FlowField;
CalcFormula=-Sum("Reservation
Entry"."Quantity (Base)" WHERE (Source ID=FIELD(Document No.),

Source Ref. No.=FIELD(Line No.),

Source Type=CONST(5741),

Source Subtype=CONST(0),

Source Prod. Order Line=FIELD(Derived From Line No.),

Reservation Status=CONST(Reservation)));
CaptionML=[ENU=Reserved Qty.
Outbnd. (Base);
ESP=Cant. reservada
salida (base)];
DecimalPlaces=0:5;
Editable=No }
{ 54 ; ;Shipping Time ;DateFormula ;OnValidate=BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;

TransferRoute.CalcReceiptDate("Shipment Date","Receipt Date",


"Shipping
Time","Outbound Whse. Handling Time","Inbound Whse. Handling Time",
"Transfer-from
Code","Transfer-to Code","Shipping Agent Code","Shipping Agent Service Code");
DateConflictCheck;
END;

AccessByPermission=TableData
5790=R;
CaptionML=[ENU=Shipping Time;
ESP=Tiempo env¡o] }
{ 55 ; ;Reserved Quantity Shipped;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Reservation
Entry".Quantity WHERE (Source ID=FIELD(Document No.),

Source Ref. No.=FILTER(<>0),


Source Type=CONST(5741),

Source Subtype=CONST(1),

Source Prod. Order Line=FIELD(Line No.),

Reservation Status=CONST(Reservation)));
CaptionML=[ENU=Reserved Quantity
Shipped;
ESP=Env¡o de cantidad
reservada];
DecimalPlaces=0:5;
Editable=No }
{ 56 ; ;Reserved Qty. Shipped (Base);Decimal;
FieldClass=FlowField;
CalcFormula=Sum("Reservation
Entry"."Quantity (Base)" WHERE (Source ID=FIELD(Document No.),

Source Ref. No.=FILTER(<>0),

Source Type=CONST(5741),

Source Subtype=CONST(1),

Source Prod. Order Line=FIELD(Line No.),

Reservation Status=CONST(Reservation)));
CaptionML=[ENU=Reserved Qty.
Shipped (Base);
ESP=Env¡o cant.
reservada (base)];
DecimalPlaces=0:5;
Editable=No }
{ 70 ; ;Direct Transfer ;Boolean ;CaptionML=[ENU=Direct Transfer;
ESP=Transferencia
directa] }
{ 480 ; ;Dimension Set ID ;Integer ;TableRelation="Dimension Set
Entry";
OnValidate=BEGIN

DimMgt.UpdateGlobalDimFromDimSetID("Dimension Set ID","Shortcut Dimension 1


Code","Shortcut Dimension 2 Code");
END;

OnLookup=BEGIN
ShowDimensions;
END;

CaptionML=[ENU=Dimension Set ID;


ESP=Id. grupo
dimensiones];
Editable=No }
{ 5704; ;Item Category Code ;Code20 ;TableRelation="Item Category";
CaptionML=[ENU=Item Category
Code;
ESP=C¢d. categor¡a
producto] }
{ 5707; ;Product Group Code ;Code10 ;TableRelation="Product
Group".Code WHERE (Item Category Code=FIELD(Item Category Code));
ValidateTableRelation=No;
ObsoleteReason=Product Groups
became first level children of Item Categories.;
CaptionML=[ENU=Product Group
Code;
ESP=C¢d. grupo
producto] }
{ 5750; ;Whse. Inbnd. Otsdg. Qty (Base);Decimal;
FieldClass=FlowField;
CalcFormula=Sum("Warehouse
Receipt Line"."Qty. Outstanding (Base)" WHERE (Source Type=CONST(5741),

Source Subtype=CONST(1),

Source No.=FIELD(Document No.),

Source Line No.=FIELD(Line No.)));


CaptionML=[ENU=Whse. Inbnd.
Otsdg. Qty (Base);
ESP=Cant. pdte.
entrada alm.(base)];
DecimalPlaces=0:5;
BlankZero=Yes;
Editable=No }
{ 5751; ;Whse Outbnd. Otsdg. Qty (Base);Decimal;
FieldClass=FlowField;
CalcFormula=Sum("Warehouse
Shipment Line"."Qty. Outstanding (Base)" WHERE (Source Type=CONST(5741),

Source Subtype=CONST(0),

Source No.=FIELD(Document No.),

Source Line No.=FIELD(Line No.)));


CaptionML=[ENU=Whse Outbnd.
Otsdg. Qty (Base);
ESP=Cant. pdte.
salida alm. (base)];
DecimalPlaces=0:5;
BlankZero=Yes;
Editable=No }
{ 5752; ;Completely Shipped ;Boolean ;CaptionML=[ENU=Completely
Shipped;
ESP=Enviado
completamente];
Editable=No }
{ 5753; ;Completely Received ;Boolean ;CaptionML=[ENU=Completely
Received;
ESP=Recibido
completamente];
Editable=No }
{ 5793; ;Outbound Whse. Handling Time;DateFormula;
OnValidate=BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;

TransferRoute.CalcReceiptDate("Shipment Date","Receipt Date",


"Shipping
Time","Outbound Whse. Handling Time","Inbound Whse. Handling Time",
"Transfer-from
Code","Transfer-to Code","Shipping Agent Code","Shipping Agent Service Code");
DateConflictCheck;
END;

CaptionML=[ENU=Outbound Whse.
Handling Time;
ESP=Tiempo manip.
alm. salida] }
{ 5794; ;Inbound Whse. Handling Time;DateFormula;
OnValidate=BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;

TransferRoute.CalcReceiptDate("Shipment Date","Receipt Date",


"Shipping
Time","Outbound Whse. Handling Time","Inbound Whse. Handling Time",
"Transfer-from
Code","Transfer-to Code","Shipping Agent Code","Shipping Agent Service Code");
DateConflictCheck;
END;

CaptionML=[ENU=Inbound Whse.
Handling Time;
ESP=Tiempo manip.
alm. entrada] }
{ 7300; ;Transfer-from Bin Code;Code20 ;TableRelation="Bin Content"."Bin
Code" WHERE (Location Code=FIELD(Transfer-from Code),

Item No.=FIELD(Item No.),

Variant Code=FIELD(Variant Code));


OnValidate=BEGIN
IF "Transfer-from
Bin Code" <> xRec."Transfer-from Bin Code" THEN BEGIN

TESTFIELD("Transfer-from Code");
IF "Transfer-from
Bin Code" <> '' THEN BEGIN

GetLocation("Transfer-from Code");

Location.TESTFIELD("Bin Mandatory");

Location.TESTFIELD("Directed Put-away and Pick",FALSE);

GetBin("Transfer-from Code","Transfer-from Bin Code");

TESTFIELD("Transfer-from Code",Bin."Location Code");

HandleDedicatedBin(TRUE);
END;
END;
END;

CaptionML=[ENU=Transfer-from Bin
Code;
ESP=Transfer.desde-c
¢d. ubic.] }
{ 7301; ;Transfer-To Bin Code;Code20 ;TableRelation=Bin.Code WHERE
(Location Code=FIELD(Transfer-to Code));
OnValidate=BEGIN
IF "Transfer-To Bin
Code" <> xRec."Transfer-To Bin Code" THEN BEGIN

TESTFIELD("Transfer-to Code");
IF "Transfer-To
Bin Code" <> '' THEN BEGIN

GetLocation("Transfer-to Code");

Location.TESTFIELD("Bin Mandatory");

Location.TESTFIELD("Directed Put-away and Pick",FALSE);

GetBin("Transfer-to Code","Transfer-To Bin Code");

TESTFIELD("Transfer-to Code",Bin."Location Code");


END;
END;
END;

CaptionML=[ENU=Transfer-To Bin
Code;
ESP=Transfer.a-c¢d.
ubic.] }
{ 50000; ;Original Quantity ;Decimal ;OnValidate=VAR

IsHandled@1100225000 : Boolean;

ItemUpdateManagement@7141743 : Record 50003;


BEGIN
IF CurrFieldNo <> 0
THEN
TestStatusOpen;
IF Quantity <> 0
THEN
TESTFIELD("Item
No.");
"Quantity
(Base)" := CalcBaseQty(Quantity);
IF ((Quantity *
"Quantity Shipped") < 0) OR
(ABS(Quantity) <
ABS("Quantity Shipped"))
THEN

FIELDERROR(Quantity,STRSUBSTNO(Text002,FIELDCAPTION("Quantity Shipped")));
IF (("Quantity
(Base)" * "Qty. Shipped (Base)") < 0) OR
(ABS("Quantity
(Base)") < ABS("Qty. Received (Base)"))
THEN

FIELDERROR("Quantity (Base)",STRSUBSTNO(Text002,FIELDCAPTION("Qty. Shipped


(Base)")));
InitQtyInTransit;
InitOutstandingQty;
InitQtyToShip;
InitQtyToReceive;

CheckItemAvailable(FIELDNO(Quantity));

ReserveTransferLine.VerifyQuantity(Rec,xRec);

UpdateWithWarehouseShipReceive;

IsHandled := FALSE;

OnValidateQuantityOnBeforeTransLineVerifyChange(Rec,xRec,IsHandled);
IF NOT IsHandled
THEN

WhseValidateSourceLine.TransLineVerifyChange(Rec,xRec);

//-007
// AGV-000 ==>
// IF
(xRec.Quantity <> Quantity) THEN
//
ItemUpdateManagement.ItemStatus("Item No.","Variant Code",TRUE);
// AGV-000 <==
//+007
END;

CaptionML=[ENU=Original
Quantity;
ESP=Cantidad
original];
DecimalPlaces=0:5;
MinValue=0;
Description=OS,377;
Editable=No }
{ 50102; ;Exclude From
EDI ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Exclude From EDI;
ESP=Excluir del EDI];
Description=163 }
{ 90000; ;AGV WaterMark Group ;Code50 ;TableRelation="MRW Codes".Code
WHERE (Type=FILTER(WaterMark group));

DataClassification=ToBeClassified;
CaptionML=[ENU=WaterMark Group;
ESP=Grupo WaterMark];
Description=CS-09 }
{ 90005; ;AGV Line Response ORDRSP;Option ;InitValue=5;
OnValidate=BEGIN

TestStatusOpen;
IF "AGV Canceled
ORDRSP" THEN

ERROR(Text7142721);
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Line Response
ORDRSP;
ESP=C�d. L�nea
Respuesta ORDRSP];

OptionCaptionML=[ENU=Added,Changed,Accepted witout corrections,Accepted with


corrections,Not accepted,Not found;
ESP=1 -
A�adido,3 -Cambiado (Falta Stock),5 -Aceptado sin correcci�n,6 -Aceptado con
correcci�n,7 -No aceptada,10 -No encontrada];
OptionString=1,3,5,6,7,10 }
{ 90006; ;AGV Canceled ORDRSP ;Boolean ;OnValidate=BEGIN

TestStatusOpen;
IF "AGV Canceled
ORDRSP" THEN
"AGV Line Response
ORDRSP" := "AGV Line Response ORDRSP"::"5"
ELSE
"AGV Line Response
ORDRSP" := "AGV Line Response ORDRSP"::"5";
"AGV Qty. Rejected
ORDRSP" := 0;
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Canceled ORDRSP;
ESP=Cancelado ORDRSP]
}
{ 90007; ;AGV EAN Item Not
Exist;Code20 ;DataClassification=ToBeClassified;
CaptionML=[ENU=EAN Item Not
Exist;
ESP=EDI EAN Producto
no existe] }
{ 90008; ;AGV Qty. Rejected ORDRSP;Decimal ;OnValidate=BEGIN

TestStatusOpen;
IF "AGV Canceled
ORDRSP" THEN

ERROR(Text7142722);

IF "AGV Qty.
Rejected ORDRSP" = 0 THEN
"AGV Line
Response ORDRSP" := "AGV Line Response ORDRSP"::"5"
ELSE BEGIN
IF "AGV Qty.
Rejected ORDRSP" > "Outstanding Quantity" THEN

//ERROR(Text7142723);

MESSAGE(Text7142723);
//"Line Response
ORDRSP" := "Line Response ORDRSP"::"7"
END;
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Qty. Rejected
ORDRSP;
ESP=Cdad. Rechazada
ORDRSP] }
{ 10000720;;Division ;Code10 ;TableRelation=Division;
CaptionML=[ENU=Division;
ESP=Divisi¢n] }
{ 10001305;;Reason Code ;Code10 ;TableRelation="Reason
Code".Code;
CaptionML=[ENU=Reason Code;
ESP=C¢d. auditor¡a];
Description=LS }
{ 10012300;;Transfer Type ;Option ;CaptionML=[ENU=Transfer Type;
ESP=Tipo
transferencia];
OptionCaptionML=[ENU=" ,Planned
Cross Docking,Buyer's Push,Replenishment,Stock Recall,Special Order";
ESP=" ,Env¡o
Directo Planeado,Compra Centralizada,Reaprovisionamiento,Regr. Log¡s.
Existencias,Pedido Especial"];
OptionString=[ ,Planned Cross
Docking,Buyer's Push,Replenishment,Stock Recall,Special Order] }
{ 10012301;;Purchase Order No. ;Code20 ;CaptionML=[ENU=Purchase Order
No.;
ESP=No. pedido
compra] }
{ 99000755;;Planning Flexibility;Option ;InitValue=None;
OnValidate=BEGIN
IF "Planning
Flexibility" <> xRec."Planning Flexibility" THEN

ReserveTransferLine.UpdatePlanningFlexibility(Rec);
END;

CaptionML=[ENU=Planning
Flexibility;
ESP=Flexib.
planificaci¢n];

OptionCaptionML=[ENU=Unlimited,None;

ESP=Ilimitada,Ninguna];
OptionString=Unlimited,None }
}
KEYS
{
{ ;Document No.,Line No. ;Clustered=Yes }
{ ;Transfer-to Code,Status,Derived From Line No.,Item No.,Variant
Code,Shortcut Dimension 1 Code,Shortcut Dimension 2 Code,Receipt Date,In-Transit
Code;
SumIndexFields=Qty. in Transit
(Base),Outstanding Qty. (Base);
MaintainSIFTIndex=No }
{ ;Transfer-from Code,Status,Derived From Line No.,Item No.,Variant
Code,Shortcut Dimension 1 Code,Shortcut Dimension 2 Code,Shipment Date,In-Transit
Code;
SumIndexFields=Outstanding Qty.
(Base);
MaintainSIFTIndex=No }
{ ;Item No.,Variant Code }
{ ;Transfer-to Code,Receipt Date,Item No.,Variant Code }
{ ;Transfer-from Code,Shipment Date,Item No.,Variant Code }
{ ;Transfer Type,Purchase Order No.,Transfer-to Code,Item No.,Variant Code }
{ ;Document No.,Item No.,Derived From Line No. }
}
FIELDGROUPS
{
}
CODE
{
VAR
Text001@1001 : TextConst 'ENU=You cannot rename a %1.;ESP=No se puede cambiar
el nombre a %1.';
Text002@1002 : TextConst 'ENU=must not be less than %1;ESP=No puede ser
inferior a %1.';
Text003@1003 : TextConst 'ENU="Warehouse %1 is required for %2 = %3.";ESP="Se
requiere almac‚n %1 para %2 = %3."';
Text004@1004 : TextConst 'ENU=\The entered information may be disregarded by
warehouse operations.;ESP=\La informaci¢n introducida puede ser ignorada por
operaciones almac‚n.';
Text005@1005 : TextConst 'ENU=You cannot ship more than %1 units.;ESP=No se
pueden enviar m s de %1 unidades.';
Text006@1006 : TextConst 'ENU=All items have been shipped.;ESP=Todos los
prod. enviados.';
Text008@1008 : TextConst 'ENU=You cannot receive more than %1 units.;ESP=No
se pueden recibir m s de %1 unidades.';
Text009@1009 : TextConst 'ENU=No items are currently in transit.;ESP=No hay
productos en tr nsito.';
Text011@1011 : TextConst 'ENU=Outbound,Inbound;ESP=Salida,Entrada';
Text012@1020 : TextConst 'ENU=You have changed one or more dimensions on the
%1, which is already shipped. When you post the line with the changed dimension to
General Ledger, amounts on the Inventory Interim account will be out of balance
when reported per dimension.\\Do you want to keep the changed dimension?;ESP=Ha
modificado una o varias dimensiones de %1, que ya se ha enviado. Al registrar la
l¡nea con la dimensi¢n modificada en la contabilidad, los importes de la cuenta
provisional de inventario no cuadrar n cuando se notifiquen por dimensi¢n.\\¨Desea
conservar la dimensi¢n modificada?';
Text013@1017 : TextConst 'ENU=Cancelled.;ESP=Cancelado.';
TransferRoute@1012 : Record 5742;
Item@1013 : Record 27;
TransHeader@1014 : Record 5740;
Location@1016 : Record 14;
Bin@1000 : Record 7354;
DimMgt@1019 : Codeunit 408;
WhseValidateSourceLine@1022 : Codeunit 5777;
ReserveTransferLine@1024 : Codeunit 99000836;
CheckDateConflict@1025 : Codeunit 99000815;
WMSManagement@1015 : Codeunit 7302;
UOMMgt@1100225001 : Codeunit 5402;
Reservation@1018 : Page 498;
TrackingBlocked@1007 : Boolean;
StatusCheckSuspended@1200040000 : Boolean;
InStoreMgt@1100409000 : Codeunit 10001320;
LSText001@1100409002 : TextConst 'ENU=InStore documents can only be
completely received. You can only receive %1 units.;ESP=Los Documentos InStore s¢lo
pueden ser recibidos completamente. S¢lo puede recibidos %1 unidades.';
LSText002@1100409001 : TextConst 'ENU=InStore documents can only be
completely shipped. You can only ship %1 units.;ESP=Documentos InStore s¢lo pueden
ser enviados completamente. S¢lo puede enviar %1 unidades.';
Text10000700@1200070000 : TextConst 'ENU=%1 %2 is Blocked for Transfer. See
Item Status Link %3 %4 %5 %6 %7 %8.;ESP=%1 %2 est Bloqueado para Transferencia.
Ver V¡nculo Estado Producto %3 %4 %5 %6 %7 %8.';
BOUtils@1100409003 : Codeunit 99001452;
InStoreFunc@1100409004 : Codeunit 10001310;
MustUseTrackingErr@1023 : TextConst '@@@="%1 = Form Name, %2 = Value to
Enter";ENU=You must use the %1 page to specify the %2, if you use item
tracking.;ESP=Use la p gina %1 para especificar %2, si usa el seguimiento de
productos.';
LedgEntryWillBeOpenedMsg@1100225000 : TextConst '@@@="%1 = Entry
No.";ENU=When posting the Applied to Ledger Entry %1 will be opened first.;ESP=Al
registrar, se abrir� primero Liq. por mov. producto %1.';
ShippingMoreUnitsThanReceivedErr@1010 : TextConst '@@@="%1 = Quantity Value,
%2 = Document No.";ENU=You cannot ship more than the %1 units that you have
received for document no. %2.;ESP=No se puede enviar m s de %1 unidades que se
hayan recibido para el documento n§ %2.';
AnotherItemWithSameDescrQst@1026 : TextConst '@@@="%1=Item no., %2=item
description";ENU=We found an item with the description "%2" (No. %1).\Did you mean
to change the current item to %1?;ESP=Encontramos un producto con la descripci¢n
"%2" (N.§ %1).\¨Desea cambiar el producto actual por %1?';
GlobalSkipLineNoInsert@1100225002 : Boolean;
Text7142721@1000000000 : TextConst 'ENU=You can not change the ORDRSP state.
Line canceled.;ESP=No se puede canviar el estado ORDRSP. L�nea cancelada.';
Text7142722@1000000002 : TextConst 'ESP=No se pueden modificar cantidades
rechazadas si la l�nea est� cancelada';
Text7142723@1000000001 : TextConst 'ESP=La cantidad a rechazar es superior a
la cantidad pendiente de la l�nea';

[LineStart(2271)]
LOCAL PROCEDURE InitOutstandingQty@16();
BEGIN
"Outstanding Quantity" := Quantity - "Quantity Shipped";
"Outstanding Qty. (Base)" := "Quantity (Base)" - "Qty. Shipped (Base)";
"Completely Shipped" := (Quantity <> 0) AND ("Outstanding Quantity" = 0);
END;

[LineStart(2276)]
LOCAL PROCEDURE InitQtyToShip@15();
BEGIN
"Qty. to Ship" := "Outstanding Quantity";
"Qty. to Ship (Base)" := "Outstanding Qty. (Base)";
END;

[LineStart(2280)]
LOCAL PROCEDURE InitQtyToReceive@2();
BEGIN
IF "In-Transit Code" <> '' THEN BEGIN
"Qty. to Receive" := "Qty. in Transit";
"Qty. to Receive (Base)" := "Qty. in Transit (Base)";
END;
IF ("In-Transit Code" = '') AND ("Quantity Shipped" = "Quantity Received")
THEN BEGIN
"Qty. to Receive" := "Qty. to Ship";
"Qty. to Receive (Base)" := "Qty. to Ship (Base)";
END;
//LS-8656//
// "Actual Qty. to Receive" := "Qty. to Receive";
// "Actual Qty. to Receive (Base)" := "Qty. to Receive (Base)";
// "Qty. Difference" := 0;
// "Qty. Difference (Base)" := 0;
//LS-8656//
END;

[LineStart(2296)]
LOCAL PROCEDURE InitQtyInTransit@4();
BEGIN
IF "In-Transit Code" <> '' THEN BEGIN
"Qty. in Transit" := "Quantity Shipped" - "Quantity Received";
"Qty. in Transit (Base)" := "Qty. Shipped (Base)" - "Qty. Received (Base)";
END ELSE BEGIN
"Qty. in Transit" := 0;
"Qty. in Transit (Base)" := 0;
END;
"Completely Received" := (Quantity <> 0) AND (Quantity = "Quantity
Received");
END;

[External]
[LineStart(2306)]
PROCEDURE ResetPostedQty@6();
BEGIN
"Quantity Shipped" := 0;
"Qty. Shipped (Base)" := 0;
"Quantity Received" := 0;
"Qty. Received (Base)" := 0;
"Qty. in Transit" := 0;
"Qty. in Transit (Base)" := 0;

OnAfterResetPostedQty(Rec);
END;

[LineStart(2316)]
LOCAL PROCEDURE CalcBaseQty@14(Qty@1000 : Decimal) : Decimal;
BEGIN
TESTFIELD("Qty. per Unit of Measure");
EXIT(ROUND(Qty * "Qty. per Unit of Measure",UOMMgt.QtyRndPrecision));
END;

[LineStart(2320)]
LOCAL PROCEDURE GetTransHeader@1();
BEGIN
GetTransferHeaderNoVerification;

TransHeader.TESTFIELD("Shipment Date");
TransHeader.TESTFIELD("Receipt Date");
TransHeader.TESTFIELD("Transfer-from Code");
TransHeader.TESTFIELD("Transfer-to Code");
IF NOT TransHeader."Direct Transfer" AND ("Direct Transfer" = xRec."Direct
Transfer") THEN
TransHeader.TESTFIELD("In-Transit Code");
"In-Transit Code" := TransHeader."In-Transit Code";
"Transfer-from Code" := TransHeader."Transfer-from Code";
"Transfer-to Code" := TransHeader."Transfer-to Code";
"Shipment Date" := TransHeader."Shipment Date";
"Receipt Date" := TransHeader."Receipt Date";
"Shipping Agent Code" := TransHeader."Shipping Agent Code";
"Shipping Agent Service Code" := TransHeader."Shipping Agent Service Code";
"Shipping Time" := TransHeader."Shipping Time";
"Outbound Whse. Handling Time" := TransHeader."Outbound Whse. Handling Time";
"Inbound Whse. Handling Time" := TransHeader."Inbound Whse. Handling Time";
// CS-09 ==>
Rec."AGV WaterMark Group" := TransHeader."AGV WaterMark Group";
// CS-09 <==
Status := TransHeader.Status;
"Direct Transfer" := TransHeader."Direct Transfer";

OnAfterGetTransHeader(Rec,TransHeader);
//LS-8656 UpdateInStoreDocStatus(); //LS
END;

[LineStart(2348)]
LOCAL PROCEDURE GetItem@9();
BEGIN
TESTFIELD("Item No.");
IF "Item No." <> Item."No." THEN
Item.GET("Item No.");
END;

[External]
[LineStart(2353)]
PROCEDURE BlockDynamicTracking@23(SetBlock@1000 : Boolean);
BEGIN
TrackingBlocked := SetBlock;
ReserveTransferLine.Block(SetBlock);
END;

[External]
[LineStart(2357)]
PROCEDURE ShowDimensions@25();
BEGIN
"Dimension Set ID" :=
DimMgt.EditDimensionSet("Dimension Set ID",STRSUBSTNO('%1 %2
%3',TABLECAPTION,"Document No.","Line No."));
VerifyItemLineDim;
DimMgt.UpdateGlobalDimFromDimSetID("Dimension Set ID","Shortcut Dimension 1
Code","Shortcut Dimension 2 Code");
END;

[External]
[LineStart(2363)]
PROCEDURE CreateDim@26(Type1@1000 : Integer;No1@1001 : Code[20]);
VAR
SourceCodeSetup@1002 : Record 242;
TableID@1003 : ARRAY [10] OF Integer;
No@1004 : ARRAY [10] OF Code[20];
BEGIN
SourceCodeSetup.GET;
TableID[1] := Type1;
No[1] := No1;
OnAfterCreateDimTableIDs(Rec,CurrFieldNo,TableID,No);

"Shortcut Dimension 1 Code" := '';


"Shortcut Dimension 2 Code" := '';
"Dimension Set ID" :=
DimMgt.GetRecDefaultDimID(
Rec,CurrFieldNo,TableID,No,SourceCodeSetup.Transfer,
"Shortcut Dimension 1 Code","Shortcut Dimension 2
Code",TransHeader."Dimension Set ID",DATABASE::Item);
END;

[External]
[LineStart(2376)]
PROCEDURE ValidateShortcutDimCode@29(FieldNumber@1000 : Integer;VAR
ShortcutDimCode@1001 : Code[20]);
BEGIN
DimMgt.ValidateShortcutDimValues(FieldNumber,ShortcutDimCode,"Dimension Set
ID");
VerifyItemLineDim;
END;

[External]
[LineStart(2380)]
PROCEDURE LookupShortcutDimCode@28(FieldNumber@1000 : Integer;VAR
ShortcutDimCode@1001 : Code[20]);
BEGIN
DimMgt.LookupDimValueCode(FieldNumber,ShortcutDimCode);
ValidateShortcutDimCode(FieldNumber,ShortcutDimCode);
END;

[External]
[LineStart(2384)]
PROCEDURE ShowShortcutDimCode@27(VAR ShortcutDimCode@1000 : ARRAY [8] OF
Code[20]);
BEGIN
DimMgt.GetShortcutDimensions("Dimension Set ID",ShortcutDimCode);
END;

[LineStart(2387)]
LOCAL PROCEDURE CheckItemAvailable@3(CalledByFieldNo@1000 : Integer);
VAR
ItemCheckAvail@1001 : Codeunit 311;
BEGIN
IF (CurrFieldNo <> 0) AND
(CurrFieldNo = CalledByFieldNo) AND
("Item No." <> '') AND
("Outstanding Quantity" > 0)
THEN
IF ItemCheckAvail.TransferLineCheck(Rec) THEN
ItemCheckAvail.RaiseUpdateInterruptedError;
END;

[External]
[LineStart(2396)]
PROCEDURE OpenItemTrackingLines@6500(Direction@1002 : 'Outbound,Inbound');
BEGIN
TESTFIELD("Item No.");
TESTFIELD("Quantity (Base)");
ReserveTransferLine.CallItemTracking(Rec,Direction);
END;

[LineStart(2402)]
LOCAL PROCEDURE TestStatusOpen@37();
BEGIN
TESTFIELD("Document No.");
IF TransHeader."No." <> "Document No." THEN
TransHeader.GET("Document No.");

//LS -
IF StatusCheckSuspended THEN
EXIT;
//LS +

TransHeader.TESTFIELD(Status,TransHeader.Status::Open);
END;

[External]
[LineStart(2414)]
PROCEDURE ShowReservation@10();
VAR
OptionNumber@1000 : Integer;
BEGIN
TESTFIELD("Item No.");
CLEAR(Reservation);
OptionNumber := STRMENU(Text011);
IF OptionNumber > 0 THEN BEGIN
Reservation.SetTransLine(Rec,OptionNumber - 1);
Reservation.RUNMODAL;
END;
END;

[External]
[LineStart(2423)]
PROCEDURE UpdateWithWarehouseShipReceive@41();
BEGIN
IF Location.RequireShipment("Transfer-from Code") THEN
VALIDATE("Qty. to Ship",0)
ELSE
VALIDATE("Qty. to Ship","Outstanding Quantity");

IF Location.RequireReceive("Transfer-to Code") THEN


VALIDATE("Qty. to Receive",0)
ELSE BEGIN
IF "In-Transit Code" <> '' THEN
VALIDATE("Qty. to Receive","Qty. in Transit");
IF ("In-Transit Code" = '') AND ("Quantity Shipped" = "Quantity Received")
THEN
VALIDATE("Qty. to Receive","Qty. to Ship");
END;
END;

[External]
[LineStart(2438)]
PROCEDURE RenameNo@12(OldNo@1001 : Code[20];NewNo@1002 : Code[20]);
BEGIN
RESET;
SETRANGE("Item No.",OldNo);
MODIFYALL("Item No.",NewNo,TRUE);
END;

[LineStart(2443)]
LOCAL PROCEDURE CheckWarehouse@47(LocationCode@1003 : Code[10];Receive@1004 :
Boolean);
VAR
ShowDialog@1001 : ' ,Message,Error';
DialogText@1000 : Text[50];
BEGIN
GetLocation(LocationCode);
IF Location."Directed Put-away and Pick" THEN BEGIN
ShowDialog := ShowDialog::Error;
IF Receive THEN
DialogText := Location.GetRequirementText(Location.FIELDNO("Require
Receive"))
ELSE
DialogText := Location.GetRequirementText(Location.FIELDNO("Require
Shipment"));
END ELSE BEGIN
IF Receive AND (Location."Require Receive" OR Location."Require Put-away")
THEN BEGIN
IF WhseValidateSourceLine.WhseLinesExist(
DATABASE::"Transfer Line",
1,
"Document No.",
"Line No.",
0,
Quantity)
THEN
ShowDialog := ShowDialog::Error
ELSE
IF Location."Require Receive" THEN
ShowDialog := ShowDialog::Message;
IF Location."Require Receive" THEN
DialogText := Location.GetRequirementText(Location.FIELDNO("Require
Receive"))
ELSE
DialogText := Location.GetRequirementText(Location.FIELDNO("Require
Put-away"));
END;

IF NOT Receive AND (Location."Require Shipment" OR Location."Require Pick")


THEN BEGIN
IF WhseValidateSourceLine.WhseLinesExist(
DATABASE::"Transfer Line",
0,
"Document No.",
"Line No.",
0,
Quantity)
THEN
ShowDialog := ShowDialog::Error
ELSE
IF Location."Require Shipment" THEN
ShowDialog := ShowDialog::Message;
IF Location."Require Shipment" THEN
DialogText := Location.GetRequirementText(Location.FIELDNO("Require
Shipment"))
ELSE
DialogText := Location.GetRequirementText(Location.FIELDNO("Require
Pick"));
END;
END;

CASE ShowDialog OF
ShowDialog::Message:
MESSAGE(Text003 + Text004,DialogText,FIELDCAPTION("Line No."),"Line
No.");
ShowDialog::Error:
ERROR(Text003,DialogText,FIELDCAPTION("Line No."),"Line No.");
END;
END;

[LineStart(2498)]
LOCAL PROCEDURE GetLocation@44(LocationCode@1000 : Code[10]);
BEGIN
IF Location.Code <> LocationCode THEN
Location.GET(LocationCode);
END;

[LineStart(2502)]
LOCAL PROCEDURE GetBin@36(LocationCode@1000 : Code[10];BinCode@1001 :
Code[20]);
BEGIN
IF BinCode = '' THEN
CLEAR(Bin)
ELSE
IF Bin.Code <> BinCode THEN
Bin.GET(LocationCode,BinCode);
END;

[LineStart(2509)]
LOCAL PROCEDURE GetDefaultBin@5(FromLocationCode@1000 :
Code[10];ToLocationCode@1001 : Code[10]);
BEGIN
IF (FromLocationCode <> '') AND ("Item No." <> '') THEN BEGIN
GetLocation(FromLocationCode);
IF Location."Bin Mandatory" AND NOT Location."Directed Put-away and Pick"
THEN BEGIN
WMSManagement.GetDefaultBin("Item No.","Variant
Code",FromLocationCode,"Transfer-from Bin Code");
HandleDedicatedBin(FALSE);
END;
END;

IF (ToLocationCode <> '') AND ("Item No." <> '') THEN BEGIN
GetLocation(ToLocationCode);
IF Location."Bin Mandatory" AND NOT Location."Directed Put-away and Pick"
THEN
WMSManagement.GetDefaultBin("Item No.","Variant
Code",ToLocationCode,"Transfer-To Bin Code");
END;
END;

[External]
[LineStart(2524)]
PROCEDURE IsInbound@8() : Boolean;
BEGIN
EXIT("Quantity (Base)" < 0);
END;

[LineStart(2527)]
LOCAL PROCEDURE HandleDedicatedBin@7(IssueWarning@1000 : Boolean);
VAR
WhseIntegrationMgt@1001 : Codeunit 7317;
BEGIN
IF NOT IsInbound AND ("Quantity (Base)" <> 0) THEN
WhseIntegrationMgt.CheckIfBinDedicatedOnSrcDoc("Transfer-from
Code","Transfer-from Bin Code",IssueWarning);
END;

[External]
[LineStart(2531)]
PROCEDURE FilterLinesWithItemToPlan@70(VAR Item@1000 : Record 27;IsReceipt@1001
: Boolean;IsSupplyForPlanning@1002 : Boolean);
BEGIN
RESET;
SETCURRENTKEY("Item No.");
SETRANGE("Item No.",Item."No.");
SETFILTER("Variant Code",Item.GETFILTER("Variant Filter"));
IF NOT IsSupplyForPlanning THEN
SETRANGE("Derived From Line No.",0);
IF IsReceipt THEN BEGIN
SETFILTER("Transfer-to Code",Item.GETFILTER("Location Filter"));
SETFILTER("Receipt Date",Item.GETFILTER("Date Filter"))
END ELSE BEGIN
SETFILTER("Transfer-from Code",Item.GETFILTER("Location Filter"));
SETFILTER("Shipment Date",Item.GETFILTER("Date Filter"));
SETFILTER("Outstanding Qty. (Base)",'<>0');
END;
SETFILTER("Shortcut Dimension 1 Code",Item.GETFILTER("Global Dimension 1
Filter"));
SETFILTER("Shortcut Dimension 2 Code",Item.GETFILTER("Global Dimension 2
Filter"));
END;

[External]
[LineStart(2549)]
PROCEDURE FindLinesWithItemToPlan@68(VAR Item@1000 : Record 27;IsReceipt@1001 :
Boolean;IsSupplyForPlanning@1002 : Boolean) : Boolean;
BEGIN
FilterLinesWithItemToPlan(Item,IsReceipt,IsSupplyForPlanning);
EXIT(FIND('-'));
END;

[External]
[LineStart(2553)]
PROCEDURE LinesWithItemToPlanExist@67(VAR Item@1000 : Record
27;IsReceipt@1001 : Boolean) : Boolean;
BEGIN
FilterLinesWithItemToPlan(Item,IsReceipt,FALSE);
EXIT(NOT ISEMPTY);
END;

[LineStart(2557)]
LOCAL PROCEDURE VerifyItemLineDim@87();
BEGIN
IF IsShippedDimChanged THEN
ConfirmShippedDimChange;
END;

[LineStart(2561)]
PROCEDURE SuspendStatusCheck@1200040000();
BEGIN
//LS
StatusCheckSuspended := TRUE;
END;

[External]
[LineStart(2565)]
PROCEDURE IsShippedDimChanged@105() : Boolean;
BEGIN
EXIT(("Dimension Set ID" <> xRec."Dimension Set ID") AND
(("Quantity Shipped" <> 0) OR ("Qty. Shipped (Base)" <> 0)));
END;

[External]
[LineStart(2569)]
PROCEDURE ConfirmShippedDimChange@106() : Boolean;
BEGIN
IF NOT CONFIRM(Text012,FALSE,TABLECAPTION) THEN
ERROR(Text013);

EXIT(TRUE);
END;

[LineStart(2575)]
LOCAL PROCEDURE SelectItemEntry@11(CurrentFieldNo@1000 : Integer);
VAR
ItemLedgEntry@1001 : Record 32;
TransferLine2@1002 : Record 5741;
BEGIN
ItemLedgEntry.SETRANGE("Item No.","Item No.");
IF "Transfer-from Code" <> '' THEN
ItemLedgEntry.SETRANGE("Location Code","Transfer-from Code");
ItemLedgEntry.SETRANGE("Variant Code","Variant Code");

ItemLedgEntry.SETRANGE(Positive,TRUE);
ItemLedgEntry.SETRANGE(Open,TRUE);

IF PAGE.RUNMODAL(PAGE::"Item Ledger Entries",ItemLedgEntry) =


ACTION::LookupOK THEN BEGIN
TransferLine2 := Rec;
TransferLine2.VALIDATE("Appl.-to Item Entry",ItemLedgEntry."Entry No.");
CheckItemAvailable(CurrentFieldNo);
Rec := TransferLine2;
END;
END;

[LineStart(2591)]
LOCAL PROCEDURE GetTransferHeaderNoVerification@112();
BEGIN
TESTFIELD("Document No.");
IF "Document No." <> TransHeader."No." THEN
TransHeader.GET("Document No.");
END;

[External]
[LineStart(2596)]
PROCEDURE DateConflictCheck@13();
BEGIN
IF NOT TrackingBlocked THEN
CheckDateConflict.TransferLineCheck(Rec);
END;

[Integration]
[LineStart(2600)]
LOCAL PROCEDURE OnAfterCreateDimTableIDs@138(VAR TransferLine@1000 : Record
5741;FieldNo@1001 : Integer;VAR TableID@1003 : ARRAY [10] OF Integer;VAR No@1002 :
ARRAY [10] OF Code[20]);
BEGIN
END;

[LineStart(2603)]
LOCAL PROCEDURE ItemExists@17(ItemNo@1000 : Code[20]) : Boolean;
VAR
IEItem@1001 : Record 27;
BEGIN
EXIT(IEItem.GET(ItemNo));
END;

[External]
[LineStart(2606)]
PROCEDURE RowID1@48(Direction@1001 : 'Outbound,Inbound') : Text[250];
VAR
ItemTrackingMgt@1000 : Codeunit 6500;
BEGIN
EXIT(ItemTrackingMgt.ComposeRowID(DATABASE::"Transfer
Line",Direction,"Document No.",'',"Derived From Line No.","Line No."));
END;

[Integration]
[LineStart(2609)]
LOCAL PROCEDURE OnAfterGetTransHeader@19(VAR TransferLine@1000 : Record
5741;TransferHeader@1001 : Record 5740);
BEGIN
END;

[Integration]
[LineStart(2612)]
LOCAL PROCEDURE OnAfterResetPostedQty@20(VAR TransferLine@1000 : Record 5741);
BEGIN
END;

[Integration]
[LineStart(2615)]
LOCAL PROCEDURE OnValidateQuantityOnBeforeTransLineVerifyChange@18(VAR
TransferLine@1000 : Record 5741;xTransferLine@1001 : Record 5741;VAR IsHandled@1002
: Boolean);
BEGIN
END;

[LineStart(2618)]
PROCEDURE SetSkipInsertLineNo@1000000000(SkipLineNoInsert@1000000000 :
Boolean);
BEGIN
GlobalSkipLineNoInsert := SkipLineNoInsert; //<528
END;

BEGIN
{
LS = changes made by LS Retail
LS-7685 GH Remove some LS changes
LS-7709 VBE Remove Forecourt Delivery Transaction functionality
LS-8518 ZBZ Remove SPO (Special Order).
LS-8656 ZBZ Remove Standalone Store InStore Documents

-007 apicazo 14/05/2015. PI0007_MRW_9999. Magento


-999 apicazo 03/07/2015. Ajustos generals

-MRW023 dperez 18/04/2018 Valor inicial de Flex. planificaci¢n None

377 OS.XT.21/10/2020. MRW_SP20201021_XT. Actualitzaci� comandes transfer al


fer Reaprovisionament en tenda
431 OS.ACE.04/02/2021. Integraci�n con Canarias
Creaci� key nova ==> "Document No.","Item No.","Derived From Line
No."
528 OS.OA. 01/06/2021. AN_CASTOR. Integraci�n con CASTOR.
}
END.
}
}

OBJECT Table 7002 Sales Price


{
OBJECT-PROPERTIES
{
Date=30/01/23;
Time=16:50:09;
Modified=Yes;
Version List=NAVW114.00,LSW113.0.00.775,MRW,042,999,OS,099,431,MRW042;
}
PROPERTIES
{
OnInsert=BEGIN
IF "Sales Type" = "Sales Type"::"All Customers" THEN
"Sales Code" := ''
ELSE
TESTFIELD("Sales Code");
TESTFIELD("Item No.");

//LS -
//Used to indicated if default price group is used or not.
IF NOT gItemCardUpdate THEN
UpdateItemCardUnitPrice(FALSE);
gItemCardUpdate := FALSE;
//LS +
"Last DateTime Modified" := CURRENTDATETIME();
END;

OnModify=BEGIN
//LS -
IF NOT gItemCardUpdate THEN
UpdateItemCardUnitPrice(TRUE);
gItemCardUpdate := FALSE;
//LS +
"Last DateTime Modified" := CURRENTDATETIME();
END;

OnDelete=BEGIN
//LS -
// We are about to delete the price from the card since this is the
default group
IF NOT gItemCardUpdate THEN
UpdateItemCardUnitPrice(TRUE);
gItemCardUpdate := FALSE;
//LS +
END;

OnRename=BEGIN
IF "Sales Type" <> "Sales Type"::"All Customers" THEN
TESTFIELD("Sales Code");
TESTFIELD("Item No.");
END;

CaptionML=[ENU=Sales Price;
ESP=Precio venta];
LookupPageID=Page7002;
}
FIELDS
{
{ 1 ; ;Item No. ;Code20 ;TableRelation=Item;
OnValidate=BEGIN
IF "Item No." <>
xRec."Item No." THEN BEGIN
Item.GET("Item
No.");
"Unit of Measure
Code" := Item."Sales Unit of Measure";
"Variant Code" :=
'';
END;

IF "Sales Type" =
"Sales Type"::"Customer Price Group" THEN
IF
CustPriceGr.GET("Sales Code") AND

(CustPriceGr."Allow Invoice Disc." = "Allow Invoice Disc.")


THEN
EXIT;

UpdateValuesFromItem;
END;

CaptionML=[ENU=Item No.;
ESP=N� producto];
NotBlank=Yes }
{ 2 ; ;Sales Code ;Code20 ;TableRelation=IF (Sales
Type=CONST(Customer Price Group)) "Customer Price Group"
ELSE IF (Sales
Type=CONST(Customer)) Customer
ELSE IF (Sales
Type=CONST(Campaign)) Campaign;
OnValidate=BEGIN
IF "Sales Code" <>
'' THEN
CASE "Sales Type"
OF
"Sales
Type"::"All Customers":

ERROR(Text001,FIELDCAPTION("Sales Code"));
"Sales
Type"::"Customer Price Group":
BEGIN

CustPriceGr.GET("Sales Code");
"Price
Includes VAT" := CustPriceGr."Price Includes VAT";
"VAT Bus.
Posting Gr. (Price)" := CustPriceGr."VAT Bus. Posting Gr. (Price)";
"Allow Line
Disc." := CustPriceGr."Allow Line Disc.";
"Allow
Invoice Disc." := CustPriceGr."Allow Invoice Disc.";
END;
"Sales
Type"::Customer:
BEGIN

Cust.GET("Sales Code");
"Currency
Code" := Cust."Currency Code";
"Price
Includes VAT" := Cust."Prices Including VAT";
"VAT Bus.
Posting Gr. (Price)" := Cust."VAT Bus. Posting Group";
"Allow Line
Disc." := Cust."Allow Line Disc.";
END;
"Sales
Type"::Campaign:
BEGIN

Campaign.GET("Sales Code");
"Starting
Date" := Campaign."Starting Date";
"Ending
Date" := Campaign."Ending Date";
END;
END;
END;

CaptionML=[ENU=Sales Code;
ESP=C�digo ventas] }
{ 3 ; ;Currency Code ;Code10 ;TableRelation=Currency;
CaptionML=[ENU=Currency Code;
ESP=C�d. divisa] }
{ 4 ; ;Starting Date ;Date ;OnValidate=BEGIN
IF ("Starting Date"
> "Ending Date") AND ("Ending Date" <> 0D) THEN

ERROR(Text000,FIELDCAPTION("Starting Date"),FIELDCAPTION("Ending Date"));

IF CurrFieldNo = 0
THEN
EXIT;

IF "Starting Date"
<> 0D THEN
IF "Sales Type" =
"Sales Type"::Campaign THEN

ERROR(Text002,"Sales Type");
END;

CaptionML=[ENU=Starting Date;
ESP=Fecha inicial] }
{ 5 ; ;Unit Price ;Decimal ;OnValidate=BEGIN
//LS -
Item.GET("Item
No.");
"Calculate
Prices"(Item,FIELDNO("Unit Price"));
//LS +
END;

CaptionML=[ENU=Unit Price;
ESP=Precio venta];
DecimalPlaces=4:4;
MinValue=0;
AutoFormatExpr="Currency Code" }
{ 7 ; ;Price Includes VAT ;Boolean ;CaptionML=[ENU=Price Includes
VAT;
ESP=Precio IVA
incluido] }
{ 10 ; ;Allow Invoice Disc. ;Boolean ;InitValue=Yes;
CaptionML=[ENU=Allow Invoice
Disc.;
ESP=Permitir dto.
factura] }
{ 11 ; ;VAT Bus. Posting Gr. (Price);Code20;TableRelation="VAT Business
Posting Group";
CaptionML=[ENU=VAT Bus. Posting
Gr. (Price);
ESP=Gr.regis. IVA
negocio (precio)] }
{ 13 ; ;Sales Type ;Option ;OnValidate=BEGIN
IF "Sales Type" <>
xRec."Sales Type" THEN BEGIN
VALIDATE("Sales
Code",'');

UpdateValuesFromItem;
END;
END;
CaptionML=[ENU=Sales Type;
ESP=Tipo venta];

OptionCaptionML=[ENU=Customer,Customer Price Group,All Customers,Campaign;

ESP=Cliente,Grupo precio cliente,Todos clientes,Campa�a];


OptionString=Customer,Customer
Price Group,All Customers,Campaign }
{ 14 ; ;Minimum Quantity ;Decimal ;OnValidate=BEGIN
//LS -
IF NOT
RetailSetup.GET THEN
EXIT;
IF "Sales Type" =
"Sales Type"::"Customer Price Group" THEN
IF
CustPriceGr.GET("Sales Code") AND (CustPriceGr."Retail Price Group" = TRUE) THEN
IF "Minimum
Quantity" <> 0 THEN

ERROR(Text99001452,FIELDCAPTION("Minimum Quantity"));
//LS +
END;

CaptionML=[ENU=Minimum Quantity;
ESP=Cantidad m�nima];
DecimalPlaces=0:5;
MinValue=0 }
{ 15 ; ;Ending Date ;Date ;OnValidate=BEGIN
IF CurrFieldNo = 0
THEN
EXIT;

VALIDATE("Starting
Date");

IF "Ending Date" <>


0D THEN
IF "Sales Type" =
"Sales Type"::Campaign THEN

ERROR(Text002,"Sales Type");
END;

CaptionML=[ENU=Ending Date;
ESP=Fecha final] }
{ 5400; ;Unit of Measure Code;Code10 ;TableRelation="Item Unit of
Measure".Code WHERE (Item No.=FIELD(Item No.));
OnValidate=BEGIN
//LS -
Item.GET("Item
No.");
"Calculate
Prices"(Item,FIELDNO("Unit of Measure Code"));
//LS +
END;

CaptionML=[ENU=Unit of Measure
Code;
ESP=C�d. unidad
medida] }
{ 5700; ;Variant Code ;Code10 ;TableRelation="Item
Variant".Code WHERE (Item No.=FIELD(Item No.));
CaptionML=[ENU=Variant Code;
ESP=C�d. variante] }
{ 7001; ;Allow Line Disc. ;Boolean ;InitValue=Yes;
CaptionML=[ENU=Allow Line Disc.;
ESP=Permite dto.
l�nea] }
{ 50000; ;Magento Code ;Integer ;FieldClass=FlowField;
CalcFormula=Lookup("Customer
Price Group"."Magento Code" WHERE (Code=FIELD(Sales Code)));
OnValidate=BEGIN
//-007
END;

CaptionML=ESP=C�d. Magento;
BlankZero=Yes;
Description=-007;
Editable=No }
{ 50001; ;Low Margin Price ;Boolean ;CaptionML=[ENU=Low Margin Price;
ESP=Precio bajo
margen];
Description=MRW042 }
{ 50002; ;Unit Price
Modified ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Unit Price
Modified;
ESP=Precio venta
modificado];
Description=099 }
{ 50003; ;Item Disc. Group ;Code20 ;FieldClass=FlowField;
CalcFormula=Lookup(Item."Item
Disc. Group" WHERE (No.=FIELD(Item No.)));
TableRelation="Item Discount
Group".Code;
CaptionML=[ENU=Item Disc. Group;
ESP=Grupo dto.
pdto.];
Description=MRW999;
Editable=No }
{ 50004; ;Division Code ;Code10 ;FieldClass=FlowField;

CalcFormula=Lookup(Item."Division Code" WHERE (No.=FIELD(Item No.)));


TableRelation=Division.Code;
OnValidate=VAR
Text50000@7141743 :
TextConst 'ESP=Debe exiistir Grupo Registro IVA producto para poder configurar un
valor para la Divisi�n';
BEGIN
END;

CaptionML=[ENU=Division Code;
ESP=C�d. Divisi�n];
Description=MRW999;
Editable=No }
{ 50005; ;Item Category Code ;Code10 ;FieldClass=FlowField;
CalcFormula=Lookup(Item."Item
Category Code" WHERE (No.=FIELD(Item No.)));
TableRelation="Item
Category".Code WHERE (Division Code=FIELD(Division Code));
CaptionML=[ENU=Item Category
Code;
ESP=C�d. categor�a
producto];
Description=MRW999;
Editable=No }
{ 50006; ;Product Group Code ;Code10 ;FieldClass=FlowField;
CalcFormula=Lookup(Item."Product
Group Code" WHERE (No.=FIELD(Item No.)));
TableRelation="Product
Group".Code WHERE (Item Category Code=FIELD(Item Category Code));
CaptionML=[ENU=Product Group
Code;
ESP=C�d. grupo
producto];
Description=MRW999;
Editable=No }
{ 50007; ;Description ;Text100 ;FieldClass=FlowField;

CalcFormula=Lookup(Item.Description WHERE (No.=FIELD(Item No.)));


CaptionML=[ENU=Description;
ESP=Descripci�n];
Description=MRW999;
Editable=No }
{ 50008; ;Vendor No. ;Code20 ;FieldClass=FlowField;
CalcFormula=Lookup(Item."Vendor
No." WHERE (No.=FIELD(Item No.)));
TableRelation=Vendor;
ValidateTableRelation=Yes;
CaptionML=[ENU=Vendor No.;
ESP=N� proveedor];
Description=MRW999;
Editable=No }
{ 90000; ;Last DateTime
Modified;DateTime ;DataClassification=ToBeClassified }
{ 10000701;;Markup % ;Decimal ;OnValidate=VAR
Price@1000000000 :
Decimal;

CurrencyFactor@1000000001 : Decimal;

ItemUnitofMeasure@1200000000 : Record 5404;


BEGIN
//LS
Item.GET("Item
No.");
IF
(Item."Price/Profit Calculation" = Item."Price/Profit Calculation"::"Profit=Price-
Cost") OR

(Item."Price/Profit Calculation" = Item."Price/Profit Calculation"::"No


Relationship") THEN
BEGIN;
Price :=
Item."Unit Cost" * (1 + "Markup %"/100);
IF "Unit of
Measure Code" <> '' THEN
BEGIN

ItemUnitofMeasure.GET("Item No.","Unit of Measure Code");


Price :=
Price * ItemUnitofMeasure."Qty. per Unit of Measure";
END;
IF "Currency
Code" <> '' THEN
BEGIN;

CurrencyFactor := CurrencyExchangeRate.ExchangeRate(TODAY(),"Currency Code");


Price :=
CurrencyExchangeRate.ExchangeAmtLCYToFCY(TODAY(),"Currency
Code",Price,CurrencyFactor);
END;
IF "Price
Includes VAT" THEN
BEGIN;

VATPostingSetup.GET("VAT Bus. Posting Gr. (Price)",Item."VAT Prod. Posting Group");


CASE
VATPostingSetup."VAT Calculation Type" OF

VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT":

VATPostingSetup."VAT %" := 0;

VATPostingSetup."VAT Calculation Type"::"Sales Tax":

ERROR(Text1000701 +

Text1000702,VATPostingSetup.FIELDCAPTION("VAT Calculation Type"),

VATPostingSetup."VAT Calculation Type");


END;
Price :=
Price * (1 + VATPostingSetup."VAT %"/100);
END;
IF "Price
Includes VAT" THEN
"Unit
Price" := "Amount Rounding".InvoiceRound("Currency Code",Price)
ELSE
"Unit
Price" := "Amount Rounding".UnitAmountRound("Currency Code",Price);
END;

"Calculate
Prices"(Item,FIELDNO("Markup %"));
END;

CaptionML=[ENU=Markup %;
ESP=% Aumento] }
{ 10000702;;Profit % ;Decimal ;OnValidate=BEGIN
//LS
Item.GET("Item
No.");
"Markup %" :=
ROUND("Profit %"/(100-"Profit %") * 100,0.00001);
"Calculate
Prices"(Item,FIELDNO("Profit %"));
END;

CaptionML=[ENU=Profit %;
ESP=% Beneficio] }
{ 10000703;;Profit (LCY) ;Decimal ;CaptionML=[ENU=Profit (LCY);
ESP=Bfo. bruto (DL)];
Editable=No }
{ 99001450;;Unit Price Including VAT;Decimal ;OnValidate=VAR

BackOfficeSetup@1000 : Record 10000700;


Store@1001 : Record
99001470;
BEGIN
//LS
Item.GET("Item
No.");
IF NOT "Price
Includes VAT" THEN BEGIN
IF NOT
VATPostingSetup.GET("VAT Bus. Posting Gr. (Price)",Item."VAT Prod. Posting Group")
THEN

VATPostingSetup.INIT;
CASE
VATPostingSetup."VAT Calculation Type" OF

VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT":

VATPostingSetup."VAT %" := 0;

VATPostingSetup."VAT Calculation Type"::"Sales Tax":


ERROR(

Text99001450 +

Text99001451,VATPostingSetup.FIELDCAPTION("VAT Calculation Type"),

VATPostingSetup."VAT Calculation Type");


END;
"Unit Price" :=
ROUND("Unit Price Including VAT" / (1 + (VATPostingSetup."VAT %" / 100)),0.00001);
END ELSE
"Unit Price" :=
"Unit Price Including VAT";

"Calculate
Prices"(Item,FIELDNO("Unit Price Including VAT"));
END;

CaptionML=[ENU=Unit Price
Including VAT;
ESP=Precio Unitario
IVA Incl.];
AutoFormatType=2;
AutoFormatExpr="Currency Code" }
{ 99001453;;Price Group Description;Text50 ;FieldClass=FlowField;
CalcFormula=Lookup("Customer
Price Group".Description WHERE (Code=FIELD(Sales Code)));
CaptionML=[ENU=Price Group
Description;
ESP=Descripci�n Grupo
Precios];
Description=LS;
Editable=No }
}
KEYS
{
{ ;Item No.,Sales Type,Sales Code,Starting Date,Currency Code,Variant
Code,Unit of Measure Code,Minimum Quantity;
Clustered=Yes }
{ ;Sales Type,Sales Code,Item No.,Starting Date,Currency Code,Variant
Code,Unit of Measure Code,Minimum Quantity }
{ ;Item No.,Sales Type,Sales Code,Ending Date,Starting Date }
}
FIELDGROUPS
{
{ 1 ;Brick ;Sales Type,Sales Code,Item No.,Starting Date,Unit
Price,Ending Date }
}
CODE
{
VAR
CustPriceGr@1000 : Record 6;
Text000@1001 : TextConst 'ENU=%1 cannot be after %2;ESP=%1 no puede ser
posterior %2';
Cust@1002 : Record 18;
Text001@1003 : TextConst 'ENU=%1 must be blank.;ESP=%1 debe ser blanco.';
Campaign@1005 : Record 5071;
Item@1004 : Record 27;
Text002@1006 : TextConst 'ENU="If Sales Type = %1, then you can only change
Starting Date and Ending Date from the Campaign Card.";ESP="Si el tipo de ventas es
= %1, solo puede cambiar la Fecha de inicio y la Fecha final de la Ficha
campa�a."';
CurrencyExchangeRate@1100409000 : Record 330;
VATPostingSetup@1100409001 : Record 325;
"Amount Rounding"@1100409008 : Codeunit 10000705;
Text99001450@1100409004 : TextConst 'ENU="Prices including VAT cannot be
calculated when ";ESP="Los precios con IVA incl. no pueden calcularse cuando "';
Text99001451@1100409003 : TextConst 'ENU=%1 is %2.;ESP=%1 es %2.';
Text99001458@1100409002 : TextConst 'ENU=%1 Must Be %3 for %2;ESP=%1 debe ser
%3 para %2';
Text1000700@1100409007 : TextConst 'ENU=Closing date must be later then
starting date;ESP=La fecha cierre debe ser posterior a la fecha de apertura';
Text1000701@1100409006 : TextConst 'ENU="Prices including VAT cannot be
calculated when ";ESP="Los precios con IVA incl. no pueden calcularse cuando "';
Text1000702@1100409005 : TextConst 'ENU=%1 is %2.;ESP=%1 es %2.';
RetailSetup@1100409013 : Record 10000700;
gItemCardUpdate@1100409009 : Boolean;
Text99001452@1200070000 : TextConst 'ENU=%1 must be 0 for Retail Price
Groups. Use multibuy for qty. discounts.;ESP=%1 debe ser 0 para Grupos Precio
Retail. Usar multicompra para descuentos cdad.';

[LineStart(2653)]
LOCAL PROCEDURE UpdateValuesFromItem@1();
BEGIN
IF Item.GET("Item No.") THEN BEGIN
"Allow Invoice Disc." := Item."Allow Invoice Disc.";
IF "Sales Type" = "Sales Type"::"All Customers" THEN BEGIN
"Price Includes VAT" := Item."Price Includes VAT";
"VAT Bus. Posting Gr. (Price)" := Item."VAT Bus. Posting Gr. (Price)";
END;
END;
END;

[LineStart(2662)]
PROCEDURE "Calculate Prices"@10014500(VAR Item_In@1000000000 : Record
27;CalledByFieldNo@1200070000 : Integer);
VAR
Price@1000000002 : Decimal;
CurrencyFactor@1000000003 : Decimal;
ItemUnitofMeasure@1200000000 : Record 5404;
BEGIN
//LS
//Calculate Prices
CASE Item_In."Price/Profit Calculation" OF
Item_In."Price/Profit Calculation"::"Profit=Price-Cost":
BEGIN
IF "Price Includes VAT" THEN
"Unit Price" := "Amount Rounding".InvoiceRound("Currency Code","Unit
Price")
ELSE
"Unit Price" := "Amount Rounding".UnitAmountRound("Currency
Code","Unit Price");

IF "Price Includes VAT" THEN BEGIN


VATPostingSetup.GET("VAT Bus. Posting Gr. (Price)",Item_In."VAT Prod.
Posting Group");
CASE VATPostingSetup."VAT Calculation Type" OF
VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT":
VATPostingSetup."VAT %" := 0;
VATPostingSetup."VAT Calculation Type"::"Sales Tax":
ERROR(Text1000701 +
Text1000702,VATPostingSetup.FIELDCAPTION("VAT Calculation
Type"),
VATPostingSetup."VAT Calculation Type");
END; //Case
Price := "Unit Price" / (1 + VATPostingSetup."VAT %"/100);
END
ELSE
Price := "Unit Price";

IF "Unit of Measure Code" <> '' THEN BEGIN


ItemUnitofMeasure.GET("Item No.","Unit of Measure Code");
IF ItemUnitofMeasure."Qty. per Unit of Measure" <> 0 THEN
Price := Price / ItemUnitofMeasure."Qty. per Unit of Measure";
END;

IF "Currency Code" <> '' THEN BEGIN


CurrencyFactor :=
CurrencyExchangeRate.ExchangeRate(TODAY(),"Currency Code");
Price := CurrencyExchangeRate.ExchangeAmtFCYToLCY(TODAY(),"Currency
Code",Price,CurrencyFactor);
END;
IF Item_In."Unit Cost" <> 0 THEN
"Markup %" := ROUND((Price/Item_In."Unit Cost" - 1) * 100,0.00001)
ELSE
"Markup %" := 0;

IF Price <> 0 THEN BEGIN


"Profit %" := ROUND(100 * (1 - Item_In."Unit Cost"/Price),0.00001);
"Profit (LCY)" := ROUND(Price - Item_In."Unit Cost",0.01);
END
ELSE BEGIN
"Profit %" := 0;
"Profit (LCY)" := 0;
END;
END; // Item_In."Price/Profit Calculation"::"Profit=Price-Cost"

Item_In."Price/Profit Calculation"::"Price=Cost+Profit":
BEGIN
"Markup %" := ROUND(Item_In."Profit %"/(100-Item_In."Profit %") *
100,0.00001); //LS
Price := Item_In."Unit Cost" * (1 + "Markup %"/100);
IF Price <> 0 THEN BEGIN
"Profit %" := ROUND(100 * (1 - Item_In."Unit Cost"/Price),0.00001);
"Profit (LCY)" := ROUND(Price - Item_In."Unit Cost",0.01);
END
ELSE BEGIN
"Profit %" := 0;
"Profit (LCY)" := 0;
END;

IF "Unit of Measure Code" <> '' THEN BEGIN


ItemUnitofMeasure.GET("Item No.","Unit of Measure Code");
Price := Price * ItemUnitofMeasure."Qty. per Unit of Measure";
END;

IF "Currency Code" <> '' THEN BEGIN


CurrencyFactor :=
CurrencyExchangeRate.ExchangeRate(TODAY(),"Currency Code");
Price := CurrencyExchangeRate.ExchangeAmtLCYToFCY(TODAY(),"Currency
Code",Price,CurrencyFactor);
END;

IF "Price Includes VAT" THEN BEGIN


VATPostingSetup.GET("VAT Bus. Posting Gr. (Price)",Item_In."VAT Prod.
Posting Group");
CASE VATPostingSetup."VAT Calculation Type" OF
VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT":
VATPostingSetup."VAT %" := 0;
VATPostingSetup."VAT Calculation Type"::"Sales Tax":
ERROR(Text1000701 +
Text1000702,VATPostingSetup.FIELDCAPTION("VAT Calculation
Type"),
VATPostingSetup."VAT Calculation Type");
END; //Case
Price := Price * (1 + VATPostingSetup."VAT %"/100);
END;

IF "Price Includes VAT" THEN


"Unit Price" := "Amount Rounding".InvoiceRound("Currency Code",Price)
ELSE
"Unit Price" := "Amount Rounding".UnitAmountRound("Currency
Code",Price);
CalledByFieldNo := 0; //LS
END; //Item_In."Price/Profit Calculation"::"Price=Cost+Profit"

Item_In."Price/Profit Calculation"::"No Relationship":


BEGIN
IF "Price Includes VAT" THEN
"Unit Price" := "Amount Rounding".InvoiceRound("Currency Code","Unit
Price")
ELSE
"Unit Price" := "Amount Rounding".UnitAmountRound("Currency
Code","Unit Price");

IF "Price Includes VAT" THEN BEGIN


VATPostingSetup.GET("VAT Bus. Posting Gr. (Price)",Item_In."VAT Prod.
Posting Group");
CASE VATPostingSetup."VAT Calculation Type" OF
VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT":
VATPostingSetup."VAT %" := 0;
VATPostingSetup."VAT Calculation Type"::"Sales Tax":
ERROR(Text1000701 +
Text1000702,VATPostingSetup.FIELDCAPTION("VAT Calculation
Type"),
VATPostingSetup."VAT Calculation Type");
END; //Case
Price := "Unit Price" / (1 + VATPostingSetup."VAT %"/100);
END
ELSE
Price := "Unit Price";

IF "Unit of Measure Code" <> '' THEN BEGIN


ItemUnitofMeasure.GET("Item No.","Unit of Measure Code");
IF ItemUnitofMeasure."Qty. per Unit of Measure" <> 0 THEN
Price := Price / ItemUnitofMeasure."Qty. per Unit of Measure";
END;
IF "Currency Code" <> '' THEN BEGIN
CurrencyFactor :=
CurrencyExchangeRate.ExchangeRate(TODAY(),"Currency Code");
Price := CurrencyExchangeRate.ExchangeAmtFCYToLCY(TODAY(),"Currency
Code",Price,CurrencyFactor);
END;

IF Item_In."Unit Cost" <> 0 THEN


"Markup %" := ROUND((Price/Item_In."Unit Cost" - 1) * 100,0.00001)
ELSE
"Markup %" := 0;
END; //Item_In."Price/Profit Calculation"::"No Relationship"
END; //Case

IF CalledByFieldNo <> 99001450 THEN


CalcPriceInclVAT(Item_In);
END;

[LineStart(2799)]
PROCEDURE UpdateItemCardUnitPrice@1200000000(pModify@1200000001 : Boolean);
VAR
ItemControl@1200070000 : Codeunit 10000711;
PriceDiffer@1100409000 : Decimal;
BEGIN
//LS
//UpdateItemCardUnitPrice
RetailSetup.GET();

IF (RetailSetup."Default Price Group" <> '') AND


("Sales Type" = "Sales Type"::"Customer Price Group") AND
("Sales Code" = RetailSetup."Default Price Group")
THEN BEGIN
IF pModify THEN BEGIN
ItemControl."ItemPrice Update"(Rec);
MODIFY();
END;
Item.GET("Item No.");
IF ("Price Includes VAT" = Item."Price Includes VAT") AND
("VAT Bus. Posting Gr. (Price)" = Item."VAT Bus. Posting Gr. (Price)")
AND
("Starting Date" = 0D) AND
("Ending Date" = 0D) AND
("Currency Code" = '') AND
("Variant Code" = '') AND
(("Unit of Measure Code" = '') OR ("Unit of Measure Code" = Item."Sales
Unit of Measure")) AND
("Minimum Quantity" = 0)
THEN BEGIN
Item.VALIDATE(Item."Unit Price","Unit Price");
PriceDiffer := "Amount Rounding".UnitAmountRound("Currency Code",
ABS((Item."Unit Price Including VAT"-"Unit Price Including VAT")/10));
IF PriceDiffer = 0 THEN
Item."Unit Price Including VAT" := "Unit Price Including VAT";
Item.MODIFY(TRUE);
END;
END;
END;

[LineStart(2831)]
PROCEDURE CalcEstProfit@1200000002(VAR pItemPrice@1200000012 : Record 7002) :
Decimal;
VAR
lItemRec@1200000000 : Record 27;
PurchHeader@1200000001 : TEMPORARY Record 38;
Purchline@1200000002 : TEMPORARY Record 39;
Vendor@1200000003 : Record 23;
CurrencyRate@1200000004 : Record 330;
UOMMgt@1200000005 : Codeunit 5402;
PurchPriceCalcMgt@1200000006 : Codeunit 7010;
Profit@1200000007 : Decimal;
ItemUnitofMeasure@1200000009 : Record 5404;
Price@1200000010 : Decimal;
CurrencyFactor@1200000008 : Decimal;
lCost@1200000011 : Decimal;
"Est. Profit %"@1200000013 : Decimal;
BEGIN
//LS
//CalcEstProfit
"Est. Profit %" := 0;

IF NOT lItemRec.GET(pItemPrice."Item No.") THEN


EXIT("Est. Profit %");
IF NOT Vendor.GET(lItemRec."Vendor No.") THEN
EXIT("Est. Profit %");

IF pItemPrice."Price Includes VAT" THEN


IF NOT VATPostingSetup.GET(pItemPrice."VAT Bus. Posting Gr.
(Price)",lItemRec."VAT Prod. Posting Group") THEN
EXIT("Est. Profit %")
ELSE
CASE VATPostingSetup."VAT Calculation Type" OF
VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT":
VATPostingSetup."VAT %" := 0;
VATPostingSetup."VAT Calculation Type"::"Sales Tax":
ERROR(Text1000701 +
Text1000702,VATPostingSetup.FIELDCAPTION("VAT Calculation
Type"),
VATPostingSetup."VAT Calculation Type");
END;

//Find Est. Cost price.


PurchHeader.INIT;
PurchHeader."Document Type" := PurchHeader."Document Type"::Invoice;
IF pItemPrice."Starting Date" = 0D THEN
PurchHeader."Posting Date" := TODAY
ELSE
PurchHeader."Posting Date" := pItemPrice."Starting Date";
PurchHeader."Buy-from Vendor No." := Vendor."No.";
PurchHeader."Pay-to Vendor No." := Vendor."No.";
PurchHeader."Currency Code" := Vendor."Currency Code";
PurchHeader."Currency Factor" :=
CurrencyRate.ExchangeRate(PurchHeader."Posting Date",PurchHeader."Currency Code");

Purchline.INIT;
Purchline."Document Type" := Purchline."Document Type"::Invoice;
Purchline."Document No." := PurchHeader."No.";
Purchline.Type := Purchline.Type::Item;
Purchline."No." := pItemPrice."Item No.";
Purchline."Buy-from Vendor No." := PurchHeader."Buy-from Vendor No.";
Purchline."Pay-to Vendor No." := PurchHeader."Pay-to Vendor No.";
Purchline."Unit of Measure Code" := lItemRec."Base Unit of Measure";
Purchline."Qty. per Unit of Measure" :=
UOMMgt.GetQtyPerUnitOfMeasure(lItemRec,Purchline."Unit of Measure Code");
Purchline."Currency Code" := PurchHeader."Currency Code";

PurchPriceCalcMgt.FindPurchLinePrice(PurchHeader,Purchline,Purchline.FIELDNO(Purchl
ine."No."));
PurchPriceCalcMgt.FindPurchLineLineDisc(PurchHeader,Purchline);

IF PurchHeader."Currency Code" <> '' THEN


Purchline."Direct Unit Cost" :=
CurrencyRate.ExchangeAmtFCYToLCY(PurchHeader."Posting Date",PurchHeader."Currency
Code",
Purchline."Direct Unit
Cost",PurchHeader."Currency Factor");

IF lItemRec."Standard Cost" = 0 THEN


lCost := Purchline."Direct Unit Cost"
ELSE
lCost := lItemRec."Standard Cost";

//Find Price
IF pItemPrice."Price Includes VAT" THEN
Price := pItemPrice."Unit Price" / (1 + VATPostingSetup."VAT %"/100)
ELSE
Price := pItemPrice."Unit Price";

IF pItemPrice."Unit of Measure Code" <> '' THEN BEGIN


ItemUnitofMeasure.GET(pItemPrice."Item No.",pItemPrice."Unit of Measure
Code");
IF ItemUnitofMeasure."Qty. per Unit of Measure" <> 0 THEN
Price := Price / ItemUnitofMeasure."Qty. per Unit of Measure";
END;

IF pItemPrice."Currency Code" <> '' THEN BEGIN


CurrencyFactor := CurrencyRate.ExchangeRate(TODAY(),pItemPrice."Currency
Code");
Price := CurrencyRate.ExchangeAmtFCYToLCY(TODAY(),pItemPrice."Currency
Code",Price,CurrencyFactor);
END;

IF Price <> 0 THEN


"Est. Profit %" := ROUND(100 * (1 - lCost/Price),0.00001)
ELSE
"Est. Profit %" := 0;

EXIT("Est. Profit %");


END;

[LineStart(2914)]
PROCEDURE SetItemCardUpdate@1200000001();
BEGIN
//LS
//SetItemCardUpdate
gItemCardUpdate := TRUE;
END;

[LineStart(2919)]
PROCEDURE CalcPriceInclVAT@104(VAR Item_In@1200070000 : Record 27);
VAR
LSRetailSetup@1000 : Record 10000700;
Store@1001 : Record 99001470;
BEGIN
//CalcPriceInclVAT
//LS
IF NOT "Price Includes VAT" THEN BEGIN
IF NOT VATPostingSetup.GET("VAT Bus. Posting Gr. (Price)",Item_In."VAT
Prod. Posting Group") THEN
VATPostingSetup.INIT;
"Unit Price Including VAT" := "Unit Price" * (1 + VATPostingSetup."VAT %" /
100);
END ELSE
"Unit Price Including VAT" := "Unit Price";
END;

[External]
[LineStart(2929)]
PROCEDURE CopySalesPriceToCustomersSalesPrice@3(VAR SalesPrice@1000 : Record
7002;CustNo@1002 : Code[20]);
VAR
NewSalesPrice@1001 : Record 7002;
BEGIN
IF SalesPrice.FINDSET THEN
REPEAT
NewSalesPrice := SalesPrice;
NewSalesPrice."Sales Type" := NewSalesPrice."Sales Type"::Customer;
NewSalesPrice."Sales Code" := CustNo;
OnBeforeNewSalesPriceInsert(NewSalesPrice,SalesPrice);
IF NewSalesPrice.INSERT THEN;
UNTIL SalesPrice.NEXT = 0;
END;

[Integration]
[LineStart(2939)]
LOCAL PROCEDURE OnBeforeNewSalesPriceInsert@2(VAR NewSalesPrice@1000 : Record
7002;SalesPrice@1001 : Record 7002);
BEGIN
END;

BEGIN
{
LS = changes made by LS Retail
LS-5359 GH Standard code fixed
LS-8457 ZBZ Create preactions by using EventSubscriber functions
LS-9716 HMJ Unit price including VAT Rounding fix

MRW042 18/09/2018 dperez Gesti�n de tarifas

099 OS.XT. 31/01/2019. MRW_SP20190131_XT. En tarifes de venda, controlar si


alg� modifica el preu de venda amb un check de modificado (a la page el control)
MRW999 dperez 17/06/2019 Crear campos calculados (Grupo descuento producto,
Divisi�n, Categor�a, Grupo, Descripci�n, Proveedor)
431 OS.ACE.04/02/2021. Integraci�n con Canarias
Creaci� key nova ==> "Item No.","Sales Type","Sales Code","Ending
Date","Starting Date"
}
END.
}
}

OBJECT Table 50122 Franchises Values


{
OBJECT-PROPERTIES
{
Date=16/11/21;
Time=12:00:36;
Modified=Yes;
Version List=OS,431,558,560;
}
PROPERTIES
{
CaptionML=ESP=Valores franquicia;
LookupPageID=Page50285;
}
FIELDS
{
{ 1 ; ;Franchise Code ;Code20 ;TableRelation="Franchises
Setup";

DataClassification=ToBeClassified;
CaptionML=ESP=C�d. Franquicia }

{ 2 ; ;Type ;Option ;DataClassification=ToBeClassified;


CaptionML=[ENU=Type;
ESP=Tipo;
ENG=Type];
OptionCaptionML=[ENU=" ,Adjust
Reason,Payment Method,Income/Expense Account,Return reason";
ESP=" ,Motivo
Ajuste,Forma pago,Cuenta ingresos/gastos,Motivo devoluci�n"];
OptionString=[ ,Adjust
Reason,Payment Method,Income/Expense Account,Return reason];
Description=558,560 }
{ 3 ; ;Code ;Code20 ;TableRelation=IF
(Type=CONST(Adjust Reason)) "Reason Code"
ELSE IF
(Type=CONST(Payment Method)) "Tender Type".Code
ELSE IF
(Type=CONST(Income/Expense Account)) "Income/Expense Account".No.
ELSE IF
(Type=CONST(Return reason)) "Return Reason";

DataClassification=ToBeClassified;
CaptionML=[ENU=Code;
ESP=Codigo];
NotBlank=Yes;
Description=558,560 }

{ 10 ; ;Description ;Text100 ;DataClassification=ToBeClassified;


CaptionML=[ENU=Description;
ESP=Descripcion] }
{ 50 ; ;Franchise
Value ;Text100 ;DataClassification=ToBeClassified;
CaptionML=ESP=Valor de
franquicia }
}
KEYS
{
{ ;Franchise Code,Type,Code ;Clustered=Yes }
{ ;Franchise Code,Type,Description }
}
FIELDGROUPS
{
}
CODE
{

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
558 OS.OA. 11/11/2021. AN_CASTOR. A�adir equivalencias motivos gasto/ingreso
560 OS.OA. 15/11/2021. AN_CAST003_MRW. Devoluciones Venta CASTOR
}
END.
}
}
OBJECT Table 50123 Franchises Setup
{
OBJECT-PROPERTIES
{
Date=21/06/23;
Time=10:04:48;
Modified=Yes;
Version List=OS,431,528,544,550,560,564;
}
PROPERTIES
{
OnDelete=VAR
FranchisesSetupStore@1100225000 : Record 50126;
BEGIN
FranchisesSetupStore.SETRANGE(Code,Code);
IF NOT FranchisesSetupStore.ISEMPTY THEN
FranchisesSetupStore.DELETEALL;
END;

CaptionML=[ENU=Franchises Setup;
ESP=Configuraci�n franquicias];
}
FIELDS
{

{ 1 ; ;Code ;Code20 ;DataClassification=ToBeClassified;


CaptionML=ESP=C�digo }

{ 2 ; ;Description ;Text50 ;DataClassification=ToBeClassified;


CaptionML=ESP=Descripci�n }
{ 5 ; ;Endpoint
URL ;Text100 ;DataClassification=ToBeClassified;
CaptionML=ESP=URL Endpoint }
{ 6 ; ;Endpoint
Items ;Text30 ;DataClassification=ToBeClassified;
CaptionML=ESP=Productos Endpoint
}
{ 7 ; ;Endpoint
Shipment ;Text30 ;DataClassification=ToBeClassified;
CaptionML=[ENU=Endpoint
Shipment;
ESP=Albar�n Endpoint]
}
{ 8 ; ;Endpoint
Stock ;Text30 ;DataClassification=ToBeClassified;
CaptionML=ESP=Estoc Endpoint }

{ 10 ; ;User ;Text50 ;DataClassification=ToBeClassified;


CaptionML=ESP=Usuario }
{ 11 ; ;PVP Customer Price Group;Code10 ;TableRelation="Customer Price
Group";

DataClassification=ToBeClassified;
CaptionML=[ENU=Customer Price
Group;
ESP=PVP Grupo precio
cliente] }
{ 12 ; ;Cost Customer Price Group;Code10 ;TableRelation="Customer Price
Group";

DataClassification=ToBeClassified;
CaptionML=ESP=Precio compra
franquicia }

{ 15 ; ;Password ;Text50 ;DataClassification=ToBeClassified;


CaptionML=ESP=Contrase�a }
{ 16 ; ;Base 64
Password ;Text35 ;DataClassification=ToBeClassified;
CaptionML=ESP=Password Base 64 }
{ 25 ; ;Channel
1 ;Code20 ;DataClassification=ToBeClassified;
CaptionML=ESP=Canal 1 }
{ 30 ; ;Active
1 ;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=Activo 1 }
{ 35 ; ;Channel
2 ;Code20 ;DataClassification=ToBeClassified;
CaptionML=ESP=Canal 2 }
{ 40 ; ;Active
2 ;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=Activo 2 }
{ 45 ; ;Color Attribute ;Code20 ;TableRelation=Attribute.Code;

DataClassification=ToBeClassified;
CaptionML=ESP=Atributo Color }
{ 50 ; ;Brand Attribute ;Code20 ;TableRelation=Attribute.Code;

DataClassification=ToBeClassified;
CaptionML=ESP=Atributo Marca }
{ 55 ; ;Size Attribute ;Code20 ;TableRelation=Attribute.Code;

DataClassification=ToBeClassified;
CaptionML=ESP=Atributo Talla }

{ 70 ; ;Vendor ;Text50 ;DataClassification=ToBeClassified;


CaptionML=ESP=Proveedor }
{ 85 ; ;Enable Franchise ;Boolean ;OnValidate=VAR

FranchisesSetupStore@1100225000 : Record 50126;


BEGIN

FranchisesSetupStore.SETRANGE(Code,Code);
IF NOT
FranchisesSetupStore.ISEMPTY THEN BEGIN

FranchisesSetupStore.FINDSET;
REPEAT

FranchisesSetupStore."Enable Store" := "Enable Franchise";

FranchisesSetupStore.MODIFY;
UNTIL
FranchisesSetupStore.NEXT = 0;
END;
END;
DataClassification=ToBeClassified;
CaptionML=ESP=Habilitar
Franquicia }
{ 86 ; ;Enable Import Confirm Message;Boolean;

DataClassification=ToBeClassified;
CaptionML=[ENU=Enable Receipt
Confirm Message;
ESP=Habilitar mensaje
importaci�n confirmaci�n recepci�n] }
{ 87 ; ;Enable Import Sales
Message;Boolean;DataClassification=ToBeClassified;
CaptionML=[ENU=Enable Sales
Import Message;
ESP=Habilitar mensaje
importaci�n de ventas] }
{ 88 ; ;Enable Export Item Information;Boolean;

DataClassification=ToBeClassified;
CaptionML=[ENU=Enable Sales
Import Message;
ESP=Habilitar mensaje
exportaci�n productos] }
{ 89 ; ;Enable Import
Inventory;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=Habilitar mensaje
importaci�n inventario }
{ 90 ; ;Enable Import
Stock ;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=Habilitar mensaje
importaci�n estoc }
{ 91 ; ;Enable Export
Stock ;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=Habilitar mensaje
exportaci�n estoc }
{ 92 ; ;Send Stock In
Days ;Integer ;DataClassification=ToBeClassified;
CaptionML=ESP=Enviar mensaje de
estoc cada X d�as }
{ 93 ; ;Last Stock
Sent ;Date ;DataClassification=ToBeClassified;
CaptionML=ESP=Fecha �ltimo env�o
estoc }
{ 94 ; ;Enable Check Item Before Pick;Boolean;

DataClassification=ToBeClassified;
CaptionML=ESP=Habilitar
verificar producto antes Picking }
{ 100 ; ;Enable Export Shipment Inform.;Boolean;

DataClassification=ToBeClassified;
CaptionML=ESP=Habilitar mensaje
exportaci�n albar�n }
{ 105 ; ;Enable Import
Contact;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=Habilitar mensaje
importaci�n contactos }
{ 120 ; ;Contact Nos. ;Code20 ;TableRelation="No. Series";
DataClassification=ToBeClassified;
CaptionML=[ENU=Contact Nos.;
ESP=N� serie
contactos] }
{ 200 ; ;Save File
Path ;Text200 ;DataClassification=ToBeClassified;
CaptionML=[ENU=Save File Path;
ESP=Ruta guardar
archivo] }
{ 201 ; ;Days To Delete
Log ;Integer ;DataClassification=ToBeClassified;
CaptionML=[ENU=Days To Delete
Log;
ESP=Di�s para borrar
Log] }
{ 300 ; ;Intercompany Method ;Boolean ;OnValidate=BEGIN
//<544
IF "Intercompany
Method" THEN
"Central
Warehouse" := '';
//544>
END;

DataClassification=ToBeClassified;
CaptionML=ESP=M�todo
intercompany;
Description=544 }
{ 301 ; ;SII
Disabled ;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=SII desactivado;
Description=544 }
{ 302 ; ;View All Shipment
Ws;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=Ver todos los
albaranes v�a WS;
Description=544 }
{ 500 ; ;Date Filter To
Invoice;Date ;DataClassification=ToBeClassified;
CaptionML=ESP=Filtro fecha para
facturar }
{ 600 ; ;Store
Type ;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=Store type;
ESP=Tipo tienda];

OptionCaptionML=[ENU=" ,Franchise,Castor,Castor Franchise";

ESP=" ,Franquicia,Castor,Franquicia Castor"];

OptionString=[ ,Franchise,Castor,Castor Franchise];


Description=528,550 }
{ 601 ; ;Disable
Declaration ;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Disable
Declaration;
ESP=Deshabilitar
declaraci�n];
Description=528 }
{ 602 ; ;Central Warehouse ;Code10 ;TableRelation=Location;

DataClassification=ToBeClassified;
CaptionML=[ENU=Central
Warehouse;
ESP=Almac�n Central];
Description=528 }
{ 603 ; ;Store Whse.
Filter ;Text2048 ;DataClassification=ToBeClassified;
CaptionML=[ENU=Store Whse.
Filter;
ESP=Filtro almacenes
tiendas];
Description=528 }
{ 604 ; ;Enable Store Requests Message;Boolean;

DataClassification=ToBeClassified;
CaptionML=[ENU=Enable store
requests message;
ESP=Habilitar mensaje
peticiones tienda];
Description=528 }
{ 605 ; ;Prices Sales Code ;Code10 ;TableRelation="Customer Price
Group";

DataClassification=ToBeClassified;
CaptionML=[ENU=Sales Code;
ESP=C�digo ventas];
Description=528 }
{ 606 ; ;Enable Store Open/Close Mess.;Boolean;

DataClassification=ToBeClassified;
CaptionML=[ENU=Enable store
opening/closing message;
ESP=Habilitar mensaje
apertura/cierre tienda];
Description=528 }
{ 607 ; ;Invoicing According to Sales;Boolean;

DataClassification=ToBeClassified;
CaptionML=[ENU=Invoicing
According to Sales;
ESP=Facturaci�n seg�n
ventas];
Description=550 }
{ 608 ; ;Enable Web Sales
Returns;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Enable web sales
returns;
ESP=Habilitar devol.
venta web];
Description=560 }
{ 609 ; ;Positive Adjmt. Reason Code;Code10 ;TableRelation="Reason Code";

DataClassification=ToBeClassified;
CaptionML=[ENU=Positive Adjmt.
Reason Code;
ESP=C�d. auditor�a
ajustes positivos];
Description=564 }
{ 50000; ;Skip Flyer
statement;Boolean ;DataClassification=ToBeClassified;
Description=inc-999 }
{ 60000; ;AGV VAT Bus. Posting Gr.;Code20 ;TableRelation="VAT Business
Posting Group";
CaptionML=[ENU=VAT Bus. Posting
Gr. (Price);
ESP=Gr.regis. IVA
negocio (precio)];
Description=CS-17 }
{ 60001; ;AGV Enable Calc. Item Price;Boolean;OnValidate=BEGIN
// CS-17 ==>
IF Rec."AGV Enable
Calc. Item Price" THEN

Rec.TESTFIELD("AGV VAT Bus. Posting Gr.");

IF NOT Rec."AGV
Enable Calc. Item Price" THEN
Rec."AGV VAT Bus.
Posting Gr." := '';
// CS-17 <==
END;

DataClassification=ToBeClassified;
CaptionML=[ENU=Enable Calc. Item
Price;
ESP=Habilitar c�lculo
de tarifa producto];
Description=CS-17 }
}
KEYS
{
{ ;Code ;Clustered=Yes }
{ ;Enable Franchise,Endpoint Items,Enable Export Item Information }
{ ;Enable Franchise,Endpoint Shipment,Enable Export Shipment Inform. }
{ ;Enable Franchise,Code,Endpoint Shipment,Endpoint URL,User,Password,Base
64 Password }
{ ;Enable Franchise,Enable Import Confirm Message }
}
FIELDGROUPS
{
}
CODE
{

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
528 OS.OA. 01/06/2021. AN_CASTOR. Integraci�n con CASTOR
544 OS.MM. 09/08/2021. AN_PTG001_MRW. Implantaci�n empresa portuguesa.
550 OS.OA. 22/09/2021. AN_CAST002_MRW. Franquicias CASTOR
560 OS.OA. 15/11/2021. AN_CAST003_MRW. Devoluciones Venta CASTOR
564 OS.OA. 22/11/2021. SP_20211115_MRW. Log ajustes positivos declaraciones
CASTOR
}
END.
}
}

OBJECT Table 50124 Franchises Log Entry


{
OBJECT-PROPERTIES
{
Date=26/10/22;
Time=17:40:03;
Modified=Yes;
Version List=OS,431,528,544,550,560,584;
}
PROPERTIES
{
OnInsert=BEGIN
InitEntry;
END;

CaptionML=ESP=Log Franquicias;
LookupPageID=Page50272;
DrillDownPageID=Page50272;
}
FIELDS
{
{ 1 ; ;Operation ;Option ;CaptionML=ESP=Operaci�n;

OptionCaptionML=[ENU=,Shipment,Sale,Confirmation
Receipt,Stock,Adjustment,Item,Contact,Store Request,Store Opening,Store
Closure,Transfer Order,Sales return,ShipmentSGA;

ESP=,Albar�n,Venta,Confirmaci�n recepci�n,Stock,Ajuste
inventario,Producto,Contacto,Petici�n Tienda,Apertura Tienda,Cierre
Tienda,Transferir pedido,Devoluci�n venta,AlbaranSGA];

OptionString=,Shipment,Sale,Confirmation Receipt,Stock,Inventory
Adjustment,Item,Contact,Store Request,Store Opening,Store
Closure,TransferOrder,Return Order,ShipmentSGA;
Description=544,560 }
{ 5 ; ;Action ;Option ;CaptionML=ESP=Acci�n;

OptionCaptionML=[ENU=,Receive,Send;

ESP=,Recibir,Enviar];
OptionString=,Receive,Send }
{ 10 ; ;Entry No. ;Integer ;CaptionML=ESP=N� Mov. }

{ 11 ; ;RecordID ;RecordID ;DataClassification=ToBeClassified;


CaptionML=ESP=ID Registro }
{ 12 ; ;Source
Operation ;Code20 ;DataClassification=ToBeClassified;
CaptionML=ESP=Origen operaci�n }
{ 15 ; ;Operation Date ;Date ;CaptionML=ESP=Fecha Operaci�n }
{ 20 ; ;Operation Time ;Time ;CaptionML=ESP=Hora Operaci�n }
{ 25 ; ;User ;Code50 ;CaptionML=ESP=Usuario }
{ 30 ; ;Error ;Boolean ;CaptionML=ESP=Error }
{ 35 ; ;Description ;Text250 ;CaptionML=ESP=Descripci�n }
{ 36 ; ;Franchise
Code ;Code20 ;DataClassification=ToBeClassified;
CaptionML=ESP=C�digo
Franquicia }
{ 37 ; ;Store No. ;Code20 ;TableRelation=Store.No.;
OnValidate=VAR

RetailUser@1000000000 : Record 10000742;

RetailStoreErr@1000000001 : TextConst 'ENU=It is not possible to configure a


franchise store if it has already been configured for a user of the LS Retail
module;ESP=No es posible configurar una tienda para franquicia en caso que esta ya
haya sido configurada para un usuario del m�dulo LS Retail';
BEGIN

//RetailUser.SETRANGE("Store No.", "Store No.");


//IF NOT
RetailUser.ISEMPTY THEN
//
ERROR(RetailStoreErr);
END;

DataClassification=ToBeClassified;
CaptionML=ESP=Tienda }
{ 38 ; ;POS Terminal ;Code20 ;TableRelation="POS Terminal".No.
WHERE (Store No.=FIELD(Store No.));

DataClassification=ToBeClassified;
CaptionML=ESP=Terminal TPV }
{ 39 ; ;Store No. Source ;Code20 ;TableRelation=Store.No.;
OnValidate=VAR

RetailUser@1000000000 : Record 10000742;

RetailStoreErr@1000000001 : TextConst 'ENU=It is not possible to configure a


franchise store if it has already been configured for a user of the LS Retail
module;ESP=No es posible configurar una tienda para franquicia en caso que esta ya
haya sido configurada para un usuario del m�dulo LS Retail';
BEGIN

//RetailUser.SETRANGE("Store No.", "Store No.");


//IF NOT
RetailUser.ISEMPTY THEN
//
ERROR(RetailStoreErr);
END;

DataClassification=ToBeClassified;
CaptionML=ESP=Tienda Origen }
{ 40 ; ;Inventory
Type ;Text50 ;DataClassification=ToBeClassified;
CaptionML=ESP=Tipo Inventario }

{ 100 ; ;Processed ;Boolean ;DataClassification=ToBeClassified;


CaptionML=[ENU=Processed;
ESP=Procesado] }
{ 101 ; ;Processed
Date ;Date ;DataClassification=ToBeClassified;
CaptionML=[ENU=Processed Date;
ESP=Fecha
procesado] }
{ 102 ; ;Processed
Time ;Time ;DataClassification=ToBeClassified;
CaptionML=[ENU=Processed Time;
ESP=Hora procesado] }
{ 103 ; ;Created
Date ;Date ;DataClassification=ToBeClassified;
CaptionML=ESP=Fecha creaci�n;
Editable=No }
{ 104 ; ;Created
Time ;Time ;DataClassification=ToBeClassified;
CaptionML=ESP=Hora creaci�n;
Editable=No }
{ 110 ; ;Posted Statement No.;Code20 ;TableRelation=IF
(Operation=CONST(Store Closure)) "Posted Statement" WHERE (Store No.=FIELD(Store
No.),

Posting Date=FIELD(Processed Date));

DataClassification=ToBeClassified;
CaptionML=ESP=N� declaraci�n
registrada }
{ 200 ; ;Json
File ;BLOB ;DataClassification=ToBeClassified;
CaptionML=[ENU=Json File;
ESP=Archivo JSON] }
{ 201 ; ;Json
Type ;Text30 ;DataClassification=ToBeClassified;
CaptionML=ESP=Tipo (JSON) }
{ 202 ; ;Json
Code ;Text30 ;DataClassification=ToBeClassified;
CaptionML=ESP=C�digo (JSON) }
{ 250 ; ;Package
No ;Code20 ;DataClassification=ToBeClassified;
CaptionML=ESP=N� bulto a
recibir;
Description=Recepci� albar� }
{ 251 ; ;Posted Warehouse Shipment No.;Code20;

DataClassification=ToBeClassified;
CaptionML=ESP=N� env�o
registrado almac�n }
{ 500 ; ;Result Document
No. ;Code20 ;DataClassification=ToBeClassified;
CaptionML=ESP=N� Documento;
Description=Mostrar totals
despr�s de creaci� factures }
{ 501 ; ;Result Item
No. ;Code20 ;DataClassification=ToBeClassified;
CaptionML=ESP=N� producto }
{ 502 ; ;Result
Quantity ;Decimal ;DataClassification=ToBeClassified;
CaptionML=ESP=Cantidad }
{ 503 ; ;Result Franchise
No.;Code20 ;DataClassification=ToBeClassified;
CaptionML=ESP=N� Franquicia }
{ 504 ; ;Result Store
No. ;Code20 ;DataClassification=ToBeClassified;
CaptionML=ESP=Tienda }
{ 505 ; ;Result Location
Code;Code20 ;DataClassification=ToBeClassified;
CaptionML=ESP=C�d. Almac�n }
{ 506 ; ;Result Item
Description;Text100 ;DataClassification=ToBeClassified;
CaptionML=ESP=Descripci�n
producto }
{ 600 ; ;Store
Type ;Option ;DataClassification=ToBeClassified;
CaptionML=[ENU=Store type;
ESP=Tipo tienda];

OptionCaptionML=[ENU=" ,Franchise,Castor,Castor Franchise";

ESP=" ,Franquicia,Castor,Franquicia Castor"];

OptionString=[ ,Franchise,Castor,Castor Franchise];


Description=528,550 }
{ 601 ; ;Error On Report
Execution;Boolean ;DataClassification=ToBeClassified;
CaptionML=[ENU=Error On Report
Execution;
ESP=Error en
ejecuci�n informe];
Description=528 }
{ 610 ; ;Existe Transacci�n ;Boolean ;FieldClass=FlowField;
CalcFormula=Exist("Transaction
Header" WHERE (Receipt No.=FIELD(Source Operation)));
Editable=No }
{ 650 ; ;Processed
Manually ;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=Procesado
manualmente;
Description=584;
Editable=No }
{ 651 ; ;Processed
DateTime ;DateTime ;DataClassification=ToBeClassified;
CaptionML=ESP=FechaHora
procesado manual;
Description=584;
Editable=No }
{ 652 ; ;Processed
by ;Text30 ;DataClassification=ToBeClassified;
CaptionML=ESP=Procesado manual
por;
Description=584;
Editable=No }
{ 653 ; ;Unmark Error
Manually;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=Quitar error
manual;
Description=584;
Editable=No }
{ 654 ; ;Unmark Error
DateTime;DateTime ;DataClassification=ToBeClassified;
CaptionML=ESP=FechaHora quitar
error;
Description=584;
Editable=No }
{ 655 ; ;Unmark Error
by ;Text30 ;DataClassification=ToBeClassified;
CaptionML=ESP=Quitar error por;
Description=584;
Editable=No }
}
KEYS
{
{ ;Entry No.,Operation,Action ;Clustered=Yes }
{ ;Operation,Action,User }
{ ;Operation Date }
{ ;Operation,RecordID,Processed,Franchise Code }
{ ;Action,Operation,Franchise Code,Processed }
}
FIELDGROUPS
{
}
CODE
{

[LineStart(2949)]
LOCAL PROCEDURE InitEntry@7141746();
VAR
FranchisesLogEntry@7141743 : Record 50124;
BEGIN
IF FranchisesLogEntry.FINDLAST THEN
"Entry No." := FranchisesLogEntry."Entry No." + 1
ELSE
"Entry No." := 1;

"Operation Date" := WORKDATE;


"Operation Time" := TIME;
User := USERID;

"Created Date" := WORKDATE;


"Created Time" := TIME;
END;

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
528 OS.OA. 01/06/2021. AN_CASTOR. Integraci�n con CASTOR
544 OS.MM. 09/08/2021. AN_PTG001_MRW. Implantaci�n empresa portuguesa.
550 OS.OA. 22/09/2021. AN_CAST002_MRW. Franquicias CASTOR
560 OS.OA. 15/11/2021. AN_CAST003_MRW. Devoluciones Venta CASTOR
584 OS.AP. 18/05/2022. SP20220518_MRW. Ajustes TPV y declaraciones
}
END.
}
}

OBJECT Table 50126 Franchises Setup Store


{
OBJECT-PROPERTIES
{
Date=29/12/21;
Time=[ 9:30:47];
Modified=Yes;
Version List=OS,431,528,544,579;
}
PROPERTIES
{
OnInsert=VAR
FranchisesSetup@1100225000 : Record 50123;
BEGIN
FranchisesSetup.SETRANGE(Code,Code);
IF FranchisesSetup.FINDFIRST THEN
VALIDATE("Enable Store",FranchisesSetup."Enable Franchise");
END;

CaptionML=[ENU=Franchises Setup Store;


ESP=Configuraci�n tiendas franquicias];
}
FIELDS
{

{ 1 ; ;Code ;Code20 ;DataClassification=ToBeClassified;


CaptionML=ESP=C�digo }
{ 2 ; ;Store No. ;Code20 ;TableRelation=Store.No.;
OnValidate=VAR

RetailUser@1000000000 : Record 10000742;

RetailStoreErr@1000000001 : TextConst 'ENU=It is not possible to configure a


franchise store if it has already been configured for a user of the LS Retail
module;ESP=No es posible configurar una tienda para franquicia en caso que esta ya
haya sido configurada para un usuario del m�dulo LS Retail';
BEGIN

//RetailUser.SETRANGE("Store No.", "Store No.");


//IF NOT
RetailUser.ISEMPTY THEN
//
ERROR(RetailStoreErr);
END;

DataClassification=ToBeClassified;
CaptionML=ESP=Tienda }
{ 3 ; ;POS Terminal ;Code20 ;TableRelation="POS Terminal".No.
WHERE (Store No.=FIELD(Store No.));

DataClassification=ToBeClassified;
CaptionML=ESP=Terminal TPV }
{ 10 ; ;Customer No. ;Code20 ;TableRelation=Customer.No.;

DataClassification=ToBeClassified;
CaptionML=ESP=N� Cliente }
{ 20 ; ;Invoice Location ;Code10 ;TableRelation=Location;

DataClassification=ToBeClassified;
CaptionML=ESP=Almac�n de
facturaci�n }
{ 30 ; ;Integration Doc.
Type;Option ;DataClassification=ToBeClassified;
CaptionML=ESP=Tipo documento
integraci�n;
OptionCaptionML=[ENU=Transfer,Purchase;

ESP=Transferencia,Compra];
OptionString=Transfer,Purchase;
Description=544 }
{ 75 ; ;Journal Template Name Adjust;Code10;TableRelation="Item Journal
Template";
CaptionML=[ENU=Journal Template
Name;
ESP=Nombre libro
diario ajustes] }
{ 80 ; ;Journal Batch Name Adjust;Code10 ;TableRelation="Item Journal
Batch".Name WHERE (Journal Template Name=FIELD(Journal Template Name Adjust));

DataClassification=ToBeClassified;
CaptionML=[ENU=Journal Batch
Name;
ESP=Nombre secci¢n
diario ajustes] }
{ 81 ; ;Journal Template Name Reclass;Code10;
TableRelation="Item Journal
Template";

DataClassification=ToBeClassified;
CaptionML=[ENU=Journal Template
Name;
ESP=Nombre libro
diario reclasificaci�n] }
{ 82 ; ;Journal Batch Name Reclass;Code10 ;TableRelation="Item Journal
Batch".Name WHERE (Journal Template Name=FIELD(Journal Template Name Reclass));

DataClassification=ToBeClassified;
CaptionML=[ENU=Journal Batch
Name;
ESP=Nombre secci¢n
diario reclasificaci�n] }
{ 85 ; ;Enable Store ;Boolean ;OnValidate=VAR

FranchisesSetup@1100225003 : Record 50123;


Store@1100225002 :
Record 99001470;

StorePosition@1100225001 : Integer;

StoreFilterTxt@1100225000 : Text;
BEGIN
//<528

FranchisesSetup.GET(Rec.Code);

Store.GET(Rec."Store No.");
IF
FranchisesSetup."Store Type" = FranchisesSetup."Store Type"::Castor THEN
IF "Enable Store"
THEN BEGIN
IF
FranchisesSetup."Store Whse. Filter" = '' THEN
FranchisesSetup."Store Whse. Filter" := Store."Location Code"
ELSE

FranchisesSetup."Store Whse. Filter" += '|' + Store."Location Code";

FranchisesSetup.MODIFY;
END ELSE BEGIN
StorePosition
:= STRPOS(FranchisesSetup."Store Whse. Filter", Store."Location Code");
IF
StorePosition <> 0 THEN BEGIN
IF
(StorePosition - 1) = 0 THEN

StoreFilterTxt := DELSTR(FranchisesSetup."Store Whse. Filter",1,


(STRLEN(Store."Location Code")+1))
ELSE

StoreFilterTxt := DELSTR(FranchisesSetup."Store Whse. Filter",StorePosition-1,


(STRLEN(Store."Location Code")+1));

FranchisesSetup."Store Whse. Filter" := StoreFilterTxt;

FranchisesSetup.MODIFY;
END;
END;
//528>
END;

DataClassification=ToBeClassified;
CaptionML=ESP=Habilitar Tienda }

{ 200 ; ;ECI ;Boolean ;DataClassification=ToBeClassified;


CaptionML=ESP=ECI;
Description=579 }
{ 607 ; ;Income No. ;Code10 ;TableRelation="Income/Expense
Account".No. WHERE (Store No.=FIELD(Store No.));

DataClassification=ToBeClassified;
CaptionML=[ENU=Income No.;
ESP=Cuenta ingresos];
Description=528 }
{ 608 ; ;Expenses No. ;Code10 ;TableRelation="Income/Expense
Account".No. WHERE (Store No.=FIELD(Store No.));

DataClassification=ToBeClassified;
CaptionML=[ENU=Expenses No.;
ESP=Cuenta gastos];
Description=528 }
}
KEYS
{
{ ;Code,Store No.,POS Terminal ;Clustered=Yes }
{ ;Enable Store,Code,Store No. }
{ ;Store No. }
}
FIELDGROUPS
{
}
CODE
{

BEGIN
{
528 OS.OA. 01/06/2021. AN_CASTOR. Integraci�n con CASTOR
544 OS.MM. 09/08/2021. AN_PTG001_MRW. Implantaci�n empresa portuguesa.
579 OS.MM. 29/12/2021. CASTOR ECI.
}
END.
}
}

OBJECT Table 50128 Franchises Stock Entry


{
OBJECT-PROPERTIES
{
Date=30/03/21;
Time=12:40:29;
Modified=Yes;
Version List=OS,431;
}
PROPERTIES
{
CaptionML=[ENU=Franchises Stock Entry;
ESP=Estoc Franquicias];
LookupPageID=Page50279;
}
FIELDS
{
{ 1 ; ;Operation
Date ;Date ;DataClassification=ToBeClassified;
CaptionML=ESP=Fecha Operaci�n;
Editable=No }
{ 2 ; ;Franchise
Code ;Code20 ;DataClassification=ToBeClassified;
CaptionML=ESP=C�digo Franquicia;
Editable=No }
{ 3 ; ;Item No. ;Code20 ;TableRelation=Item;

DataClassification=ToBeClassified;
CaptionML=ESP=N� Producto;
Editable=No }
{ 4 ; ;Lot
No. ;Code50 ;DataClassification=ToBeClassified;
CaptionML=[ENU=Lot No.;
ESP=N§ lote];
Editable=No }
{ 5 ; ;Location Code ;Code10 ;TableRelation=Location;

DataClassification=ToBeClassified;
CaptionML=ESP=C�d. almac�n;
Editable=No }
{ 6 ; ;Store No. ;Code20 ;TableRelation=Store.No.;
OnValidate=VAR

RetailUser@1000000000 : Record 10000742;


RetailStoreErr@1000000001 : TextConst 'ENU=It is not possible to configure a
franchise store if it has already been configured for a user of the LS Retail
module;ESP=No es posible configurar una tienda para franquicia en caso que esta ya
haya sido configurada para un usuario del m�dulo LS Retail';
BEGIN
END;

DataClassification=ToBeClassified;
CaptionML=ESP=Tienda;
Editable=No }
{ 24 ; ;Item
Description ;Text100 ;DataClassification=ToBeClassified;
CaptionML=ESP=Descripci�n;
Editable=No }
{ 25 ; ;Barcode
No. ;Code20 ;DataClassification=ToBeClassified;
CaptionML=[ENU=Barcode No.;
ESP=No. C�d. Barras];
Editable=No }
{ 26 ; ;Location
Name ;Text100 ;DataClassification=ToBeClassified;
CaptionML=ESP=Nombre almac�n;
Editable=No }
{ 27 ; ;Franchise
Stock ;Decimal ;DataClassification=ToBeClassified;
CaptionML=ESP=Estoc Franquicia;
Editable=No }
{ 28 ; ;MRW
Stock ;Decimal ;DataClassification=ToBeClassified;
CaptionML=ESP=Estoc MRW;
Editable=No }
{ 29 ; ;Status ;Option ;OnValidate=BEGIN
IF Status =
Status::Resolved THEN BEGIN
"Resolution Date"
:= WORKDATE;
"Resolution
USERID" := USERID;
END ELSE BEGIN
"Resolution Date"
:= 0D;
"Resolution
USERID" := '';
END;
END;

DataClassification=ToBeClassified;
CaptionML=ESP=Estado;
OptionCaptionML=[ENU=Resolution
pending,In Resolution,Resolved;
ESP=Pendiente
resoluci�n,En resoluci�n,Resuelto];
OptionString=Resolution
pending,In Resolution,Resolved }
{ 30 ; ;Resolution
Description;Text250 ;DataClassification=ToBeClassified;
CaptionML=ESP=Descripci�n de la
resoluci�n }
{ 31 ; ;Resolution
Date ;Date ;DataClassification=ToBeClassified;
CaptionML=ESP=Fecha resoluci�n;
Editable=No }
{ 32 ; ;Resolution USERID ;Code50 ;OnValidate=VAR

UserMgt@1100225000 : Codeunit 418;


BEGIN

UserMgt.ValidateUserID("Resolution USERID");
END;

OnLookup=VAR
UserMgt@1100225000 :
Codeunit 418;
BEGIN

UserMgt.LookupUserID("Resolution USERID");
END;

DataClassification=ToBeClassified;
CaptionML=ESP=Usuario
resoluci�n;
Editable=No }
{ 33 ; ;Stock
Difference ;Decimal ;DataClassification=ToBeClassified;
CaptionML=ESP=Diferencia estoc;
Editable=No }
}
KEYS
{
{ ;Operation Date,Franchise Code,Item No.,Lot No.,Location Code;
Clustered=Yes }
}
FIELDGROUPS
{
}
CODE
{

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
}
END.
}
}

OBJECT Table 50133 Franchises Adjust Entry


{
OBJECT-PROPERTIES
{
Date=05/10/21;
Time=14:14:12;
Modified=Yes;
Version List=OS,431,999;
}
PROPERTIES
{
CaptionML=[ENU=Franchises Adjust Entry;
ESP=Ajuste Franquicias];
LookupPageID=Page50306;
}
FIELDS
{
{ 1 ; ;Operation
Date ;Date ;DataClassification=ToBeClassified;
CaptionML=ESP=Fecha Operaci�n;
Editable=No }
{ 2 ; ;Franchise
Code ;Code20 ;DataClassification=ToBeClassified;
CaptionML=ESP=C�digo Franquicia;
Editable=No }
{ 3 ; ;Item No. ;Code20 ;TableRelation=Item;

DataClassification=ToBeClassified;
CaptionML=ESP=N� Producto;
Editable=No }
{ 5 ; ;Location Code ;Code10 ;TableRelation=Location;

DataClassification=ToBeClassified;
CaptionML=ESP=C�d. almac�n;
Editable=No }
{ 6 ; ;Store No. ;Code20 ;TableRelation=Store.No.;
OnValidate=VAR

RetailUser@1000000000 : Record 10000742;

RetailStoreErr@1000000001 : TextConst 'ENU=It is not possible to configure a


franchise store if it has already been configured for a user of the LS Retail
module;ESP=No es posible configurar una tienda para franquicia en caso que esta ya
haya sido configurada para un usuario del m�dulo LS Retail';
BEGIN
END;

DataClassification=ToBeClassified;
CaptionML=ESP=Tienda;
Editable=No }
{ 7 ; ;Entry
No. ;Integer ;DataClassification=ToBeClassified;
CaptionML=ESP=N� mov. }
{ 15 ; ;Quantity
Adjusted ;Decimal ;DataClassification=ToBeClassified;
CaptionML=ESP=Cantidad
ajustada }
{ 24 ; ;Item
Description ;Text100 ;DataClassification=ToBeClassified;
CaptionML=ESP=Descripci�n;
Editable=No }
{ 25 ; ;Barcode
No. ;Code20 ;DataClassification=ToBeClassified;
CaptionML=[ENU=Barcode No.;
ESP=No. C�d. Barras];
Editable=No }
{ 26 ; ;Location
Name ;Text100 ;DataClassification=ToBeClassified;
CaptionML=ESP=Nombre almac�n;
Editable=No }
{ 29 ; ;Status ;Option ;OnValidate=BEGIN
IF Status =
Status::Resolved THEN BEGIN
"Resolution Date"
:= WORKDATE;
"Resolution
USERID" := USERID;
END ELSE BEGIN
"Resolution Date"
:= 0D;
"Resolution
USERID" := '';
END;
END;

DataClassification=ToBeClassified;
CaptionML=ESP=Estado;
OptionCaptionML=[ENU=Resolution
pending,In Resolution,Resolved;
ESP=Pendiente
resoluci�n,En resoluci�n,Resuelto];
OptionString=Resolution
pending,In Resolution,Resolved }
{ 30 ; ;Resolution
Description;Text250 ;DataClassification=ToBeClassified;
CaptionML=ESP=Descripci�n de la
resoluci�n }
{ 31 ; ;Resolution
Date ;Date ;DataClassification=ToBeClassified;
CaptionML=ESP=Fecha resoluci�n;
Editable=No }
{ 32 ; ;Resolution USERID ;Code50 ;OnValidate=VAR

UserMgt@1100225000 : Codeunit 418;


BEGIN

UserMgt.ValidateUserID("Resolution USERID");
END;

OnLookup=VAR
UserMgt@1100225000 :
Codeunit 418;
BEGIN

UserMgt.LookupUserID("Resolution USERID");
END;

DataClassification=ToBeClassified;
CaptionML=ESP=Usuario
resoluci�n;
Editable=No }
{ 33 ; ;Related To Receipt
No.;Code20 ;DataClassification=ToBeClassified;
CaptionML=ESP=Relacionado con n�
ticket }
}
KEYS
{
{ ;Entry No. ;Clustered=Yes }
}
FIELDGROUPS
{
}
CODE
{

BEGIN
{
999 OS.XT. 05/10/2021. Modificaci� per les vendes fer ajust positiu si no hi
ha estoc i guardar-ho en taula nova
}
END.
}
}

OBJECT Table 99001473 Trans. Sales Entry


{
OBJECT-PROPERTIES
{
Date=16/12/21;
Time=11:50:39;
Modified=Yes;
Version List=LSW113.0.00.775,OS,431,528,546,578,700;
}
PROPERTIES
{
OnInsert=BEGIN
VALIDATE("Replication Counter");
END;

OnModify=BEGIN
VALIDATE("Replication Counter");
END;

OnRename=BEGIN
IF NOT CONFIRM(Text000 + Text001) THEN
ERROR(Text002);
END;

CaptionML=[ENU=Trans. Sales Entry;


ESP=Mov. Venta Transacci�n];
LookupPageID=Page99001497;
DrillDownPageID=Page99001497;
}
FIELDS
{
{ 1 ; ;Transaction No. ;Integer ;TableRelation="Transaction
Header"."Transaction No." WHERE (Store No.=FIELD(Store No.),

POS Terminal No.=FIELD(POS Terminal No.));


CaptionML=[ENU=Transaction No.;
ESP=N� Transacci�n] }
{ 2 ; ;Line No. ;Integer ;CaptionML=[ENU=Line No.;
ESP=No. L�nea] }
{ 3 ; ;Receipt No. ;Code20 ;CaptionML=[ENU=Receipt No.;
ESP=No. Recibo] }
{ 4 ; ;Barcode No. ;Code22 ;TableRelation=Barcodes."Barcode
No.";
ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=Barcode No.;
ESP=No. C�d.
Barras] }
{ 5 ; ;Item No. ;Code20 ;TableRelation=Item;
OnValidate=VAR
Item@1000 : Record
27;
ItemSectionLoc@1001
: Record 99001533;

DiscOfferLine@1002 : Record 99001503;


ItemCategory@1003 :
Record 5722;
ProductGroup@1004 :
Record 5723;
TestDec@1005 :
Integer;

TransactionHeader@10012000 : Record 99001472;


POSVATCode@10012002
: Record 99001560;

VATPercentage@10012001 : Decimal;

RetailPriceUtils@10012003 : Codeunit 99001462;


BEGIN
IF NOT
Item.GET("Item No.") THEN BEGIN
"Transaction
Code" := "Transaction Code"::"Item/Barcode Not On File";
"Product Group
Code" := '';
"Item Category
Code" := '';
EXIT;
END;

IF (Item.Blocked)
THEN
"Transaction
Code" := "Transaction Code"::"Item Blocked"
ELSE
"Transaction
Code" := "Transaction Code"::"Item on File";

"Item Category
Code" := Item."Item Category Code";
"Product Group
Code" := Item."Product Group Code";
"Item Posting
Group" := Item."Inventory Posting Group";
ItemSectionLoc.RESET;

ItemSectionLoc.SETRANGE("Item No.",Item."No.");

ItemSectionLoc.SETRANGE("Store No.","Store No.");

ItemSectionLoc.SETRANGE("Shows Sales Statistics",TRUE);


IF
ItemSectionLoc.FIND('-') THEN BEGIN
Section :=
ItemSectionLoc."Section Code";
Shelf :=
ItemSectionLoc."Shelf Code";
END ELSE BEGIN

ItemSectionLoc.SETRANGE("Shows Sales Statistics");


IF
ItemSectionLoc.FIND('-') THEN BEGIN
Section :=
ItemSectionLoc."Section Code";
Shelf :=
ItemSectionLoc."Shelf Code";
END ELSE BEGIN
Section := '';
Shelf := '';
END;
END;

IF Item."Qty.
Becomes Negative" THEN
TestDec := - 1
ELSE
TestDec := 1;
IF "Return No Sale"
THEN
TestDec := -
TestDec;
IF "Item Corrected
Line" THEN
IF ABS(Quantity -
TestDec) > (Quantity) THEN
"Item Corrected
Line" := FALSE;

CASE Item."POS Cost


Calculation" OF
Item."POS Cost
Calculation"::"Item Based":
BEGIN
IF "Cost
Amount" = 0 THEN
IF
Item."Price/Profit Calculation" < Item."Price/Profit Calculation"::"No
Relationship" THEN
"Cost
Amount" := ROUND((Quantity * "Net Price") * (1 - Item."Profit %" / 100))
END;
Item."POS Cost
Calculation"::"Product Group Based":
IF
ProductGroup.GET("Item Category Code","Product Group Code") THEN
"Cost Amount"
:= ROUND((Quantity * "Net Price") * (1 - ProductGroup."Default Profit %" / 100));
Item."POS Cost
Calculation"::"Item Cat. Based":
IF
ItemCategory.GET("Item Category Code") THEN
"Cost Amount"
:= ROUND((Quantity * "Net Price") * (1 - ItemCategory."Default Profit %" / 100));
END;

IF NOT
TransactionHeader.GET("Store No.","POS Terminal No.","Transaction No.") THEN

CLEAR(TransactionHeader);
VATPercentage := 0;
IF ("VAT Amount" <>
0) AND ("VAT Code" <> '') THEN
IF
POSVATCode.GET("VAT Code") THEN

VATPercentage := POSVATCode."VAT %";


IF Quantity <> 0
THEN
"Disc. Amount
From Std. Price" := ABS(ROUND("Net Amount" / Quantity,0.01)) - "Standard Net Price"
ELSE
"Disc. Amount
From Std. Price" := 0;
END;

ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=Item No.;
ESP=No. Producto] }
{ 17 ; ;Sales Staff ;Code20 ;TableRelation=Staff;
CaptionML=[ENU=Sales Staff;
ESP=Personal
Ventas] }
{ 20 ; ;Item Category Code ;Code10 ;TableRelation="Item Category";
ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=Item Category
Code;
ESP=C�digo Categor�a
Producto] }
{ 25 ; ;Product Group Code ;Code10 ;TableRelation="Product
Group".Code WHERE (Item Category Code=FIELD(Item Category Code));
ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=Product Group
Code;
ESP=C�d. grupo
producto] }
{ 30 ; ;Price ;Decimal ;CaptionML=[ENU=Price;
ESP=Precio];
DecimalPlaces=2:2 }
{ 31 ; ;Net Price ;Decimal ;CaptionML=[ENU=Net Price;
ESP=Precio Neto] }
{ 32 ; ;Quantity ;Decimal ;CaptionML=[ENU=Quantity;
ESP=Cantidad];
DecimalPlaces=0:5 }
{ 35 ; ;Price Group Code ;Code10 ;CaptionML=[ENU=Price Group Code;
ESP=C�d. Grupo
Precio] }
{ 36 ; ;VAT Bus. Posting Group;Code10 ;CaptionML=[ENU=VAT Bus. Posting
Group;
ESP=Grupo registro
IVA neg.] }
{ 40 ; ;VAT Code ;Code10 ;CaptionML=[ENU=VAT Code;
ESP=C�d. IVA] }
{ 50 ; ;xTransaction Status ;Option ;CaptionML=[ENU=xTransaction
Status;
ESP=Estado
Transacci�n];

OptionCaptionML=[ENU=" ,Voided,Posted,Training";

ESP=" ,Anulado,Registrado,Entrenamiento"];

OptionString=[ ,Voided,Posted,Training] }
{ 55 ; ;Discount Amount ;Decimal ;CaptionML=[ENU=Discount Amount;
ESP=Importe
Descuento];
DecimalPlaces=2:2 }
{ 56 ; ;Cost Amount ;Decimal ;CaptionML=[ENU=Cost Amount;
ESP=Importe coste];
DecimalPlaces=2:2 }
{ 60 ; ;Date ;Date ;CaptionML=[ENU=Date;
ESP=Fecha] }
{ 61 ; ;Time ;Time ;CaptionML=[ENU=Time;
ESP=Hora] }
{ 62 ; ;Shift No. ;Code1 ;TableRelation="Work Shift
Setup".No.;
CaptionML=[ENU=Shift No.;
ESP=No. Turno] }
{ 63 ; ;Shift Date ;Date ;TableRelation="Work Shift
RBO"."Shift Date";
CaptionML=[ENU=Shift Date;
ESP=Fecha Turno] }
{ 65 ; ;Net Amount ;Decimal ;CaptionML=[ENU=Net Amount;
ESP=Importe Neto];
DecimalPlaces=2:2 }
{ 66 ; ;VAT Amount ;Decimal ;CaptionML=[ENU=VAT Amount;
ESP=Importe IVA];
DecimalPlaces=2:2 }
{ 67 ; ;Promotion No. ;Code20 ;TableRelation=Offer.No.;
CaptionML=[ENU=Promotion No.;
ESP=No Promoci�n] }
{ 68 ; ;Standard Net Price ;Decimal ;CaptionML=[ENU=Standard Net
Price;
ESP=Precio Neto
Standard] }
{ 69 ; ;Disc. Amount From Std. Price;Decimal;
CaptionML=[ENU=Disc. Amount From
Std. Price;
ESP=Imp. Dto. de
Precio Standard] }
{ 70 ; ;xStatement No. ;Code20 ;CaptionML=[ENU=xStatement No.;
ESP=xNo. Declaraci�n]
}
{ 75 ; ;Customer No. ;Code20 ;TableRelation=Customer;
CaptionML=[ENU=Customer No.;
ESP=N� cliente] }
{ 80 ; ;Section ;Code10 ;TableRelation="Store
Section".Code WHERE (Store No.=FIELD(Store No.));
CaptionML=[ENU=Section;
ESP=Secci�n] }
{ 83 ; ;Shelf ;Code10 ;TableRelation="Section
Shelf".Code WHERE (Store No.=FIELD(Store No.),

Section Code=FIELD(Section));
CaptionML=[ENU=Shelf;
ESP=Estanter�a] }
{ 85 ; ;Statement Code ;Code20 ;CaptionML=[ENU=Statement Code;
ESP=C�d. Declaraci�n]
}
{ 86 ; ;Item Disc. Group ;Code20 ;CaptionML=[ENU=Item Disc. Group;
ESP=Grupo Dto.
Producto] }
{ 90 ; ;Transaction Code ;Option ;CaptionML=[ENU=Transaction Code;
ESP=C�digo
Transacci�n];
OptionCaptionML=[ENU=Item on
File,Item/Barcode Not On File,Item Blocked;
ESP=Producto en
Fichero,Producto/C�d. Barras no En Fichero,Producto Bloqueado];
OptionString=Item on
File,Item/Barcode Not On File,Item Blocked }
{ 100 ; ;Store No. ;Code10 ;TableRelation=Store;
CaptionML=[ENU=Store No.;
ESP=No. Tienda] }
{ 140 ; ;Item Number Scanned ;Boolean ;CaptionML=[ENU=Item Number
Scanned;
ESP=N�mero Productos
Escaneados] }
{ 145 ; ;Keyboard Item Entry ;Boolean ;CaptionML=[ENU=Keyboard Item
Entry;
ESP=Mov. Producto por
Teclado] }
{ 150 ; ;Price in Barcode ;Boolean ;CaptionML=[ENU=Price in Barcode;
ESP=Precio en C�d.
Barras] }
{ 151 ; ;Price Change ;Boolean ;CaptionML=[ENU=Price Change;
ESP=Cambio Precio] }
{ 152 ; ;Weight Manually Entered;Boolean ;CaptionML=[ENU=Weight Manually
Entered;
ESP=Peso insertado
Manualmente] }
{ 170 ; ;Line was Discounted ;Boolean ;CaptionML=[ENU=Line was
Discounted;
ESP=La l�nea fue
descontada] }
{ 175 ; ;Scale Item ;Boolean ;CaptionML=[ENU=Scale Item;
ESP=Producto
pesado] }
{ 176 ; ;Weight Item ;Boolean ;CaptionML=[ENU=Weight Item;
ESP=Producto Pre-
Pesado] }
{ 185 ; ;Return No Sale ;Boolean ;CaptionML=[ENU=Return No Sale;
ESP=Devolver No.
Venta] }
{ 195 ; ;Item Corrected Line ;Boolean ;CaptionML=[ENU=Item Corrected
Line;
ESP=L�nea Producto
Corregido] }
{ 200 ; ;Type of Sale ;Option ;CaptionML=[ENU=Type of Sale;
ESP=Tipo de Venta];
OptionCaptionML=[ENU=Item
Sale,Product Group Sale,Item Category Sale;
ESP=Venta
Produto,Venta Grupo Producto,Venta Dept. Producto];
OptionString=Item Sale,Product
Group Sale,Item Category Sale }
{ 205 ; ;Linked No. not Orig.;Boolean ;CaptionML=[ENU=Linked No. not
Orig.;
ESP=No. Vinculado No
Original] }
{ 235 ; ;Orig. of a Linked Item List;Boolean;CaptionML=[ENU=Orig. of a Linked
Item List;
ESP=Orig. Lista
Productos Vinculados] }
{ 250 ; ;POS Terminal No. ;Code10 ;TableRelation="POS
Terminal".No.;
ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=POS Terminal No.;
ESP=No. TPV] }
{ 255 ; ;Staff ID ;Code20 ;TableRelation=Staff.ID;
ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=Staff ID;
ESP=ID Empleado] }
{ 260 ; ;Item Posting Group ;Code10 ;TableRelation="Inventory Posting
Group".Code;
CaptionML=[ENU=Item Posting
Group;
ESP=Grupo Registro
Producto] }
{ 270 ; ;Total Rounded Amt. ;Decimal ;CaptionML=[ENU=Total Rounded
Amt.;
ESP=Total Importe
Redondeado] }
{ 275 ; ;Counter ;Decimal ;InitValue=1;
CaptionML=[ENU=Counter;
ESP=Contador] }
{ 280 ; ;Variant Code ;Code10 ;TableRelation="Item
Variant".Code WHERE (Item No.=FIELD(Item No.));
CaptionML=[ENU=Variant Code;
ESP=C�digo
Variante] }
{ 290 ; ;Serial No. ;Code20 ;CaptionML=[ENU=Serial No.;
ESP=No. Serie] }
{ 291 ; ;Serial/Lot No. Not Valid;Boolean ;CaptionML=[ENU=Serial/Lot No.
Not Valid;
ESP=No. Serie No
Encontrado] }
{ 292 ; ;Lot No. ;Code20 ;CaptionML=[ENU=Lot No.;
ESP=N� lote] }
{ 293 ; ;Expiration Date ;Date ;CaptionML=[ENU=Expiration Date;
ESP=Fecha
caducidad] }
{ 300 ; ;Member Points Type ;Option ;CaptionML=[ENU=Member Points
Type;
ESP=Tipo Puntos
Miembro];
OptionCaptionML=[ENU=Award
Points,Other Points;
ESP=Puntos
Premio,Otros Puntos];
OptionString=Award Points,Other
Points }
{ 301 ; ;Member Points ;Decimal ;CaptionML=[ENU=Member Points;
ESP=Puntos Miembro] }
{ 302 ; ;Offer Blocked Points;Boolean ;CaptionML=[ENU=Offer Blocked
Points;
ESP=Puntos Bloqueados
Oferta] }
{ 600 ; ;Trans. Date ;Date ;CaptionML=[ENU=Trans. Date;
ESP=Fecha Trans.] }
{ 601 ; ;Trans. Time ;Time ;CaptionML=[ENU=Trans. Time;
ESP=Hora Trans] }
{ 900 ; ;Posting Exception Key;Text75 ;CaptionML=[ENU=Posting Exception
Key;
ESP=Clave Excepci�n
Registro] }
{ 1000; ;Line Discount ;Decimal ;CaptionML=[ENU=Line Discount;
ESP=Descuento L�nea];
DecimalPlaces=2:2 }
{ 1001; ;Replicated ;Boolean ;CaptionML=[ENU=Replicated;
ESP=Replicado] }
{ 1002; ;Customer Discount ;Decimal ;CaptionML=[ENU=Customer
Discount;
ESP=Descuento
Cliente] }
{ 1005; ;Infocode Discount ;Decimal ;CaptionML=[ENU=Infocode
Discount;
ESP=Descuento
Infoc�digo] }
{ 1006; ;Cust. Invoice Discount;Decimal ;CaptionML=[ENU=Cust. Invoice
Discount;
ESP=Descuento Factura
Cliente] }
{ 1007; ;Unit of Measure ;Code10 ;TableRelation="Unit of
Measure".Code;
CaptionML=[ENU=Unit of Measure;
ESP=Unidad de Medida]
}
{ 1008; ;UOM Quantity ;Decimal ;CaptionML=[ENU=UOM Quantity;
ESP=Cantidad UM] }
{ 1009; ;UOM Price ;Decimal ;CaptionML=[ENU=UOM Price;
ESP=Precio UM] }
{ 1010; ;Total Discount ;Decimal ;CaptionML=[ENU=Total Discount;
ESP=Descuento Total];
DecimalPlaces=2:2 }
{ 1011; ;Total Disc.% ;Decimal ;CaptionML=[ENU=Total Disc.%;
ESP=Dto.Total %] }
{ 1012; ;Tot. Disc Info Line No.;Integer ;CaptionML=[ENU=Tot. Disc Info
Line No.;
ESP=Dto.Total No.
Info L�n.] }
{ 1015; ;Periodic Disc. Type ;Option ;CaptionML=[ENU=Periodic Disc.
Type;
ESP=Tipo Descuento
Peri�dico];

OptionCaptionML=[ENU=" ,Multibuy,Mix&Match,Disc. Offer";

ESP=" ,Multicompra,Mix&Match,Oferta Desc."];

OptionString=[ ,Multibuy,Mix&Match,Disc. Offer] }


{ 1020; ;Periodic Disc. Group;Code20 ;CaptionML=[ENU=Periodic Disc.
Group;
ESP=Grupo Dto.
Peri�dico] }
{ 1025; ;Periodic Discount ;Decimal ;CaptionML=[ENU=Periodic
Discount;
ESP=Descuento
Peri�dico];
DecimalPlaces=2:2 }
{ 1030; ;Deal Line ;Boolean ;CaptionML=[ENU=Deal Line;
ESP=L�nea Men�
Promoci�n] }
{ 1031; ;Deal Header Line No.;Integer ;CaptionML=[ENU=Deal Header Line
No.;
ESP=No. L�n. Cabecera
Men�] }
{ 1032; ;Deal Line No. ;Integer ;CaptionML=[ENU=Deal Line No.;
ESP=No. L�nea
Promo] }
{ 1034; ;Deal Line Added Amt.;Decimal ;CaptionML=[ENU=Deal Line Added
Amt.;
ESP=Importe A�ad.
L�na Promo.] }
{ 1035; ;Deal Modifier Added Amt.;Decimal ;CaptionML=[ENU=Deal Modifier
Added Amt.;
ESP=Importe A�adido
Mod. Promo] }
{ 1036; ;Deal Modifier Line No.;Integer ;CaptionML=[ENU=Deal Modifier
Line No.;
ESP=No. L�n.
Modificador Promo] }
{ 1050; ;Discount Amt. For Printing;Decimal ;CaptionML=[ENU=Discount Amt. For
Printing;
ESP=Valor Desc. para
Impresi�n] }
{ 1055; ;Coupon Discount ;Decimal ;CaptionML=[ENU=Coupon Discount;
ESP=Descuento
Cup�n] }
{ 1060; ;Coupon Amt. For Printing;Decimal ;CaptionML=[ENU=Coupon Amt. For
Printing;
ESP=Cdad. Cup�n Para
Impresi�n] }
{ 1100; ;Replication Counter ;Integer ;OnValidate=VAR

TransSalesEntry@10012000 : Record 99001473;


BEGIN
IF NOT
ClientSessionUtility.UpdateReplicationCounters THEN
EXIT;

TransSalesEntry.SETCURRENTKEY("Replication Counter");
IF
TransSalesEntry.FINDLAST THEN
"Replication
Counter" := TransSalesEntry."Replication Counter" + 1
ELSE
"Replication
Counter" := 1;
END;

CaptionML=[ENU=Replication
Counter;
ESP=Contador
Replicaci�n] }
{ 1101; ;Sales Type ;Code20 ;TableRelation="Sales Type".Code;
ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=Sales Type;
ESP=Tipo venta] }
{ 1150; ;Orig. from Infocode ;Code10 ;CaptionML=[ENU=Orig. from
Infocode;
ESP=Orig. desde
Infoc�digo] }
{ 1151; ;Orig. from Subcode ;Code20 ;CaptionML=[ENU=Orig. from
Subcode;
ESP=Orig. de
Subc�digo] }
{ 1152; ;Parent Line No. ;Integer ;CaptionML=[ENU=Parent Line No.;
ESP=No. L�nea
Maestro] }
{ 1153; ;Infocode Entry Line No.;Integer ;CaptionML=[ENU=Infocode Entry
Line No.;
ESP=No. L�n. Mov.
Infoc�digo] }
{ 1154; ;Excluded BOM Line No.;Integer ;CaptionML=[ENU=Excluded BOM Line
No.;
ESP=Ingrediente
Excluido] }
{ 1155; ;Infocode Selected Qty.;Decimal ;CaptionML=[ENU=Infocode Selected
Qty.;
ESP=Cdad.
Seleccionada Infoc�digo] }
{ 1156; ;Parent Item No. ;Code20 ;CaptionML=[ENU=Parent Item No.;
ESP=N� L.M.] }
{ 1200; ;Orig Trans Store ;Code10 ;CaptionML=[ENU=Orig. Trans.
Store;
ESP=Tienda Trans.
Orig.] }
{ 1201; ;Orig Trans Pos ;Code10 ;CaptionML=[ENU=Orig. Trans. Pos;
ESP=TPV Trans. Orig.]
}
{ 1202; ;Orig Trans No. ;Integer ;CaptionML=[ENU=Orig. Trans. No.;
ESP=No. Trans. Orig.]
}
{ 1203; ;Orig Trans Line No. ;Integer ;CaptionML=[ENU=Orig. Trans. Line
No.;
ESP=No. L�n. Trans.
Orig.] }
{ 1210; ;Refund Qty. ;Decimal ;CaptionML=[ENU=Refund Qty.;
ESP=Cdad. Reembolso];
DecimalPlaces=0:5 }
{ 1211; ;Refunded Line No. ;Integer ;CaptionML=[ENU=Refunded Line
No.;
ESP=No. L�nea
Reembolso] }
{ 1212; ;Refunded Trans. No. ;Integer ;CaptionML=[ENU=Refunded Trans.
No.;
ESP=No. Trans.
Reembolso] }
{ 1213; ;Refunded POS No. ;Code20 ;CaptionML=[ENU=Refunded POS No.;
ESP=No. TPV
Reembolso] }
{ 1214; ;Refunded Store No. ;Code20 ;CaptionML=[ENU=Refunded Store
No.;
ESP=No. Tienda
Reembolso] }
{ 1215; ;Created by Staff ID ;Code20 ;TableRelation=Staff.ID;
CaptionML=[ENU=Created by Staff
ID;
ESP=Creado por ID
Empleado];
Description= }
{ 1216; ;Marked for Gift Receipt;Boolean ;CaptionML=[ENU=Marked for Gift
Receipt;
ESP=Marcado para
Ticket Regalo];
Description=-2282 AMS }
{ 50000; ;SII Receipt
No. ;Code20 ;DataClassification=ToBeClassified;
CaptionML=[ENU=Receipt No.;
ESP=No. ticket SII];
Description=700 }
{ 50001; ;No Item Leger
Entry ;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=Sin movimiento
producto;
Description=431 }
{ 50002; ;Promotional
Code ;Text250 ;DataClassification=ToBeClassified;
CaptionML=ESP=C�digo
promocional;
Description=528 }
{ 50003; ;Promotion
% ;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Promotion %;
ESP=% Promoci�n];
DecimalPlaces=0:2;
Description=578 }
{ 60000; ;Transaction Type ;Option ;FieldClass=FlowField;
CalcFormula=Lookup("Transaction
Header"."Transaction Type" WHERE (Store No.=FIELD(Store No.),

POS Terminal No.=FIELD(POS Terminal No.),

Transaction No.=FIELD(Transaction No.)));


CaptionML=[ENU=Transaction Type;
ESP=Tipo
Transacci�n];

OptionCaptionML=[ENU=Logoff,Logon,Sales,Payment,Remove Tender,Float Entry,Change


Tender,Tender Decl.,Voided,Open Drawer,NegAdj,PhysInv,Collect,Cancelation;
ESP=Terminar
Sesi�n,Iniciar Sesi�n,Ventas,Pagos,Borrar Medio Pago,Adici�n a Caja,Cambiar Medio
Pago,Decl. Caja,Anulado,Abrir Caj�n,Ajuste Negativo,Inventario
F�sico,Recolecci�n,Cancelaci�n];

OptionString=Logoff,Logon,Sales,Payment,Remove Tender,Float Entry,Change


Tender,Tender Decl.,Voided,Open Drawer,NegAdj,PhysInv,Collect,Cancelation;
Description=546;
Editable=No }
{ 10012782;;Recommended Item ;Boolean ;CaptionML=[ENU=Recommended Item;
ESP=Producto
Recomendado] }
{ 10016250;;BI Timestamp ;DateTime ;CaptionML=[ENU=BI Timestamp;
ESP=BI Timestamp] }
}
KEYS
{
{ ;Store No.,POS Terminal No.,Transaction No.,Line No.;
Clustered=Yes }
{ ;Item No.,Variant Code,Date,Store No.,Serial No.,Lot No.;
SumIndexFields=Quantity,Net
Amount,Discount Amount,Cost Amount,VAT Amount,Counter;
KeyGroups=Store;
SIFTLevelsToMaintain=[{Item
No.},
{Item
No.,Variant Code,Date:Day,Store No.},
{Item
No.,Variant Code,Date:Day,Store No.,Serial No.}] }
{ No ;Item No.,Return No Sale,Date,Store No. ;SumIndexFields=Quantity,Net
Amount,Discount Amount,Cost Amount,Counter,VAT Amount;
KeyGroups=Store;
SIFTLevelsToMaintain=[{Item
No.},
{Item
No.,Return No Sale},
{Item
No.,Return No Sale,Date:Year},
{Item
No.,Return No Sale,Date:Month},
{Item
No.,Return No Sale,Date:Day},
{Item
No.,Return No Sale,Date:Day,Store No.}] }
{ ;Product Group Code,Date,Store No.,Item Corrected Line;
SumIndexFields=Quantity,Net
Amount,Discount Amount,Cost Amount,VAT Amount,Counter;
KeyGroups=Store;
SIFTLevelsToMaintain=[{Product
Group Code},
{Product
Group Code,Date:Year},
{Product
Group Code,Date:Month},
{Product
Group Code,Date:Day},
{Product
Group Code,Date:Day,Store No.}] }
{ ;Store No.,Section,Shelf,Date ;SumIndexFields=Quantity,Net
Amount,Discount Amount,Cost Amount,VAT Amount;
KeyGroups=Store;
SIFTLevelsToMaintain=[{Store
No.},
{Store
No.,Section},
{Store
No.,Section,Shelf},
{Store
No.,Section,Shelf,Date:Day}] }
{ ;Item Category Code,Date,Store No. ;SumIndexFields=Quantity,Net
Amount,Discount Amount,Cost Amount,VAT Amount;
KeyGroups=Store;
SIFTLevelsToMaintain=[{Item
Category Code},
{Item
Category Code,Date:Year},
{Item
Category Code,Date:Month},
{Item
Category Code,Date:Day},
{Item
Category Code,Date:Day,Store No.}] }
{ No ;Statement Code,Line was Discounted ;SumIndexFields=Net Amount,VAT
Amount,Discount Amount,Total Discount;
KeyGroups=Store }
{ No ;Date ;KeyGroups=Store }
{ No ;Product Group Code,Item No.,Customer No.;SumIndexFields=Net Amount,VAT
Amount,Discount Amount,Quantity;
KeyGroups=Store }
{ No ;Shift No.,Shift Date,Store No. ;SumIndexFields=Discount
Amount,Cost Amount,Net Amount;
KeyGroups=Store }
{ No ;Transaction Code,Barcode No. ;KeyGroups=Store }
{ No ;Replicated }
{ No ;Item No.,Variant Code,Date ;SumIndexFields=Quantity }
{ ;Date,Item No. ;SumIndexFields=Net Amount,VAT
Amount,Discount Amount,Cost Amount,Quantity }
{ ;Item Category Code,Product Group Code,Date;
SumIndexFields=Quantity,Net
Amount,VAT Amount,Discount Amount }
{ ;Customer No.,Date }
{ ;Replication Counter }
{ ;Orig Trans Store,Orig Trans Pos,Orig Trans No.,Orig Trans Line No.;
SumIndexFields=Quantity;
MaintainSIFTIndex=No }
}
FIELDGROUPS
{
}
CODE
{
VAR
Text000@1000 : TextConst 'ENU=Renaming the record could cause problems with
data exchange.\;ESP=Renombrar el registro podr�a causar problema con el intercambio
de datos.\';
Text001@1001 : TextConst 'ENU=Do you still want to rename the
record?;ESP=�Desea renombrar el registro de todas formas?';
Text002@1002 : TextConst 'ENU=The record was not renamed.;ESP=El registro ha
sido renombrado.';
ClientSessionUtility@10014500 : Codeunit 10000961;

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
528 OS.MM. 04/10/2021. AN_CASTOR. Integraci�n con CASTOR
546 OS.MM. 13/08/2021. 2021-122. Webservice para informar Ventas a
franquicias Wonregala.
578 OS.OA. 15/12/2021. Facturaci�n franquicias tipo Canarias
700 OS.AP. 19/09/2019. Numeradors tickets SII TPV.
}
END.
}
}

OBJECT Table 99001540 Archived Sales Entry


{
OBJECT-PROPERTIES
{
Date=25/01/23;
Time=17:07:31;
Modified=Yes;
Version List=LSW113.0.00.775,OS,431,578,700;
}
PROPERTIES
{
CaptionML=[ENU=Archived Sales Entry;
ESP=Mov. Venta Archivado];
LookupPageID=Page99001671;
DrillDownPageID=Page99001671;
}
FIELDS
{
{ 1 ; ;Transaction No. ;Integer ;TableRelation="Archived
Transaction Header"."Transaction No.";
CaptionML=[ENU=Transaction No.;
ESP=N� Transacci�n] }
{ 2 ; ;Line No. ;Integer ;CaptionML=[ENU=Line No.;
ESP=No. L�nea] }
{ 3 ; ;Receipt No. ;Code20 ;CaptionML=[ENU=Receipt No.;
ESP=No. Recibo] }
{ 4 ; ;Barcode No. ;Code22 ;TableRelation=Barcodes."Barcode
No.";
ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=Barcode No.;
ESP=No. C�d.
Barras] }
{ 5 ; ;Item No. ;Code20 ;TableRelation=Item;
ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=Item No.;
ESP=No. Producto] }
{ 17 ; ;Sales Staff ;Code20 ;TableRelation=Staff;
CaptionML=[ENU=Sales Staff;
ESP=Personal
Ventas] }
{ 20 ; ;Item Category Code ;Code10 ;TableRelation="Trans. Server
Table Setup"."Profile ID";
ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=Item Category
Code;
ESP=C�digo Categor�a
Producto] }
{ 25 ; ;Product Group Code ;Code10 ;TableRelation="Trans. Server
Table Log"."Table No.";
ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=Product Group
Code;
ESP=C�d. grupo
producto] }
{ 30 ; ;Price ;Decimal ;CaptionML=[ENU=Price;
ESP=Precio];
DecimalPlaces=2:2 }
{ 31 ; ;Net Price ;Decimal ;CaptionML=[ENU=Net Price;
ESP=Precio Neto] }
{ 32 ; ;Quantity ;Decimal ;CaptionML=[ENU=Quantity;
ESP=Cantidad] }
{ 35 ; ;Price Group Code ;Code10 ;CaptionML=[ENU=Price Group Code;
ESP=C�d. Grupo
Precio] }
{ 36 ; ;VAT Bus. Posting Group;Code10 ;CaptionML=[ENU=VAT Bus. Posting
Group;
ESP=Grupo registro
IVA neg.] }
{ 40 ; ;VAT Code ;Code10 ;CaptionML=[ENU=VAT Code;
ESP=C�d. IVA] }
{ 50 ; ;xTransaction Status ;Option ;CaptionML=[ENU=xTransaction
Status;
ESP=Estado
Transacci�n];

OptionCaptionML=[ENU=" ,Voided,Posted,Training";

ESP=" ,Anulado,Registrado,Entrenamiento"];

OptionString=[ ,Voided,Posted,Training] }
{ 55 ; ;Discount Amount ;Decimal ;CaptionML=[ENU=Discount Amount;
ESP=Importe
Descuento];
DecimalPlaces=2:2 }
{ 56 ; ;Cost Amount ;Decimal ;CaptionML=[ENU=Cost Amount;
ESP=Importe coste];
DecimalPlaces=2:2 }
{ 60 ; ;Date ;Date ;CaptionML=[ENU=Date;
ESP=Fecha] }
{ 61 ; ;Time ;Time ;CaptionML=[ENU=Time;
ESP=Hora] }
{ 62 ; ;Shift No. ;Code1 ;TableRelation="Work Shift
Setup".No.;
CaptionML=[ENU=Shift No.;
ESP=No. Turno] }
{ 63 ; ;Shift Date ;Date ;TableRelation="Work Shift
RBO"."Shift Date";
CaptionML=[ENU=Shift Date;
ESP=Fecha Turno] }
{ 65 ; ;Net Amount ;Decimal ;CaptionML=[ENU=Net Amount;
ESP=Importe Neto];
DecimalPlaces=2:2 }
{ 66 ; ;VAT Amount ;Decimal ;CaptionML=[ENU=VAT Amount;
ESP=Importe IVA];
DecimalPlaces=2:2 }
{ 67 ; ;Promotion No. ;Code20 ;TableRelation=Offer.No.;
CaptionML=[ENU=Promotion No.;
ESP=No Promoci�n] }
{ 68 ; ;Standard Net Price ;Decimal ;CaptionML=[ENU=Standard Net
Price;
ESP=Precio Neto
Standard] }
{ 69 ; ;Disc. Amount From Std. Price;Decimal;
CaptionML=[ENU=Disc. Amount From
Std. Price;
ESP=Imp. Dto. de
Precio Standard] }
{ 70 ; ;xStatement No. ;Code20 ;CaptionML=[ENU=xStatement No.;
ESP=No.
Declaraci�n] }
{ 75 ; ;Customer No. ;Code20 ;TableRelation=Customer;
CaptionML=[ENU=Customer No.;
ESP=N� cliente] }
{ 80 ; ;Section ;Code10 ;TableRelation="Store
Section".Code WHERE (Store No.=FIELD(Store No.));
CaptionML=[ENU=Section;
ESP=Secci�n] }
{ 83 ; ;Shelf ;Code10 ;TableRelation="Section
Shelf".Code WHERE (Store No.=FIELD(Store No.),

Section Code=FIELD(Section));
CaptionML=[ENU=Shelf;
ESP=Estanter�a] }
{ 85 ; ;Statement Code ;Code20 ;CaptionML=[ENU=Statement Code;
ESP=C�d. Declaraci�n]
}
{ 86 ; ;Item Disc. Group ;Code10 ;CaptionML=[ENU=Item Disc. Group;
ESP=Grupo Dto.
Producto] }
{ 90 ; ;Transaction Code ;Option ;CaptionML=[ENU=Transaction Code;
ESP=C�digo
Transacci�n];
OptionCaptionML=[ENU=Item on
File,Item/Barcode Not On File,Item Blocked;
ESP=Producto en
Fichero,Producto/C�d. Barras no En Fichero,Producto Bloqueado];
OptionString=Item on
File,Item/Barcode Not On File,Item Blocked }
{ 100 ; ;Store No. ;Code10 ;TableRelation=Store;
CaptionML=[ENU=Store No.;
ESP=No. Tienda] }
{ 140 ; ;Item Number Scanned ;Boolean ;CaptionML=[ENU=Item Number
Scanned;
ESP=N�mero Productos
Escaneados] }
{ 145 ; ;Keyboard Item Entry ;Boolean ;CaptionML=[ENU=Keyboard Item
Entry;
ESP=Mov. Producto por
Teclado] }
{ 150 ; ;Price in Barcode ;Boolean ;CaptionML=[ENU=Price in Barcode;
ESP=Precio en C�d.
Barras] }
{ 151 ; ;Price Change ;Boolean ;CaptionML=[ENU=Price Change;
ESP=Cambio Precio] }
{ 152 ; ;Weight Manually Entered;Boolean ;CaptionML=[ENU=Weight Manually
Entered;
ESP=Peso insertado
Manualmente] }
{ 170 ; ;Line was Discounted ;Boolean ;CaptionML=[ENU=Line was
Discounted;
ESP=La l�nea fue
descontada] }
{ 175 ; ;Scale Item ;Boolean ;CaptionML=[ENU=Scale Item;
ESP=Producto
pesado] }
{ 176 ; ;Weight Item ;Boolean ;CaptionML=[ENU=Weight Item;
ESP=Producto Pre-
Pesado] }
{ 185 ; ;Return No Sale ;Boolean ;CaptionML=[ENU=Return No Sale;
ESP=Devolver No.
Venta] }
{ 195 ; ;Item Corrected Line ;Boolean ;CaptionML=[ENU=Item Corrected
Line;
ESP=L�nea Producto
Corregido] }
{ 200 ; ;Type of Sale ;Option ;CaptionML=[ENU=Type of Sale;
ESP=Tipo de Venta];
OptionCaptionML=[ENU=Item
Sale,Product Group Sale,Item Category Sale;
ESP=Venta
Produto,Venta Grupo Producto,Venta Dept. Producto];
OptionString=Item Sale,Product
Group Sale,Item Category Sale }
{ 205 ; ;Linked No. not Orig.;Boolean ;CaptionML=[ENU=Linked No. not
Orig.;
ESP=No. Vinculado No
Original] }
{ 235 ; ;Orig. of a Linked Item List;Boolean;CaptionML=[ENU=Orig. of a Linked
Item List;
ESP=Orig. Lista
Productos Vinculados] }
{ 250 ; ;POS Terminal No. ;Code10 ;TableRelation="POS
Terminal".No.;
ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=POS Terminal No.;
ESP=No. TPV] }
{ 255 ; ;Staff ID ;Code20 ;TableRelation=Staff.ID;
ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=Staff ID;
ESP=ID Empleado] }
{ 260 ; ;Item Posting Group ;Code10 ;TableRelation="Inventory Posting
Group".Code;
CaptionML=[ENU=Item Posting
Group;
ESP=Grupo Contable
Producto] }
{ 270 ; ;Total Rounded Amt. ;Decimal ;CaptionML=[ENU=Total Rounded
Amt.;
ESP=Total Importe
Redondeado] }
{ 275 ; ;Counter ;Decimal ;InitValue=1;
CaptionML=[ENU=Counter;
ESP=Contador] }
{ 280 ; ;Variant Code ;Code10 ;TableRelation="Item
Variant".Code;
CaptionML=[ENU=Variant Code;
ESP=C�digo
Variante] }
{ 290 ; ;Serial No. ;Code20 ;CaptionML=[ENU=Serial No.;
ESP=No. Serie] }
{ 291 ; ;Serial/Lot No. Not Valid;Boolean ;CaptionML=[ENU=Serial/Lot No.
Not Valid;
ESP=No. Serie No
Encontrado] }
{ 292 ; ;Lot No. ;Code20 ;CaptionML=[ENU=Lot No.;
ESP=N� lote] }
{ 293 ; ;Expiration Date ;Date ;CaptionML=[ENU=Expiration Date;
ESP=Fecha
caducidad] }
{ 300 ; ;Member Points Type ;Option ;CaptionML=[ENU=Member Points
Type;
ESP=Tipo Puntos
Miembro];
OptionCaptionML=[ENU=Award
Points,Other Points;
ESP=Puntos
Premio,Otros Puntos];
OptionString=Award Points,Other
Points }
{ 301 ; ;Member Points ;Decimal ;CaptionML=[ENU=Member Points;
ESP=Puntos Miembro] }
{ 302 ; ;Offer Blocked Points;Boolean ;CaptionML=[ENU=Offer Blocked
Points;
ESP=Puntos Bloqueados
Oferta] }
{ 600 ; ;Trans. Date ;Date ;CaptionML=[ENU=Trans. Date;
ESP=Fecha Trans.] }
{ 601 ; ;Trans. Time ;Time ;CaptionML=[ENU=Trans. Time;
ESP=Hora Trans] }
{ 900 ; ;Posting Exception Key;Text75 ;CaptionML=[ENU=Posting Exception
Key;
ESP=Clave Excepci�n
Registro] }
{ 1000; ;Line Discount ;Decimal ;CaptionML=[ENU=Line Discount;
ESP=Descuento L�nea];
DecimalPlaces=2:2 }
{ 1001; ;Replicated ;Boolean ;CaptionML=[ENU=Replicated;
ESP=Replicado] }
{ 1002; ;Customer Discount ;Decimal ;CaptionML=[ENU=Customer
Discount;
ESP=Descuento
Cliente] }
{ 1005; ;Infocode Discount ;Decimal ;CaptionML=[ENU=Infocode
Discount;
ESP=Descuento
Infoc�digo] }
{ 1006; ;Cust. Invoice Discount;Decimal ;CaptionML=[ENU=Cust. Invoice
Discount;
ESP=Descuento Factura
Cliente] }
{ 1007; ;Unit of Measure ;Code10 ;TableRelation="Unit of
Measure".Code;
CaptionML=[ENU=Unit of Measure;
ESP=Unidad de Medida]
}
{ 1008; ;UOM Quantity ;Decimal ;CaptionML=[ENU=UOM Quantity;
ESP=Cantidad UM] }
{ 1009; ;UOM Price ;Decimal ;CaptionML=[ENU=UOM Price;
ESP=Precio UM] }
{ 1010; ;Total Discount ;Decimal ;CaptionML=[ENU=Total Discount;
ESP=Descuento Total];
DecimalPlaces=2:2 }
{ 1011; ;Total Disc.% ;Decimal ;CaptionML=[ENU=Total Disc.%;
ESP=Dto.Total %] }
{ 1012; ;Tot. Disc Info Line No.;Integer ;CaptionML=[ENU=Tot. Disc Info
Line No.;
ESP=Dto.Total No.
Info L�n.] }
{ 1015; ;Periodic Disc. Type ;Option ;CaptionML=[ENU=Periodic Disc.
Type;
ESP=Tipo Descuento
Peri�dico];

OptionCaptionML=[ENU=" ,Multibuy,Mix&Match,Disc. Offer";

ESP=" ,Multicompra,Mix&Match,Oferta Desc."];

OptionString=[ ,Multibuy,Mix&Match,Disc. Offer] }


{ 1020; ;Periodic Disc. Group;Code20 ;CaptionML=[ENU=Periodic Disc.
Group;
ESP=Grupo Dto.
Peri�dico] }
{ 1025; ;Periodic Discount ;Decimal ;CaptionML=[ENU=Periodic
Discount;
ESP=Descuento
Peri�dico];
DecimalPlaces=2:2 }
{ 1030; ;Deal Line ;Boolean ;CaptionML=[ENU=Deal Line;
ESP=L�nea Men�
Promoci�n] }
{ 1031; ;Deal Header Line No.;Integer ;CaptionML=[ENU=Deal Header Line
No.;
ESP=No. L�n. Cabecera
Men�] }
{ 1032; ;Deal Line No. ;Integer ;CaptionML=[ENU=Deal Line No.;
ESP=No. L�nea
Promo] }
{ 1034; ;Deal Line Added Amt.;Decimal ;CaptionML=[ENU=Deal Line Added
Amt.;
ESP=Importe A�ad.
L�na Promo.] }
{ 1035; ;Deal Modifier Added Amt.;Decimal ;CaptionML=[ENU=Deal Modifier
Added Amt.;
ESP=Importe A�adido
Mod. Promo] }
{ 1036; ;Deal Modifier Line No.;Integer ;CaptionML=[ENU=Deal Modifier
Line No.;
ESP=No. L�n.
Modificador Promo] }
{ 1050; ;Discount Amt. For Printing;Decimal ;CaptionML=[ENU=Discount Amt. For
Printing;
ESP=Valor Desc. para
Impresi�n] }
{ 1055; ;Coupon Discount ;Decimal ;CaptionML=[ENU=Coupon Discount;
ESP=Descuento
Cup�n] }
{ 1060; ;Coupon Amt. For Printing;Decimal ;CaptionML=[ENU=Coupon Amt. For
Printing;
ESP=Cdad. Cup�n Para
Impresi�n] }
{ 1100; ;Replication Counter ;Integer ;OnValidate=VAR

TransSalesEntry@10012000 : Record 99001473;


BEGIN
END;

CaptionML=[ENU=Replication
Counter;
ESP=Contador
Replicaci�n] }
{ 1101; ;Sales Type ;Code20 ;TableRelation="Sales Type".Code;
ValidateTableRelation=No;
TestTableRelation=No;
CaptionML=[ENU=Sales Type;
ESP=Tipo venta] }
{ 1150; ;Orig. from Infocode ;Code10 ;CaptionML=[ENU=Orig. from
Infocode;
ESP=Orig. desde
Infoc�digo] }
{ 1151; ;Orig. from Subcode ;Code20 ;CaptionML=[ENU=Orig. from
Subcode;
ESP=Orig. de
Subc�digo] }
{ 1152; ;Parent Line No. ;Integer ;CaptionML=[ENU=Parent Line No.;
ESP=No. L�nea
Maestro] }
{ 1153; ;Infocode Entry Line No.;Integer ;CaptionML=[ENU=Infocode Entry
Line No.;
ESP=No. L�n. Mov.
Infoc�digo] }
{ 1154; ;Excluded BOM Line No.;Integer ;CaptionML=[ENU=Excluded BOM Line
No.;
ESP=Ingrediente
Excluido] }
{ 1155; ;Infocode Selected Qty.;Decimal ;CaptionML=[ENU=Infocode Selected
Qty.;
ESP=Cdad.
Seleccionada Infoc�digo] }
{ 1156; ;Parent Item No. ;Code20 ;CaptionML=[ENU=Parent Item No.;
ESP=N� L.M.] }
{ 1200; ;Orig. Trans. Store ;Code10 ;CaptionML=[ENU=Orig. Trans.
Store;
ESP=Tienda Trans.
Orig.] }
{ 1201; ;Orig. Trans. Pos ;Code10 ;CaptionML=[ENU=Orig. Trans. Pos;
ESP=TPV Trans. Orig.]
}
{ 1202; ;Orig. Trans. No. ;Integer ;CaptionML=[ENU=Orig. Trans. No.;
ESP=No. Trans. Orig.]
}
{ 1203; ;Orig. Trans. Line No.;Integer ;CaptionML=[ENU=Orig. Trans. Line
No.;
ESP=No. L�n. Trans.
Orig.] }
{ 1204; ;Qty Refunded ;Decimal ;FieldClass=FlowField;
CalcFormula=Sum("Trans. Sales
Entry".Quantity WHERE (Orig Trans Store=FIELD(Store No.),

Orig Trans Pos=FIELD(POS Terminal No.),

Orig Trans No.=FIELD(Transaction No.),

Orig Trans Line No.=FIELD(Line No.)));


CaptionML=[ENU=Qty Refunded;
ESP=Cdad. Devuelta];
DecimalPlaces=0:5 }
{ 1210; ;Refund Qty. ;Decimal ;CaptionML=[ENU=Refund Qty.;
ESP=Cdad. Reembolso];
DecimalPlaces=0:5 }
{ 1211; ;Refunded Line No. ;Integer ;CaptionML=[ENU=Refunded Line
No.;
ESP=No. L�nea
Reembolso] }
{ 1212; ;Refunded Trans. No. ;Integer ;CaptionML=[ENU=Refunded Trans.
No.;
ESP=No. Trans.
Reembolso] }
{ 1213; ;Refunded POS No. ;Code20 ;CaptionML=[ENU=Refunded POS No.;
ESP=No. TPV
Reembolso] }
{ 1214; ;Refunded Store No. ;Code20 ;CaptionML=[ENU=Refunded Store
No.;
ESP=No. Tienda
Reembolso] }
{ 1215; ;Created by Staff ID ;Code20 ;CaptionML=[ENU=Created by Staff
ID;
ESP=Creado por ID
Empleado] }
{ 50000; ;SII Receipt
No. ;Code20 ;DataClassification=ToBeClassified;
CaptionML=[ENU=Receipt No.;
ESP=No. ticket SII];
Description=700 }
{ 50001; ;No Item Leger
Entry ;Boolean ;DataClassification=ToBeClassified;
CaptionML=ESP=Sin movimiento
producto;
Description=431 }
{ 50002; ;Promotional
Code ;Text250 ;DataClassification=ToBeClassified;
CaptionML=ESP=C�digo
promocional;
Description=528 }
{ 50003; ;Promotion
% ;Decimal ;DataClassification=ToBeClassified;
CaptionML=[ENU=Promotion %;
ESP=% Promoci�n];
DecimalPlaces=0:2;
Description=578 }
{ 60000; ;Transaction Type ;Option ;FieldClass=FlowField;
CalcFormula=Lookup("Transaction
Header"."Transaction Type" WHERE (Store No.=FIELD(Store No.),

POS Terminal No.=FIELD(POS Terminal No.),

Transaction No.=FIELD(Transaction No.)));


CaptionML=[ENU=Transaction Type;
ESP=Tipo
Transacci�n];

OptionCaptionML=[ENU=Logoff,Logon,Sales,Payment,Remove Tender,Float Entry,Change


Tender,Tender Decl.,Voided,Open Drawer,NegAdj,PhysInv,Collect,Cancelation;
ESP=Terminar
Sesi�n,Iniciar Sesi�n,Ventas,Pagos,Borrar Medio Pago,Adici�n a Caja,Cambiar Medio
Pago,Decl. Caja,Anulado,Abrir Caj�n,Ajuste Negativo,Inventario
F�sico,Recolecci�n,Cancelaci�n];

OptionString=Logoff,Logon,Sales,Payment,Remove Tender,Float Entry,Change


Tender,Tender Decl.,Voided,Open Drawer,NegAdj,PhysInv,Collect,Cancelation;
Description=546;
Editable=No }
{ 10012782;;Recommended Item ;Boolean ;CaptionML=[ENU=Recommended Item;
ESP=Producto
Recomendado] }
{ 10016250;;BI Timestamp ;DateTime ;CaptionML=[ENU=BI Timestamp;
ESP=BI Timestamp] }
}
KEYS
{
{ ;Store No.,POS Terminal No.,Transaction No.,Line No.;
Clustered=Yes }
}
FIELDGROUPS
{
}
CODE
{
BEGIN
{
578 OS.OA. 15/12/2021. Facturaci�n franquicias tipo Canarias
700 OS.AP. 19/09/2019. Numeradors tickets SII TPV.
431 OS.ACE.04/02/2021. Integraci�n con Canarias
}
END.
}
}

OBJECT Report 50003 Franchises Invoicing


{
OBJECT-PROPERTIES
{
Date=01/10/21;
Time=14:03:42;
Modified=Yes;
Version List=OS,431,550;
}
PROPERTIES
{
CaptionML=[ENU=Franchises Invoicing;
ESP=Facturaci�n Franquicia];
ProcessingOnly=Yes;
}
DATASET
{
{ 1000000000;;DataItem;Franchises Setup ;
DataItemTable=Table50123;
DataItemTableView=SORTING(Code);
OnPreDataItem=BEGIN
//<550
//FranchiseCodeFilter := "Franchises
Setup".GETFILTER(Code);
IF FranchiseCodeFilter <> '' THEN
"Franchises Setup".SETFILTER(Code,
FranchiseCodeFilter);
//550>
DateFilterToInvoiceFilter := "Franchises
Setup".GETFILTER("Date Filter To Invoice");
"Franchises Setup".SETRANGE("Date Filter To
Invoice");

IF DateFilterToInvoiceFilter = '' THEN


ERROR(DateFilterIsMandatoryErr);

IF FranchiseCodeFilter = '' THEN


IF NOT CONFIRM(NoFranchiseCodeSelectedQst) THEN
ERROR(ProcessCancelledByUserErr);

Window.OPEN('Franquicia............................... #1##########\'+
'Tienda
Franquicia........................ #2##########\'+

'......................................................\'+
'Guardando productos a
facturar/abonar.... @3@@@@@@@@@@\'+
'Creando factura
borrador................. @4@@@@@@@@@@\'+
'Creando abono
borrador................... @5@@@@@@@@@@\');
END;

OnAfterGetRecord=BEGIN
Window.UPDATE(1,"Franchises Setup".Code);
END;

OnPostDataItem=BEGIN
MESSAGE(FinishedInv,TotalDocuments);

Window.CLOSE;
END;

ReqFilterFields=Date Filter To Invoice }

{ 1000000001;1;DataItem;Franchises Setup Store;


DataItemTable=Table50126;
DataItemTableView=SORTING(Code,Store No.,POS Terminal);
OnAfterGetRecord=VAR
SalesHeader@1000000000 : Record 36;
SalesLine@1100225003 : Record 37;
ItemLedgerEntry@1100225000 : Record 32;
LineNo@1100225004 : Integer;
TempInventoryBuffer@1100225001 : TEMPORARY Record
307;
NoOfRecs@1100225002 : Integer;
CurrRec@1100225005 : Integer;
TransSalesEntry@1100225006 : Record 99001473;
BEGIN
Window.UPDATE(2,"Franchises Setup Store"."Store
No.");
Window.UPDATE(3,0);
Window.UPDATE(4,0);

CLEAR(TempInventoryBuffer);
IF NOT TempInventoryBuffer.ISEMPTY THEN
TempInventoryBuffer.DELETEALL;

TransSalesEntry.SETCURRENTKEY("Store
No.",Section,Shelf,Date);
TransSalesEntry.SETRANGE("Store No.","Franchises
Setup Store"."Store No.");

TransSalesEntry.SETFILTER(Date,DateFilterToInvoiceFilter);
IF TransSalesEntry.ISEMPTY THEN
CurrReport.SKIP;

TransSalesEntry.FINDSET;
NoOfRecs := TransSalesEntry.COUNT;
REPEAT
CurrRec += 1;
IF NoOfRecs <= 100 THEN
Window.UPDATE(3,(CurrRec / NoOfRecs * 10000)
DIV 1)
ELSE IF CurrRec MOD (NoOfRecs DIV 100) = 0 THEN
Window.UPDATE(3,(CurrRec / NoOfRecs * 10000)
DIV 1);

IF TransSalesEntry.Quantity > 0 THEN BEGIN


IF NOT
TempInventoryBuffer.GET(TransSalesEntry."Item No.",'',0,"Franchises Setup
Store"."Store No.",'',TransSalesEntry."Lot No.",TransSalesEntry."Serial No.") THEN
BEGIN // Abonaments
TempInventoryBuffer."Item No." :=
TransSalesEntry."Item No.";
TempInventoryBuffer."Variant Code" := '';
TempInventoryBuffer."Dimension Entry
No." := 0;
TempInventoryBuffer."Location Code" :=
"Franchises Setup Store"."Store No.";
TempInventoryBuffer."Bin Code" := '';
TempInventoryBuffer."Lot No." :=
TransSalesEntry."Lot No.";
TempInventoryBuffer."Serial No." :=
TransSalesEntry."Serial No.";
TempInventoryBuffer.Quantity :=
TransSalesEntry.Quantity;
TempInventoryBuffer.INSERT;
END ELSE BEGIN
TempInventoryBuffer.Quantity +=
TransSalesEntry.Quantity;
TempInventoryBuffer.MODIFY;
END;
END ELSE BEGIN
IF NOT
TempInventoryBuffer.GET(TransSalesEntry."Item No.",'',1,"Franchises Setup
Store"."Store No.",'',TransSalesEntry."Lot No.",TransSalesEntry."Serial No.") THEN
BEGIN // Factures
TempInventoryBuffer."Item No." :=
TransSalesEntry."Item No.";
TempInventoryBuffer."Variant Code" := '';
TempInventoryBuffer."Dimension Entry
No." := 1;
TempInventoryBuffer."Location Code" :=
"Franchises Setup Store"."Store No.";
TempInventoryBuffer."Bin Code" := '';
TempInventoryBuffer."Lot No." :=
TransSalesEntry."Lot No.";
TempInventoryBuffer."Serial No." :=
TransSalesEntry."Serial No.";
TempInventoryBuffer.Quantity :=
TransSalesEntry.Quantity;
TempInventoryBuffer.INSERT;
END ELSE BEGIN
TempInventoryBuffer.Quantity +=
TransSalesEntry.Quantity;
TempInventoryBuffer.MODIFY;
END;
END;
UNTIL TransSalesEntry.NEXT = 0;

// Crear factura
CurrRec := 0;
CLEAR(TempInventoryBuffer);
TempInventoryBuffer.SETRANGE("Dimension Entry
No.",1);
NoOfRecs := TempInventoryBuffer.COUNT;
IF TempInventoryBuffer.FINDSET THEN BEGIN
SalesHeader.INIT;
SalesHeader.SetHideValidationDialog(TRUE);
SalesHeader.SuspendStatusCheck(TRUE);
SalesHeader."Document Type" :=
SalesHeader."Document Type"::Invoice;
SalesHeader."No." := '';
SalesHeader.INSERT(TRUE);

SalesHeader.VALIDATE("Sell-to Customer No.",


"Franchises Setup Store"."Customer No.");
SalesHeader.CreateDim(
DATABASE::Customer,SalesHeader."Sell-to
Customer No.",

DATABASE::"Salesperson/Purchaser",SalesHeader."Salesperson Code",
DATABASE::Campaign,SalesHeader."Campaign
No.",
DATABASE::"Responsibility
Center",SalesHeader."Responsibility Center",
DATABASE::"Customer
Template",SalesHeader."Sell-to Customer Template Code");

SalesHeader.VALIDATE("Location
Code","Franchises Setup Store"."Invoice Location");
SalesHeader.VALIDATE("Posting Date", WORKDATE);
SalesHeader.MODIFY(TRUE);
TotalDocuments += 1;
LineNo := 0;
REPEAT
CurrRec += 1;
IF NoOfRecs <= 100 THEN
Window.UPDATE(4,(CurrRec / NoOfRecs *
10000) DIV 1)
ELSE IF CurrRec MOD (NoOfRecs DIV 100) = 0
THEN
Window.UPDATE(4,(CurrRec / NoOfRecs *
10000) DIV 1);

LineNo += 10000;
SalesLine.INIT;
SalesLine.SetHideValidationDialog(TRUE);
SalesLine.SuspendStatusCheck(TRUE);
SalesLine."Document No." :=
SalesHeader."No.";
SalesLine."Document Type" :=
SalesHeader."Document Type";
SalesLine."Line No." := LineNo;
SalesLine.INSERT(TRUE);
SalesLine.VALIDATE(Type,
SalesLine.Type::Item);
SalesLine.VALIDATE("No.",
TempInventoryBuffer."Item No.");
SalesLine.VALIDATE("Location Code",
"Franchises Setup Store"."Invoice Location");
SalesLine.VALIDATE(Quantity,
ABS(TempInventoryBuffer.Quantity));
SalesLine.MODIFY(TRUE);

AssignSerialLotToSalesInvoice(SalesLine,'1','');
UNTIL TempInventoryBuffer.NEXT = 0;
END;

// Crear abonament
CurrRec := 0;
CLEAR(TempInventoryBuffer);
TempInventoryBuffer.SETRANGE("Dimension Entry
No.",0);
NoOfRecs := TempInventoryBuffer.COUNT;
IF TempInventoryBuffer.FINDSET THEN BEGIN
SalesHeader.INIT;
SalesHeader.SetHideValidationDialog(TRUE);
SalesHeader.SuspendStatusCheck(TRUE);
SalesHeader."Document Type" :=
SalesHeader."Document Type"::"Credit Memo";
SalesHeader."No." := '';
SalesHeader.INSERT(TRUE);

SalesHeader.VALIDATE("Sell-to Customer No.",


"Franchises Setup Store"."Customer No.");

SalesHeader.CreateDim(
DATABASE::Customer,SalesHeader."Sell-to
Customer No.",

DATABASE::"Salesperson/Purchaser",SalesHeader."Salesperson Code",
DATABASE::Campaign,SalesHeader."Campaign
No.",
DATABASE::"Responsibility
Center",SalesHeader."Responsibility Center",
DATABASE::"Customer
Template",SalesHeader."Sell-to Customer Template Code");

SalesHeader.VALIDATE("Location
Code","Franchises Setup Store"."Invoice Location");
SalesHeader.VALIDATE("Posting Date", WORKDATE);
SalesHeader.MODIFY(TRUE);
TotalDocuments += 1;
LineNo := 0;
REPEAT
CurrRec += 1;
IF NoOfRecs <= 100 THEN
Window.UPDATE(5,(CurrRec / NoOfRecs *
10000) DIV 1)
ELSE IF CurrRec MOD (NoOfRecs DIV 100) = 0
THEN
Window.UPDATE(5,(CurrRec / NoOfRecs *
10000) DIV 1);

LineNo += 10000;
SalesLine.INIT;
SalesLine.SetHideValidationDialog(TRUE);
SalesLine.SuspendStatusCheck(TRUE);
SalesLine."Document No." :=
SalesHeader."No.";
SalesLine."Document Type" :=
SalesHeader."Document Type";
SalesLine."Line No." := LineNo;
SalesLine.INSERT(TRUE);
SalesLine.VALIDATE(Type,
SalesLine.Type::Item);
SalesLine.VALIDATE("No.",
TempInventoryBuffer."Item No.");
SalesLine.VALIDATE("Location Code",
"Franchises Setup Store"."Invoice Location");
SalesLine.VALIDATE(Quantity,
ABS(TempInventoryBuffer.Quantity));
SalesLine.MODIFY(TRUE);

AssignSerialLotToSalesInvoice(SalesLine,'1','');
UNTIL TempInventoryBuffer.NEXT = 0;
END;
END;

DataItemLink=Code=FIELD(Code) }

}
REQUESTPAGE
{
PROPERTIES
{
}
CONTROLS
{
{ 1100225002;0;Container;
ContainerType=ContentArea }

{ 1100225001;1;Group ;
CaptionML=[ENU=Options;
ESP=Opciones] }

{ 1100225000;2;Field ;
Name=FranchisesCode;
CaptionML=[ENU=Code;
ESP=C�digo];
ApplicationArea=#Basic,#Suite;
SourceExpr=FranchiseCodeFilter;
TableRelation="Franchises Setup" WHERE (Store
Type=FILTER(<>Castor),
Invoicing According to
Sales=CONST(Yes)) }

}
}
LABELS
{
}
CODE
{
VAR
FinishedInv@1000000000 : TextConst 'ENU=Invoicing Completed;ESP=Proceso
finalizado, creado %1 documentos';
NoFranchiseCodeSelectedQst@1100225000 : TextConst 'ESP=No ha seleccionado
ninguna franquicia, esto har� que se ejecute el proceso para todas';
ProcessCancelledByUserErr@1100225001 : TextConst 'ESP=Proceso cancelado por
el usuario';
DateFilterIsMandatoryErr@1100225002 : TextConst 'ESP=El filtro fecha para
facturar es obligatorio';
FranchiseCodeFilter@1100225004 : Text;
DateFilterToInvoiceFilter@1100225003 : Text;
TempFranchisesLogEntryTotals@1100225005 : TEMPORARY Record 50124;
EntryNo@1100225006 : Integer;
Window@1100225007 : Dialog;
TotalDocuments@1100225008 : Integer;

[LineStart(2977)]
LOCAL PROCEDURE AssignSerialLotToSalesInvoice@1000000010(SalesLine@1000000001 :
Record 37;LotNo@1000000000 : Code[20];SerialNo@1100225000 : Code[20]);
VAR
Item@1000000005 : Record 27;
ItemTrackingManagement@1000000004 : Codeunit 6500;
TempTrackingSpecification@1000000003 : TEMPORARY Record 336;
SourceSpecification@1000000002 : TEMPORARY Record 336;
ItemTrackingCode@1000000006 : Record 6502;
BEGIN
IF SalesLine.Type <> SalesLine.Type::Item THEN
EXIT;

IF (LotNo = '') AND (SerialNo = '') THEN


EXIT;

Item.GET(SalesLine."No.");
IF NOT ((Item."Item Tracking Code" <> '') AND
(ItemTrackingCode.GET(Item."Item Tracking Code")) AND ((ItemTrackingCode."Lot
Specific Tracking") OR (ItemTrackingCode."SN Specific Tracking"))) THEN
EXIT;

CLEAR(ItemTrackingManagement);
TempTrackingSpecification.RESET;
TempTrackingSpecification.DELETEALL;

SourceSpecification.INIT;
SourceSpecification.VALIDATE("Item No.",SalesLine."No.");
SourceSpecification.VALIDATE("Location Code",SalesLine."Location Code");
SourceSpecification.VALIDATE("Quantity (Base)",SalesLine."Quantity (Base)");
SourceSpecification.VALIDATE("Source Type",DATABASE::"Sales Line");
SourceSpecification.VALIDATE("Source Subtype",SalesLine."Document Type");
SourceSpecification.VALIDATE("Source ID",SalesLine."Document No.");
SourceSpecification.VALIDATE("Source Batch Name",'');
SourceSpecification.VALIDATE("Source Ref. No.",SalesLine."Line No.");
SourceSpecification.VALIDATE(Correction,FALSE);

TempTrackingSpecification.INIT;
TempTrackingSpecification."Entry No." := 1;
IF LotNo <> '' THEN
TempTrackingSpecification."Lot No." := LotNo;
IF SerialNo <> '' THEN
TempTrackingSpecification."Serial No." := SerialNo;
TempTrackingSpecification.VALIDATE("Quantity (Base)", SalesLine."Quantity
(Base)");
TempTrackingSpecification.INSERT(TRUE);

ItemTrackingManagement.SetGlobalParameters(SourceSpecification,TempTrackingSpecific
ation,0D);
ItemTrackingManagement.RUN;
END;

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
550 OS.OA. 22/09/2021. AN_CAST002_MRW. Franquicias CASTOR
}
END.
}
RDLDATA
{
}
}

OBJECT Report 50154 Send Franchise Interactions


{
OBJECT-PROPERTIES
{
Date=18/12/23;
Time=12:29:00;
Modified=Yes;
Version List=OS,431,532;
}
PROPERTIES
{
CaptionML=[ENU=Send Franchise Interactions;
ESP=Enviar interacciones franquicias];
ProcessingOnly=Yes;
UseRequestPage=No;
}
DATASET
{
{ 1100225000;;DataItem;Franchises Log Entry;
DataItemTable=Table50124;
DataItemTableView=SORTING(Entry No.,Operation,Action)
WHERE(Store Type=CONST(Franchise));
OnPreDataItem=VAR
FranchisesSetup@1100225000 : Record 50123;
FranchisesManagement@1100225002 : Codeunit 50069;
Item@1000000000 : Record 27;
Item2@1000000002 : Record 27;
i@1000000001 : Integer;
AGVItemExtension@1000000003 : Record 50144;
BEGIN
SETRANGE(Processed,FALSE);

// Esborrar el LOG
IF FranchisesSetup.FINDSET THEN
REPEAT
//<532
// AGV-000 ==>
AGVItemExtension.SETCURRENTKEY("AGV Visible on
Item Franchise");
AGVItemExtension.SETRANGE("AGV Visible on Item
Franchise", TRUE);
IF NOT AGVItemExtension.ISEMPTY THEN BEGIN
IF AGVItemExtension.FINDSET THEN BEGIN
REPEAT
//
Item.GET(AGVItemExtension."AGV Item No.");
//

FranchisesManagement.ItemLogEntry(Item,'');
UNTIL AGVItemExtension.NEXT = 0;
END;
END;
// Mirar si hi ha productes que es necessita
reenviar a les franqu�cies
// Item.SETCURRENTKEY("Send Item Info To
Franchise");
// Item.SETRANGE("Send Item Info To
Franchise",TRUE);
// IF Item.FINDSET THEN BEGIN
// REPEAT
//
FranchisesManagement.ItemLogEntry(Item,'');
// i += 1;
// COMMIT;
// UNTIL (Item.NEXT = 0) OR (i = 200);
// END;
// AGV-000 <==
//532>

// Per eliminar LOG


IF FranchisesSetup."Days To Delete Log" > 0 THEN
BEGIN
CLEAR(FranchisesLogEntry);
FranchisesLogEntry.SETRANGE("Franchise
Code",FranchisesSetup.Code);
FranchisesLogEntry.SETFILTER("Operation
Date",'%1..%2', 010100D, WORKDATE - FranchisesSetup."Days To Delete Log");
IF NOT FranchisesLogEntry.ISEMPTY THEN;
FranchisesLogEntry.DELETEALL;
END;

//Per crear registre de LOG d'enviar estoc


IF FranchisesSetup."Enable Export Stock" THEN
IF FranchisesSetup."Send Stock In Days" > 0
THEN
IF FranchisesSetup."Last Stock Sent" = 0D
THEN

FranchisesManagement.CreateExportStockToLog(FranchisesSetup.Code)
ELSE BEGIN
IF (FranchisesSetup."Last Stock Sent" +
FranchisesSetup."Send Stock In Days") < WORKDATE THEN

FranchisesManagement.CreateExportStockToLog(FranchisesSetup.Code);
END;
UNTIL FranchisesSetup.NEXT = 0;
END;

OnAfterGetRecord=VAR
RecRef@1100225000 : RecordRef;
RecId@1100225003 : RecordID;
FieldRef@1100225004 : FieldRef;
Item@1100225001 : Record 27;
PostedWhseShipmentHeader@1100225002 : Record
7322;
TransactionHeader@1100225005 : Record 99001472;
TransSalesEntry@1100225006 : Record 99001473;
ItemLedgEntry@1100225007 : Record 32;
BEGIN
COMMIT;
CLEARLASTERROR;
CASE "Franchises Log Entry"."Store Type" OF
"Franchises Log Entry"."Store Type"::Franchise:
BEGIN
IF NOT FranchisesSendingMgn.RUN("Franchises
Log Entry") THEN BEGIN
FranchisesLogEntry.GET("Entry
No.",Operation,Action);
IF COPYSTR(GETLASTERRORTEXT,1,250) <>
'CHECKED_ERROR' THEN BEGIN
FranchisesLogEntry.Error := TRUE;
FranchisesLogEntry.Description :=
COPYSTR(GETLASTERRORTEXT,1,250);
FranchisesLogEntry.MODIFY;
END;

//Esborrar transacci� si ha donat error


IF FranchisesLogEntry.Operation =
FranchisesLogEntry.Operation::Sale THEN BEGIN
IF FranchisesLogEntry."Source
Operation" <> '' THEN BEGIN
CLEAR(ItemLedgEntry);
ItemLedgEntry.SETCURRENTKEY("Document
No.","Document Type","Document Line No.");
ItemLedgEntry.SETRANGE("Document
No.", FranchisesLogEntry."Source Operation");
IF ItemLedgEntry.ISEMPTY THEN BEGIN
CLEAR(TransactionHeader);

TransactionHeader.SETCURRENTKEY("Store No.","Wrong Shift","POS Terminal


No.","Receipt No.");
TransactionHeader.SETRANGE("Store
No.",FranchisesLogEntry."Store No.");
TransactionHeader.SETRANGE("Receipt
No.",FranchisesLogEntry."Source Operation");
IF TransactionHeader.FINDFIRST THEN
TransactionHeader.DELETE(TRUE);

CLEAR(TransSalesEntry);

TransSalesEntry.SETCURRENTKEY("Store No.","Receipt No.");


TransSalesEntry.SETRANGE("Store
No.",FranchisesLogEntry."Store No.");
TransSalesEntry.SETRANGE("Receipt
No.",FranchisesLogEntry."Source Operation");
IF TransSalesEntry.FINDSET THEN
REPEAT
TransSalesEntry.DELETE(TRUE);
UNTIL TransSalesEntry.NEXT = 0;
END ELSE BEGIN
"Franchises Log Entry".Error :=
FALSE;
"Franchises Log
Entry".Description := '';
"Franchises Log Entry".Processed :=
TRUE;
"Franchises Log Entry"."Processed
Date" := WORKDATE;
"Franchises Log Entry"."Processed
Time" := TIME;
"Franchises Log Entry".MODIFY;
END;
END;
END;
END ELSE BEGIN
"Franchises Log Entry".Error := FALSE;
"Franchises Log Entry".Description := '';
"Franchises Log Entry".Processed := TRUE;
"Franchises Log Entry"."Processed
Date" := WORKDATE;
"Franchises Log Entry"."Processed
Time" := TIME;
"Franchises Log Entry".MODIFY;
END;
END;
END;
END;
}

}
REQUESTPAGE
{
PROPERTIES
{
}
CONTROLS
{
}
}
LABELS
{
}
CODE
{
VAR
FranchisesLogEntry@1100225002 : Record 50124;
FranchisesSendingMgn@1100225000 : Codeunit 50069;
CASTORManagement@1100225001 : Codeunit 50090;

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
532 OS.XT. 15/06/2021. MRW_SP20210615_XT. Poder enviar descripcions de
Magento juntament amb la informaci� de producte a franqu�cies.
}
END.
}
RDLDATA
{
}
}

OBJECT Codeunit 6500 Item Tracking Management


{
OBJECT-PROPERTIES
{
Date=29/03/21;
Time=18:22:38;
Modified=Yes;
Version List=NAVW114.01,AITANASTD1.08,OS,431;
}
PROPERTIES
{
Permissions=TableData 6507=rd,
TableData 6508=rd,
TableData 6550=rimd;
OnRun=VAR
ItemTrackingLines@1000 : Page 6510;
BEGIN
ItemTrackingLines.SetReclass(GlobalIsReclass); //<431
SourceSpecification.TESTFIELD("Source Type");
ItemTrackingLines.RegisterItemTrackingLines(
SourceSpecification,DueDate,TempTrackingSpecification)
END;

}
CODE
{
VAR
Text003@1002 : TextConst 'ENU=No information exists for %1 %2.;ESP=No existe
informaci�n para %1 %2.';
Text005@1004 : TextConst 'ENU=Warehouse item tracking is not enabled for %1
%2.;ESP=No est� habilitado el seguimiento pdto. almac�n para %1 %2.';
SourceSpecification@1005 : TEMPORARY Record 336;
TempTrackingSpecification@1006 : TEMPORARY Record 336;
TempGlobalWhseItemTrkgLine@1014 : TEMPORARY Record 6550;
UOMMgt@1100225003 : Codeunit 5402;
DueDate@1007 : Date;
Text006@1008 : TextConst 'ENU=Synchronization cancelled.;ESP=Sincronizaci�n
cancelada.';
Registering@1009 : Boolean;
Text007@1001 : TextConst 'ENU=There are multiple expiration dates registered
for lot %1.;ESP=Existen varias fechas de caducidad registradas para el lote %1.';
text008@1010 : TextConst 'ENU=%1 already exists for %2 %3. Do you want to
overwrite the existing information?;ESP=%1 ya existe para %2 %3. �Desea
sobrescribir la informaci�n existente?';
IsConsume@1012 : Boolean;
Text011@1018 : TextConst 'ENU=%1 must not be %2.;ESP=%1 no debe ser %2.';
Text012@1016 : TextConst 'ENU=Only one expiration date is allowed per lot
number.\%1 currently has two different expiration dates: %2 and %3.;ESP=S�lo se
permite una fecha de caducidad por n�mero de lote.\%1 tiene dos fechas de caducidad
diferentes: %2 y %3.';
IsPick@1017 : Boolean;
DeleteReservationEntries@1021 : Boolean;
CannotMatchItemTrackingErr@1003 : TextConst 'ENU=Cannot match item
tracking.;ESP=No coincide seguimiento producto.';
QtyToInvoiceDoesNotMatchItemTrackingErr@1022 : TextConst 'ENU=The quantity to
invoice does not match the quantity defined in item tracking.;ESP=La cantidad que
hay que facturar no coincide con la cantidad definida en el seguimiento del
producto.';
RetrieveAsmItemTracking@1100225000 : Boolean;
Text004@1100225001 : TextConst 'ENU=Counting records...;ESP=Contando
registros...';
Text009@1100225002 : TextConst 'ENU=Table %1 is not supported.;ESP=No se
admite la tabla %1.';
GlobalIsReclass@1000000000 : Boolean;

[External]
[LineStart(3021)]
PROCEDURE SetPointerFilter@21(VAR TrackingSpecification@1000 : Record 336);
BEGIN
WITH TrackingSpecification DO BEGIN
SetSourceFilter("Source Type","Source Subtype","Source ID","Source Ref.
No.",TRUE);
SetSourceFilter2("Source Batch Name","Source Prod. Order Line");
END;
END;

[External]
[LineStart(3027)]
PROCEDURE LookupLotSerialNoInfo@23(ItemNo@1002 : Code[20];Variant@1003 :
Code[20];LookupType@1004 : 'Serial No.,Lot No.';LookupNo@1005 : Code[50]);
VAR
LotNoInfo@1000 : Record 6505;
SerialNoInfo@1001 : Record 6504;
BEGIN
CASE LookupType OF
LookupType::"Serial No.":
BEGIN
IF NOT SerialNoInfo.GET(ItemNo,Variant,LookupNo) THEN
ERROR(Text003,SerialNoInfo.FIELDCAPTION("Serial No."),LookupNo);
PAGE.RUNMODAL(0,SerialNoInfo);
END;
LookupType::"Lot No.":
BEGIN
IF NOT LotNoInfo.GET(ItemNo,Variant,LookupNo) THEN
ERROR(Text003,LotNoInfo.FIELDCAPTION("Lot No."),LookupNo);
PAGE.RUNMODAL(0,LotNoInfo);
END;
END;
END;

[External]
[LineStart(3043)]
PROCEDURE CreateTrackingSpecification@5(VAR FromReservEntry@1000 : Record
337;VAR ToTrackingSpecification@1001 : Record 336);
BEGIN
ToTrackingSpecification.INIT;
ToTrackingSpecification.TRANSFERFIELDS(FromReservEntry);
ToTrackingSpecification."Qty. to Handle (Base)" := 0;
ToTrackingSpecification."Qty. to Invoice (Base)" := 0;
ToTrackingSpecification."Quantity Handled (Base)" := FromReservEntry."Qty. to
Handle (Base)";
ToTrackingSpecification."Quantity Invoiced (Base)" := FromReservEntry."Qty.
to Invoice (Base)";
END;

[External]
[LineStart(3051)]
PROCEDURE GetItemTrackingSettings@4(VAR ItemTrackingCode@1000 : Record
6502;EntryType@1001 : 'Purchase,Sale,Positive Adjmt.,Negative
Adjmt.,Transfer,Consumption,Output, ,Assembly Consumption,Assembly
Output';Inbound@1002 : Boolean;VAR SNRequired@1003 : Boolean;VAR LotRequired@1004 :
Boolean;VAR SNInfoRequired@1006 : Boolean;VAR LotInfoRequired@1005 : Boolean);
BEGIN
SNRequired := FALSE;
LotRequired := FALSE;
SNInfoRequired := FALSE;
LotInfoRequired := FALSE;

IF ItemTrackingCode.Code = '' THEN BEGIN


CLEAR(ItemTrackingCode);
EXIT;
END;
ItemTrackingCode.GET(ItemTrackingCode.Code);

IF EntryType = EntryType::Transfer THEN BEGIN


LotInfoRequired := ItemTrackingCode."Lot Info. Outbound Must Exist" OR
ItemTrackingCode."Lot Info. Inbound Must Exist";
SNInfoRequired := ItemTrackingCode."SN Info. Outbound Must Exist" OR
ItemTrackingCode."SN Info. Inbound Must Exist";
END ELSE BEGIN
SNInfoRequired := (Inbound AND ItemTrackingCode."SN Info. Inbound Must
Exist") OR
(NOT Inbound AND ItemTrackingCode."SN Info. Outbound Must Exist");

LotInfoRequired := (Inbound AND ItemTrackingCode."Lot Info. Inbound Must


Exist") OR
(NOT Inbound AND ItemTrackingCode."Lot Info. Outbound Must Exist");
END;

IF ItemTrackingCode."SN Specific Tracking" THEN BEGIN


SNRequired := TRUE;
END ELSE
CASE EntryType OF
EntryType::Purchase:
IF Inbound THEN
SNRequired := ItemTrackingCode."SN Purchase Inbound Tracking"
ELSE
SNRequired := ItemTrackingCode."SN Purchase Outbound Tracking";
EntryType::Sale:
IF Inbound THEN
SNRequired := ItemTrackingCode."SN Sales Inbound Tracking"
ELSE
SNRequired := ItemTrackingCode."SN Sales Outbound Tracking";
EntryType::"Positive Adjmt.":
IF Inbound THEN
SNRequired := ItemTrackingCode."SN Pos. Adjmt. Inb. Tracking"
ELSE
SNRequired := ItemTrackingCode."SN Pos. Adjmt. Outb. Tracking";
EntryType::"Negative Adjmt.":
IF Inbound THEN
SNRequired := ItemTrackingCode."SN Neg. Adjmt. Inb. Tracking"
ELSE
SNRequired := ItemTrackingCode."SN Neg. Adjmt. Outb. Tracking";
EntryType::Transfer:
SNRequired := ItemTrackingCode."SN Transfer Tracking";
EntryType::Consumption,EntryType::Output:
IF Inbound THEN
SNRequired := ItemTrackingCode."SN Manuf. Inbound Tracking"
ELSE
SNRequired := ItemTrackingCode."SN Manuf. Outbound Tracking";
EntryType::"Assembly Consumption",EntryType::"Assembly Output":
IF Inbound THEN
SNRequired := ItemTrackingCode."SN Assembly Inbound Tracking"
ELSE
SNRequired := ItemTrackingCode."SN Assembly Outbound Tracking";
END;

IF ItemTrackingCode."Lot Specific Tracking" THEN BEGIN


LotRequired := TRUE;
END ELSE
CASE EntryType OF
EntryType::Purchase:
IF Inbound THEN
LotRequired := ItemTrackingCode."Lot Purchase Inbound Tracking"
ELSE
LotRequired := ItemTrackingCode."Lot Purchase Outbound Tracking";
EntryType::Sale:
IF Inbound THEN
LotRequired := ItemTrackingCode."Lot Sales Inbound Tracking"
ELSE
LotRequired := ItemTrackingCode."Lot Sales Outbound Tracking";
EntryType::"Positive Adjmt.":
IF Inbound THEN
LotRequired := ItemTrackingCode."Lot Pos. Adjmt. Inb. Tracking"
ELSE
LotRequired := ItemTrackingCode."Lot Pos. Adjmt. Outb. Tracking";
EntryType::"Negative Adjmt.":
IF Inbound THEN
LotRequired := ItemTrackingCode."Lot Neg. Adjmt. Inb. Tracking"
ELSE
LotRequired := ItemTrackingCode."Lot Neg. Adjmt. Outb. Tracking";
EntryType::Transfer:
LotRequired := ItemTrackingCode."Lot Transfer Tracking";
EntryType::Consumption,EntryType::Output:
IF Inbound THEN
LotRequired := ItemTrackingCode."Lot Manuf. Inbound Tracking"
ELSE
LotRequired := ItemTrackingCode."Lot Manuf. Outbound Tracking";
EntryType::"Assembly Consumption",EntryType::"Assembly Output":
IF Inbound THEN
LotRequired := ItemTrackingCode."Lot Assembly Inbound Tracking"
ELSE
LotRequired := ItemTrackingCode."Lot Assembly Outbound Tracking";
END;
END;

[External]
[LineStart(3150)]
PROCEDURE RetrieveInvoiceSpecification@35(SourceSpecification@1002 : Record
336;VAR TempInvoicingSpecification@1008 : TEMPORARY Record 336) OK@1003 : Boolean;
VAR
TrackingSpecification@1000 : Record 336;
ReservEntry@1001 : Record 337;
TempTrackingSpecSummedUp@1006 : TEMPORARY Record 336;
BEGIN
OK := FALSE;
TempInvoicingSpecification.RESET;
TempInvoicingSpecification.DELETEALL;

ReservEntry.SetSourceFilter(
SourceSpecification."Source Type",SourceSpecification."Source
Subtype",SourceSpecification."Source ID",
SourceSpecification."Source Ref. No.",TRUE);
ReservEntry.SetSourceFilter2(SourceSpecification."Source Batch
Name",SourceSpecification."Source Prod. Order Line");
ReservEntry.SETFILTER("Reservation Status",'<>%1',ReservEntry."Reservation
Status"::Prospect);
ReservEntry.SETFILTER("Item Tracking",'<>%1',ReservEntry."Item
Tracking"::None);
SumUpItemTracking(ReservEntry,TempTrackingSpecSummedUp,FALSE,TRUE);

// TrackingSpecification contains information about lines that should be


invoiced:
TrackingSpecification.SetSourceFilter(
SourceSpecification."Source Type",SourceSpecification."Source
Subtype",SourceSpecification."Source ID",
SourceSpecification."Source Ref. No.",TRUE);
TrackingSpecification.SetSourceFilter2(
SourceSpecification."Source Batch Name",SourceSpecification."Source Prod.
Order Line");
IF TrackingSpecification.FINDSET THEN
REPEAT
TrackingSpecification.TESTFIELD("Qty. to Handle (Base)",0);
TrackingSpecification.TESTFIELD("Qty. to Handle",0);
IF NOT TrackingSpecification.Correction THEN BEGIN
TempInvoicingSpecification := TrackingSpecification;
TempInvoicingSpecification."Qty. to Invoice" :=
ROUND(TempInvoicingSpecification."Qty. to Invoice (Base)" /
SourceSpecification."Qty. per Unit of
Measure",UOMMgt.QtyRndPrecision);
TempInvoicingSpecification.INSERT;
OK := TRUE;

TempTrackingSpecSummedUp.SetTrackingFilter(
TempInvoicingSpecification."Serial
No.",TempInvoicingSpecification."Lot No.");
IF TempTrackingSpecSummedUp.FINDFIRST THEN BEGIN
TempTrackingSpecSummedUp."Qty. to Invoice (Base)" +=
TempInvoicingSpecification."Qty. to Invoice (Base)";
TempTrackingSpecSummedUp.MODIFY;
END ELSE BEGIN
TempTrackingSpecSummedUp := TempInvoicingSpecification;
TempTrackingSpecSummedUp.INSERT;
END;
END;
UNTIL TrackingSpecification.NEXT = 0;

IF NOT IsConsume AND (SourceSpecification."Qty. to Invoice (Base)" <> 0) THEN


CheckQtyToInvoiceMatchItemTracking(
TempTrackingSpecSummedUp,TempInvoicingSpecification,
SourceSpecification."Qty. to Invoice (Base)",SourceSpecification."Qty.
per Unit of Measure");
TempInvoicingSpecification.SETFILTER("Qty. to Invoice (Base)",'<>0');
IF NOT TempInvoicingSpecification.FINDFIRST THEN
TempInvoicingSpecification.INIT;
END;

[External]
[LineStart(3202)]
PROCEDURE RetrieveInvoiceSpecWithService@75(SourceSpecification@1002 : Record
336;VAR TempInvoicingSpecification@1008 : TEMPORARY Record 336;Consume@1001 :
Boolean) OK@1003 : Boolean;
BEGIN
IsConsume := Consume;
OK :=
RetrieveInvoiceSpecification(SourceSpecification,TempInvoicingSpecification);
END;

[External]
[LineStart(3206)]
PROCEDURE RetrieveItemTracking@9(ItemJnlLine@1002 : Record 83;VAR
TempHandlingSpecification@1007 : TEMPORARY Record 336) : Boolean;
VAR
ReservEntry@1001 : Record 337;
BEGIN

EXIT(RetrieveItemTrackingFromReservEntry(ItemJnlLine,ReservEntry,TempHandlingSpecif
ication));
END;

[External]
[LineStart(3209)]
PROCEDURE RetrieveItemTrackingFromReservEntry@11(ItemJnlLine@1001 : Record
83;VAR ReservEntry@1002 : Record 337;VAR TempTrackingSpec@1000 : TEMPORARY Record
336) : Boolean;
BEGIN
IF ItemJnlLine.Subcontracting THEN
EXIT(RetrieveSubcontrItemTracking(ItemJnlLine,TempTrackingSpec));

ReservEntry.SetSourceFilter(
DATABASE::"Item Journal Line",ItemJnlLine."Entry Type",ItemJnlLine."Journal
Template Name",ItemJnlLine."Line No.",TRUE);
ReservEntry.SetSourceFilter2(ItemJnlLine."Journal Batch Name",0);
OnAfterReserveEntryFilter(ItemJnlLine,ReservEntry);
ReservEntry.SETFILTER("Qty. to Handle (Base)",'<>0');
OnRetrieveItemTrackingFromReservEntryFilter(ReservEntry,ItemJnlLine);
IF SumUpItemTracking(ReservEntry,TempTrackingSpec,FALSE,TRUE) THEN BEGIN
ReservEntry.SETRANGE("Reservation Status",ReservEntry."Reservation
Status"::Prospect);
IF NOT ReservEntry.ISEMPTY THEN
ReservEntry.DELETEALL;
EXIT(TRUE);
END;
EXIT(FALSE);
END;

[LineStart(3227)]
LOCAL PROCEDURE RetrieveSubcontrItemTracking@46(ItemJnlLine@1002 : Record
83;VAR TempHandlingSpecification@1007 : TEMPORARY Record 336) : Boolean;
VAR
ReservEntry@1100225002 : Record 337;
ProdOrderRoutingLine@1100225001 : Record 5409;
IsLastOperation@1100225000 : Boolean;
BEGIN
IF NOT ItemJnlLine.Subcontracting THEN
EXIT(FALSE);

IF ItemJnlLine."Operation No." = '' THEN


EXIT(FALSE);

ItemJnlLine.TESTFIELD("Routing No.");
ItemJnlLine.TESTFIELD("Order Type",ItemJnlLine."Order Type"::Production);
IF NOT ProdOrderRoutingLine.GET(
ProdOrderRoutingLine.Status::Released,ItemJnlLine."Order No.",
ItemJnlLine."Routing Reference No.",ItemJnlLine."Routing
No.",ItemJnlLine."Operation No.")
THEN
EXIT(FALSE);

IsLastOperation := ProdOrderRoutingLine."Next Operation No." = '';

OnRetrieveSubcontrItemTrackingOnBeforeCheckLastOperation(ProdOrderRoutingLine,IsLas
tOperation);
IF NOT IsLastOperation THEN
EXIT(FALSE);

ReservEntry.SetSourceFilter(DATABASE::"Prod. Order Line",3,ItemJnlLine."Order


No.",0,TRUE);
ReservEntry.SetSourceFilter2('',ItemJnlLine."Order Line No.");
ReservEntry.SETFILTER("Qty. to Handle (Base)",'<>0');
IF SumUpItemTracking(ReservEntry,TempHandlingSpecification,FALSE,TRUE) THEN
BEGIN
ReservEntry.SETRANGE("Reservation Status",ReservEntry."Reservation
Status"::Prospect);
IF NOT ReservEntry.ISEMPTY THEN
ReservEntry.DELETEALL;
EXIT(TRUE);
END;
EXIT(FALSE);
END;

[LineStart(3258)]
PROCEDURE RetrieveDocumentItemTracking@1100225006(VAR TrackingSpecBuffer@1003 :
TEMPORARY Record 336;SourceID@1000 : Code[20];SourceType@1001 :
Integer;SourceSubType@1002 : Option) : Integer;
BEGIN
// retrieves Item Tracking for Purchase Header, Sales Header, Sales Shipment
Header, Sales Invoice Header

TrackingSpecBuffer.DELETEALL;

CASE SourceType OF
DATABASE::"Purchase Header":
RDITPurchase(TrackingSpecBuffer,SourceID,SourceSubType);
DATABASE::"Sales Header":
RDITSales(TrackingSpecBuffer,SourceID,SourceSubType);
DATABASE::"Service Header":
RDITService(TrackingSpecBuffer,SourceID,SourceSubType);
DATABASE::"Sales Shipment Header":
RDITSalesShipment(TrackingSpecBuffer,SourceID);
DATABASE::"Sales Invoice Header":
RDITSalesInvoice(TrackingSpecBuffer,SourceID);
DATABASE::"Service Shipment Header":
RDITServiceShipment(TrackingSpecBuffer,SourceID);
DATABASE::"Service Invoice Header":
RDITServiceInvoice(TrackingSpecBuffer,SourceID);
ELSE
ERROR(Text009,SourceType);
END;

TrackingSpecBuffer.RESET;
EXIT(TrackingSpecBuffer.COUNT);
END;

[External]
[LineStart(3285)]
PROCEDURE RetrieveConsumpItemTracking@13(ItemJnlLine@1002 : Record 83;VAR
TempHandlingSpecification@1007 : TEMPORARY Record 336) : Boolean;
VAR
ReservEntry@1001 : Record 337;
BEGIN
ItemJnlLine.TESTFIELD("Order Type",ItemJnlLine."Order Type"::Production);
ReservEntry.SetSourceFilter(
DATABASE::"Prod. Order Component",3,ItemJnlLine."Order
No.",ItemJnlLine."Prod. Order Comp. Line No.",TRUE);
ReservEntry.SetSourceFilter2('',ItemJnlLine."Order Line No.");
ReservEntry.SETFILTER("Qty. to Handle (Base)",'<>0');
ReservEntry.SetTrackingFilterFromItemJnlLine(ItemJnlLine);

// Sum up in a temporary table per component line:


EXIT(SumUpItemTracking(ReservEntry,TempHandlingSpecification,TRUE,TRUE));
END;

[External]
[LineStart(3296)]
PROCEDURE SumUpItemTracking@15(VAR ReservEntry@1000 : Record 337;VAR
TempHandlingSpecification@1007 : TEMPORARY Record 336;SumPerLine@1006 :
Boolean;SumPerLotSN@1008 : Boolean) : Boolean;
VAR
NextEntryNo@1004 : Integer;
ExpDate@1210 : Date;
EntriesExist@1211 : Boolean;
BEGIN
// Sum up Item Tracking in a temporary table (to defragment the ReservEntry
records)
TempHandlingSpecification.RESET;
TempHandlingSpecification.DELETEALL;
IF SumPerLotSN THEN
TempHandlingSpecification.SETCURRENTKEY("Lot No.","Serial No.");

IF ReservEntry.FINDSET THEN
REPEAT
IF ReservEntry.TrackingExists THEN BEGIN
IF SumPerLine THEN
TempHandlingSpecification.SETRANGE("Source Ref.
No.",ReservEntry."Source Ref. No."); // Sum up line per line
IF SumPerLotSN THEN BEGIN

TempHandlingSpecification.SetTrackingFilterFromReservEntry(ReservEntry);
IF ReservEntry."New Serial No." <> '' THEN
TempHandlingSpecification.SETRANGE("New Serial
No.",ReservEntry."New Serial No." );
IF ReservEntry."New Lot No." <> '' THEN
TempHandlingSpecification.SETRANGE("New Lot No.",ReservEntry."New
Lot No.");
END;

OnBeforeFindTempHandlingSpecification(TempHandlingSpecification,ReservEntry);
IF TempHandlingSpecification.FINDFIRST THEN BEGIN
TempHandlingSpecification."Quantity (Base)" += ReservEntry."Quantity
(Base)";
TempHandlingSpecification."Qty. to Handle (Base)" +=
ReservEntry."Qty. to Handle (Base)";
TempHandlingSpecification."Qty. to Invoice (Base)" +=
ReservEntry."Qty. to Invoice (Base)";
TempHandlingSpecification."Quantity Invoiced (Base)" +=
ReservEntry."Quantity Invoiced (Base)";
TempHandlingSpecification."Qty. to Handle" :=
TempHandlingSpecification."Qty. to Handle (Base)" /
ReservEntry."Qty. per Unit of Measure";
TempHandlingSpecification."Qty. to Invoice" :=
TempHandlingSpecification."Qty. to Invoice (Base)" /
ReservEntry."Qty. per Unit of Measure";
IF ReservEntry."Reservation Status" > ReservEntry."Reservation
Status"::Tracking THEN
TempHandlingSpecification."Buffer Value1" += // Late Binding
TempHandlingSpecification."Qty. to Handle (Base)";
TempHandlingSpecification.MODIFY;
END ELSE BEGIN
TempHandlingSpecification.INIT;
TempHandlingSpecification.TRANSFERFIELDS(ReservEntry);
NextEntryNo += 1;
TempHandlingSpecification."Entry No." := NextEntryNo;
TempHandlingSpecification."Qty. to Handle" :=
TempHandlingSpecification."Qty. to Handle (Base)" /
ReservEntry."Qty. per Unit of Measure";
TempHandlingSpecification."Qty. to Invoice" :=
TempHandlingSpecification."Qty. to Invoice (Base)" /
ReservEntry."Qty. per Unit of Measure";
IF ReservEntry."Reservation Status" > ReservEntry."Reservation
Status"::Tracking THEN
TempHandlingSpecification."Buffer Value1" += // Late Binding
TempHandlingSpecification."Qty. to Handle (Base)";
ExpDate :=
ExistingExpirationDate(
ReservEntry."Item No.",ReservEntry."Variant
Code",ReservEntry."Lot No.",ReservEntry."Serial No.",FALSE,EntriesExist);
IF EntriesExist THEN
TempHandlingSpecification."Expiration Date" := ExpDate;
TempHandlingSpecification.INSERT;
END;
END;
UNTIL ReservEntry.NEXT = 0;

TempHandlingSpecification.RESET;
EXIT(TempHandlingSpecification.FINDFIRST);
END;
[External]
[LineStart(3358)]
PROCEDURE SumUpItemTrackingOnlyInventoryOrATO@112(VAR ReservationEntry@1004 :
Record 337;VAR TrackingSpecification@1003 : Record 336;SumPerLine@1002 :
Boolean;SumPerLotSN@1001 : Boolean) : Boolean;
VAR
TempReservationEntry@1000 : TEMPORARY Record 337;
BEGIN
IF ReservationEntry.FINDSET THEN
REPEAT
IF (ReservationEntry."Reservation Status" <>
ReservationEntry."Reservation Status"::Reservation) OR
IsResEntryReservedAgainstInventory(ReservationEntry)
THEN BEGIN
TempReservationEntry := ReservationEntry;
TempReservationEntry.INSERT;
END;
UNTIL ReservationEntry.NEXT = 0;

EXIT(SumUpItemTracking(TempReservationEntry,TrackingSpecification,SumPerLine,SumPer
LotSN));
END;

[LineStart(3371)]
LOCAL PROCEDURE IsResEntryReservedAgainstInventory@106(ReservationEntry@1000 :
Record 337) : Boolean;
VAR
ReservationEntry2@1001 : Record 337;
BEGIN
IF (ReservationEntry."Reservation Status" <> ReservationEntry."Reservation
Status"::Reservation) OR
ReservationEntry.Positive
THEN
EXIT(FALSE);

ReservationEntry2.GET(ReservationEntry."Entry No.",NOT
ReservationEntry.Positive);
IF ReservationEntry2."Source Type" = DATABASE::"Item Ledger Entry" THEN
EXIT(TRUE);

EXIT(IsResEntryReservedAgainstATO(ReservationEntry));
END;

[LineStart(3383)]
LOCAL PROCEDURE IsResEntryReservedAgainstATO@108(ReservationEntry@1000 : Record
337) : Boolean;
VAR
ReservationEntry2@1001 : Record 337;
SalesLine@1003 : Record 37;
AssembleToOrderLink@1002 : Record 904;
BEGIN
IF (ReservationEntry."Source Type" <> DATABASE::"Sales Line") OR
(ReservationEntry."Source Subtype" <> SalesLine."Document Type"::Order) OR
(NOT SalesLine.GET(ReservationEntry."Source
Subtype",ReservationEntry."Source ID",ReservationEntry."Source Ref. No.")) OR
(NOT AssembleToOrderLink.AsmExistsForSalesLine(SalesLine))
THEN
EXIT(FALSE);
ReservationEntry2.GET(ReservationEntry."Entry No.",NOT
ReservationEntry.Positive);
IF (ReservationEntry2."Source Type" <> DATABASE::"Assembly Header") OR
(ReservationEntry2."Source Subtype" <> AssembleToOrderLink."Assembly
Document Type") OR
(ReservationEntry2."Source ID" <> AssembleToOrderLink."Assembly Document
No.")
THEN
EXIT(FALSE);

EXIT(TRUE);
END;

[External]
[LineStart(3400)]
PROCEDURE DecomposeRowID@8(IDtext@1000 : Text[250];VAR StrArray@1009 : ARRAY
[6] OF Text[100]);
VAR
Len@1005 : Integer;
Pos@1002 : Integer;
ArrayIndex@1007 : Integer;
Count@1004 : Integer;
Char@1003 : Text[1];
NoWriteSinceLastNext@1010 : Boolean;
Write@1006 : Boolean;
Next@1001 : Boolean;
BEGIN
FOR ArrayIndex := 1 TO 6 DO
StrArray[ArrayIndex] := '';
Len := STRLEN(IDtext);
Pos := 1;
ArrayIndex := 1;

WHILE NOT (Pos > Len) DO BEGIN


Char := COPYSTR(IDtext,Pos,1);
IF Char = '"' THEN BEGIN
Write := FALSE;
Count += 1;
END ELSE BEGIN
IF Count = 0 THEN
Write := TRUE
ELSE BEGIN
IF Count MOD 2 = 1 THEN BEGIN
Next := (Char = ';');
Count -= 1;
END ELSE
IF NoWriteSinceLastNext AND (Char = ';') THEN BEGIN
Count -= 2;
Next := TRUE;
END;
Count /= 2;
WHILE Count > 0 DO BEGIN
StrArray[ArrayIndex] += '"';
Count -= 1;
END;
Write := NOT Next;
END;
NoWriteSinceLastNext := Next;
END;

IF Next THEN BEGIN


ArrayIndex += 1;
Next := FALSE
END;

IF Write THEN
StrArray[ArrayIndex] += Char;
Pos += 1;
END;
END;

[External]
[LineStart(3444)]
PROCEDURE ComposeRowID@2(Type@1005 : Integer;Subtype@1004 : Integer;ID@1003 :
Code[20];BatchName@1002 : Code[10];ProdOrderLine@1001 : Integer;RefNo@1000 :
Integer) : Text[250];
VAR
StrArray@1006 : ARRAY [2] OF Text[100];
Pos@1010 : Integer;
Len@1011 : Integer;
T@1009 : Integer;
BEGIN
StrArray[1] := ID;
StrArray[2] := BatchName;
FOR T := 1 TO 2 DO
IF STRPOS(StrArray[T],'"') > 0 THEN BEGIN
Len := STRLEN(StrArray[T]);
Pos := 1;
REPEAT
IF COPYSTR(StrArray[T],Pos,1) = '"' THEN BEGIN
StrArray[T] := INSSTR(StrArray[T],'"',Pos + 1);
Len += 1;
Pos += 1;
END;
Pos += 1;
UNTIL Pos > Len;
END;

EXIT(STRSUBSTNO('"%1";"%2";"%3";"%4";"%5";"%6"',Type,Subtype,StrArray[1],StrArray[2
],ProdOrderLine,RefNo));
END;

[LineStart(3462)]
PROCEDURE CallItemTrackingEntryForm@1100225005(SourceType@1001 :
' ,Customer,Vendor,Item';SourceNo@1002 : Code[20];ItemNo@1005 :
Code[20];VariantCode@1009 : Code[20];SerialNo@1007 : Code[50];LotNo@1008 :
Code[50];LocationCode@1010 : Code[10]);
VAR
ItemLedgEntry@1003 : Record 32;
TempItemLedgEntry@1000 : TEMPORARY Record 32;
Item@1006 : Record 27;
Window@1004 : Dialog;
BEGIN
// Used when calling Item Tracking from Item, Stockkeeping Unit, Customer,
Vendor and information card:
Window.OPEN(Text004);
IF SourceNo <> '' THEN BEGIN
ItemLedgEntry.SETCURRENTKEY("Source Type","Source No.","Item No.","Variant
Code");
ItemLedgEntry.SETRANGE("Source No.",SourceNo);
ItemLedgEntry.SETRANGE("Source Type",SourceType);
END ELSE
ItemLedgEntry.SETCURRENTKEY("Item No.",Open,"Variant Code");

IF LocationCode <> '' THEN


ItemLedgEntry.SETRANGE("Location Code",LocationCode);

IF ItemNo <> '' THEN BEGIN


Item.GET(ItemNo);
Item.TESTFIELD("Item Tracking Code");
ItemLedgEntry.SETRANGE("Item No.",ItemNo);
END;
IF SourceType = 0 THEN
ItemLedgEntry.SETRANGE("Variant Code",VariantCode);
IF SerialNo <> '' THEN
ItemLedgEntry.SETRANGE("Serial No.",SerialNo);
IF LotNo <> '' THEN
ItemLedgEntry.SETRANGE("Lot No.",LotNo);

IF ItemLedgEntry.FINDSET THEN
REPEAT
IF (ItemLedgEntry."Serial No." <> '') OR (ItemLedgEntry."Lot No." <> '')
THEN BEGIN
TempItemLedgEntry := ItemLedgEntry;
TempItemLedgEntry.INSERT;
END
UNTIL ItemLedgEntry.NEXT = 0;
Window.CLOSE;
PAGE.RUNMODAL(PAGE::"Item Tracking Entries",TempItemLedgEntry);
END;

[External]
[LineStart(3498)]
PROCEDURE CopyItemTracking@14(FromRowID@1000 : Text[250];ToRowID@1001 :
Text[250];SwapSign@1006 : Boolean);
BEGIN
CopyItemTracking2(FromRowID,ToRowID,SwapSign,FALSE);
END;

[External]
[LineStart(3501)]
PROCEDURE CopyItemTracking2@55(FromRowID@1000 : Text[250];ToRowID@1001 :
Text[250];SwapSign@1006 : Boolean;SkipReservation@1007 : Boolean);
VAR
ReservEntry@1002 : Record 337;
BEGIN
ReservEntry.SetPointer(FromRowID);
ReservEntry.SetPointerFilter;
CopyItemTracking3(ReservEntry,ToRowID,SwapSign,SkipReservation);
END;

[LineStart(3506)]
LOCAL PROCEDURE CopyItemTracking3@76(VAR ReservEntry@1008 : Record
337;ToRowID@1001 : Text[250];SwapSign@1006 : Boolean;SkipReservation@1007 :
Boolean);
VAR
ReservEntry1@1000 : Record 337;
TempReservEntry@1003 : TEMPORARY Record 337;
BEGIN
IF SkipReservation THEN
ReservEntry.SETFILTER("Reservation Status",'<>%1',ReservEntry."Reservation
Status"::Reservation);
IF ReservEntry.FINDSET THEN BEGIN
REPEAT
IF ReservEntry.TrackingExists THEN BEGIN
TempReservEntry := ReservEntry;
TempReservEntry."Reservation Status" := TempReservEntry."Reservation
Status"::Prospect;
TempReservEntry.SetPointer(ToRowID);
IF SwapSign THEN BEGIN
TempReservEntry."Quantity (Base)" := -TempReservEntry."Quantity
(Base)";
TempReservEntry.Quantity := -TempReservEntry.Quantity;
TempReservEntry."Qty. to Handle (Base)" := -TempReservEntry."Qty. to
Handle (Base)";
TempReservEntry."Qty. to Invoice (Base)" := -TempReservEntry."Qty. to
Invoice (Base)";
TempReservEntry."Quantity Invoiced (Base)" := -
TempReservEntry."Quantity Invoiced (Base)";
TempReservEntry.Positive := TempReservEntry."Quantity (Base)" > 0;
TempReservEntry.ClearApplFromToItemEntry;
END;
TempReservEntry.INSERT;
END;
UNTIL ReservEntry.NEXT = 0;

ModifyTemp337SetIfTransfer(TempReservEntry);

IF TempReservEntry.FINDSET THEN BEGIN


ReservEntry1.RESET;
REPEAT
ReservEntry1 := TempReservEntry;
ReservEntry1."Entry No." := 0;
ReservEntry1.INSERT;
UNTIL TempReservEntry.NEXT = 0;
END;
END;
END;

[External]
[LineStart(3540)]
PROCEDURE CopyHandledItemTrkgToInvLine@1(FromSalesLine@1000 : Record
37;ToSalesInvLine@1001 : Record 37);
VAR
ItemEntryRelation@1003 : Record 6507;
BEGIN
// Used for combined shipment/returns:
IF FromSalesLine.Type <> FromSalesLine.Type::Item THEN
EXIT;

CASE ToSalesInvLine."Document Type" OF


ToSalesInvLine."Document Type"::Invoice:
BEGIN
ItemEntryRelation.SetSourceFilter(
DATABASE::"Sales Shipment Line",0,ToSalesInvLine."Shipment
No.",ToSalesInvLine."Shipment Line No.",TRUE);
ItemEntryRelation.SetSourceFilter2('',0);
END;
ToSalesInvLine."Document Type"::"Credit Memo":
BEGIN
ItemEntryRelation.SetSourceFilter(
DATABASE::"Return Receipt Line",0,ToSalesInvLine."Return Receipt
No.",ToSalesInvLine."Return Receipt Line No.",TRUE);
ItemEntryRelation.SetSourceFilter2('',0);
END;
ELSE
ToSalesInvLine.FIELDERROR("Document Type",FORMAT(ToSalesInvLine."Document
Type"));
END;

InsertProspectReservEntryFromItemEntryRelationAndSourceData(
ItemEntryRelation,ToSalesInvLine."Document Type",ToSalesInvLine."Document
No.",ToSalesInvLine."Line No.");
END;

[External]
[LineStart(3565)]
PROCEDURE CopyHandledItemTrkgToInvLine2@43(FromPurchLine@1000 : Record
39;ToPurchLine@1001 : Record 39);
BEGIN
CopyHandledItemTrkgToPurchLine(FromPurchLine,ToPurchLine,FALSE);
END;

[External]
[LineStart(3568)]
PROCEDURE CopyHandledItemTrkgToPurchLineWithLineQty@25(FromPurchLine@1000 :
Record 39;ToPurchLine@1002 : Record 39);
BEGIN
CopyHandledItemTrkgToPurchLine(FromPurchLine,ToPurchLine,TRUE);
END;

[LineStart(3571)]
LOCAL PROCEDURE CopyHandledItemTrkgToPurchLine@16(FromPurchLine@1000 : Record
39;ToPurchLine@1001 : Record 39;CheckLineQty@1004 : Boolean);
VAR
ItemEntryRelation@1003 : Record 6507;
TrackingSpecification@1002 : Record 336;
QtyBase@1005 : Decimal;
BEGIN
// Used for combined receipts/returns:
IF FromPurchLine.Type <> FromPurchLine.Type::Item THEN
EXIT;

CASE ToPurchLine."Document Type" OF


ToPurchLine."Document Type"::Invoice:
BEGIN
ItemEntryRelation.SetSourceFilter(
DATABASE::"Purch. Rcpt. Line",0,ToPurchLine."Receipt
No.",ToPurchLine."Receipt Line No.",TRUE);
ItemEntryRelation.SetSourceFilter2('',0);
END;
ToPurchLine."Document Type"::"Credit Memo":
BEGIN
ItemEntryRelation.SetSourceFilter(
DATABASE::"Return Shipment Line",0,ToPurchLine."Return Shipment
No.",ToPurchLine."Return Shipment Line No.",TRUE);
ItemEntryRelation.SetSourceFilter2('',0);
END;
ELSE
ToPurchLine.FIELDERROR("Document Type",FORMAT(ToPurchLine."Document
Type"));
END;

IF NOT ItemEntryRelation.FINDSET THEN


EXIT;

REPEAT
TrackingSpecification.GET(ItemEntryRelation."Item Entry No.");
QtyBase := TrackingSpecification."Quantity (Base)" -
TrackingSpecification."Quantity Invoiced (Base)";
IF CheckLineQty AND (QtyBase > ToPurchLine.Quantity) THEN
QtyBase := ToPurchLine.Quantity;
InsertReservEntryFromTrackingSpec(
TrackingSpecification,ToPurchLine."Document Type",ToPurchLine."Document
No.",ToPurchLine."Line No.",QtyBase);
UNTIL ItemEntryRelation.NEXT = 0;
END;

[External]
[LineStart(3605)]
PROCEDURE CopyHandledItemTrkgToServLine@93(FromServLine@1000 : Record
5902;ToServLine@1001 : Record 5902);
VAR
ItemEntryRelation@1003 : Record 6507;
BEGIN
// Used for combined shipment/returns:
IF FromServLine.Type <> FromServLine.Type::Item THEN
EXIT;

CASE ToServLine."Document Type" OF


ToServLine."Document Type"::Invoice:
BEGIN
ItemEntryRelation.SetSourceFilter(
DATABASE::"Service Shipment Line",0,ToServLine."Shipment
No.",ToServLine."Shipment Line No.",TRUE);
ItemEntryRelation.SetSourceFilter2('',0);
END;
ELSE
ToServLine.FIELDERROR("Document Type",FORMAT(ToServLine."Document
Type"));
END;

InsertProspectReservEntryFromItemEntryRelationAndSourceData(
ItemEntryRelation,ToServLine."Document Type",ToServLine."Document
No.",ToServLine."Line No.");
END;

[External]
[LineStart(3624)]
PROCEDURE CollectItemEntryRelation@37(VAR TempItemLedgEntry@1000 : TEMPORARY
Record 32;SourceType@1002 : Integer;SourceSubtype@1003 : Integer;SourceID@1004 :
Code[20];SourceBatchName@1005 : Code[10];SourceProdOrderLine@1007 :
Integer;SourceRefNo@1006 : Integer;TotalQty@1010 : Decimal) : Boolean;
VAR
ItemLedgEntry@1001 : Record 32;
ItemEntryRelation@1008 : Record 6507;
Quantity@1011 : Decimal;
BEGIN
Quantity := 0;
TempItemLedgEntry.RESET;
TempItemLedgEntry.DELETEALL;

ItemEntryRelation.SetSourceFilter(SourceType,SourceSubtype,SourceID,SourceRefNo,TRU
E);
ItemEntryRelation.SetSourceFilter2(SourceBatchName,SourceProdOrderLine);
IF ItemEntryRelation.FINDSET THEN
REPEAT
ItemLedgEntry.GET(ItemEntryRelation."Item Entry No.");
TempItemLedgEntry := ItemLedgEntry;
TempItemLedgEntry.INSERT;
Quantity := Quantity + ItemLedgEntry.Quantity;
UNTIL ItemEntryRelation.NEXT = 0;
EXIT(Quantity = TotalQty);
END;

[External]
[LineStart(3639)]
PROCEDURE IsOrderNetworkEntity@19(Type@1002 : Integer;Subtype@1000 : Integer) :
Boolean;
VAR
IsNetworkEntity@1001 : Boolean;
BEGIN
CASE Type OF
DATABASE::"Sales Line":
EXIT(Subtype IN [1,5]);
DATABASE::"Purchase Line":
EXIT(Subtype IN [1,5]);
DATABASE::"Prod. Order Line":
EXIT(Subtype IN [2,3]);
DATABASE::"Prod. Order Component":
EXIT(Subtype IN [2,3]);
DATABASE::"Assembly Header":
EXIT(Subtype IN [1]);
DATABASE::"Assembly Line":
EXIT(Subtype IN [1]);
DATABASE::"Transfer Line":
EXIT(TRUE);
DATABASE::"Service Line":
EXIT(Subtype IN [1]);
ELSE BEGIN
OnIsOrderNetworkEntity(Type,Subtype,IsNetworkEntity);
EXIT(IsNetworkEntity);
END;
END;
END;

[External]
[LineStart(3663)]
PROCEDURE DeleteItemEntryRelation@3(SourceType@1006 :
Integer;SourceSubtype@1005 : Integer;SourceID@1004 :
Code[20];SourceBatchName@1003 : Code[10];SourceProdOrderLine@1002 :
Integer;SourceRefNo@1001 : Integer;DeleteAllDocLines@1007 : Boolean);
VAR
ItemEntryRelation@1000 : Record 6507;
BEGIN
ItemEntryRelation.SetSourceFilter(SourceType,SourceSubtype,SourceID,-1,TRUE);
IF DeleteAllDocLines THEN
ItemEntryRelation.SetSourceFilter(SourceType,SourceSubtype,SourceID,-
1,TRUE)
ELSE

ItemEntryRelation.SetSourceFilter(SourceType,SourceSubtype,SourceID,SourceRefNo,TRU
E);
ItemEntryRelation.SetSourceFilter2(SourceBatchName,SourceProdOrderLine);
IF NOT ItemEntryRelation.ISEMPTY THEN
ItemEntryRelation.DELETEALL;
END;

[External]
[LineStart(3673)]
PROCEDURE DeleteValueEntryRelation@22(RowID@1001 : Text[100]);
VAR
ValueEntryRelation@1000 : Record 6508;
BEGIN
ValueEntryRelation.SETCURRENTKEY("Source RowId");
ValueEntryRelation.SETRANGE("Source RowId",RowID);
IF NOT ValueEntryRelation.ISEMPTY THEN
ValueEntryRelation.DELETEALL;
END;

[External]
[LineStart(3679)]
PROCEDURE FindInInventory@24(ItemNo@1000 : Code[20];VariantCode@1001 :
Code[20];SerialNo@1002 : Code[50]) : Boolean;
VAR
ItemLedgerEntry@1004 : Record 32;
BEGIN
ItemLedgerEntry.RESET;
ItemLedgerEntry.SETCURRENTKEY("Item No.",Open,"Variant Code",Positive);
ItemLedgerEntry.SETRANGE("Item No.",ItemNo);
ItemLedgerEntry.SETRANGE(Open,TRUE);
ItemLedgerEntry.SETRANGE("Variant Code",VariantCode);
ItemLedgerEntry.SETRANGE(Positive,TRUE);
IF SerialNo <> '' THEN
ItemLedgerEntry.SETRANGE("Serial No.",SerialNo);
EXIT(ItemLedgerEntry.FINDFIRST);
END;

[External]
[LineStart(3690)]
PROCEDURE SplitWhseJnlLine@29(TempWhseJnlLine@1000 : TEMPORARY Record 7311;VAR
TempWhseJnlLine2@1004 : TEMPORARY Record 7311;VAR TempWhseSplitSpecification@1001 :
TEMPORARY Record 336;ToTransfer@1010 : Boolean);
VAR
NonDistrQtyBase@1006 : Decimal;
NonDistrCubage@1007 : Decimal;
NonDistrWeight@1008 : Decimal;
SplitFactor@1009 : Decimal;
LineNo@1002 : Integer;
WhseSNRequired@1003 : Boolean;
WhseLNRequired@1005 : Boolean;
BEGIN
TempWhseJnlLine2.DELETEALL;

CheckWhseItemTrkgSetup(TempWhseJnlLine."Item
No.",WhseSNRequired,WhseLNRequired,FALSE);
IF NOT (WhseSNRequired OR WhseLNRequired) THEN BEGIN
TempWhseJnlLine2 := TempWhseJnlLine;
TempWhseJnlLine2.INSERT;
OnAfterSplitWhseJnlLine(TempWhseJnlLine,TempWhseJnlLine2);
EXIT;
END;

LineNo := TempWhseJnlLine."Line No.";


WITH TempWhseSplitSpecification DO BEGIN
RESET;
CASE TempWhseJnlLine."Source Type" OF
DATABASE::"Item Journal Line",
DATABASE::"Job Journal Line":
SetSourceFilter(
TempWhseJnlLine."Source Type",-1,TempWhseJnlLine."Journal Template
Name",TempWhseJnlLine."Source Line No.",TRUE);
0: // Whse. journal line
SetSourceFilter(
DATABASE::"Warehouse Journal Line",-1,TempWhseJnlLine."Journal Batch
Name",TempWhseJnlLine."Line No.",TRUE);
ELSE
SetSourceFilter(
TempWhseJnlLine."Source Type",-1,TempWhseJnlLine."Source
No.",TempWhseJnlLine."Source Line No.",TRUE);
END;
SETFILTER("Quantity actual Handled (Base)",'<>%1',0);
NonDistrQtyBase := TempWhseJnlLine."Qty. (Absolute, Base)";
NonDistrCubage := TempWhseJnlLine.Cubage;
NonDistrWeight := TempWhseJnlLine.Weight;
IF FINDSET THEN
REPEAT
LineNo += 10000;
TempWhseJnlLine2 := TempWhseJnlLine;
TempWhseJnlLine2."Line No." := LineNo;

IF "Serial No." <> '' THEN


IF ABS("Quantity (Base)") <> 1 THEN
FIELDERROR("Quantity (Base)");

IF ToTransfer THEN BEGIN


SetWhseSerialLotNo(TempWhseJnlLine2."Serial No.","New Serial
No.",WhseSNRequired);
SetWhseSerialLotNo(TempWhseJnlLine2."Lot No.","New Lot
No.",WhseLNRequired);
IF "New Expiration Date" <> 0D THEN
TempWhseJnlLine2."Expiration Date" := "New Expiration Date"
END ELSE BEGIN
SetWhseSerialLotNo(TempWhseJnlLine2."Serial No.","Serial
No.",WhseSNRequired);
SetWhseSerialLotNo(TempWhseJnlLine2."Lot No.","Lot
No.",WhseLNRequired);
TempWhseJnlLine2."Expiration Date" := "Expiration Date";
END;
SetWhseSerialLotNo(TempWhseJnlLine2."New Serial No.","New Serial
No.",WhseSNRequired);
SetWhseSerialLotNo(TempWhseJnlLine2."New Lot No.","New Lot
No.",WhseLNRequired);
TempWhseJnlLine2."New Expiration Date" := "New Expiration Date";
TempWhseJnlLine2."Warranty Date" := "Warranty Date";
TempWhseJnlLine2."Qty. (Absolute, Base)" := ABS("Quantity (Base)");
TempWhseJnlLine2."Qty. (Absolute)" :=
ROUND(
TempWhseJnlLine2."Qty. (Absolute, Base)" / TempWhseJnlLine."Qty.
per Unit of Measure",UOMMgt.QtyRndPrecision);
IF TempWhseJnlLine.Quantity > 0 THEN BEGIN
TempWhseJnlLine2."Qty. (Base)" := TempWhseJnlLine2."Qty. (Absolute,
Base)";
TempWhseJnlLine2.Quantity := TempWhseJnlLine2."Qty. (Absolute)";
END ELSE BEGIN
TempWhseJnlLine2."Qty. (Base)" := -TempWhseJnlLine2."Qty. (Absolute,
Base)";
TempWhseJnlLine2.Quantity := -TempWhseJnlLine2."Qty. (Absolute)";
END;
SplitFactor := "Quantity (Base)" / NonDistrQtyBase;
IF SplitFactor < 1 THEN BEGIN
TempWhseJnlLine2.Cubage := ROUND(NonDistrCubage *
SplitFactor,UOMMgt.QtyRndPrecision);
TempWhseJnlLine2.Weight := ROUND(NonDistrWeight *
SplitFactor,UOMMgt.QtyRndPrecision);
NonDistrQtyBase -= "Quantity (Base)";
NonDistrCubage -= TempWhseJnlLine2.Cubage;
NonDistrWeight -= TempWhseJnlLine2.Weight;
END ELSE BEGIN // the last record
TempWhseJnlLine2.Cubage := NonDistrCubage;
TempWhseJnlLine2.Weight := NonDistrWeight;
END;
OnBeforeTempWhseJnlLine2Insert(

TempWhseJnlLine2,TempWhseJnlLine,TempWhseSplitSpecification,ToTransfer,WhseSNRequir
ed,WhseLNRequired);
TempWhseJnlLine2.INSERT;
UNTIL NEXT = 0
ELSE BEGIN
TempWhseJnlLine2 := TempWhseJnlLine;
OnBeforeTempWhseJnlLine2Insert(

TempWhseJnlLine2,TempWhseJnlLine,TempWhseSplitSpecification,ToTransfer,FALSE,FALSE)
;
TempWhseJnlLine2.INSERT;
END;
END;

OnAfterSplitWhseJnlLine(TempWhseJnlLine,TempWhseJnlLine2);
END;

[External]
[LineStart(3780)]
PROCEDURE SplitPostedWhseRcptLine@26(PostedWhseRcptLine@1005 : Record 7319;VAR
TempPostedWhseRcptLine@1000 : TEMPORARY Record 7319);
VAR
WhseItemEntryRelation@1001 : Record 6509;
ItemLedgEntry@1004 : Record 32;
LineNo@1003 : Integer;
WhseSNRequired@1006 : Boolean;
WhseLNRequired@1002 : Boolean;
CrossDockQty@1007 : Decimal;
CrossDockQtyBase@1008 : Decimal;
BEGIN
TempPostedWhseRcptLine.RESET;
TempPostedWhseRcptLine.DELETEALL;

CheckWhseItemTrkgSetup(PostedWhseRcptLine."Item
No.",WhseSNRequired,WhseLNRequired,FALSE);
IF NOT (WhseSNRequired OR WhseLNRequired) THEN BEGIN
TempPostedWhseRcptLine := PostedWhseRcptLine;
TempPostedWhseRcptLine.INSERT;

OnAfterSplitPostedWhseReceiptLine(PostedWhseRcptLine,TempPostedWhseRcptLine);
EXIT;
END;

WhseItemEntryRelation.RESET;
WhseItemEntryRelation.SetSourceFilter(
DATABASE::"Posted Whse. Receipt
Line",0,PostedWhseRcptLine."No.",PostedWhseRcptLine."Line No.",TRUE);
IF WhseItemEntryRelation.FINDSET THEN BEGIN
REPEAT
ItemLedgEntry.GET(WhseItemEntryRelation."Item Entry No.");
TempPostedWhseRcptLine.SETRANGE("Serial No.",ItemLedgEntry."Serial No.");
TempPostedWhseRcptLine.SETRANGE("Lot No.",ItemLedgEntry."Lot No.");
TempPostedWhseRcptLine.SETRANGE("Warranty Date",ItemLedgEntry."Warranty
Date");
TempPostedWhseRcptLine.SETRANGE("Expiration
Date",ItemLedgEntry."Expiration Date");

OnTempPostedWhseRcptLineSetFilters(TempPostedWhseRcptLine,ItemLedgEntry,WhseItemEnt
ryRelation);
IF TempPostedWhseRcptLine.FINDFIRST THEN BEGIN
TempPostedWhseRcptLine."Qty. (Base)" += ItemLedgEntry.Quantity;
TempPostedWhseRcptLine.Quantity :=
ROUND(
TempPostedWhseRcptLine."Qty. (Base)" / TempPostedWhseRcptLine."Qty.
per Unit of Measure",
UOMMgt.QtyRndPrecision);
TempPostedWhseRcptLine.MODIFY;

CrossDockQty := CrossDockQty - TempPostedWhseRcptLine."Qty. Cross-


Docked";
CrossDockQtyBase := CrossDockQtyBase - TempPostedWhseRcptLine."Qty.
Cross-Docked (Base)";
END ELSE BEGIN
LineNo += 10000;
TempPostedWhseRcptLine.RESET;
TempPostedWhseRcptLine := PostedWhseRcptLine;
TempPostedWhseRcptLine."Line No." := LineNo;
TempPostedWhseRcptLine.SetTracking(
WhseItemEntryRelation."Serial No.",WhseItemEntryRelation."Lot No.",
ItemLedgEntry."Warranty Date",ItemLedgEntry."Expiration Date");
TempPostedWhseRcptLine."Qty. (Base)" := ItemLedgEntry.Quantity;
TempPostedWhseRcptLine.Quantity :=
ROUND(
TempPostedWhseRcptLine."Qty. (Base)" / TempPostedWhseRcptLine."Qty.
per Unit of Measure",
UOMMgt.QtyRndPrecision);

OnBeforeInsertSplitPostedWhseRcptLine(TempPostedWhseRcptLine,PostedWhseRcptLine,Whs
eItemEntryRelation);
TempPostedWhseRcptLine.INSERT;
END;

IF WhseSNRequired THEN BEGIN


IF CrossDockQty < PostedWhseRcptLine."Qty. Cross-Docked" THEN BEGIN
TempPostedWhseRcptLine."Qty. Cross-Docked" :=
TempPostedWhseRcptLine.Quantity;
TempPostedWhseRcptLine."Qty. Cross-Docked (Base)" :=
TempPostedWhseRcptLine."Qty. (Base)";
END ELSE BEGIN
TempPostedWhseRcptLine."Qty. Cross-Docked" := 0;
TempPostedWhseRcptLine."Qty. Cross-Docked (Base)" := 0;
END;
CrossDockQty := CrossDockQty + TempPostedWhseRcptLine.Quantity;
END ELSE
IF PostedWhseRcptLine."Qty. Cross-Docked" > 0 THEN BEGIN
IF TempPostedWhseRcptLine.Quantity <=
PostedWhseRcptLine."Qty. Cross-Docked" - CrossDockQty
THEN BEGIN
TempPostedWhseRcptLine."Qty. Cross-Docked" :=
TempPostedWhseRcptLine.Quantity;
TempPostedWhseRcptLine."Qty. Cross-Docked (Base)" :=
TempPostedWhseRcptLine."Qty. (Base)";
END ELSE BEGIN
TempPostedWhseRcptLine."Qty. Cross-Docked" :=
PostedWhseRcptLine."Qty. Cross-Docked" - CrossDockQty;
TempPostedWhseRcptLine."Qty. Cross-Docked (Base)" :=
PostedWhseRcptLine."Qty. Cross-Docked (Base)" - CrossDockQtyBase;
END;
CrossDockQty := CrossDockQty + TempPostedWhseRcptLine."Qty. Cross-
Docked";
CrossDockQtyBase := CrossDockQtyBase + TempPostedWhseRcptLine."Qty.
Cross-Docked (Base)";
IF CrossDockQty >= PostedWhseRcptLine."Qty. Cross-Docked" THEN BEGIN
PostedWhseRcptLine."Qty. Cross-Docked" := 0;
PostedWhseRcptLine."Qty. Cross-Docked (Base)" := 0;
END;
END;
TempPostedWhseRcptLine.MODIFY;
UNTIL WhseItemEntryRelation.NEXT = 0;
END ELSE BEGIN
TempPostedWhseRcptLine := PostedWhseRcptLine;
TempPostedWhseRcptLine.INSERT;
END;

OnAfterSplitPostedWhseReceiptLine(PostedWhseRcptLine,TempPostedWhseRcptLine);
END;

[External]
[LineStart(3867)]
PROCEDURE SplitInternalPutAwayLine@27(PostedWhseRcptLine@1005 : Record 7319;VAR
TempPostedWhseRcptLine@1000 : TEMPORARY Record 7319);
VAR
WhseItemTrackingLine@1001 : Record 6550;
LineNo@1003 : Integer;
WhseSNRequired@1004 : Boolean;
WhseLNRequired@1002 : Boolean;
BEGIN
TempPostedWhseRcptLine.DELETEALL;

CheckWhseItemTrkgSetup(PostedWhseRcptLine."Item
No.",WhseSNRequired,WhseLNRequired,FALSE);
IF NOT (WhseSNRequired OR WhseLNRequired) THEN BEGIN
TempPostedWhseRcptLine := PostedWhseRcptLine;
TempPostedWhseRcptLine.INSERT;
EXIT;
END;

WhseItemTrackingLine.RESET;
WhseItemTrackingLine.SetSourceFilter(
DATABASE::"Whse. Internal Put-away
Line",0,PostedWhseRcptLine."No.",PostedWhseRcptLine."Line No.",TRUE);
WhseItemTrackingLine.SetSourceFilter2('',0);
WhseItemTrackingLine.SETFILTER("Qty. to Handle (Base)",'<>0');
IF WhseItemTrackingLine.FINDSET THEN
REPEAT
LineNo += 10000;
TempPostedWhseRcptLine := PostedWhseRcptLine;
TempPostedWhseRcptLine."Line No." := LineNo;
TempPostedWhseRcptLine.SetTracking(
WhseItemTrackingLine."Serial No.",WhseItemTrackingLine."Lot No.",
WhseItemTrackingLine."Warranty Date",WhseItemTrackingLine."Expiration
Date");
TempPostedWhseRcptLine."Qty. (Base)" := WhseItemTrackingLine."Qty. to
Handle (Base)";
TempPostedWhseRcptLine.Quantity :=
ROUND(
TempPostedWhseRcptLine."Qty. (Base)" / TempPostedWhseRcptLine."Qty.
per Unit of Measure",
UOMMgt.QtyRndPrecision);

OnBeforeInsertSplitInternalPutAwayLine(TempPostedWhseRcptLine,PostedWhseRcptLine,Wh
seItemTrackingLine);
TempPostedWhseRcptLine.INSERT;
UNTIL WhseItemTrackingLine.NEXT = 0
ELSE BEGIN
TempPostedWhseRcptLine := PostedWhseRcptLine;
TempPostedWhseRcptLine.INSERT;
END
END;

[External]
[LineStart(3903)]
PROCEDURE DeleteWhseItemTrkgLines@28(SourceType@1000 :
Integer;SourceSubtype@1002 : Integer;SourceID@1001 :
Code[20];SourceBatchName@1007 : Code[10];SourceProdOrderLine@1003 :
Integer;SourceRefNo@1005 : Integer;LocationCode@1006 :
Code[10];RelatedToLine@1008 : Boolean);
VAR
WhseItemTrkgLine@1004 : Record 6550;
BEGIN
WITH WhseItemTrkgLine DO BEGIN
RESET;
SetSourceFilter(SourceType,SourceSubtype,SourceID,-1,TRUE);
IF RelatedToLine THEN BEGIN
SetSourceFilter2(SourceBatchName,SourceProdOrderLine);
SETRANGE("Source Ref. No.",SourceRefNo);
SETRANGE("Location Code",LocationCode);
END;

IF FINDSET THEN
REPEAT
// If the item tracking information was added through a pick
registration, the reservation entry needs to
// be modified/deleted as well in order to remove this item tracking
information again.
IF DeleteReservationEntries AND
"Created by Whse. Activity Line" AND
("Source Type" = DATABASE::"Warehouse Shipment Line")
THEN
RemoveItemTrkgFromReservEntry(WhseItemTrkgLine);
DELETE;
UNTIL NEXT = 0;
END;
END;

[LineStart(3926)]
LOCAL PROCEDURE RemoveItemTrkgFromReservEntry@104(WhseItemTrackingLine@1002 :
Record 6550);
VAR
ReservEntry@1001 : Record 337;
WarehouseShipmentLine@1003 : Record 7321;
BEGIN
WarehouseShipmentLine.SETRANGE("No.",WhseItemTrackingLine."Source ID");
WarehouseShipmentLine.SETRANGE("Line No.",WhseItemTrackingLine."Source Ref.
No.");
IF NOT WarehouseShipmentLine.FINDFIRST THEN
EXIT;

ReservEntry.SetSourceFilter(
WarehouseShipmentLine."Source Type",WarehouseShipmentLine."Source Subtype",
WarehouseShipmentLine."Source No.",WarehouseShipmentLine."Source Line
No.",TRUE);
ReservEntry.SetTrackingFilterFromWhseSpec(WhseItemTrackingLine);
IF ReservEntry.FINDSET THEN
REPEAT
CASE ReservEntry."Reservation Status" OF
ReservEntry."Reservation Status"::Surplus:
ReservEntry.DELETE(TRUE);
ELSE BEGIN
ReservEntry.ClearItemTrackingFields;
ReservEntry.MODIFY(TRUE);
END;
END;
UNTIL ReservEntry.NEXT = 0;
END;

[External]
[LineStart(3948)]
PROCEDURE SetDeleteReservationEntries@105(DeleteEntries@1000 : Boolean);
BEGIN
DeleteReservationEntries := DeleteEntries;
END;

[External]
[LineStart(3951)]
PROCEDURE InitTrackingSpecification@34(WhseWkshLine@1000 : Record 7326);
VAR
WhseItemTrkgLine@1002 : Record 6550;
PostedWhseReceiptLine@1003 : Record 7319;
TempWhseItemTrkgLine@1004 : TEMPORARY Record 6550;
WhseManagement@1005 : Codeunit 5775;
SourceType@1001 : Integer;
BEGIN
SourceType := WhseManagement.GetSourceType(WhseWkshLine);
WITH WhseWkshLine DO BEGIN
IF "Whse. Document Type" = "Whse. Document Type"::Receipt THEN BEGIN
PostedWhseReceiptLine.SETRANGE("No.","Whse. Document No.");
PostedWhseReceiptLine.SETRANGE("Line No.","Whse. Document Line No.");
IF PostedWhseReceiptLine.FINDFIRST THEN
InsertWhseItemTrkgLines(PostedWhseReceiptLine,SourceType);
END;

IF SourceType = DATABASE::"Prod. Order Component" THEN BEGIN


WhseItemTrkgLine.SetSourceFilter(SourceType,"Source Subtype","Source
No.","Source Subline No.",TRUE);
WhseItemTrkgLine.SETRANGE("Source Prod. Order Line","Source Line No.");
END ELSE
WhseItemTrkgLine.SetSourceFilter(SourceType,-1,"Whse. Document
No.","Whse. Document Line No.",TRUE);

WhseItemTrkgLine.LOCKTABLE;
IF WhseItemTrkgLine.FINDSET THEN BEGIN
REPEAT
CalcWhseItemTrkgLine(WhseItemTrkgLine);
WhseItemTrkgLine.MODIFY;
IF SourceType IN [DATABASE::"Prod. Order Component",DATABASE::"Assembly
Line"] THEN BEGIN
TempWhseItemTrkgLine := WhseItemTrkgLine;
TempWhseItemTrkgLine.INSERT;
END;
UNTIL WhseItemTrkgLine.NEXT = 0;
IF NOT TempWhseItemTrkgLine.ISEMPTY THEN
CheckWhseItemTrkg(TempWhseItemTrkgLine,WhseWkshLine);
END ELSE
CASE SourceType OF
DATABASE::"Posted Whse. Receipt Line":
CreateWhseItemTrkgForReceipt(WhseWkshLine);
DATABASE::"Warehouse Shipment Line":
CreateWhseItemTrkgBatch(WhseWkshLine);
DATABASE::"Prod. Order Component":
CreateWhseItemTrkgBatch(WhseWkshLine);
DATABASE::"Assembly Line":
CreateWhseItemTrkgBatch(WhseWkshLine);
END;
END;
END;

[LineStart(3992)]
LOCAL PROCEDURE CreateWhseItemTrkgForReceipt@33(WhseWkshLine@1002 : Record
7326);
VAR
ItemLedgEntry@1001 : Record 32;
WhseItemEntryRelation@1000 : Record 6509;
WhseItemTrackingLine@1003 : Record 6550;
EntryNo@1004 : Integer;
BEGIN
WITH WhseWkshLine DO BEGIN
WhseItemTrackingLine.RESET;
IF WhseItemTrackingLine.FINDLAST THEN
EntryNo := WhseItemTrackingLine."Entry No.";

WhseItemEntryRelation.SetSourceFilter(
DATABASE::"Posted Whse. Receipt Line",0,"Whse. Document No.","Whse.
Document Line No.",TRUE);
IF WhseItemEntryRelation.FINDSET THEN
REPEAT
WhseItemTrackingLine.INIT;
EntryNo += 1;
WhseItemTrackingLine."Entry No." := EntryNo;
WhseItemTrackingLine."Item No." := "Item No.";
WhseItemTrackingLine."Variant Code" := "Variant Code";
WhseItemTrackingLine."Location Code" := "Location Code";
WhseItemTrackingLine.Description := Description;
WhseItemTrackingLine."Qty. per Unit of Measure" := "Qty. per From Unit
of Measure";
WhseItemTrackingLine.SetSource(
DATABASE::"Posted Whse. Receipt Line",0,"Whse. Document No.","Whse.
Document Line No.",'',0);
ItemLedgEntry.GET(WhseItemEntryRelation."Item Entry No.");
WhseItemTrackingLine.CopyTrackingFromItemLedgEntry(ItemLedgEntry);
WhseItemTrackingLine."Quantity (Base)" := ItemLedgEntry.Quantity;
IF "Qty. (Base)" = "Qty. to Handle (Base)" THEN
WhseItemTrackingLine."Qty. to Handle (Base)" :=
WhseItemTrackingLine."Quantity (Base)";
WhseItemTrackingLine."Qty. to Handle" :=
ROUND(
WhseItemTrackingLine."Qty. to Handle (Base)" /
WhseItemTrackingLine."Qty. per Unit of Measure",
UOMMgt.QtyRndPrecision);

OnBeforeCreateWhseItemTrkgForReceipt(WhseItemTrackingLine,WhseWkshLine);
WhseItemTrackingLine.INSERT;
UNTIL WhseItemEntryRelation.NEXT = 0;
END;
END;

[LineStart(4026)]
LOCAL PROCEDURE CreateWhseItemTrkgBatch@31(WhseWkshLine@1001 : Record 7326);
VAR
SourceItemTrackingLine@1000 : Record 337;
WhseManagement@1004 : Codeunit 5775;
SourceType@1005 : Integer;
BEGIN
SourceType := WhseManagement.GetSourceType(WhseWkshLine);

WITH WhseWkshLine DO BEGIN


CASE SourceType OF
DATABASE::"Prod. Order Component":
BEGIN
SourceItemTrackingLine.SetSourceFilter("Source Type","Source
Subtype","Source No.","Source Subline No.",TRUE);
SourceItemTrackingLine.SetSourceFilter2('',"Source Line No.");
END;
ELSE BEGIN
SourceItemTrackingLine.SetSourceFilter("Source Type","Source
Subtype","Source No.","Source Line No.",TRUE);
SourceItemTrackingLine.SetSourceFilter2('',0);
END;
END;
IF SourceItemTrackingLine.FINDSET THEN
REPEAT
CreateWhseItemTrkgForResEntry(SourceItemTrackingLine,WhseWkshLine);
UNTIL SourceItemTrackingLine.NEXT = 0;
END;
END;

[External]
[LineStart(4047)]
PROCEDURE CreateWhseItemTrkgForResEntry@92(SourceReservEntry@1000 : Record
337;WhseWkshLine@1004 : Record 7326);
VAR
WhseItemTrackingLine@1003 : Record 6550;
WhseManagement@1001 : Codeunit 5775;
EntryNo@1002 : Integer;
SourceType@1005 : Integer;
BEGIN
IF NOT ((SourceReservEntry."Reservation Status" <>
SourceReservEntry."Reservation Status"::Reservation) OR
IsResEntryReservedAgainstInventory(SourceReservEntry))
THEN
EXIT;

IF NOT SourceReservEntry.TrackingExists THEN


EXIT;

SourceType := WhseManagement.GetSourceType(WhseWkshLine);

IF WhseItemTrackingLine.FINDLAST THEN
EntryNo := WhseItemTrackingLine."Entry No.";

WhseItemTrackingLine.INIT;

WITH WhseWkshLine DO
CASE SourceType OF
DATABASE::"Posted Whse. Receipt Line":
WhseItemTrackingLine.SetSource(
DATABASE::"Posted Whse. Receipt Line",0,"Whse. Document No.","Whse.
Document Line No.",'',0);
DATABASE::"Warehouse Shipment Line":
WhseItemTrackingLine.SetSource(
DATABASE::"Warehouse Shipment Line",0,"Whse. Document No.","Whse.
Document Line No.",'',0);
DATABASE::"Assembly Line":
WhseItemTrackingLine.SetSource(
DATABASE::"Assembly Line","Source Subtype","Whse. Document
No.","Whse. Document Line No.",'',0);
DATABASE::"Prod. Order Component":
WhseItemTrackingLine.SetSource(
"Source Type","Source Subtype","Source No.","Source Subline
No.",'',"Source Line No.");
END;

WhseItemTrackingLine."Entry No." := EntryNo + 1;


WhseItemTrackingLine."Item No." := SourceReservEntry."Item No.";
WhseItemTrackingLine."Variant Code" := SourceReservEntry."Variant Code";
WhseItemTrackingLine."Location Code" := SourceReservEntry."Location Code";
WhseItemTrackingLine.Description := SourceReservEntry.Description;
WhseItemTrackingLine."Qty. per Unit of Measure" := SourceReservEntry."Qty.
per Unit of Measure";
WhseItemTrackingLine.CopyTrackingFromReservEntry(SourceReservEntry);
WhseItemTrackingLine."Quantity (Base)" := -SourceReservEntry."Quantity
(Base)";

IF WhseWkshLine."Qty. Handled (Base)" <> 0 THEN BEGIN


WhseItemTrackingLine."Quantity Handled (Base)" := WhseWkshLine."Qty.
Handled (Base)";
WhseItemTrackingLine."Qty. Registered (Base)" := WhseWkshLine."Qty. Handled
(Base)";
END ELSE
IF WhseWkshLine."Qty. (Base)" = WhseWkshLine."Qty. to Handle (Base)" THEN
BEGIN
WhseItemTrackingLine."Qty. to Handle (Base)" :=
WhseItemTrackingLine."Quantity (Base)";
WhseItemTrackingLine."Qty. to Handle" := -SourceReservEntry.Quantity;
END;

OnBeforeCreateWhseItemTrkgForResEntry(WhseItemTrackingLine,SourceReservEntry,WhseWk
shLine);
WhseItemTrackingLine.INSERT;
END;

[External]
[LineStart(4099)]
PROCEDURE CalcWhseItemTrkgLine@30(VAR WhseItemTrkgLine@1000 : Record 6550);
VAR
WhseActivQtyBase@1001 : Decimal;
BEGIN
CASE WhseItemTrkgLine."Source Type" OF
DATABASE::"Posted Whse. Receipt Line":
WhseItemTrkgLine."Source Type Filter" := WhseItemTrkgLine."Source Type
Filter"::Receipt;
DATABASE::"Whse. Internal Put-away Line":
WhseItemTrkgLine."Source Type Filter" := WhseItemTrkgLine."Source Type
Filter"::"Internal Put-away";
DATABASE::"Warehouse Shipment Line":
WhseItemTrkgLine."Source Type Filter" := WhseItemTrkgLine."Source Type
Filter"::Shipment;
DATABASE::"Whse. Internal Pick Line":
WhseItemTrkgLine."Source Type Filter" := WhseItemTrkgLine."Source Type
Filter"::"Internal Pick";
DATABASE::"Prod. Order Component":
WhseItemTrkgLine."Source Type Filter" := WhseItemTrkgLine."Source Type
Filter"::Production;
DATABASE::"Assembly Line":
WhseItemTrkgLine."Source Type Filter" := WhseItemTrkgLine."Source Type
Filter"::Assembly;
DATABASE::"Whse. Worksheet Line":
WhseItemTrkgLine."Source Type Filter" := WhseItemTrkgLine."Source Type
Filter"::"Movement Worksheet";
END;
WhseItemTrkgLine.CALCFIELDS("Put-away Qty. (Base)","Pick Qty. (Base)");

IF WhseItemTrkgLine."Put-away Qty. (Base)" > 0 THEN


WhseActivQtyBase := WhseItemTrkgLine."Put-away Qty. (Base)";
IF WhseItemTrkgLine."Pick Qty. (Base)" > 0 THEN
WhseActivQtyBase := WhseItemTrkgLine."Pick Qty. (Base)";

IF NOT Registering THEN


WhseItemTrkgLine.VALIDATE("Quantity Handled (Base)",
WhseActivQtyBase + WhseItemTrkgLine."Qty. Registered (Base)")
ELSE
WhseItemTrkgLine.VALIDATE("Quantity Handled (Base)",
WhseItemTrkgLine."Qty. Registered (Base)");

IF WhseItemTrkgLine."Quantity (Base)" >= WhseItemTrkgLine."Quantity Handled


(Base)" THEN
WhseItemTrkgLine.VALIDATE("Qty. to Handle (Base)",
WhseItemTrkgLine."Quantity (Base)" - WhseItemTrkgLine."Quantity Handled
(Base)");
END;

[External]
[LineStart(4134)]
PROCEDURE InitItemTrkgForTempWkshLine@36(WhseDocType@1000 :
Option;WhseDocNo@1001 : Code[20];WhseDocLineNo@1002 : Integer;SourceType@1003 :
Integer;SourceSubtype@1004 : Integer;SourceNo@1005 : Code[20];SourceLineNo@1006 :
Integer;SourceSublineNo@1007 : Integer);
VAR
TempWhseWkshLine@1008 : Record 7326;
BEGIN

InitWhseWkshLine(TempWhseWkshLine,WhseDocType,WhseDocNo,WhseDocLineNo,SourceType,So
urceSubtype,SourceNo,
SourceLineNo,SourceSublineNo);
InitTrackingSpecification(TempWhseWkshLine);
END;

[External]
[LineStart(4139)]
PROCEDURE InitWhseWkshLine@99(VAR WhseWkshLine@1009 : Record
7326;WhseDocType@1007 : Option;WhseDocNo@1006 : Code[20];WhseDocLineNo@1005 :
Integer;SourceType@1004 : Integer;SourceSubtype@1003 : Integer;SourceNo@1002 :
Code[20];SourceLineNo@1001 : Integer;SourceSublineNo@1000 : Integer);
VAR
ProdOrderComponent@1011 : Record 5407;
BEGIN
WhseWkshLine.INIT;
WhseWkshLine."Whse. Document Type" := WhseDocType;
WhseWkshLine."Whse. Document No." := WhseDocNo;
WhseWkshLine."Whse. Document Line No." := WhseDocLineNo;
WhseWkshLine."Source Type" := SourceType;
WhseWkshLine."Source Subtype" := SourceSubtype;
WhseWkshLine."Source No." := SourceNo;
WhseWkshLine."Source Line No." := SourceLineNo;
WhseWkshLine."Source Subline No." := SourceSublineNo;
IF WhseDocType = WhseWkshLine."Whse. Document Type"::Production THEN BEGIN

ProdOrderComponent.GET(SourceSubtype,SourceNo,SourceLineNo,SourceSublineNo);
WhseWkshLine."Qty. Handled (Base)" := ProdOrderComponent."Qty. Picked
(Base)";
END;
END;

[External]
[LineStart(4155)]
PROCEDURE UpdateWhseItemTrkgLines@38(VAR TempWhseItemTrkgLine@1000 : TEMPORARY
Record 6550);
VAR
WhseItemTrkgLine@1001 : Record 6550;
BEGIN
IF TempWhseItemTrkgLine.FINDSET THEN
REPEAT
WhseItemTrkgLine.SETCURRENTKEY("Serial No.","Lot No.");
WhseItemTrkgLine.SetTrackingFilter(TempWhseItemTrkgLine."Serial
No.",TempWhseItemTrkgLine."Lot No.");
WhseItemTrkgLine.SetSourceFilter(
TempWhseItemTrkgLine."Source Type",TempWhseItemTrkgLine."Source
Subtype",TempWhseItemTrkgLine."Source ID",
TempWhseItemTrkgLine."Source Ref. No.",FALSE);
WhseItemTrkgLine.SetSourceFilter2(
TempWhseItemTrkgLine."Source Batch Name",TempWhseItemTrkgLine."Source
Prod. Order Line");
WhseItemTrkgLine.LOCKTABLE;
IF WhseItemTrkgLine.FINDFIRST THEN BEGIN
CalcWhseItemTrkgLine(WhseItemTrkgLine);
WhseItemTrkgLine.MODIFY;
END;
UNTIL TempWhseItemTrkgLine.NEXT = 0
END;

[LineStart(4172)]
LOCAL PROCEDURE InsertWhseItemTrkgLines@48(PostedWhseReceiptLine@1000 : Record
7319;SourceType@1001 : Integer);
VAR
WhseItemTrkgLine@1003 : Record 6550;
WhseItemEntryRelation@1002 : Record 6509;
ItemLedgEntry@1005 : Record 32;
EntryNo@1004 : Integer;
QtyHandledBase@1007 : Decimal;
RemQtyHandledBase@1006 : Decimal;
BEGIN
IF WhseItemTrkgLine.FINDLAST THEN
EntryNo := WhseItemTrkgLine."Entry No." + 1
ELSE
EntryNo := 1;

WITH PostedWhseReceiptLine DO BEGIN


WhseItemEntryRelation.RESET;
WhseItemEntryRelation.SetSourceFilter(SourceType,0,"No.","Line No.",TRUE);
IF WhseItemEntryRelation.FINDSET THEN BEGIN
WhseItemTrkgLine.SetSourceFilter(SourceType,0,"No.","Line No.",FALSE);
WhseItemTrkgLine.DELETEALL;
WhseItemTrkgLine.INIT;
WhseItemTrkgLine.SETCURRENTKEY("Serial No.","Lot No.");
REPEAT

OnBeforeInsertWhseItemTrkgLinesLoop(PostedWhseReceiptLine,WhseItemEntryRelation,Whs
eItemTrkgLine);
WhseItemTrkgLine.SetTrackingFilterFromRelation(WhseItemEntryRelation);
ItemLedgEntry.GET(WhseItemEntryRelation."Item Entry No.");
IF (WhseItemEntryRelation."Lot No." <> WhseItemTrkgLine."Lot No.") OR
(WhseItemEntryRelation."Serial No." <> WhseItemTrkgLine."Serial
No.")
THEN
RemQtyHandledBase :=
RegisteredPutAwayQtyBase(PostedWhseReceiptLine,WhseItemEntryRelation)
ELSE
RemQtyHandledBase -= QtyHandledBase;
QtyHandledBase := RemQtyHandledBase;
IF QtyHandledBase > ItemLedgEntry.Quantity THEN
QtyHandledBase := ItemLedgEntry.Quantity;

IF NOT WhseItemTrkgLine.FINDFIRST THEN BEGIN


WhseItemTrkgLine.INIT;
WhseItemTrkgLine."Entry No." := EntryNo;
EntryNo := EntryNo + 1;

WhseItemTrkgLine."Item No." := ItemLedgEntry."Item No.";


WhseItemTrkgLine."Location Code" := ItemLedgEntry."Location Code";
WhseItemTrkgLine.Description := ItemLedgEntry.Description;
WhseItemTrkgLine.SetSource(
WhseItemEntryRelation."Source Type",WhseItemEntryRelation."Source
Subtype",WhseItemEntryRelation."Source ID",
WhseItemEntryRelation."Source Ref.
No.",WhseItemEntryRelation."Source Batch Name",
WhseItemEntryRelation."Source Prod. Order Line");
WhseItemTrkgLine.SetTracking(
WhseItemEntryRelation."Serial No.",WhseItemEntryRelation."Lot No.",
ItemLedgEntry."Warranty Date",ItemLedgEntry."Expiration Date");
WhseItemTrkgLine."Qty. per Unit of Measure" := ItemLedgEntry."Qty.
per Unit of Measure";
WhseItemTrkgLine."Quantity Handled (Base)" := QtyHandledBase;
WhseItemTrkgLine."Qty. Registered (Base)" := QtyHandledBase;
WhseItemTrkgLine.VALIDATE("Quantity (Base)",ItemLedgEntry.Quantity);

OnBeforeInsertWhseItemTrkgLines(WhseItemTrkgLine,PostedWhseReceiptLine,WhseItemEntr
yRelation);
WhseItemTrkgLine.INSERT;
END ELSE BEGIN
WhseItemTrkgLine."Quantity Handled (Base)" += QtyHandledBase;
WhseItemTrkgLine."Qty. Registered (Base)" += QtyHandledBase;
WhseItemTrkgLine.VALIDATE("Quantity
(Base)",WhseItemTrkgLine."Quantity (Base)" + ItemLedgEntry.Quantity);

OnBeforeModifyWhseItemTrkgLines(WhseItemTrkgLine,PostedWhseReceiptLine,WhseItemEntr
yRelation);
WhseItemTrkgLine.MODIFY;
END;

OnAfterInsertWhseItemTrkgLinesLoop(PostedWhseReceiptLine,WhseItemEntryRelation,Whse
ItemTrkgLine);
UNTIL WhseItemEntryRelation.NEXT = 0;
END;
END;
END;

[LineStart(4233)]
LOCAL PROCEDURE RegisteredPutAwayQtyBase@91(PostedWhseReceiptLine@1000 : Record
7319;WhseItemEntryRelation@1001 : Record 6509) : Decimal;
VAR
RegisteredWhseActivityLine@1003 : Record 5773;
BEGIN
WITH PostedWhseReceiptLine DO BEGIN
RegisteredWhseActivityLine.RESET;
RegisteredWhseActivityLine.SetSourceFilter("Source Type","Source
Subtype","Source No.","Source Line No.",-1,TRUE);

RegisteredWhseActivityLine.SetTrackingFilterFromRelation(WhseItemEntryRelation);
RegisteredWhseActivityLine.SETRANGE("Whse. Document No.","No.");
RegisteredWhseActivityLine.SETRANGE("Action
Type",RegisteredWhseActivityLine."Action Type"::Take);
RegisteredWhseActivityLine.CALCSUMS("Qty. (Base)");
END;

EXIT(RegisteredWhseActivityLine."Qty. (Base)");
END;

[External]
[LineStart(4245)]
PROCEDURE ItemTrkgIsManagedByWhse@41(Type@1005 : Integer;Subtype@1004 :
Integer;ID@1003 : Code[20];ProdOrderLine@1001 : Integer;RefNo@1000 :
Integer;LocationCode@1008 : Code[10];ItemNo@1010 : Code[20]) : Boolean;
VAR
WhseShipmentLine@1002 : Record 7321;
WhseWkshLine@1006 : Record 7326;
WhseActivLine@1007 : Record 5767;
WhseWkshTemplate@1013 : Record 7328;
Location@1009 : Record 14;
SNRequired@1011 : Boolean;
LNRequired@1012 : Boolean;
BEGIN
IF NOT (Type IN [DATABASE::"Sales Line",
DATABASE::"Purchase Line",
DATABASE::"Transfer Line",
DATABASE::"Assembly Header",
DATABASE::"Assembly Line",
DATABASE::"Prod. Order Line",
DATABASE::"Service Line",
DATABASE::"Prod. Order Component"])
THEN
EXIT(FALSE);

IF NOT (Location.RequirePicking(LocationCode) OR
Location.RequirePutaway(LocationCode)) THEN
EXIT(FALSE);

CheckWhseItemTrkgSetup(ItemNo,SNRequired,LNRequired,FALSE);
IF NOT (SNRequired OR LNRequired) THEN
EXIT(FALSE);

WhseShipmentLine.SetSourceFilter(Type,Subtype,ID,RefNo,TRUE);
IF NOT WhseShipmentLine.ISEMPTY THEN
EXIT(TRUE);

IF Type IN [DATABASE::"Prod. Order Component",DATABASE::"Prod. Order Line"]


THEN BEGIN
WhseWkshLine.SetSourceFilter(Type,Subtype,ID,ProdOrderLine,TRUE);
WhseWkshLine.SETRANGE("Source Subline No.",RefNo);
END ELSE
WhseWkshLine.SetSourceFilter(Type,Subtype,ID,RefNo,TRUE);
IF WhseWkshLine.FINDFIRST THEN
IF WhseWkshTemplate.GET(WhseWkshLine."Worksheet Template Name") THEN
IF WhseWkshTemplate.Type = WhseWkshTemplate.Type::Pick THEN
EXIT(TRUE);

IF Type IN [DATABASE::"Prod. Order Component",DATABASE::"Prod. Order Line"]


THEN
WhseActivLine.SetSourceFilter(Type,Subtype,ID,ProdOrderLine,RefNo,TRUE)
ELSE
WhseActivLine.SetSourceFilter(Type,Subtype,ID,RefNo,0,TRUE);
IF WhseActivLine.FINDFIRST THEN
IF WhseActivLine."Activity Type" IN [WhseActivLine."Activity Type"::Pick,
WhseActivLine."Activity Type"::"Invt.
Put-away",
WhseActivLine."Activity Type"::"Invt.
Pick"]
THEN
EXIT(TRUE);

EXIT(FALSE);
END;

[External]
[LineStart(4291)]
PROCEDURE CheckWhseItemTrkgSetup@42(ItemNo@1000 : Code[20];VAR
SNRequired@1002 : Boolean;VAR LNRequired@1003 : Boolean;ShowError@1005 : Boolean);
VAR
ItemTrackingCode@1001 : Record 6502;
Item@1004 : Record 27;
BEGIN
SNRequired := FALSE;
LNRequired := FALSE;
IF Item."No." <> ItemNo THEN
Item.GET(ItemNo);
IF Item."Item Tracking Code" <> '' THEN BEGIN
IF ItemTrackingCode.Code <> Item."Item Tracking Code" THEN
ItemTrackingCode.GET(Item."Item Tracking Code");
SNRequired := ItemTrackingCode."SN Warehouse Tracking";
LNRequired := ItemTrackingCode."Lot Warehouse Tracking";
END;
IF NOT (SNRequired OR LNRequired) AND ShowError THEN
ERROR(Text005,Item.FIELDCAPTION("No."),ItemNo);
END;

[External]
[LineStart(4305)]
PROCEDURE SetGlobalParameters@44(SourceSpecification2@1000 : TEMPORARY Record
336;VAR TempTrackingSpecification2@1001 : TEMPORARY Record 336;DueDate2@1002 :
Date);
BEGIN
SourceSpecification := SourceSpecification2;
DueDate := DueDate2;
IF TempTrackingSpecification2.FINDSET THEN
REPEAT
TempTrackingSpecification := TempTrackingSpecification2;
TempTrackingSpecification.INSERT;
UNTIL TempTrackingSpecification2.NEXT = 0;
END;

[External]
[LineStart(4314)]
PROCEDURE AdjustQuantityRounding@45(NonDistrQuantity@1004 : Decimal;VAR
QtyToBeHandled@1002 : Decimal;NonDistrQuantityBase@1001 :
Decimal;QtyToBeHandledBase@1000 : Decimal);
VAR
FloatingFactor@1003 : Decimal;
BEGIN
// Used by CU80/90 for handling rounding differences during invoicing

FloatingFactor := QtyToBeHandledBase / NonDistrQuantityBase;

IF FloatingFactor < 1 THEN


QtyToBeHandled := ROUND(FloatingFactor *
NonDistrQuantity,UOMMgt.QtyRndPrecision)
ELSE
QtyToBeHandled := NonDistrQuantity;
END;

[External]
[LineStart(4324)]
PROCEDURE SynchronizeItemTrackingByPtrs@7(FromReservEntry@1002 : Record
337;ToReservEntry@1003 : Record 337);
VAR
FromRowID@1001 : Text[250];
ToRowID@1000 : Text[250];
BEGIN
FromRowID := ComposeRowID(
FromReservEntry."Source Type",FromReservEntry."Source
Subtype",FromReservEntry."Source ID",
FromReservEntry."Source Batch Name",FromReservEntry."Source Prod. Order
Line",FromReservEntry."Source Ref. No.");
ToRowID := ComposeRowID(
ToReservEntry."Source Type",ToReservEntry."Source
Subtype",ToReservEntry."Source ID",
ToReservEntry."Source Batch Name",ToReservEntry."Source Prod. Order
Line",ToReservEntry."Source Ref. No.");
SynchronizeItemTracking(FromRowID,ToRowID,'');
END;

[External]
[LineStart(4333)]
PROCEDURE SynchronizeItemTracking@47(FromRowID@1000 : Text[250];ToRowID@1001 :
Text[250];DialogText@1006 : Text[250]);
VAR
ReservEntry1@1002 : Record 337;
BEGIN
// Used for syncronizing between orders linked via Drop Shipment
ReservEntry1.SetPointer(FromRowID);
ReservEntry1.SetPointerFilter;
SynchronizeItemTracking2(ReservEntry1,ToRowID,DialogText);

OnAfterSynchronizeItemTracking(ReservEntry1,ToRowID);
END;

[LineStart(4341)]
LOCAL PROCEDURE SynchronizeItemTracking2@79(VAR FromReservEntry@1000 : Record
337;ToRowID@1001 : Text[250];DialogText@1006 : Text[250]);
VAR
ReservEntry2@1003 : Record 337;
TempTrkgSpec1@1007 : TEMPORARY Record 336;
TempTrkgSpec2@1008 : TEMPORARY Record 336;
TempTrkgSpec3@1011 : TEMPORARY Record 336;
TempSourceSpec@1010 : TEMPORARY Record 336;
ItemTrackingMgt@1017 : Codeunit 6500;
ReservMgt@1004 : Codeunit 99000845;
CreateReservEntry@1009 : Codeunit 99000830;
ConfirmManagement@1002 : Codeunit 27;
ItemTrackingLines@1014 : Page 6510;
AvailabilityDate@1016 : Date;
LastEntryNo@1005 : Integer;
SignFactor1@1015 : Integer;
SignFactor2@1012 : Integer;
SecondSourceRowID@1013 : Text[250];
BEGIN
// Used for synchronizing between orders linked via Drop Shipment and for
// synchronizing between invt. pick/put-away and parent line.
ReservEntry2.SetPointer(ToRowID);
SignFactor1 := CreateReservEntry.SignFactor(FromReservEntry);
SignFactor2 := CreateReservEntry.SignFactor(ReservEntry2);
ReservEntry2.SetPointerFilter;

IF ReservEntry2.ISEMPTY THEN BEGIN


IF FromReservEntry.ISEMPTY THEN
EXIT;
IF DialogText <> '' THEN
IF NOT ConfirmManagement.ConfirmProcess(DialogText,TRUE) THEN BEGIN
MESSAGE(Text006);
EXIT;
END;
CopyItemTracking3(FromReservEntry,ToRowID,SignFactor1 <>
SignFactor2,FALSE);

// Copy to inbound part of transfer.


IF IsReservedFromTransferShipment(FromReservEntry) THEN BEGIN
SecondSourceRowID :=
ItemTrackingMgt.ComposeRowID(FromReservEntry."Source Type",
1,FromReservEntry."Source ID",
FromReservEntry."Source Batch Name",FromReservEntry."Source Prod.
Order Line",
FromReservEntry."Source Ref. No.");
IF ToRowID <> SecondSourceRowID THEN // Avoid copying to the line itself
CopyItemTracking(ToRowID,SecondSourceRowID,TRUE);
END;
END ELSE BEGIN
IF IsReservedFromTransferShipment(FromReservEntry) THEN
SynchronizeItemTrkgTransfer(ReservEntry2); // synchronize transfer

IF SumUpItemTracking(ReservEntry2,TempTrkgSpec2,FALSE,TRUE) THEN
TempSourceSpec := TempTrkgSpec2 // TempSourceSpec is used for conveying
source information to Form6510.
ELSE
TempSourceSpec.TRANSFERFIELDS(ReservEntry2);

IF ReservEntry2."Quantity (Base)" > 0 THEN


AvailabilityDate := ReservEntry2."Expected Receipt Date"
ELSE
AvailabilityDate := ReservEntry2."Shipment Date";

SumUpItemTracking(FromReservEntry,TempTrkgSpec1,FALSE,TRUE);

TempTrkgSpec1.RESET;
TempTrkgSpec2.RESET;
TempTrkgSpec1.SETCURRENTKEY("Lot No.","Serial No.");
TempTrkgSpec2.SETCURRENTKEY("Lot No.","Serial No.");
IF TempTrkgSpec1.FINDSET THEN
REPEAT
TempTrkgSpec2.SetTrackingFilterFromSpec(TempTrkgSpec1);
IF TempTrkgSpec2.FINDFIRST THEN BEGIN
IF TempTrkgSpec2."Quantity (Base)" * SignFactor2 <>
TempTrkgSpec1."Quantity (Base)" * SignFactor1 THEN BEGIN
TempTrkgSpec3 := TempTrkgSpec2;
TempTrkgSpec3.VALIDATE("Quantity (Base)",
(TempTrkgSpec1."Quantity (Base)" * SignFactor1 -
TempTrkgSpec2."Quantity (Base)" * SignFactor2));
TempTrkgSpec3."Entry No." := LastEntryNo + 1;
TempTrkgSpec3.INSERT;
END;
TempTrkgSpec2.DELETE;
END ELSE BEGIN
TempTrkgSpec3 := TempTrkgSpec1;
TempTrkgSpec3.VALIDATE("Quantity (Base)",TempTrkgSpec1."Quantity
(Base)" * SignFactor1);
TempTrkgSpec3."Entry No." := LastEntryNo + 1;
TempTrkgSpec3.INSERT;
END;
LastEntryNo := TempTrkgSpec3."Entry No.";
TempTrkgSpec1.DELETE;
UNTIL TempTrkgSpec1.NEXT = 0;

TempTrkgSpec2.RESET;

IF TempTrkgSpec2.FINDFIRST THEN
REPEAT
TempTrkgSpec3 := TempTrkgSpec2;
TempTrkgSpec3.VALIDATE("Quantity (Base)",-TempTrkgSpec2."Quantity
(Base)" * SignFactor2);
TempTrkgSpec3."Entry No." := LastEntryNo + 1;
TempTrkgSpec3.INSERT;
LastEntryNo := TempTrkgSpec3."Entry No.";
UNTIL TempTrkgSpec2.NEXT = 0;

TempTrkgSpec3.RESET;

IF NOT TempTrkgSpec3.ISEMPTY THEN BEGIN


IF DialogText <> '' THEN
IF NOT ConfirmManagement.ConfirmProcess(DialogText,TRUE) THEN BEGIN
MESSAGE(Text006);
EXIT;
END;
TempSourceSpec."Quantity (Base)" :=
ReservMgt.GetSourceRecordValue(ReservEntry2,FALSE,1);
IF TempTrkgSpec3."Source Type" = DATABASE::"Transfer Line" THEN BEGIN
TempTrkgSpec3.MODIFYALL("Location Code",ReservEntry2."Location Code");
ItemTrackingLines.SetFormRunMode(4);
END ELSE
IF FromReservEntry."Source Type" <> ReservEntry2."Source Type" THEN //
If different it is drop shipment
ItemTrackingLines.SetFormRunMode(3);

ItemTrackingLines.RegisterItemTrackingLines(TempSourceSpec,AvailabilityDate,TempTrk
gSpec3);
END;
END;
END;

[External]
[LineStart(4441)]
PROCEDURE SetRegistering@49(Registering2@1000 : Boolean);
BEGIN
Registering := Registering2;
END;

[LineStart(4444)]
LOCAL PROCEDURE ModifyTemp337SetIfTransfer@50(VAR TempReservEntry@1001 :
TEMPORARY Record 337);
VAR
TransLine@1000 : Record 5741;
BEGIN
IF TempReservEntry."Source Type" = DATABASE::"Transfer Line" THEN BEGIN
TransLine.GET(TempReservEntry."Source ID",TempReservEntry."Source Ref.
No.");
TempReservEntry.MODIFYALL("Reservation Status",TempReservEntry."Reservation
Status"::Surplus);
IF TempReservEntry."Source Subtype" = 0 THEN BEGIN
TempReservEntry.MODIFYALL("Location Code",TransLine."Transfer-from
Code");
TempReservEntry.MODIFYALL("Expected Receipt Date",0D);
TempReservEntry.MODIFYALL("Shipment Date",TransLine."Shipment Date");
END ELSE BEGIN
TempReservEntry.MODIFYALL("Location Code",TransLine."Transfer-to Code");
TempReservEntry.MODIFYALL("Expected Receipt Date",TransLine."Receipt
Date");
TempReservEntry.MODIFYALL("Shipment Date",0D);
END;
END;
END;

[External]
[LineStart(4459)]
PROCEDURE SynchronizeWhseItemTracking@51(VAR TempTrackingSpecification@1002 :
TEMPORARY Record 336;RegPickNo@1007 : Code[20];Deletion@1006 : Boolean);
VAR
ReservEntry@1003 : Record 337;
RegisteredWhseActLine@1004 : Record 5773;
Qty@1102601000 : Decimal;
ZeroQtyToHandle@1005 : Boolean;
BEGIN
IF TempTrackingSpecification.FINDSET THEN
REPEAT
IF TempTrackingSpecification.Correction THEN BEGIN
IF IsPick THEN BEGIN
ZeroQtyToHandle := FALSE;
Qty := -TempTrackingSpecification."Qty. to Handle (Base)";
IF RegPickNo <> '' THEN BEGIN
RegisteredWhseActLine.SETRANGE("Activity
Type",RegisteredWhseActLine."Activity Type"::Pick);
RegisteredWhseActLine.SetSourceFilter(
TempTrackingSpecification."Source
Type",TempTrackingSpecification."Source Subtype",
TempTrackingSpecification."Source
ID",TempTrackingSpecification."Source Ref. No.",-1,TRUE);

RegisteredWhseActLine.SetTrackingFilterFromSpec(TempTrackingSpecification);
RegisteredWhseActLine.SETFILTER("No.",'<> %1',RegPickNo);
IF NOT RegisteredWhseActLine.FINDFIRST THEN
ZeroQtyToHandle := TRUE
ELSE
IF RegisteredWhseActLine."Whse. Document Type" =
RegisteredWhseActLine."Whse. Document Type"::Shipment THEN BEGIN
ZeroQtyToHandle := TRUE;
Qty := -(TempTrackingSpecification."Qty. to Handle (Base)" +
CalcQtyBaseRegistered(RegisteredWhseActLine));
END;
END;

ReservEntry.SetSourceFilter(
TempTrackingSpecification."Source
Type",TempTrackingSpecification."Source Subtype",
TempTrackingSpecification."Source
ID",TempTrackingSpecification."Source Ref. No.",TRUE);
ReservEntry.SetSourceFilter2('',TempTrackingSpecification."Source
Prod. Order Line");
ReservEntry.SetTrackingFilterFromSpec(TempTrackingSpecification);
IF ReservEntry.FINDSET(TRUE) THEN
REPEAT
IF ZeroQtyToHandle THEN BEGIN
ReservEntry."Qty. to Handle (Base)" := 0;
ReservEntry."Qty. to Invoice (Base)" := 0;
ReservEntry.MODIFY;
END;
UNTIL ReservEntry.NEXT = 0;

IF ReservEntry.FINDSET(TRUE) THEN
REPEAT
IF RegPickNo <> '' THEN BEGIN
ReservEntry."Qty. to Handle (Base)" += Qty;
ReservEntry."Qty. to Invoice (Base)" += Qty;
END ELSE
IF NOT Deletion THEN BEGIN
ReservEntry."Qty. to Handle (Base)" := Qty;
ReservEntry."Qty. to Invoice (Base)" := Qty;
END;
IF ABS(ReservEntry."Qty. to Handle (Base)") >
ABS(ReservEntry."Quantity (Base)") THEN BEGIN
Qty := ReservEntry."Qty. to Handle (Base)" -
ReservEntry."Quantity (Base)";
ReservEntry."Qty. to Handle (Base)" := ReservEntry."Quantity
(Base)";
ReservEntry."Qty. to Invoice (Base)" := ReservEntry."Quantity
(Base)";
END ELSE
Qty := 0;
ReservEntry.MODIFY;

IF IsReservedFromTransferShipment(ReservEntry) THEN
UpdateItemTrackingInTransferReceipt(ReservEntry);
UNTIL (ReservEntry.NEXT = 0) OR (Qty = 0);
END;
TempTrackingSpecification.DELETE;
END;
UNTIL TempTrackingSpecification.NEXT = 0;

RegisterNewItemTrackingLines(TempTrackingSpecification);
END;

[LineStart(4524)]
LOCAL PROCEDURE CheckWhseItemTrkg@40(VAR TempWhseItemTrkgLine@1000 : Record
6550;WhseWkshLine@1002 : Record 7326);
VAR
SourceReservEntry@1001 : Record 337;
WhseItemTrackingLine@1003 : Record 6550;
EntryNo@1004 : Integer;
Checked@1005 : Boolean;
BEGIN
OnBeforeCheckWhseItemTrkg(TempWhseItemTrkgLine,WhseWkshLine,Checked);
IF Checked THEN
EXIT;

WITH WhseWkshLine DO BEGIN


IF WhseItemTrackingLine.FINDLAST THEN
EntryNo := WhseItemTrackingLine."Entry No.";

IF "Source Type" = DATABASE::"Prod. Order Component" THEN BEGIN


SourceReservEntry.SetSourceFilter("Source Type","Source Subtype","Source
No.","Source Subline No.",TRUE);
SourceReservEntry.SetSourceFilter2('',"Source Line No.");
END ELSE BEGIN
SourceReservEntry.SetSourceFilter("Source Type","Source Subtype","Source
No.","Source Line No.",TRUE);
SourceReservEntry.SetSourceFilter2('',0);
END;
IF SourceReservEntry.FINDSET THEN
REPEAT
IF SourceReservEntry.TrackingExists THEN BEGIN
IF "Source Type" = DATABASE::"Prod. Order Component" THEN BEGIN
TempWhseItemTrkgLine.SetSourceFilter("Source Type","Source
Subtype","Source No.","Source Subline No.",TRUE);
TempWhseItemTrkgLine.SETRANGE("Source Prod. Order Line","Source
Line No.");
END ELSE BEGIN
TempWhseItemTrkgLine.SetSourceFilter("Source Type","Source
Subtype","Source No.","Source Line No.",TRUE);
TempWhseItemTrkgLine.SETRANGE("Source Prod. Order Line",0);
END;
TempWhseItemTrkgLine.SetTrackingFilterFromReservEntry(SourceReservEntry);

IF TempWhseItemTrkgLine.FINDFIRST THEN
TempWhseItemTrkgLine.DELETE
ELSE BEGIN
WhseItemTrackingLine.INIT;
EntryNo += 1;
WhseItemTrackingLine."Entry No." := EntryNo;
WhseItemTrackingLine."Item No." := SourceReservEntry."Item No.";
WhseItemTrackingLine."Variant Code" := SourceReservEntry."Variant
Code";
WhseItemTrackingLine."Location Code" := SourceReservEntry."Location
Code";
WhseItemTrackingLine.Description := SourceReservEntry.Description;
WhseItemTrackingLine."Qty. per Unit of Measure" :=
SourceReservEntry."Qty. per Unit of Measure";
IF "Source Type" = DATABASE::"Prod. Order Component" THEN
WhseItemTrackingLine.SetSource("Source Type","Source
Subtype","Source No.","Source Subline No.",'',"Source Line No.")
ELSE
WhseItemTrackingLine.SetSource("Source Type","Source
Subtype","Source No.","Source Line No.",'',0);

WhseItemTrackingLine.CopyTrackingFromReservEntry(SourceReservEntry);
WhseItemTrackingLine."Quantity (Base)" := -
SourceReservEntry."Quantity (Base)";
IF "Qty. (Base)" = "Qty. to Handle (Base)" THEN
WhseItemTrackingLine."Qty. to Handle (Base)" :=
WhseItemTrackingLine."Quantity (Base)";
WhseItemTrackingLine."Qty. to Handle" :=
ROUND(
WhseItemTrackingLine."Qty. to Handle (Base)" /
WhseItemTrackingLine."Qty. per Unit of Measure",
UOMMgt.QtyRndPrecision);

OnBeforeWhseItemTrackingLineInsert(WhseItemTrackingLine,SourceReservEntry);
WhseItemTrackingLine.INSERT;
END;
END;
UNTIL SourceReservEntry.NEXT = 0;

TempWhseItemTrkgLine.RESET;
IF TempWhseItemTrkgLine.FINDSET THEN
REPEAT
IF TempWhseItemTrkgLine.TrackingExists AND
(TempWhseItemTrkgLine."Quantity Handled (Base)" = 0) THEN BEGIN
WhseItemTrackingLine.GET(TempWhseItemTrkgLine."Entry No.");
WhseItemTrackingLine.DELETE;
END;
UNTIL TempWhseItemTrkgLine.NEXT = 0;
END;
END;

[External]
[LineStart(4591)]
PROCEDURE CopyLotNoInformation@80(LotNoInfo@1000 : Record 6505;NewLotNo@1002 :
Code[50]);
VAR
NewLotNoInfo@1001 : Record 6505;
ConfirmManagement@1003 : Codeunit 27;
CommentType@1004 : ' ,Serial No.,Lot No.';
BEGIN
IF NewLotNoInfo.GET(LotNoInfo."Item No.",LotNoInfo."Variant Code",NewLotNo)
THEN BEGIN
IF NOT ConfirmManagement.ConfirmProcess(
STRSUBSTNO(
text008,LotNoInfo.TABLECAPTION,LotNoInfo.FIELDCAPTION("Lot
No."),NewLotNo),TRUE)
THEN
ERROR('');
NewLotNoInfo.TRANSFERFIELDS(LotNoInfo,FALSE);
NewLotNoInfo.MODIFY;
END ELSE BEGIN
NewLotNoInfo := LotNoInfo;
NewLotNoInfo."Lot No." := NewLotNo;
NewLotNoInfo.INSERT;
END;

CopyInfoComment(
CommentType::"Lot No.",
LotNoInfo."Item No.",
LotNoInfo."Variant Code",
LotNoInfo."Lot No.",
NewLotNo);
END;

[External]
[LineStart(4613)]
PROCEDURE CopySerialNoInformation@52(SerialNoInfo@1000 : Record
6504;NewSerialNo@1002 : Code[50]);
VAR
NewSerialNoInfo@1001 : Record 6504;
ConfirmManagement@1003 : Codeunit 27;
CommentType@1004 : ' ,Serial No.,Lot No.';
BEGIN
IF NewSerialNoInfo.GET(SerialNoInfo."Item No.",SerialNoInfo."Variant
Code",NewSerialNo) THEN BEGIN
IF NOT ConfirmManagement.ConfirmProcess(
STRSUBSTNO(
text008,SerialNoInfo.TABLECAPTION,SerialNoInfo.FIELDCAPTION("Serial
No."),NewSerialNo),TRUE)
THEN
ERROR('');
NewSerialNoInfo.TRANSFERFIELDS(SerialNoInfo,FALSE);
NewSerialNoInfo.MODIFY;
END ELSE BEGIN
NewSerialNoInfo := SerialNoInfo;
NewSerialNoInfo."Serial No." := NewSerialNo;
NewSerialNoInfo.INSERT;
END;

CopyInfoComment(
CommentType::"Serial No.",
SerialNoInfo."Item No.",
SerialNoInfo."Variant Code",
SerialNoInfo."Serial No.",
NewSerialNo);
END;

[LineStart(4635)]
LOCAL PROCEDURE CopyInfoComment@57(InfoType@1000 : ' ,Serial No.,Lot
No.';ItemNo@1001 : Code[20];VariantCode@1002 : Code[10];SerialLotNo@1003 :
Code[50];NewSerialLotNo@1004 : Code[50]);
VAR
ItemTrackingComment@1005 : Record 6506;
ItemTrackingComment1@1006 : Record 6506;
BEGIN
IF SerialLotNo = NewSerialLotNo THEN
EXIT;

ItemTrackingComment1.SETRANGE(Type,InfoType);
ItemTrackingComment1.SETRANGE("Item No.",ItemNo);
ItemTrackingComment1.SETRANGE("Variant Code",VariantCode);
ItemTrackingComment1.SETRANGE("Serial/Lot No.",NewSerialLotNo);

IF NOT ItemTrackingComment1.ISEMPTY THEN


ItemTrackingComment1.DELETEALL;

ItemTrackingComment.SETRANGE(Type,InfoType);
ItemTrackingComment.SETRANGE("Item No.",ItemNo);
ItemTrackingComment.SETRANGE("Variant Code",VariantCode);
ItemTrackingComment.SETRANGE("Serial/Lot No.",SerialLotNo);

IF ItemTrackingComment.ISEMPTY THEN
EXIT;

IF ItemTrackingComment.FINDSET THEN BEGIN


REPEAT
ItemTrackingComment1 := ItemTrackingComment;
ItemTrackingComment1."Serial/Lot No." := NewSerialLotNo;
ItemTrackingComment1.INSERT;
UNTIL ItemTrackingComment.NEXT = 0
END;
END;

[External]
[LineStart(4663)]
PROCEDURE GetLotSNDataSet@60(ItemNo@1000 : Code[20];Variant@1001 :
Code[20];LotNo@1002 : Code[50];SerialNo@1006 : Code[50];VAR ItemLedgEntry@1003 :
Record 32) : Boolean;
BEGIN
ItemLedgEntry.RESET;
ItemLedgEntry.SETCURRENTKEY("Item No.",Open,"Variant Code",Positive,"Lot
No.","Serial No.");

ItemLedgEntry.SETRANGE("Item No.",ItemNo);
ItemLedgEntry.SETRANGE(Open,TRUE);
ItemLedgEntry.SETRANGE("Variant Code",Variant);
IF LotNo <> '' THEN
ItemLedgEntry.SETRANGE("Lot No.",LotNo)
ELSE
IF SerialNo <> '' THEN
ItemLedgEntry.SETRANGE("Serial No.",SerialNo);
ItemLedgEntry.SETRANGE(Positive,TRUE);

IF ItemLedgEntry.FINDLAST THEN
EXIT(TRUE);

ItemLedgEntry.SETRANGE(Open);
EXIT(ItemLedgEntry.FINDLAST);
END;

[External]
[LineStart(4683)]
PROCEDURE ExistingExpirationDate@58(ItemNo@1002 : Code[20];Variant@1001 :
Code[20];LotNo@1000 : Code[50];SerialNo@1005 : Code[50];TestMultiple@1004 :
Boolean;VAR EntriesExist@1007 : Boolean) ExpDate : Date;
VAR
ItemLedgEntry@1003 : Record 32;
ItemTracingMgt@1008 : Codeunit 6520;
IsHandled@1006 : Boolean;
BEGIN
IsHandled := FALSE;

OnBeforeExistingExpirationDate(ItemNo,Variant,LotNo,SerialNo,TestMultiple,EntriesEx
ist,ExpDate,IsHandled);
IF IsHandled THEN
EXIT;

IF NOT GetLotSNDataSet(ItemNo,Variant,LotNo,SerialNo,ItemLedgEntry) THEN


BEGIN
EntriesExist := FALSE;
EXIT;
END;

EntriesExist := TRUE;
ExpDate := ItemLedgEntry."Expiration Date";

IF TestMultiple AND ItemTracingMgt.SpecificTracking(ItemNo,SerialNo,LotNo)


THEN BEGIN
ItemLedgEntry.SETFILTER("Expiration Date",'<>%1',ItemLedgEntry."Expiration
Date");
ItemLedgEntry.SETRANGE(Open,TRUE);
IF NOT ItemLedgEntry.ISEMPTY THEN
ERROR(Text007,LotNo);
END;
END;

[External]
[LineStart(4704)]
PROCEDURE ExistingExpirationDateAndQty@20(ItemNo@1002 : Code[20];Variant@1001 :
Code[20];LotNo@1000 : Code[50];SerialNo@1005 : Code[50];VAR SumOfEntries@1007 :
Decimal) ExpDate : Date;
VAR
ItemLedgEntry@1003 : Record 32;
IsHandled@1004 : Boolean;
BEGIN
IsHandled := FALSE;

OnBeforeExistingExpirationDateAndQty(ItemNo,Variant,LotNo,SerialNo,SumOfEntries,Exp
Date,IsHandled);
IF IsHandled THEN
EXIT;

SumOfEntries := 0;
IF NOT GetLotSNDataSet(ItemNo,Variant,LotNo,SerialNo,ItemLedgEntry) THEN
EXIT;

ExpDate := ItemLedgEntry."Expiration Date";


IF ItemLedgEntry.FINDSET THEN
REPEAT
SumOfEntries += ItemLedgEntry."Remaining Quantity";
UNTIL ItemLedgEntry.NEXT = 0;
END;

[External]
[LineStart(4720)]
PROCEDURE ExistingWarrantyDate@1002(ItemNo@1002 : Code[20];Variant@1001 :
Code[20];LotNo@1000 : Code[50];SerialNo@1005 : Code[50];VAR EntriesExist@1007 :
Boolean) WarDate : Date;
VAR
ItemLedgEntry@1003 : Record 32;
BEGIN
IF NOT GetLotSNDataSet(ItemNo,Variant,LotNo,SerialNo,ItemLedgEntry) THEN
EXIT;

EntriesExist := TRUE;
WarDate := ItemLedgEntry."Warranty Date";
END;

[External]
[LineStart(4727)]
PROCEDURE WhseExistingExpirationDate@56(ItemNo@1002 : Code[20];VariantCode@1001
: Code[20];Location@1006 : Record 14;LotNo@1000 : Code[50];SerialNo@1005 :
Code[50];VAR EntriesExist@1007 : Boolean) ExpDate : Date;
VAR
WhseEntry@1003 : Record 7312;
SumOfEntries@1009 : Decimal;
IsHandled@1004 : Boolean;
BEGIN
IsHandled := FALSE;

OnBeforeWhseExistingExpirationDate(ItemNo,VariantCode,Location,LotNo,SerialNo,Entri
esExist,ExpDate,IsHandled);
IF IsHandled THEN
EXIT;

ExpDate := 0D;
SumOfEntries := 0;

IF Location."Adjustment Bin Code" = '' THEN


EXIT;

WITH WhseEntry DO BEGIN


RESET;
SETCURRENTKEY("Item No.","Bin Code","Location Code","Variant Code","Unit of
Measure Code","Lot No.","Serial No.");
SETRANGE("Item No.",ItemNo);
SETRANGE("Bin Code",Location."Adjustment Bin Code");
SETRANGE("Location Code",Location.Code);
SETRANGE("Variant Code",VariantCode);
IF LotNo <> '' THEN
SETRANGE("Lot No.",LotNo)
ELSE
IF SerialNo <> '' THEN
SETRANGE("Serial No.",SerialNo);
IF ISEMPTY THEN
EXIT;

IF FINDSET THEN
REPEAT
SumOfEntries += "Qty. (Base)";
IF ("Expiration Date" <> 0D) AND (("Expiration Date" < ExpDate) OR
(ExpDate = 0D)) THEN
ExpDate := "Expiration Date";
UNTIL NEXT = 0;
END;

EntriesExist := SumOfEntries < 0;


END;

[LineStart(4764)]
LOCAL PROCEDURE WhseExistingWarrantyDate@94(ItemNo@1000 :
Code[20];VariantCode@1001 : Code[20];Location@1002 : Record 14;LotNo@1003 :
Code[50];SerialNo@1004 : Code[50];VAR EntriesExist@1005 : Boolean) WarDate : Date;
VAR
WhseEntry@1006 : Record 7312;
SumOfEntries@1007 : Decimal;
BEGIN
WarDate := 0D;
SumOfEntries := 0;

IF Location."Adjustment Bin Code" = '' THEN


EXIT;

WITH WhseEntry DO BEGIN


RESET;
SETCURRENTKEY("Item No.","Bin Code","Location Code","Variant Code","Unit of
Measure Code","Lot No.","Serial No.");
SETRANGE("Item No.",ItemNo);
SETRANGE("Bin Code",Location."Adjustment Bin Code");
SETRANGE("Location Code",Location.Code);
SETRANGE("Variant Code",VariantCode);
IF LotNo <> '' THEN
SETRANGE("Lot No.",LotNo)
ELSE
IF SerialNo <> '' THEN
SETRANGE("Serial No.",SerialNo);
IF ISEMPTY THEN
EXIT;

IF FINDSET THEN
REPEAT
SumOfEntries += "Qty. (Base)";
IF ("Warranty Date" <> 0D) AND (("Warranty Date" < WarDate) OR (WarDate
= 0D)) THEN
WarDate := "Warranty Date";
UNTIL NEXT = 0;
END;

EntriesExist := SumOfEntries < 0;


END;
[External]
[LineStart(4796)]
PROCEDURE GetWhseExpirationDate@73(ItemNo@1002 : Code[20];VariantCode@1001 :
Code[20];Location@1006 : Record 14;LotNo@1000 : Code[50];SerialNo@1005 :
Code[50];VAR ExpDate@1003 : Date) : Boolean;
VAR
EntriesExist@1004 : Boolean;
BEGIN
ExpDate :=
ExistingExpirationDate(ItemNo,VariantCode,LotNo,SerialNo,FALSE,EntriesExist);
IF EntriesExist THEN
EXIT(TRUE);

ExpDate :=
WhseExistingExpirationDate(ItemNo,VariantCode,Location,LotNo,SerialNo,EntriesExist)
;
IF EntriesExist THEN
EXIT(TRUE);

ExpDate := 0D;
EXIT(FALSE);
END;

[External]
[LineStart(4808)]
PROCEDURE GetWhseWarrantyDate@97(ItemNo@1000 : Code[20];VariantCode@1001 :
Code[20];Location@1002 : Record 14;LotNo@1003 : Code[50];SerialNo@1004 :
Code[50];VAR Wardate@1005 : Date) : Boolean;
VAR
EntriesExist@1006 : Boolean;
BEGIN
Wardate :=
ExistingWarrantyDate(ItemNo,VariantCode,LotNo,SerialNo,EntriesExist);
IF EntriesExist THEN
EXIT(TRUE);

Wardate :=
WhseExistingWarrantyDate(ItemNo,VariantCode,Location,LotNo,SerialNo,EntriesExist);
IF EntriesExist THEN
EXIT(TRUE);

Wardate := 0D;
EXIT(FALSE);
END;

[External]
[LineStart(4820)]
PROCEDURE SumNewLotOnTrackingSpec@81(VAR TempTrackingSpecification@1000 :
TEMPORARY Record 336) : Decimal;
VAR
TempTrackingSpecification2@1001 : Record 336;
SumLot@1002 : Decimal;
BEGIN
SumLot := 0;
TempTrackingSpecification2 := TempTrackingSpecification;
TempTrackingSpecification.SETRANGE("New Lot
No.",TempTrackingSpecification."New Lot No.");
IF TempTrackingSpecification.FINDSET THEN
REPEAT
SumLot += TempTrackingSpecification."Quantity (Base)";
UNTIL TempTrackingSpecification.NEXT = 0;
TempTrackingSpecification := TempTrackingSpecification2;
EXIT(SumLot);
END;

[External]
[LineStart(4831)]
PROCEDURE TestExpDateOnTrackingSpec@53(VAR TempTrackingSpecification@1000 :
TEMPORARY Record 336);
BEGIN
IF (TempTrackingSpecification."Lot No." = '') OR
(TempTrackingSpecification."Serial No." = '') THEN
EXIT;
TempTrackingSpecification.SETRANGE("Lot No.",TempTrackingSpecification."Lot
No.");
TempTrackingSpecification.SETFILTER("Expiration Date",'<>
%1',TempTrackingSpecification."Expiration Date");
IF NOT TempTrackingSpecification.ISEMPTY THEN
ERROR(Text007,TempTrackingSpecification."Lot No.");
TempTrackingSpecification.SETRANGE("Lot No.");
TempTrackingSpecification.SETRANGE("Expiration Date");
END;

[External]
[LineStart(4841)]
PROCEDURE TestExpDateOnTrackingSpecNew@54(VAR TempTrackingSpecification@1000 :
TEMPORARY Record 336);
BEGIN
IF TempTrackingSpecification."New Lot No." = '' THEN
EXIT;
TempTrackingSpecification.SETRANGE("New Lot
No.",TempTrackingSpecification."New Lot No.");
TempTrackingSpecification.SETFILTER("New Expiration Date",'<>
%1',TempTrackingSpecification."New Expiration Date");
IF NOT TempTrackingSpecification.ISEMPTY THEN
ERROR(Text007,TempTrackingSpecification."New Lot No.");
TempTrackingSpecification.SETRANGE("New Lot No.");
TempTrackingSpecification.SETRANGE("New Expiration Date");
END;

[External]
[LineStart(4851)]
PROCEDURE ItemTrackingOption@66(LotNo@1000 : Code[50];SerialNo@1001 : Code[50])
OptionValue : Integer;
BEGIN
IF LotNo <> '' THEN
OptionValue := 1;

IF SerialNo <> '' THEN BEGIN


IF LotNo <> '' THEN
OptionValue := 2
ELSE
OptionValue := 3;
END;
END;

[External]
[LineStart(4862)]
PROCEDURE CalcQtyBaseRegistered@110(VAR RegisteredWhseActivityLine@1001 :
Record 5773) : Decimal;
VAR
RegisteredWhseActivityLineForCalcBaseQty@1002 : Record 5773;
BEGIN

RegisteredWhseActivityLineForCalcBaseQty.COPYFILTERS(RegisteredWhseActivityLine);
WITH RegisteredWhseActivityLineForCalcBaseQty DO BEGIN
SETRANGE("Action Type","Action Type"::Place);
CALCSUMS("Qty. (Base)");
EXIT("Qty. (Base)");
END;
END;

[External]
[LineStart(4870)]
PROCEDURE CopyItemLedgEntryTrkgToSalesLn@70(VAR TempItemLedgEntryBuf@1000 :
TEMPORARY Record 32;ToSalesLine@1001 : Record 37;FillExactCostRevLink@1015 :
Boolean;VAR MissingExCostRevLink@1010 : Boolean;FromPricesInclVAT@1017 :
Boolean;ToPricesInclVAT@1009 : Boolean;FromShptOrRcpt@1020 : Boolean);
VAR
TempReservEntry@1003 : TEMPORARY Record 337;
ReservEntry@1004 : Record 337;
CopyDocMgt@1019 : Codeunit 6620;
ReservMgt@1007 : Codeunit 99000845;
ReservEngineMgt@1008 : Codeunit 99000831;
TotalCostLCY@1006 : Decimal;
ItemLedgEntryQty@1011 : Decimal;
QtyBase@1005 : Decimal;
SignFactor@1014 : Integer;
LinkThisEntry@1002 : Boolean;
EntriesExist@1012 : Boolean;
BEGIN
IF (ToSalesLine.Type <> ToSalesLine.Type::Item) OR (ToSalesLine.Quantity = 0)
THEN
EXIT;

IF FillExactCostRevLink THEN
FillExactCostRevLink := NOT ToSalesLine.IsShipment;

WITH TempItemLedgEntryBuf DO
IF FINDSET THEN BEGIN
IF Quantity / ToSalesLine.Quantity < 0 THEN
SignFactor := 1
ELSE
SignFactor := -1;
IF ToSalesLine.IsCreditDocType THEN
SignFactor := -SignFactor;

ReservMgt.SetSalesLine(ToSalesLine);
ReservMgt.DeleteReservEntries(TRUE,0);

REPEAT
LinkThisEntry := "Entry No." > 0;

IF FillExactCostRevLink THEN
QtyBase := "Shipped Qty. Not Returned" * SignFactor
ELSE
QtyBase := Quantity * SignFactor;
IF FillExactCostRevLink THEN
IF NOT LinkThisEntry THEN
MissingExCostRevLink := TRUE
ELSE
IF NOT MissingExCostRevLink THEN BEGIN
CALCFIELDS("Cost Amount (Actual)","Cost Amount (Expected)");
TotalCostLCY := TotalCostLCY + "Cost Amount (Expected)" + "Cost
Amount (Actual)";
ItemLedgEntryQty := ItemLedgEntryQty - Quantity;
END;

InsertReservEntryForSalesLine(

ReservEntry,TempItemLedgEntryBuf,ToSalesLine,QtyBase,FillExactCostRevLink AND
LinkThisEntry,EntriesExist);

TempReservEntry := ReservEntry;
TempReservEntry.INSERT;
UNTIL NEXT = 0;
ReservEngineMgt.UpdateOrderTracking(TempReservEntry);

IF FillExactCostRevLink AND NOT MissingExCostRevLink THEN BEGIN


ToSalesLine.VALIDATE(
"Unit Cost (LCY)",ABS(TotalCostLCY / ItemLedgEntryQty) *
ToSalesLine."Qty. per Unit of Measure");
IF NOT FromShptOrRcpt THEN

CopyDocMgt.CalculateRevSalesLineAmount(ToSalesLine,ItemLedgEntryQty,FromPricesInclV
AT,ToPricesInclVAT);
ToSalesLine.MODIFY;
END;
END;
END;

[External]
[LineStart(4924)]
PROCEDURE CopyItemLedgEntryTrkgToPurchLn@71(VAR ItemLedgEntryBuf@1000 : Record
32;ToPurchLine@1001 : Record 39;FillExactCostRevLink@1015 : Boolean;VAR
MissingExCostRevLink@1010 : Boolean;FromPricesInclVAT@1017 :
Boolean;ToPricesInclVAT@1013 : Boolean;FromShptOrRcpt@1018 : Boolean);
VAR
ItemLedgEntry@1012 : Record 32;
CopyDocMgt@1011 : Codeunit 6620;
ReservMgt@1007 : Codeunit 99000845;
TotalCostLCY@1006 : Decimal;
ItemLedgEntryQty@1002 : Decimal;
QtyBase@1005 : Decimal;
SignFactor@1003 : Integer;
LinkThisEntry@1009 : Boolean;
EntriesExist@1008 : Boolean;
BEGIN
IF (ToPurchLine.Type <> ToPurchLine.Type::Item) OR (ToPurchLine.Quantity = 0)
THEN
EXIT;

IF FillExactCostRevLink THEN
FillExactCostRevLink := ToPurchLine.Signed(ToPurchLine."Quantity (Base)") <
0;
IF FillExactCostRevLink THEN
IF (ToPurchLine."Document Type" IN [ToPurchLine."Document
Type"::Invoice,ToPurchLine."Document Type"::"Credit Memo"]) AND
(ToPurchLine."Job No." <> '')
THEN
FillExactCostRevLink := FALSE;

WITH ItemLedgEntryBuf DO
IF FINDSET THEN BEGIN
IF Quantity / ToPurchLine.Quantity > 0 THEN
SignFactor := 1
ELSE
SignFactor := -1;
IF ToPurchLine."Document Type" IN
[ToPurchLine."Document Type"::"Return Order",ToPurchLine."Document
Type"::"Credit Memo"]
THEN
SignFactor := -SignFactor;

IF ToPurchLine."Expected Receipt Date" = 0D THEN


ToPurchLine."Expected Receipt Date" := WORKDATE;
ToPurchLine."Outstanding Qty. (Base)" := ToPurchLine."Quantity (Base)";
ReservMgt.SetPurchLine(ToPurchLine);
ReservMgt.DeleteReservEntries(TRUE,0);

REPEAT
LinkThisEntry := "Entry No." > 0;

IF FillExactCostRevLink THEN
IF NOT LinkThisEntry THEN
MissingExCostRevLink := TRUE
ELSE
IF NOT MissingExCostRevLink THEN BEGIN
CALCFIELDS("Cost Amount (Actual)","Cost Amount (Expected)");
TotalCostLCY := TotalCostLCY + "Cost Amount (Expected)" + "Cost
Amount (Actual)";
ItemLedgEntryQty := ItemLedgEntryQty - Quantity;
END;

IF LinkThisEntry AND ("Lot No." = '') THEN


// The check for Lot No = '' is to avoid changing the remaining
quantity for partly sold Lots
// because this will cause undefined quantities in the item tracking
"Remaining Quantity" := Quantity;
IF ToPurchLine."Job No." = '' THEN
QtyBase := "Remaining Quantity" * SignFactor
ELSE BEGIN
ItemLedgEntry.GET("Entry No.");
QtyBase := ABS(ItemLedgEntry.Quantity) * SignFactor;
END;

InsertReservEntryForPurchLine(
ItemLedgEntryBuf,ToPurchLine,QtyBase,FillExactCostRevLink AND
LinkThisEntry,EntriesExist);
UNTIL NEXT = 0;

IF FillExactCostRevLink AND NOT MissingExCostRevLink THEN BEGIN


ToPurchLine.VALIDATE(
"Unit Cost (LCY)",
ABS(TotalCostLCY / ItemLedgEntryQty) * ToPurchLine."Qty. per Unit of
Measure");
IF NOT FromShptOrRcpt THEN
CopyDocMgt.CalculateRevPurchLineAmount(
ToPurchLine,ItemLedgEntryQty,FromPricesInclVAT,ToPricesInclVAT);

ToPurchLine.MODIFY;
END;
END;
END;

[External]
[LineStart(4994)]
PROCEDURE SynchronizeWhseActivItemTrkg@74(WhseActivLine@1000 : Record 5767);
VAR
TempTrackingSpec@1002 : TEMPORARY Record 336;
TempReservEntry@1005 : TEMPORARY Record 337;
ReservEntry@1008 : Record 337;
ReservEntryBindingCheck@1013 : Record 337;
ATOSalesLine@1004 : Record 37;
AsmHeader@1010 : Record 900;
ItemTrackingMgt@1007 : Codeunit 6500;
SignFactor@1001 : Integer;
ToRowID@1006 : Text[250];
IsTransferReceipt@1012 : Boolean;
IsATOPosting@1003 : Boolean;
IsBindingOrderToOrder@1011 : Boolean;
BEGIN
// Used for carrying the item tracking from the invt. pick/put-away to the
parent line.
WITH WhseActivLine DO BEGIN
RESET;
SetSourceFilter("Source Type","Source Subtype","Source No.","Source Line
No.","Source Subline No.",TRUE);
SETRANGE("Assemble to Order","Assemble to Order");
IF FINDSET THEN BEGIN
// Transfer receipt needs special treatment:
IsTransferReceipt := ("Source Type" = DATABASE::"Transfer Line") AND
("Source Subtype" = 1);
IsATOPosting := ("Source Type" = DATABASE::"Sales Line") AND "Assemble to
Order";
IF ("Source Type" IN [DATABASE::"Prod. Order Line",DATABASE::"Prod. Order
Component"]) OR IsTransferReceipt THEN
ToRowID :=
ItemTrackingMgt.ComposeRowID(
"Source Type","Source Subtype","Source No.",'',"Source Line
No.","Source Subline No.")
ELSE BEGIN
IF IsATOPosting THEN BEGIN
ATOSalesLine.GET("Source Subtype","Source No.","Source Line No.");
ATOSalesLine.AsmToOrderExists(AsmHeader);
ToRowID :=
ItemTrackingMgt.ComposeRowID(
DATABASE::"Assembly Header",AsmHeader."Document
Type",AsmHeader."No.",'',0,0);
END ELSE
ToRowID :=
ItemTrackingMgt.ComposeRowID(
"Source Type","Source Subtype","Source No.",'',"Source Subline
No.","Source Line No.");
END;
TempReservEntry.SetPointer(ToRowID);
SignFactor := WhseActivitySignFactor(WhseActivLine);
ReservEntryBindingCheck.SetPointer(ToRowID);
ReservEntryBindingCheck.SetPointerFilter;
REPEAT
IF TrackingExists THEN BEGIN
TempReservEntry."Entry No." += 1;
TempReservEntry.Positive := SignFactor > 0;
TempReservEntry."Item No." := "Item No.";
TempReservEntry."Location Code" := "Location Code";
TempReservEntry.Description := Description;
TempReservEntry."Variant Code" := "Variant Code";
TempReservEntry."Quantity (Base)" := "Qty. Outstanding (Base)" *
SignFactor;
TempReservEntry.Quantity := "Qty. Outstanding" * SignFactor;
TempReservEntry."Qty. to Handle (Base)" := "Qty. to Handle (Base)" *
SignFactor;
TempReservEntry."Qty. to Invoice (Base)" := "Qty. to Handle (Base)" *
SignFactor;
TempReservEntry."Qty. per Unit of Measure" := "Qty. per Unit of
Measure";
TempReservEntry.CopyTrackingFromWhseActivLine(WhseActivLine);

OnSyncActivItemTrkgOnBeforeInsertTempReservEntry(TempReservEntry,WhseActivLine);
TempReservEntry.INSERT;

IF NOT IsBindingOrderToOrder THEN BEGIN


ReservEntryBindingCheck.SetTrackingFilter("Serial No.","Lot No.");

ReservEntryBindingCheck.SETRANGE(Binding,ReservEntryBindingCheck.Binding::"Order-
to-Order");
IsBindingOrderToOrder := NOT ReservEntryBindingCheck.ISEMPTY;
END;
END;
UNTIL NEXT = 0;

IF TempReservEntry.ISEMPTY THEN
EXIT;
END;
END;

SumUpItemTracking(TempReservEntry,TempTrackingSpec,FALSE,TRUE);

IF TempTrackingSpec.FINDSET THEN
REPEAT
ReservEntry.SetSourceFilter(
TempTrackingSpec."Source Type",TempTrackingSpec."Source Subtype",
TempTrackingSpec."Source ID",TempTrackingSpec."Source Ref. No.",TRUE);
ReservEntry.SetSourceFilter2('',TempTrackingSpec."Source Prod. Order
Line");
ReservEntry.SetTrackingFilterFromSpec(TempTrackingSpec);
IF IsTransferReceipt THEN
ReservEntry.SETRANGE("Source Ref. No.");
IF ReservEntry.FINDSET THEN BEGIN
REPEAT
IF ABS(TempTrackingSpec."Qty. to Handle (Base)") >
ABS(ReservEntry."Quantity (Base)") THEN
ReservEntry.VALIDATE("Qty. to Handle (Base)",ReservEntry."Quantity
(Base)")
ELSE
ReservEntry.VALIDATE("Qty. to Handle (Base)",TempTrackingSpec."Qty.
to Handle (Base)");

IF ABS(TempTrackingSpec."Qty. to Invoice (Base)") >


ABS(ReservEntry."Quantity (Base)") THEN
ReservEntry.VALIDATE("Qty. to Invoice (Base)",ReservEntry."Quantity
(Base)")
ELSE
ReservEntry.VALIDATE("Qty. to Invoice
(Base)",TempTrackingSpec."Qty. to Invoice (Base)");

TempTrackingSpec."Qty. to Handle (Base)" -= ReservEntry."Qty. to


Handle (Base)";
TempTrackingSpec."Qty. to Invoice (Base)" -= ReservEntry."Qty. to
Invoice (Base)";
TempTrackingSpec.MODIFY;

WITH WhseActivLine DO BEGIN


RESET;
SetSourceFilter("Source Type","Source Subtype","Source No.","Source
Line No.","Source Subline No.",TRUE);
SetTrackingFilter(ReservEntry."Serial No.",ReservEntry."Lot No.");
IF FINDFIRST THEN
ReservEntry."Expiration Date" := "Expiration Date";

OnSynchronizeWhseActivItemTrkgOnAfterSetExpirationDate(WhseActivLine,ReservEntry);
END;

ReservEntry.MODIFY;

IF IsReservedFromTransferShipment(ReservEntry) THEN
UpdateItemTrackingInTransferReceipt(ReservEntry);
UNTIL ReservEntry.NEXT = 0;

IF (TempTrackingSpec."Qty. to Handle (Base)" = 0) AND


(TempTrackingSpec."Qty. to Invoice (Base)" = 0) THEN
TempTrackingSpec.DELETE
ELSE
ERROR(CannotMatchItemTrackingErr);
END;
UNTIL TempTrackingSpec.NEXT = 0;

IF TempTrackingSpec.FINDSET THEN
REPEAT
TempTrackingSpec."Quantity (Base)" := ABS(TempTrackingSpec."Qty. to
Handle (Base)");
TempTrackingSpec."Qty. to Handle (Base)" := ABS(TempTrackingSpec."Qty. to
Handle (Base)");
TempTrackingSpec."Qty. to Invoice (Base)" := ABS(TempTrackingSpec."Qty.
to Invoice (Base)");
TempTrackingSpec.MODIFY;
UNTIL TempTrackingSpec.NEXT = 0;

RegisterNewItemTrackingLines(TempTrackingSpec);
END;
[LineStart(5113)]
LOCAL PROCEDURE RegisterNewItemTrackingLines@123(VAR TempTrackingSpec@1000 :
TEMPORARY Record 336);
VAR
TrackingSpec@1001 : Record 336;
ItemTrackingLines@1002 : Page 6510;
BEGIN
IF TempTrackingSpec.FINDSET THEN
REPEAT
TempTrackingSpec.SetSourceFilter(
TempTrackingSpec."Source Type",TempTrackingSpec."Source Subtype",
TempTrackingSpec."Source ID",TempTrackingSpec."Source Ref. No.",FALSE);
TempTrackingSpec.SETRANGE("Source Prod. Order
Line",TempTrackingSpec."Source Prod. Order Line");

TrackingSpec := TempTrackingSpec;
TempTrackingSpec.CALCSUMS("Qty. to Handle (Base)");

TrackingSpec."Quantity (Base)" :=
TempTrackingSpec."Qty. to Handle (Base)" +
ABS(ItemTrkgQtyPostedOnSource(TrackingSpec));

CLEAR(ItemTrackingLines);
ItemTrackingLines.SetCalledFromSynchWhseItemTrkg(TRUE);

ItemTrackingLines.RegisterItemTrackingLines(TrackingSpec,TrackingSpec."Creation
Date",TempTrackingSpec);
TempTrackingSpec.ClearSourceFilter;
UNTIL TempTrackingSpec.NEXT = 0;
END;

[LineStart(5133)]
LOCAL PROCEDURE WhseActivitySignFactor@111(WhseActivityLine@1102601000 : Record
5767) : Integer;
BEGIN
IF WhseActivityLine."Activity Type" = WhseActivityLine."Activity
Type"::"Invt. Pick" THEN BEGIN
IF WhseActivityLine."Assemble to Order" THEN
EXIT(1);
EXIT(-1);
END;
IF WhseActivityLine."Activity Type" = WhseActivityLine."Activity
Type"::"Invt. Put-away" THEN
EXIT(1);

ERROR(Text011,WhseActivityLine.FIELDCAPTION("Activity
Type"),WhseActivityLine."Activity Type");
END;

[External]
[LineStart(5144)]
PROCEDURE RetrieveAppliedExpirationDate@77(VAR TempItemLedgEntry@1000 :
TEMPORARY Record 32);
VAR
ItemLedgEntry@1002 : Record 32;
ItemApplnEntry@1001 : Record 339;
BEGIN
OnBeforeRetrieveAppliedExpirationDate(TempItemLedgEntry);
WITH TempItemLedgEntry DO BEGIN
IF Positive THEN
EXIT;

ItemApplnEntry.RESET;
ItemApplnEntry.SETCURRENTKEY("Outbound Item Entry No.","Item Ledger Entry
No.","Cost Application");
ItemApplnEntry.SETRANGE("Outbound Item Entry No.","Entry No.");
ItemApplnEntry.SETRANGE("Item Ledger Entry No.","Entry No.");
IF ItemApplnEntry.FINDFIRST THEN BEGIN
ItemLedgEntry.GET(ItemApplnEntry."Inbound Item Entry No.");
"Expiration Date" := ItemLedgEntry."Expiration Date";
END;
END;

OnAfterRetrieveAppliedExpirationDate(TempItemLedgEntry,ItemApplnEntry);
END;

[LineStart(5163)]
LOCAL PROCEDURE ItemTrkgQtyPostedOnSource@78(SourceTrackingSpec@1001 : Record
336) Qty : Decimal;
VAR
TrackingSpecification@1000 : Record 336;
ReservEntry@1002 : Record 337;
TransferLine@1003 : Record 5741;
BEGIN
WITH SourceTrackingSpec DO BEGIN
TrackingSpecification.SetSourceFilter("Source Type","Source
Subtype","Source ID","Source Ref. No.",TRUE);
TrackingSpecification.SetSourceFilter2("Source Batch Name","Source Prod.
Order Line");
IF NOT TrackingSpecification.ISEMPTY THEN BEGIN
TrackingSpecification.FINDSET;
REPEAT
Qty += TrackingSpecification."Quantity (Base)";
UNTIL TrackingSpecification.NEXT = 0;
END;

ReservEntry.SetSourceFilter("Source Type","Source Subtype","Source


ID","Source Ref. No.",FALSE);
ReservEntry.SetSourceFilter2('',"Source Prod. Order Line");
IF NOT ReservEntry.ISEMPTY THEN BEGIN
ReservEntry.FINDSET;
REPEAT
Qty += ReservEntry."Qty. to Handle (Base)";
UNTIL ReservEntry.NEXT = 0;
END;
IF "Source Type" = DATABASE::"Transfer Line" THEN BEGIN
TransferLine.GET("Source ID","Source Ref. No.");
Qty -= TransferLine."Qty. Shipped (Base)";
END;
END;
END;

[LineStart(5188)]
LOCAL PROCEDURE UpdateItemTrackingInTransferReceipt@59(FromReservEntry@1001 :
Record 337);
VAR
ToReservEntry@1000 : Record 337;
ToRowID@1002 : Text[250];
BEGIN
ToRowID := ComposeRowID(
DATABASE::"Transfer Line",1,FromReservEntry."Source ID",
FromReservEntry."Source Batch Name",FromReservEntry."Source Prod. Order
Line",FromReservEntry."Source Ref. No.");
ToReservEntry.SetPointer(ToRowID);
ToReservEntry.SetPointerFilter;
SynchronizeItemTrkgTransfer(ToReservEntry);
END;

[LineStart(5196)]
LOCAL PROCEDURE SynchronizeItemTrkgTransfer@88(VAR ReservEntry@1000 : Record
337);
VAR
FromReservEntry@1001 : Record 337;
ToReservEntry@1006 : Record 337;
TempToReservEntry@1002 : TEMPORARY Record 337;
TempTrackingSpecification@1007 : TEMPORARY Record 336;
BEGIN
FromReservEntry.COPY(ReservEntry);
FromReservEntry.SETRANGE("Source Subtype",0);

ToReservEntry.COPY(ReservEntry);
ToReservEntry.SETRANGE("Source Subtype",1);
IF ToReservEntry.FINDSET THEN
REPEAT
TempToReservEntry := ToReservEntry;
TempToReservEntry."Qty. to Handle (Base)" := 0;
TempToReservEntry."Qty. to Invoice (Base)" := 0;
TempToReservEntry.INSERT;
UNTIL ToReservEntry.NEXT = 0;
IF TempToReservEntry.ISEMPTY THEN
EXIT;

SumUpItemTracking(FromReservEntry,TempTrackingSpecification,FALSE,TRUE);
TempTrackingSpecification.RESET;
TempTrackingSpecification.SETFILTER("Qty. to Handle (Base)",'<%1',0);
IF TempTrackingSpecification.FINDSET THEN
REPEAT
ToReservEntry.SETRANGE("Lot No.",TempTrackingSpecification."Lot No.");
ToReservEntry.SETRANGE("Serial No.",TempTrackingSpecification."Serial
No.");
ToReservEntry.MODIFYALL("Qty. to Handle (Base)",0);
ToReservEntry.MODIFYALL("Qty. to Invoice (Base)",0);

TempTrackingSpecification."Qty. to Handle (Base)" *= -1;

TempToReservEntry.SETCURRENTKEY(
"Item No.","Variant Code","Location Code","Item Tracking","Reservation
Status","Lot No.","Serial No.");
TempToReservEntry.SETRANGE("Lot No.",TempTrackingSpecification."Lot
No.");
TempToReservEntry.SETRANGE("Serial No.",TempTrackingSpecification."Serial
No.");
IF TempToReservEntry.FINDSET THEN
REPEAT
IF TempToReservEntry."Quantity (Base)" <
TempTrackingSpecification."Qty. to Handle (Base)" THEN BEGIN
TempToReservEntry."Qty. to Handle (Base)" :=
TempToReservEntry."Quantity (Base)";
TempTrackingSpecification."Qty. to Handle (Base)" -=
TempToReservEntry."Quantity (Base)";
TempToReservEntry."Qty. to Invoice (Base)" :=
TempToReservEntry."Quantity (Base)";
END ELSE BEGIN
TempToReservEntry."Qty. to Handle (Base)" :=
TempTrackingSpecification."Qty. to Handle (Base)";
TempTrackingSpecification."Qty. to Handle (Base)" := 0;
TempToReservEntry."Qty. to Invoice (Base)" :=
TempTrackingSpecification."Qty. to Handle (Base)";
END;

ToReservEntry.GET(TempToReservEntry."Entry
No.",TempToReservEntry.Positive);
ToReservEntry."Qty. to Handle (Base)" := TempToReservEntry."Qty. to
Handle (Base)";
ToReservEntry."Qty. to Invoice (Base)" := TempToReservEntry."Qty. to
Handle (Base)";
ToReservEntry.MODIFY;
UNTIL (TempToReservEntry.NEXT = 0) OR (TempTrackingSpecification."Qty.
to Handle (Base)" = 0);
ReservEntry.GET(ToReservEntry."Entry No.",ToReservEntry.Positive);

UNTIL TempTrackingSpecification.NEXT = 0;
END;

[External]
[LineStart(5249)]
PROCEDURE InitCollectItemTrkgInformation@87();
BEGIN
TempGlobalWhseItemTrkgLine.DELETEALL;
END;

[External]
[LineStart(5252)]
PROCEDURE CollectItemTrkgInfWhseJnlLine@86(WhseJnlLine@1000 : Record 7311);
VAR
WhseItemTrackingLine@1001 : Record 6550;
BEGIN
WITH WhseItemTrackingLine DO BEGIN
SetSourceFilter(
DATABASE::"Warehouse Journal Line",-1,WhseJnlLine."Journal Batch
Name",WhseJnlLine."Line No.",TRUE);
SetSourceFilter2(WhseJnlLine."Journal Template Name",-1);
SETRANGE("Location Code",WhseJnlLine."Location Code");
SETRANGE("Item No.",WhseJnlLine."Item No.");
SETRANGE("Variant Code",WhseJnlLine."Variant Code");
SETRANGE("Qty. per Unit of Measure",WhseJnlLine."Qty. per Unit of
Measure");
IF FINDSET THEN
REPEAT
CLEAR(TempGlobalWhseItemTrkgLine);
TempGlobalWhseItemTrkgLine := WhseItemTrackingLine;
IF TempGlobalWhseItemTrkgLine.INSERT THEN;
UNTIL NEXT = 0;
END;
END;

[External]
[LineStart(5269)]
PROCEDURE CheckItemTrkgInfBeforePost@89();
VAR
TempLotNoInfo@1000 : TEMPORARY Record 6505;
CheckExpDate@1001 : Date;
ErrorFound@1002 : Boolean;
EndLoop@1003 : Boolean;
ErrMsgTxt@1004 : Text[160];
BEGIN
// Check for different expiration dates within one Lot no.
IF TempGlobalWhseItemTrkgLine.FIND('-') THEN BEGIN
TempLotNoInfo.DELETEALL;
REPEAT
IF TempGlobalWhseItemTrkgLine."New Lot No." <> '' THEN BEGIN
CLEAR(TempLotNoInfo);
TempLotNoInfo."Item No." := TempGlobalWhseItemTrkgLine."Item No.";
TempLotNoInfo."Variant Code" := TempGlobalWhseItemTrkgLine."Variant
Code";
TempLotNoInfo."Lot No." := TempGlobalWhseItemTrkgLine."New Lot No.";

OnCheckItemTrkgInfBeforePostOnBeforeTempItemLotInfoInsert(TempLotNoInfo,TempGlobalW
hseItemTrkgLine);
IF TempLotNoInfo.INSERT THEN;
END;
UNTIL TempGlobalWhseItemTrkgLine.NEXT = 0;

IF TempLotNoInfo.FIND('-') THEN
REPEAT
ErrorFound := FALSE;
EndLoop := FALSE;
IF TempGlobalWhseItemTrkgLine.FIND('-') THEN BEGIN
CheckExpDate := 0D;
REPEAT
IF (TempGlobalWhseItemTrkgLine."Item No." = TempLotNoInfo."Item
No.") AND
(TempGlobalWhseItemTrkgLine."Variant Code" =
TempLotNoInfo."Variant Code") AND
(TempGlobalWhseItemTrkgLine."New Lot No." = TempLotNoInfo."Lot
No.")
THEN
IF CheckExpDate = 0D THEN
CheckExpDate := TempGlobalWhseItemTrkgLine."New Expiration
Date"
ELSE
IF TempGlobalWhseItemTrkgLine."New Expiration Date" <>
CheckExpDate THEN BEGIN
ErrorFound := TRUE;
ErrMsgTxt :=
STRSUBSTNO(Text012,
TempGlobalWhseItemTrkgLine."Lot No.",
TempGlobalWhseItemTrkgLine."New Expiration Date",
CheckExpDate);
END;
IF NOT ErrorFound THEN
IF TempGlobalWhseItemTrkgLine.NEXT = 0 THEN
EndLoop := TRUE;
UNTIL EndLoop OR ErrorFound;
END;
UNTIL (TempLotNoInfo.NEXT = 0) OR ErrorFound;
IF ErrorFound THEN
ERROR(ErrMsgTxt);
END;
END;

[External]
[LineStart(5316)]
PROCEDURE SetPick@90(IsPick2@1000 : Boolean);
BEGIN
IsPick := IsPick2;
END;

[External]
[LineStart(5319)]
PROCEDURE StrictExpirationPosting@32(ItemNo@1000 : Code[20]) : Boolean;
VAR
Item@1001 : Record 27;
ItemTrackingCode@1002 : Record 6502;
BEGIN
Item.GET(ItemNo);
IF Item."Item Tracking Code" = '' THEN
EXIT(FALSE);
ItemTrackingCode.GET(Item."Item Tracking Code");
EXIT(ItemTrackingCode."Strict Expiration Posting");
END;

[External]
[LineStart(5326)]
PROCEDURE WhseItemTrkgLineExists@109(SourceId@1000 : Code[20];SourceType@1001 :
Integer;SourceSubtype@1002 : Integer;SourceBatchName@1003 :
Code[10];SourceProdOrderLine@1004 : Integer;SourceRefNo@1005 :
Integer;LocationCode@1006 : Code[10];SerialNo@1007 : Code[50];LotNo@1008 :
Code[50]) : Boolean;
VAR
WhseItemTrkgLine@1009 : Record 6550;
BEGIN
WITH WhseItemTrkgLine DO BEGIN
SetSourceFilter(SourceType,SourceSubtype,SourceId,SourceRefNo,TRUE);
SetSourceFilter2(SourceBatchName,SourceProdOrderLine);
SETRANGE("Location Code",LocationCode);
IF SerialNo <> '' THEN
SETRANGE("Serial No.",SerialNo);
IF LotNo <> '' THEN
SETRANGE("Lot No.",LotNo);
EXIT(NOT ISEMPTY);
END;
END;

[LineStart(5338)]
LOCAL PROCEDURE SetWhseSerialLotNo@113(VAR DestNo@1000 : Code[50];SourceNo@1001
: Code[50];NoRequired@1002 : Boolean);
BEGIN
IF NoRequired THEN
DestNo := SourceNo;
END;
[LineStart(5342)]
LOCAL PROCEDURE
InsertProspectReservEntryFromItemEntryRelationAndSourceData@10(VAR
ItemEntryRelation@1001 : Record 6507;SourceSubtype@1002 : Option;SourceID@1003 :
Code[20];SourceRefNo@1004 : Integer);
VAR
TrackingSpecification@1000 : Record 336;
QtyBase@1005 : Decimal;
BEGIN
IF NOT ItemEntryRelation.FINDSET THEN
EXIT;

REPEAT
TrackingSpecification.GET(ItemEntryRelation."Item Entry No.");
QtyBase := TrackingSpecification."Quantity (Base)" -
TrackingSpecification."Quantity Invoiced (Base)";
InsertReservEntryFromTrackingSpec(
TrackingSpecification,SourceSubtype,SourceID,SourceRefNo,QtyBase);
UNTIL ItemEntryRelation.NEXT = 0;
END;

[External]
[LineStart(5353)]
PROCEDURE UpdateQuantities@116(WhseWorksheetLine@1006 : Record 7326;VAR
TotalWhseItemTrackingLine@1008 : Record 6550;VAR SourceQuantityArray@1001 : ARRAY
[2] OF Decimal;VAR UndefinedQtyArray@1007 : ARRAY [2] OF Decimal;SourceType@1002 :
Integer) : Boolean;
BEGIN
SourceQuantityArray[1] := ABS(WhseWorksheetLine."Qty. (Base)");
SourceQuantityArray[2] := ABS(WhseWorksheetLine."Qty. to Handle (Base)");

EXIT(CalculateSums(WhseWorksheetLine,TotalWhseItemTrackingLine,SourceQuantityArray,
UndefinedQtyArray,SourceType));
END;

[LineStart(5358)]
LOCAL PROCEDURE TableSignFactor@1100225004(TableNo@1000 : Integer) : Integer;
BEGIN
IF TableNo IN [
DATABASE::"Sales Line",
DATABASE::"Sales Shipment Line",
DATABASE::"Sales Invoice Line",
DATABASE::"Purch. Cr. Memo Line",
DATABASE::"Prod. Order Component",
DATABASE::"Transfer Shipment Line",
DATABASE::"Return Shipment Line",
DATABASE::"Planning Component",
DATABASE::"Posted Assembly Line",
DATABASE::"Service Line",
DATABASE::"Service Shipment Line",
DATABASE::"Service Invoice Line"]
THEN
EXIT(-1);

EXIT(1);
END;

[LineStart(5377)]
LOCAL PROCEDURE AddTempRecordToSet@1100225003(VAR TempItemLedgEntry@1000 :
TEMPORARY Record 32;SignFactor@1002 : Integer);
VAR
TempItemLedgEntry2@1001 : TEMPORARY Record 32;
BEGIN
IF SignFactor <> 1 THEN BEGIN
TempItemLedgEntry.Quantity *= SignFactor;
TempItemLedgEntry."Remaining Quantity" *= SignFactor;
TempItemLedgEntry."Invoiced Quantity" *= SignFactor;
END;
RetrieveAppliedExpirationDate(TempItemLedgEntry);
TempItemLedgEntry2 := TempItemLedgEntry;
TempItemLedgEntry.RESET;
TempItemLedgEntry.SETRANGE("Serial No.",TempItemLedgEntry2."Serial No.");
TempItemLedgEntry.SETRANGE("Lot No.",TempItemLedgEntry2."Lot No.");
TempItemLedgEntry.SETRANGE("Warranty Date",TempItemLedgEntry2."Warranty
Date");
TempItemLedgEntry.SETRANGE("Expiration Date",TempItemLedgEntry2."Expiration
Date");
IF TempItemLedgEntry.FINDFIRST THEN BEGIN
TempItemLedgEntry.Quantity += TempItemLedgEntry2.Quantity;
TempItemLedgEntry."Remaining Quantity" += TempItemLedgEntry2."Remaining
Quantity";
TempItemLedgEntry."Invoiced Quantity" += TempItemLedgEntry2."Invoiced
Quantity";
TempItemLedgEntry.MODIFY;
END ELSE
TempItemLedgEntry.INSERT;

TempItemLedgEntry.RESET;
END;

[External]
[LineStart(5400)]
PROCEDURE CalculateSums@115(WhseWorksheetLine@1005 : Record 7326;VAR
TotalWhseItemTrackingLine@1003 : Record 6550;SourceQuantityArray@1001 : ARRAY [2]
OF Decimal;VAR UndefinedQtyArray@1002 : ARRAY [2] OF Decimal;SourceType@1004 :
Integer) : Boolean;
BEGIN
WITH TotalWhseItemTrackingLine DO BEGIN
SETRANGE("Location Code",WhseWorksheetLine."Location Code");
CASE SourceType OF
DATABASE::"Posted Whse. Receipt Line",
DATABASE::"Warehouse Shipment Line",
DATABASE::"Whse. Internal Put-away Line",
DATABASE::"Whse. Internal Pick Line",
DATABASE::"Assembly Line",
DATABASE::"Internal Movement Line":
SetSourceFilter(
SourceType,-1,WhseWorksheetLine."Whse. Document
No.",WhseWorksheetLine."Whse. Document Line No.",TRUE);
DATABASE::"Prod. Order Component":
BEGIN
SetSourceFilter(
SourceType,WhseWorksheetLine."Source
Subtype",WhseWorksheetLine."Source No.",WhseWorksheetLine."Source Subline No.",
TRUE);
SETRANGE("Source Prod. Order Line",WhseWorksheetLine."Source Line
No.");
END;
DATABASE::"Whse. Worksheet Line",
DATABASE::"Warehouse Journal Line":
BEGIN
SetSourceFilter(SourceType,-
1,WhseWorksheetLine.Name,WhseWorksheetLine."Line No.",TRUE);
SETRANGE("Source Batch Name",WhseWorksheetLine."Worksheet Template
Name");
END;
END;
CALCSUMS("Quantity (Base)","Qty. to Handle (Base)");
END;

EXIT(UpdateUndefinedQty(TotalWhseItemTrackingLine,SourceQuantityArray,UndefinedQtyA
rray));
END;

[External]
[LineStart(5430)]
PROCEDURE UpdateUndefinedQty@114(TotalWhseItemTrackingLine@1004 : Record
6550;SourceQuantityArray@1002 : ARRAY [2] OF Decimal;VAR UndefinedQtyArray@1003 :
ARRAY [2] OF Decimal) : Boolean;
BEGIN
UndefinedQtyArray[1] := SourceQuantityArray[1] -
TotalWhseItemTrackingLine."Quantity (Base)";
UndefinedQtyArray[2] := SourceQuantityArray[2] -
TotalWhseItemTrackingLine."Qty. to Handle (Base)";
EXIT(NOT (ABS(SourceQuantityArray[1]) <
ABS(TotalWhseItemTrackingLine."Quantity (Base)")));
END;

[LineStart(5435)]
LOCAL PROCEDURE InsertReservEntryForSalesLine@12(VAR ReservEntry@1006 : Record
337;ItemLedgEntryBuf@1004 : Record 32;SalesLine@1003 : Record 37;QtyBase@1002 :
Decimal;AppliedFromItemEntry@1001 : Boolean;VAR EntriesExist@1000 : Boolean);
BEGIN
IF QtyBase = 0 THEN
EXIT;

WITH ReservEntry DO BEGIN


InitReservEntry(ReservEntry,ItemLedgEntryBuf,QtyBase,SalesLine."Shipment
Date",EntriesExist);
SetSource(
DATABASE::"Sales Line",SalesLine."Document Type",SalesLine."Document
No.",SalesLine."Line No.",'',0);
IF SalesLine."Document Type" IN [SalesLine."Document
Type"::Order,SalesLine."Document Type"::"Return Order"] THEN
"Reservation Status" := "Reservation Status"::Surplus
ELSE
"Reservation Status" := "Reservation Status"::Prospect;
IF AppliedFromItemEntry THEN
"Appl.-from Item Entry" := ItemLedgEntryBuf."Entry No.";
Description := SalesLine.Description;
OnCopyItemLedgEntryTrkgToDocLine(ItemLedgEntryBuf,ReservEntry);
UpdateItemTracking;
OnBeforeInsertReservEntryForSalesLine(ReservEntry,SalesLine);
INSERT;
END;
END;
[LineStart(5456)]
LOCAL PROCEDURE InsertReservEntryForPurchLine@117(ItemLedgEntryBuf@1001 :
Record 32;PurchaseLine@1000 : Record 39;QtyBase@1003 :
Decimal;AppliedToItemEntry@1004 : Boolean;VAR EntriesExist@1005 : Boolean);
VAR
ReservEntry@1002 : Record 337;
BEGIN
IF QtyBase = 0 THEN
EXIT;

WITH ReservEntry DO BEGIN


InitReservEntry(ReservEntry,ItemLedgEntryBuf,QtyBase,PurchaseLine."Expected
Receipt Date",EntriesExist);
SetSource(DATABASE::"Purchase Line",PurchaseLine."Document
Type",PurchaseLine."Document No.",PurchaseLine."Line No.",'',0);
IF PurchaseLine."Document Type" IN [PurchaseLine."Document
Type"::Order,PurchaseLine."Document Type"::"Return Order"] THEN
"Reservation Status" := "Reservation Status"::Surplus
ELSE
"Reservation Status" := "Reservation Status"::Prospect;
IF AppliedToItemEntry THEN
"Appl.-to Item Entry" := ItemLedgEntryBuf."Entry No.";
Description := PurchaseLine.Description;
OnCopyItemLedgEntryTrkgToDocLine(ItemLedgEntryBuf,ReservEntry);
UpdateItemTracking;
OnBeforeInsertReservEntryForPurchLine(ReservEntry,PurchaseLine);
INSERT;
END;
END;

[LineStart(5476)]
LOCAL PROCEDURE InsertReservEntryFromTrackingSpec@39(TrackingSpecification@1000
: Record 336;SourceSubtype@1005 : Option;SourceID@1004 :
Code[20];SourceRefNo@1003 : Integer;QtyBase@1001 : Decimal);
VAR
ReservEntry@1002 : Record 337;
BEGIN
IF QtyBase = 0 THEN
EXIT;

WITH ReservEntry DO BEGIN


INIT;
TRANSFERFIELDS(TrackingSpecification);
"Source Subtype" := SourceSubtype;
"Source ID" := SourceID;
"Source Ref. No." := SourceRefNo;
"Reservation Status" := "Reservation Status"::Prospect;
"Quantity Invoiced (Base)" := 0;
VALIDATE("Quantity (Base)",QtyBase);
Positive := ("Quantity (Base)" > 0);
"Entry No." := 0;
"Item Tracking" := ItemTrackingOption("Lot No.","Serial No.");
INSERT;
END;
END;

[LineStart(5495)]
LOCAL PROCEDURE InitReservEntry@18(VAR ReservEntry@1000 : Record
337;ItemLedgEntryBuf@1002 : Record 32;QtyBase@1003 : Decimal;Date@1001 : Date;VAR
EntriesExist@1004 : Boolean);
BEGIN
WITH ReservEntry DO BEGIN
INIT;
"Item No." := ItemLedgEntryBuf."Item No.";
"Location Code" := ItemLedgEntryBuf."Location Code";
"Variant Code" := ItemLedgEntryBuf."Variant Code";
"Qty. per Unit of Measure" := ItemLedgEntryBuf."Qty. per Unit of Measure";
CopyTrackingFromItemLedgEntry(ItemLedgEntryBuf);
"Quantity Invoiced (Base)" := 0;
VALIDATE("Quantity (Base)",QtyBase);
Positive := ("Quantity (Base)" > 0);
"Entry No." := 0;
IF Positive THEN BEGIN
"Warranty Date" := ItemLedgEntryBuf."Warranty Date";
"Expiration Date" :=
ExistingExpirationDate("Item No.","Variant Code","Lot No.","Serial
No.",FALSE,EntriesExist);
"Expected Receipt Date" := Date;
END ELSE
"Shipment Date" := Date;
"Creation Date" := WORKDATE;
"Created By" := USERID;
END;

OnAfterInitReservEntry(ReservEntry,ItemLedgEntryBuf);
END;

[External]
[LineStart(5520)]
PROCEDURE DeleteInvoiceSpecFromHeader@17(SourceType@1001 :
Integer;SourceSubtype@1002 : Option;SourceID@1003 : Code[20]);
VAR
TrackingSpecification@1000 : Record 336;
BEGIN
TrackingSpecification.SetSourceFilter(SourceType,SourceSubtype,SourceID,-
1,FALSE);
TrackingSpecification.SetSourceFilter2('',0);
TrackingSpecification.DELETEALL;
END;

[External]
[LineStart(5525)]
PROCEDURE DeleteInvoiceSpecFromLine@6(SourceType@1003 :
Integer;SourceSubtype@1002 : Option;SourceID@1001 : Code[20];SourceRefNo@1004 :
Integer);
VAR
TrackingSpecification@1000 : Record 336;
BEGIN

TrackingSpecification.SetSourceFilter(SourceType,SourceSubtype,SourceID,SourceRefNo
,FALSE);
TrackingSpecification.SetSourceFilter2('',0);
TrackingSpecification.DELETEALL;
END;

[LineStart(5530)]
LOCAL PROCEDURE IsReservedFromTransferShipment@61(ReservEntry@1000 : Record
337) : Boolean;
BEGIN
EXIT((ReservEntry."Source Type" = DATABASE::"Transfer Line") AND
(ReservEntry."Source Subtype" = 0));
END;

[External]
[LineStart(5533)]
PROCEDURE ItemTrackingExistsOnDocumentLine@100(SourceType@1004 :
Integer;SourceSubtype@1003 : Option;SourceID@1002 : Code[20];SourceRefNo@1001 :
Integer) : Boolean;
VAR
TrackingSpecification@1000 : Record 336;
ReservEntry@1005 : Record 337;
BEGIN

TrackingSpecification.SetSourceFilter(SourceType,SourceSubtype,SourceID,SourceRefNo
,TRUE);
TrackingSpecification.SetSourceFilter2('',0);
TrackingSpecification.SETRANGE(Correction,FALSE);

ReservEntry.SetSourceFilter(SourceType,SourceSubtype,SourceID,SourceRefNo,TRUE);
ReservEntry.SetSourceFilter2('',0);
ReservEntry.SETFILTER("Item Tracking",'<>%1',ReservEntry."Item
Tracking"::None);

EXIT(NOT TrackingSpecification.ISEMPTY OR NOT ReservEntry.ISEMPTY);


END;

[External]
[LineStart(5543)]
PROCEDURE CalcQtyToHandleForTrackedQtyOnDocumentLine@102(SourceType@1003 :
Integer;SourceSubtype@1002 : Option;SourceID@1001 : Code[20];SourceRefNo@1000 :
Integer) : Decimal;
VAR
ReservEntry@1004 : Record 337;
BEGIN

ReservEntry.SetSourceFilter(SourceType,SourceSubtype,SourceID,SourceRefNo,TRUE);
ReservEntry.SetSourceFilter2('',0);
ReservEntry.SETFILTER("Item Tracking",'<>%1',ReservEntry."Item
Tracking"::None);
ReservEntry.CALCSUMS("Qty. to Handle (Base)");
EXIT(ReservEntry."Qty. to Handle (Base)");
END;

[LineStart(5550)]
LOCAL PROCEDURE CheckQtyToInvoiceMatchItemTracking@156(VAR
TempTrackingSpecSummedUp@1003 : TEMPORARY Record 336;VAR
TempTrackingSpecNotInvoiced@1004 : TEMPORARY Record
336;QtyToInvoiceOnDocLine@1002 : Decimal;QtyPerUoM@1005 : Decimal);
VAR
NoOfLotsOrSerials@1000 : Integer;
Sign@1001 : Integer;
QtyToInvOnLineAndTrkgDiff@1006 : Decimal;
BEGIN
TempTrackingSpecSummedUp.RESET;
TempTrackingSpecSummedUp.SETFILTER("Qty. to Invoice (Base)",'<>%1',0);
NoOfLotsOrSerials := TempTrackingSpecSummedUp.COUNT;
IF NoOfLotsOrSerials = 0 THEN
EXIT;

TempTrackingSpecSummedUp.CALCSUMS("Qty. to Invoice (Base)");


QtyToInvOnLineAndTrkgDiff := ABS(QtyToInvoiceOnDocLine) -
ABS(TempTrackingSpecSummedUp."Qty. to Invoice (Base)");
IF QtyToInvOnLineAndTrkgDiff = 0 THEN
EXIT;

IF ((NoOfLotsOrSerials > 1) AND (QtyToInvOnLineAndTrkgDiff <> 0)) OR


((NoOfLotsOrSerials = 1) AND (QtyToInvOnLineAndTrkgDiff > 0))
THEN
ERROR(QtyToInvoiceDoesNotMatchItemTrackingErr);

IF TempTrackingSpecNotInvoiced.ISEMPTY THEN
EXIT;

IF NoOfLotsOrSerials = 1 THEN BEGIN


QtyToInvoiceOnDocLine := ABS(QtyToInvoiceOnDocLine);
TempTrackingSpecNotInvoiced.CALCSUMS("Qty. to Invoice (Base)");
IF QtyToInvoiceOnDocLine < ABS(TempTrackingSpecNotInvoiced."Qty. to Invoice
(Base)") THEN BEGIN
TempTrackingSpecNotInvoiced.FINDSET;
REPEAT
IF QtyToInvoiceOnDocLine >= ABS(TempTrackingSpecNotInvoiced."Qty. to
Invoice (Base)") THEN
QtyToInvoiceOnDocLine -= ABS(TempTrackingSpecNotInvoiced."Qty. to
Invoice (Base)")
ELSE BEGIN
Sign := 1;
IF TempTrackingSpecNotInvoiced."Qty. to Invoice (Base)" < 0 THEN
Sign := -1;

TempTrackingSpecNotInvoiced."Qty. to Invoice (Base)" :=


QtyToInvoiceOnDocLine * Sign;
TempTrackingSpecNotInvoiced."Qty. to Invoice" :=
ROUND(TempTrackingSpecNotInvoiced."Qty. to Invoice (Base)" /
QtyPerUoM,UOMMgt.QtyRndPrecision);
TempTrackingSpecNotInvoiced.MODIFY;

QtyToInvoiceOnDocLine := 0;
END;
UNTIL TempTrackingSpecNotInvoiced.NEXT = 0;
END;
END;
END;

[Integration]
[LineStart(5594)]
LOCAL PROCEDURE OnAfterInsertWhseItemTrkgLinesLoop@121(VAR
PostedWhseReceiptLine@1000 : Record 7319;VAR WhseItemEntryRelation@1001 : Record
6509;VAR WhseItemTrackingLine@1002 : Record 6550);
BEGIN
END;

[Integration]
[LineStart(5597)]
LOCAL PROCEDURE OnAfterRetrieveAppliedExpirationDate@122(VAR
TempItemLedgEntry@1000 : TEMPORARY Record 32;ItemApplicationEntry@1001 : Record
339);
BEGIN
END;

[Integration]
[LineStart(5600)]
LOCAL PROCEDURE OnAfterSynchronizeItemTracking@130(VAR ReservationEntry@1000 :
Record 337;ToRowID@1001 : Text[250]);
BEGIN
END;

[Integration]
[LineStart(5603)]
LOCAL PROCEDURE OnBeforeCheckWhseItemTrkg@63(VAR TempWhseItemTrkgLine@1001 :
TEMPORARY Record 6550;WhseWkshLine@1000 : Record 7326;VAR Checked@1002 : Boolean);
BEGIN
END;

[Integration]
[LineStart(5606)]
LOCAL PROCEDURE OnBeforeCreateWhseItemTrkgForReceipt@84(VAR
WhseItemTrackingLine@1001 : Record 6550;WhseWkshLine@1000 : Record 7326);
BEGIN
END;

[Integration]
[LineStart(5609)]
LOCAL PROCEDURE OnBeforeCreateWhseItemTrkgForResEntry@95(VAR
WhseItemTrackingLine@1001 : Record 6550;SourceReservEntry@1002 : Record
337;WhseWkshLine@1000 : Record 7326);
BEGIN
END;

[Integration]
[LineStart(5612)]
LOCAL PROCEDURE OnBeforeExistingExpirationDate@85(ItemNo@1005 :
Code[20];Variant@1004 : Code[20];LotNo@1003 : Code[50];SerialNo@1002 :
Code[50];TestMultiple@1001 : Boolean;VAR EntriesExist@1000 : Boolean;VAR
ExpDate@1006 : Date;VAR IsHandled@1007 : Boolean);
BEGIN
END;

[Integration]
[LineStart(5615)]
LOCAL PROCEDURE OnBeforeExistingExpirationDateAndQty@98(ItemNo@1005 :
Code[20];Variant@1004 : Code[20];LotNo@1003 : Code[50];SerialNo@1002 :
Code[50];SumOfEntries@1001 : Decimal;VAR ExpDate@1006 : Date;VAR IsHandled@1007 :
Boolean);
BEGIN
END;

[Integration]
[LineStart(5618)]
LOCAL PROCEDURE OnBeforeFindTempHandlingSpecification@64(VAR
TempTrackingSpecification@1000 : TEMPORARY Record 336;ReservEntry@1001 : Record
337);
BEGIN
END;

[Integration]
[LineStart(5621)]
LOCAL PROCEDURE OnBeforeInsertReservEntryForPurchLine@67(VAR ReservEntry@1000 :
Record 337;PurchLine@1001 : Record 39);
BEGIN
END;

[Integration]
[LineStart(5624)]
LOCAL PROCEDURE OnBeforeInsertReservEntryForSalesLine@72(VAR ReservEntry@1000 :
Record 337;SalesLine@1001 : Record 37);
BEGIN
END;

[Integration]
[LineStart(5627)]
LOCAL PROCEDURE OnBeforeInsertSplitPostedWhseRcptLine@128(VAR
TempPostedWhseRcptLine@1002 : TEMPORARY Record 7319;PostedWhseRcptLine@1001 :
Record 7319;WhseItemEntryRelation@1000 : Record 6509);
BEGIN
END;

[Integration]
[LineStart(5630)]
LOCAL PROCEDURE OnBeforeInsertSplitInternalPutAwayLine@125(VAR
TempPostedWhseRcptLine@1000 : TEMPORARY Record 7319;PostedWhseRcptLine@1001 :
Record 7319;WhseItemTrackingLine@1002 : Record 6550);
BEGIN
END;

[Integration]
[LineStart(5633)]
LOCAL PROCEDURE OnBeforeTempWhseJnlLine2Insert@82(VAR TempWhseJnlLineTo@1000 :
TEMPORARY Record 7311;TempWhseJnlLineFrom@1001 : TEMPORARY Record 7311;VAR
TempSplitTrackingSpec@1002 : TEMPORARY Record 336;TransferTo@1003 :
Boolean;WhseSNRequired@1004 : Boolean;WhseLNRequired@1005 : Boolean);
BEGIN
END;

[Integration]
[LineStart(5636)]
LOCAL PROCEDURE OnBeforeWhseExistingExpirationDate@96(ItemNo@1005 :
Code[20];Variant@1004 : Code[20];Location@1008 : Record 14;LotNo@1003 :
Code[50];SerialNo@1002 : Code[50];VAR EntriesExist@1000 : Boolean;VAR
ExpDate@1006 : Date;VAR IsHandled@1007 : Boolean);
BEGIN
END;

[Integration]
[LineStart(5639)]
LOCAL PROCEDURE OnBeforeWhseItemTrackingLineInsert@129(VAR
WhseItemTrackingLine@1000 : Record 6550;SourceReservEntry@1001 : Record 337);
BEGIN
END;

[Integration]
[LineStart(5642)]
LOCAL PROCEDURE OnSyncActivItemTrkgOnBeforeInsertTempReservEntry@131(VAR
TempReservEntry@1000 : TEMPORARY Record 337;WhseActivLine@1001 : Record 5767);
BEGIN
END;

[Integration]
[LineStart(5645)]
LOCAL PROCEDURE OnBeforeInsertWhseItemTrkgLines@101(VAR WhseItemTrkgLine@1001 :
Record 6550;PostedWhseReceiptLine@1002 : Record 7319;WhseItemEntryRelation@1000 :
Record 6509);
BEGIN
END;

[Integration]
[LineStart(5648)]
LOCAL PROCEDURE OnBeforeModifyWhseItemTrkgLines@107(VAR WhseItemTrkgLine@1001 :
Record 6550;PostedWhseReceiptLine@1002 : Record 7319;WhseItemEntryRelation@1000 :
Record 6509);
BEGIN
END;

[Integration]
[LineStart(5651)]
LOCAL PROCEDURE OnBeforeRetrieveAppliedExpirationDate@120(VAR
TempItemLedgEntry@1000 : TEMPORARY Record 32);
BEGIN
END;

[Integration]
[LineStart(5654)]
LOCAL PROCEDURE OnBeforeInsertWhseItemTrkgLinesLoop@126(VAR
PostedWhseReceiptLine@1000 : Record 7319;VAR WhseItemEntryRelation@1001 : Record
6509;VAR WhseItemTrackingLine@1002 : Record 6550);
BEGIN
END;

[Integration]
[LineStart(5657)]
LOCAL PROCEDURE
OnCheckItemTrkgInfBeforePostOnBeforeTempItemLotInfoInsert@127(VAR
TempLotNoInfo@1000 : TEMPORARY Record 6505;WhseItemTrackingLine@1001 : Record
6550);
BEGIN
END;

[Integration]
[LineStart(5660)]
LOCAL PROCEDURE OnCopyItemLedgEntryTrkgToDocLine@62(VAR ItemLedgerEntry@1000 :
Record 32;VAR ReservationEntry@1001 : Record 337);
BEGIN
END;

[Integration]
[LineStart(5663)]
LOCAL PROCEDURE OnIsOrderNetworkEntity@65(Type@1000 : Integer;Subtype@1001 :
Integer;VAR IsNetworkEntity@1002 : Boolean);
BEGIN
END;

[Integration]
[LineStart(5666)]
LOCAL PROCEDURE OnAfterInitReservEntry@119(VAR ReservEntry@1000 : Record
337;ItemLedgerEntry@1001 : Record 32);
BEGIN
END;

[Integration]
[LineStart(5669)]
LOCAL PROCEDURE OnAfterReserveEntryFilter@69(ItemJournalLine@1000 : Record
83;VAR ReservationEntry@1001 : Record 337);
BEGIN
END;

[Integration]
[LineStart(5672)]
LOCAL PROCEDURE OnRetrieveItemTrackingFromReservEntryFilter@68(VAR
ReservEntry@1000 : Record 337;ItemJournalLine@1001 : Record 83);
BEGIN
END;

[Integration]
[LineStart(5675)]
LOCAL PROCEDURE OnAfterSplitWhseJnlLine@83(VAR TempWhseJnlLine@1000 : TEMPORARY
Record 7311;VAR TempWhseJnlLine2@1001 : TEMPORARY Record 7311);
BEGIN
END;

[Integration]
[LineStart(5678)]
LOCAL PROCEDURE OnAfterSplitPostedWhseReceiptLine@103(PostedWhseRcptLine@1001 :
Record 7319;VAR TempPostedWhseRcptLine@1000 : TEMPORARY Record 7319);
BEGIN
END;

[Integration]
[LineStart(5681)]
LOCAL PROCEDURE OnSynchronizeWhseActivItemTrkgOnAfterSetExpirationDate@124(VAR
WarehouseActivityLine@1000 : Record 5767;VAR ReservationEntry@1001 : Record 337);
BEGIN
END;

[Integration]
[LineStart(5684)]
LOCAL PROCEDURE OnTempPostedWhseRcptLineSetFilters@118(VAR
PostedWhseReceiptLine@1000 : Record 7319;ItemLedgerEntry@1001 : Record
32;WhseItemEntryRelation@1002 : Record 6509);
BEGIN
END;

[Integration]
[LineStart(5687)]
LOCAL PROCEDURE
OnRetrieveSubcontrItemTrackingOnBeforeCheckLastOperation@132(ProdOrderRoutingLine@1
000 : Record 5409;VAR IsLastOperation@1001 : Boolean);
BEGIN
END;

[LineStart(5690)]
PROCEDURE SetRetrieveAsmItemTracking@1100225000(RetrieveAsmItemTracking2@1000 :
Boolean);
BEGIN
RetrieveAsmItemTracking := RetrieveAsmItemTracking2;
END;

[LineStart(5693)]
PROCEDURE RetrieveILEFromPostedInvGlobal@7141743(VAR
TempItemLedgEntry@7141744 : TEMPORARY Record 32;InvoiceRowID@7141743 : Text[100]);
BEGIN
//-STD043
RetrieveILEFromPostedInv(TempItemLedgEntry, InvoiceRowID);
//-STD043
END;

[LineStart(5698)]
LOCAL PROCEDURE RetrieveILEFromPostedInv@1100225001(VAR
TempItemLedgEntry@1006 : TEMPORARY Record 32;InvoiceRowID@1000 : Text[250]);
VAR
ValueEntryRelation@1005 : Record 6508;
ValueEntry@1004 : Record 5802;
ItemLedgEntry@1002 : Record 32;
SignFactor@1001 : Integer;
BEGIN
// retrieves a data set of Item Ledger Entries (Posted Invoices)

ValueEntryRelation.SETCURRENTKEY("Source RowId");
ValueEntryRelation.SETRANGE("Source RowId",InvoiceRowID);
IF ValueEntryRelation.FIND('-') THEN BEGIN
SignFactor := TableSignFactor2(InvoiceRowID);
REPEAT
ValueEntry.GET(ValueEntryRelation."Value Entry No.");
ItemLedgEntry.GET(ValueEntry."Item Ledger Entry No.");
TempItemLedgEntry := ItemLedgEntry;
TempItemLedgEntry.Quantity := ValueEntry."Invoiced Quantity";
IF TempItemLedgEntry."Entry Type" IN [TempItemLedgEntry."Entry
Type"::Purchase,TempItemLedgEntry."Entry Type"::Sale] THEN
IF TempItemLedgEntry.Quantity <> 0 THEN
AddTempRecordToSet(TempItemLedgEntry,SignFactor);
UNTIL ValueEntryRelation.NEXT = 0;
END;
END;

[LineStart(5716)]
LOCAL PROCEDURE InitTrackingSpecBuffer@1100225029(VAR
TempTrackingSpecBuffer@1010 : TEMPORARY Record 336;EntryNo@1011 : Integer;Type@1006
: Integer;Subtype@1005 : Integer;ID@1004 : Code[20];BatchName@1003 :
Code[10];ProdOrderLine@1002 : Integer;RefNo@1000 : Integer;Description@1001 :
Text[100];ItemNo@1007 : Code[20];LN@1009 : Code[50];SN@1008 :
Code[50];Correction@1012 : Boolean);
BEGIN
// initializes a new record for TempTrackingSpecBuffer

TempTrackingSpecBuffer.INIT;
TempTrackingSpecBuffer."Source Type" := Type;
TempTrackingSpecBuffer."Entry No." := EntryNo;
TempTrackingSpecBuffer."Item No." := ItemNo;
TempTrackingSpecBuffer.Description := Description;
TempTrackingSpecBuffer."Source Subtype" := Subtype;
TempTrackingSpecBuffer."Source ID" := ID;
TempTrackingSpecBuffer."Source Batch Name" := BatchName;
TempTrackingSpecBuffer."Source Prod. Order Line" := ProdOrderLine;
TempTrackingSpecBuffer."Source Ref. No." := RefNo;
TempTrackingSpecBuffer."Lot No." := LN;
TempTrackingSpecBuffer."Serial No." := SN;
TempTrackingSpecBuffer.Correction := Correction;
END;

[LineStart(5733)]
LOCAL PROCEDURE TableSignFactor2@1100225002(RowID@1000 : Text[250]) : Integer;
VAR
TableNo@1001 : Integer;
BEGIN
RowID := DELCHR(RowID,'<','"');
RowID := COPYSTR(RowID,1,STRPOS(RowID,'"') - 1);
IF EVALUATE(TableNo,RowID) THEN
EXIT(TableSignFactor(TableNo));

EXIT(1);
END;

[LineStart(5741)]
LOCAL PROCEDURE RDITPurchase@1100225013(VAR TempTrackingSpecBuffer@1003 :
TEMPORARY Record 336;SourceID@1000 : Code[20];SourceSubType@1002 : Option);
VAR
PurchaseLine@1005 : Record 39;
Item@1006 : Record 27;
Descr@1004 : Text[100];
BEGIN
PurchaseLine.SETRANGE("Document Type",SourceSubType);
PurchaseLine.SETRANGE("Document No.",SourceID);
IF NOT PurchaseLine.ISEMPTY THEN BEGIN
PurchaseLine.FINDSET;
REPEAT
IF (PurchaseLine.Type = PurchaseLine.Type::Item) AND
(PurchaseLine."Quantity (Base)" <> 0)
THEN BEGIN
IF Item.GET(PurchaseLine."No.") THEN
Descr := Item.Description;
FindReservEntries(TempTrackingSpecBuffer,DATABASE::"Purchase
Line",PurchaseLine."Document Type",
PurchaseLine."Document No.",'',0,PurchaseLine."Line No.",Descr);
FindTrackingEntries(TempTrackingSpecBuffer,DATABASE::"Purchase
Line",PurchaseLine."Document Type",
PurchaseLine."Document No.",'',0,PurchaseLine."Line No.",Descr);
END;
UNTIL PurchaseLine.NEXT = 0;
END;
END;

[LineStart(5760)]
LOCAL PROCEDURE RDITSales@1100225012(VAR TempTrackingSpecBuffer@1003 :
TEMPORARY Record 336;SourceID@1000 : Code[20];SourceSubType@1002 : Option);
VAR
SalesLine@1007 : Record 37;
Item@1006 : Record 27;
Descr@1004 : Text[100];
BEGIN
SalesLine.SETRANGE("Document Type",SourceSubType);
SalesLine.SETRANGE("Document No.",SourceID);
IF NOT SalesLine.ISEMPTY THEN BEGIN
SalesLine.FINDSET;
REPEAT
IF (SalesLine.Type = SalesLine.Type::Item) AND
(SalesLine."No." <> '') AND
(SalesLine."Quantity (Base)" <> 0)
THEN BEGIN
IF Item.GET(SalesLine."No.") THEN
Descr := Item.Description;
FindReservEntries(TempTrackingSpecBuffer,DATABASE::"Sales
Line",SalesLine."Document Type",
SalesLine."Document No.",'',0,SalesLine."Line No.",Descr);
FindTrackingEntries(TempTrackingSpecBuffer,DATABASE::"Sales
Line",SalesLine."Document Type",
SalesLine."Document No.",'',0,SalesLine."Line No.",Descr);
END;
UNTIL SalesLine.NEXT = 0;
END;
END;

[LineStart(5780)]
LOCAL PROCEDURE ItemTrackingExistsInBuffer@1100225028(VAR
TempTrackingSpecBuffer@1008 : TEMPORARY Record 336;Type@1006 : Integer;Subtype@1005
: Integer;ID@1004 : Code[20];BatchName@1003 : Code[10];ProdOrderLine@1002 :
Integer;RefNo@1001 : Integer;LN@1000 : Code[50];SN@1007 : Code[50]) : Boolean;
BEGIN
// searches after existing record in TempTrackingSpecBuffer

TempTrackingSpecBuffer.SETCURRENTKEY("Source ID","Source Type","Source


Subtype",
"Source Batch Name","Source Prod. Order Line","Source Ref. No.");
TempTrackingSpecBuffer.SETRANGE("Source ID",ID);
TempTrackingSpecBuffer.SETRANGE("Source Type",Type);
TempTrackingSpecBuffer.SETRANGE("Source Subtype",Subtype);
TempTrackingSpecBuffer.SETRANGE("Source Batch Name",BatchName);
TempTrackingSpecBuffer.SETRANGE("Source Prod. Order Line",ProdOrderLine);
TempTrackingSpecBuffer.SETRANGE("Source Ref. No.",RefNo);
TempTrackingSpecBuffer.SETRANGE("Serial No.",SN);
TempTrackingSpecBuffer.SETRANGE("Lot No.",LN);

IF NOT TempTrackingSpecBuffer.ISEMPTY THEN BEGIN


TempTrackingSpecBuffer.FINDFIRST;
EXIT(TRUE);
END;
EXIT(FALSE);
END;

[LineStart(5800)]
LOCAL PROCEDURE RDITService@1100225011(VAR TempTrackingSpecBuffer@1003 :
TEMPORARY Record 336;SourceID@1000 : Code[20];SourceSubType@1002 : Option);
VAR
ServLine@1013 : Record 5902;
Item@1006 : Record 27;
Descr@1004 : Text[100];
BEGIN
ServLine.SETRANGE("Document Type",SourceSubType);
ServLine.SETRANGE("Document No.",SourceID);
IF NOT ServLine.ISEMPTY THEN BEGIN
ServLine.FINDSET;
REPEAT
IF (ServLine.Type = ServLine.Type::Item) AND
(ServLine."No." <> '') AND
(ServLine."Quantity (Base)" <> 0)
THEN BEGIN
IF Item.GET(ServLine."No.") THEN
Descr := Item.Description;
FindReservEntries(TempTrackingSpecBuffer,DATABASE::"Service
Line",ServLine."Document Type",
ServLine."Document No.",'',0,ServLine."Line No.",Descr);
FindTrackingEntries(TempTrackingSpecBuffer,DATABASE::"Service
Line",ServLine."Document Type",
ServLine."Document No.",'',0,ServLine."Line No.",Descr);
END;
UNTIL ServLine.NEXT = 0;
END;
END;

[LineStart(5820)]
LOCAL PROCEDURE RDITSalesShipment@1100225010(VAR TempTrackingSpecBuffer@1003 :
TEMPORARY Record 336;SourceID@1000 : Code[20]);
VAR
SalesShipmentLine@1009 : Record 111;
Item@1006 : Record 27;
PostedAsmHeader@1001 : Record 910;
PostedAsmLine@1002 : Record 911;
Descr@1004 : Text[100];
BEGIN
SalesShipmentLine.SETRANGE("Document No.",SourceID);
IF NOT SalesShipmentLine.ISEMPTY THEN BEGIN
SalesShipmentLine.FINDSET;
REPEAT
IF (SalesShipmentLine.Type = SalesShipmentLine.Type::Item) AND
(SalesShipmentLine."No." <> '') AND
(SalesShipmentLine."Quantity (Base)" <> 0)
THEN BEGIN
IF Item.GET(SalesShipmentLine."No.") THEN
Descr := Item.Description;
FindItemEntries(TempTrackingSpecBuffer,DATABASE::"Sales Shipment Line",
0,SalesShipmentLine."Document No.",'',0,SalesShipmentLine."Line
No.",Descr);
IF RetrieveAsmItemTracking THEN
IF SalesShipmentLine.AsmToShipmentExists(PostedAsmHeader) THEN BEGIN
PostedAsmLine.SETRANGE("Document No.",PostedAsmHeader."No.");
IF PostedAsmLine.FINDSET THEN
REPEAT
Descr := PostedAsmLine.Description;
FindItemEntries(TempTrackingSpecBuffer,DATABASE::"Posted
Assembly Line",
0,PostedAsmLine."Document No.",'',0,PostedAsmLine."Line
No.",Descr);
UNTIL PostedAsmLine.NEXT = 0;
END;
END;
UNTIL SalesShipmentLine.NEXT = 0;
END;
END;

[LineStart(5847)]
LOCAL PROCEDURE RDITSalesInvoice@1100225009(VAR TempTrackingSpecBuffer@1000 :
TEMPORARY Record 336;SourceID@1001 : Code[20]);
VAR
SalesInvoiceLine@1002 : Record 113;
Item@1003 : Record 27;
Descr@1004 : Text[100];
BEGIN
SalesInvoiceLine.SETRANGE("Document No.",SourceID);
IF NOT SalesInvoiceLine.ISEMPTY THEN BEGIN
SalesInvoiceLine.FINDSET;
REPEAT
IF (SalesInvoiceLine.Type = SalesInvoiceLine.Type::Item) AND
(SalesInvoiceLine."No." <> '') AND
(SalesInvoiceLine."Quantity (Base)" <> 0)
THEN BEGIN
IF Item.GET(SalesInvoiceLine."No.") THEN
Descr := Item.Description;
FindValueEntries(TempTrackingSpecBuffer,DATABASE::"Sales Invoice Line",
0,SalesInvoiceLine."Document No.",'',0,SalesInvoiceLine."Line
No.",Descr);
END;
UNTIL SalesInvoiceLine.NEXT = 0;
END;
END;

[LineStart(5864)]
LOCAL PROCEDURE RDITServiceShipment@1100225008(VAR
TempTrackingSpecBuffer@1003 : TEMPORARY Record 336;SourceID@1000 : Code[20]);
VAR
ServShptLine@1011 : Record 5991;
Item@1006 : Record 27;
Descr@1004 : Text[100];
BEGIN
ServShptLine.SETRANGE("Document No.",SourceID);
IF NOT ServShptLine.ISEMPTY THEN BEGIN
ServShptLine.FINDSET;
REPEAT
IF (ServShptLine.Type = ServShptLine.Type::Item) AND
(ServShptLine."No." <> '') AND
(ServShptLine."Quantity (Base)" <> 0)
THEN BEGIN
IF Item.GET(ServShptLine."No.") THEN
Descr := Item.Description;
FindItemEntries(TempTrackingSpecBuffer,DATABASE::"Service Shipment
Line",
0,ServShptLine."Document No.",'',0,ServShptLine."Line No.",Descr);
END;
UNTIL ServShptLine.NEXT = 0;
END;
END;

[LineStart(5881)]
LOCAL PROCEDURE RDITServiceInvoice@1100225007(VAR TempTrackingSpecBuffer@1003 :
TEMPORARY Record 336;SourceID@1000 : Code[20]);
VAR
ServInvLine@1012 : Record 5993;
Item@1006 : Record 27;
Descr@1004 : Text[100];
BEGIN
ServInvLine.SETRANGE("Document No.",SourceID);
IF NOT ServInvLine.ISEMPTY THEN BEGIN
ServInvLine.FINDSET;
REPEAT
IF (ServInvLine.Type = ServInvLine.Type::Item) AND
(ServInvLine."No." <> '') AND
(ServInvLine."Quantity (Base)" <> 0)
THEN BEGIN
IF Item.GET(ServInvLine."No.") THEN
Descr := Item.Description;
FindValueEntries(TempTrackingSpecBuffer,DATABASE::"Service Invoice
Line",
0,ServInvLine."Document No.",'',0,ServInvLine."Line No.",Descr);
END;
UNTIL ServInvLine.NEXT = 0;
END;
END;

[LineStart(5898)]
PROCEDURE FindReservEntries@1100225015(VAR TempTrackingSpecBuffer@1002 :
TEMPORARY Record 336;Type@1010 : Integer;Subtype@1009 : Integer;ID@1008 :
Code[20];BatchName@1007 : Code[10];ProdOrderLine@1006 : Integer;RefNo@1005 :
Integer;Description@1004 : Text[100]);
VAR
ReservEntry@1001 : Record 337;
BEGIN
// finds Item Tracking for Quote, Order, Invoice, Credit Memo, Return Order

FilterReservEntries(ReservEntry,Type,Subtype,ID,BatchName,ProdOrderLine,RefNo);
IF ReservEntry.FINDSET THEN
REPEAT
IF (ReservEntry."Lot No." <> '') OR (ReservEntry."Serial No." <> '') THEN

FillTrackingSpecBuffer(TempTrackingSpecBuffer,Type,Subtype,ID,BatchName,
ProdOrderLine,RefNo,Description,ReservEntry."Item
No.",ReservEntry."Lot No.",
ReservEntry."Serial No.",ReservEntry."Quantity
(Base)",ReservEntry.Correction);
UNTIL ReservEntry.NEXT = 0;
END;

[LineStart(5910)]
LOCAL PROCEDURE RetrieveILEFromShptRcpt@1100225027(VAR TempItemLedgEntry@1010 :
TEMPORARY Record 32;Type@1009 : Integer;Subtype@1008 : Integer;ID@1007 :
Code[20];BatchName@1006 : Code[10];ProdOrderLine@1005 : Integer;RefNo@1004 :
Integer);
VAR
ItemEntryRelation@1003 : Record 6507;
ItemLedgEntry@1002 : Record 32;
SignFactor@1000 : Integer;
BEGIN
// retrieves a data set of Item Ledger Entries (Posted Shipments/Receipts)

ItemEntryRelation.SETCURRENTKEY("Source ID","Source Type");


ItemEntryRelation.SETRANGE("Source Type",Type);
ItemEntryRelation.SETRANGE("Source Subtype",Subtype);
ItemEntryRelation.SETRANGE("Source ID",ID);
ItemEntryRelation.SETRANGE("Source Batch Name",BatchName);
ItemEntryRelation.SETRANGE("Source Prod. Order Line",ProdOrderLine);
ItemEntryRelation.SETRANGE("Source Ref. No.",RefNo);
IF ItemEntryRelation.FINDSET THEN BEGIN
SignFactor := TableSignFactor(Type);
REPEAT
ItemLedgEntry.GET(ItemEntryRelation."Item Entry No.");
TempItemLedgEntry := ItemLedgEntry;
AddTempRecordToSet(TempItemLedgEntry,SignFactor);
UNTIL ItemEntryRelation.NEXT = 0;
END;
END;

[LineStart(5929)]
PROCEDURE FindTrackingEntries@1100225014(VAR TempTrackingSpecBuffer@1002 :
TEMPORARY Record 336;Type@1008 : Integer;Subtype@1007 : Integer;ID@1006 :
Code[20];BatchName@1005 : Code[10];ProdOrderLine@1004 : Integer;RefNo@1003 :
Integer;Description@1000 : Text[100]);
VAR
TrackingSpec@1001 : Record 336;
BEGIN
// finds Item Tracking for Quote, Order, Invoice, Credit Memo, Return Order
when shipped/received

FilterTrackingEntries(TrackingSpec,Type,Subtype,ID,BatchName,ProdOrderLine,RefNo);
IF TrackingSpec.FINDSET THEN
REPEAT
IF (TrackingSpec."Lot No." <> '') OR (TrackingSpec."Serial No." <> '')
THEN

FillTrackingSpecBuffer(TempTrackingSpecBuffer,Type,Subtype,ID,BatchName,
ProdOrderLine,RefNo,Description,TrackingSpec."Item
No.",TrackingSpec."Lot No.",
TrackingSpec."Serial No.",TrackingSpec."Quantity
(Base)",TrackingSpec.Correction);
UNTIL TrackingSpec.NEXT = 0;
END;

[LineStart(5941)]
PROCEDURE FindItemEntries@1100225017(VAR TempTrackingSpecBuffer@1011 :
TEMPORARY Record 336;Type@1005 : Integer;Subtype@1004 : Integer;ID@1003 :
Code[20];BatchName@1002 : Code[10];ProdOrderLine@1001 : Integer;RefNo@1000 :
Integer;Description@1009 : Text[100]);
VAR
TempItemLedgEntry@1007 : TEMPORARY Record 32;
BEGIN
// finds Item Tracking for Posted Shipments/Receipts

RetrieveILEFromShptRcpt(TempItemLedgEntry,Type,Subtype,ID,BatchName,ProdOrderLine,R
efNo);
FillTrackingSpecBufferFromILE(

TempItemLedgEntry,TempTrackingSpecBuffer,Type,Subtype,ID,BatchName,ProdOrderLine,Re
fNo,Description);
END;

[LineStart(5948)]
PROCEDURE FindValueEntries@1100225016(VAR TempTrackingSpecBuffer@1013 :
TEMPORARY Record 336;Type@1008 : Integer;Subtype@1007 : Integer;ID@1006 :
Code[20];BatchName@1005 : Code[10];ProdOrderLine@1004 : Integer;RefNo@1003 :
Integer;Description@1002 : Text[100]);
VAR
TempItemLedgEntry@1010 : TEMPORARY Record 32;
InvoiceRowID@1000 : Text[250];
BEGIN
// finds Item Tracking for Posted Invoices

InvoiceRowID := ComposeRowID(Type,Subtype,ID,BatchName,ProdOrderLine,RefNo);
RetrieveILEFromPostedInv(TempItemLedgEntry,InvoiceRowID);
FillTrackingSpecBufferFromILE(

TempItemLedgEntry,TempTrackingSpecBuffer,Type,Subtype,ID,BatchName,ProdOrderLine,Re
fNo,Description);
END;

[LineStart(5956)]
LOCAL PROCEDURE FilterTrackingEntries@1100225018(VAR TrackingSpec@1002 : Record
336;Type@1008 : Integer;Subtype@1007 : Integer;ID@1006 : Code[20];BatchName@1005 :
Code[10];ProdOrderLine@1004 : Integer;RefNo@1003 : Integer);
BEGIN
// retrieves a data set of Tracking Specification Entries

TrackingSpec.SETCURRENTKEY("Source ID","Source Type","Source Subtype","Source


Batch Name",
"Source Prod. Order Line","Source Ref. No.");
TrackingSpec.SETRANGE("Source ID",ID);
TrackingSpec.SETRANGE("Source Type",Type);
TrackingSpec.SETRANGE("Source Subtype",Subtype);
TrackingSpec.SETRANGE("Source Batch Name",BatchName);
TrackingSpec.SETRANGE("Source Prod. Order Line",ProdOrderLine);
TrackingSpec.SETRANGE("Source Ref. No.",RefNo);
END;

[LineStart(5968)]
LOCAL PROCEDURE FilterReservEntries@1100225022(VAR ReservEntry@1002 : Record
337;Type@1010 : Integer;Subtype@1009 : Integer;ID@1008 : Code[20];BatchName@1007 :
Code[10];ProdOrderLine@1006 : Integer;RefNo@1005 : Integer);
BEGIN
// retrieves a data set of Reservation Entries

ReservEntry.SETCURRENTKEY("Source ID","Source Ref. No.","Source Type","Source


Subtype","Source Batch Name",
"Source Prod. Order Line","Reservation Status","Shipment Date","Expected
Receipt Date");
ReservEntry.SETRANGE("Source ID",ID);
ReservEntry.SETRANGE("Source Ref. No.",RefNo);
ReservEntry.SETRANGE("Source Type",Type);
ReservEntry.SETRANGE("Source Subtype",Subtype);
ReservEntry.SETRANGE("Source Batch Name",BatchName);
ReservEntry.SETRANGE("Source Prod. Order Line",ProdOrderLine);
END;

[LineStart(5980)]
LOCAL PROCEDURE FillTrackingSpecBuffer@1100225024(VAR
TempTrackingSpecBuffer@1011 : TEMPORARY Record 336;Type@1007 : Integer;Subtype@1006
: Integer;ID@1005 : Code[20];BatchName@1004 : Code[10];ProdOrderLine@1003 :
Integer;RefNo@1002 : Integer;Description@1010 : Text[100];ItemNo@1009 :
Code[20];LN@1001 : Code[50];SN@1000 : Code[50];Qty@1008 : Decimal;Correction@1013 :
Boolean);
VAR
LastEntryNo@1012 : Integer;
BEGIN
// creates or sums up a record in TempTrackingSpecBuffer

TempTrackingSpecBuffer.RESET;
IF TempTrackingSpecBuffer.FINDLAST THEN
LastEntryNo := TempTrackingSpecBuffer."Entry No.";

IF
ItemTrackingExistsInBuffer(TempTrackingSpecBuffer,Type,Subtype,ID,BatchName,ProdOrd
erLine,RefNo,LN,SN) THEN BEGIN
TempTrackingSpecBuffer."Quantity (Base)" +=
ABS(Qty); // Sum up Qty
TempTrackingSpecBuffer.MODIFY;
END
ELSE BEGIN
LastEntryNo += 1;

InitTrackingSpecBuffer(TempTrackingSpecBuffer,LastEntryNo,Type,Subtype,ID,BatchName
,
ProdOrderLine,RefNo,Description,ItemNo,LN,SN,Correction);
TempTrackingSpecBuffer."Quantity (Base)" := ABS(Qty);
TempTrackingSpecBuffer.INSERT;
END;
END;

[LineStart(5999)]
LOCAL PROCEDURE FillTrackingSpecBufferFromILE@1100225023(VAR
TempItemLedgEntry@1000 : TEMPORARY Record 32;VAR TempTrackingSpecBuffer@1008 :
TEMPORARY Record 336;Type@1007 : Integer;Subtype@1006 : Integer;ID@1005 :
Code[20];BatchName@1004 : Code[10];ProdOrderLine@1003 : Integer;RefNo@1002 :
Integer;Description@1001 : Text[100]);
BEGIN
// creates a new record in TempTrackingSpecBuffer (used for Posted
Shipments/Receipts/Invoices)

IF TempItemLedgEntry.FINDSET THEN
REPEAT
IF (TempItemLedgEntry."Lot No." <> '') OR (TempItemLedgEntry."Serial No."
<> '') THEN

FillTrackingSpecBuffer(TempTrackingSpecBuffer,Type,Subtype,ID,BatchName,
ProdOrderLine,RefNo,Description,TempItemLedgEntry."Item
No.",TempItemLedgEntry."Lot No.",
TempItemLedgEntry."Serial
No.",TempItemLedgEntry.Quantity,TempItemLedgEntry.Correction);
UNTIL TempItemLedgEntry.NEXT = 0;
END;

[LineStart(6010)]
PROCEDURE SetReclass@1000000000(IsReclass@1000000000 : Boolean);
BEGIN
GlobalIsReclass := IsReclass; //<431
END;

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
}
END.
}
}

OBJECT Codeunit 50069 Franchises Management


{
OBJECT-PROPERTIES
{
Date=17/01/24;
Time=14:39:47;
Modified=Yes;
Version List=OS,431,528,532,542,563,565,578,999;
}
PROPERTIES
{
TableNo=50124;
OnRun=VAR
Item@1100225000 : Record 27;
PostedWhseShipmentHeader@1000000000 : Record 7322;
RecRef@1100225005 : RecordRef;
RecId@1100225004 : RecordID;
FieldRef@1100225003 : FieldRef;
TransferShipmentHeader@1000000001 : Record 5744;
BEGIN
//<528
IF Rec."Store Type" <> Rec."Store Type"::Franchise THEN
EXIT;
//528>
CASE TRUE OF
Rec.Action = Rec.Action::Send : BEGIN // Si es de tipus enviar
CASE Rec.Operation OF
Rec.Operation::Item:
BEGIN
RecId := Rec.RecordID;
RecRef := RecId.GETRECORD;
FieldRef := RecRef.FIELD(1);
Item.GET(FieldRef.VALUE);
ItemSender(Rec,Item);
END;
Rec.Operation::Shipment:
BEGIN
RecId := Rec.RecordID;
RecRef := RecId.GETRECORD;
FieldRef := RecRef.FIELD(1);
PostedWhseShipmentHeader.GET(FieldRef.VALUE);
TransferSender(Rec,PostedWhseShipmentHeader);
END;
Rec.Operation::ShipmentSGA:
BEGIN
RecId := Rec.RecordID;
RecRef := RecId.GETRECORD;
FieldRef := RecRef.FIELD(1);
TransferShipmentHeader.GET(FieldRef.VALUE);
TransferSenderSGA(Rec,TransferShipmentHeader);
END;
Rec.Operation::Stock: ExportStock(Rec);
END;
END;
Rec.Action = Rec.Action::Receive : BEGIN // Si es de tipus rebre
CASE Rec.Operation OF
Rec.Operation::"Confirmation Receipt": ReceiptConfirmation(Rec);
Rec.Operation::Sale: PostSales(Rec);
Rec.Operation::Stock: StockToLog(Rec);
Rec.Operation::"Inventory Adjustment": InventoryToAdjust(Rec);
Rec.Operation::Contact: PostContact(Rec);
END;
END;
END;
END;

}
CODE
{
VAR
NoFranchiseShipmentEndpointErr@1100225000 : TextConst 'ESP=No existe ninguna
franquicia configurada con el Endpoint de albar�n';
NoFranchiseItemEndpointErr@1100225001 : TextConst 'ESP=No existe ninguna
franquicia configurada con el Endpoint de producto';
ProcessCancelledByUser@1100225002 : TextConst 'ESP=Proceso cancelado por el
usuario';
NotEnoughStockErr@1000000000 : TextConst 'ENU="The transaction cannot be
registered due to lack of stock ";ESP=No se puede registrar la transacci�n por
falta de stock';

[LineStart(6027)]
LOCAL PROCEDURE "-----Import-------"@1000000003();
BEGIN
END;

[LineStart(6030)]
LOCAL PROCEDURE ReceiptConfirmation@1000000028(VAR
FranchisesLogEntry@1000000000 : Record 50124);
VAR
JObject@1000000002 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JSONManagement@1000000001 : Codeunit 5459;
WhsePostReceipt@1000000011 : Codeunit 5760;
TransferMgmt@1000000018 : Codeunit 50053;
PostedWhseShipmentHeader@1000000008 : Record 7322;
PostedWhseShipmentLine@1000000006 : Record 7323;
TransferHeader@1000000007 : Record 5740;
TransferLine@1000000012 : Record 5741;
WhseRcptHeader@1000000010 : Record 7316;
WhseRcptLine@1000000013 : Record 7317;
DocNo@1000000003 : Text;
StoreNo@1000000004 : Text;
ConfirmationDate@1000000005 : Date;
GetSourceDocInbound@1000000009 : Codeunit 5751;
PostWhsReceiption@1000000014 : TextConst 'ENU=It was not posible to post the
reception of the transfer order: %1;ESP=No se ha podido registrar la recepci�n del
pedido de transferencia: %1';
PostPackLine@1100225000 : Record 50053;
QtyModified@1100225001 : Boolean;
TransfOrderPostRcpt@1100225002 : Codeunit 5705;
PostedWhseShipmentNoErr@1000000015 : TextConst 'ESP=No se ha encontrado el
envio almac�n registrado %1';
TransferHeaderNoErr@1000000016 : TextConst 'ESP=No se ha encontrado el pedido
transferencia %1';
TransferLineNoErr@1000000017 : TextConst 'ESP=No se ha encontrado el producto
%1 en el pedido de transferencia %2 del docuemento env�o registrado %3 en el
packing %4';
FranchisesLogEntry2@1000000019 : Record 50124;
ConfirmReceptErr@1000000020 : TextConst 'ESP=La confirmaci�n del bulto %1 ya
fue procesada anteriormente.';
RecRef@1000000026 : RecordRef;
FieRefShipmentNo@1000000025 : FieldRef;
FieRefPackageNo@1000000024 : FieldRef;
FieRefItemNo@1000000023 : FieldRef;
FieRefQuantity@1000000022 : FieldRef;
FieRefLineNo@1000000021 : FieldRef;
TransferShipmentHeader@1000000027 : Record 5744;
TransferShipmentLine@1000000028 : Record 5745;
TransShipQty@1000000029 : Decimal;
TransShipItemNo@1000000030 : Code[20];
BEGIN
IF (FranchisesLogEntry.Operation =
FranchisesLogEntry.Operation::"Confirmation Receipt") AND
(FranchisesLogEntry."Package No" <> '') THEN BEGIN
FranchisesLogEntry2.SETCURRENTKEY(Action,Operation,"Franchise
Code",Processed);
FranchisesLogEntry2.SETRANGE(Action,FranchisesLogEntry.Action);
FranchisesLogEntry2.SETRANGE(Operation,FranchisesLogEntry.Operation);
FranchisesLogEntry2.SETRANGE("Franchise Code",FranchisesLogEntry."Franchise
Code");
FranchisesLogEntry2.SETRANGE(Processed,TRUE);
FranchisesLogEntry2.SETRANGE("Package No",FranchisesLogEntry."Package No");
FranchisesLogEntry2.SETFILTER("Entry No.",'<>%1',FranchisesLogEntry."Entry
No.");
IF FranchisesLogEntry2.FINDSET() THEN

SetCheckedError(FranchisesLogEntry,STRSUBSTNO(ConfirmReceptErr,FranchisesLogEntry."
Package No"));
END;

// INC-999 ==>
IF TransferShipmentHeader.GET(FranchisesLogEntry."Posted Warehouse Shipment
No.") THEN BEGIN
IF TransferHeader.GET(TransferShipmentHeader."Transfer Order No.") THEN
BEGIN
TransferMgmt.RestoreTrackingFromEntries(TransferHeader."No.");
TransferHeader.VALIDATE("Posting Date",FranchisesLogEntry."Operation
Date");
TransferHeader.MODIFY;
// Validamos las cantidades a recibir a 0 en base a lo que estaba
programado
TransferLine.SETCURRENTKEY("Document No.","Item No.","Derived From Line
No.");
TransferLine.SETRANGE("Document No.", TransferHeader."No.");
TransferLine.SETFILTER("Item No.", '<>%1', '');
TransferLine.SETRANGE("Derived From Line No.", 0);
IF TransferLine.FINDSET THEN BEGIN
REPEAT
TransferLine.VALIDATE("Qty. to Receive", 0);
TransferLine.MODIFY();
UNTIL TransferLine.NEXT = 0;
END;
// Aqui mirar en el envio de transferencia registrado las l�neas de
origen etc, puesto que en la tabla 80025 no lo tenemos
RecRef.OPEN(80025);
FieRefShipmentNo := RecRef.FIELD(110);
FieRefShipmentNo.SETFILTER(FranchisesLogEntry."Posted Warehouse Shipment
No.");
FieRefPackageNo := RecRef.FIELD(10);
FieRefPackageNo.SETFILTER(FranchisesLogEntry."Package No");
IF RecRef.FINDSET THEN BEGIN
REPEAT
// Aqu� se olvidar�n de vincular la l�nea del pedido de transferencia
con la del env�o de transferencia registrado
// he creado el campo para los nuevos datos pero los antiguos no
funcionaran, tampoco en la integraci�n del SGA
// en la tabla 80025 hay vinculaci�n sobre que linea del TO se
vincula, con lo cual el fallo podr�a ser el siguiente
// varias veces el mismo producto en un mismo PT y que se env�en en
el mismo bulto, substituto mio mira esa casuistica primero ;-)
FieRefItemNo := RecRef.FIELD(30);
FieRefQuantity := RecRef.FIELD(40);
EVALUATE(TransShipQty, FORMAT(FieRefQuantity.VALUE));
TransShipItemNo := FORMAT(FieRefItemNo.VALUE);
TransferShipmentLine.SETRANGE("Document No.",
TransferShipmentHeader."No.");
TransferShipmentLine.SETRANGE("Item No.", TransShipItemNo);
TransferShipmentLine.SETRANGE(Quantity, TransShipQty);
IF TransferShipmentLine.FINDFIRST THEN BEGIN
TransferLine.SETCURRENTKEY("Document No.","Item No.","Derived From
Line No.");
TransferLine.SETRANGE("Document No.", TransferHeader."No.");
TransferLine.SETRANGE("Item No.", TransShipItemNo);

IF TransferShipmentLine."Source Line No." <> 0 THEN


TransferLine.SETRANGE("Line No.", TransferShipmentLine."Source
Line No.");

TransferLine.SETRANGE("Derived From Line No.", 0);


IF TransferLine.FINDFIRST THEN BEGIN
TransferLine."Qty. to Receive" += TransShipQty;
TransferLine.VALIDATE("Qty. to Receive");
TransferLine.MODIFY;
QtyModified := TRUE;
END ELSE

SetCheckedError(FranchisesLogEntry,STRSUBSTNO(TransferLineNoErr,TransShipItemNo,Tra
nsferHeader."No.",FranchisesLogEntry."Posted Warehouse Shipment
No.",FranchisesLogEntry."Package No"));
END;
UNTIL RecRef.NEXT = 0;
END;
END;
END;
// IF PostedWhseShipmentHeader.GET(FranchisesLogEntry."Posted Warehouse
Shipment No.") THEN BEGIN
// PostedWhseShipmentLine.SETRANGE("No.", PostedWhseShipmentHeader."No.");
// IF PostedWhseShipmentLine.FINDFIRST THEN BEGIN
// IF TransferHeader.GET(PostedWhseShipmentLine."Source No.") THEN BEGIN
// TransferMgmt.RestoreTrackingFromEntries(TransferHeader."No.");
// TransferHeader.VALIDATE("Posting Date",FranchisesLogEntry."Operation
Date");
// TransferHeader.MODIFY;
// // Primer posem totes les quantitats a rebre a 0
// TransferLine.SETCURRENTKEY("Document No.","Item No.","Derived From
Line No.");
// TransferLine.SETRANGE("Document No.", TransferHeader."No.");
// TransferLine.SETFILTER("Item No.", '<>%1', '');
// TransferLine.SETRANGE("Derived From Line No.", 0);
// IF TransferLine.FINDSET THEN BEGIN
// REPEAT
// TransferLine.VALIDATE("Qty. to Receive", 0);
// TransferLine.MODIFY();
// UNTIL TransferLine.NEXT = 0;
// END;
//
// // Busquem els productos del packing rebut
// CLEAR(PostPackLine);
// PostPackLine.SETCURRENTKEY("Packing No.","Package No.");
// PostPackLine.SETRANGE("Packing No.",PostedWhseShipmentHeader."Posted
Packing No.");
// PostPackLine.SETRANGE("Package No.",FranchisesLogEntry."Package No");
// IF PostPackLine.FINDSET THEN BEGIN
// REPEAT
// TransferLine.SETCURRENTKEY("Document No.","Item No.","Derived
From Line No.");
// TransferLine.SETRANGE("Document No.", TransferHeader."No.");
// TransferLine.SETRANGE("Item No.", PostPackLine."Item No.");
// TransferLine.SETRANGE("Line No.",PostPackLine."Source Line No.");
// IF TransferLine.FINDFIRST THEN BEGIN
// TransferLine."Qty. to Receive" += PostPackLine."Package
Quantity";
// TransferLine.VALIDATE("Qty. to Receive");
// TransferLine.MODIFY;
// QtyModified := TRUE;
// END ELSE
//
SetCheckedError(FranchisesLogEntry,STRSUBSTNO(TransferLineNoErr,PostPackLine."Item
No.",TransferHeader."No.",FranchisesLogEntry."Posted Warehouse Shipment
No.",FranchisesLogEntry."Package No"));
// UNTIL PostPackLine.NEXT = 0;
// END;
// END ELSE // No existeix comanda transferencia
//
SetCheckedError(FranchisesLogEntry,STRSUBSTNO(TransferHeaderNoErr,PostedWhseShipmen
tLine."Source No."));
// END;
// END ELSE // No existeix enviament magatzem registrat
//
SetCheckedError(FranchisesLogEntry,STRSUBSTNO(PostedWhseShipmentNoErr,FranchisesLog
Entry."Posted Warehouse Shipment No."));
// INC-999 <==
IF QtyModified THEN BEGIN
COMMIT;
TransferHeader.SETRECFILTER;
TransfOrderPostRcpt.SetHideValidationDialog(TRUE);
TransfOrderPostRcpt.RUN(TransferHeader);
END;
END;
[LineStart(6153)]
LOCAL PROCEDURE PostSales@1100225005(VAR "Franchises Log Entry"@1100225000 :
Record 50124);
VAR
JObject@1000000001 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
TempBlob@1000000032 : TEMPORARY Record 99008535;
Instr@1000000000 : InStream;
JSONString@1000000034 : Text;
ReceiptNo@1000000021 : Text;
StoreNo@1000000020 : Text;
Store@1000000030 : Record 99001470;
POSTerminalNo@1000000018 : Text;
DateText@1000000046 : Text;
TransactionDate@1000000035 : Date;
FranchisesSetupStore@1000000023 : Record 50126;
CustomerNoFromStore@1000000036 : Code[20];
JSONManagement@1000000002 : Codeunit 5459;
LineasVenta@1000000003 : Text;
JArray@1000000019 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
TransactionHeader@1000000022 : Record 99001472;
EntryNo@1000000007 : Integer;
TransSalesEntry@1000000016 : Record 99001473;
LineNo@1000000010 : Integer;
ItemJournalLine@1000000039 : Record 83;
IsFirstTime@1000000040 : Boolean;
ItemJournalLineNo@1000000045 : Integer;
CreatedLines@1000000047 : Boolean;
LineasCobro@1000000006 : Text;
TransPaymentEntry@1000000009 : Record 99001474;
ItemJnlPostBatch@1000000048 : Codeunit 23;
TenderTypeValue@1100225010 : Text;
IsReturn@1100225009 : Boolean;
TotalPayments@1100225011 : Integer;
ToDoILE@1100225012 : Boolean;
"---------"@1000000033 : Integer;
JObject1@1000000027 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JObjectSales@1000000005 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JObjectReceivables@1000000004 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
Barcodes@1000000013 : Record 99001451;
Item@1000000012 : Record 27;
Customer@1000000025 : Record 18;
SalesHeader@1000000028 : Record 36;
SalesLine@1000000029 : Record 37;
CIF@1000000024 : Text;
CustomerARRAY@1000000026 : Text;
Qty@1000000011 : Decimal;
QtyInSales@1100225020 : Decimal;
QtyInPositiveAdj@1100225021 : Decimal;
PVPUnitPrice@1000000014 : Decimal;
PVPUnitPriceDisc@1000000015 : Decimal;
TransPaymentEntryAmount@1000000017 : Decimal;
VATPCT@1000000008 : Decimal;
StoreNotExistErr@1000000042 : TextConst 'ESP=La tienda %1 no existe en el
sistema';
PostingErr@1000000031 : TextConst 'ENU=It was not possible to release or post
the sales order %1;ESP=No ha sido posible lanzar o registrar el pedido de venta
%1';
CustomerNotExistInStoreErr@1000000037 : TextConst 'ESP=En la configuraci�n de
franquicia, en la tienda %1 no tiene configurado el cliente o no est� activa';
StoreErr@1000000038 : TextConst 'ESP=En la configuraci�n de franquicia, la
tienda %1 no est� configurada o no est� activada';
POSTerminalErr@1000000043 : TextConst 'ESP=El terminal %1 no est� configurado
en la tienda %2';
InvoiceLocationErr@1000000044 : TextConst 'ESP=En la configuraci�n de
franquicia, la tienda %1 no tiene configurado el almac�n de facturaci�n';
ItemJnlTemplate@1000000050 : Record 82;
ItemJnlBatch@1000000049 : Record 233;
NoItems@1100225001 : Integer;
TotalPayment@1100225002 : Decimal;
Payment@1100225003 : Decimal;
VATAmount@1100225004 : Decimal;
TotalVATAmount@1100225005 : Decimal;
ItemCost@1100225006 : Decimal;
TotalCost@1100225007 : Decimal;
TotalDisc@1100225008 : Decimal;
DocumentStoreExistErr@1100225013 : TextConst 'ESP=El documento %1 para la
tienda %2 ya existe';
TransSalesEntry2@1100225014 : Record 99001473;
EntryStoreExistErr@1100225015 : TextConst 'ESP=El documento %1 para la tienda
%2 con n�mero de l�nea %3 ya existe en transacciones de ventas';
TransactionStatus@1100225016 : Record 99001493;
GlobalToDoILE@1100225017 : Boolean;
AdjustJournalErr@1100225018 : TextConst 'ESP=En la configuraci�n de
franquicia, la tienda %1 no tiene configurado el diario y secci�n de ajustes';
Item2@1000000054 : Record 27;
TotalToAdjust@1000000053 : Decimal;
FranchisesAdjustEntry@1100225019 : Record 50133;
FranchisesAdjustEntryNo@1000000051 : Integer;
Location@1000000041 : Record 14;
DefaultDimension@1100225022 : Record 352;
TempDimSetEntry@1100225023 : TEMPORARY Record 480;
DimMgt@1100225024 : Codeunit 408;
NewDimSetID@1100225025 : Integer;
PromotionPctg@1100225026 : Decimal;
BarcodeNo@1000000052 : Text;
BEGIN
// Llegir el BLOB json
"Franchises Log Entry".CALCFIELDS("Json File");
TempBlob.Blob := "Franchises Log Entry"."Json File";
JSONString := TempBlob.ReadAsText('', TEXTENCODING::UTF8);

IF JSONString = '' THEN


EXIT;

JSONManagement.InitializeFromString(JSONString);
JSONManagement.GetJSONObject(JObject);

ReceiptNo := JObject.GetValue('NumeroDocumentoGN1').ToString;
StoreNo := JObject.GetValue('CodigoTienda').ToString;
IF NOT Store.GET(StoreNo) THEN
ERROR(StoreNotExistErr,StoreNo);

// Que la tenda estigui activada


FranchisesSetupStore.SETCURRENTKEY("Enable Store",Code,"Store No.");
FranchisesSetupStore.SETRANGE("Enable Store",TRUE);
FranchisesSetupStore.SETRANGE("Store No.",StoreNo);
IF FranchisesSetupStore.ISEMPTY THEN
ERROR(StoreErr,StoreNo);

FranchisesSetupStore.FINDFIRST;

TransactionHeader.SETCURRENTKEY("Store No.","Wrong Shift","POS Terminal


No.","Receipt No.");
TransactionHeader.SETRANGE("Store No.",StoreNo);
TransactionHeader.SETRANGE("Receipt No.", ReceiptNo);
IF NOT TransactionHeader.ISEMPTY THEN
ERROR(DocumentStoreExistErr,ReceiptNo,StoreNo);

POSTerminalNo := JObject.GetValue('CodigoTPV').ToString;

IF FranchisesSetupStore."POS Terminal" <> POSTerminalNo THEN


ERROR(POSTerminalErr,POSTerminalNo,StoreNo);

DateText:= JObject.GetValue('Fecha').ToString;
EVALUATE(TransactionDate, COPYSTR(DateText,1,2) + COPYSTR(DateText,4,2) +
COPYSTR(DateText,7,4));

// Que tingui un client assignat


IF FranchisesSetupStore."Customer No." = '' THEN
ERROR(CustomerNotExistInStoreErr,StoreNo);

// Que tingui el diari per poder fer la reclassificaci�


IF (FranchisesSetupStore."Journal Batch Name Adjust" = '') OR
(FranchisesSetupStore."Journal Template Name Adjust" = '') THEN
ERROR(AdjustJournalErr,StoreNo);

// Que tingui el magatzem de facturaci� configurat la tenda


IF FranchisesSetupStore."Invoice Location" = '' THEN
ERROR(InvoiceLocationErr,StoreNo);

// Crearem la transacci� de RETAIL


CLEAR(TransactionHeader);
TransactionHeader.SETRANGE("Store No.", StoreNo);
TransactionHeader.SETRANGE("POS Terminal No.", POSTerminalNo);
IF TransactionHeader.FINDLAST THEN
EntryNo := TransactionHeader."Transaction No." + 1
ELSE
EntryNo := 1;

CLEAR(TransactionHeader);
TransactionHeader."Transaction No." := EntryNo;
TransactionHeader."POS Terminal No." := POSTerminalNo;
TransactionHeader."Store No." := StoreNo;
TransactionHeader.INSERT(TRUE);
TransactionHeader.VALIDATE("Customer No.",CustomerNoFromStore);
TransactionHeader."Receipt No." := ReceiptNo;
TransactionHeader."Transaction Type" := TransactionHeader."Transaction
Type"::Sales;
TransactionHeader.Date := TransactionDate;
TransactionHeader.Time := TIME;

LineasVenta := JObject.SelectToken('LineasVenta').ToString;
JSONManagement.InitializeCollection(LineasVenta);
JSONManagement.GetJsonArray(JArray);
IsFirstTime := TRUE;
NoItems := 0;
TotalPayment := 0;
TotalVATAmount := 0;
TotalCost := 0;

FOREACH JObject1 IN JArray DO BEGIN


TransSalesEntry.INIT;
TransSalesEntry."Transaction No." := EntryNo;
TransSalesEntry."POS Terminal No." := POSTerminalNo;
TransSalesEntry."Store No." := StoreNo;
EVALUATE(LineNo, JObject1.GetValue('IdLinea').ToString);
TransSalesEntry."Line No." := LineNo;

CLEAR(TransSalesEntry2);
TransSalesEntry2.SETCURRENTKEY("Store No.","POS Terminal No.","Line
No.","Receipt No.");
TransSalesEntry2.SETRANGE("Store No.",TransSalesEntry."Store No.");
TransSalesEntry2.SETRANGE("POS Terminal No.",TransSalesEntry."POS Terminal
No.");
TransSalesEntry2.SETRANGE("Line No.",TransSalesEntry."Line No.");
TransSalesEntry2.SETRANGE("Receipt No.",ReceiptNo);
IF NOT TransSalesEntry2.ISEMPTY THEN
ERROR(EntryStoreExistErr,ReceiptNo,TransSalesEntry."Store
No.",FORMAT(TransSalesEntry."Line No."));

TransSalesEntry.INSERT(TRUE);
NoItems += 1;
TransSalesEntry."Receipt No." := ReceiptNo;
// INC-999 ==>
// �apa del dia por el departamento de operaciones
BarcodeNo := JObject1.GetValue('CodBarras').ToString();
IF BarcodeNo = '8445641027797' THEN
BarcodeNo := '8445641027795';

Barcodes.GET(BarcodeNo);
// INC-999 <==
Item.GET(Barcodes."Item No.");
ToDoILE := Item."Item Class" <> Item."Item Class"::"No Item ledger
Entry"; // No fer moviment d'estoc
IF ToDoILE THEN
GlobalToDoILE := TRUE;

TransSalesEntry."Barcode No." := Barcodes."Barcode No.";


EVALUATE(Qty, JObject1.GetValue('Unidades').ToString);
EVALUATE(PVPUnitPrice, JObject1.GetValue('PVPUnitario').ToString);
EVALUATE(PVPUnitPriceDisc,
JObject1.GetValue('PVPUnitarioConDescuento').ToString);
EVALUATE(VATPCT, JObject1.GetValue('PorcentajeImpuesto').ToString);
EVALUATE(Payment, JObject1.GetValue('Total').ToString);
EVALUATE(VATAmount, JObject1.GetValue('TotalImpuesto').ToString);
TransSalesEntry.VALIDATE("Item No.", Barcodes."Item No.");
IsReturn := Qty < 0;

TransSalesEntry.Quantity := -Qty;
TransSalesEntry."Discount Amount" := Qty * (PVPUnitPrice -
PVPUnitPriceDisc);
TransSalesEntry."VAT Amount" := ROUND((VATPCT/100) * (Qty * PVPUnitPrice));
TransSalesEntry.Price := PVPUnitPrice;
TransSalesEntry."Net Price" := PVPUnitPrice - (PVPUnitPrice * (VATPCT *
0.1));
TransSalesEntry."Standard Net Price" := TransSalesEntry."Net Price";
//<578
EVALUATE(PromotionPctg, JObject1.GetValue('PorcentajeDescuento').ToString);
TransSalesEntry."Promotion %" := PromotionPctg;
//578>
//TransSalesEntry."Net Amount" := (PVPUnitPrice - (PVPUnitPrice * (VATPCT *
0.1))) * -Qty;
TransSalesEntry."Net Amount" := ((TransSalesEntry."Net Price" * ABS(Qty)) -
ABS(TransSalesEntry."Discount Amount"));
IF NOT IsReturn THEN
TransSalesEntry."Net Amount" := -TransSalesEntry."Net Amount";

TransSalesEntry."Cost Amount" := Item."Unit Cost" * -Qty;


IF NOT IsReturn THEN
TransSalesEntry."Total Rounded Amt." := - (TransSalesEntry.Price -
TransSalesEntry."Discount Amount")
ELSE
TransSalesEntry."Total Rounded Amt." := TransSalesEntry.Price -
TransSalesEntry."Discount Amount";
TransSalesEntry."Periodic Discount" := TransSalesEntry."Discount Amount";
TransSalesEntry.Date := TransactionDate;
TransSalesEntry.Time := TIME;
IF NOT ToDoILE THEN
TransSalesEntry."No Item Leger Entry" := TRUE;
TransSalesEntry.MODIFY(TRUE);

TotalCost += Item."Unit Cost";


TotalPayment += Payment;
TotalVATAmount += VATAmount;
TotalDisc += Qty * (PVPUnitPrice - PVPUnitPriceDisc);
//<578
{
// Ahora se crear� el diario de producto
IF ToDoILE THEN BEGIN
IF IsFirstTime THEN BEGIN
IsFirstTime := FALSE;
CLEAR(ItemJournalLine);
ItemJournalLine.SETRANGE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
ItemJournalLine.SETRANGE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.DELETEALL;
ItemJnlTemplate.GET(FranchisesSetupStore."Journal Template Name
Adjust");
ItemJnlBatch.GET(FranchisesSetupStore."Journal Template Name
Adjust",FranchisesSetupStore."Journal Batch Name Adjust");
END;

CLEAR(ItemJournalLine);
ItemJournalLine.SETRANGE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.SETRANGE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
IF ItemJournalLine.FINDLAST THEN
ItemJournalLineNo := ItemJournalLine."Line No." + 10000
ELSE
ItemJournalLineNo := 10000;

//<999 XT 05102021
//Verificar si t� estoc per fer un ajust positiu o no
CLEAR(Item2);
Item2.SETFILTER("Location Filter",Store."Location Code");
Item2.SETFILTER("No.",Barcodes."Item No.");
Item2.FINDFIRST;
Item2.CALCFIELDS(Inventory);

//Comprovar si ja hi ha l�nies de venta per processar del mateix producte


CLEAR(ItemJournalLine);
ItemJournalLine.SETRANGE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.SETRANGE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
ItemJournalLine.SETRANGE("Entry Type", ItemJournalLine."Entry
Type"::Sale);
ItemJournalLine.SETRANGE("Item No.", Barcodes."Item No.");
ItemJournalLine.CALCSUMS(Quantity);
QtyInSales := ItemJournalLine.Quantity;

CLEAR(ItemJournalLine);
ItemJournalLine.SETRANGE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.SETRANGE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
ItemJournalLine.SETRANGE("Entry Type", ItemJournalLine."Entry
Type"::"Positive Adjmt.");
ItemJournalLine.SETRANGE("Item No.", Barcodes."Item No.");
ItemJournalLine.CALCSUMS(Quantity);
QtyInPositiveAdj := ItemJournalLine.Quantity;
IF (Qty - Item2.Inventory + QtyInSales - QtyInPositiveAdj) > 0 THEN BEGIN
TotalToAdjust := Qty - Item2.Inventory + QtyInSales - QtyInPositiveAdj;

CLEAR(ItemJournalLine);
ItemJournalLine.VALIDATE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.VALIDATE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
ItemJournalLine.VALIDATE("Line No.",ItemJournalLineNo);
ItemJournalLine.INSERT(TRUE);
ItemJournalLine.VALIDATE("Posting Date",TransactionDate);
ItemJournalLine."Entry Type" := ItemJournalLine."Entry Type"::"Positive
Adjmt.";
ItemJournalLine.VALIDATE("Document No.",ReceiptNo);
ItemJournalLine.VALIDATE("Item No.",Barcodes."Item No.");
ItemJournalLine.VALIDATE("Location Code",Store."Location Code");
ItemJournalLine.VALIDATE(Quantity,TotalToAdjust);
ItemJournalLine."Source Code" := ItemJnlTemplate."Source Code";
ItemJournalLine."Posting No. Series" := ItemJnlBatch."Posting No.
Series";
ItemJournalLine.MODIFY(TRUE);

CreateSerialLotToJournalDocument(ItemJournalLine,'1','');

ItemJournalLineNo += 10000;

// Ara es crear� el registre a la taula de adjust


CLEAR(FranchisesAdjustEntry);
IF FranchisesAdjustEntry.FINDLAST THEN
FranchisesAdjustEntryNo := FranchisesAdjustEntry."Entry No." + 1
ELSE
FranchisesAdjustEntryNo := 1;

Location.GET(Store."Location Code");

CLEAR(FranchisesAdjustEntry);
FranchisesAdjustEntry."Entry No." := FranchisesAdjustEntryNo;
FranchisesAdjustEntry."Operation Date" := TransactionDate;
FranchisesAdjustEntry."Franchise Code" := FranchisesSetupStore.Code;
FranchisesAdjustEntry."Item No." := Barcodes."Item No.";
FranchisesAdjustEntry."Item Description" := Item2.Description;
FranchisesAdjustEntry."Barcode No." := Barcodes."Barcode No.";
FranchisesAdjustEntry."Location Code" := Store."Location Code";
FranchisesAdjustEntry."Store No." := Store."No.";
FranchisesAdjustEntry."Quantity Adjusted" := TotalToAdjust;
FranchisesAdjustEntry."Location Name" := Location.Name;
FranchisesAdjustEntry.Status :=
FranchisesAdjustEntry.Status::"Resolution pending";
FranchisesAdjustEntry."Related To Receipt No." := ReceiptNo;
FranchisesAdjustEntry.INSERT;
END;
//999 XT 05102021>

CLEAR(ItemJournalLine);
ItemJournalLine.VALIDATE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.VALIDATE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
ItemJournalLine.VALIDATE("Line No.",ItemJournalLineNo);
ItemJournalLine.INSERT(TRUE);
ItemJournalLine.VALIDATE("Posting Date",TransactionDate);
ItemJournalLine."Entry Type" := ItemJournalLine."Entry Type"::Sale;
ItemJournalLine.VALIDATE("Document No.",ReceiptNo);
ItemJournalLine.VALIDATE("Item No.",Barcodes."Item No.");
ItemJournalLine.VALIDATE("Location Code",Store."Location Code");
ItemJournalLine.VALIDATE(Quantity,Qty);
ItemJournalLine."Source Code" := ItemJnlTemplate."Source Code";
ItemJournalLine."Posting No. Series" := ItemJnlBatch."Posting No.
Series";
ItemJournalLine.MODIFY(TRUE);
//<563
CLEAR(TempDimSetEntry);
DimMgt.GetDimensionSet(TempDimSetEntry, ItemJournalLine."Dimension Set
ID");
CLEAR(DefaultDimension);
DefaultDimension.SETRANGE("Table ID", DATABASE::Store);
DefaultDimension.SETRANGE("No.", Store."No.");
IF NOT DefaultDimension.ISEMPTY THEN BEGIN
DefaultDimension.FINDSET;
REPEAT
TempDimSetEntry.RESET;
TempDimSetEntry.SETRANGE("Dimension Code",
DefaultDimension."Dimension Code");
IF TempDimSetEntry.FINDSET(TRUE,TRUE) THEN BEGIN
TempDimSetEntry.VALIDATE("Dimension Value Code",
DefaultDimension."Dimension Value Code");
TempDimSetEntry.MODIFY(TRUE);
END ELSE BEGIN
TempDimSetEntry.INIT;
TempDimSetEntry.VALIDATE("Dimension Code",
DefaultDimension."Dimension Code");
TempDimSetEntry.VALIDATE("Dimension Value Code",
DefaultDimension."Dimension Value Code");
TempDimSetEntry.INSERT(TRUE);
END;
UNTIL DefaultDimension.NEXT = 0;
END;

NewDimSetID := DimMgt.GetDimensionSetID(TempDimSetEntry);

IF NewDimSetID <> ItemJournalLine."Dimension Set ID" THEN BEGIN


DimMgt.UpdateGlobalDimFromDimSetID(NewDimSetID,
ItemJournalLine."Shortcut Dimension 1 Code", ItemJournalLine."Shortcut Dimension 2
Code");
ItemJournalLine."Dimension Set ID" := NewDimSetID;
ItemJournalLine.MODIFY(TRUE);
END;
//563>

AssignLotToItemJournalLine(ItemJournalLine);
END;
}
//578>
CreatedLines := TRUE;
END;

// Al tindre ja tots els totals actualitzems camps de la Transaction Header


TransactionHeader."Net Amount" := - (TotalPayment - TotalVATAmount);
IsReturn := TransactionHeader."Net Amount" > 0;
IF NOT IsReturn THEN BEGIN
TransactionHeader."Cost Amount" := -TotalCost;
TransactionHeader."No. of Items" := NoItems;
END ELSE BEGIN
TransactionHeader."Cost Amount" := TotalCost;
TransactionHeader."No. of Items" := - NoItems;
TransactionHeader."Sale Is Return Sale" := TRUE;
END;

TransactionHeader."Gross Amount" := -TotalPayment;


TransactionHeader.Payment := TotalPayment;
TransactionHeader."Discount Amount":= ABS(TotalDisc);
TransactionHeader."Pending Sales Shipment Process" := TRUE; //<578
TransactionHeader.MODIFY(TRUE);

IF CreatedLines THEN BEGIN


LineasCobro := JObject.SelectToken('LineasCobro').ToString;

JSONManagement.InitializeCollection(LineasCobro);
JSONManagement.GetJsonArray(JArray);

FOREACH JObject1 IN JArray DO BEGIN


EVALUATE(TransPaymentEntryAmount, JObject1.GetValue('Importe').ToString);
IF TransPaymentEntryAmount <> 0 THEN BEGIN
TransPaymentEntry.INIT;
EVALUATE(LineNo, JObject1.GetValue('IdLinea').ToString);
TransPaymentEntry."Line No." := LineNo;
TransPaymentEntry."Transaction No." := EntryNo;
TransPaymentEntry."Store No." := StoreNo;
TransPaymentEntry."POS Terminal No." := POSTerminalNo;
TransPaymentEntry.INSERT(TRUE);
TransPaymentEntry."Receipt No." := ReceiptNo;
TransPaymentEntry."Exchange Rate" := 1;
TransPaymentEntry.Quantity := 1;
TransPaymentEntry."Amount in Currency" := TransPaymentEntryAmount;
TransPaymentEntry."Amount Tendered" := TransPaymentEntryAmount;
TenderTypeValue := JObject1.GetValue('TipoCobro').ToString;
IF TenderTypeValue <> '' THEN
TransPaymentEntry."Tender Type" :=
GetTenderType(FranchisesSetupStore.Code,TenderTypeValue);
TransPaymentEntry.MODIFY(TRUE);
TotalPayments += 1;
END;
END;

// Actualitzar les l�nies de pagament


TransactionHeader."No. of Payment Lines" := TotalPayments;
TransactionHeader.MODIFY(TRUE);

//Crear registre perqu� s'embli que est� registrat


TransactionStatus."Store No." := TransactionHeader."Store No.";
TransactionStatus."POS Terminal No." := TransactionHeader."POS Terminal
No.";
TransactionStatus."Transaction No." := TransactionHeader."Transaction No.";
TransactionStatus.Status := TransactionStatus.Status::Posted;
TransactionStatus.INSERT;
//<578
{
IF GlobalToDoILE THEN
ItemJnlPostBatch.RUN(ItemJournalLine);
}
//578>
END;

//<578
COMMIT;
GenerateSalesShipmentFromTransactionHeader(TransactionHeader);
//578>
END;

[LineStart(6525)]
LOCAL PROCEDURE StockToLog@1000000004(VAR "Franchises Log Entry"@1000000000 :
Record 50124);
VAR
TempBlob@1000000002 : TEMPORARY Record 99008535;
JSONString@1000000001 : Text;
JObject@1000000004 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JSONManagement@1000000003 : Codeunit 5459;
ListaStocks@1000000006 : Text;
JArray@1000000005 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
JObject1@1000000007 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
StockQuantity@1000000008 : Decimal;
StoreNo@1000000011 : Code[10];
BarcodeNo@1000000010 : Text;
Barcodes@1000000009 : Record 99001451;
FranchisesStockEntry@1000000012 : Record 50128;
Location@1100225000 : Record 14;
Store@1100225001 : Record 99001470;
Item@1100225002 : Record 27;
MRWStock@1100225003 : Decimal;
BEGIN
// Llegir el BLOB json
"Franchises Log Entry".CALCFIELDS("Json File");
TempBlob.Blob := "Franchises Log Entry"."Json File";
JSONString := TempBlob.ReadAsText('', TEXTENCODING::UTF8);

IF JSONString = '' THEN


EXIT;

JSONManagement.InitializeFromString(JSONString);
JSONManagement.GetJSONObject(JObject);

ListaStocks := JObject.SelectToken('ListaStocks').ToString;
JSONManagement.InitializeCollection(ListaStocks);
JSONManagement.GetJsonArray(JArray);

FOREACH JObject1 IN JArray DO BEGIN


MRWStock := 0;
StoreNo := JObject1.GetValue('CodigoTienda').ToString;
BarcodeNo := JObject1.GetValue('CodBarras').ToString;
EVALUATE(StockQuantity, JObject1.GetValue('Stock').ToString);
Barcodes.GET(BarcodeNo);
Store.GET(StoreNo);
Location.GET(Store."Location Code");

CLEAR(Item);
Item.SETFILTER("Location Filter",Location.Code);
Item.SETFILTER("No.",Barcodes."Item No.");
Item.FINDFIRST;
Item.CALCFIELDS(Inventory);
MRWStock := Item.Inventory;

IF Item.Inventory <> StockQuantity THEN BEGIN


CLEAR(FranchisesStockEntry);
FranchisesStockEntry."Operation Date" := WORKDATE;
FranchisesStockEntry."Franchise Code" := "Franchises Log
Entry"."Franchise Code";
FranchisesStockEntry."Item No." := Barcodes."Item No.";
FranchisesStockEntry."Lot No." := '';
FranchisesStockEntry."Location Code" := Store."Location Code";
FranchisesStockEntry."Store No." := Store."No.";
FranchisesStockEntry."Item Description" := Barcodes.Description;
FranchisesStockEntry."Barcode No." := BarcodeNo;
FranchisesStockEntry."Location Name" := Location.Name;
FranchisesStockEntry."Franchise Stock" := StockQuantity;
FranchisesStockEntry."MRW Stock" := MRWStock;
FranchisesStockEntry."Stock Difference" := MRWStock - StockQuantity;
IF NOT FranchisesStockEntry.INSERT(TRUE) THEN
FranchisesStockEntry.MODIFY(TRUE);
END;
END;
END;
[LineStart(6576)]
PROCEDURE InventoryToAdjust@1000000020(VAR "Franchises Log Entry"@1000000000 :
Record 50124);
VAR
JObject@1000000002 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JObject1@1000000009 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JArray@1000000008 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
JSONManagement@1000000001 : Codeunit 5459;
LineasDocumento@1000000003 : Text;
DocNo@1000000004 : Text;
DocNoVendor@1000000005 : Text;
FromStoreNo@1000000006 : Text;
ToStoreNo@1000000007 : Text;
EmptyDocNoErr@1000000010 : TextConst 'ENU=Document No. is empty;ESP=El campo
N� Documento debe tener un valor';
EmptyVendorDocNoErr@1000000011 : TextConst 'ENU=The vendor document number is
empty;ESP=El campo N� Documento proveedor debe tener un valor';
NoDocLinesErr@1000000012 : TextConst 'ENU=There are no lines to perform
inventory adjustments;ESP=No existen l�nias para realizar ajustes de inventario';
EmptyFromStoreErr@1000000013 : TextConst 'ENU=Store Code field must have a
value;ESP=El campo c�digo tienda debe tener un valor';
Operation@1000000014 : Text;
NoOperationErr@1000000015 : TextConst 'ENU=Operation field is mandatory. It
cannot be empty;ESP=El campo Operaci�n debe tener un valor';
FranchisesLogEntry@1100225000 : Record 50124;
TempBlob@1000000017 : TEMPORARY Record 99008535;
JSONString@1000000016 : Text;
DateText@1100225001 : Text;
TransactionDate@1100225002 : Date;
BEGIN
// Llegir el BLOB json
"Franchises Log Entry".CALCFIELDS("Json File");
TempBlob.Blob := "Franchises Log Entry"."Json File";
JSONString := TempBlob.ReadAsText('', TEXTENCODING::UTF8);

IF JSONString = '' THEN


EXIT;

JSONManagement.InitializeFromString(JSONString);
JSONManagement.GetJSONObject(JObject);

Operation := JObject.GetValue('Operacion').ToString;
DocNo := JObject.GetValue('NumeroDocumentoGN1').ToString;
DocNoVendor := JObject.GetValue('NumeroDocumentoProveedor').ToString;
ToStoreNo := JObject.GetValue('CodigoTienda').ToString;
FromStoreNo := JObject.GetValue('CodigoTiendaOrigen').ToString;
//<999 04112021
DateText:= JObject.GetValue('Fecha').ToString;
EVALUATE(TransactionDate, COPYSTR(DateText,1,2) + COPYSTR(DateText,4,2) +
COPYSTR(DateText,7,4));
//999> 04112021
LineasDocumento := JObject.SelectToken('LineasDocumento').ToString;

IF (FromStoreNo <> '') AND (ToStoreNo <> '') THEN


CreateReclassJournal(LineasDocumento, DocNo, FromStoreNo, ToStoreNo,
Operation,TransactionDate)
ELSE
CreateItemJournal(LineasDocumento, DocNo, ToStoreNo,
Operation,TransactionDate);
END;

[LineStart(6604)]
PROCEDURE PostContact@1100225004(VAR FranchisesLogEntry@1000000000 : Record
50124);
VAR
JObject@1100225002 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JSONManagement@1100225001 : Codeunit 5459;
Contact@1100225003 : Record 5050;
TempBlob@1000000001 : TEMPORARY Record 99008535;
JSONString@1000000002 : Text;
Store@1100225000 : Record 99001470;
StoreNo@1100225004 : Text;
FranchisesSetupStore@1100225005 : Record 50126;
StoreErr@1100225006 : TextConst 'ESP=En la configuraci�n de franquicia, la
tienda %1 no est� configurada o no est� activada';
CustomerNotExistInStoreErr@1100225007 : TextConst 'ESP=En la configuraci�n de
franquicia, en la tienda %1 no tiene configurado el cliente o no est� activa';
Customer@1100225008 : Record 18;
ContBusRel@1100225009 : Record 5054;
UpdateContFromCust@1100225010 : Codeunit 5056;
PersonContact@1100225011 : Record 5050;
CompanyContact@1100225012 : Record 5050;
FranchisesSetup@1100225013 : Record 50123;
ContactNosErr@1100225014 : TextConst 'ESP=El la configuraci�n de franquicia,
el n�mero de serie para crear contactos no est� configurado';
BEGIN
// Llegir el BLOB json
FranchisesLogEntry.CALCFIELDS("Json File");
TempBlob.Blob := FranchisesLogEntry."Json File";
JSONString := TempBlob.ReadAsText('', TEXTENCODING::UTF8);

IF JSONString = '' THEN


EXIT;

JSONManagement.InitializeFromString(JSONString);
JSONManagement.GetJsonArray(JObject);

//// Al tindre la tenda


//StoreNo := JObject.GetValue('CodigoTienda').ToString;

// Que la tenda estigui activada


FranchisesSetupStore.SETCURRENTKEY("Enable Store",Code,"Store No.");
FranchisesSetupStore.SETRANGE("Enable Store",TRUE);
FranchisesSetupStore.SETRANGE("Store No.",StoreNo);
IF FranchisesSetupStore.ISEMPTY THEN
ERROR(StoreErr,StoreNo);

FranchisesSetupStore.FINDFIRST;

// Que la franquicia tingui serie de contactes


FranchisesSetup.GET(FranchisesSetupStore.Code);
IF FranchisesSetup."Contact Nos." = '' THEN
ERROR(ContactNosErr);

//// Que tingui un client assignat


//IF FranchisesSetupStore."Customer No." = '' THEN
// ERROR(CustomerNotExistInStoreErr,StoreNo);
//Customer.GET(FranchisesSetupStore."Customer No.");

// // Si no existeix el contacte tipus empresa que es faci


// ContBusRel.SETCURRENTKEY("Link to Table","No.");
// ContBusRel.SETRANGE("Link to Table",ContBusRel."Link to Table"::Customer);
// ContBusRel.SETRANGE("No.",Customer."No.");
// IF ContBusRel.ISEMPTY THEN
// UpdateContFromCust.InsertNewContact(Customer,FALSE);
//
// CLEAR(ContBusRel);
// ContBusRel.SETCURRENTKEY("Link to Table","No.");
// ContBusRel.SETRANGE("Link to Table",ContBusRel."Link to Table"::Customer);
// ContBusRel.SETRANGE("No.",Customer."No.");
// ContBusRel.FINDFIRST;
// CompanyContact.GET(ContBusRel."Contact No.");

// Crear el contacte de tipus persona


CLEAR(PersonContact);
PersonContact.Type := PersonContact.Type::Person;
// PersonContact."Company No." := CompanyContact."No.";
// PersonContact."Company Name" := CompanyContact.Name;
PersonContact."No. Series" := FranchisesSetup."Contact Nos.";
PersonContact.VALIDATE(Name, JObject.GetValue('NombreCliente').ToString);
PersonContact.VALIDATE("VAT Registration No.",
JObject.GetValue('CIF_NIF').ToString);
PersonContact."Name 2" := JObject.GetValue('ApellidosCliente').ToString;
PersonContact."Phone No." := JObject.GetValue('TelefonoCliente').ToString;
PersonContact."Mobile Phone No." :=
JObject.GetValue('MovilCliente').ToString;
PersonContact.VALIDATE("E-Mail",JObject.GetValue('EmailCliente').ToString);
PersonContact.VALIDATE("Post Code",
JObject.GetValue('CodigoPostalCliente').ToString);
PersonContact.Address := JObject.GetValue('DireccionCliente').ToString;
PersonContact.VALIDATE("Country/Region Code",
JObject.GetValue('PaisCliente').ToString);
PersonContact.City := JObject.GetValue('Localidad').ToString;
PersonContact.County := JObject.GetValue('ProvinciaCliente').ToString;
PersonContact.SetSkipDefault;
PersonContact.INSERT(TRUE);
END;

[LineStart(6673)]
LOCAL PROCEDURE "-----Export-------"@1000000002();
BEGIN
END;

[LineStart(6676)]
LOCAL PROCEDURE ExportStock@1100225008(VAR FranchisesLogEntry@1100225000 :
Record 50124);
VAR
JObject@1100225002 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JSONManagement@1100225001 : Codeunit 5459;
FranchiseSetup@1100225003 : Record 50123;
FranchisesSetupStore@1100225005 : Record 50126;
ItemLedgerEntry@1100225004 : Record 32;
Store@1100225006 : Record 99001470;
JArray@1100225007 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
TempStoreStock@1100225008 : TEMPORARY Record 60008;
Barcodes@1100225009 : Record 99001451;
Item@1100225010 : Record 27;
JObject1@1100225011 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
jArrayString@1100225013 : Text;
Url@1100225014 : Text[100];
HttpWebRequestMgt@1100225021 : Codeunit 1297;
TempBlob@1100225020 : TEMPORARY Record 99008535;
Instr@1100225019 : InStream;
HttpStatusCode@1100225018 : DotNet "'System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.HttpStatusCode";
ResponseHeaders@1100225017 : DotNet "'System, Version=4.0.0.0,
Culture=neutral,
PublicKeyToken=b77a5c561934e089'.System.Collections.Specialized.NameValueCollection
";
APIResult@1100225016 : Text;
MyOutStream@1100225015 : OutStream;
TempJSONBuffer@1100225023 : TEMPORARY Record 1236;
ValueFromResult@1100225022 : Text;
DateInText@1100225025 : Text;
TimeInText@1100225024 : Text;
BEGIN
FranchiseSetup.GET(FranchisesLogEntry."Franchise Code");

FranchisesSetupStore.SETCURRENTKEY("Enable Store",Code,"Store No.");


FranchisesSetupStore.SETRANGE("Enable Store",TRUE);
FranchisesSetupStore.SETRANGE(Code,FranchiseSetup.Code);
IF FranchisesSetupStore.FINDSET THEN
REPEAT
Store.GET(FranchisesSetupStore."Store No.");

// Nom�s exportar els productes que tinguin en estoc


ItemLedgerEntry.SETCURRENTKEY("Item No.",Open,"Variant
Code",Positive,"Lot No.","Serial No.");
ItemLedgerEntry.SETRANGE(Open,TRUE);
ItemLedgerEntry.SETRANGE("Location Code",Store."Location Code");
ItemLedgerEntry.SETRANGE(Positive,TRUE);
IF ItemLedgerEntry.FINDSET THEN
REPEAT
IF NOT TempStoreStock.GET(Store."No.",Store."Location
Code",ItemLedgerEntry."Item No.") THEN BEGIN
Item.GET(ItemLedgerEntry."Item No.");
CLEAR(Barcodes);
Barcodes.SETCURRENTKEY("Item No.","Unit of Measure Code");
Barcodes.SETRANGE("Item No.", Item."No.");
Barcodes.SETRANGE("Unit of Measure Code", Item."Base Unit of
Measure");
IF Barcodes.FINDFIRST THEN BEGIN
TempStoreStock."Store No." := Store."No.";
TempStoreStock."Location Code" := Store."Location Code";
TempStoreStock."Item No." := ItemLedgerEntry."Item No.";
TempStoreStock."Item Barcode" := Barcodes."Barcode No.";
CLEAR(Item);
Item.SETFILTER("Location Filter",Store."Location Code");
Item.SETFILTER("No.",Barcodes."Item No.");
Item.FINDFIRST;
Item.CALCFIELDS(Inventory);
TempStoreStock.Inventory := Item.Inventory;
TempStoreStock.INSERT;
END;
END;
UNTIL ItemLedgerEntry.NEXT = 0;
UNTIL FranchisesSetupStore.NEXT = 0;

IF TempStoreStock.FINDSET THEN BEGIN


JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObject);
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoProveedor',
FranchiseSetup.Vendor);

JSONManagement.InitializeEmptyCollection();
JSONManagement.GetJsonArray(JArray);

DateInText := FORMAT(WORKDATE,0,'<Day,2>-<Month,2>-<Year4>');
TimeInText := FORMAT(TIME,0,'<Hours24,2>:<Minutes,2>:<Seconds,2>');

IF STRPOS(TimeInText,' ') = 1 THEN


TimeInText := CONVERTSTR(TimeInText,' ','0');

REPEAT
JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObject1);

JSONManagement.AddJPropertyToJObject(JObject1, 'CodigoTienda',
TempStoreStock."Store No.");
JSONManagement.AddJPropertyToJObject(JObject1, 'Fecha', STRSUBSTNO('%1
%2',DateInText,TimeInText));
JSONManagement.AddJPropertyToJObject(JObject1, 'CodBarras',
TempStoreStock."Item Barcode");
JSONManagement.AddJPropertyToJObject(JObject1, 'Stock',
TempStoreStock.Inventory);
JSONManagement.AddJObjectToJArray(JArray, JObject1);
UNTIL TempStoreStock.NEXT = 0;

JSONManagement.AddJArrayToJObject(JObject,'ListaStocks',JArray);

jArrayString := JObject.ToString();

IF jArrayString <> '' THEN BEGIN


CreateFile(FranchiseSetup,3,DateInText,JObject.ToString);

Url := FranchiseSetup."Endpoint URL" + FranchiseSetup."Endpoint Stock";

TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(MyOutStream, TEXTENCODING::UTF8);
MyOutStream.WRITETEXT(jArrayString);

HttpWebRequestMgt.Initialize(Url);
HttpWebRequestMgt.DisableUI;
HttpWebRequestMgt.SetMethod('POST');
HttpWebRequestMgt.SetContentType('application/json; charset=utf-8');
HttpWebRequestMgt.SetContentType('application/json; charset=utf-8');
HttpWebRequestMgt.AddHeader('Authorization', 'Basic ' +
FranchiseSetup."Base 64 Password");
HttpWebRequestMgt.SetTimeout(30000);
HttpWebRequestMgt.AddBodyBlob(TempBlob);

TempBlob.INIT;
TempBlob.Blob.CREATEINSTREAM(Instr);
IF HttpWebRequestMgt.GetResponse(Instr, HttpStatusCode, ResponseHeaders)
THEN BEGIN
APIResult := TempBlob.ReadAsText('', TEXTENCODING::UTF8);

// Guardem la resposta
CreateFile(FranchiseSetup,13,DateInText,APIResult);

TempJSONBuffer.ReadFromText(APIResult);
TempJSONBuffer.GetPropertyValue(ValueFromResult,'Estado');
CASE ValueFromResult OF
'OK': BEGIN
TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(MyOutStream, TEXTENCODING::UTF8);
MyOutStream.WRITETEXT(jArrayString);
FranchisesLogEntry."Json File" := TempBlob.Blob;
FranchisesLogEntry.MODIFY;
FranchiseSetup."Last Stock Sent" := WORKDATE;
FranchiseSetup.MODIFY;
END;
'OaK': BEGIN
TempJSONBuffer.GetPropertyValue(ValueFromResult,'MensajeError');
ERROR(COPYSTR(ValueFromResult,1,250));
END;
END;
END ELSE
ERROR(GETLASTERRORTEXT);
END;
END;
END;

[LineStart(6793)]
LOCAL PROCEDURE TransferSender@1100225003(VAR FranchisesLogEntry@1100225002 :
Record 50124;PostedWhseShipmentHeader@1100225000 : Record 7322);
VAR
JSONManagement@1100225001 : Codeunit 5459;
Barcodes@1100225003 : Record 99001451;
PostedWhseShipmentLine@1100225004 : Record 7323;
Item@1100225005 : Record 27;
TransferHeader@1000000011 : Record 5740;
Store@1000000012 : Record 99001470;
JObject@1000000010 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JObject1@1100225006 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JObject2@1000000003 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JArray@1000000000 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
JArray1@1000000009 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
PostPackLine@1000000001 : Record 50053;
PostPackLine1@1000000008 : Record 50053;
Url@1100225018 : Text[100];
HttpWebRequestMgt@1100225017 : Codeunit 1297;
TempBlob@1100225016 : TEMPORARY Record 99008535;
Instr@1100225015 : InStream;
HttpStatusCode@1100225014 : DotNet "'System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.HttpStatusCode";
ResponseHeaders@1100225013 : DotNet "'System, Version=4.0.0.0,
Culture=neutral,
PublicKeyToken=b77a5c561934e089'.System.Collections.Specialized.NameValueCollection
";
APIResult@1100225012 : Text;
MyOutStream@1100225011 : OutStream;
SalesPrice@1100225010 : Record 7002;
TempJSONBuffer@1100225009 : TEMPORARY Record 1236;
ValueFromResult@1100225008 : Text;
ValueToExport@1100225007 : Text;
jArrayString@1100225019 : Text;
FranchiseSetup@1100225020 : Record 50123;
TotalPackages@1100225021 : Integer;
TempPostPackLine@1100225022 : TEMPORARY Record 50053;
DateInText@1100225023 : Text;
TimeInText@1100225024 : Text;
PostPackLine2@1100225025 : Record 50053;
PostedWhseShipmentLine2@1100225026 : Record 7323;
RegisteredWhseActivityLine2@1100225027 : Record 5773;
PostedPackingLine2@1100225028 : Record 50053;
PostedPackingNo@1100225029 : Code[20];
FoundInPicking@1100225030 : Boolean;
PostedWhseShipmentHeaderCheck@1100225031 : Record 7322;
BEGIN
// Nom�s les franqu�cies que tinguin per enviar productes i configurat tot
FranchiseSetup.SETCURRENTKEY("Enable Franchise",Code,"Endpoint
Shipment","Endpoint URL",User,Password,"Base 64 Password");
FranchiseSetup.SETRANGE("Enable Franchise", TRUE);
FranchiseSetup.SETRANGE(Code,FranchisesLogEntry."Franchise Code");
FranchiseSetup.SETFILTER("Endpoint Shipment",'<>%1','');
FranchiseSetup.SETFILTER("Endpoint URL",'<>%1','');
FranchiseSetup.SETFILTER(User,'<>%1','');
FranchiseSetup.SETFILTER(Password,'<>%1','');
FranchiseSetup.SETFILTER("Base 64 Password",'<>%1','');
IF FranchiseSetup.FINDFIRST THEN BEGIN
DateInText := FORMAT(PostedWhseShipmentHeader."Posting Date",0,'<Day,2>-
<Month,2>-<Year4>');
TimeInText := FORMAT(PostedWhseShipmentHeader."Posting
Time",0,'<Hours24,2>:<Minutes,2>:<Seconds,2>');
IF STRPOS(TimeInText,' ') = 1 THEN
TimeInText := CONVERTSTR(TimeInText,' ','0');

JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObject);
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoProveedor',
FranchiseSetup.Vendor);
JSONManagement.AddJPropertyToJObject(JObject, 'NumeroDocumentoProveedor',
PostedWhseShipmentHeader."No.");
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoTienda',
FranchisesLogEntry."Store No.");
JSONManagement.AddJPropertyToJObject(JObject, 'Fecha', STRSUBSTNO('%1
%2',DateInText,TimeInText));

//<01022022
PostedWhseShipmentHeaderCheck.SETRANGE("Posted Packing No.",
PostedWhseShipmentHeader."Posted Packing No.");
IF PostedWhseShipmentHeaderCheck.COUNT > 1 THEN
ERROR('Existe m�s de 1 env�o registrado con el packing %1',
PostedWhseShipmentHeader."Posted Packing No.");

{PostedWhseShipmentLine2.SETRANGE("No.", PostedWhseShipmentHeader."No.");
IF PostedWhseShipmentLine2.FINDFIRST THEN BEGIN
RegisteredWhseActivityLine2.SETCURRENTKEY("Action Type","Source
No.","Source Line No.",Quantity);
RegisteredWhseActivityLine2.SETRANGE("Action Type",
RegisteredWhseActivityLine2."Action Type"::Take);
RegisteredWhseActivityLine2.SETRANGE("Source No.",
PostedWhseShipmentLine2."Source No.");
RegisteredWhseActivityLine2.SETRANGE("Source Line No.",
PostedWhseShipmentLine2."Source Line No.");
RegisteredWhseActivityLine2.SETRANGE(Quantity,
PostedWhseShipmentLine2.Quantity);
IF RegisteredWhseActivityLine2.FINDLAST THEN BEGIN
PostedPackingLine2.SETCURRENTKEY("Whse. Activity No.","Whse. Activity
Line No.");
PostedPackingLine2.SETRANGE("Whse. Activity No.",
RegisteredWhseActivityLine2."Source Act. No.");
PostedPackingLine2.SETRANGE("Whse. Activity Line No.",
RegisteredWhseActivityLine2."Source Act. Line No.");
IF PostedPackingLine2.FINDFIRST THEN BEGIN
PostPackLine.SETCURRENTKEY("Shipment No.","Source Line No.","Item
No.");
PostPackLine.SETRANGE("Packing No." ,PostedPackingLine2."Packing
No.");
PostPackLine.SETRANGE("Source Line
No.",PostedWhseShipmentLine2."Source Line No.");
PostPackLine.SETRANGE("Item No.",PostedWhseShipmentLine2."Item
No.");
FoundInPicking := TRUE;
END;
END;
IF NOT FoundInPicking THEN BEGIN
PostPackLine.SETCURRENTKEY("Shipment No.","Source Line No.","Item
No.");
PostPackLine.SETRANGE("Shipment No.",PostedWhseShipmentHeader."Whse.
Shipment No.");
PostPackLine.SETRANGE("Source Line
No.",PostedWhseShipmentLine."Source Line No.");
PostPackLine.SETRANGE("Item No.",PostedWhseShipmentLine."Item No.");
END;
END;

IF PostPackLine.FINDFIRST THEN
PostedPackingNo := PostPackLine."Packing No.";
END;}
//01022022>

CLEAR(PostPackLine);
//<01022022
//PostPackLine.SETRANGE("Packing No.",PostedWhseShipmentHeader."Posted
Packing No.");
IF PostedPackingNo = '' THEN
PostPackLine.SETRANGE("Packing No.",PostedWhseShipmentHeader."Posted
Packing No.")
ELSE
PostPackLine.SETRANGE("Packing No.",PostedPackingNo);
//01022022>
IF PostPackLine.FINDSET THEN
REPEAT
IF NOT TempPostPackLine.GET(PostPackLine."Package No.",0) THEN BEGIN
TempPostPackLine."Packing No." := PostPackLine."Package No.";
TempPostPackLine.INSERT;
END;
UNTIL PostPackLine.NEXT = 0;

JSONManagement.InitializeEmptyCollection();
JSONManagement.GetJsonArray(JArray);

CLEAR(TempPostPackLine);
IF TempPostPackLine.FINDSET THEN BEGIN
REPEAT
JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObject2);
JSONManagement.InitializeEmptyCollection();
JSONManagement.GetJsonArray(JArray1);

CLEAR(PostPackLine1);
PostPackLine1.SETCURRENTKEY("Packing No.","Package No.");
//<01022022
//PostPackLine1.SETRANGE("Packing No.",
PostedWhseShipmentHeader."Posted Packing No.");
IF PostedPackingNo = '' THEN
PostPackLine1.SETRANGE("Packing No.",PostedWhseShipmentHeader."Posted
Packing No.")
ELSE
PostPackLine1.SETRANGE("Packing No.",PostedPackingNo);
//01022022>
PostPackLine1.SETRANGE("Package No.", TempPostPackLine."Packing No.");
PostPackLine1.SETFILTER("Package Quantity",'<>%1',0);
IF PostPackLine1.FINDSET THEN
REPEAT
JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObject1);
Item.GET(PostPackLine1."Item No.");

CLEAR(Barcodes);
Barcodes.SETCURRENTKEY("Item No.","Unit of Measure Code");
Barcodes.SETRANGE("Item No.", Item."No.");
Barcodes.SETRANGE("Unit of Measure Code", Item."Base Unit of
Measure");
IF Barcodes.FINDFIRST THEN;

JSONManagement.AddJPropertyToJObject(JObject1, 'IdLinea',
PostPackLine1."Packing Line No.");
JSONManagement.AddJPropertyToJObject(JObject1, 'CodBarras',
Barcodes."Barcode No.");
JSONManagement.AddJPropertyToJObject(JObject1, 'Referencia',
PostPackLine1."Item No.");
JSONManagement.AddJPropertyToJObject(JObject1, 'Unidades',
PostPackLine1."Package Quantity");
JSONManagement.AddJPropertyToJObject(JObject1, 'CosteUnitario', 0);
JSONManagement.AddJPropertyToJObject(JObject1, 'PctDescuento', 0);
JSONManagement.AddJPropertyToJObject(JObject1, 'Descuento', 0);
JSONManagement.AddJPropertyToJObject(JObject1,
'CosteUnitarioDescuento', 0);
JSONManagement.AddJPropertyToJObject(JObject1, 'Total', 0);
JSONManagement.AddJPropertyToJObject(JObject1, 'TipoImpuesto', 0);
JSONManagement.AddJPropertyToJObject(JObject1,
'PorcentajeImpuesto', 0);
JSONManagement.AddJPropertyToJObject(JObject1, 'ImporteImpuesto',
0);
JSONManagement.AddJPropertyToJObject(JObject1, 'TotalConImpuesto',
0);
JSONManagement.AddJObjectToJArray(JArray1, JObject1);
UNTIL PostPackLine1.NEXT = 0;
JSONManagement.AddJPropertyToJObject(JObject2, 'NumeroBulto',
TempPostPackLine."Packing No.");
JSONManagement.AddJArrayToJObject(JObject2,'Lineas',JArray1);
JSONManagement.AddJObjectToJArray(JArray, JObject2);
JArray1.RemoveAll();
UNTIL TempPostPackLine.NEXT = 0;
END;

JSONManagement.AddJArrayToJObject(JObject, 'Bultos', JArray);

jArrayString := JObject.ToString();

IF jArrayString <> '' THEN BEGIN

CreateFile(FranchiseSetup,2,PostedWhseShipmentHeader."No.",JObject.ToString);

Url := FranchiseSetup."Endpoint URL" + FranchiseSetup."Endpoint


Shipment";

TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(MyOutStream, TEXTENCODING::UTF8);
MyOutStream.WRITETEXT(jArrayString);

HttpWebRequestMgt.Initialize(Url);
HttpWebRequestMgt.DisableUI;
HttpWebRequestMgt.SetMethod('POST');
HttpWebRequestMgt.SetContentType('application/json; charset=utf-8');
HttpWebRequestMgt.SetContentType('application/json; charset=utf-8');
HttpWebRequestMgt.AddHeader('Authorization', 'Basic ' +
FranchiseSetup."Base 64 Password");
HttpWebRequestMgt.SetTimeout(30000);
HttpWebRequestMgt.AddBodyBlob(TempBlob);

TempBlob.INIT;
TempBlob.Blob.CREATEINSTREAM(Instr);
IF HttpWebRequestMgt.GetResponse(Instr, HttpStatusCode, ResponseHeaders)
THEN BEGIN
APIResult := TempBlob.ReadAsText('', TEXTENCODING::UTF8);

// Guardem la resposta
CreateFile(FranchiseSetup,12,PostedWhseShipmentHeader."No.",APIResult);

TempJSONBuffer.ReadFromText(APIResult);
TempJSONBuffer.GetPropertyValue(ValueFromResult,'Estado');
CASE ValueFromResult OF
'OK': BEGIN
TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(MyOutStream, TEXTENCODING::UTF8);
MyOutStream.WRITETEXT(jArrayString);
FranchisesLogEntry."Json File" := TempBlob.Blob;
FranchisesLogEntry.MODIFY;
END;
'OaK': BEGIN
TempJSONBuffer.GetPropertyValue(ValueFromResult,'MensajeError');
ERROR(COPYSTR(ValueFromResult,1,250));
END;
END;
END ELSE
ERROR(GETLASTERRORTEXT);
END;
END ELSE
SetCheckedError(FranchisesLogEntry,NoFranchiseShipmentEndpointErr);
END;

[LineStart(6976)]
LOCAL PROCEDURE TransferSenderSGA@1000000008(VAR
FranchisesLogEntry@1100225002 : Record 50124;TransferShipmentHeader@1000000002 :
Record 5744);
VAR
JSONManagement@1100225001 : Codeunit 5459;
Barcodes@1100225003 : Record 99001451;
Item@1100225005 : Record 27;
TransferHeader@1000000011 : Record 5740;
Store@1000000012 : Record 99001470;
JObject@1000000010 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JObject1@1100225006 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JObject2@1000000003 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JArray@1000000000 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
JArray1@1000000009 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
Url@1100225018 : Text[100];
HttpWebRequestMgt@1100225017 : Codeunit 1297;
TempBlob@1100225016 : TEMPORARY Record 99008535;
Instr@1100225015 : InStream;
HttpStatusCode@1100225014 : DotNet "'System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.HttpStatusCode";
ResponseHeaders@1100225013 : DotNet "'System, Version=4.0.0.0,
Culture=neutral,
PublicKeyToken=b77a5c561934e089'.System.Collections.Specialized.NameValueCollection
";
APIResult@1100225012 : Text;
MyOutStream@1100225011 : OutStream;
SalesPrice@1100225010 : Record 7002;
TempJSONBuffer@1100225009 : TEMPORARY Record 1236;
ValueFromResult@1100225008 : Text;
ValueToExport@1100225007 : Text;
jArrayString@1100225019 : Text;
FranchiseSetup@1100225020 : Record 50123;
TotalPackages@1100225021 : Integer;
TempPostPackLine@1100225022 : TEMPORARY Record 50053;
DateInText@1100225023 : Text;
TimeInText@1100225024 : Text;
FoundInPicking@1100225030 : Boolean;
MyTime@1000000004 : Time;
RecRef@1000000005 : RecordRef;
FieRefShipmentNo@1000000006 : FieldRef;
FieRefPackageNo@1000000007 : FieldRef;
FieRefItemNo@1000000013 : FieldRef;
FieRefQuantity@1000000014 : FieldRef;
FieRefLineNo@1000000015 : FieldRef;
BEGIN
// Nom�s les franqu�cies que tinguin per enviar productes i configurat tot
FranchiseSetup.SETCURRENTKEY("Enable Franchise",Code,"Endpoint
Shipment","Endpoint URL",User,Password,"Base 64 Password");
FranchiseSetup.SETRANGE("Enable Franchise", TRUE);
FranchiseSetup.SETRANGE(Code,FranchisesLogEntry."Franchise Code");
FranchiseSetup.SETFILTER("Endpoint Shipment",'<>%1','');
FranchiseSetup.SETFILTER("Endpoint URL",'<>%1','');
FranchiseSetup.SETFILTER(User,'<>%1','');
FranchiseSetup.SETFILTER(Password,'<>%1','');
FranchiseSetup.SETFILTER("Base 64 Password",'<>%1','');
IF FranchiseSetup.FINDFIRST THEN BEGIN
DateInText := FORMAT(TransferShipmentHeader."Posting Date",0,'<Day,2>-
<Month,2>-<Year4>');
TimeInText := FORMAT(MyTime,0,'<Hours24,2>:<Minutes,2>:<Seconds,2>');
IF STRPOS(TimeInText,' ') = 1 THEN
TimeInText := CONVERTSTR(TimeInText,' ','0');

JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObject);
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoProveedor',
FranchiseSetup.Vendor);
JSONManagement.AddJPropertyToJObject(JObject, 'NumeroDocumentoProveedor',
TransferShipmentHeader."No.");
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoTienda',
FranchisesLogEntry."Store No.");
JSONManagement.AddJPropertyToJObject(JObject, 'Fecha', STRSUBSTNO('%1
%2',DateInText,TimeInText));

RecRef.OPEN(80025);
FieRefShipmentNo := RecRef.FIELD(110);
// INC-999 ==>
// Al cambiar el n�mero de documento externo en el flujo de los pedidos de
transferencia ahora en la 80025 el campo "Envio" tiene el numero de PT
FieRefShipmentNo.SETFILTER(TransferShipmentHeader."Transfer Order No.");
//FieRefShipmentNo.SETFILTER(TransferShipmentHeader."No.");
// INC-999 <==
IF RecRef.FINDSET() THEN
REPEAT
FieRefPackageNo := RecRef.FIELD(10);
IF NOT TempPostPackLine.GET(FieRefPackageNo.VALUE,0) THEN BEGIN
TempPostPackLine."Packing No." := FieRefPackageNo.VALUE;
TempPostPackLine.INSERT;
END;
UNTIL RecRef.NEXT=0;
RecRef.CLOSE();

JSONManagement.InitializeEmptyCollection();
JSONManagement.GetJsonArray(JArray);

CLEAR(TempPostPackLine);
IF TempPostPackLine.FINDSET THEN BEGIN
REPEAT
JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObject2);
JSONManagement.InitializeEmptyCollection();
JSONManagement.GetJsonArray(JArray1);

CLEAR(RecRef);
CLEAR(FieRefShipmentNo);
CLEAR(FieRefPackageNo);
CLEAR(FieRefItemNo);
CLEAR(FieRefQuantity);
RecRef.OPEN(80025);
FieRefShipmentNo := RecRef.FIELD(110);
// INC-999 ==>
// Al cambiar el n�mero de documento externo en el flujo de los pedidos
de transferencia ahora en la 80025 el campo "Envio" tiene el numero de PT
FieRefShipmentNo.SETFILTER(TransferShipmentHeader."Transfer Order
No.");
// FieRefShipmentNo.SETFILTER(TransferShipmentHeader."No.");
// INC-999 <==
FieRefPackageNo := RecRef.FIELD(10);
FieRefPackageNo.SETFILTER(TempPostPackLine."Packing No.");
IF RecRef.FINDSET() THEN
REPEAT
FieRefLineNo := RecRef.FIELD(20);
FieRefItemNo := RecRef.FIELD(30);
FieRefQuantity := RecRef.FIELD(40);

JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObject1);
Item.GET(FieRefItemNo.VALUE);

CLEAR(Barcodes);
Barcodes.SETCURRENTKEY("Item No.","Unit of Measure Code");
Barcodes.SETRANGE("Item No.", Item."No.");
Barcodes.SETRANGE("Unit of Measure Code", Item."Base Unit of
Measure");
IF Barcodes.FINDFIRST THEN BEGIN
JSONManagement.AddJPropertyToJObject(JObject1, 'IdLinea',
FieRefLineNo.VALUE);
JSONManagement.AddJPropertyToJObject(JObject1, 'CodBarras',
Barcodes."Barcode No.");
JSONManagement.AddJPropertyToJObject(JObject1, 'Referencia',
FieRefItemNo.VALUE);
JSONManagement.AddJPropertyToJObject(JObject1, 'Unidades',
FieRefQuantity.VALUE);
JSONManagement.AddJPropertyToJObject(JObject1, 'CosteUnitario',
0);
JSONManagement.AddJPropertyToJObject(JObject1, 'PctDescuento',
0);
JSONManagement.AddJPropertyToJObject(JObject1, 'Descuento', 0);
JSONManagement.AddJPropertyToJObject(JObject1,
'CosteUnitarioDescuento', 0);
JSONManagement.AddJPropertyToJObject(JObject1, 'Total', 0);
JSONManagement.AddJPropertyToJObject(JObject1, 'TipoImpuesto',
0);
JSONManagement.AddJPropertyToJObject(JObject1,
'PorcentajeImpuesto', 0);
JSONManagement.AddJPropertyToJObject(JObject1, 'ImporteImpuesto',
0);
JSONManagement.AddJPropertyToJObject(JObject1,
'TotalConImpuesto', 0);
JSONManagement.AddJObjectToJArray(JArray1, JObject1);
END ELSE
ERROR('El producto %1 no tiene c�digo de barras consulte con
operaciones', Item."No.");
UNTIL RecRef.NEXT=0;
RecRef.CLOSE();
JSONManagement.AddJPropertyToJObject(JObject2, 'NumeroBulto',
TempPostPackLine."Packing No.");
JSONManagement.AddJArrayToJObject(JObject2,'Lineas',JArray1);
JSONManagement.AddJObjectToJArray(JArray, JObject2);
JArray1.RemoveAll();
UNTIL TempPostPackLine.NEXT = 0;
END;

JSONManagement.AddJArrayToJObject(JObject, 'Bultos', JArray);

jArrayString := JObject.ToString();

IF jArrayString <> '' THEN BEGIN

CreateFile(FranchiseSetup,2,TransferShipmentHeader."No.",JObject.ToString);

Url := FranchiseSetup."Endpoint URL" + FranchiseSetup."Endpoint


Shipment";

TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(MyOutStream, TEXTENCODING::UTF8);
MyOutStream.WRITETEXT(jArrayString);

HttpWebRequestMgt.Initialize(Url);
HttpWebRequestMgt.DisableUI;
HttpWebRequestMgt.SetMethod('POST');
HttpWebRequestMgt.SetContentType('application/json; charset=utf-8');
HttpWebRequestMgt.SetContentType('application/json; charset=utf-8');
HttpWebRequestMgt.AddHeader('Authorization', 'Basic ' +
FranchiseSetup."Base 64 Password");
HttpWebRequestMgt.SetTimeout(30000);
HttpWebRequestMgt.AddBodyBlob(TempBlob);

TempBlob.INIT;
TempBlob.Blob.CREATEINSTREAM(Instr);
IF HttpWebRequestMgt.GetResponse(Instr, HttpStatusCode, ResponseHeaders)
THEN BEGIN
APIResult := TempBlob.ReadAsText('', TEXTENCODING::UTF8);

// Guardem la resposta
CreateFile(FranchiseSetup,12,TransferShipmentHeader."No.",APIResult);

TempJSONBuffer.ReadFromText(APIResult);
TempJSONBuffer.GetPropertyValue(ValueFromResult,'Estado');
CASE ValueFromResult OF
'OK': BEGIN
TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(MyOutStream, TEXTENCODING::UTF8);
MyOutStream.WRITETEXT(jArrayString);
FranchisesLogEntry."Json File" := TempBlob.Blob;
FranchisesLogEntry.MODIFY;
END;
'OaK': BEGIN
TempJSONBuffer.GetPropertyValue(ValueFromResult,'MensajeError');
ERROR(COPYSTR(ValueFromResult,1,250));
END;
END;
END ELSE
ERROR(GETLASTERRORTEXT);
END;
END ELSE
SetCheckedError(FranchisesLogEntry,NoFranchiseShipmentEndpointErr);
END;

[LineStart(7133)]
LOCAL PROCEDURE ItemSender@1100225002(VAR FranchisesLogEntry@1100225023 :
Record 50124;Item@1100225002 : Record 27);
VAR
JObject@1100225001 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JObjectSon@1100225010 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JSONManagement@1100225000 : Codeunit 5459;
MRWCodes@1100225004 : Record 50012;
Division@1100225005 : Record 10000787;
ItemCategory@1100225006 : Record 5722;
ProductGroup@1100225007 : Record 5723;
Barcodes@1100225008 : Record 99001451;
FranchiseSetup@1000000000 : Record 50123;
AttributeValue@1000000001 : Record 10000786;
jArrayString@1100225009 : Text;
JArray@1100225011 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
i@1100225013 : Integer;
Url@1100225018 : Text[100];
HttpWebRequestMgt@1100225017 : Codeunit 1297;
TempBlob@1100225016 : TEMPORARY Record 99008535;
Instr@1100225015 : InStream;
HttpStatusCode@1100225014 : DotNet "'System, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Net.HttpStatusCode";
ResponseHeaders@1100225012 : DotNet "'System, Version=4.0.0.0,
Culture=neutral,
PublicKeyToken=b77a5c561934e089'.System.Collections.Specialized.NameValueCollection
";
APIResult@1100225003 : Text;
MyOutStream@1100225020 : OutStream;
SalesPrice@1100225019 : Record 7002;
TempJSONBuffer@1100225021 : TEMPORARY Record 1236;
ValueFromResult@1100225022 : Text;
ValueToExport@1100225024 : Text;
Customer@1100225025 : Record 18;
Magento@1100225026 : Codeunit 50003;
TempItemPictureBuffer@1100225027 : TEMPORARY Record 31;
ItemDescription@1100225030 : Text;
ShortDescription@1100225029 : Text;
LongDescription@1100225028 : Text;
Magento2@1100225031 : Codeunit 50064;
ItemManagement@1000000003 : Codeunit 50034;
BEGIN
// Nom�s les franqu�cies que tinguin per enviar productes i configurat tot
FranchiseSetup.SETCURRENTKEY("Enable Franchise",Code,"Endpoint
Shipment","Endpoint URL",User,Password,"Base 64 Password");
FranchiseSetup.SETRANGE("Enable Franchise", TRUE);
FranchiseSetup.SETRANGE(Code,FranchisesLogEntry."Franchise Code");
FranchiseSetup.SETFILTER("Endpoint Items",'<>%1','');
FranchiseSetup.SETFILTER("Endpoint URL",'<>%1','');
FranchiseSetup.SETFILTER(User,'<>%1','');
FranchiseSetup.SETFILTER(Password,'<>%1','');
FranchiseSetup.SETFILTER("Base 64 Password",'<>%1','');
IF FranchiseSetup.FINDSET THEN BEGIN
REPEAT
// AGV-000 ==>
//<532
// IF Item."Send Item Info To Franchise" THEN BEGIN
// Item."Send Item Info To Franchise" := FALSE;
// Item.MODIFY;
// END;
//532>
// AGV-000 <==

i := 0;
JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObject);
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoProveedor',
FranchiseSetup.Vendor);
JSONManagement.AddJPropertyToJObject(JObject, 'Referencia', Item."No.");
JSONManagement.AddJPropertyToJObject(JObject, 'AgrupacionSKU',
Item."No.");

CLEAR(Barcodes);
Barcodes.SETCURRENTKEY("Item No.","Unit of Measure Code");
Barcodes.SETRANGE("Item No.", Item."No.");
Barcodes.SETRANGE("Unit of Measure Code", Item."Base Unit of Measure");
IF NOT Barcodes.FINDFIRST THEN
CLEAR(Barcodes);

JSONManagement.AddJPropertyToJObject(JObject, 'CodBarrasPrincipal',
Barcodes."Barcode No.");

JSONManagement.InitializeEmptyCollection();
JSONManagement.GetJsonArray(JArray);

CLEAR(Barcodes);
Barcodes.SETCURRENTKEY("Item No.","Unit of Measure Code");
Barcodes.SETRANGE("Item No.", Item."No.");
Barcodes.SETFILTER("Unit of Measure Code", '<>%1', Item."Base Unit of
Measure");
IF Barcodes.FINDSET THEN
REPEAT
JArray.Add(Barcodes."Barcode No.");
i += 1;
UNTIL Barcodes.NEXT = 0;

JSONManagement.AddJsonArray('CodBarrasSecundario', JArray.ToString);
JArray.RemoveAll;

//Talla. Si no hi ha valor, posar 'Talla �nica'


ValueToExport := '';
GetAttributeValue(AttributeValue, Item, FranchiseSetup.FIELDNO("Size
Attribute"), FranchiseSetup);
ValueToExport := AttributeValue."Attribute Value";
IF ValueToExport = '' THEN
ValueToExport := 'Talla �nica';
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoTalla',
COPYSTR(ValueToExport,1,20));
JSONManagement.AddJPropertyToJObject(JObject, 'DescripcionTalla',
COPYSTR(ValueToExport,1,50));
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoLargo', '');
JSONManagement.AddJPropertyToJObject(JObject, 'DescripcionLargo', '');

//Color. Si no hi ha valor, posar 'No color'


ValueToExport := '';
GetAttributeValue(AttributeValue, Item, FranchiseSetup.FIELDNO("Color
Attribute"), FranchiseSetup);
ValueToExport := AttributeValue."Attribute Value";
IF ValueToExport = '' THEN
ValueToExport := 'No color';
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoColor',
COPYSTR(ValueToExport,1,20));
JSONManagement.AddJPropertyToJObject(JObject, 'DescripcionColor',
COPYSTR(ValueToExport,1,50));

JSONManagement.InitializeEmptyCollection();
JSONManagement.GetJsonArray(JArray);
JSONManagement.AddJsonArray('ColorNormalizado', JArray.ToString);
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoAgrupacion', '');

//Item descriptions and URL


IF Item."Magento Code" <> 0 THEN BEGIN
//<542
//Magento.catalogProductAttributeMediaInfo(Item,TempItemPictureBuffer);

//Magento.catalogProductInfo(Item,ItemDescription,ShortDescription,LongDescription)
; //<532
Magento2.productMediaInfo(Item, TempItemPictureBuffer);
Magento2.productDescriptionInfo(Item, LongDescription);
//542>
END;

//<532
//IF ItemDescription = '' THEN
// ItemDescription := Item.Description;

//IF ShortDescription = '' THEN


// ShortDescription := Item.Description;

IF LongDescription = '' THEN


LongDescription := Item.Description;
//532>

JSONManagement.AddJPropertyToJObject(JObject, 'Descripcion',
Item.Description);
JSONManagement.AddJPropertyToJObject(JObject, 'Resumen',
Item.Description);
JSONManagement.AddJPropertyToJObject(JObject, 'DescripcionLarga',
LongDescription);
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoCapsula',
Item."Collection No.");
IF NOT MRWCodes.GET(MRWCodes.Type::Collection, Item."Collection No.")
THEN
CLEAR(MRWCodes);
JSONManagement.AddJPropertyToJObject(JObject, 'Capsula',
MRWCodes.Description);

JSONManagement.AddJPropertyToJObject(JObject, 'CodigoTemporada', '');


JSONManagement.AddJPropertyToJObject(JObject, 'DescripcionTemporada',
'');
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoA�o',
Item."Collection Year");
IF NOT MRWCodes.GET(MRWCodes.Type::Year, Item."Collection Year") THEN
CLEAR(MRWCodes);
JSONManagement.AddJPropertyToJObject(JObject, 'DescripcionA�o',
MRWCodes.Description);

JSONManagement.AddJPropertyToJObject(JObject, 'CodigoGenero', '');


JSONManagement.AddJPropertyToJObject(JObject, 'DescripcionGenero', '');
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoClasificacion1',
Item."Division Code");
IF NOT Division.GET(Item."Division Code") THEN
CLEAR(Division);
JSONManagement.AddJPropertyToJObject(JObject,
'DescripcionClasificacion1', Division.Description);

JSONManagement.AddJPropertyToJObject(JObject, 'CodigoClasificacion2',
Item."Item Category Code");
IF NOT ItemCategory.GET(Item."Item Category Code") THEN
CLEAR(ItemCategory);
JSONManagement.AddJPropertyToJObject(JObject,
'DescripcionClasificacion2', ItemCategory.Description);

JSONManagement.AddJPropertyToJObject(JObject, 'CodigoClasificacion3',
Item."Product Group Code");
IF NOT ProductGroup.GET(Item."Item Category Code", Item."Product Group
Code") THEN
CLEAR(ProductGroup);
JSONManagement.AddJPropertyToJObject(JObject,
'DescripcionClasificacion3', ProductGroup.Description);

JSONManagement.AddJPropertyToJObject(JObject, 'CodigoClasificacion4',
'');
JSONManagement.AddJPropertyToJObject(JObject,
'DescripcionClasificacion4', '');

JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObjectSon);
JSONManagement.AddJPropertyToJObject(JObjectSon, 'Peso', '');
JSONManagement.AddJPropertyToJObject(JObjectSon, 'Largo', '');
JSONManagement.AddJPropertyToJObject(JObjectSon, 'Ancho', '');
JSONManagement.AddJPropertyToJObject(JObjectSon, 'Alto','');
JSONManagement.AddJObjectToJObject(JObject, 'AspectoFisico', JObjectSon);

JSONManagement.InitializeEmptyCollection();
JSONManagement.GetJsonArray(JArray);
JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObjectSon);
JSONManagement.AddJPropertyToJObject(JObjectSon, 'Canal',
FranchiseSetup."Channel 1");
JSONManagement.AddJPropertyToJObject(JObjectSon, 'Activo',
FranchiseSetup."Active 1");
JSONManagement.AddJObjectToJArray(JArray, JObjectSon);

JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObjectSon);
JSONManagement.AddJPropertyToJObject(JObjectSon, 'Canal',
FranchiseSetup."Channel 2");
JSONManagement.AddJPropertyToJObject(JObjectSon, 'Activo',
FranchiseSetup."Active 2");
JSONManagement.AddJObjectToJArray(JArray, JObjectSon);
JSONManagement.AddJArrayToJObject(JObject, 'CanalesActivos', JArray);

JSONManagement.InitializeEmptyCollection();
JSONManagement.GetJsonArray(JArray);
JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObjectSon);
IF TempItemPictureBuffer.FINDSET THEN BEGIN
REPEAT
JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObjectSon);
JSONManagement.AddJPropertyToJObject(JObjectSon, 'URL',
TempItemPictureBuffer."File Name");
JSONManagement.AddJObjectToJArray(JArray, JObjectSon);
UNTIL TempItemPictureBuffer.NEXT = 0;
END ELSE BEGIN
//JSONManagement.AddJPropertyToJObject(JObjectSon, 'URL', '');
//JSONManagement.AddJPropertyToJObject(JObjectSon, 'Principal', '');
//JSONManagement.AddJObjectToJArray(JArray, JObjectSon);
END;
JSONManagement.AddJArrayToJObject(JObject, 'UrlImagenes', JArray);

//Marca. Si no hi ha valor, posar 'Mr Wonderful'


ValueToExport := '';
GetAttributeValue(AttributeValue, Item, FranchiseSetup.FIELDNO("Brand
Attribute"), FranchiseSetup);
ValueToExport := AttributeValue."Attribute Value";
IF ValueToExport = '' THEN
ValueToExport := 'Mr Wonderful';
JSONManagement.AddJPropertyToJObject(JObject, 'CodigoMarca',
COPYSTR(ValueToExport,1,20));
JSONManagement.AddJPropertyToJObject(JObject, 'Marca',
COPYSTR(ValueToExport,1,50));

JSONManagement.InitializeEmptyCollection();
JSONManagement.GetJsonArray(JArray);
JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObjectSon);
//JSONManagement.AddJPropertyToJObject(JObjectSon, 'CodigoMaterial', '');
//JSONManagement.AddJPropertyToJObject(JObjectSon, 'DescripcionMaterial',
'');
//JSONManagement.AddJObjectToJArray(JArray, JObjectSon);
JSONManagement.AddJArrayToJObject(JObject, 'Materiales', JArray);

// Tarifa de venda que t� que vendre la franquicia


IF FranchiseSetup."PVP Customer Price Group" <> '' THEN BEGIN
CLEAR(SalesPrice);
SalesPrice.SETCURRENTKEY("Item No.","Sales Type","Sales Code","Ending
Date","Starting Date");
SalesPrice.SETRANGE("Item No.", Item."No.");
SalesPrice.SETRANGE("Sales Type", SalesPrice."Sales Type"::"Customer
Price Group");
SalesPrice.SETRANGE("Sales Code",FranchiseSetup."PVP Customer Price
Group");
SalesPrice.SETFILTER("Ending Date",'%1|>=%2', 0D, WORKDATE);
SalesPrice.SETRANGE("Starting Date", 0D, WORKDATE);
IF SalesPrice.FINDLAST THEN;
END;
JSONManagement.AddJPropertyToJObject(JObject, 'PVP', SalesPrice."Unit
Price Including VAT");
CLEAR(SalesPrice);

// Preu de venda que fa MRW a la franquicia


IF FranchiseSetup."Cost Customer Price Group" <> '' THEN BEGIN
SalesPrice.SETCURRENTKEY("Item No.","Sales Type","Sales Code","Ending
Date","Starting Date");
SalesPrice.SETRANGE("Item No.", Item."No.");
SalesPrice.SETRANGE("Sales Type", SalesPrice."Sales Type"::"Customer
Price Group");
SalesPrice.SETRANGE("Sales Code",FranchiseSetup."Cost Customer Price
Group");
SalesPrice.SETFILTER("Ending Date",'%1|>=%2', 0D, WORKDATE);
SalesPrice.SETRANGE("Starting Date", 0D, WORKDATE);
IF SalesPrice.FINDLAST THEN;
END;
JSONManagement.AddJPropertyToJObject(JObject, 'Coste', SalesPrice."Unit
Price");

JSONManagement.InitializeEmptyCollection();
JSONManagement.GetJsonArray(JArray);
JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObjectSon);
JSONManagement.AddJPropertyToJObject(JObjectSon, 'Caracteristica', 'Es
consumible');
IF Item."Item Class" = Item."Item Class"::Consumable THEN
JSONManagement.AddJPropertyToJObject(JObjectSon, 'Valor', '1')
ELSE
JSONManagement.AddJPropertyToJObject(JObjectSon, 'Valor', '0');
JSONManagement.AddJObjectToJArray(JArray, JObjectSon);
JSONManagement.AddJArrayToJObject(JObject,'OtrasCaracteristicas',
JArray);

JSONManagement.InitializeEmptyCollection();
JSONManagement.GetJsonArray(JArray);
JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObjectSon);
//JSONManagement.AddJPropertyToJObject(JObjectSon, 'Codigo', '');
//JSONManagement.AddJPropertyToJObject(JObjectSon, 'Descripcion', '');
//JSONManagement.AddJObjectToJArray(JArray, JObjectSon);
JSONManagement.AddJArrayToJObject(JObject,'ClasificacionWeb', JArray);

jArrayString := JObject.ToString();

IF jArrayString <> '' THEN BEGIN


CreateFile(FranchiseSetup,1,Item."No.",JObject.ToString);

Url := FranchiseSetup."Endpoint URL" + FranchiseSetup."Endpoint Items";

TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(MyOutStream, TEXTENCODING::UTF8);
MyOutStream.WRITETEXT(jArrayString);

HttpWebRequestMgt.Initialize(Url);
HttpWebRequestMgt.DisableUI;
HttpWebRequestMgt.SetMethod('POST');
HttpWebRequestMgt.SetContentType('application/json; charset=utf-8');
HttpWebRequestMgt.SetContentType('application/json; charset=utf-8');
HttpWebRequestMgt.AddHeader('Authorization', 'Basic ' +
FranchiseSetup."Base 64 Password");
HttpWebRequestMgt.SetTimeout(30000);
HttpWebRequestMgt.AddBodyBlob(TempBlob);

TempBlob.INIT;
TempBlob.Blob.CREATEINSTREAM(Instr);
IF HttpWebRequestMgt.GetResponse(Instr, HttpStatusCode,
ResponseHeaders) THEN BEGIN
APIResult := TempBlob.ReadAsText('', TEXTENCODING::UTF8);

// Guardem la resposta
CreateFile(FranchiseSetup,11,Item."No.",APIResult);

TempJSONBuffer.ReadFromText(APIResult);
TempJSONBuffer.GetPropertyValue(ValueFromResult,'Estado');
CASE ValueFromResult OF
'OK': BEGIN
TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(MyOutStream, TEXTENCODING::UTF8);
MyOutStream.WRITETEXT(jArrayString);
FranchisesLogEntry."Json File" := TempBlob.Blob;
FranchisesLogEntry.MODIFY;
// AGV-000 ==>
ItemManagement.UpdateItemExtensionFranchise(Item."No.");
// AGV-000 <==
END;
'OaK': BEGIN
TempJSONBuffer.GetPropertyValue(ValueFromResult,'MensajeError');
ERROR(COPYSTR(ValueFromResult,1,250));
END;
END;
END ELSE
ERROR(GETLASTERRORTEXT);
END;
UNTIL FranchiseSetup.NEXT = 0;
END ELSE
SetCheckedError(FranchisesLogEntry,NoFranchiseItemEndpointErr);
END;

[LineStart(7427)]
LOCAL PROCEDURE "---From Subscription----"@1000000009();
BEGIN
END;

[LineStart(7430)]
PROCEDURE ItemLogEntry@1000000000(Item@1000000000 : Record
27;FranchiseCode@1100225001 : Code[20]);
VAR
FranchisesSetup@1100225000 : Record 50123;
FranchisesLogEntry@1000000001 : Record 50124;
Barcodes@1100225003 : Record 99001451;
SalesPrice@1100225002 : Record 7002;
ItemStatusSync@1100225005 : Record 50137;
CreateItem@1100225004 : Boolean;
BEGIN
IF Item.ISTEMPORARY THEN
EXIT;
IF Item.Blocked THEN
EXIT;

FranchisesSetup.SETCURRENTKEY("Enable Franchise","Endpoint Items","Enable


Export Item Information");
FranchisesSetup.SETRANGE("Enable Franchise", TRUE);
FranchisesSetup.SETFILTER("Endpoint Items",'<>%1','');
FranchisesSetup.SETRANGE("Enable Export Item Information",TRUE);
IF FranchiseCode <> '' THEN
FranchisesSetup.SETRANGE(Code,FranchiseCode);
IF FranchisesSetup.ISEMPTY THEN
EXIT;

FranchisesSetup.FINDSET;
REPEAT
CreateItem := FALSE;
// Si es de tipus consumible, enviar
IF Item."Item Class" = Item."Item Class"::Consumable THEN
CreateItem := TRUE
ELSE BEGIN
//<565
// T� que tindre una tarifa venta al franquiciant
IF FranchisesSetup."Cost Customer Price Group" <> '' THEN BEGIN
// Si no existeix tarifa de PVP llavors no crea registre
CLEAR(SalesPrice);
SalesPrice.SETCURRENTKEY("Item No.","Sales Type","Sales Code","Ending
Date","Starting Date");
SalesPrice.SETRANGE("Item No.", Item."No.");
SalesPrice.SETRANGE("Sales Type", SalesPrice."Sales Type"::"Customer
Price Group");
SalesPrice.SETRANGE("Sales Code",FranchisesSetup."Cost Customer Price
Group");
SalesPrice.SETFILTER("Ending Date",'%1|>=%2', 0D, WORKDATE);
SalesPrice.SETRANGE("Starting Date", 0D, WORKDATE);
IF NOT SalesPrice.ISEMPTY THEN
CreateItem := TRUE;
END;
//565>

// Si no t� codi de barres que surti


IF CreateItem THEN BEGIN
CLEAR(Barcodes);
Barcodes.SETCURRENTKEY("Item No.","Unit of Measure Code");
Barcodes.SETRANGE("Item No.", Item."No.");
Barcodes.SETRANGE("Unit of Measure Code", Item."Base Unit of Measure");
IF Barcodes.ISEMPTY THEN
CreateItem := FALSE
END;
//<565
// No enviar si no es configura segons estat de franqu�cia
// AGV-000 ==>
// IF CreateItem THEN BEGIN
// CLEAR(ItemStatusSync);
// ItemStatusSync.SETRANGE(Code, FranchisesSetup.Code);
// ItemStatusSync.SETRANGE(Status, Item.Status);
// ItemStatusSync.SETRANGE("Sync Franchise", TRUE);
// IF ItemStatusSync.ISEMPTY THEN
// CreateItem := FALSE;
// END;
// AGV-000 <==
//565>
END;

IF CreateItem THEN BEGIN


// Si ja est� el registre d'aquest producte pendent de processar, llavors
no cal tornar a crear el registre
FranchisesLogEntry.SETCURRENTKEY(Operation,RecordID,Processed,"Franchise
Code");

FranchisesLogEntry.SETRANGE(Operation,FranchisesLogEntry.Operation::Item);
FranchisesLogEntry.SETRANGE(RecordID,Item.RECORDID);
FranchisesLogEntry.SETRANGE(Processed,FALSE);
FranchisesLogEntry.SETRANGE("Franchise Code",FranchisesSetup.Code);
IF FranchisesLogEntry.ISEMPTY THEN BEGIN
// Si no hi ha res pendent, es crea el log per enviar la info d'aquest
producte
FranchisesLogEntry.INIT;
FranchisesLogEntry.Action := FranchisesLogEntry.Action::Send;
FranchisesLogEntry.Operation := FranchisesLogEntry.Operation::Item;
FranchisesLogEntry.RecordID := Item.RECORDID;
FranchisesLogEntry."Source Operation" := Item."No.";
FranchisesLogEntry."Franchise Code" := FranchisesSetup.Code;
FranchisesLogEntry."Store Type" := FranchisesLogEntry."Store
Type"::Franchise; //<528
FranchisesLogEntry.INSERT(TRUE);
END;
END;
UNTIL FranchisesSetup.NEXT = 0;
END;

[LineStart(7514)]
PROCEDURE TransferLogEntry@1000000001(WarehouseShipmentHeader@1100225004 :
Record 7320);
VAR
Store@1100225000 : Record 99001470;
TransferHeader@1100225001 : Record 5740;
FranchisesSetup@1100225002 : Record 50123;
PostedWhseShipmentHeader@1000000001 : Record 7322;
PostedWhseShipmentLine@1100225003 : Record 7323;
FranchisesSetupStore@1100225005 : Record 50126;
FranchisesLogEntry@1000000000 : Record 50124;
BEGIN
IF WarehouseShipmentHeader.ISTEMPORARY THEN
EXIT;

PostedWhseShipmentLine.SETCURRENTKEY("Whse. Shipment No.","Whse Shipment Line


No.");
PostedWhseShipmentLine.SETRANGE("Whse. Shipment
No.",WarehouseShipmentHeader."No.");
IF PostedWhseShipmentLine.ISEMPTY THEN
EXIT;

PostedWhseShipmentLine.FINDFIRST;

IF PostedWhseShipmentLine."Source Type" <> DATABASE::"Transfer Line" THEN


EXIT;
IF NOT PostedWhseShipmentHeader.GET(PostedWhseShipmentLine."No.") THEN
EXIT;

Store.SETCURRENTKEY("Location Code");
Store.SETRANGE("Location Code", PostedWhseShipmentLine."Destination No.");
IF Store.FINDFIRST THEN BEGIN
FranchisesSetup.SETCURRENTKEY("Enable Franchise","Endpoint Shipment");
FranchisesSetup.SETRANGE("Enable Franchise", TRUE);
FranchisesSetup.SETFILTER("Endpoint Shipment",'<>%1','');
IF FranchisesSetup.FINDSET THEN BEGIN
REPEAT
CLEAR(FranchisesSetupStore);
FranchisesSetupStore.SETCURRENTKEY("Enable Store",Code,"Store No.");
FranchisesSetupStore.SETRANGE("Enable Store",TRUE);
FranchisesSetupStore.SETRANGE(Code,FranchisesSetup.Code);
FranchisesSetupStore.SETRANGE("Store No.",Store."No.");
IF NOT FranchisesSetupStore.ISEMPTY THEN BEGIN
FranchisesLogEntry.INIT;
FranchisesLogEntry.Action := FranchisesLogEntry.Action::Send;
FranchisesLogEntry.Operation :=
FranchisesLogEntry.Operation::Shipment;
FranchisesLogEntry.RecordID := PostedWhseShipmentHeader.RECORDID;
FranchisesLogEntry."Source Operation" :=
PostedWhseShipmentHeader."No.";
FranchisesLogEntry."Franchise Code" := FranchisesSetup.Code;
FranchisesLogEntry."Store No." := Store."No.";
FranchisesLogEntry."Store Type" := FranchisesLogEntry."Store
Type"::Franchise; //<528
FranchisesLogEntry.INSERT(TRUE);

CreateItemLogEntryFromPostedShipment(PostedWhseShipmentHeader,FranchisesSetup.Code)
;
END;
UNTIL FranchisesSetup.NEXT = 0;
END;
END;
END;

[LineStart(7560)]
PROCEDURE TransferLogEntrySGA@1000000012(TransferShipmentHeader@1100225004 :
Record 5744);
VAR
Store@1100225000 : Record 99001470;
TransferHeader@1100225001 : Record 5740;
FranchisesSetup@1100225002 : Record 50123;
FranchisesSetupStore@1100225005 : Record 50126;
FranchisesLogEntry@1000000000 : Record 50124;
TransferShipmentLine@1000000002 : Record 5745;
BEGIN
IF TransferShipmentHeader.ISTEMPORARY THEN
EXIT;

TransferShipmentLine.SETRANGE(TransferShipmentLine."Document
No.",TransferShipmentHeader."No.");
IF NOT TransferShipmentLine.FINDSET() THEN
EXIT;

Store.SETCURRENTKEY("Location Code");
Store.SETRANGE("Location Code", TransferShipmentHeader."Transfer-to Code");
IF Store.FINDFIRST THEN BEGIN
FranchisesSetup.SETCURRENTKEY("Enable Franchise","Endpoint Shipment");
FranchisesSetup.SETRANGE("Enable Franchise", TRUE);
FranchisesSetup.SETFILTER("Endpoint Shipment",'<>%1','');
IF FranchisesSetup.FINDSET THEN BEGIN
REPEAT
CLEAR(FranchisesSetupStore);
FranchisesSetupStore.SETCURRENTKEY("Enable Store",Code,"Store No.");
FranchisesSetupStore.SETRANGE("Enable Store",TRUE);
FranchisesSetupStore.SETRANGE(Code,FranchisesSetup.Code);
FranchisesSetupStore.SETRANGE("Store No.",Store."No.");
IF NOT FranchisesSetupStore.ISEMPTY THEN BEGIN
FranchisesLogEntry.INIT;
FranchisesLogEntry.Action := FranchisesLogEntry.Action::Send;
FranchisesLogEntry.Operation :=
FranchisesLogEntry.Operation::ShipmentSGA;
FranchisesLogEntry.RecordID := TransferShipmentHeader.RECORDID;
FranchisesLogEntry."Source Operation" :=
TransferShipmentHeader."No.";
FranchisesLogEntry."Franchise Code" := FranchisesSetup.Code;
FranchisesLogEntry."Store No." := Store."No.";
FranchisesLogEntry."Store Type" := FranchisesLogEntry."Store
Type"::Franchise; //<528
FranchisesLogEntry.INSERT(TRUE);

CreateItemLogEntryFromTransferShipment(TransferShipmentHeader,FranchisesSetup.Code)
;
END;
UNTIL FranchisesSetup.NEXT = 0;
END;
END;
END;

[LineStart(7598)]
LOCAL PROCEDURE "----Functions-----"@1100225000();
BEGIN
END;

[LineStart(7601)]
LOCAL PROCEDURE GetAttributeValue@1000000007(VAR AttributeValue@1000000000 :
Record 10000786;item@1000000001 : Record 27;FieldNo@1000000002 :
Integer;FranchiseSetup@1000000003 : Record 50123);
VAR
RecRef@1000000004 : RecordRef;
FieldRec@1000000005 : FieldRef;
BEGIN
RecRef.OPEN(DATABASE::"Franchises Setup", FALSE);
RecRef.SETTABLE(FranchiseSetup);
RecRef.FINDFIRST;
FieldRec := RecRef.FIELD(FieldNo);

CLEAR(AttributeValue);
AttributeValue.SETCURRENTKEY("Link Type","Attribute Code","Link Field 1");
AttributeValue.SETRANGE("Link Type", AttributeValue."Link Type"::Item);
AttributeValue.SETRANGE("Attribute Code", FORMAT(FieldRec.VALUE));
AttributeValue.SETRANGE("Link Field 1", item."No.");
IF AttributeValue.FINDFIRST THEN;
END;
[LineStart(7614)]
PROCEDURE CreateFile@1100225015(VAR FranchiseSetup@1100225005 : Record
50123;SourceType@1100225006 : Integer;SourceNo@1100225007 :
Code[20];JsonText@1100225001 : Text) : Text;
VAR
PrintFile@1100225000 : File;
FileMgt@1100225004 : Codeunit 419;
FileNameValue@1100225008 : TextConst 'ESP=%1%2_%3.json';
Filename@1100225002 : Text;
BEGIN
IF FranchiseSetup."Save File Path" = '' THEN
EXIT;

// Sourcetype ==> 1 Item, 2 Shipment, 3 Send Stock, 11 Item Response, 12


Shipment Response, 13 Send Stock Response
CASE SourceType OF
1: Filename := STRSUBSTNO(FileNameValue,FranchiseSetup."Save File Path",
'Item', SourceNo);
2: Filename := STRSUBSTNO(FileNameValue,FranchiseSetup."Save File Path",
'Shipment', SourceNo);
3: Filename := STRSUBSTNO(FileNameValue,FranchiseSetup."Save File Path",
'Stock', SourceNo);
11: Filename := STRSUBSTNO(FileNameValue,FranchiseSetup."Save File Path",
'Item', SourceNo + '_Response');
12: Filename := STRSUBSTNO(FileNameValue,FranchiseSetup."Save File Path",
'Shipment', SourceNo + '_Response');
13: Filename := STRSUBSTNO(FileNameValue,FranchiseSetup."Save File Path",
'Stock', SourceNo + '_Response');
END;

CLEAR(PrintFile);
PrintFile.TEXTMODE := TRUE;
PrintFile.WRITEMODE := TRUE;
PrintFile.CREATE(Filename, TEXTENCODING::UTF8);
PrintFile.WRITE(JsonText);
PrintFile.CLOSE;

EXIT(Filename);
END;

[LineStart(7637)]
LOCAL PROCEDURE SetCheckedError@1000000023(VAR FranchisesLogEntry@1000000000 :
Record 50124;ErrorText@1000000001 : Text);
BEGIN
FranchisesLogEntry.Error := TRUE;
FranchisesLogEntry.Description := ErrorText;
FranchisesLogEntry."Processed Date" := WORKDATE;
FranchisesLogEntry."Processed Time" := TIME;
FranchisesLogEntry.MODIFY;
COMMIT;
ERROR('CHECKED_ERROR');
END;

[LineStart(7646)]
LOCAL PROCEDURE CreateItemJournal@1000000006(LineasDocumento@1000000000 :
Text;DocNo@1000000003 : Text;StoreCode@1000000004 : Code[20];Operation@1000000012 :
Text;TransactionDate@1100225003 : Date);
VAR
JObject@1000000001 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
ItemJournalLine@1000000002 : Record 83;
FranchisesSetup@1000000008 : Record 50123;
Barcodes@1000000005 : Record 99001451;
Item@1000000006 : Record 27;
ItemJournalBatch@1000000010 : Record 233;
ReasonCode@1100225000 : Record 231;
ItemJnlPostLine@1000000015 : Codeunit 22;
Qty@1000000007 : Decimal;
PostingDate@1000000009 : Date;
FranchisesSetupStore@1000000013 : Record 50126;
StoreErr@1000000017 : TextConst 'ESP=En la configuraci�n de franquicia, la
tienda %1 no est� configurada o no est� activada';
AdjustJournalErr@1000000016 : TextConst 'ESP=En la configuraci�n de
franquicia, la tienda %1 no tiene configurado el diario y secci�n de ajustes';
JSONManagement@1000000024 : Codeunit 5459;
JArray@1000000023 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
IsFirstTime@1000000022 : Boolean;
ItemJnlTemplate@1000000021 : Record 82;
ItemJnlBatch@1000000020 : Record 233;
ItemJournalLineNo@1000000019 : Integer;
ItemJnlPostBatch@1000000018 : Codeunit 23;
CreatedLines@1000000014 : Boolean;
Item2@1100225001 : Record 27;
TotalToAdjust@1100225002 : Decimal;
FranchisesAdjustEntry@1100225006 : Record 50133;
FranchisesAdjustEntryNo@1100225005 : Integer;
Location@1100225004 : Record 14;
Store@1100225007 : Record 99001470;
BEGIN
// Que la tenda estigui activada
FranchisesSetupStore.SETCURRENTKEY("Enable Store",Code,"Store No.");
FranchisesSetupStore.SETRANGE("Enable Store",TRUE);
FranchisesSetupStore.SETRANGE("Store No.",StoreCode);
IF FranchisesSetupStore.ISEMPTY THEN
ERROR(StoreErr,StoreCode);

FranchisesSetupStore.FINDFIRST;

// Que tingui el diari per poder fer l'ajust


IF (FranchisesSetupStore."Journal Batch Name Adjust" = '') OR
(FranchisesSetupStore."Journal Template Name Adjust" = '') THEN
ERROR(AdjustJournalErr,StoreCode);

JSONManagement.InitializeCollection(LineasDocumento);
JSONManagement.GetJsonArray(JArray);
IsFirstTime := TRUE;

Store.GET(StoreCode); //<999 04112021

FOREACH JObject IN JArray DO BEGIN


EVALUATE(Qty, JObject.GetValue('Unidades').ToString);
Barcodes.GET(JObject.GetValue('CodBarras').ToString);

// Ahora se crear� el diario de reclasificaci�n


IF IsFirstTime THEN BEGIN
IsFirstTime := FALSE;
CLEAR(ItemJournalLine);
ItemJournalLine.SETRANGE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
ItemJournalLine.SETRANGE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.DELETEALL;
ItemJnlTemplate.GET(FranchisesSetupStore."Journal Template Name Adjust");
ItemJnlBatch.GET(FranchisesSetupStore."Journal Template Name
Adjust",FranchisesSetupStore."Journal Batch Name Adjust");
END;

CLEAR(ItemJournalLine);
ItemJournalLine.SETRANGE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.SETRANGE("Journal Batch Name",FranchisesSetupStore."Journal
Batch Name Adjust");
IF ItemJournalLine.FINDLAST THEN
ItemJournalLineNo := ItemJournalLine."Line No." + 10000
ELSE
ItemJournalLineNo := 10000;

//<999 XT 04112021
//Verificar si t� estoc per fer un ajust positiu o no

CLEAR(Item2);
Item2.SETFILTER("Location Filter",Store."Location Code");
Item2.SETFILTER("No.",Barcodes."Item No.");
Item2.FINDFIRST;
Item2.CALCFIELDS(Inventory);
IF Item2.Inventory < Qty THEN BEGIN
TotalToAdjust := Qty - Item2.Inventory;

CLEAR(ItemJournalLine);
ItemJournalLine.VALIDATE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.VALIDATE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
ItemJournalLine.VALIDATE("Line No.",ItemJournalLineNo);
ItemJournalLine.INSERT(TRUE);
ItemJournalLine.VALIDATE("Posting Date",TransactionDate);
ItemJournalLine."Entry Type" := ItemJournalLine."Entry Type"::"Positive
Adjmt.";
ItemJournalLine.VALIDATE("Document No.",DocNo);
ItemJournalLine.VALIDATE("Item No.",Barcodes."Item No.");
ItemJournalLine.VALIDATE("Location Code",Store."Location Code");
ItemJournalLine.VALIDATE(Quantity,TotalToAdjust);
ItemJournalLine."Source Code" := ItemJnlTemplate."Source Code";
ItemJournalLine."Posting No. Series" := ItemJnlBatch."Posting No.
Series";
ItemJournalLine.MODIFY(TRUE);

CreateSerialLotToJournalDocument(ItemJournalLine,'1','');

ItemJournalLineNo += 10000;

// Ara es crear� el registre a la taula de adjust


CLEAR(FranchisesAdjustEntry);
IF FranchisesAdjustEntry.FINDLAST THEN
FranchisesAdjustEntryNo := FranchisesAdjustEntry."Entry No." + 1
ELSE
FranchisesAdjustEntryNo := 1;

Location.GET(Store."Location Code");

CLEAR(FranchisesAdjustEntry);
FranchisesAdjustEntry."Entry No." := FranchisesAdjustEntryNo;
FranchisesAdjustEntry."Operation Date" := TransactionDate;
FranchisesAdjustEntry."Franchise Code" := FranchisesSetupStore.Code;
FranchisesAdjustEntry."Item No." := Barcodes."Item No.";
FranchisesAdjustEntry."Item Description" := Item2.Description;
FranchisesAdjustEntry."Barcode No." := Barcodes."Barcode No.";
FranchisesAdjustEntry."Location Code" := Store."Location Code";
FranchisesAdjustEntry."Store No." := Store."No.";
FranchisesAdjustEntry."Quantity Adjusted" := TotalToAdjust;
FranchisesAdjustEntry."Location Name" := Location.Name;
FranchisesAdjustEntry.Status := FranchisesAdjustEntry.Status::"Resolution
pending";
FranchisesAdjustEntry."Related To Receipt No." := DocNo;
FranchisesAdjustEntry.INSERT;
END;
//999 XT 04112021>

CLEAR(ItemJournalLine);
ItemJournalLine.VALIDATE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.VALIDATE("Journal Batch Name",FranchisesSetupStore."Journal
Batch Name Adjust");
ItemJournalLine.VALIDATE("Line No.",ItemJournalLineNo);
ItemJournalLine.INSERT(TRUE);
ItemJournalLine.VALIDATE("Posting Date",TransactionDate);
ItemJournalLine.VALIDATE("Document No.",DocNo);
ItemJournalLine.VALIDATE("Item No.",Barcodes."Item No.");
ItemJournalLine.VALIDATE("Location Code", Store."Location Code");
IF Qty < 0 THEN BEGIN
ItemJournalLine.VALIDATE("Entry Type", ItemJournalLine."Entry
Type"::"Negative Adjmt.");
Qty := -Qty;
END ELSE
ItemJournalLine.VALIDATE("Entry Type", ItemJournalLine."Entry
Type"::"Positive Adjmt.");
ItemJournalLine.VALIDATE(Quantity,Qty);
IF Operation <> '' THEN
ItemJournalLine."Reason Code" :=
GetReasonCode(FranchisesSetupStore.Code,Operation);
ItemJournalLine."Source Code" := ItemJnlTemplate."Source Code";
ItemJournalLine."Posting No. Series" := ItemJnlBatch."Posting No. Series";
ItemJournalLine.MODIFY(TRUE);
AssignLotToItemJournalLine(ItemJournalLine);
CreatedLines := TRUE;
END;

IF CreatedLines THEN
ItemJnlPostBatch.RUN(ItemJournalLine);
END;

[LineStart(7773)]
LOCAL PROCEDURE CreateReclassJournal@1100225001(LineasDocumento@1000000000 :
Text;DocNo@1000000002 : Text;FromStore@1000000004 : Code[20];ToStore@1000000005 :
Code[20];Operation@1000000001 : Text;TransactionDate@1100225000 : Date);
VAR
JObject@1000000014 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
ItemJournalLine@1000000013 : Record 83;
FranchisesSetup@1000000012 : Record 50123;
Barcodes@1000000011 : Record 99001451;
Item@1000000010 : Record 27;
Store@1000000009 : Record 99001470;
ItemJournalBatch@1000000008 : Record 233;
ItemJnlPostLine@1000000016 : Codeunit 22;
Qty@1000000007 : Decimal;
PostingDate@1000000006 : Date;
PostItemJnlLineErr@1000000015 : TextConst 'ENU=It was not posible to post the
item ledger entry of the journal template %1, journal batch %2;ESP=No se pudo
registrar el movimiento de producto por el libro de diario %1, secci�n %2';
StoreErr@1000000003 : TextConst 'ESP=En la configuraci�n de franquicia, la
tienda %1 no est� configurada o no est� activada';
ReclassJournalErr@1000000017 : TextConst 'ESP=En la configuraci�n de
franquicia, la tienda %1 no tiene configurado el diario y secci�n de
reclasificaci�n';
FranchisesSetupStore@1000000018 : Record 50126;
JSONManagement@1000000019 : Codeunit 5459;
JArray@1000000020 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
IsFirstTime@1000000021 : Boolean;
ItemJnlTemplate@1000000023 : Record 82;
ItemJnlBatch@1000000022 : Record 233;
ItemJournalLineNo@1000000024 : Integer;
ItemJnlPostBatch@1000000025 : Codeunit 23;
CreatedLines@1000000026 : Boolean;
Item2@1100225005 : Record 27;
TotalToAdjust@1100225004 : Decimal;
FranchisesAdjustEntry@1100225003 : Record 50133;
FranchisesAdjustEntryNo@1100225002 : Integer;
Location@1100225001 : Record 14;
BEGIN
// Que la tenda estigui activada
FranchisesSetupStore.SETCURRENTKEY("Enable Store",Code,"Store No.");
FranchisesSetupStore.SETRANGE("Enable Store",TRUE);
FranchisesSetupStore.SETRANGE("Store No.",FromStore);
IF FranchisesSetupStore.ISEMPTY THEN
ERROR(StoreErr,FromStore);

// Que la tenda estigui activada


CLEAR(FranchisesSetupStore);
FranchisesSetupStore.SETCURRENTKEY("Enable Store",Code,"Store No.");
FranchisesSetupStore.SETRANGE("Enable Store",TRUE);
FranchisesSetupStore.SETRANGE("Store No.",ToStore);
IF FranchisesSetupStore.ISEMPTY THEN
ERROR(StoreErr,FromStore);

FranchisesSetupStore.FINDFIRST;

// Que tingui el diari per poder fer la reclassificaci�


IF (FranchisesSetupStore."Journal Batch Name Reclass" = '') OR
(FranchisesSetupStore."Journal Template Name Reclass" = '') THEN
ERROR(ReclassJournalErr,ToStore);

JSONManagement.InitializeCollection(LineasDocumento);
JSONManagement.GetJsonArray(JArray);
IsFirstTime := TRUE;
FOREACH JObject IN JArray DO BEGIN
EVALUATE(Qty, JObject.GetValue('Unidades').ToString);
Barcodes.GET(JObject.GetValue('CodBarras').ToString);

// Ahora se crear� el diario de reclasificaci�n


IF IsFirstTime THEN BEGIN
IsFirstTime := FALSE;
CLEAR(ItemJournalLine);
ItemJournalLine.SETRANGE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Reclass");
ItemJournalLine.SETRANGE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Reclass");
ItemJournalLine.DELETEALL;
ItemJnlTemplate.GET(FranchisesSetupStore."Journal Template Name
Reclass");
ItemJnlBatch.GET(FranchisesSetupStore."Journal Template Name
Reclass",FranchisesSetupStore."Journal Batch Name Reclass");
END;

CLEAR(ItemJournalLine);
ItemJournalLine.SETRANGE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Reclass");
ItemJournalLine.SETRANGE("Journal Batch Name",FranchisesSetupStore."Journal
Batch Name Reclass");
IF ItemJournalLine.FINDLAST THEN
ItemJournalLineNo := ItemJournalLine."Line No." + 10000
ELSE
ItemJournalLineNo := 10000;

//<999 XT 04112021
//Verificar si t� estoc per fer un ajust positiu o no
Store.GET(FromStore); //<999 04112021
CLEAR(Item2);
Item2.SETFILTER("Location Filter",Store."Location Code");
Item2.SETFILTER("No.",Barcodes."Item No.");
Item2.FINDFIRST;
Item2.CALCFIELDS(Inventory);
IF Item2.Inventory < Qty THEN BEGIN
TotalToAdjust := Qty - Item2.Inventory;

CLEAR(ItemJournalLine);
ItemJournalLine.VALIDATE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.VALIDATE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
ItemJournalLine.VALIDATE("Line No.",ItemJournalLineNo);
ItemJournalLine.INSERT(TRUE);
ItemJournalLine.VALIDATE("Posting Date",TransactionDate);
ItemJournalLine."Entry Type" := ItemJournalLine."Entry Type"::"Positive
Adjmt.";
ItemJournalLine.VALIDATE("Document No.",DocNo);
ItemJournalLine.VALIDATE("Item No.",Barcodes."Item No.");
ItemJournalLine.VALIDATE("Location Code",Store."Location Code");
ItemJournalLine.VALIDATE(Quantity,TotalToAdjust);
ItemJournalLine."Source Code" := ItemJnlTemplate."Source Code";
ItemJournalLine."Posting No. Series" := ItemJnlBatch."Posting No.
Series";
ItemJournalLine.MODIFY(TRUE);
CreateSerialLotToJournalDocument(ItemJournalLine,'1','');

ItemJournalLineNo += 10000;

// Ara es crear� el registre a la taula de adjust


CLEAR(FranchisesAdjustEntry);
IF FranchisesAdjustEntry.FINDLAST THEN
FranchisesAdjustEntryNo := FranchisesAdjustEntry."Entry No." + 1
ELSE
FranchisesAdjustEntryNo := 1;

Location.GET(Store."Location Code");

CLEAR(FranchisesAdjustEntry);
FranchisesAdjustEntry."Entry No." := FranchisesAdjustEntryNo;
FranchisesAdjustEntry."Operation Date" := TransactionDate;
FranchisesAdjustEntry."Franchise Code" := FranchisesSetupStore.Code;
FranchisesAdjustEntry."Item No." := Barcodes."Item No.";
FranchisesAdjustEntry."Item Description" := Item2.Description;
FranchisesAdjustEntry."Barcode No." := Barcodes."Barcode No.";
FranchisesAdjustEntry."Location Code" := Store."Location Code";
FranchisesAdjustEntry."Store No." := Store."No.";
FranchisesAdjustEntry."Quantity Adjusted" := TotalToAdjust;
FranchisesAdjustEntry."Location Name" := Location.Name;
FranchisesAdjustEntry.Status := FranchisesAdjustEntry.Status::"Resolution
pending";
FranchisesAdjustEntry."Related To Receipt No." := DocNo;
FranchisesAdjustEntry.INSERT;
END;
//999 XT 04112021>

CLEAR(ItemJournalLine);
ItemJournalLine.VALIDATE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Reclass");
ItemJournalLine.VALIDATE("Journal Batch Name",FranchisesSetupStore."Journal
Batch Name Reclass");
ItemJournalLine.VALIDATE("Line No.",ItemJournalLineNo);
ItemJournalLine.INSERT(TRUE);
ItemJournalLine.VALIDATE("Posting Date",TransactionDate);
ItemJournalLine."Entry Type" := ItemJournalLine."Entry Type"::Transfer;
ItemJournalLine.VALIDATE("Document No.",DocNo);
ItemJournalLine.VALIDATE("Item No.",Barcodes."Item No.");
IF Store.GET(FromStore) THEN
ItemJournalLine.VALIDATE("Location Code", Store."Location Code");
IF Store.GET(ToStore) THEN
ItemJournalLine.VALIDATE("New Location Code", Store."Location Code");
ItemJournalLine.VALIDATE(Quantity,Qty);
IF Operation <> '' THEN
ItemJournalLine."Reason Code" :=
GetReasonCode(FranchisesSetupStore.Code,Operation);
ItemJournalLine."Source Code" := ItemJnlTemplate."Source Code";
ItemJournalLine."Posting No. Series" := ItemJnlBatch."Posting No. Series";
ItemJournalLine.MODIFY(TRUE);
AssignLotToItemJournalLine(ItemJournalLine);
CreatedLines := TRUE;
END;

IF CreatedLines THEN
ItemJnlPostBatch.RUN(ItemJournalLine);
END;

[LineStart(7904)]
PROCEDURE Exportfile@1000000005(VAR "Franchises Log Entry"@1000000009 : Record
50124);
VAR
Filename@1000000001 : Text;
FileNameToExport@1000000002 : TextConst 'ESP=ArchivoExportado.json';
FileExtension@1000000003 : Text;
FileMgmt@1000000004 : Codeunit 419;
FileExtensionLbl@1000000005 : TextConst 'ENU=All Files (*.%1)|*.%2;ESP=Todos
los archivos (*.%1)|*.%2';
TempBlob@1000000006 : TEMPORARY Record 99008535;
IStream@1000000007 : InStream;
OStream@1000000008 : OutStream;
JSONString@1000000000 : Text;
DialogTxt@1000000010 : TextConst 'ESP=Exportar';
NotExistFile@1000000011 : TextConst 'ESP=No existe valor para exportar';
BEGIN
IF NOT "Franchises Log Entry"."Json File".HASVALUE THEN
ERROR(NotExistFile);

Filename := FileNameToExport;
FileExtension := FileMgmt.GetExtension(Filename);
IF FileExtension <> '' THEN
FileExtension := STRSUBSTNO(FileExtensionLbl, FileExtension, FileExtension)
ELSE
FileExtension := STRSUBSTNO(FileExtensionLbl, '*', '*');

"Franchises Log Entry".CALCFIELDS("Json File");


TempBlob.Blob := "Franchises Log Entry"."Json File";
JSONString := TempBlob.ReadAsText('', TEXTENCODING::UTF8);

CLEAR(TempBlob);
TempBlob.Blob.CREATEOUTSTREAM(OStream, TEXTENCODING::UTF8);
TempBlob.Blob.CREATEINSTREAM(IStream, TEXTENCODING::UTF8);
OStream.WRITE(JSONString);

COPYSTREAM(OStream, IStream);
DOWNLOADFROMSTREAM(IStream, DialogTxt, '', FileExtension, Filename);
END;

[LineStart(7927)]
LOCAL PROCEDURE
AssignLotToItemJournalLine@1000000010(ItemJournalLine@1000000001 : Record 83);
VAR
Item@1000000005 : Record 27;
ItemTrackingManagement@1000000004 : Codeunit 6500;
TempTrackingSpecification@1000000003 : TEMPORARY Record 336;
SourceSpecification@1000000002 : TEMPORARY Record 336;
ItemTrackingCode@1000000006 : Record 6502;
IsReclass@1100225000 : Boolean;
ItemLedgerEntry@1000000007 : Record 32;
ExitFromRepeat@1000000008 : Boolean;
LotNo@1000000009 : Code[20];
ReservationEntry@1100225001 : Record 337;
BEGIN
CLEAR(ReservationEntry);
ReservationEntry.SETRANGE("Location Code",ItemJournalLine."Location Code");
ReservationEntry.SETRANGE("Source Type",DATABASE::"Item Journal Line");
ReservationEntry.SETRANGE("Source Batch Name",ItemJournalLine."Journal Batch
Name");
ReservationEntry.SETRANGE("Source ID",ItemJournalLine."Journal Template
Name");
ReservationEntry.SETRANGE("Source Ref. No.",ItemJournalLine."Line No.");
ReservationEntry.SETRANGE("Item No.", ItemJournalLine."Item No.");
IF NOT ReservationEntry.ISEMPTY THEN
ReservationEntry.DELETEALL;

Item.GET(ItemJournalLine."Item No.");
IF NOT ((Item."Item Tracking Code" <> '') AND
(ItemTrackingCode.GET(Item."Item Tracking Code")) AND (ItemTrackingCode."Lot
Specific Tracking")) THEN
EXIT;

IF (ItemJournalLine."Entry Type" = ItemJournalLine."Entry Type"::"Negative


Adjmt.") OR
((ItemJournalLine."Entry Type" = ItemJournalLine."Entry Type"::Sale) AND
(ItemJournalLine.Quantity > 0)) THEN BEGIN
//Buscar el lot a colocar
ItemLedgerEntry.SETCURRENTKEY("Item No.",Open,"Variant Code","Location
Code","Item Tracking","Lot No.","Serial No.");
ItemLedgerEntry.SETRANGE("Item No.",ItemJournalLine."Item No.");
ItemLedgerEntry.SETRANGE(Open,TRUE);
ItemLedgerEntry.SETRANGE("Location Code",ItemJournalLine."Location Code");
ItemLedgerEntry.SETRANGE(Positive,TRUE);
IF ItemLedgerEntry.FINDSET THEN BEGIN
REPEAT
IF ItemLedgerEntry."Remaining Quantity" >= ItemJournalLine."Quantity
(Base)" THEN BEGIN
ExitFromRepeat := TRUE;
LotNo := ItemLedgerEntry."Lot No.";
END;
UNTIL (ItemLedgerEntry.NEXT = 0) OR ExitFromRepeat;
END;
END;

IF LotNo = '' THEN


LotNo := '1';

IsReclass := ItemJournalLine."Entry Type" = ItemJournalLine."Entry


Type"::Transfer;

CLEAR(ItemTrackingManagement);
TempTrackingSpecification.RESET;
TempTrackingSpecification.DELETEALL;

SourceSpecification.INIT;
SourceSpecification.VALIDATE("Item No.",ItemJournalLine."Item No.");
SourceSpecification.VALIDATE("Location Code",ItemJournalLine."Location
Code");
SourceSpecification.VALIDATE("Quantity (Base)",ItemJournalLine."Quantity
(Base)");
SourceSpecification.VALIDATE("Source Type",DATABASE::"Item Journal Line");
SourceSpecification.VALIDATE("Source Subtype",ItemJournalLine."Entry Type");
SourceSpecification.VALIDATE("Source ID",ItemJournalLine."Journal Template
Name");
SourceSpecification.VALIDATE("Source Batch Name",ItemJournalLine."Journal
Batch Name");
SourceSpecification.VALIDATE("Source Ref. No.",ItemJournalLine."Line No.");
SourceSpecification.VALIDATE(Correction,FALSE);

TempTrackingSpecification.INIT;
TempTrackingSpecification."Entry No." := 1;
TempTrackingSpecification."Lot No." := LotNo;
IF IsReclass THEN
TempTrackingSpecification."New Lot No." := LotNo;
TempTrackingSpecification.VALIDATE("Quantity (Base)",
ItemJournalLine."Quantity (Base)");
TempTrackingSpecification.INSERT(TRUE);

ItemTrackingManagement.SetGlobalParameters(SourceSpecification,TempTrackingSpecific
ation,0D);
IF IsReclass THEN
ItemTrackingManagement.SetReclass(TRUE);
ItemTrackingManagement.RUN;
END;

[LineStart(7993)]
PROCEDURE CreateExportStockToLog@1100225006(FranchiseCode@1100225001 :
Code[20]);
VAR
FranchisesLogEntry@1100225000 : Record 50124;
BEGIN
//Crearem el LOG per enviar l'estoc. Es crea des del report de Franchises
FranchisesLogEntry.SETCURRENTKEY(Action,Operation,"Franchise
Code",Processed);
FranchisesLogEntry.SETRANGE(Action,FranchisesLogEntry.Action::Send);
FranchisesLogEntry.SETRANGE(Operation,FranchisesLogEntry.Operation::Stock);
FranchisesLogEntry.SETRANGE("Franchise Code",FranchiseCode);
FranchisesLogEntry.SETRANGE(Processed,FALSE);
IF NOT FranchisesLogEntry.ISEMPTY THEN
EXIT;

FranchisesLogEntry.INIT;
FranchisesLogEntry.Action := FranchisesLogEntry.Action::Send;
FranchisesLogEntry.Operation := FranchisesLogEntry.Operation::Stock;
FranchisesLogEntry.Error := FALSE;
FranchisesLogEntry.Description := '';
FranchisesLogEntry."Franchise Code" := FranchiseCode;
FranchisesLogEntry."Store Type" := FranchisesLogEntry."Store
Type"::Franchise; //<528
FranchisesLogEntry.INSERT(TRUE);
END;

[LineStart(8012)]
PROCEDURE
TransferLogEntryFromPostedPage@1100225007(PostedWhseShipmentHeader@1100225004 :
Record 7322);
VAR
Store@1100225000 : Record 99001470;
FranchisesSetup@1100225002 : Record 50123;
PostedWhseShipmentLine@1100225003 : Record 7323;
FranchisesSetupStore@1100225005 : Record 50126;
FranchisesLogEntry@1000000000 : Record 50124;
CreatedEntry@1100225001 : Boolean;
EntryCreatedMsg@1100225006 : TextConst 'ESP=El registro se ha guardado
correctamente en el LOG de franquicia';
EntryNotCreatedMsg@1100225007 : TextConst 'ESP=No se ha creado el registro en
el LOG de franquicia. No hay ninguna configuraci�n activa para estos datos';
BEGIN
// Des de la page de Posted Warehouse Shipment Header per afegir al Log
manualment el registre
PostedWhseShipmentLine.SETRANGE("No.",PostedWhseShipmentHeader."No.");
IF PostedWhseShipmentLine.ISEMPTY THEN
EXIT;

PostedWhseShipmentLine.FINDFIRST;

IF PostedWhseShipmentLine."Source Type" <> DATABASE::"Transfer Line" THEN


EXIT;

Store.SETCURRENTKEY("Location Code");
Store.SETRANGE("Location Code", PostedWhseShipmentLine."Destination No.");
IF Store.FINDFIRST THEN BEGIN
FranchisesSetup.SETCURRENTKEY("Enable Franchise","Endpoint
Shipment","Enable Export Shipment Inform.");
FranchisesSetup.SETRANGE("Enable Franchise", TRUE);
FranchisesSetup.SETFILTER("Endpoint Shipment",'<>%1','');
FranchisesSetup.SETRANGE("Enable Export Shipment Inform.",TRUE);
IF FranchisesSetup.FINDSET THEN BEGIN
REPEAT
CLEAR(FranchisesSetupStore);
FranchisesSetupStore.SETCURRENTKEY("Enable Store",Code,"Store No.");
FranchisesSetupStore.SETRANGE("Enable Store",TRUE);
FranchisesSetupStore.SETRANGE(Code,FranchisesSetup.Code);
FranchisesSetupStore.SETRANGE("Store No.",Store."No.");
IF NOT FranchisesSetupStore.ISEMPTY THEN BEGIN
FranchisesLogEntry.INIT;
FranchisesLogEntry.Action := FranchisesLogEntry.Action::Send;
FranchisesLogEntry.Operation :=
FranchisesLogEntry.Operation::Shipment;
FranchisesLogEntry.RecordID := PostedWhseShipmentHeader.RECORDID;
FranchisesLogEntry."Source Operation" :=
PostedWhseShipmentHeader."No.";
FranchisesLogEntry."Franchise Code" := FranchisesSetup.Code;
FranchisesLogEntry."Store No." := Store."No.";
FranchisesLogEntry."Store Type" := FranchisesLogEntry."Store
Type"::Franchise; //<528
FranchisesLogEntry.INSERT(TRUE);
CreatedEntry := TRUE;

CreateItemLogEntryFromPostedShipment(PostedWhseShipmentHeader,FranchisesSetup.Code)
;
END;
UNTIL FranchisesSetup.NEXT = 0;
END;
END;

IF CreatedEntry THEN
MESSAGE(EntryCreatedMsg)
ELSE
MESSAGE(EntryNotCreatedMsg);
END;
[LineStart(8059)]
PROCEDURE
TransferLogEntrySGAFromPostedPage@1000000013(TransferShipmentHeader@1100225004 :
Record 5744);
VAR
Store@1100225000 : Record 99001470;
FranchisesSetup@1100225002 : Record 50123;
TransferShipmentLine@1100225003 : Record 5745;
FranchisesSetupStore@1100225005 : Record 50126;
FranchisesLogEntry@1000000000 : Record 50124;
CreatedEntry@1100225001 : Boolean;
EntryCreatedMsg@1100225006 : TextConst 'ESP=El registro se ha guardado
correctamente en el LOG de franquicia';
EntryNotCreatedMsg@1100225007 : TextConst 'ESP=No se ha creado el registro en
el LOG de franquicia. No hay ninguna configuraci�n activa para estos datos';
BEGIN
// Des de la page de Posted Warehouse Shipment Header per afegir al Log
manualment el registre
TransferShipmentLine.SETRANGE("Document No.",TransferShipmentHeader."No.");
IF TransferShipmentLine.ISEMPTY THEN
EXIT;

TransferShipmentLine.FINDFIRST;

Store.SETCURRENTKEY("Location Code");
Store.SETRANGE("Location Code", TransferShipmentHeader."Transfer-to Code");
IF Store.FINDFIRST THEN BEGIN
FranchisesSetup.SETCURRENTKEY("Enable Franchise","Endpoint
Shipment","Enable Export Shipment Inform.");
FranchisesSetup.SETRANGE("Enable Franchise", TRUE);
FranchisesSetup.SETFILTER("Endpoint Shipment",'<>%1','');
FranchisesSetup.SETRANGE("Enable Export Shipment Inform.",TRUE);
IF FranchisesSetup.FINDSET THEN BEGIN
REPEAT
CLEAR(FranchisesSetupStore);
FranchisesSetupStore.SETCURRENTKEY("Enable Store",Code,"Store No.");
FranchisesSetupStore.SETRANGE("Enable Store",TRUE);
FranchisesSetupStore.SETRANGE(Code,FranchisesSetup.Code);
FranchisesSetupStore.SETRANGE("Store No.",Store."No.");
IF NOT FranchisesSetupStore.ISEMPTY THEN BEGIN
FranchisesLogEntry.INIT;
FranchisesLogEntry.Action := FranchisesLogEntry.Action::Send;
FranchisesLogEntry.Operation :=
FranchisesLogEntry.Operation::ShipmentSGA;
FranchisesLogEntry.RecordID := TransferShipmentHeader.RECORDID;
FranchisesLogEntry."Source Operation" :=
TransferShipmentHeader."No.";
FranchisesLogEntry."Franchise Code" := FranchisesSetup.Code;
FranchisesLogEntry."Store No." := Store."No.";
FranchisesLogEntry."Store Type" := FranchisesLogEntry."Store
Type"::Franchise; //<528
FranchisesLogEntry.INSERT(TRUE);
CreatedEntry := TRUE;

CreateItemLogEntryFromTransferShipment(TransferShipmentHeader,FranchisesSetup.Code)
;
END;
UNTIL FranchisesSetup.NEXT = 0;
END;
END;

IF CreatedEntry THEN
MESSAGE(EntryCreatedMsg)
ELSE
MESSAGE(EntryNotCreatedMsg);
END;

[LineStart(8103)]
LOCAL PROCEDURE
CreateItemLogEntryFromPostedShipment@1100225010(PostedWhseShipmentHeader@1100225000
: Record 7322;FranchiseCode@1100225004 : Code[20]);
VAR
PostedWhseShipmentLine@1100225001 : Record 7323;
Item@1100225002 : Record 27;
FranchisesLogEntry@1100225003 : Record 50124;
BEGIN
PostedWhseShipmentLine.SETRANGE("No.",PostedWhseShipmentHeader."No.");
IF PostedWhseShipmentLine.FINDSET THEN
REPEAT
IF Item.GET(PostedWhseShipmentLine."Item No.") THEN BEGIN
CLEAR(FranchisesLogEntry);

FranchisesLogEntry.SETCURRENTKEY(Operation,RecordID,Processed,"Franchise Code");

FranchisesLogEntry.SETRANGE(Operation,FranchisesLogEntry.Operation::Item);
FranchisesLogEntry.SETRANGE(RecordID,Item.RECORDID);
IF FranchisesLogEntry.ISEMPTY THEN
ItemLogEntry(Item,FranchiseCode);
END;
UNTIL PostedWhseShipmentLine.NEXT = 0;
END;

[LineStart(8117)]
LOCAL PROCEDURE
CreateItemLogEntryFromTransferShipment@1000000014(TransferShipmentHeader@1100225000
: Record 5744;FranchiseCode@1100225004 : Code[20]);
VAR
TransferShipmentLine@1100225001 : Record 5745;
Item@1100225002 : Record 27;
FranchisesLogEntry@1100225003 : Record 50124;
BEGIN
TransferShipmentLine.SETRANGE(TransferShipmentLine."Document
No.",TransferShipmentHeader."No.");
IF TransferShipmentLine.FINDSET THEN
REPEAT
IF Item.GET(TransferShipmentLine."Item No.") THEN BEGIN
CLEAR(FranchisesLogEntry);

FranchisesLogEntry.SETCURRENTKEY(Operation,RecordID,Processed,"Franchise Code");

FranchisesLogEntry.SETRANGE(Operation,FranchisesLogEntry.Operation::Item);
FranchisesLogEntry.SETRANGE(RecordID,Item.RECORDID);
IF FranchisesLogEntry.ISEMPTY THEN
ItemLogEntry(Item,FranchiseCode);
END;
UNTIL TransferShipmentLine.NEXT = 0;
END;
[LineStart(8131)]
LOCAL PROCEDURE GetReasonCode@1100225009(FranchiseCode@1100225000 :
Code[20];ReturnReasonFranchise@1100225001 : Text) : Code[10];
VAR
FranchisesValues@1100225002 : Record 50122;
BEGIN
FranchisesValues.SETCURRENTKEY("Franchise Code",Type,Description);
FranchisesValues.SETRANGE("Franchise Code",FranchiseCode);
FranchisesValues.SETRANGE(Type, FranchisesValues.Type::"Adjust Reason");
FranchisesValues.SETRANGE("Franchise Value",ReturnReasonFranchise);
IF FranchisesValues.ISEMPTY THEN
EXIT;

FranchisesValues.FINDFIRST;

EXIT(FranchisesValues.Code);
END;

[LineStart(8143)]
LOCAL PROCEDURE GetTenderType@1000000011(FranchiseCode@1100225000 :
Code[20];TenderTypeFranchise@1100225001 : Text) : Code[10];
VAR
FranchisesValues@1100225002 : Record 50122;
BEGIN
FranchisesValues.SETCURRENTKEY("Franchise Code",Type,Description);
FranchisesValues.SETRANGE("Franchise Code",FranchiseCode);
FranchisesValues.SETRANGE(Type, FranchisesValues.Type::"Payment Method");
FranchisesValues.SETRANGE("Franchise Value",TenderTypeFranchise);
IF FranchisesValues.ISEMPTY THEN
EXIT;

FranchisesValues.FINDFIRST;

EXIT(FranchisesValues.Code);
END;

[LineStart(8155)]
PROCEDURE CheckValuesFromLogEntry@1100225011();
VAR
FranchisesLogEntry@1100225004 : Record 50124;
TransactionHeader@1100225003 : Record 99001472;
TransSalesEntry@1100225002 : Record 99001473;
ItemLedgerEntry@1100225001 : Record 32;
Store@1100225000 : Record 99001470;
BEGIN
FranchisesLogEntry.SETRANGE(Operation,FranchisesLogEntry.Operation::Sale);
IF FranchisesLogEntry.FINDSET THEN BEGIN
REPEAT
CLEAR(TransactionHeader);
TransactionHeader.SETCURRENTKEY("Store No.","Wrong Shift","POS Terminal
No.","Receipt No.");
TransactionHeader.SETRANGE("Store No.",FranchisesLogEntry."Store No.");
TransactionHeader.SETRANGE("Receipt No.",FranchisesLogEntry."Source
Operation");
IF TransactionHeader.ISEMPTY THEN
MESSAGE(FranchisesLogEntry."Source Operation" + '-1');

CLEAR(TransSalesEntry);
TransSalesEntry.SETCURRENTKEY("Store No.","Receipt No.");
TransSalesEntry.SETRANGE("Store No.",FranchisesLogEntry."Store No.");
TransSalesEntry.SETRANGE("Receipt No.",FranchisesLogEntry."Source
Operation");
IF TransSalesEntry.ISEMPTY THEN
MESSAGE(FranchisesLogEntry."Source Operation" + '-2');

Store.GET(FranchisesLogEntry."Store No.");

CLEAR(ItemLedgerEntry);
ItemLedgerEntry.SETCURRENTKEY("Location Code","Document No.");
ItemLedgerEntry.SETRANGE("Location Code",Store."Location Code");
ItemLedgerEntry.SETRANGE("Document No.",FranchisesLogEntry."Source
Operation");
IF ItemLedgerEntry.ISEMPTY THEN
MESSAGE(FranchisesLogEntry."Source Operation" + '-3')

UNTIL FranchisesLogEntry.NEXT = 0;
END;
END;

[LineStart(8185)]
PROCEDURE CreateRecordsInInvoice@1100225013(SalesHeader@1100225010 : Record
36);
VAR
ItemLedgerEntry@1100225000 : Record 32;
FranchisesSetupStore@1100225001 : Record 50126;
IsFirstTime@1100225002 : Boolean;
ItemJournalLine@1100225003 : Record 83;
ItemJnlTemplate@1100225004 : Record 82;
ItemJnlBatch@1100225005 : Record 233;
ItemJournalLineNo@1100225006 : Integer;
CreatedLines@1100225007 : Boolean;
TempInventoryBuffer@1100225008 : TEMPORARY Record 307;
ItemJnlPostBatch@1100225009 : Codeunit 23;
SalesLine@1100225011 : Record 37;
NoFranchiseFoundErr@1100225012 : TextConst 'ENU=For customer %1 and invoice
location %2 not exist any franchise;ESP=Para cliente %1 y almac�n de facturaci�n %2
no existe franquicia configurada';
CreateRecordsInInvoiceLocationQst@1100225013 : TextConst 'ESP=Se va a crear
los movimientos en el almac�n de facturaci�n para poder facturar. �Est� seguro?';
NoOfRecs@1100225014 : Integer;
CurrRec@1100225015 : Integer;
Window@1100225016 : Dialog;
ReadyToInvoice@1100225017 : TextConst 'ESP=Ya est� listo para facturar';
BEGIN
// Abans de registrar la factura, es tenen que crear els moviments.
IF NOT CONFIRM(CreateRecordsInInvoiceLocationQst) THEN
ERROR(ProcessCancelledByUser);

SalesLine.SETCURRENTKEY("Document Type","Document No.",Type,Quantity);


SalesLine.SETRANGE("Document Type", SalesHeader."Document Type");
SalesLine.SETRANGE("Document No.",SalesHeader."No.");
SalesLine.SETRANGE(Type,SalesLine.Type::Item);
SalesLine.SETFILTER(Quantity,'<>%1',0);
NoOfRecs := SalesLine.COUNT;
IF SalesLine.FINDSET THEN BEGIN
FranchisesSetupStore.SETCURRENTKEY("Enable Store","Invoice Location",
"Customer No.");
FranchisesSetupStore.SETRANGE("Enable Store",TRUE);
FranchisesSetupStore.SETFILTER("Invoice Location",SalesHeader."Location
Code");
FranchisesSetupStore.SETRANGE("Customer No.",SalesHeader."Sell-to Customer
No.");
IF FranchisesSetupStore.ISEMPTY THEN
ERROR(NoFranchiseFoundErr,SalesHeader."Sell-to Customer
No.",SalesHeader."Location Code");

FranchisesSetupStore.FINDFIRST;

DeleteRemainingInInvoice(FranchisesSetupStore.Code,FranchisesSetupStore."Store
No."); //Esborrar si queda algo en magatzem de facturaci�
Window.OPEN('Procesando registros... @1@@@@@@@@@@');
REPEAT
CurrRec += 1;
IF NoOfRecs <= 100 THEN
Window.UPDATE(1,(CurrRec / NoOfRecs * 10000) DIV 1)
ELSE IF CurrRec MOD (NoOfRecs DIV 100) = 0 THEN
Window.UPDATE(1,(CurrRec / NoOfRecs * 10000) DIV 1);
IF IsFirstTime THEN BEGIN
IsFirstTime := FALSE;
CLEAR(ItemJournalLine);
ItemJournalLine.SETRANGE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
ItemJournalLine.SETRANGE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.DELETEALL;
ItemJnlTemplate.GET(FranchisesSetupStore."Journal Template Name
Adjust");
ItemJnlBatch.GET(FranchisesSetupStore."Journal Template Name
Adjust",FranchisesSetupStore."Journal Batch Name Adjust");
END;

CLEAR(ItemJournalLine);
ItemJournalLine.SETRANGE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.SETRANGE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
IF ItemJournalLine.FINDLAST THEN
ItemJournalLineNo := ItemJournalLine."Line No." + 10000
ELSE
ItemJournalLineNo := 10000;

CLEAR(ItemJournalLine);
ItemJournalLine.VALIDATE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.VALIDATE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
ItemJournalLine.VALIDATE("Line No.",ItemJournalLineNo);
ItemJournalLine.INSERT(TRUE);
ItemJournalLine.VALIDATE("Posting Date",SalesHeader."Posting Date");
ItemJournalLine.VALIDATE("Document No.",'ToInvoice');
ItemJournalLine.VALIDATE("Item No.",SalesLine."No.");
ItemJournalLine.VALIDATE("Entry Type", ItemJournalLine."Entry
Type"::"Positive Adjmt.");
ItemJournalLine.VALIDATE(Quantity,SalesLine.Quantity);
ItemJournalLine.VALIDATE("Location Code",SalesLine."Location Code");
ItemJournalLine."Source Code" := ItemJnlTemplate."Source Code";
ItemJournalLine."Posting No. Series" := ItemJnlBatch."Posting No.
Series";
ItemJournalLine.MODIFY(TRUE);
AssignLotToItemJournalLine(ItemJournalLine);
CreatedLines := TRUE;
UNTIL SalesLine.NEXT = 0;

IF CreatedLines THEN BEGIN


ItemJnlPostBatch.RUN(ItemJournalLine);
MESSAGE(ReadyToInvoice);
END;
END;
END;

[LineStart(8255)]
LOCAL PROCEDURE DeleteRemainingInInvoice@1100225012(FranchiseCode@1100225012 :
Code[20];StoreNo@1100225011 : Code[20]);
VAR
ItemLedgerEntry@1100225000 : Record 32;
FranchisesSetupStore@1100225001 : Record 50126;
IsFirstTime@1100225002 : Boolean;
ItemJournalLine@1100225003 : Record 83;
ItemJnlTemplate@1100225004 : Record 82;
ItemJnlBatch@1100225005 : Record 233;
ItemJournalLineNo@1100225006 : Integer;
CreatedLines@1100225007 : Boolean;
TempInventoryBuffer@1100225008 : TEMPORARY Record 307;
ItemJnlPostBatch@1100225009 : Codeunit 23;
ReservationEntry@1100225010 : Record 337;
BEGIN
// Ajust a 0 el que queda en magatzem de facturacions

FranchisesSetupStore.SETCURRENTKEY("Enable Store",Code,"Store No.");


FranchisesSetupStore.SETRANGE("Enable Store",TRUE);
FranchisesSetupStore.SETRANGE(Code,FranchiseCode);
FranchisesSetupStore.SETRANGE("Store No.",StoreNo);
IF FranchisesSetupStore.FINDFIRST THEN BEGIN
CLEAR(TempInventoryBuffer);
TempInventoryBuffer.DELETEALL;
IsFirstTime := TRUE;
CreatedLines := FALSE;

CLEAR(ItemLedgerEntry);
ItemLedgerEntry.SETCURRENTKEY("Item No.",Open,"Variant
Code",Positive,"Location Code","Posting Date");
ItemLedgerEntry.SETRANGE("Location Code",FranchisesSetupStore."Invoice
Location");
ItemLedgerEntry.SETRANGE(Open,TRUE);
IF ItemLedgerEntry.FINDSET THEN BEGIN
REPEAT
IF NOT TempInventoryBuffer.GET(ItemLedgerEntry."Item
No.",'',0,ItemLedgerEntry."Location Code",'',ItemLedgerEntry."Lot
No.",ItemLedgerEntry."Serial No.") THEN BEGIN
TempInventoryBuffer."Item No." := ItemLedgerEntry."Item No.";
TempInventoryBuffer."Variant Code" := '';
TempInventoryBuffer."Dimension Entry No." := 0;
TempInventoryBuffer."Location Code" := ItemLedgerEntry."Location
Code";
TempInventoryBuffer."Bin Code" := '';
TempInventoryBuffer."Lot No." := ItemLedgerEntry."Lot No.";
TempInventoryBuffer."Serial No." := ItemLedgerEntry."Serial No.";
TempInventoryBuffer.Quantity := ItemLedgerEntry."Remaining Quantity";
TempInventoryBuffer.INSERT;
END ELSE BEGIN
TempInventoryBuffer.Quantity += ItemLedgerEntry."Remaining Quantity";
TempInventoryBuffer.MODIFY;
END;
UNTIL ItemLedgerEntry.NEXT = 0;
END;

IF TempInventoryBuffer.FINDSET THEN BEGIN


// Esborrar 337 per si existeixen
FranchisesSetupStore.TESTFIELD("Invoice Location");
FranchisesSetupStore.TESTFIELD("Journal Batch Name Adjust");
FranchisesSetupStore.TESTFIELD("Journal Template Name Adjust");

CLEAR(ReservationEntry);
ReservationEntry.SETRANGE("Location Code",FranchisesSetupStore."Invoice
Location");
ReservationEntry.SETRANGE("Source Type",DATABASE::"Item Journal Line");
ReservationEntry.SETRANGE("Source Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
ReservationEntry.SETRANGE("Source Subtype",3);
ReservationEntry.SETRANGE("Source ID",FranchisesSetupStore."Journal
Template Name Adjust");
IF NOT ReservationEntry.ISEMPTY THEN
ReservationEntry.DELETEALL;

REPEAT
IF IsFirstTime THEN BEGIN
IsFirstTime := FALSE;
CLEAR(ItemJournalLine);
ItemJournalLine.SETRANGE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
ItemJournalLine.SETRANGE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.DELETEALL;
ItemJnlTemplate.GET(FranchisesSetupStore."Journal Template Name
Adjust");
ItemJnlBatch.GET(FranchisesSetupStore."Journal Template Name
Adjust",FranchisesSetupStore."Journal Batch Name Adjust");
END;

CLEAR(ItemJournalLine);
ItemJournalLine.SETRANGE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.SETRANGE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
IF ItemJournalLine.FINDLAST THEN
ItemJournalLineNo := ItemJournalLine."Line No." + 10000
ELSE
ItemJournalLineNo := 10000;

CLEAR(ItemJournalLine);
ItemJournalLine.VALIDATE("Journal Template
Name",FranchisesSetupStore."Journal Template Name Adjust");
ItemJournalLine.VALIDATE("Journal Batch
Name",FranchisesSetupStore."Journal Batch Name Adjust");
ItemJournalLine.VALIDATE("Line No.",ItemJournalLineNo);
ItemJournalLine.INSERT(TRUE);
ItemJournalLine.VALIDATE("Posting Date",WORKDATE);
ItemJournalLine.VALIDATE("Document No.",'AJUST F');
ItemJournalLine.VALIDATE("Item No.",TempInventoryBuffer."Item No.");
ItemJournalLine.VALIDATE("Entry Type", ItemJournalLine."Entry
Type"::"Negative Adjmt.");
ItemJournalLine.VALIDATE(Quantity,TempInventoryBuffer.Quantity);
ItemJournalLine.VALIDATE("Location Code",FranchisesSetupStore."Invoice
Location");
ItemJournalLine."Source Code" := ItemJnlTemplate."Source Code";
ItemJournalLine."Posting No. Series" := ItemJnlBatch."Posting No.
Series";
ItemJournalLine.MODIFY(TRUE);
AssignLotToItemJournalLine(ItemJournalLine);
CreatedLines := TRUE;
UNTIL TempInventoryBuffer.NEXT = 0;
END;
IF CreatedLines THEN
ItemJnlPostBatch.RUN(ItemJournalLine);
END;
END;

[LineStart(8347)]
LOCAL PROCEDURE
CreateSerialLotToJournalDocument@1100225014(ItemJournalLine@1000000001 : Record
83;LotNo@1000000000 : Code[20];SerialNo@1100225000 : Code[20]);
VAR
Item@1000000005 : Record 27;
ItemTrackingManagement@1000000004 : Codeunit 6500;
TempTrackingSpecification@1000000003 : TEMPORARY Record 336;
SourceSpecification@1000000002 : TEMPORARY Record 336;
ItemTrackingCode@1000000006 : Record 6502;
BEGIN
//<999 XT 05102021
IF (LotNo = '') AND (SerialNo = '') THEN
EXIT;

Item.GET(ItemJournalLine."Item No.");
IF NOT ((Item."Item Tracking Code" <> '') AND
(ItemTrackingCode.GET(Item."Item Tracking Code")) AND ((ItemTrackingCode."Lot
Specific Tracking") OR (ItemTrackingCode."SN Specific Tracking"))) THEN
EXIT;

CLEAR(ItemTrackingManagement);
TempTrackingSpecification.RESET;
TempTrackingSpecification.DELETEALL;

SourceSpecification.INIT;
SourceSpecification.VALIDATE("Item No.",ItemJournalLine."Item No.");
SourceSpecification.VALIDATE("Location Code",ItemJournalLine."Location
Code");
SourceSpecification.VALIDATE("Quantity (Base)",ItemJournalLine."Quantity
(Base)");
SourceSpecification.VALIDATE("Source Type",DATABASE::"Item Journal Line");
SourceSpecification.VALIDATE("Source Subtype",ItemJournalLine."Entry Type");
SourceSpecification.VALIDATE("Source ID",ItemJournalLine."Journal Template
Name");
SourceSpecification.VALIDATE("Source Batch Name",ItemJournalLine."Journal
Batch Name");
SourceSpecification.VALIDATE("Source Ref. No.",ItemJournalLine."Line No.");
SourceSpecification.VALIDATE(Correction,FALSE);

TempTrackingSpecification.INIT;
TempTrackingSpecification."Entry No." := 1;
IF LotNo <> '' THEN
TempTrackingSpecification."Lot No." := LotNo;
IF SerialNo <> '' THEN
TempTrackingSpecification."Serial No." := SerialNo;
TempTrackingSpecification.VALIDATE("Quantity (Base)",
ItemJournalLine."Quantity (Base)");
TempTrackingSpecification.INSERT(TRUE);

ItemTrackingManagement.SetGlobalParameters(SourceSpecification,TempTrackingSpecific
ation,0D);
ItemTrackingManagement.RUN;
//999 XT 05102021>
END;

[LineStart(8384)]
PROCEDURE GenerateSalesShipmentFromTransactionHeader@1100225019(VAR
TransactionHeader@1100225000 : Record 99001472);
VAR
TransSalesEntry@1100225001 : Record 99001473;
SalesHeader@1100225002 : Record 36;
SalesLine@1100225003 : Record 37;
FranchisesSetupStore@1100225004 : Record 50126;
Store@1100225005 : Record 99001470;
Item@1100225006 : Record 27;
ItemTrackingCode@1100225008 : Record 6502;
TempILE@1100225009 : TEMPORARY Record 32;
NotEnoughStock@1100225007 : Boolean;
QtyToAssign@1100225010 : Decimal;
ItemTrackingManagement@1100225014 : Codeunit 6500;
TempTrackingSpecification@1100225013 : TEMPORARY Record 336;
SourceSpecification@1100225012 : TEMPORARY Record 336;
ReservationEntry@1100225011 : Record 337;
EntryNo@1100225015 : Integer;
LotSet@1100225016 : Boolean;
FranchiseShptStockErrLog@1100225017 : Record 50136;
FranchiseShptStockErrLog2@1100225021 : Record 50136;
SalesSetup@1100225018 : Record 311;
ShippingAgent@1100225019 : Record 291;
NewExternalDocNo@1100225020 : Code[35];
Location@1000000000 : Record 14;
BEGIN
//<578
CLEAR(FranchisesSetupStore);
FranchisesSetupStore.SETCURRENTKEY("Store No.","POS Terminal");
FranchisesSetupStore.SETRANGE("Store No.", TransactionHeader."Store No.");
FranchisesSetupStore.SETRANGE("POS Terminal", TransactionHeader."POS Terminal
No.");
FranchisesSetupStore.FINDFIRST;

Store.GET(TransactionHeader."Store No.");

CLEAR(SalesHeader);
IF TransactionHeader."Sale Is Return Sale" THEN BEGIN
SalesHeader.SETRANGE("Document Type", SalesHeader."Document Type"::"Return
Order");
SalesHeader.SETRANGE("Return Receipt No.", TransactionHeader."Receipt
No.");
END ELSE BEGIN
SalesHeader.SETRANGE("Document Type", SalesHeader."Document Type"::Order);
SalesHeader.SETRANGE("Shipping No.", TransactionHeader."Receipt No.");
END;
IF SalesHeader.FINDFIRST THEN BEGIN
//eliminamos mov reserva y cabecera+l�neas
CLEAR(ReservationEntry);
ReservationEntry.SETCURRENTKEY("Source ID","Source Ref. No.","Source
Type","Source Subtype","Source Batch Name","Source Prod. Order Line","Reservation
Status","Shipment Date","Expected Receipt Date");
ReservationEntry.SETRANGE("Source ID", SalesHeader."No.");
ReservationEntry.SETRANGE("Source Type", DATABASE::"Sales Line");
ReservationEntry.SETRANGE("Source Subtype", SalesHeader."Document Type");

IF NOT ReservationEntry.ISEMPTY THEN BEGIN


ReservationEntry.FINDSET;
REPEAT
ReservationEntry.DELETE(TRUE);
UNTIL ReservationEntry.NEXT = 0;
END;
SalesHeader.DELETE(TRUE);
COMMIT;
END;

//Creamos cabecera
CLEAR(SalesHeader);
SalesHeader.INIT;
IF TransactionHeader."Sale Is Return Sale" THEN
SalesHeader."Document Type" := SalesHeader."Document Type"::"Return Order"
ELSE
SalesHeader."Document Type" := SalesHeader."Document Type"::Order;
SalesHeader."No." := '';
SalesHeader.INSERT(TRUE);
SalesHeader.VALIDATE("Sell-to Customer No.", FranchisesSetupStore."Customer
No.");
SalesHeader.VALIDATE("Posting Date", TransactionHeader.Date);
SalesHeader.VALIDATE("Store No.", Store."No.");
SalesHeader.VALIDATE("Location Code", Store."Location Code");
IF TransactionHeader."Sale Is Return Sale" THEN BEGIN
SalesHeader.VALIDATE("Return Receipt No.", TransactionHeader."Receipt
No.");
SalesHeader.Receive := TRUE;
END ELSE BEGIN
SalesHeader.VALIDATE("Shipping No.", TransactionHeader."Receipt No.");
SalesHeader.Ship := TRUE;
END;

IF ((SalesHeader."Document Type" = SalesHeader."Document Type"::Order) AND


(SalesHeader."External Document No." = '')) OR
((SalesHeader."Document Type" = SalesHeader."Document Type"::Order) AND
(COPYSTR(SalesHeader."No.",1,2) = 'IN'))
THEN
SalesHeader."External Document No." := SalesHeader."No.";
SalesSetup.GET;
IF (SalesHeader."Order Class" <> SalesSetup."Orders - Default Class") AND
GUIALLOWED THEN
IF ShippingAgent.GET(SalesHeader."Shipping Agent Code") THEN BEGIN
NewExternalDocNo := SalesHeader."External Document No.";
IF ShippingAgent."Doc. External No. Lenght" <> 0 THEN
NewExternalDocNo := COPYSTR(NewExternalDocNo, 1, ShippingAgent."Doc.
External No. Lenght");

IF ShippingAgent."Characters Not Allowed" <> '' THEN


NewExternalDocNo := DELCHR(NewExternalDocNo, '=',
ShippingAgent."Characters Not Allowed");
END;
IF NewExternalDocNo <> '' THEN
SalesHeader."External Document No." := NewExternalDocNo;

SalesHeader.MODIFY(TRUE);

//Comprobamos y creamos l�neas


NotEnoughStock := FALSE;
CLEAR(TransSalesEntry);
//n� trans, n� tienda, n� tpv
TransSalesEntry.SETCURRENTKEY("Store No.", "POS Terminal No.", "Transaction
No.");
TransSalesEntry.SETRANGE("Store No.", TransactionHeader."Store No.");
TransSalesEntry.SETRANGE("POS Terminal No.", TransactionHeader."POS Terminal
No.");
TransSalesEntry.SETRANGE("Transaction No.", TransactionHeader."Transaction
No.");
IF NOT TransSalesEntry.ISEMPTY THEN BEGIN
TransSalesEntry.FINDSET;
REPEAT
IF NOT NotEnoughStock THEN BEGIN
//Creamos l�nea
CLEAR(SalesLine);
SalesLine.INIT;
SalesLine."Document Type" := SalesHeader."Document Type";
SalesLine."Document No." := SalesHeader."No.";
SalesLine."Line No." := TransSalesEntry."Line No." * 10000;
SalesLine.INSERT(TRUE);
SalesLine.VALIDATE("Sell-to Customer No.", SalesHeader."Sell-to
Customer No.");
SalesLine.VALIDATE("Location Code", SalesHeader."Location Code");
SalesLine.VALIDATE(Type, SalesLine.Type::Item);
SalesLine.VALIDATE("No.", TransSalesEntry."Item No.");
//SalesLine.VALIDATE(Quantity, ABS(TransSalesEntry.Quantity));
IF SalesLine."Document Type" = SalesLine."Document Type"::Order THEN
SalesLine.VALIDATE(Quantity, TransSalesEntry.Quantity * -1);
IF SalesLine."Document Type" = SalesLine."Document Type"::"Return
Order" THEN
SalesLine.VALIDATE(Quantity, TransSalesEntry.Quantity);
IF TransSalesEntry."Promotion %" <> 0 THEN
SalesLine.VALIDATE("Line Discount %", TransSalesEntry."Promotion %");
SalesLine.MODIFY(TRUE);
//Comprobamos que haya stock/asignamos lotes
TempILE.DELETEALL;
Item.GET(TransSalesEntry."Item No.");
IF Item."Item Tracking Code" <> '' THEN BEGIN
//miramos si hay lotes suficientes, si no hay generamos log error
IF ItemTrackingCode.GET(Item."Item Tracking Code") THEN
IF (ItemTrackingCode."Lot Specific Tracking") OR
(ItemTrackingCode."Lot Info. Outbound Must Exist") OR (ItemTrackingCode."Lot Sales
Outbound Tracking") THEN BEGIN
//revisar 32 y si no hay error asignar lotes
IF GetItemLot(Item."No.", TransSalesEntry."Store No.",
ABS(TransSalesEntry.Quantity), TempILE) OR TransactionHeader."Sale Is Return Sale"
THEN BEGIN
//asignamos lotes
CLEAR(ItemTrackingManagement);
TempTrackingSpecification.RESET;
TempTrackingSpecification.DELETEALL;
CLEAR(TempILE);
LotSet := FALSE;
IF NOT TempILE.ISEMPTY THEN BEGIN
TempILE.FINDSET;
QtyToAssign := SalesLine."Quantity (Base)";
EntryNo := 0;
//creaci�n reserventry
SourceSpecification.INIT;
SourceSpecification.VALIDATE("Item No.",SalesLine."No.");
SourceSpecification.VALIDATE("Location
Code",SalesLine."Location Code");
SourceSpecification.VALIDATE("Quantity (Base)",
SalesLine."Quantity (Base)");
SourceSpecification.VALIDATE("Source Type",DATABASE::"Sales
Line");
SourceSpecification.VALIDATE("Source
Subtype",SalesLine."Document Type");
SourceSpecification.VALIDATE("Source ID",SalesLine."Document
No.");
SourceSpecification.VALIDATE("Source Batch Name",'');
SourceSpecification.VALIDATE("Source Ref.
No.",SalesLine."Line No.");
SourceSpecification.VALIDATE(Correction,FALSE);
REPEAT
EntryNo +=1;
TempTrackingSpecification.INIT;
TempTrackingSpecification."Entry No." := EntryNo;
TempTrackingSpecification."Lot No." := TempILE."Lot No.";
//mover esto al otro lado
IF TempILE."Remaining Quantity" < QtyToAssign THEN BEGIN
TempTrackingSpecification.VALIDATE("Quantity (Base)",
TempILE."Remaining Quantity");
QtyToAssign -= TempILE."Remaining Quantity";
END ELSE BEGIN
TempTrackingSpecification.VALIDATE("Quantity (Base)",
QtyToAssign);
LotSet := TRUE;
END;
TempTrackingSpecification.INSERT(TRUE);
UNTIL (TempILE.NEXT = 0) OR LotSet;
//aqu� llamada a reserventry

ItemTrackingManagement.SetGlobalParameters(SourceSpecification,TempTrackingSpecific
ation,0D);
ItemTrackingManagement.RUN;
END;
END ELSE BEGIN
//generamos log error
Location.GET(SalesLine."Location Code");
IF NOT Location."Permitir stock negativo" THEN BEGIN//220422
InsertStockIncidenceToLog(TransSalesEntry,
FranchisesSetupStore."Customer No.", Item."No.", TRUE);
NotEnoughStock := TRUE;
END;
END;
END ELSE BEGIN
Item.SETFILTER("Location Filter", Store."Location Code");
Item.CALCFIELDS(Inventory);
IF ABS(TransSalesEntry.Quantity) > Item.Inventory THEN BEGIN
Location.GET(Store."Location Code");
IF NOT Location."Permitir stock negativo" THEN BEGIN//220422
//generamos log error
InsertStockIncidenceToLog(TransSalesEntry,
FranchisesSetupStore."Customer No.", Item."No.", FALSE);
NotEnoughStock := TRUE;
END;//220422
END;
END;
END ELSE BEGIN
IF NOT TransactionHeader."Sale Is Return Sale" THEN BEGIN // Si es
devoluci�n no hay que revisar stock
//miramos stock, si no hay generamos log error
Item.SETFILTER("Location Filter", Store."Location Code");
Item.CALCFIELDS(Inventory);
IF ABS(TransSalesEntry.Quantity) > Item.Inventory THEN BEGIN
//generamos log error
Location.GET(Store."Location Code");
IF NOT Location."Permitir stock negativo" THEN BEGIN//220422
InsertStockIncidenceToLog(TransSalesEntry,
FranchisesSetupStore."Customer No.", Item."No.", FALSE);
NotEnoughStock := TRUE;
END;//220422
END;
END;
END;
END;
UNTIL TransSalesEntry.NEXT = 0;
END;
IF NotEnoughStock THEN BEGIN
//eliminamos mov reserva y cabecera+l�neas
CLEAR(ReservationEntry);
ReservationEntry.SETCURRENTKEY("Source ID","Source Ref. No.","Source
Type","Source Subtype","Source Batch Name","Source Prod. Order Line","Reservation
Status","Shipment Date","Expected Receipt Date");
ReservationEntry.SETRANGE("Source ID", SalesHeader."No.");
ReservationEntry.SETRANGE("Source Type", DATABASE::"Sales Line");
ReservationEntry.SETRANGE("Source Subtype", SalesHeader."Document Type");

IF NOT ReservationEntry.ISEMPTY THEN BEGIN


ReservationEntry.FINDSET;
REPEAT
ReservationEntry.DELETE(TRUE);
UNTIL ReservationEntry.NEXT = 0;
END;
SalesHeader.DELETE(TRUE);
COMMIT;
EXIT;
END;

TryToRelease(SalesHeader);
COMMIT;
IF CODEUNIT.RUN(CODEUNIT::"Sales-Post", SalesHeader) THEN BEGIN
TransactionHeader."Pending Sales Shipment Process" := FALSE;
TransactionHeader.MODIFY(TRUE);
//Si hay incidencias las marcamos como "managed" (las relacionadas con ese
tpv, tienda, ticket)
CLEAR(FranchiseShptStockErrLog);
FranchiseShptStockErrLog.SETCURRENTKEY("Store No.","POS Terminal
No.","Receipt No.","Incidence Managed");
FranchiseShptStockErrLog.SETRANGE("Store No.", TransactionHeader."Store
No.");
FranchiseShptStockErrLog.SETRANGE("POS Terminal No.",
TransactionHeader."POS Terminal No.");
FranchiseShptStockErrLog.SETRANGE("Receipt No.", TransactionHeader."Receipt
No.");
FranchiseShptStockErrLog.SETRANGE("Incidence Managed", FALSE);
IF NOT FranchiseShptStockErrLog.ISEMPTY THEN BEGIN
FranchiseShptStockErrLog.FINDSET;
REPEAT
FranchiseShptStockErrLog2.GET(FranchiseShptStockErrLog."Transaction
No.", FranchiseShptStockErrLog."Store No.", FranchiseShptStockErrLog."POS Terminal
No.", FranchiseShptStockErrLog."Receipt No.", FranchiseShptStockErrLog."Line No.");
FranchiseShptStockErrLog2.VALIDATE("Incidence Managed", TRUE);
FranchiseShptStockErrLog2.MODIFY(TRUE);
UNTIL FranchiseShptStockErrLog.NEXT = 0;
END;
END;
//578>
END;

[LineStart(8621)]
LOCAL PROCEDURE InsertStockIncidenceToLog@1100225016(VAR
TransSalesEntry@1100225001 : Record 99001473;CustNo@1100225003 :
Code[20];ItemNo@1100225004 : Code[20];LotStockErr@1100225002 : Boolean);
VAR
FranchiseShptStockErrLog@1100225000 : Record 50136;
Customer@1100225005 : Record 18;
Item@1100225006 : Record 27;
NotEnoughInventoryErr@1100225007 : TextConst 'ENU=Not enough stock for the
item %1 in location %2;ESP=No hay suficiente stock del producto %1 en el almac�n
%2';
Store@1100225008 : Record 99001470;
NotEnoughLotErr@1100225009 : TextConst 'ENU=Not enough qty. in lots found for
item %1 in location %2;ESP=No se ha encontado cantidad suficiente en lotes para el
producto %1 en el almac�n %2';
BEGIN
//<578
IF Customer.GET(CustNo) THEN;
IF Item.GET(ItemNo) THEN;
IF Store.GET(TransSalesEntry."Store No.") THEN;

CLEAR(FranchiseShptStockErrLog);
FranchiseShptStockErrLog.INIT;
FranchiseShptStockErrLog."Transaction No." := TransSalesEntry."Transaction
No.";
FranchiseShptStockErrLog."Store No." := TransSalesEntry."Store No.";
FranchiseShptStockErrLog."POS Terminal No." := TransSalesEntry."POS Terminal
No.";
FranchiseShptStockErrLog."Receipt No." := TransSalesEntry."Receipt No.";
FranchiseShptStockErrLog."Line No." := TransSalesEntry."Line No.";
FranchiseShptStockErrLog."Customer No." := CustNo;
FranchiseShptStockErrLog."Customer Name" := Customer.Name;
FranchiseShptStockErrLog."Item No." := ItemNo;
FranchiseShptStockErrLog.Description := Item.Description;
FranchiseShptStockErrLog.Error := TRUE;
IF LotStockErr THEN
FranchiseShptStockErrLog."Error Description" := STRSUBSTNO(NotEnoughLotErr,
TransSalesEntry."Item No.", Store."Location Code")
ELSE
FranchiseShptStockErrLog."Error Description" :=
STRSUBSTNO(NotEnoughInventoryErr, TransSalesEntry."Item No.", Store."Location
Code");
FranchiseShptStockErrLog.INSERT(TRUE);
//578>
END;

[LineStart(8646)]
LOCAL PROCEDURE GetItemLot@1100225017(ItemNo@1100225000 :
Code[20];StoreNoIn@1100225001 : Code[10];Qty@1100225004 : Decimal;VAR
TempItemLdgEntry@1100225003 : Record 32) : Boolean;
VAR
ItemLdgEntry@1100225002 : Record 32;
Store@1100225005 : Record 99001470;
BEGIN
//<578
TempItemLdgEntry.RESET;
TempItemLdgEntry.SETRANGE("Item No.",ItemNo);
IF NOT TempItemLdgEntry.ISEMPTY THEN
EXIT;

Store.GET(StoreNoIn);

ItemLdgEntry.RESET;
ItemLdgEntry.SETCURRENTKEY("Item No.",Open,"Variant Code","Location
Code","Item Tracking","Lot No.","Serial No.");
ItemLdgEntry.SETRANGE("Item No.",ItemNo);
ItemLdgEntry.SETRANGE(Open,TRUE);
ItemLdgEntry.SETRANGE("Location Code",Store."Location Code");
IF ItemLdgEntry.FINDSET THEN REPEAT
TempItemLdgEntry.INIT;
TempItemLdgEntry := ItemLdgEntry;
TempItemLdgEntry.INSERT;
Qty -= TempItemLdgEntry."Remaining Quantity";
UNTIL (ItemLdgEntry.NEXT = 0) OR (Qty <= 0);

IF Qty > 0 THEN


EXIT(FALSE);

EXIT(TRUE);
//578>
END;

[LineStart(8673)]
LOCAL PROCEDURE TryToRelease@1000000018(VAR SalesHeader@1000000000 : Record
36);
VAR
ReleaseSalesDocument@1000000002 : Codeunit 414;
ApprovalsMgmt@1000000001 : Codeunit 1535;
BEGIN
IF ApprovalsMgmt.IsSalesApprovalsWorkflowEnabled(SalesHeader) THEN BEGIN
IF ApprovalsMgmt.CheckSalesApprovalPossible(SalesHeader) THEN
ApprovalsMgmt.OnSendSalesDocForApproval(SalesHeader)
ELSE
ReleaseSalesDocument.RUN(SalesHeader);
END ELSE
ReleaseSalesDocument.RUN(SalesHeader);
END;

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
528 OS.OA. 01/06/2021. AN_CASTOR. Integraci�n con CASTOR
532 OS.XT. 15/06/2021. MRW_SP20210615_XT. Poder enviar descripcions de
Magento juntament amb la informaci� de producte a franqu�cies.
542 OS.MMC.29/07/2021. MRW_SP20210729_MMC.Actualitzaci� enviament informaci�
producte a franqu�cies per Magento 2
563 OS.OA. 22/11/2021. SP_20211115_MRW. Informar dimensiones tienda al
generar movimientos venta franquicias
565 OS.MM. 24/11/2021. SP_20211115_MRW. No enviar productos seg�n
configuraci�n de estado y precios a Canarias
578 OS.OA. 15/12/2021. Facturaci�n franquicias tipo Canarias
999 OS.XT. 05/10/2021. Modificaci� per les vendes fer ajust positiu si no hi
ha estoc i guardar-ho en taula nova

INC-999 fotal 18/05/2023 Parece que nadie penso en las recepciones


automaticas del SGA :-(
}
END.
}
}

OBJECT Codeunit 50070 Franchises WS


{
OBJECT-PROPERTIES
{
Date=17/01/24;
Time=10:52:06;
Modified=Yes;
Version List=OS,431,528;
}
PROPERTIES
{
OnRun=VAR
FranchMgt@1000000000 : Codeunit 50069;
TransferShipmentHeader@1000000001 : Record 5744;
BEGIN
//SetShipmentConfirmationToLog('{"NumeroDocumentoProveedor":
"10000023","NumeroBultoProveedor": "BULTO_02_001","CodigoTienda": "SIAM","fecha":
"2021-03-26T00:00:00"}');
//TransferShipmentHeader.GET('ENT-0273082-ALB');
//FranchMgt.TransferLogEntrySGA(TransferShipmentHeader);
//MESSAGE('finalizado');
END;
}
CODE
{
VAR
NoDataFoundInJSON@1100225000 : TextConst 'ESP=No se ha encontrado valor en la
recepci�n del mensaje';

[External]
[LineStart(8684)]
PROCEDURE SetSalesToLog@1100225001(JSONString@1100225000 : Text) : Text;
VAR
FranchisesLogEntry@1000000017 : Record 50124;
FranchisesSetup@1000000006 : Record 50123;
FranchisesSetupStore@1000000005 : Record 50126;
TempBlob@1000000003 : TEMPORARY Record 99008535;
Customer@1000000018 : Record 18;
Store@1000000021 : Record 99001470;
Barcodes@1000000034 : Record 99001451;
MyOutStream@1000000002 : OutStream;
JSONManagement@1000000001 : Codeunit 5459;
JObject@1000000000 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JObject1@1000000013 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JArray@1000000027 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
POSTerminalNo@1000000008 : Text;
StoreNo@1000000009 : Text;
ReceiptNo@1000000010 : Text;
CustomerARRAY@1000000011 : Text;
NoCustomerErr@1000000014 : TextConst 'ENU=The field CIF from the customer
information is not filled;ESP=No est� rellenado el campo CIF en la informaci�n del
cliente';
NoexistingCustErr@1000000019 : TextConst 'ENU=The CIF %1 does not correspond
to any Navision customers;ESP=En la configuraci�n de franquicia, la tienda %1 no
tiene configurado el cliente';
NoStoreErr@1000000020 : TextConst 'ENU=The field C�d. Tienda is not
filled;ESP=No est� rellenado el campo C�d. Tienda';
NoExistingStoreErr@1000000022 : TextConst 'ENU=The %1 store does not exist in
the system;ESP=La tienda %1 no existe en el sistema';
NoStoreInFranchise@1000000025 : TextConst 'ESP=La tienda %1 no est�
configurada en ninguna franquicia';
StoreNotEnabledInFranchise@1000000024 : TextConst 'ESP=La tienda %1 no est�
habilitada para funcionar para la franquicia %2';
FranchiseNotEnabled@1000000023 : TextConst 'ESP=La franquicia %1 no est�
habilitada para funcionar';
FranchiseNoReceiptEnabled@1000000007 : TextConst 'ESP=La franquicia %1 no
tiene habilitado el mensaje de recepci�n de material';
Lines@1000000026 : Text;
ErrorToExport@1000000016 : Text;
RequestMessage@1000000015 : Text;
BarcodeNo@1000000033 : Text;
Receivables@1000000035 : Text;
ExistValue@1000000004 : Boolean;
NoLinesErr@1000000028 : TextConst 'ENU=There are no lines for the transaction
that is going to be done;ESP=No existen l�nias para la transacci�n a realizar';
NoBarcodeErr@1000000029 : TextConst 'ENU=The CodBarras field must have a
value;ESP=El campo CodBarras debe tener un valor';
NoQtyErr@1000000030 : TextConst 'ENU=The Unidades field must have a
value;ESP=El campo Unidades debe tener un valor';
NoPriceErr@1000000031 : TextConst 'ENU=The PVPUnitario field must have a
value;ESP=El campo PVPUnitario debe tener un valor';
NoItemErr@1000000032 : TextConst 'ENU=There is no item with the barcode
%1;ESP=No existe ning�n producto con el c�d. de barras %1';
NoAmountErr@1000000036 : TextConst 'ENU=The field Importe must have a
value;ESP=El campo Importe debe tener un valor';
NoPaymType@1000000037 : TextConst 'ENU=The TipoCobro field must have a
value;ESP=El campo TipoCobro debe tener un valor';
NoPOSTerminalErr@1000000038 : TextConst 'ESP=El campo CodigoTPV debe tener un
valor';
POSTerminalNoNotEnabledInFranchise@1000000039 : TextConst 'ESP=El Terminal %1
no est� habilitada para funcionar para la franquicia %2 en la tienda %3';
QuantityTocheck@1100225001 : Decimal;
Item@1100225002 : Record 27;
SalesQuantityErr@1100225003 : TextConst 'ESP=La cantidad para venta de %1
para el producto %2 con c�digo de barras %3 es superior a la cantidad en el
almac�n. Es posible que se tengan que confirmar recepciones primero';
ReturnQuantityErr@1100225004 : TextConst 'ESP=La cantidad de devoluci�n %1
para el producto %2 con c�digo de barras %3 es superior a la cantidad en el
almac�n. Es posible que se tengan que confirmar recepciones primero';
ItemLedgerEntry@1100225005 : Record 32;
TicketForStoreAlreadyExist@1100225006 : TextConst 'ESP=El ticket %1 para la
tienda %2 ya ha sido introducido anteriormente en el sistema, no se permite
duplicar tickets';
TransactionHeader@1100225007 : Record 99001472;
DocumentStoreExistErr@1100225008 : TextConst 'ESP=El documento %1 para la
tienda %2 ya existe';
BEGIN
IF JSONString = '' THEN BEGIN
ErrorToExport := NoDataFoundInJSON;
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;

JSONManagement.InitializeFromString(JSONString);
JSONManagement.GetJSONObject(JObject);

POSTerminalNo := JObject.GetValue('CodigoTPV').ToString;
StoreNo := JObject.GetValue('CodigoTienda').ToString;
ReceiptNo := JObject.GetValue('NumeroDocumentoGN1').ToString;

TransactionHeader.SETCURRENTKEY("Store No.","Wrong Shift","POS Terminal


No.","Receipt No.");
TransactionHeader.SETRANGE("Store No.",StoreNo);
TransactionHeader.SETRANGE("Receipt No.", ReceiptNo);
IF NOT TransactionHeader.ISEMPTY THEN BEGIN

SetResponseJSON(STRSUBSTNO(DocumentStoreExistErr,ReceiptNo,StoreNo),RequestMessage)
;
EXIT(RequestMessage);
END;

CustomerARRAY := JObject.SelectToken('cliente').ToString;

JSONManagement.InitializeObject(CustomerARRAY);
JSONManagement.GetJSONObject(JObject1);

IF StoreNo = '' THEN


IF ErrorToExport <> '' THEN
ErrorToExport += '.' + NoStoreErr
ELSE
ErrorToExport := NoStoreErr;

IF POSTerminalNo = '' THEN


IF ErrorToExport <> '' THEN
ErrorToExport += '.' + NoPOSTerminalErr
ELSE
ErrorToExport := NoPOSTerminalErr;

IF ErrorToExport <> '' THEN BEGIN


SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;

IF NOT Store.GET(StoreNo) THEN BEGIN


ErrorToExport := STRSUBSTNO(NoExistingStoreErr,StoreNo);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END ELSE BEGIN
// Verificar que estigui a alguna franquicia
FranchisesSetupStore.SETCURRENTKEY("Store No.");
FranchisesSetupStore.SETRANGE("Store No.",StoreNo);
IF FranchisesSetupStore.ISEMPTY THEN BEGIN
ErrorToExport := STRSUBSTNO(NoStoreInFranchise,StoreNo);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END ELSE BEGIN
// Mirar que estigui habilitada la tenda
FranchisesSetupStore.FINDFIRST;
IF NOT FranchisesSetupStore."Enable Store" THEN BEGIN
ErrorToExport :=
STRSUBSTNO(StoreNotEnabledInFranchise,StoreNo,FranchisesSetupStore.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
// Mirar que la TPV estigui configurada a la tenda
IF POSTerminalNo <> FranchisesSetupStore."POS Terminal" THEN BEGIN
ErrorToExport :=
STRSUBSTNO(POSTerminalNoNotEnabledInFranchise,POSTerminalNo,FranchisesSetupStore.Co
de,StoreNo);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
// Mirar que la tenda tingui assignat un client
IF FranchisesSetupStore."Customer No." = '' THEN BEGIN
ErrorToExport := STRSUBSTNO(NoexistingCustErr,Store."No.");
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
// Mirar que la franquicia estigui habilitada
FranchisesSetup.GET(FranchisesSetupStore.Code);
IF NOT FranchisesSetup."Enable Franchise" THEN BEGIN
ErrorToExport := STRSUBSTNO(FranchiseNotEnabled,FranchisesSetup.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
// Mirar que la franquicia tingui habilitada la funcionalitat de importar
vendes
IF NOT FranchisesSetup."Enable Import Sales Message" THEN BEGIN
ErrorToExport :=
STRSUBSTNO(FranchiseNoReceiptEnabled,FranchisesSetup.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
// Mirar si el ticket ja ha sigut entrat anteriorment
ItemLedgerEntry.SETCURRENTKEY("Location Code","Document No.");
ItemLedgerEntry.SETRANGE("Location Code",Store."Location Code");
ItemLedgerEntry.SETRANGE("Document No.",ReceiptNo);
IF NOT ItemLedgerEntry.ISEMPTY THEN BEGIN
ErrorToExport :=
STRSUBSTNO(TicketForStoreAlreadyExist,ReceiptNo,Store."No.");
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
END;
END;

Lines := JObject.SelectToken('LineasVenta').ToString;
JSONManagement.InitializeCollection(Lines);
JSONManagement.GetJsonArray(JArray);
IF JArray.ToString = '[]' THEN BEGIN
SetResponseJSON(NoLinesErr,RequestMessage);
EXIT(RequestMessage);
END;

FOREACH JObject1 IN JArray DO BEGIN


ErrorToExport := '';
BarcodeNo := JObject1.GetValue('CodBarras').ToString;
IF BarcodeNo = '' THEN
IF ErrorToExport <> '' THEN
ErrorToExport += '.' + NoBarcodeErr
ELSE
ErrorToExport := NoBarcodeErr;

IF JObject1.GetValue('Unidades').ToString = '' THEN


IF ErrorToExport <> '' THEN
ErrorToExport += '.' + NoQtyErr
ELSE
ErrorToExport := NoQtyErr;

IF JObject1.GetValue('PVPUnitario').ToString = '' THEN


IF ErrorToExport <> '' THEN
ErrorToExport += '.' + NoPriceErr
ELSE
ErrorToExport := NoPriceErr;

IF ErrorToExport <> '' THEN BEGIN


SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;

// �apa del dia por el departamento de operaciones


IF BarcodeNo = '8445641027797' THEN
BarcodeNo := '8445641027795';

IF NOT Barcodes.GET(BarcodeNo) THEN BEGIN


SetResponseJSON(STRSUBSTNO(NoItemErr, BarcodeNo), RequestMessage);
EXIT(RequestMessage);
END;

Item.GET(Barcodes."Item No.");
IF Item."Item Class" <> Item."Item Class"::"No Item ledger Entry" THEN
BEGIN // No control estoc
// Verificar que tenim estoc per la venda
EVALUATE(QuantityTocheck, JObject1.GetValue('Unidades').ToString);

{IF QuantityTocheck > 0 THEN BEGIN


CLEAR(Item);
Item.SETFILTER("Location Filter",Store."Location Code");
Item.SETFILTER("No.",Barcodes."Item No.");
Item.FINDFIRST;
Item.CALCFIELDS(Inventory);
IF QuantityTocheck > Item.Inventory THEN BEGIN

SetResponseJSON(STRSUBSTNO(SalesQuantityErr,QuantityTocheck,Barcodes."Item No.",
BarcodeNo), RequestMessage);
EXIT(RequestMessage);
END;
END ELSE BEGIN
CLEAR(Item);
Item.SETFILTER("Location Filter",FranchisesSetupStore."Invoice
Location");
Item.SETFILTER("No.",Barcodes."Item No.");
Item.FINDFIRST;
Item.CALCFIELDS(Inventory);
IF ABS(QuantityTocheck) > Item.Inventory THEN BEGIN

SetResponseJSON(STRSUBSTNO(ReturnQuantityErr,ABS(QuantityTocheck),Barcodes."Item
No.", BarcodeNo), RequestMessage);
EXIT(RequestMessage);
END;
END; }
END;
END;

//Crearem el LOG per registrar


FranchisesLogEntry.INIT;
FranchisesLogEntry.Action := FranchisesLogEntry.Action::Receive;
FranchisesLogEntry.Operation := FranchisesLogEntry.Operation::Sale;
FranchisesLogEntry.Error := FALSE;
FranchisesLogEntry.Description := '';
FranchisesLogEntry."Franchise Code" := FranchisesSetup.Code;
FranchisesLogEntry."Source Operation" := ReceiptNo;
FranchisesLogEntry."Store No." := StoreNo;

TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(MyOutStream, TEXTENCODING::UTF8);
MyOutStream.WRITETEXT(JSONString);

FranchisesLogEntry."Json File" := TempBlob.Blob;


FranchisesLogEntry."Store Type" := FranchisesLogEntry."Store
Type"::Franchise; //<528
FranchisesLogEntry.INSERT(TRUE);

SetResponseJSON('',RequestMessage);
EXIT(RequestMessage);
END;

[External]
[LineStart(8878)]
PROCEDURE SetInventoryAdjustToLog@1100225004(JSONString@1100225000 : Text) :
Text;
VAR
ErrorToExport@1000000000 : Text;
RequestMessage@1000000001 : Text;
JSONManagement@1000000003 : Codeunit 5459;
JObject@1000000002 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
InventoryType@1000000029 : Text;
GN1DocumentNo@1000000004 : Code[20];
StoreNo@1000000005 : Code[10];
StoreNoSource@1000000006 : Code[10];
NoGN1DocumentNoErr@1000000007 : TextConst 'ESP=No existe valor en
NumeroDocumentoGN1';
NoStoreErr@1000000008 : TextConst 'ENU=The field C�d. Tienda is not
filled;ESP=No est� rellenado el campo CodigoTienda';
Store@1000000009 : Record 99001470;
FranchisesSetup@1000000011 : Record 50123;
FranchisesSetupStore@1000000010 : Record 50126;
NoExistingStoreErr@1000000012 : TextConst 'ENU=The %1 store does not exist in
the system;ESP=La tienda %1 no existe en el sistema';
NoStoreInFranchise@1000000015 : TextConst 'ESP=La tienda %1 no est�
configurada en ninguna franquicia';
StoreNotEnabledInFranchise@1000000014 : TextConst 'ESP=La tienda %1 no est�
habilitada para funcionar para la franquicia %2';
FranchiseNotEnabled@1000000013 : TextConst 'ESP=La franquicia %1 no est�
habilitada para funcionar';
FranchiseNoInventoryEnabled@1000000016 : TextConst 'ESP=La franquicia %1 no
tiene habilitado el mensaje de recepci�n inventario';
Lines@1000000017 : Text;
JArray@1000000018 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
NoDocumentLinesErr@1000000019 : TextConst 'ESP=No existen l�nias para la
transacci�n a realizar';
JObject1@1000000020 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
BarcodeNo@1000000021 : Text;
NoBarcodeErr@1000000023 : TextConst 'ENU=The CodBarras field must have a
value;ESP=El campo CodBarras debe tener un valor';
NoQtyErr@1000000022 : TextConst 'ENU=The Unidades field must have a
value;ESP=El campo Unidades debe tener un valor';
Barcodes@1000000024 : Record 99001451;
NoItemErr@1000000025 : TextConst 'ENU=There is no item with the barcode
%1;ESP=No existe ning�n producto con el c�d. de barras %1';
FranchisesLogEntry@1000000026 : Record 50124;
TempBlob@1000000028 : TEMPORARY Record 99008535;
MyOutStream@1000000027 : OutStream;
Qty@1000000030 : Decimal;
NoValidQtyErr@1000000031 : TextConst 'ESP=El producto con c�digo de barras %1
tiene una cantidad que no se puede tratar';
BEGIN
IF JSONString = '' THEN BEGIN
ErrorToExport := NoDataFoundInJSON;
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
JSONManagement.InitializeFromString(JSONString);
JSONManagement.GetJSONObject(JObject);
InventoryType := JObject.GetValue('Operacion').ToString;
GN1DocumentNo := JObject.GetValue('NumeroDocumentoGN1').ToString;
StoreNo := JObject.GetValue('CodigoTienda').ToString;
StoreNoSource := JObject.GetValue('CodigoTiendaOrigen').ToString;

IF StoreNo = '' THEN


ErrorToExport := NoStoreErr;

IF GN1DocumentNo = '' THEN


IF ErrorToExport <> '' THEN
ErrorToExport += '.' + NoGN1DocumentNoErr
ELSE
ErrorToExport := NoGN1DocumentNoErr;

IF ErrorToExport <> '' THEN BEGIN


SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;

IF NOT Store.GET(StoreNo) THEN BEGIN


ErrorToExport := STRSUBSTNO(NoExistingStoreErr,StoreNo);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END ELSE BEGIN
// Verificar que estigui a alguna franquicia
FranchisesSetupStore.SETCURRENTKEY("Store No.");
FranchisesSetupStore.SETRANGE("Store No.",StoreNo);
IF FranchisesSetupStore.ISEMPTY THEN BEGIN
ErrorToExport := STRSUBSTNO(NoStoreInFranchise,StoreNo);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END ELSE BEGIN
// Mirar que estigui habilitada la tenda
FranchisesSetupStore.FINDFIRST;
IF NOT FranchisesSetupStore."Enable Store" THEN BEGIN
ErrorToExport :=
STRSUBSTNO(StoreNotEnabledInFranchise,StoreNo,FranchisesSetupStore.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
// Mirar que la franquicia estigui habilitada
FranchisesSetup.GET(FranchisesSetupStore.Code);
IF NOT FranchisesSetup."Enable Franchise" THEN BEGIN
ErrorToExport := STRSUBSTNO(FranchiseNotEnabled,FranchisesSetup.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
// Mirar que la franquicia tingui habilitada la funcionalitat de importar
vendes
IF NOT FranchisesSetup."Enable Import Inventory" THEN BEGIN
ErrorToExport :=
STRSUBSTNO(FranchiseNoInventoryEnabled,FranchisesSetup.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
END;
END;
// Si hi ha intercanvi de tendes mirar l'altre tenda
IF StoreNoSource <> '' THEN
IF NOT Store.GET(StoreNoSource) THEN BEGIN
ErrorToExport := STRSUBSTNO(NoExistingStoreErr,StoreNoSource);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END ELSE BEGIN
// Verificar que estigui a alguna franquicia
FranchisesSetupStore.SETCURRENTKEY("Store No.");
FranchisesSetupStore.SETRANGE("Store No.",StoreNoSource);
IF FranchisesSetupStore.ISEMPTY THEN BEGIN
ErrorToExport := STRSUBSTNO(NoStoreInFranchise,StoreNoSource);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END ELSE BEGIN
// Mirar que estigui habilitada la tenda
FranchisesSetupStore.FINDFIRST;
IF NOT FranchisesSetupStore."Enable Store" THEN BEGIN
ErrorToExport :=
STRSUBSTNO(StoreNotEnabledInFranchise,StoreNoSource,FranchisesSetupStore.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
// Mirar que la franquicia estigui habilitada
FranchisesSetup.GET(FranchisesSetupStore.Code);
IF NOT FranchisesSetup."Enable Franchise" THEN BEGIN
ErrorToExport :=
STRSUBSTNO(FranchiseNotEnabled,FranchisesSetup.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
// Mirar que la franquicia tingui habilitada la funcionalitat de
importar vendes
IF NOT FranchisesSetup."Enable Import Inventory" THEN BEGIN
ErrorToExport :=
STRSUBSTNO(FranchiseNoInventoryEnabled,FranchisesSetup.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
END;
END;

Lines := JObject.SelectToken('LineasDocumento').ToString;
JSONManagement.InitializeCollection(Lines);
JSONManagement.GetJsonArray(JArray);
IF JArray.ToString = '[]' THEN BEGIN
SetResponseJSON(NoDocumentLinesErr,RequestMessage);
EXIT(RequestMessage);
END;

FOREACH JObject1 IN JArray DO BEGIN


ErrorToExport := '';
BarcodeNo := JObject1.GetValue('CodBarras').ToString;
IF BarcodeNo = '' THEN
ErrorToExport := NoBarcodeErr;

IF JObject1.GetValue('Unidades').ToString = '' THEN


IF ErrorToExport <> '' THEN
ErrorToExport += '.' + NoQtyErr
ELSE
ErrorToExport := NoQtyErr;

IF NOT EVALUATE(Qty,JObject1.GetValue('Unidades').ToString) THEN


IF ErrorToExport <> '' THEN
ErrorToExport += '.' + STRSUBSTNO(NoValidQtyErr,BarcodeNo)
ELSE
ErrorToExport := STRSUBSTNO(NoValidQtyErr,BarcodeNo);

IF Qty = 0 THEN
IF ErrorToExport <> '' THEN
ErrorToExport += '.' + STRSUBSTNO(NoValidQtyErr,BarcodeNo)
ELSE
ErrorToExport := STRSUBSTNO(NoValidQtyErr,BarcodeNo);

IF ErrorToExport <> '' THEN BEGIN


SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;

IF NOT Barcodes.GET(BarcodeNo) THEN BEGIN


SetResponseJSON(STRSUBSTNO(NoItemErr, BarcodeNo), RequestMessage);
EXIT(RequestMessage);
END;
END;

//Crearem el LOG per registrar


FranchisesLogEntry.INIT;
FranchisesLogEntry.Action := FranchisesLogEntry.Action::Receive;
FranchisesLogEntry.Operation := FranchisesLogEntry.Operation::"Inventory
Adjustment";
FranchisesLogEntry.Error := FALSE;
FranchisesLogEntry.Description := '';
FranchisesLogEntry."Franchise Code" := FranchisesSetup.Code;
FranchisesLogEntry."Store No." := StoreNo;
FranchisesLogEntry."Store No. Source" := StoreNoSource;
FranchisesLogEntry."Inventory Type" := InventoryType;
FranchisesLogEntry."Source Operation" := GN1DocumentNo;

TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(MyOutStream, TEXTENCODING::UTF8);
MyOutStream.WRITETEXT(JSONString);

FranchisesLogEntry."Json File" := TempBlob.Blob;


FranchisesLogEntry."Store Type" := FranchisesLogEntry."Store
Type"::Franchise; //<528
FranchisesLogEntry.INSERT(TRUE);

SetResponseJSON('',RequestMessage);
EXIT(RequestMessage);
END;

[External]
[LineStart(9046)]
PROCEDURE SetShipmentConfirmationToLog@1100225006(JSONString@1100225000 : Text)
: Text;
VAR
FranchisesLogEntry@1100225016 : Record 50124;
ErrorToExport@1100225015 : Text;
RequestMessage@1100225014 : Text;
PostedWhseShipmentNo@1100225011 : Code[20];
StoreNo@1100225010 : Code[20];
ConfirmationDate@1100225009 : Date;
PackageNo@1100225008 : Code[20];
PostedWhseShipmentHeader@1100225007 : Record 7322;
PostedWhseShipmentLine@1100225006 : Record 7323;
PostPackLine@1100225005 : Record 50053;
Store@1100225004 : Record 99001470;
FranchisesSetup@1100225003 : Record 50123;
FranchisesSetupStore@1100225002 : Record 50126;
ExistValue@1100225001 : Boolean;
NoPostedWhseShipmentErr@1100225026 : TextConst 'ESP=No est� rellenado el
campo NumeroDocumentoProveedor';
NoPackageNoErr@1100225025 : TextConst 'ESP=No est� rellenado el campo
NumeroButloProveedor';
NoStoreNoErr@1100225024 : TextConst 'ESP=No est� rellenado elcampo
CodigoTienda';
PostedWhseShipmentFoundErr@1100225023 : TextConst 'ESP=El documento %1 no se
encuentra en el sistema';
NoStoreNoInNAVErr@1100225022 : TextConst 'ESP=La tienda %1 no existe en el
sistema';
NoPackageFoundInDocumentErr@1100225021 : TextConst 'ESP=El bulto %1 no se
encuentra en el documento %2';
NoStoreInFranchise@1100225020 : TextConst 'ESP=La tienda %1 no est�
configurada en ninguna franquicia';
StoreNotEnabledInFranchise@1100225019 : TextConst 'ESP=La tienda %1 no est�
habilitada para funcionar para la franquicia %2';
FranchiseNotEnabled@1100225018 : TextConst 'ESP=La franquicia %1 no est�
habilitada para funcionar';
FranchiseNoReceiptEnabled@1100225017 : TextConst 'ESP=La franquicia %1 no
tiene habilitado el mensaje de recepci�n de material';
TempBlob@1100225028 : TEMPORARY Record 99008535;
MyOutStream@1100225027 : OutStream;
JSONManagement@1100225012 : Codeunit 5459;
JObject@1100225013 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
RecRef@1000000005 : RecordRef;
FieRefShipmentNo@1000000004 : FieldRef;
FieRefPackageNo@1000000003 : FieldRef;
FieRefItemNo@1000000002 : FieldRef;
FieRefQuantity@1000000001 : FieldRef;
FieRefLineNo@1000000000 : FieldRef;
TransferShipmentHeader@1000000006 : Record 5744;
DocFound@1000000007 : Boolean;
BEGIN
// Controls per verificar si les dades s�n correctes
// Que vingui valor lo que envien
IF JSONString = '' THEN BEGIN
ErrorToExport := NoDataFoundInJSON;
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;

JSONManagement.InitializeFromString(JSONString);
JSONManagement.GetJSONObject(JObject);

PostedWhseShipmentNo :=
JObject.GetValue('NumeroDocumentoProveedor').ToString;
PackageNo := COPYSTR(JObject.GetValue('NumeroBultoProveedor').ToString,1,20);
StoreNo := JObject.GetValue('CodigoTienda').ToString;

// Si no hi ha document
IF PostedWhseShipmentNo = '' THEN
ErrorToExport := NoPostedWhseShipmentErr;

// Si no hi ha bulto
IF PackageNo = '' THEN
IF ErrorToExport <> '' THEN
ErrorToExport += '.' + NoPackageNoErr
ELSE
ErrorToExport := NoPackageNoErr;

// Si no hi ha tenda
IF StoreNo = '' THEN
IF ErrorToExport <> '' THEN
ErrorToExport += '.' + NoStoreNoErr
ELSE
ErrorToExport := NoStoreNoErr;

IF ErrorToExport <> '' THEN BEGIN


SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;

// INC-999 ==>
// Si no existeix document al NAV
// IF NOT PostedWhseShipmentHeader.GET(PostedWhseShipmentNo) THEN BEGIN
// ErrorToExport :=
STRSUBSTNO(PostedWhseShipmentFoundErr,PostedWhseShipmentNo);
// SetResponseJSON(ErrorToExport,RequestMessage);
// EXIT(RequestMessage);
// END;

// �apa del dia, a veces EGD indica en la tabla 80025 el numero de albaran,
otras el numero del PT, otras no envia datos
IF TransferShipmentHeader.GET(PostedWhseShipmentNo) THEN BEGIN
// Primero buscamos por el PT y el numero de bulto
RecRef.OPEN(80025);
FieRefShipmentNo := RecRef.FIELD(110);
FieRefShipmentNo.SETFILTER(TransferShipmentHeader."Transfer Order No.");
FieRefPackageNo := RecRef.FIELD(10);
FieRefPackageNo.SETFILTER(PackageNo);
IF RecRef.FINDFIRST THEN
DocFound := TRUE;

// Luego buscamos por el numero de envio de transferencia + bulto


IF NOT DocFound THEN BEGIN
FieRefShipmentNo.SETFILTER(PostedWhseShipmentNo);
FieRefPackageNo := RecRef.FIELD(10);
FieRefPackageNo.SETFILTER(PackageNo);
IF RecRef.FINDFIRST THEN
DocFound := TRUE;
END;

// Luego si no lo encuentra buscamos por el n�mero de bulto, que deber�a de


ser �nico.
IF NOT DocFound THEN BEGIN
RecRef.CLOSE;
CLEAR(RecRef);
RecRef.OPEN(80025);
FieRefPackageNo := RecRef.FIELD(10);
FieRefPackageNo.SETFILTER(PackageNo);
IF NOT RecRef.FINDFIRST THEN BEGIN
ErrorToExport :=
STRSUBSTNO(NoPackageFoundInDocumentErr,PackageNo,PostedWhseShipmentNo);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
END;
END;

// RecRef.OPEN(80025);
// FieRefShipmentNo := RecRef.FIELD(110);
// FieRefShipmentNo.SETFILTER(PostedWhseShipmentNo);
// IF NOT RecRef.FINDFIRST THEN BEGIN
// ErrorToExport :=
STRSUBSTNO(PostedWhseShipmentFoundErr,PostedWhseShipmentNo);
// SetResponseJSON(ErrorToExport,RequestMessage);
// EXIT(RequestMessage);
// END;

// Si no existeix el bulto per aquest document


// CLEAR(PostPackLine);
// PostPackLine.SETCURRENTKEY("Packing No.","Package No.");
// PostPackLine.SETRANGE("Packing No.",PostedWhseShipmentHeader."Posted
Packing No.");
// PostPackLine.SETRANGE("Package No.",PackageNo);
// IF PostPackLine.ISEMPTY THEN BEGIN
// ErrorToExport :=
STRSUBSTNO(NoPackageFoundInDocumentErr,PackageNo,PostedWhseShipmentNo);
// SetResponseJSON(ErrorToExport,RequestMessage);
// EXIT(RequestMessage);
// END;

// CLEAR(RecRef);
// RecRef.OPEN(80025);
// FieRefShipmentNo := RecRef.FIELD(110);
// FieRefShipmentNo.SETFILTER(PostedWhseShipmentNo);
// FieRefPackageNo := RecRef.FIELD(10);
// FieRefPackageNo.SETFILTER(PackageNo);
// IF NOT RecRef.FINDFIRST THEN BEGIN
// ErrorToExport :=
STRSUBSTNO(NoPackageFoundInDocumentErr,PackageNo,PostedWhseShipmentNo);
// SetResponseJSON(ErrorToExport,RequestMessage);
// EXIT(RequestMessage);
// END;
// INC-999 <==

// Verificar que la tenda estigui donada d'alta a una franquicia i existeixi


tenda
IF NOT Store.GET(StoreNo) THEN BEGIN
ErrorToExport := STRSUBSTNO(NoStoreNoInNAVErr,StoreNo);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END ELSE BEGIN
// Verificar que estigui a alguna franquicia
FranchisesSetupStore.SETCURRENTKEY("Store No.");
FranchisesSetupStore.SETRANGE("Store No.",StoreNo);
IF FranchisesSetupStore.ISEMPTY THEN BEGIN
ErrorToExport := STRSUBSTNO(NoStoreInFranchise,StoreNo);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END ELSE BEGIN
// Mirar que estigui habilitada la tenda
FranchisesSetupStore.FINDFIRST;
IF NOT FranchisesSetupStore."Enable Store" THEN BEGIN
ErrorToExport :=
STRSUBSTNO(StoreNotEnabledInFranchise,StoreNo,FranchisesSetupStore.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
// Mirar que la franquicia estigui habilitada
FranchisesSetup.GET(FranchisesSetupStore.Code);
IF NOT FranchisesSetup."Enable Franchise" THEN BEGIN
ErrorToExport := STRSUBSTNO(FranchiseNotEnabled,FranchisesSetup.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
// Mirar que la franquicia tingui habilitada la funcionalitat de
recepcionar
IF NOT FranchisesSetup."Enable Import Confirm Message" THEN BEGIN
ErrorToExport :=
STRSUBSTNO(FranchiseNoReceiptEnabled,FranchisesSetup.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
END;
END;

//Crearem el LOG per registrar


FranchisesLogEntry.INIT;
FranchisesLogEntry.Action := FranchisesLogEntry.Action::Receive;
FranchisesLogEntry.Operation := FranchisesLogEntry.Operation::"Confirmation
Receipt";
FranchisesLogEntry.Error := FALSE;
FranchisesLogEntry.Description := '';
FranchisesLogEntry."Franchise Code" := FranchisesSetup.Code;
FranchisesLogEntry."Store No." := StoreNo;
// INC-999 ==>
// FranchisesLogEntry."Posted Warehouse Shipment No." :=
PostedWhseShipmentHeader."No.";
FranchisesLogEntry."Posted Warehouse Shipment No." := PostedWhseShipmentNo;
// INC-999 <==
FranchisesLogEntry."Package No" := PackageNo;

TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(MyOutStream, TEXTENCODING::UTF8);
MyOutStream.WRITETEXT(JSONString);

FranchisesLogEntry."Json File" := TempBlob.Blob;


FranchisesLogEntry."Store Type" := FranchisesLogEntry."Store
Type"::Franchise; //<528
FranchisesLogEntry.INSERT(TRUE);
SetResponseJSON('',RequestMessage);
EXIT(RequestMessage);
END;

[External]
[LineStart(9224)]
PROCEDURE SetStockToLog@1100225010(JSONString@1100225000 : Text) : Text;
VAR
ErrorToExport@1000000003 : Text;
RequestMessage@1000000002 : Text;
JSONManagement@1000000001 : Codeunit 5459;
JObject@1000000000 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
ListaStocks@1000000004 : Text;
JArray@1000000005 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JArray";
JObject1@1000000012 : DotNet
"'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
StoreNo@1000000011 : Code[10];
Store@1000000010 : Record 99001470;
FranchisesSetup@1000000009 : Record 50123;
FranchisesSetupStore@1000000008 : Record 50126;
BarcodeNo@1000000007 : Text;
Barcodes@1000000006 : Record 99001451;
NoListaStocksErr@1000000021 : TextConst 'ESP=No existen l�nias para la
transacci�n a realizar';
NoStoreErr@1000000013 : TextConst 'ENU=The field C�d. Tienda is not
filled;ESP=No est� rellenado el campo CodigoTienda';
NoBarcodeErr@1000000014 : TextConst 'ENU=The CodBarras field must have a
value;ESP=El campo CodBarras debe tener un valor';
NoStockErr@1000000015 : TextConst 'ENU=The Unidades field must have a
value;ESP=El campo Stock debe tener un valor';
NoItemErr@1000000022 : TextConst 'ENU=There is no item with the barcode
%1;ESP=No existe ning�n producto con el c�d. de barras %1';
NoExistingStoreErr@1000000016 : TextConst 'ENU=The %1 store does not exist in
the system;ESP=La tienda %1 no existe en el sistema';
NoStoreInFranchise@1000000017 : TextConst 'ESP=La tienda %1 no est�
configurada en ninguna franquicia';
StoreNotEnabledInFranchise@1000000019 : TextConst 'ESP=La tienda %1 no est�
habilitada para funcionar para la franquicia %2';
FranchiseNotEnabled@1000000018 : TextConst 'ESP=La franquicia %1 no est�
habilitada para funcionar';
FranchiseNoStockEnabled@1000000020 : TextConst 'ESP=La franquicia %1 no tiene
habilitado el mensaje de recepci�n estoc';
FranchisesLogEntry@1000000025 : Record 50124;
TempBlob@1000000024 : TEMPORARY Record 99008535;
MyOutStream@1000000023 : OutStream;
TempStore@1100225001 : TEMPORARY Record 99001470;
BEGIN
IF JSONString = '' THEN BEGIN
ErrorToExport := NoDataFoundInJSON;
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;

JSONManagement.InitializeFromString(JSONString);
JSONManagement.GetJSONObject(JObject);

ListaStocks := JObject.SelectToken('ListaStocks').ToString;
JSONManagement.InitializeCollection(ListaStocks);
JSONManagement.GetJsonArray(JArray);
IF JArray.ToString = '[]' THEN BEGIN
SetResponseJSON(NoListaStocksErr,RequestMessage);
EXIT(RequestMessage);
END;

FOREACH JObject1 IN JArray DO BEGIN


ErrorToExport := '';

StoreNo := JObject1.GetValue('CodigoTienda').ToString;
IF StoreNo = '' THEN
ErrorToExport := NoStoreErr;

BarcodeNo := JObject1.GetValue('CodBarras').ToString;
IF BarcodeNo = '' THEN
IF ErrorToExport <> '' THEN
ErrorToExport += '.' + NoBarcodeErr
ELSE
ErrorToExport := NoBarcodeErr;

IF JObject1.GetValue('Stock').ToString = '' THEN


IF ErrorToExport <> '' THEN
ErrorToExport += '.' + NoStockErr
ELSE
ErrorToExport := NoStockErr;

IF ErrorToExport <> '' THEN BEGIN


SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;

IF NOT Barcodes.GET(BarcodeNo) THEN BEGIN


SetResponseJSON(STRSUBSTNO(NoItemErr, BarcodeNo), RequestMessage);
EXIT(RequestMessage);
END;

IF NOT TempStore.GET(StoreNo) THEN BEGIN


TempStore."No." := StoreNo;
TempStore.INSERT;

IF NOT Store.GET(StoreNo) THEN BEGIN


ErrorToExport := STRSUBSTNO(NoExistingStoreErr,StoreNo);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END ELSE BEGIN
// Verificar que estigui a alguna franquicia
FranchisesSetupStore.SETCURRENTKEY("Store No.");
FranchisesSetupStore.SETRANGE("Store No.",StoreNo);
IF FranchisesSetupStore.ISEMPTY THEN BEGIN
ErrorToExport := STRSUBSTNO(NoStoreInFranchise,StoreNo);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END ELSE BEGIN
// Mirar que estigui habilitada la tenda
FranchisesSetupStore.FINDFIRST;
IF NOT FranchisesSetupStore."Enable Store" THEN BEGIN
ErrorToExport :=
STRSUBSTNO(StoreNotEnabledInFranchise,StoreNo,FranchisesSetupStore.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
// Mirar que la franquicia estigui habilitada
FranchisesSetup.GET(FranchisesSetupStore.Code);
IF NOT FranchisesSetup."Enable Franchise" THEN BEGIN
ErrorToExport :=
STRSUBSTNO(FranchiseNotEnabled,FranchisesSetup.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
// Mirar que la franquicia tingui habilitada la funcionalitat de
importar estoc
IF NOT FranchisesSetup."Enable Import Stock" THEN BEGIN
ErrorToExport :=
STRSUBSTNO(FranchiseNoStockEnabled,FranchisesSetup.Code);
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;
END;
END;
END;
END;

//Crearem el LOG per registrar


FranchisesLogEntry.INIT;
FranchisesLogEntry.Action := FranchisesLogEntry.Action::Receive;
FranchisesLogEntry.Operation := FranchisesLogEntry.Operation::Stock;
FranchisesLogEntry.Error := FALSE;
FranchisesLogEntry.Description := '';
FranchisesLogEntry."Franchise Code" := FranchisesSetup.Code;

TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(MyOutStream, TEXTENCODING::UTF8);
MyOutStream.WRITETEXT(JSONString);

FranchisesLogEntry."Json File" := TempBlob.Blob;


FranchisesLogEntry."Store Type" := FranchisesLogEntry."Store
Type"::Franchise; //<528
FranchisesLogEntry.INSERT(TRUE);

SetResponseJSON('',RequestMessage);
EXIT(RequestMessage);
END;

[External]
[LineStart(9333)]
PROCEDURE SetContactToLog@1100225011(JSONString@1100225000 : Text) : Text;
VAR
JObject@1000000005 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
JSONManagement@1000000004 : Codeunit 5459;
FranchisesSetup@1000000002 : Record 50123;
FranchisesSetupStore@1000000001 : Record 50126;
FranchisesLogEntry@1000000022 : Record 50124;
TempBlob@1000000024 : TEMPORARY Record 99008535;
MyOutStream@1000000023 : OutStream;
RequestMessage@1000000000 : Text;
ErrorToExport@1000000003 : Text;
ContactName@1000000006 : Text;
VATRegistrationNo@1000000007 : Code[20];
NoContactNameErr@1000000008 : TextConst 'ENU=The contact must have
name;ESP=El contacto debe tener nombre';
NoVATNoErr@1000000009 : TextConst 'ENU=The contact must have VAT Registration
No.;ESP=El contacto debe tener CIF/NIF';
Address@1000000010 : Text;
NoAddressErr@1000000011 : TextConst 'ENU=The contact must have address;ESP=El
contacto debe tener direcci�n';
PhoneNo@1000000012 : Text;
NoPhoneErr@1000000013 : TextConst 'ENU=The contact must have a phone
number;ESP=El contacto debe tener n�mero de tel�fono';
MobilePhoneNo@1000000014 : Text;
NoMobilePhoneErr@1000000015 : TextConst 'ENU=The contact must have a mobile
phone number;ESP=El contacto debe tener n�mero de tel�fono m�vil';
Mail@1000000016 : Text;
NoMailErr@1000000017 : TextConst 'ENU=The contact must have e-mail
address;ESP="El contacto debe tener correo electr�nico "';
PostalCode@1000000018 : Text;
NoPostCodeErr@1000000019 : TextConst 'ENU=The contact must have a postal
code;ESP=El contacto debe tener c�digo postal';
City@1000000020 : Text;
NoCityErr@1000000021 : TextConst 'ENU=The contact must have city;ESP=El
contacto debe tener localidad';
NoStoreErr@1100225002 : TextConst 'ENU=The contact must have city;ESP=El
contacto debe pertenecer a una tienda';
BEGIN
IF JSONString = '' THEN BEGIN
ErrorToExport := NoDataFoundInJSON;
SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;

JSONManagement.InitializeFromString(JSONString);
JSONManagement.GetJSONObject(JObject);

ContactName := JObject.GetValue('NombreCliente').ToString;
// IF ContactName = '' THEN
// IF ErrorToExport <> '' THEN
// ErrorToExport += '.' + NoContactNameErr
// ELSE
// ErrorToExport := NoContactNameErr;

VATRegistrationNo := JObject.GetValue('CIF_NIF').ToString;
// IF VATRegistrationNo = '' THEN
// IF ErrorToExport <> '' THEN
// ErrorToExport += '.' + NoVATNoErr
// ELSE
// ErrorToExport := NoVATNoErr;

Address := JObject.GetValue('DireccionCliente').ToString;
// IF Address = '' THEN
// IF ErrorToExport <> '' THEN
// ErrorToExport += '.' + NoAddressErr
// ELSE
// ErrorToExport := NoAddressErr;

PostalCode := JObject.GetValue('CodigoPostalCliente').ToString;
// IF PostalCode = '' THEN
// IF ErrorToExport <> '' THEN
// ErrorToExport += '.' + NoPostCodeErr
// ELSE
// ErrorToExport := NoPostCodeErr;

PhoneNo := JObject.GetValue('TelefonoCliente').ToString;
// IF PhoneNo = '' THEN
// IF ErrorToExport <> '' THEN
// ErrorToExport += '.' + NoPhoneErr
// ELSE
// ErrorToExport := NoPhoneErr;

MobilePhoneNo := JObject.GetValue('MovilCliente').ToString;
// IF MobilePhoneNo = '' THEN
// IF ErrorToExport <> '' THEN
// ErrorToExport += '.' + NoMobilePhoneErr
// ELSE
// ErrorToExport := NoMobilePhoneErr;

Mail := JObject.GetValue('EmailCliente').ToString;
// IF Mail = '' THEN
// IF ErrorToExport <> '' THEN
// ErrorToExport += '.' + NoMailErr
// ELSE
// ErrorToExport := NoMailErr;

City := JObject.GetValue('Localidad').ToString;
// IF City = '' THEN
// IF ErrorToExport <> '' THEN
// ErrorToExport += '.' + NoCityErr
// ELSE
// ErrorToExport := NoCityErr;

IF ErrorToExport <> '' THEN BEGIN


SetResponseJSON(ErrorToExport,RequestMessage);
EXIT(RequestMessage);
END;

//Crearem el LOG per registrar


FranchisesLogEntry.INIT;
FranchisesLogEntry.Action := FranchisesLogEntry.Action::Receive;
FranchisesLogEntry.Operation := FranchisesLogEntry.Operation::Contact;
FranchisesLogEntry.Error := FALSE;
FranchisesLogEntry.Description := '';
FranchisesLogEntry."Franchise Code" := FranchisesSetup.Code;

TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(MyOutStream, TEXTENCODING::UTF8);
MyOutStream.WRITETEXT(JSONString);

FranchisesLogEntry."Json File" := TempBlob.Blob;


FranchisesLogEntry."Store Type" := FranchisesLogEntry."Store
Type"::Franchise; //<528
FranchisesLogEntry.INSERT(TRUE);

SetResponseJSON('',RequestMessage);
EXIT(RequestMessage);
END;

[LineStart(9423)]
LOCAL PROCEDURE SetResponseJSON@1100225002(ErrorText@1100225000 : Text;VAR
RequestMessage@1100225001 : Text);
VAR
JSONManagement@1100225002 : Codeunit 5459;
JObject@1100225003 : DotNet "'Newtonsoft.Json'.Newtonsoft.Json.Linq.JObject";
BEGIN
JSONManagement.InitializeEmptyObject;
JSONManagement.GetJSONObject(JObject);

IF ErrorText <> '' THEN BEGIN


JSONManagement.AddJPropertyToJObject(JObject, 'Estado', 'OaK');
JSONManagement.AddJPropertyToJObject(JObject, 'MensajeError', ErrorText);
END ELSE BEGIN
JSONManagement.AddJPropertyToJObject(JObject, 'Estado', 'OK');
JSONManagement.AddJPropertyToJObject(JObject, 'MensajeError', '');
END;
JSONManagement.AddJPropertyToJObject(JObject, 'Fecha', STRSUBSTNO('%1
%2',FORMAT(WORKDATE,0,'<Day,2>-<Month,2>-<Year4>'), TIME));

RequestMessage := JObject.ToString();
END;

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
528 OS.OA. 01/06/2021. AN_CASTOR. Integraci�n con CASTOR
INC-999 fotal 18/05/2023 Parece que nadie penso en las recepciones
automaticas del SGA :-(
}
END.
}
}

OBJECT Codeunit 50071 Franchises Subscriptions


{
OBJECT-PROPERTIES
{
Date=18/05/23;
Time=12:00:00;
Modified=Yes;
Version List=OS,431;
}
PROPERTIES
{
OnRun=VAR
ImportarproductesFranchise@1100225000 : Record 50130;
Item@1100225001 : Record 27;
Window@1100225002 : Dialog;
CurrRec@1100225003 : Integer;
NoOfRecs@1100225004 : Integer;
BEGIN
// AGV-000 ==>
// IF ImportarproductesFranchise.FINDSET THEN
// Window.OPEN('Processing data... @1@@@@@@@@@@');
// NoOfRecs := ImportarproductesFranchise.COUNT;
// REPEAT
// CurrRec += 1;
// IF NoOfRecs <= 100 THEN
// Window.UPDATE(1,(CurrRec / NoOfRecs * 10000) DIV 1)
// ELSE IF CurrRec MOD (NoOfRecs DIV 100) = 0 THEN
// Window.UPDATE(1,(CurrRec / NoOfRecs * 10000) DIV 1);
//
// IF Item.GET(ImportarproductesFranchise."Item No.") THEN BEGIN
// Item."Send Item Info To Franchise" := TRUE;
// Item.MODIFY;
// END;
// UNTIL ImportarproductesFranchise.NEXT = 0;
// AGV-000 <==
END;

}
CODE
{

[EventSubscriber(Codeunit,5763,OnAfterPostWhseShipment)]
[LineStart(9457)]
LOCAL PROCEDURE Cdu5763_OnAfterPostWhseShipment@1100225000(VAR
WarehouseShipmentHeader@1100225000 : Record 7320);
VAR
FranchisesManagement@1100225001 : Codeunit 50069;
BEGIN
FranchisesManagement.TransferLogEntry(WarehouseShipmentHeader);
END;

[EventSubscriber(Table,5745,OnAfterCopyFromTransferLine)]
[LineStart(9460)]
LOCAL PROCEDURE
OnAfterCopyFromTransferLine_Table_TransferShipmentLine@1000000000(VAR
TransferShipmentLine@1000000000 : Record 5745;TransferLine@1000000001 : Record
5741);
BEGIN
// INC-999 ==>
TransferShipmentLine."Source Line No." := TransferLine."Line No.";
// INC-999 <==
END;

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
}
END.
}
}

OBJECT Page 43 Sales Invoice


{
OBJECT-PROPERTIES
{
Date=30/09/21;
Time=17:31:07;
Modified=Yes;
Version
List=NAVW114.01,NAVES14.01,AITANASTD1.08,AITANA,001,MRW,999,OS,044,315,411,431,451,
SIIME;
}
PROPERTIES
{
CaptionML=[ENU=Sales Invoice;
ESP=Factura venta];
SourceTable=Table36;
SourceTableView=WHERE(Document Type=FILTER(Invoice));
PageType=Document;
RefreshOnActivate=Yes;

PromotedActionCategoriesML=[ENU=New,Process,Report,Approve,Posting,Prepare,Invoice,
Release,Request Approval,View,Navigate;

ESP=Nuevo,Procesar,Informe,Aprobar,Registrar,Preparar,Factura,Liberar,Solicitar
aprobaci�n,Ver,Navegar];
OnInit=VAR
SalesReceivablesSetup@1001 : Record 311;
BEGIN
JobQueuesUsed := SalesReceivablesSetup.JobQueueActive;
SetExtDocNoMandatoryCondition;

ForcedDate := SIIMESetup.GetForcedSalesSDate; //SIIME.002


END;

OnOpenPage=VAR
PaymentServiceSetup@1002 : Record 1060;
OfficeMgt@1000 : Codeunit 1630;
PermissionManager@1001 : Codeunit 9002;
SIIManagement@1100000 : Codeunit 10756;
BEGIN
IF UserMgt.GetSalesFilter <> '' THEN BEGIN
FILTERGROUP(2);
SETRANGE("Responsibility Center",UserMgt.GetSalesFilter);
FILTERGROUP(0);
END;

ActivateFields;

SetDocNoVisible;
SetControlAppearance;

IF "Quote No." <> '' THEN


ShowQuoteNo := TRUE;

IF "No." = '' THEN


IF OfficeMgt.CheckForExistingInvoice("Sell-to Customer No.")
THEN
ERROR(''); // Cancel invoice creation
IsSaaS := PermissionManager.SoftwareAsAService;
IF ("No." <> '') AND ("Sell-to Customer No." = '') THEN
DocumentIsPosted := (NOT GET("Document Type","No."));

SIIManagement.CombineOperationDescription("Operation
Description","Operation Description 2",OperationDescription);
PaymentServiceVisible :=
PaymentServiceSetup.IsPaymentServiceVisible;
END;

OnAfterGetRecord=BEGIN
ShowQuoteNo := "Quote No." <> '';

SetControlAppearance;
WorkDescription := GetWorkDescription;
UpdateShipToBillToGroupVisibility
END;
OnNewRecord=BEGIN
xRec.INIT;
"Responsibility Center" := UserMgt.GetSalesFilter;
IF (NOT DocNoVisible) AND ("No." = '') THEN
SetSellToCustomerFromFilter;

SetDefaultPaymentServices;
UpdateShipToBillToGroupVisibility;
END;

OnInsertRecord=BEGIN
IF DocNoVisible THEN
CheckCreditMaxBeforeInsert;

IF ("Sell-to Customer No." = '') AND (GETFILTER("Sell-to


Customer No.") <> '') THEN
CurrPage.UPDATE(FALSE);
END;

OnDeleteRecord=BEGIN
CurrPage.SAVERECORD;
EXIT(ConfirmDeletion);
END;

OnQueryClosePage=BEGIN
IF NOT (SkipConfirmationDialogOnClosing OR DocumentIsPosted)
THEN
EXIT(ConfirmCloseUnposted)
END;

OnAfterGetCurrRecord=VAR
SIIManagement@1100000 : Codeunit 10756;
BEGIN

CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);

CurrPage.ApprovalFactBox.PAGE.UpdateApprovalEntriesFromSourceRecord(RECORDID);
ShowWorkflowStatus :=
CurrPage.WorkflowStatus.PAGE.SetFilterOnWorkflowRecord(RECORDID);

UpdatePaymentService;

SIIManagement.CombineOperationDescription("Operation
Description","Operation Description 2",OperationDescription);
END;

ActionList=ACTIONS
{
{ 1900000003;0 ;ActionContainer;
ActionContainerType=RelatedInformation }
{ 57 ;1 ;ActionGroup;
CaptionML=[ENU=&Invoice;
ESP=&Factura];
Image=Invoice }
{ 59 ;2 ;Action ;
Name=Statistics;
ShortCutKey=F7;
CaptionML=[ENU=Statistics;
ESP=Estad�sticas];
ToolTipML=[ENU=View statistical information, such as the
value of posted entries, for the record.;
ESP=Permite ver informaci�n estad�stica del
registro, como el valor de los movimientos registrados.];
ApplicationArea=#Basic,#Suite;
Promoted=Yes;
Enabled="No." <> '';
PromotedIsBig=Yes;
Image=Statistics;
PromotedCategory=Category7;
OnAction=VAR
Handled@1000 : Boolean;
BEGIN
OnBeforeStatisticsAction(Rec,Handled);
IF NOT Handled THEN BEGIN
CalcInvDiscForHeader;
COMMIT;
PAGE.RUNMODAL(PAGE::"Sales Statistics",Rec);

SalesCalcDiscountByType.ResetRecalculateInvoiceDisc(Rec);
END
END;
}
{ 61 ;2 ;Action ;
CaptionML=[ENU=Co&mments;
ESP=C&omentarios];
ToolTipML=[ENU=View or add comments for the record.;
ESP=Permite ver o agregar comentarios para el
registro.];
ApplicationArea=#Comments;
RunObject=Page 67;
RunPageLink=Document Type=FIELD(Document Type),
No.=FIELD(No.),
Document Line No.=CONST(0);
Promoted=Yes;
Image=ViewComments;
PromotedCategory=Category7 }
{ 162 ;2 ;Action ;
Name=Approvals;
AccessByPermission=TableData 454=R;
CaptionML=[ENU=Approvals;
ESP=Aprobaciones];
ToolTipML=[ENU=View a list of the records that are waiting to
be approved. For example, you can see who requested the record to be approved, when
it was sent, and when it is due to be approved.;
ESP=Permite ver una lista de los registros en
espera de aprobaci�n. Por ejemplo, puede ver qui�n ha solicitado la aprobaci�n del
registro, cu�ndo se envi� y la fecha de vencimiento de la aprobaci�n.];
ApplicationArea=#Suite;
Promoted=Yes;
Image=Approvals;
PromotedCategory=Category7;
OnAction=VAR
WorkflowsEntriesBuffer@1001 : Record 832;
BEGIN

WorkflowsEntriesBuffer.RunWorkflowEntriesPage(RECORDID,DATABASE::"Sales
Header","Document Type","No.");
END;
}
{ 6 ;2 ;Action ;
Name=Function_CustomerCard;
ShortCutKey=Shift+F7;
CaptionML=[ENU=Customer;
ESP=Cliente];
ToolTipML=[ENU=View or edit detailed information about the
customer on the sales document.;
ESP=Permite ver o editar la informaci�n detallada
sobre el cliente en el documento de venta.];
ApplicationArea=#Basic,#Suite;
RunObject=Page 21;
RunPageLink=No.=FIELD(Sell-to Customer No.);
Promoted=Yes;
Enabled=IsCustomerOrContactNotEmpty;
Image=Customer;
PromotedCategory=Category11 }
{ 116 ;2 ;Action ;
Name=Dimensions;
AccessByPermission=TableData 348=R;
ShortCutKey=Shift+Ctrl+D;
CaptionML=[ENU=Dimensions;
ESP=Dimensiones];
ToolTipML=[ENU=View or edit dimensions, such as area,
project, or department, that you can assign to sales and purchase documents to
distribute costs and analyze transaction history.;
ESP=Permite ver o editar dimensiones, como el
�rea, el proyecto o el departamento, que pueden asignarse a los documentos de venta
y compra para distribuir costes y analizar el historial de transacciones.];
ApplicationArea=#Dimensions;
Promoted=Yes;
Enabled="No." <> '';
PromotedIsBig=Yes;
Image=Dimensions;
PromotedCategory=Category7;
OnAction=BEGIN
ShowDocDim;
CurrPage.SAVERECORD;
END;
}
{ 1901458458;2 ;Action ;
Name=DocAttach;
CaptionML=[ENU=Attachments;
ESP=Datos adjuntos];
ToolTipML=[ENU=Add a file as an attachment. You can attach
images as well as documents.;
ESP=Permite agregar un archivo como adjunto. Puede
adjuntar im�genes y documentos.];
ApplicationArea=#All;
Promoted=Yes;
Image=Attach;
PromotedCategory=Category7;
OnAction=VAR
DocumentAttachmentDetails@1001 : Page 1173;
RecRef@1000 : RecordRef;
BEGIN
RecRef.GETTABLE(Rec);
DocumentAttachmentDetails.OpenForRecRef(RecRef);
DocumentAttachmentDetails.RUNMODAL;
END;
}
{ 1100225022;2 ;Action ;
Name=AssignLot;
CaptionML=[ENU=Assing Lot;
ESP=Asignar lote];
Promoted=Yes;
PromotedIsBig=Yes;
Image=Lot;
PromotedCategory=Category11;
OnAction=VAR
TextErr50000@7141744 : TextConst 'ENU=No se ha
podido enviar el EMail. Error: %1';
Text50001@7141745 : TextConst 'ENU=Email enviado
correctamente';
Text50002@7141748 : TextConst;
SalesManagement@1000000000 : Codeunit 50016;
BEGIN

SalesManagement.CalcLotNoSalesInvoiceLines(Rec); //<451
END;
}
{ 1900000004; ;ActionContainer;
ActionContainerType=ActionItems }
{ 29 ;1 ;ActionGroup;
CaptionML=[ENU=Approval;
ESP=Aprobaci�n] }
{ 27 ;2 ;Action ;
Name=Approve;
CaptionML=[ENU=Approve;
ESP=Aprobar];
ToolTipML=[ENU=Approve the requested changes.;
ESP=Aprueba los cambios solicitados.];
ApplicationArea=#All;
Promoted=Yes;
Visible=OpenApprovalEntriesExistForCurrUser;
PromotedIsBig=Yes;
Image=Approve;
PromotedCategory=Category4;
PromotedOnly=Yes;
OnAction=BEGIN

ApprovalsMgmt.ApproveRecordApprovalRequest(RECORDID);
END;
}
{ 25 ;2 ;Action ;
Name=Reject;
CaptionML=[ENU=Reject;
ESP=Rechazar];
ToolTipML=[ENU=Reject the approval request.;
ESP=Rechaza la solicitud de aprobaci�n.];
ApplicationArea=#All;
Promoted=Yes;
Visible=OpenApprovalEntriesExistForCurrUser;
PromotedIsBig=Yes;
Image=Reject;
PromotedCategory=Category4;
PromotedOnly=Yes;
OnAction=BEGIN

ApprovalsMgmt.RejectRecordApprovalRequest(RECORDID);
END;
}
{ 23 ;2 ;Action ;
Name=Delegate;
CaptionML=[ENU=Delegate;
ESP=Delegar];
ToolTipML=[ENU=Delegate the approval to a substitute
approver.;
ESP=Delega la aprobaci�n a un aprobador
sustituto.];
ApplicationArea=#All;
Promoted=Yes;
Visible=OpenApprovalEntriesExistForCurrUser;
Image=Delegate;
PromotedCategory=Category4;
PromotedOnly=Yes;
OnAction=BEGIN

ApprovalsMgmt.DelegateRecordApprovalRequest(RECORDID);
END;
}
{ 21 ;2 ;Action ;
Name=Comment;
CaptionML=[ENU=Comments;
ESP=Comentarios];
ToolTipML=[ENU=View or add comments for the record.;
ESP=Permite ver o agregar comentarios para el
registro.];
ApplicationArea=#All;
Promoted=Yes;
Visible=OpenApprovalEntriesExistForCurrUser;
Image=ViewComments;
PromotedCategory=Category4;
PromotedOnly=Yes;
OnAction=VAR
ApprovalsMgmt@1000 : Codeunit 1535;
BEGIN
ApprovalsMgmt.GetApprovalComment(Rec);
END;
}
{ 9 ;1 ;ActionGroup;
CaptionML=[ENU=Release;
ESP=Lanzar];
Image=ReleaseDoc }
{ 123 ;2 ;Action ;
Name=Release;
ShortCutKey=Ctrl+F9;
CaptionML=[ENU=Re&lease;
ESP=Lan&zar];
ToolTipML=[ENU=Release the document to the next stage of
processing. When a document is released, it will be included in all availability
calculations from the expected receipt date of the items. You must reopen the
document before you can make changes to it.;
ESP=Lance el documento a la siguiente etapa de
procesamiento. Cuando se lanza un documento, este se incluir� en todos los c�lculos
de disponibilidad a partir de la fecha de recepci�n esperada de los productos. Debe
volver a abrir el documento antes de realizar cambios en �l.];
ApplicationArea=#Suite;
Promoted=Yes;
Enabled=IsCustomerOrContactNotEmpty;
PromotedIsBig=Yes;
Image=ReleaseDoc;
PromotedCategory=Category8;
PromotedOnly=Yes;
OnAction=VAR
ReleaseSalesDoc@1000 : Codeunit 414;
BEGIN
ReleaseSalesDoc.PerformManualRelease(Rec);
END;
}
{ 124 ;2 ;Action ;
Name=Reopen;
CaptionML=[ENU=Re&open;
ESP=&Volver a abrir];
ToolTipML=[ENU=Reopen the document to change it after it has
been approved. Approved documents have the Released status and must be opened
before they can be changed.;
ESP=Permite volver a abrir el documento para
cambiarlo una vez que se haya aprobado. Los documentos aprobados tienen el estado
Lanzado y se deben abrir para poder cambiarlos.];
ApplicationArea=#Suite;
Promoted=Yes;
Enabled=Status <> Status::Open;
Image=ReOpen;
PromotedCategory=Category8;
PromotedOnly=Yes;
OnAction=VAR
ReleaseSalesDoc@1001 : Codeunit 414;
BEGIN
ReleaseSalesDoc.PerformManualReopen(Rec);
END;
}
{ 1100225024;1 ;ActionGroup;
CaptionML=[ESP=Franquicia;
ENI=Franchises] }
{ 1100225025;2 ;Action ;
Name=CreateEntriesToInvoiceLocation;
CaptionML=ESP=Crear registros en almac�n facturaci�n;
Image=New;
OnAction=VAR
FranchisesManagement@1100225000 : Codeunit 50069;
BEGIN

FranchisesManagement.CreateRecordsInInvoice(Rec); //<431
END;
}
{ 62 ;1 ;ActionGroup;
CaptionML=[ENU=F&unctions;
ESP=Acci&ones];
Image=Action }
{ 74 ;2 ;Action ;
Name=CreatePurchaseInvoice;
CaptionML=[ENU=Create Purchase Invoice;
ESP=Crear factura de compra];
ToolTipML=[ENU=Create a new purchase invoice to buy all the
items that are required by the sales document, even if some of the items are
already available.;
ESP=Permite crear una nueva factura de compra para
comprar todos los productos solicitados en el documento de venta, aunque algunos de
los productos ya est�n disponibles.];
ApplicationArea=#Basic,#Suite;
Promoted=No;
PromotedIsBig=Yes;
Image=NewPurchaseInvoice;
PromotedCategory=Category7;
OnAction=VAR
SelectedSalesLine@1001 : Record 37;
PurchDocFromSalesDoc@1000 : Codeunit 1314;
BEGIN

CurrPage.SalesLines.PAGE.SETSELECTIONFILTER(SelectedSalesLine);

PurchDocFromSalesDoc.CreatePurchaseInvoice(Rec,SelectedSalesLine);
END;
}
{ 66 ;2 ;Action ;
Name=GetRecurringSalesLines;
Ellipsis=Yes;
CaptionML=[ENU=Get Recurring Sales Lines;
ESP=Obtener l�neas de venta peri�dicas];
ToolTipML=[ENU=Insert sales document lines that you have set
up for the customer as recurring. Recurring sales lines could be for a monthly
replenishment order or a fixed freight expense.;
ESP=Inserta las l�neas del documento de venta que
se configuraron para el cliente como peri�dicas. Las l�neas de venta peri�dicas
pueden ser un pedido de reposici�n mensual o un gasto de flete fijo.];
ApplicationArea=#Suite;
Promoted=Yes;
Enabled=IsCustomerOrContactNotEmpty;
PromotedIsBig=Yes;
Image=CustomerCode;
PromotedCategory=Category6;
OnAction=VAR
StdCustSalesCode@1000 : Record 172;
BEGIN
StdCustSalesCode.InsertSalesLines(Rec);
END;
}
{ 63 ;2 ;Action ;
Name=CalculateInvoiceDiscount;
AccessByPermission=TableData 19=R;
CaptionML=[ENU=Calculate &Invoice Discount;
ESP=Calcular dto. en la &factura];
ToolTipML=[ENU=Calculate the invoice discount for the entire
sales document when all sales invoice lines are entered.;
ESP=Calcula el descuento de factura de todo el
documento de venta cuando se introduzcan todas las l�neas de factura de venta.];
ApplicationArea=#Basic,#Suite;
Enabled=IsCustomerOrContactNotEmpty;
Image=CalculateInvoiceDiscount;
OnAction=BEGIN
ApproveCalcInvDisc;

SalesCalcDiscountByType.ResetRecalculateInvoiceDisc(Rec);
END;
}
{ 64 ;2 ;Action ;
Name=CopyDocument;
Ellipsis=Yes;
CaptionML=[ENU=Copy Document;
ESP=Copiar l�neas];
ToolTipML=[ENU=Copy document lines and header information
from another sales document to this document. You can copy a posted sales invoice
into a new sales invoice to quickly create a similar document.;
ESP=Copia las l�neas del documento y la
informaci�n de cabecera de otro documento de venta en este. Una factura de venta
registrada se puede copiar en una nueva factura de venta para crear un documento
similar con rapidez.];
ApplicationArea=#Suite;
Promoted=Yes;
Enabled="No." <> '';
PromotedIsBig=Yes;
Image=CopyDocument;
PromotedCategory=Category6;
OnAction=BEGIN
CopySalesDoc.SetSalesHeader(Rec);
CopySalesDoc.RUNMODAL;
CLEAR(CopySalesDoc);
IF GET("Document Type","No.") THEN;
END;
}
{ 115 ;2 ;Action ;
Ellipsis=Yes;
CaptionML=[ENU=Move Negative Lines;
ESP=Mover l�neas negativas];
ToolTipML=[ENU=Prepare to create a replacement sales order in
a sales return process.;
ESP=Preparar un pedido de venta de reposici�n en
un proceso de devoluci�n de venta.];
ApplicationArea=#Basic,#Suite;
Image=MoveNegativeLines;
OnAction=BEGIN
CLEAR(MoveNegSalesLines);
MoveNegSalesLines.SetSalesHeader(Rec);
MoveNegSalesLines.RUNMODAL;
MoveNegSalesLines.ShowDocument;
END;
}
{ 47 ;2 ;ActionGroup;
CaptionML=[ENU=Incoming Document;
ESP=Documento entrante];
ActionContainerType=NewDocumentItems;
Image=Documents }
{ 45 ;3 ;Action ;
Name=IncomingDocCard;
CaptionML=[ENU=View Incoming Document;
ESP=Ver documento entrante];
ToolTipML=[ENU=View any incoming document records and file
attachments that exist for the entry or document.;
ESP=Permite ver los registros de documentos
entrantes y los archivos adjuntos que existen para el movimiento o el documento.];
ApplicationArea=#Basic,#Suite;
Enabled=HasIncomingDocument;
Image=ViewOrder;
OnAction=VAR
IncomingDocument@1000 : Record 130;
BEGIN
IncomingDocument.ShowCardFromEntryNo("Incoming
Document Entry No.");
END;
}
{ 41 ;3 ;Action ;
Name=SelectIncomingDoc;
AccessByPermission=TableData 130=R;
CaptionML=[ENU=Select Incoming Document;
ESP=Seleccionar documento entrante];
ToolTipML=[ENU=Select an incoming document record and file
attachment that you want to link to the entry or document.;
ESP=Permite seleccionar un registro de documento
entrante y un archivo adjunto que desee vincular al movimiento o al documento.];
ApplicationArea=#Basic,#Suite;
Image=SelectLineToApply;
OnAction=VAR
IncomingDocument@1000 : Record 130;
BEGIN
VALIDATE("Incoming Document Entry
No.",IncomingDocument.SelectIncomingDocument("Incoming Document Entry
No.",RECORDID));
END;
}
{ 39 ;3 ;Action ;
Name=IncomingDocAttachFile;
Ellipsis=Yes;
CaptionML=[ENU=Create Incoming Document from File;
ESP=Crear documento entrante desde archivo];
ToolTipML=[ENU=Create an incoming document record by
selecting a file to attach, and then link the incoming document record to the entry
or document.;
ESP=Permite crear un registro de documento
entrante al seleccionar un archivo que se ha de adjuntar y luego vincular el
registro de documento entrante al movimiento o al documento.];
ApplicationArea=#Basic,#Suite;
Enabled=NOT HasIncomingDocument;
Image=Attach;
OnAction=VAR
IncomingDocumentAttachment@1000 : Record 133;
BEGIN

IncomingDocumentAttachment.NewAttachmentFromSalesDocument(Rec);
END;
}
{ 37 ;3 ;Action ;
Name=RemoveIncomingDoc;
CaptionML=[ENU=Remove Incoming Document;
ESP=Eliminar documento entrante];
ToolTipML=[ENU=Remove any incoming document records and file
attachments.;
ESP=Elimina cualquier registro de documentos
entrantes y los archivos adjuntos.];
ApplicationArea=#Basic,#Suite;
Enabled=HasIncomingDocument;
Image=RemoveLine;
OnAction=VAR
IncomingDocument@1000 : Record 130;
BEGIN
IF IncomingDocument.GET("Incoming Document Entry
No.") THEN
IncomingDocument.RemoveLinkToRelatedRecord;
"Incoming Document Entry No." := 0;
MODIFY(TRUE);
END;
}
{ 49 ;1 ;ActionGroup;
CaptionML=[ENU=Request Approval;
ESP=Aprobaci�n solic.] }
{ 159 ;2 ;Action ;
Name=SendApprovalRequest;
CaptionML=[ENU=Send A&pproval Request;
ESP=Enviar solicitud a&probaci�n];
ToolTipML=[ENU=Request approval of the document.;
ESP=Permite solicitar la aprobaci�n del
documento.];
ApplicationArea=#Basic,#Suite;
Promoted=Yes;
Enabled=NOT OpenApprovalEntriesExist AND
CanRequestApprovalForFlow;
PromotedIsBig=Yes;
Image=SendApprovalRequest;
PromotedCategory=Category9;
OnAction=BEGIN
IF ApprovalsMgmt.CheckSalesApprovalPossible(Rec)
THEN
ApprovalsMgmt.OnSendSalesDocForApproval(Rec);
END;
}
{ 160 ;2 ;Action ;
Name=CancelApprovalRequest;
CaptionML=[ENU=Cancel Approval Re&quest;
ESP=&Cancelar solicitud aprobaci�n];
ToolTipML=[ENU=Cancel the approval request.;
ESP=Cancela la solicitud de aprobaci�n.];
ApplicationArea=#Basic,#Suite;
Promoted=Yes;
Enabled=CanCancelApprovalForRecord OR
CanCancelApprovalForFlow;
Image=CancelApprovalRequest;
PromotedCategory=Category9;
OnAction=VAR
WorkflowWebhookMgt@1000 : Codeunit 1543;
BEGIN
ApprovalsMgmt.OnCancelSalesApprovalRequest(Rec);
WorkflowWebhookMgt.FindAndCancel(RECORDID);
END;
}
{ 215 ;2 ;ActionGroup;
CaptionML=[ENU=Flow;
ESP=Flujo de trabajo];
Image=Flow }
{ 216 ;3 ;Action ;
Name=CreateFlow;
CaptionML=[ENU=Create a Flow;
ESP=Crear un flujo de trabajo];
ToolTipML=[ENU=Create a new Flow from a list of relevant Flow
templates.;
ESP=Crea un nuevo flujo de trabajo a partir de una
lista de plantillas de flujo de trabajo pertinentes.];
ApplicationArea=#Basic,#Suite;
Promoted=Yes;
Visible=IsSaaS;
Image=Flow;
PromotedCategory=Category9;
OnAction=VAR
FlowServiceManagement@1001 : Codeunit 6400;
FlowTemplateSelector@1000 : Page 6400;
BEGIN
// Opens page 6400 where the user can use filtered
templates to create new flows.

FlowTemplateSelector.SetSearchText(FlowServiceManagement.GetSalesTemplateFilter);
FlowTemplateSelector.RUN;
END;
}
{ 217 ;3 ;Action ;
Name=SeeFlows;
CaptionML=[ENU=See my Flows;
ESP=Ver mis flujos de trabajo];
ToolTipML=[ENU=View and configure Flows that you created.;
ESP=Permite ver y configurar los flujos de trabajo
que ha creado.];
ApplicationArea=#Basic,#Suite;
RunObject=Page 6401;
Promoted=Yes;
Image=Flow;
PromotedCategory=Category9 }
{ 69 ;1 ;ActionGroup;
CaptionML=[ENU=P&osting;
ESP=&Registro];
Image=Post }
{ 71 ;2 ;Action ;
Name=Post;
ShortCutKey=F9;
CaptionML=[ENU=P&ost;
ESP=&Registrar];
ToolTipML=[ENU=Finalize the document or journal by posting
the amounts and quantities to the related accounts in your company books.;
ESP=Finaliza el documento o el diario registrando
los importes y las cantidades en las cuentas relacionadas de los libros de su
empresa.];
ApplicationArea=#Basic,#Suite;
Promoted=Yes;
PromotedIsBig=Yes;
Image=PostOrder;
PromotedCategory=Category5;
OnAction=BEGIN
Post(CODEUNIT::"Sales-Post
(Yes/No)",NavigateAfterPost::"Posted Document");
END;
}
{ 7 ;2 ;Action ;
Name=PostAndNew;
ShortCutKey=Shift+F9;
Ellipsis=Yes;
CaptionML=[ENU=Post and New;
ESP=Registrar y nuevo];
ToolTipML=[ENU=Post the sales document and create a new,
empty one.;
ESP=Registrar el documento de ventas y crear un
nuevo vac�o.];
ApplicationArea=#Basic,#Suite;
Promoted=Yes;
Image=PostOrder;
PromotedCategory=Category5;
OnAction=BEGIN
Post(CODEUNIT::"Sales-Post
(Yes/No)",NavigateAfterPost::"New Document");
END;
}
{ 76 ;2 ;Action ;
Name=PostAndSend;
Ellipsis=Yes;
CaptionML=[ENU=Post and &Send;
ESP=Registrar y &enviar];
ToolTipML=[ENU=Finalize and prepare to send the document
according to the customer's sending profile, such as attached to an email. The Send
document to window opens first so you can confirm or select a sending profile.;
ESP=Permite finalizar y preparar el documento para
enviarlo seg�n el perfil que cuenta con las preferencias de env�o del cliente, por
ejemplo, adjunto en un correo electr�nico. La ventana "Enviar documento a" se abre
primero para que se pueda confirmar o seleccionar un perfil de env�o.];
ApplicationArea=#Basic,#Suite;
Promoted=Yes;
Image=PostSendTo;
PromotedCategory=Category5;
OnAction=BEGIN
Post(CODEUNIT::"Sales-Post and
Send",NavigateAfterPost::Nowhere);
END;
}
{ 68 ;2 ;Action ;
Name=Preview;
CaptionML=[ENU=Preview Posting;
ESP=Vista previa de registro];
ToolTipML=[ENU=Review the different types of entries that
will be created when you post the document or journal.;
ESP=Permite revisar los diferentes tipos de
movimientos que se crear�n al registrar el documento o el diario.];
ApplicationArea=#Basic,#Suite;
Promoted=Yes;
Image=ViewPostedOrder;
PromotedCategory=Category5;
OnAction=BEGIN
ShowPreview;
END;
}
{ 55 ;2 ;Action ;
Name=DraftInvoice;
Ellipsis=Yes;
CaptionML=[ENU=Draft Invoice;
ESP=Borrador de factura];
ToolTipML=[ENU=View or print the sales invoice as a draft
before you perform the actual posting.;
ESP=Ver o imprimir la factura de venta como
borrador antes de realizar el registro propiamente dicho.];
ApplicationArea=#Basic,#Suite;
Image=ViewPostedOrder;
PromotedCategory=Category5;
OnAction=VAR
DocumentPrint@1000 : Codeunit 229;
BEGIN
DocumentPrint.PrintSalesHeader(Rec);
END;
}
{ 50 ;2 ;Action ;
Name=ProformaInvoice;
Ellipsis=Yes;
CaptionML=[ENU=Pro Forma Invoice;
ESP=Factura proforma];
ToolTipML=[ENU=View or print the pro forma sales invoice.;
ESP=Permite ver o imprimir la factura de venta
proforma.];
ApplicationArea=#Basic,#Suite;
Image=ViewPostedOrder;
PromotedCategory=Category5;
OnAction=VAR
DocumentPrint@1000 : Codeunit 229;
BEGIN
DocumentPrint.PrintProformaSalesInvoice(Rec);
END;
}
{ 78 ;2 ;Action ;
Ellipsis=Yes;
CaptionML=[ENU=Test Report;
ESP=Informe prueba];
ToolTipML=[ENU=View a test report so that you can find and
correct any errors before you perform the actual posting of the journal or
document.;
ESP=Permite ver un informe de prueba para poder
encontrar y corregir cualquier error antes de hacer el registro real del diario o
el documento.];
ApplicationArea=#Basic,#Suite;
Image=TestReport;
PromotedCategory=Category5;
OnAction=BEGIN
ReportPrint.PrintSalesHeader(Rec);
END;
}
{ 3 ;2 ;Action ;
CaptionML=[ENU=Remove From Job Queue;
ESP=Quitar de cola de proyecto];
ToolTipML=[ENU=Remove the scheduled processing of this record
from the job queue.;
ESP=Permite quitar el procesamiento programado de
este registro de la cola de proyectos.];
ApplicationArea=#Basic,#Suite;
Image=RemoveLine;
OnAction=BEGIN
CancelBackgroundPosting;
END;
}
}
}
CONTROLS
{
{ 1900000001;0;Container;
ContainerType=ContentArea }

{ 1 ;1 ;Group ;
CaptionML=[ENU=General;
ESP=General];
GroupType=Group }

{ 2 ;2 ;Field ;
ToolTipML=[ENU=Specifies the number of the involved entry or
record, according to the specified number series.;
ESP=Especifica el n�mero de la entrada o el registro
relacionado, seg�n la serie num�rica especificada.];
ApplicationArea=#All;
SourceExpr="No.";
Importance=Standard;
Visible=DocNoVisible;
OnAssistEdit=BEGIN
IF AssistEdit(xRec) THEN
CurrPage.UPDATE;
END;

ImplicitType=Code20 }

{ 53 ;2 ;Field ;
CaptionML=[ENU=Customer No.;
ESP=N.� de cliente];
ToolTipML=[ENU=Specifies the number of the customer who will
receive the products and be billed by default.;
ESP=Especifica el n�mero del cliente que recibir� los
productos y al que se facturar� de forma predeterminada.];
ApplicationArea=#Basic,#Suite;
NotBlank=Yes;
SourceExpr="Sell-to Customer No.";
Importance=Additional;
Visible=NOT IsSaaS;
OnValidate=BEGIN
SelltoCustomerNoOnAfterValidate(Rec,xRec);
CurrPage.UPDATE;
END;

ImplicitType=Code20 }

{ 4 ;2 ;Field ;
CaptionML=[ENU=Customer Name;
ESP=Nombre del cliente];
ToolTipML=[ENU=Specifies the name of the customer who will receive
the products and be billed by default.;
ESP=Especifica el nombre del cliente que recibir� los
productos y al que se facturar� de forma predeterminada.];
ApplicationArea=#Basic,#Suite;
NotBlank=Yes;
SourceExpr="Sell-to Customer Name";
Importance=Promoted;
OnValidate=VAR
ApplicationAreaMgmtFacade@1000 : Codeunit 9179;
BEGIN
SelltoCustomerNoOnAfterValidate(Rec,xRec);

IF ApplicationAreaMgmtFacade.IsFoundationEnabled THEN

SalesCalcDiscountByType.ApplyDefaultInvoiceDiscount(0,Rec);

CurrPage.UPDATE;
END;

ShowMandatory=TRUE;
ImplicitType=Text100 }

{ 35 ;2 ;Field ;
ToolTipML=[ENU=Specifies additional posting information for the
document. After you post the document, the description can add detail to vendor and
customer ledger entries.;
ESP=Especifica la informaci�n de registro adicional del
documento. Despu�s de registrar el documento, la descripci�n puede agregar detalles
a los movimientos de cliente y proveedor.];
ApplicationArea=#Suite;
SourceExpr="Posting Description";
Visible=FALSE;
ImplicitType=Text100 }

{ 1100225014;2;Field ;
SourceExpr="340 Operation Code";
ImplicitType=Code1 }

{ 1100225015;2;Field ;
SourceExpr="Send IC Document";
ImplicitType=Boolean }

{ 100 ;2 ;Group ;
CaptionML=[ENU=Sell-to;
ESP=Direcci�n venta];
GroupType=Group }

{ 75 ;3 ;Field ;
CaptionML=[ENU=Address;
ESP=Direcci�n];
ToolTipML=[ENU=Specifies the address where the customer is
located.;
ESP=Especifica la direcci�n donde reside el cliente.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Sell-to Address";
Importance=Additional;
QuickEntry=FALSE;
ImplicitType=Text100 }

{ 77 ;3 ;Field ;
CaptionML=[ENU=Address 2;
ESP=Direcci�n 2];
ToolTipML=[ENU=Specifies additional address information.;
ESP=Especifica informaci�n adicional sobre la
direcci�n.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Sell-to Address 2";
Importance=Additional;
QuickEntry=FALSE;
ImplicitType=Text50 }

{ 79 ;3 ;Field ;
CaptionML=[ENU=City;
ESP=Poblaci�n];
ToolTipML=[ENU=Specifies the city of the customer on the sales
document.;
ESP=Especifica la ciudad del cliente en el documento de
ventas.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Sell-to City";
Importance=Additional;
QuickEntry=FALSE;
ImplicitType=Text30 }

{ 60 ;3 ;Group ;
Visible=IsSellToCountyVisible;
GroupType=Group }

{ 70 ;4 ;Field ;
CaptionML=[ENU=County;
ESP=Provincia];
ToolTipML=[ENU=Specifies the state, province or county of the
address.;
ESP=Especifica el estado, la provincia o la comarca de
la direcci�n.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Sell-to County";
Importance=Additional;
QuickEntry=FALSE;
ImplicitType=Text30 }

{ 81 ;3 ;Field ;
CaptionML=[ENU=Post Code;
ESP=C�digo postal];
ToolTipML=[ENU=Specifies the postal code.;
ESP=Especifica el c�digo postal.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Sell-to Post Code";
Importance=Additional;
QuickEntry=FALSE;
ImplicitType=Code20 }

{ 73 ;3 ;Field ;
CaptionML=[ENU=Country/Region Code;
ESP=C�digo pa�s/regi�n];
ToolTipML=[ENU=Specifies the country or region of the address.;
ESP=Especifica el pa�s o la regi�n de la direcci�n.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Sell-to Country/Region Code";
Importance=Additional;
OnValidate=BEGIN
IsSellToCountyVisible :=
FormatAddress.UseCounty("Sell-to Country/Region Code");
END;
QuickEntry=FALSE;
ImplicitType=Code10 }

{ 87 ;3 ;Field ;
CaptionML=[ENU=Contact No.;
ESP=N� contacto];
ToolTipML=[ENU=Specifies the number of the contact that the sales
document will be sent to.;
ESP=Especifica el n�mero del contacto a quien se enviar�
el documento de venta.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Sell-to Contact No.";
Importance=Additional;
OnValidate=BEGIN
IF ApplicationAreaMgmtFacade.IsAdvancedEnabled THEN
IF GETFILTER("Sell-to Contact No.") = xRec."Sell-to
Contact No." THEN
IF "Sell-to Contact No." <> xRec."Sell-to Contact
No." THEN
SETRANGE("Sell-to Contact No.");
END;

ImplicitType=Code20 }

{ 8 ;2 ;Field ;
CaptionML=[ENU=Contact;
ESP=Contacto];
ToolTipML=[ENU=Specifies the name of the person to contact at the
customer.;
ESP=Especifica el nombre de la persona de contacto del
cliente.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Sell-to Contact";
Editable="Sell-to Customer No." <> '';
ImplicitType=Text100 }

{ 19 ;2 ;Field ;
ToolTipML=[ENU=Specifies the customer's reference. The contents
will be printed on sales documents.;
ESP=Especifica la referencia del cliente. El contenido
se imprimir� en los documentos de venta.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Your Reference";
Importance=Additional;
ImplicitType=Text35 }

{ 43 ;2 ;Field ;
ToolTipML=[ENU=Specifies the date when the related document was
created.;
ESP=Especifica la fecha en la que se cre� el documento
correspondiente.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Document Date";
Importance=Additional;
ImplicitType=Date }

{ 12 ;2 ;Field ;
ToolTipML=[ENU=Specifies the date when the posting of the sales
document will be recorded.;
ESP=Especifica la fecha en que se registrar� el registro
del documento de venta.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Posting Date";
Importance=Promoted;
OnValidate=BEGIN
SaveInvoiceDiscountAmount;
END;

ImplicitType=Date }

{ 28 ;2 ;Field ;
ToolTipML=[ENU=Specifies when the sales invoice must be paid.;
ESP=Especifica cu�ndo se debe pagar la factura de
venta.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Due Date";
Importance=Promoted;
ImplicitType=Date }

{ 13 ;2 ;Field ;
ToolTipML=[ENU=Specifies the number of the incoming document that
this sales document is created for.;
ESP=Especifica el n�mero del documento entrante para el
que se crea este documento de venta.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Incoming Document Entry No.";
Importance=Additional;
Visible=FALSE;
ImplicitType=Integer }

{ 126 ;2 ;Field ;
ToolTipML=[ENU=Specifies a document number that refers to the
customer's or vendor's numbering system.;
ESP=Especifica un n�mero de documento que hace
referencia al sistema de numeraci�n del cliente o el proveedor.];
ApplicationArea=#Basic,#Suite;
SourceExpr="External Document No.";
Importance=Additional;
ShowMandatory=ExternalDocNoMandatory;
ImplicitType=Code35 }

{ 10 ;2 ;Field ;
ToolTipML=[ENU=Specifies the name of the salesperson who is
assigned to the customer.;
ESP=Especifica el nombre del vendedor asignado al
cliente.];
ApplicationArea=#Suite;
SourceExpr="Salesperson Code";
Importance=Additional;
OnValidate=BEGIN
SalespersonCodeOnAfterValidate;
END;

ImplicitType=Code20 }

{ 1000000000;2;Field ;
SourceExpr="GPV Code";
ImplicitType=Code20 }
{ 129 ;2 ;Field ;
ToolTipML=[ENU=Specifies the number of the campaign that the
document is linked to.;
ESP=Especifica el n�mero de la campa�a a la que est�
vinculado el documento.];
ApplicationArea=#RelationshipMgmt;
SourceExpr="Campaign No.";
Importance=Additional;
ImplicitType=Code20 }

{ 118 ;2 ;Field ;
AccessByPermission=TableData 5714=R;
ToolTipML=[ENU=Specifies the code of the responsibility center,
such as a distribution hub, that is associated with the involved user, company,
customer, or vendor.;
ESP=Especifica el c�digo del centro de responsabilidad,
como, por ejemplo, un centro de distribuci�n que est� asociado al usuario, la
empresa, el cliente o el proveedor relacionado.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Responsibility Center";
Importance=Additional;
ImplicitType=Code10 }

{ 67 ;2 ;Field ;
ToolTipML=[ENU=Specifies the ID of the user who is responsible for
the document.;
ESP=Especifica el id. del usuario responsable del
documento.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Assigned User ID";
Importance=Additional;
ImplicitType=Code50 }

{ 112 ;2 ;Field ;
ToolTipML=[ENU=Specifies whether the document is open, waiting to
be approved, has been invoiced for prepayment, or has been released to the next
stage of processing.;
ESP=Especifica si el documento est� pendiente, en espera
de aprobaci�n, facturado para prepago o ha pasado a la etapa siguiente de
procesamiento.];
ApplicationArea=#Suite;
SourceExpr=Status;
Importance=Additional;
ImplicitType=Option }

{ 1100100;2;Field ;
ToolTipML=[ENU=Specifies the number of the posted invoice that will
be created if you post the sales invoice.;
ESP=Especifica el n�mero de la factura registrada que se
crear� si se registra la factura de venta.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Posting No.";
ImplicitType=Code20 }

{ 5 ;2 ;Field ;
ToolTipML=[ENU=Specifies the status of a job queue entry or task
that handles the posting of sales invoices.;
ESP=Especifica el estado de un movimiento de la cola de
proyectos o de una tarea que controla el registro de las facturas de venta.];
ApplicationArea=#All;
SourceExpr="Job Queue Status";
Importance=Additional;
Visible=JobQueuesUsed;
ImplicitType=Option }

{ 1100225017;2;Field ;
SourceExpr="Commision Exclude";
ImplicitType=Boolean }

{ 1000000001;2;Field ;
SourceExpr="Item total";
ImplicitType=Decimal }

{ 135 ;2 ;Group ;
CaptionML=[ENU=Work Description;
ESP=Descripci�n del trabajo];
GroupType=Group }

{ 117 ;3 ;Field ;
ToolTipML=[ENU=Specifies the products or service being offered;
ESP=Especifica los productos o servicios que se
ofrecen.];
ApplicationArea=#Basic,#Suite;
SourceExpr=WorkDescription;
Importance=Additional;
MultiLine=Yes;
OnValidate=BEGIN
SetWorkDescription(WorkDescription);
END;

ShowCaption=No;
ImplicitType=Text }

{ 56 ;1 ;Part ;
Name=SalesLines;
ApplicationArea=#Basic,#Suite;
SubPageLink=Document No.=FIELD(No.);
PagePartID=Page47;
Enabled="Sell-to Customer No." <> '';
Editable="Sell-to Customer No." <> '' }

{ 1905885101;1;Group ;
CaptionML=[ENU=Invoice Details;
ESP=Detalles factura];
GroupType=Group }

{ 107 ;2 ;Field ;
ToolTipML=[ENU=Specifies the currency of amounts on the sales
document.;
ESP=Especifica la divisa de los importes en el documento
de venta.];
ApplicationArea=#Suite;
SourceExpr="Currency Code";
Importance=Promoted;
OnValidate=BEGIN
CurrPage.SAVERECORD;
SalesCalcDiscountByType.ApplyDefaultInvoiceDiscount(0,Rec);
END;

OnAssistEdit=BEGIN
CLEAR(ChangeExchangeRate);
IF "Posting Date" <> 0D THEN
ChangeExchangeRate.SetParameter("Currency
Code","Currency Factor","Posting Date")
ELSE
ChangeExchangeRate.SetParameter("Currency
Code","Currency Factor",WORKDATE);
IF ChangeExchangeRate.RUNMODAL = ACTION::OK THEN
BEGIN
VALIDATE("Currency
Factor",ChangeExchangeRate.GetParameter);
SaveInvoiceDiscountAmount;
END;
CLEAR(ChangeExchangeRate);
END;

ImplicitType=Code10 }

{ 48 ;2 ;Field ;
ToolTipML=[ENU=Specifies when items on the document are shipped or
were shipped. A shipment date is usually calculated from a requested delivery date
plus lead time.;
ESP=Especifica cu�ndo se van a enviar o se han enviado
los productos del documento. Se calcula normalmente una fecha de env�o con la fecha
de entrega solicitada y el plazo de seguridad.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Shipment Date";
Importance=Promoted;
ImplicitType=Date }

{ 1100105;2;Field ;
ToolTipML=[ENU=Specifies the type of the posted document that this
document or journal line will be applied to when you post, for example to register
payment.;
ESP=Especifica el tipo del documento registrado en el
que se liquidar� esta l�nea de diario o documento al registrar, por ejemplo,
pagos.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Applies-to Doc. Type";
ImplicitType=Option }

{ 1100107;2;Field ;
ToolTipML=[ENU=Specifies the number of the posted document that
this document or journal line will be applied to when you post, for example to
register payment.;
ESP=Especifica el n�mero del documento registrado en el
que se liquidar� esta l�nea de diario o documento al registrar, por ejemplo,
pagos.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Applies-to Doc. No.";
ImplicitType=Code20 }

{ 1100225016;2;Field ;
SourceExpr="Invoice Disc. Code";
ImplicitType=Code20 }
{ 1100225023;2;Field ;
SourceExpr="VAT Registration No.";
ImplicitType=Text20 }

{ 1901792801;2;Group ;
CaptionML=[ENU=Payment;
ESP=Pago] }

{ 1100020;3;Field ;
ToolTipML=[ENU=Specifies a code associated with a payment address
other than the customer's standard payment address.;
ESP=Especifica un c�digo asociado a una direcci�n de
pago diferente de la direcci�n de pago habitual del cliente.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Pay-at Code";
ImplicitType=Code10 }

{ 1100022;3;Field ;
ToolTipML=[ENU=Specifies the customer bank code to assign to the
sales header in this field.;
ESP=Especifica el c�digo de banco de cliente que debe
asignarse a la cabecera de ventas en este campo.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Cust. Bank Acc. Code";
ImplicitType=Code20 }

{ 58 ;2 ;Group ;
Visible=ShowQuoteNo;
GroupType=Group }

{ 83 ;3 ;Field ;
ToolTipML=[ENU=Specifies the number of the sales quote that the
sales order was created from. You can track the number to sales quote documents
that you have printed, saved, or emailed.;
ESP=Especifica el n�mero de la oferta de venta a partir
de la cual se cre� el pedido de venta. Puede hacer un seguimiento del n�mero y ver
los documentos de oferta de venta que imprimi�, guard� o envi� por correo
electr�nico.];
ApplicationArea=#All;
SourceExpr="Quote No.";
ImplicitType=Code20 }

{ 121 ;2 ;Field ;
ToolTipML=[ENU=Specifies if the Unit Price and Line Amount fields
on document lines should be shown with or without VAT.;
ESP=Especifica si los campos Precio venta e Importe
l�nea en las l�neas de documento deben mostrarse con o sin IVA.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Prices Including VAT";
OnValidate=BEGIN
CurrPage.UPDATE;
END;

ImplicitType=Boolean }

{ 156 ;2 ;Field ;
ToolTipML=[ENU=Specifies the VAT specification of the involved
customer or vendor to link transactions made for this record with the appropriate
general ledger account according to the VAT posting setup.;
ESP=Indica la especificaci�n de IVA del cliente o el
proveedor relacionado para vincular las transacciones realizadas para este registro
con la cuenta de contabilidad general correspondiente de acuerdo con la
configuraci�n de registro de IVA.];
ApplicationArea=#Basic,#Suite;
SourceExpr="VAT Bus. Posting Group";
OnValidate=VAR
ApplicationAreaMgmtFacade@1000 : Codeunit 9179;
BEGIN
IF ApplicationAreaMgmtFacade.IsFoundationEnabled THEN

SalesCalcDiscountByType.ApplyDefaultInvoiceDiscount(0,Rec);

CurrPage.UPDATE;
END;

ImplicitType=Code20 }

{ 26 ;2 ;Field ;
ToolTipML=[ENU=Specifies a formula that calculates the payment due
date, payment discount date, and payment discount amount.;
ESP=Especifica una f�rmula que calcula la fecha de
vencimiento del pago, la fecha de descuento por pronto pago y el importe de
descuento por pronto pago.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Payment Terms Code";
Importance=Promoted;
ShowMandatory=TRUE;
ImplicitType=Code10 }

{ 101 ;2 ;Field ;
ToolTipML=[ENU=Specifies how to make payment, such as with bank
transfer, cash, or check.;
ESP=Especifica c�mo realizar el pago, por ejemplo
transferencia bancaria, en efectivo o con cheque.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Payment Method Code";
Importance=Promoted;
OnValidate=BEGIN
UpdatePaymentService;
END;

ShowMandatory=TRUE;
ImplicitType=Code10 }

{ 72 ;2 ;Field ;
ToolTipML=[ENU=Specifies if the transaction is related to trade
with a third party within the EU.;
ESP=Especifica si la transacci�n est� relacionada con
comercio con terceros dentro de la UE.];
ApplicationArea=#Basic,#Suite;
SourceExpr="EU 3-Party Trade";
ImplicitType=Boolean }

{ 174 ;2 ;Group ;
Visible=PaymentServiceVisible;
GroupType=Group }
{ 175 ;3 ;Field ;
Name=SelectedPayments;
CaptionML=[ENU=Payment Service;
ESP=Servicio de pago];
ToolTipML=[ENU=Specifies the online payment service, such as
PayPal, that customers can use to pay the sales document.;
ESP=Especifica el servicio de pago en l�nea, como
PayPal, que los clientes pueden usar para pagar el documento de venta.];
ApplicationArea=#All;
SourceExpr=GetSelectedPaymentServicesText;
Enabled=PaymentServiceEnabled;
Editable=FALSE;
MultiLine=Yes;
OnAssistEdit=BEGIN
ChangePaymentServiceSetting;
END;

ImplicitType=Text }

{ 84 ;2 ;Field ;
ToolTipML=[ENU=Specifies the code for Shortcut Dimension 1, which
is one of two global dimension codes that you set up in the General Ledger Setup
window.;
ESP=Especifica el c�digo de dimensi�n del acceso directo
1, que es uno de los dos c�digos de dimensi�n globales que se configuran en la
ventana Configuraci�n de contabilidad.];
ApplicationArea=#Dimensions;
SourceExpr="Shortcut Dimension 1 Code";
OnValidate=BEGIN
CurrPage.UPDATE;
END;

ImplicitType=Code20 }

{ 88 ;2 ;Field ;
ToolTipML=[ENU=Specifies the code for Shortcut Dimension 2, which
is one of two global dimension codes that you set up in the General Ledger Setup
window.;
ESP=Especifica el c�digo de dimensi�n del acceso directo
2, que es uno de los dos c�digos de dimensi�n globales que se configuran en la
ventana Configuraci�n de contabilidad.];
ApplicationArea=#Dimensions;
SourceExpr="Shortcut Dimension 2 Code";
OnValidate=BEGIN
CurrPage.UPDATE;
END;

ImplicitType=Code20 }

{ 30 ;2 ;Field ;
ToolTipML=[ENU=Specifies the payment discount percentage granted if
the customer pays on or before the date entered in the Pmt. Discount Date field.;
ESP=Especifica el porcentaje de descuento por pronto
pago concedido si el cliente paga en o antes de la fecha introducida en el campo
Fecha dto. P.P.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Payment Discount %";
ImplicitType=Decimal }
{ 32 ;2 ;Field ;
ToolTipML=[ENU=Specifies the date on which the amount in the entry
must be paid for a payment discount to be granted.;
ESP=Especifica cu�ndo hay que pagar el importe del
movimiento para conseguir un descuento por pronto pago.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Pmt. Discount Date";
Importance=Additional;
ImplicitType=Date }

{ 15 ;2 ;Field ;
ToolTipML=[ENU=Specifies the direct-debit mandate that the customer
has signed to allow direct debit collection of payments.;
ESP=Especifica la orden de domiciliaci�n de adeudo
directo que el cliente ha firmado para permitir realizar cobros por domiciliaci�n
de pagos.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Direct Debit Mandate ID";
ImplicitType=Code35 }

{ 1100225013;2;Field ;
ToolTipML=[ENU=Specifies the location from where inventory items to
the customer on the sales document are to be shipped by default.;
ESP=Especifica el almac�n desde el que se env�an de
forma predeterminada los productos de inventario al cliente en el documento de
venta.];
ApplicationArea=#Location;
SourceExpr="Location Code";
Importance=Additional;
ImplicitType=Code10 }

{ 1100005;2;Group ;
CaptionML=[ENU=SII Information;
ESP=Informaci�n SII];
GroupType=Group }

{ 1100007;3;Field ;
CaptionML=[ENU=Operation Description;
ESP=Descripci�n de la operaci�n];
ToolTipML=[ENU=Specifies the Operation Description.;
ESP=Especifica la descripci�n de la operaci�n.];
ApplicationArea=#Basic,#Suite;
SourceExpr=OperationDescription;
MultiLine=Yes;
OnValidate=VAR
SIIManagement@1100000 : Codeunit 10756;
BEGIN

SIIManagement.SplitOperationDescription(OperationDescription,"Operation
Description","Operation Description 2");
VALIDATE("Operation Description");
VALIDATE("Operation Description 2");
MODIFY(TRUE);
END;

ImplicitType=Text500 }

{ 1100003;3;Field ;
ToolTipML=[ENU=Specifies the Special Scheme Code.;
ESP=Especifica el c�digo de esquema especial.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Special Scheme Code";
ImplicitType=Option }

{ 1100001;3;Field ;
ToolTipML=[ENU=Specifies the Special Scheme Code.;
ESP=Especifica el c�digo de esquema especial.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Invoice Type";
ImplicitType=Option }

{ 1100002;3;Field ;
ToolTipML=[ENU=Specifies the ID Type.;
ESP=Especifica el tipo de id.];
ApplicationArea=#Basic,#Suite;
SourceExpr="ID Type";
ImplicitType=Option }

{ 1100008;3;Field ;
ToolTipML=[ENU=Specifies the name of the company sucessor in
connection with corporate restructuring.;
ESP=Especifica el nombre de la sucesora de la empresa en
relaci�n con reestructuraciones corporativas.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Succeeded Company Name";
ImplicitType=Text1 }

{ 1100006;3;Field ;
ToolTipML=[ENU=Specifies the VAT registration number of the company
sucessor in connection with corporate restructuring.;
ESP=Especifica el CIF/NIF de la sucesora de la empresa
en relaci�n con reestructuraciones corporativos.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Succeeded VAT Registration No.";
ImplicitType=Text20 }

{ 1900000002;1;Group ;
CaptionML=[ENU=Shipping and Billing;
ESP=Env�o y facturaci�n];
Enabled="Sell-to Customer No." <> '';
GroupType=Group }

{ 34 ;2 ;Group ;
GroupType=Group }

{ 200 ;3 ;Group ;
GroupType=Group }

{ 201 ;4 ;Field ;
Name=ShippingOptions;
CaptionML=[ENU=Ship-to;
ESP=Direcci�n de env�o];
ToolTipML=[ENU=Specifies the address that the products on the sales
document are shipped to. Default (Sell-to Address): The same as the customer's
sell-to address. Alternate Ship-to Address: One of the customer's alternate ship-to
addresses. Custom Address: Any ship-to address that you specify in the fields
below.;
ESP=Especifica la direcci�n a la que se env�an los
productos del documento de venta. Predeterminada (direcci�n de env�o): la misma que
la direcci�n de env�o del cliente. Direcci�n de env�o alternativa: una de las
direcciones de env�o alternativas del cliente. Direcci�n personalizada: cualquier
direcci�n que especifique en los campos siguientes.];
OptionCaptionML=[ENU=Default (Sell-to Address),Alternate Shipping
Address,Custom Address;
ESP=Predeterminada (direcci�n de venta),Direcci�n
de env�o alternativa,Direcci�n personalizada];
ApplicationArea=#Basic,#Suite;
SourceExpr=ShipToOptions;
OnValidate=VAR
ShipToAddress@1001 : Record 222;
ShipToAddressList@1000 : Page 301;
BEGIN
CASE ShipToOptions OF
ShipToOptions::"Default (Sell-to Address)":
BEGIN
VALIDATE("Ship-to Code",'');
CopySellToAddressToShipToAddress;
END;
ShipToOptions::"Alternate Shipping Address":
BEGIN
ShipToAddress.SETRANGE("Customer No.","Sell-to
Customer No.");
ShipToAddressList.LOOKUPMODE := TRUE;
ShipToAddressList.SETTABLEVIEW(ShipToAddress);

IF ShipToAddressList.RUNMODAL = ACTION::LookupOK
THEN BEGIN
ShipToAddressList.GETRECORD(ShipToAddress);
VALIDATE("Ship-to Code",ShipToAddress.Code);
END ELSE
ShipToOptions := ShipToOptions::"Custom
Address";
END;
ShipToOptions::"Custom Address":
VALIDATE("Ship-to Code",'');
END;
END;

ImplicitType=Option }

{ 202 ;4 ;Group ;
Visible=NOT (ShipToOptions = ShipToOptions::"Default (Sell-to
Address)");
GroupType=Group }

{ 65 ;5 ;Field ;
CaptionML=[ENU=Code;
ESP=C�digo];
ToolTipML=[ENU=Specifies the code for another shipment address than
the customer's own address, which is entered by default.;
ESP=Especifica el c�digo para otra direcci�n de env�o
distinta a la propia direcci�n del cliente, que se especifica de forma
predeterminada.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Ship-to Code";
Importance=Promoted;
Editable=ShipToOptions = ShipToOptions::"Alternate Shipping
Address";
OnValidate=BEGIN
IF (xRec."Ship-to Code" <> '') AND ("Ship-to Code" =
'') THEN
ERROR(EmptyShipToCodeErr);
END;

ImplicitType=Code10 }

{ 36 ;5 ;Field ;
CaptionML=[ENU=Name;
ESP=Nombre];
ToolTipML=[ENU=Specifies the name that products on the sales
document will be shipped to.;
ESP=Especifica el nombre al que se enviar�n los
productos en el documento de venta.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Ship-to Name";
Editable=ShipToOptions = ShipToOptions::"Custom Address";
ImplicitType=Text100 }

{ 38 ;5 ;Field ;
CaptionML=[ENU=Address;
ESP=Direcci�n];
ToolTipML=[ENU=Specifies the address that products on the sales
document will be shipped to.;
ESP=Especifica la direcci�n a la que se enviar�n los
productos en el documento de venta.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Ship-to Address";
Editable=ShipToOptions = ShipToOptions::"Custom Address";
QuickEntry=FALSE;
ImplicitType=Text100 }

{ 40 ;5 ;Field ;
CaptionML=[ENU=Address 2;
ESP=Direcci�n 2];
ToolTipML=[ENU=Specifies additional address information.;
ESP=Especifica informaci�n adicional sobre la
direcci�n.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Ship-to Address 2";
Editable=ShipToOptions = ShipToOptions::"Custom Address";
QuickEntry=FALSE;
ImplicitType=Text50 }

{ 42 ;5 ;Field ;
CaptionML=[ENU=City;
ESP=Poblaci�n];
ToolTipML=[ENU=Specifies the city of the customer on the sales
document.;
ESP=Especifica la ciudad del cliente en el documento de
ventas.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Ship-to City";
Editable=ShipToOptions = ShipToOptions::"Custom Address";
QuickEntry=FALSE;
ImplicitType=Text30 }
{ 82 ;5 ;Group ;
Visible=IsShipToCountyVisible;
GroupType=Group }

{ 89 ;6 ;Field ;
CaptionML=[ENU=County;
ESP=Provincia];
ToolTipML=[ENU=Specifies the state, province or county of the
address.;
ESP=Especifica el estado, la provincia o la comarca de
la direcci�n.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Ship-to County";
Editable=ShipToOptions = ShipToOptions::"Custom Address";
QuickEntry=FALSE;
ImplicitType=Text30 }

{ 80 ;5 ;Field ;
CaptionML=[ENU=Post Code;
ESP=C�digo postal];
ToolTipML=[ENU=Specifies the postal code.;
ESP=Especifica el c�digo postal.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Ship-to Post Code";
Editable=ShipToOptions = ShipToOptions::"Custom Address";
QuickEntry=FALSE;
ImplicitType=Code20 }

{ 17 ;5 ;Field ;
CaptionML=[ENU=Country/Region;
ESP=Pa�s/regi�n];
ToolTipML=[ENU=Specifies the customer's country/region.;
ESP=Especifica el pa�s o regi�n del cliente.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Ship-to Country/Region Code";
Importance=Additional;
Editable=ShipToOptions = ShipToOptions::"Custom Address";
OnValidate=BEGIN
IsShipToCountyVisible :=
FormatAddress.UseCounty("Ship-to Country/Region Code");
END;

QuickEntry=FALSE;
ImplicitType=Code10 }

{ 44 ;4 ;Field ;
CaptionML=[ENU=Contact;
ESP=Contacto];
ToolTipML=[ENU=Specifies the name of the contact person at the
address that products on the sales document will be shipped to.;
ESP=Especifica el nombre de la persona de contacto en la
direcci�n a la que se enviar�n los productos en el documento de venta.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Ship-to Contact";
ImplicitType=Text100 }

{ 16 ;3 ;Group ;
CaptionML=[ENU=Shipment Method;
ESP=Condiciones env�o];
GroupType=Group }

{ 46 ;4 ;Field ;
CaptionML=[ENU=Code;
ESP=C�digo];
ToolTipML=[ENU=Specifies how items on the sales document are
shipped to the customer.;
ESP=Especifica la manera en que los productos del
documento de venta se env�an al cliente.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Shipment Method Code";
Importance=Additional;
ImplicitType=Code10 }

{ 103 ;4 ;Field ;
CaptionML=[ENU=Agent;
ESP=Agente];
ToolTipML=[ENU=Specifies which shipping agent is used to transport
the items on the sales document to the customer.;
ESP=Especifica el transportista que se usa para
transportar los productos del documento de venta al cliente.];
ApplicationArea=#Suite;
SourceExpr="Shipping Agent Code";
Importance=Additional;
ImplicitType=Code10 }

{ 11 ;4 ;Field ;
CaptionML=[ENU=Agent service;
ESP=Servicio de agente];
ToolTipML=[ENU=Specifies which shipping agent service is used to
transport the items on the sales document to the customer.;
ESP=Especifica el servicio de transportista que se usa
para transportar los productos del documento de venta al cliente.];
ApplicationArea=#Suite;
SourceExpr="Shipping Agent Service Code";
Importance=Additional;
ImplicitType=Code10 }

{ 105 ;4 ;Field ;
ToolTipML=[ENU=Specifies the shipping agent's package number.;
ESP=Especifica el n�mero de paquete del transportista.];
ApplicationArea=#Suite;
SourceExpr="Package Tracking No.";
Importance=Additional;
ImplicitType=Text30 }

{ 203 ;2 ;Group ;
GroupType=Group }

{ 204 ;3 ;Field ;
Name=BillToOptions;
CaptionML=[ENU=Bill-to;
ESP=Direcci�n facturaci�n];
ToolTipML=[ENU=Specifies the customer that the sales invoice will
be sent to. Default (Customer): The same as the customer on the sales invoice.
Another Customer: Any customer that you specify in the fields below.;
ESP=Especifica el cliente al que se enviar� la factura
de venta. Predeterminado (cliente): el mismo que el cliente en la factura de venta.
Otro cliente: cualquier cliente que especifique en los campos siguientes.];
OptionCaptionML=[ENU=Default (Customer),Another Customer,Custom
Address;
ESP=Predeterminado (cliente),Otro
cliente,Direcci�n personalizada];
ApplicationArea=#Basic,#Suite;
SourceExpr=BillToOptions;
OnValidate=BEGIN
IF BillToOptions = BillToOptions::"Default (Customer)"
THEN BEGIN
VALIDATE("Bill-to Customer No.","Sell-to Customer
No.");

RecallModifyAddressNotification(GetModifyBillToCustomerAddressNotificationId);
END;

CopySellToAddressToBillToAddress;
END;

ImplicitType=Option }

{ 205 ;3 ;Group ;
Visible=NOT (BillToOptions = BillToOptions::"Default (Customer)");
GroupType=Group }

{ 14 ;4 ;Field ;
CaptionML=[ENU=Name;
ESP=Nombre];
ToolTipML=[ENU=Specifies the customer to whom you will send the
sales invoice, when different from the customer that you are selling to.;
ESP=Especifica el cliente al que se enviar� la factura
de venta, cuando es distinto del cliente al que se realiza la venta.];
ApplicationArea=#Basic,#Suite;
NotBlank=Yes;
SourceExpr="Bill-to Name";
Importance=Promoted;
Enabled=BillToOptions = BillToOptions::"Another Customer";
Editable=BillToOptions = BillToOptions::"Another Customer";
OnValidate=VAR
ApplicationAreaMgmtFacade@1000 : Codeunit 9179;
BEGIN
IF GETFILTER("Bill-to Customer No.") = xRec."Bill-to
Customer No." THEN
IF "Bill-to Customer No." <> xRec."Bill-to Customer
No." THEN
SETRANGE("Bill-to Customer No.");

IF ApplicationAreaMgmtFacade.IsFoundationEnabled THEN

SalesCalcDiscountByType.ApplyDefaultInvoiceDiscount(0,Rec);

CurrPage.UPDATE;
END;

ImplicitType=Text100 }

{ 18 ;4 ;Field ;
CaptionML=[ENU=Address;
ESP=Direcci�n];
ToolTipML=[ENU=Specifies the address of the customer that you will
send the invoice to.;
ESP=Especifica la direcci�n del cliente a quien se
enviar� la factura.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Bill-to Address";
Importance=Additional;
Enabled=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
Editable=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
QuickEntry=FALSE;
ImplicitType=Text100 }

{ 20 ;4 ;Field ;
CaptionML=[ENU=Address 2;
ESP=Direcci�n 2];
ToolTipML=[ENU=Specifies additional address information.;
ESP=Especifica informaci�n adicional sobre la
direcci�n.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Bill-to Address 2";
Importance=Additional;
Enabled=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
Editable=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
QuickEntry=FALSE;
ImplicitType=Text50 }

{ 22 ;4 ;Field ;
CaptionML=[ENU=City;
ESP=Poblaci�n];
ToolTipML=[ENU=Specifies the city of the customer on the sales
document.;
ESP=Especifica la ciudad del cliente en el documento de
ventas.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Bill-to City";
Importance=Additional;
Enabled=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
Editable=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
QuickEntry=FALSE;
ImplicitType=Text30 }

{ 85 ;4 ;Group ;
Visible=IsBillToCountyVisible;
GroupType=Group }

{ 92 ;5 ;Field ;
CaptionML=[ENU=County;
ESP=Provincia];
ToolTipML=[ENU=Specifies the state, province or county of the
address.;
ESP=Especifica el estado, la provincia o la comarca de
la direcci�n.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Bill-to County";
Importance=Additional;
Enabled=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
Editable=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
QuickEntry=FALSE;
ImplicitType=Text30 }

{ 91 ;4 ;Field ;
CaptionML=[ENU=Post Code;
ESP=C�digo postal];
ToolTipML=[ENU=Specifies the postal code.;
ESP=Especifica el c�digo postal.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Bill-to Post Code";
Importance=Additional;
Enabled=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
Editable=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
QuickEntry=FALSE;
ImplicitType=Code20 }

{ 93 ;4 ;Field ;
CaptionML=[ENU=Country/Region;
ESP=Pa�s/regi�n];
ToolTipML=[ENU=Specifies the country or region of the address.;
ESP=Especifica el pa�s o la regi�n de la direcci�n.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Bill-to Country/Region Code";
Importance=Additional;
Enabled=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
Editable=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
OnValidate=BEGIN
IsBillToCountyVisible :=
FormatAddress.UseCounty("Bill-to Country/Region Code");
END;

QuickEntry=FALSE;
ImplicitType=Code10 }

{ 86 ;4 ;Field ;
CaptionML=[ENU=Contact No.;
ESP=N� contacto];
ToolTipML=[ENU=Specifies the number of the contact the invoice will
be sent to.;
ESP=Especifica el n�mero del contacto a quien se enviar�
la factura.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Bill-to Contact No.";
Importance=Additional;
Enabled=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
Editable=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
ImplicitType=Code20 }
{ 24 ;4 ;Field ;
CaptionML=[ENU=Contact;
ESP=Contacto];
ToolTipML=[ENU=Specifies the name of the person you should contact
at the customer who you are sending the invoice to.;
ESP=Especifica el nombre de la persona con quien
contactarse cuando es necesario comunicarse con el cliente al que se enviar� la
factura.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Bill-to Contact";
Enabled=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
Editable=(BillToOptions = BillToOptions::"Custom Address") OR
("Bill-to Customer No." <> "Sell-to Customer No.");
ImplicitType=Text100 }

{ 1907468901;1;Group ;
CaptionML=[ENU=Foreign Trade;
ESP=Comercio exterior];
GroupType=Group }

{ 99 ;2 ;Field ;
ToolTipML=[ENU=Specifies a specification of the document's
transaction, for the purpose of reporting to INTRASTAT.;
ESP=Especifica una especificaci�n de transacci�n del
documento de venta con el fin de notificarla a INTRASTAT.];
ApplicationArea=#Suite;
SourceExpr="Transaction Specification";
ImplicitType=Code10 }

{ 52 ;2 ;Field ;
ToolTipML=[ENU=Specifies the type of transaction that the document
represents, for the purpose of reporting to INTRASTAT.;
ESP=Especifica el tipo de transacci�n que representa el
documento con el fin de notificarlo a INTRASTAT.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Transaction Type";
ImplicitType=Code10 }

{ 54 ;2 ;Field ;
ToolTipML=[ENU=Specifies the transport method, for the purpose of
reporting to INTRASTAT.;
ESP=Especifica el modo de transporte con el fin de
informar a INTRASTAT.];
ApplicationArea=#Suite;
SourceExpr="Transport Method";
ImplicitType=Code10 }

{ 95 ;2 ;Field ;
ToolTipML=[ENU=Specifies the point of exit through which you ship
the items out of your country/region, for reporting to Intrastat.;
ESP=Especifica el punto de salida a trav�s del cual se
enviar�n los productos fuera de su pa�s o regi�n, con el fin de informar a
Intrastat.];
ApplicationArea=#Basic,#Suite;
SourceExpr="Exit Point";
ImplicitType=Code10 }

{ 97 ;2 ;Field ;
ToolTipML=[ENU=Specifies the area of the customer or vendor, for
the purpose of reporting to INTRASTAT.;
ESP=Especifica el �rea del cliente o proveedor con el
fin de informar a INTRASTAT.];
ApplicationArea=#Suite;
SourceExpr=Area;
ImplicitType=Code10 }

{ 1100225012;1;Group ;
CaptionML=[ENU=EDI;
ESP=EDI];
GroupType=Group }

{ 1100225011;2;Field ;
SourceExpr="EDI Document";
ImplicitType=Boolean }

{ 1100225010;2;Field ;
SourceExpr="EDI Provider No.";
ImplicitType=Code20 }

{ 1000000002;2;Field ;
SourceExpr="EDI Entity No.";
ImplicitType=Code20 }

{ 1100225021;2;Group ;
CaptionML=[ENU=Charge Note;
ESP=Nota de cargo];
Editable=FALSE;
GroupType=Group }

{ 1100225019;3;Field ;
SourceExpr="Charge Note";
ImplicitType=Boolean }

{ 1100225020;3;Field ;
SourceExpr="Charge Note Error";
ImplicitType=Boolean }

{ 1100225018;3;Field ;
SourceExpr="Charge Note Error Desc.";
ImplicitType=Text50 }

{ 1100225009;1;Group ;
Name=SII;
CaptionML=[ENU=SII;
ESP=SII];
GroupType=Group }

{ 1100225008;2;Field ;
SourceExpr="SII Exclude";
ImplicitType=Boolean }

{ 1100225007;2;Field ;
SourceExpr="SII Wait Sending";
ImplicitType=Boolean }

{ 1100225005;2;Field ;
SourceExpr="Credit Memo Type";
ImplicitType=Code10 }

{ 1100225006;2;Field ;
SourceExpr="Invoice Key Type";
ImplicitType=Code10 }

{ 1100225004;2;Field ;
SourceExpr="Special Sch. Key Issued Inv.";
ImplicitType=Code10 }

{ 1100225003;2;Field ;
SourceExpr="SII Posting Description";
ImplicitType=Text90 }

{ 1100225002;2;Field ;
SourceExpr="Intracomm. Operation Type";
ImplicitType=Code10 }

{ 1100225001;2;Field ;
SourceExpr="Intracomm. Operation Desc.";
ImplicitType=Text60 }

{ 1100225000;2;Field ;
SourceExpr="Intracomm. Operator Address";
ImplicitType=Text90 }

{ 1900000007;0;Container;
ContainerType=FactBoxArea }

{ 1901275107;1;Part ;
Name=Attached Documents;
CaptionML=[ENU=Attachments;
ESP=Datos adjuntos];
ApplicationArea=#All;
SubPageLink=Table ID=CONST(36),
No.=FIELD(No.),
Document Type=FIELD(Document Type);
PagePartID=Page1174;
PartType=Page }

{ 31 ;1 ;Part ;
ApplicationArea=#All;
SubPageLink=Table ID=CONST(36),
Document Type=FIELD(Document Type),
Document No.=FIELD(No.);
PagePartID=Page9103;
Visible=OpenApprovalEntriesExistForCurrUser;
PartType=Page }

{ 1903720907;1;Part ;
ApplicationArea=#Basic,#Suite;
SubPageLink=No.=FIELD(Sell-to Customer No.);
PagePartID=Page9080;
Visible=FALSE;
PartType=Page }

{ 1907234507;1;Part ;
ApplicationArea=#Basic,#Suite;
SubPageLink=No.=FIELD(Bill-to Customer No.);
PagePartID=Page9081;
Visible=FALSE;
PartType=Page }

{ 1902018507;1;Part ;
ApplicationArea=#Advanced;
SubPageLink=No.=FIELD(Bill-to Customer No.);
PagePartID=Page9082;
PartType=Page }

{ 1900316107;1;Part ;
ApplicationArea=#Basic,#Suite;
SubPageLink=No.=FIELD(Sell-to Customer No.);
PagePartID=Page9084;
PartType=Page }

{ 1903433807;1;Part ;
ApplicationArea=#Basic,#Suite;
SubPageLink=No.=FIELD(Bill-to Customer No.);
PagePartID=Page35304;
Visible=TRUE;
PartType=Page }

{ 1903433607;1;Part ;
ApplicationArea=#Basic,#Suite;
SubPageLink=No.=FIELD(Bill-to Customer No.);
PagePartID=Page35306;
Visible=TRUE;
PartType=Page }

{ 1906127307;1;Part ;
ApplicationArea=#Basic,#Suite;
SubPageLink=Document Type=FIELD(Document Type),
Document No.=FIELD(Document No.),
Line No.=FIELD(Line No.);
PagePartID=Page9087;
ProviderID=56;
Visible=FALSE;
PartType=Page }

{ 1901314507;1;Part ;
ApplicationArea=#Basic,#Suite;
SubPageLink=No.=FIELD(No.);
PagePartID=Page9089;
ProviderID=56;
PartType=Page }

{ 33 ;1 ;Part ;
Name=IncomingDocAttachFactBox;
ApplicationArea=#Basic,#Suite;
PagePartID=Page193;
Visible=FALSE;
PartType=Page;
ShowFilter=No }

{ 1906354007;1;Part ;
Name=ApprovalFactBox;
ApplicationArea=#Basic,#Suite;
PagePartID=Page9092;
Visible=FALSE;
PartType=Page }

{ 1907012907;1;Part ;
ApplicationArea=#Basic,#Suite;
SubPageLink=No.=FIELD(No.);
PagePartID=Page9108;
ProviderID=56;
Visible=FALSE;
PartType=Page }

{ 51 ;1 ;Part ;
Name=WorkflowStatus;
ApplicationArea=#All;
PagePartID=Page1528;
Visible=ShowWorkflowStatus;
Enabled=FALSE;
Editable=FALSE;
PartType=Page;
ShowFilter=No }

{ 1900383207;1;Part ;
ApplicationArea=#RecordLinks;
Visible=FALSE;
PartType=System;
SystemPartID=RecordLinks }

{ 1905767507;1;Part ;
ApplicationArea=#Notes;
PartType=System;
SystemPartID=Notes }

}
CODE
{
VAR
CopySalesDoc@1002 : Report 292;
MoveNegSalesLines@1006 : Report 6699;
ApplicationAreaMgmtFacade@1011 : Codeunit 9179;
ReportPrint@1003 : Codeunit 228;
UserMgt@1004 : Codeunit 5700;
SalesCalcDiscountByType@1007 : Codeunit 56;
ApprovalsMgmt@1013 : Codeunit 1535;
LinesInstructionMgt@1015 : Codeunit 1320;
CustomerMgt@1059 : Codeunit 1302;
FormatAddress@1024 : Codeunit 365;
ChangeExchangeRate@1001 : Page 511;
NavigateAfterPost@1017 : 'Posted Document,New Document,Nowhere';
WorkDescription@1018 : Text;
HasIncomingDocument@1012 : Boolean;
DocNoVisible@1005 : Boolean;
ExternalDocNoMandatory@1008 : Boolean;
OpenApprovalEntriesExistForCurrUser@1009 : Boolean;
OpenApprovalEntriesExist@1000 : Boolean;
ShowWorkflowStatus@1010 : Boolean;
PaymentServiceVisible@1032 : Boolean;
PaymentServiceEnabled@1033 : Boolean;
OpenPostedSalesInvQst@1020 : TextConst '@@@="%1 = posted document
number";ENU=The invoice is posted as number %1 and moved to the Posted Sales
Invoices window.\\Do you want to open the posted invoice?;ESP=La factura se
registr� con el n�mero %1 y se movi� a la ventana de facturas de venta
registradas.\\�Quiere abrir la factura registrada?';
IsCustomerOrContactNotEmpty@1021 : Boolean;
ShowQuoteNo@1029 : Boolean;
JobQueuesUsed@1031 : Boolean;
CanCancelApprovalForRecord@1014 : Boolean;
DocumentIsPosted@1016 : Boolean;
ShipToOptions@1050 : 'Default (Sell-to Address),Alternate Shipping
Address,Custom Address';
BillToOptions@1051 : 'Default (Customer),Another Customer,Custom Address';
EmptyShipToCodeErr@1052 : TextConst 'ENU=The Code field can only be empty if
you select Custom Address in the Ship-to field.;ESP=El campo C�digo solo puede
estar vac�o si selecciona Direcci�n personalizada en el campo Direcci�n de env�o.';
IsSaaS@1019 : Boolean;
IsBillToCountyVisible@1030 : Boolean;
IsSellToCountyVisible@1028 : Boolean;
IsShipToCountyVisible@1027 : Boolean;
CanRequestApprovalForFlow@1023 : Boolean;
CanCancelApprovalForFlow@1022 : Boolean;
OperationDescription@1100000 : Text[500];
SkipConfirmationDialogOnClosing@1100225002 : Boolean;
ForcedDate@1100225001 : Boolean;
SIIMESetup@1100225000 : Record 7200909;

[LineStart(9536)]
LOCAL PROCEDURE ActivateFields@11();
BEGIN
IsBillToCountyVisible := FormatAddress.UseCounty("Bill-to Country/Region
Code");
IsSellToCountyVisible := FormatAddress.UseCounty("Sell-to Country/Region
Code");
IsShipToCountyVisible := FormatAddress.UseCounty("Ship-to Country/Region
Code");
END;

[LineStart(9541)]
LOCAL PROCEDURE Post@4(PostingCodeunitID@1000 : Integer;Navigate@1005 :
Option);
VAR
SalesHeader@1002 : Record 36;
SalesInvoiceHeader@1003 : Record 112;
OfficeMgt@1004 : Codeunit 1630;
InstructionMgt@1006 : Codeunit 1330;
PreAssignedNo@1001 : Code[20];
IsScheduledPosting@1007 : Boolean;
BEGIN
IF ApplicationAreaMgmtFacade.IsFoundationEnabled THEN
LinesInstructionMgt.SalesCheckAllLinesHaveQuantityAssigned(Rec);
PreAssignedNo := "No.";

SendToPosting(PostingCodeunitID);

IsScheduledPosting := "Job Queue Status" = "Job Queue Status"::"Scheduled for


Posting";
DocumentIsPosted := (NOT SalesHeader.GET("Document Type","No.")) OR
IsScheduledPosting;

OnPostOnAfterSetDocumentIsPosted(SalesHeader,IsScheduledPosting,DocumentIsPosted);
IF IsScheduledPosting THEN
CurrPage.CLOSE;
CurrPage.UPDATE(FALSE);

IF PostingCodeunitID <> CODEUNIT::"Sales-Post (Yes/No)" THEN


EXIT;

IF OfficeMgt.IsAvailable THEN BEGIN


SalesInvoiceHeader.SETCURRENTKEY("Pre-Assigned No.");
SalesInvoiceHeader.SETRANGE("Pre-Assigned No.",PreAssignedNo);
IF SalesInvoiceHeader.FINDFIRST THEN
PAGE.RUN(PAGE::"Posted Sales Invoice",SalesInvoiceHeader);
END ELSE
CASE Navigate OF
NavigateAfterPost::"Posted Document":
IF
InstructionMgt.IsEnabled(InstructionMgt.ShowPostedConfirmationMessageCode) THEN
ShowPostedConfirmationMessage(PreAssignedNo);
NavigateAfterPost::"New Document":
IF DocumentIsPosted THEN BEGIN
SalesHeader.INIT;
SalesHeader.VALIDATE("Document Type",SalesHeader."Document
Type"::Invoice);
SalesHeader.INSERT(TRUE);
PAGE.RUN(PAGE::"Sales Invoice",SalesHeader);
END;
END;
END;

[LineStart(9578)]
LOCAL PROCEDURE ApproveCalcInvDisc@8();
BEGIN
CurrPage.SalesLines.PAGE.ApproveCalcInvDisc;
END;

[LineStart(9581)]
LOCAL PROCEDURE SaveInvoiceDiscountAmount@10();
VAR
DocumentTotals@1000 : Codeunit 57;
BEGIN
CurrPage.SAVERECORD;
DocumentTotals.SalesRedistributeInvoiceDiscountAmountsOnDocument(Rec);
CurrPage.UPDATE(FALSE);
END;

[LineStart(9586)]
LOCAL PROCEDURE ShowPostedConfirmationMessage@17(PreAssignedNo@1001 :
Code[20]);
VAR
SalesInvoiceHeader@1000 : Record 112;
InstructionMgt@1002 : Codeunit 1330;
BEGIN
SalesInvoiceHeader.SETCURRENTKEY("Pre-Assigned No.");
SalesInvoiceHeader.SETRANGE("Pre-Assigned No.",PreAssignedNo);
IF SalesInvoiceHeader.FINDFIRST THEN
IF
InstructionMgt.ShowConfirm(STRSUBSTNO(OpenPostedSalesInvQst,SalesInvoiceHeader."No.
"),
InstructionMgt.ShowPostedConfirmationMessageCode)
THEN
PAGE.RUN(PAGE::"Posted Sales Invoice",SalesInvoiceHeader);
END;

[LineStart(9595)]
LOCAL PROCEDURE SalespersonCodeOnAfterValidate@19011896();
BEGIN
CurrPage.SalesLines.PAGE.UpdatePage(TRUE);
END;

[LineStart(9598)]
LOCAL PROCEDURE SetDocNoVisible@3();
VAR
DocumentNoVisibility@1000 : Codeunit 1400;
DocType@1003 : 'Quote,Order,Invoice,Credit Memo,Blanket Order,Return
Order,Reminder,FinChMemo';
BEGIN
DocNoVisible :=
DocumentNoVisibility.SalesDocumentNoIsVisible(DocType::Invoice,"No.");
END;

[LineStart(9601)]
LOCAL PROCEDURE SetExtDocNoMandatoryCondition@2();
VAR
SalesReceivablesSetup@1000 : Record 311;
BEGIN
SalesReceivablesSetup.GET;
ExternalDocNoMandatory := SalesReceivablesSetup."Ext. Doc. No. Mandatory"
END;

[LineStart(9605)]
LOCAL PROCEDURE ShowPreview@5();
VAR
SalesPostYesNo@1000 : Codeunit 81;
BEGIN
SalesPostYesNo.Preview(Rec);
END;

[LineStart(9608)]
LOCAL PROCEDURE SetControlAppearance@6();
VAR
ApprovalsMgmt@1002 : Codeunit 1535;
WorkflowWebhookMgt@1000 : Codeunit 1543;
BEGIN
HasIncomingDocument := "Incoming Document Entry No." <> 0;
SetExtDocNoMandatoryCondition;

OpenApprovalEntriesExistForCurrUser :=
ApprovalsMgmt.HasOpenApprovalEntriesForCurrentUser(RECORDID);
OpenApprovalEntriesExist := ApprovalsMgmt.HasOpenApprovalEntries(RECORDID);
CanCancelApprovalForRecord :=
ApprovalsMgmt.CanCancelApprovalForRecord(RECORDID);

IsCustomerOrContactNotEmpty := ("Sell-to Customer No." <> '') OR ("Sell-to


Contact No." <> '');

WorkflowWebhookMgt.GetCanRequestAndCanCancel(RECORDID,CanRequestApprovalForFlow,Can
CancelApprovalForFlow);
END;

[External]
[LineStart(9620)]
PROCEDURE SetSkipConfirmationDialogOnClosing@12(Skip@1000 : Boolean);
BEGIN
SkipConfirmationDialogOnClosing := Skip;
END;

[LineStart(9623)]
LOCAL PROCEDURE UpdatePaymentService@7();
VAR
PaymentServiceSetup@1000 : Record 1060;
BEGIN
PaymentServiceEnabled := PaymentServiceSetup.CanChangePaymentService(Rec);
END;

[LineStart(9626)]
LOCAL PROCEDURE UpdateShipToBillToGroupVisibility@9();
BEGIN
CustomerMgt.CalculateShipToBillToOptions(ShipToOptions,BillToOptions,Rec);
END;

[Integration]
[LineStart(9629)]
LOCAL PROCEDURE OnBeforeStatisticsAction@1(VAR SalesHeader@1000 : Record 36;VAR
Handled@1001 : Boolean);
BEGIN
END;

[Integration]
[LineStart(9632)]
LOCAL PROCEDURE OnPostOnAfterSetDocumentIsPosted@13(SalesHeader@1000 : Record
36;VAR IsScheduledPosting@1001 : Boolean;VAR DocumentIsPosted@1002 : Boolean);
BEGIN
END;

BEGIN
{
-001 xtrullols 07/04/2015. PI0001_MRW_9999. Declaraci� de vendes com a
tickets al model 340

SIIME-CHANGE LOG
SIIME OS.SP 20170501
Added Fields: "Invoice Key Type", "Credit Memo Type", "Special Sch. Key
Issued Inv.", "Intracomm. Operation Type", "SII Exclude", "SII Posting
Description", "SII Wait Sending",
"Intracomm. Operation Desc.", "Intracomm. Operator
Address", "Accounting Posting Date".
SIIME.002 OS.SP 20170706
Modified Logic and Properties.

-044 OS.XT. 25/11/2016. Gesti�n IVA de autoconsumo (regalos)

MRW999 dperez 16/12/2019 C�digo gestor punto de venta

315 OS.MM. 05/03/2020. MRW_SP20200305_MM. Nou camp exclusi� comanda comissi�.


411 OS.MM. 15/12/2020. Notas de cargo: Casar con devoluci�n registrada.
431 OS.ACE.04/02/2021. Integraci�n con Canarias
451 OS.MM. 25/02/2021. MRW_SP20210225_MM. Completar lotes de borrador de
factura de venta.

13/09/2021 - YMM Sacar campor n�mero de Items


}
END.
}
}

OBJECT Page 6510 Item Tracking Lines


{
OBJECT-PROPERTIES
{
Date=29/03/21;
Time=18:23:29;
Modified=Yes;
Version List=NAVW114.01,LSW17.0,LSW17.0,OS,431;
}
PROPERTIES
{
CaptionML=[ENU=Item Tracking Lines;
ESP=L¡ns. seguim. prod.];
SourceTable=Table336;
DelayedInsert=Yes;
PopulateAllFields=Yes;
DataCaptionFields=Item No.,Variant Code,Description;
PageType=Worksheet;
SourceTableTemporary=Yes;
PromotedActionCategoriesML=[ENU=New,Process,Report,Line;
ESP=Nuevo,Procesar,Informe,L�nea];
OnInit=BEGIN
WarrantyDateEditable := TRUE;
ExpirationDateEditable := TRUE;
NewExpirationDateEditable := TRUE;
NewLotNoEditable := TRUE;
NewSerialNoEditable := TRUE;
DescriptionEditable := TRUE;
LotNoEditable := TRUE;
SerialNoEditable := TRUE;
QuantityBaseEditable := TRUE;
QtyToInvoiceBaseEditable := TRUE;
QtyToHandleBaseEditable := TRUE;
FunctionsDemandVisible := TRUE;
FunctionsSupplyVisible := TRUE;
ButtonLineVisible := TRUE;
QtyToInvoiceBaseVisible := TRUE;
Invoice3Visible := TRUE;
Invoice2Visible := TRUE;
Invoice1Visible := TRUE;
QtyToHandleBaseVisible := TRUE;
Handle3Visible := TRUE;
Handle2Visible := TRUE;
Handle1Visible := TRUE;
LocationCodeEditable := TRUE;
VariantCodeEditable := TRUE;
ItemNoEditable := TRUE;
InboundIsSet := FALSE;
ApplFromItemEntryVisible := FALSE;
ApplToItemEntryVisible := FALSE;
END;

OnOpenPage=BEGIN
ItemNoEditable := FALSE;
VariantCodeEditable := FALSE;
LocationCodeEditable := FALSE;
IF InboundIsSet THEN BEGIN
ApplFromItemEntryVisible := Inbound;
ApplToItemEntryVisible := NOT Inbound;
END;

UpdateUndefinedQtyArray;

CurrentPageIsOpen := TRUE;
END;

OnClosePage=BEGIN
IF UpdateUndefinedQty THEN
WriteToDatabase;
IF FormRunMode = FormRunMode::"Drop Shipment" THEN
CASE CurrentSourceType OF
DATABASE::"Sales Line":
SynchronizeLinkedSources(STRSUBSTNO(Text015,Text016));
DATABASE::"Purchase Line":
SynchronizeLinkedSources(STRSUBSTNO(Text015,Text017));
END;

IF (FormRunMode = FormRunMode::Transfer) OR
IsOrderToOrderBindingToTransfer THEN
SynchronizeLinkedSources('');
SynchronizeWarehouseItemTracking;
END;

OnAfterGetRecord=BEGIN
ExpirationDateOnFormat;
END;

OnNewRecord=BEGIN
"Qty. per Unit of Measure" := QtyPerUOM;
END;

OnInsertRecord=BEGIN
IF "Entry No." <> 0 THEN
EXIT(FALSE);
"Entry No." := NextEntryNo;
IF (NOT InsertIsBlocked) AND (NOT ZeroLineExists) THEN
IF VerifyNewTrackingSpecification THEN BEGIN
TempItemTrackLineInsert.TRANSFERFIELDS(Rec);
TempItemTrackLineInsert.INSERT;
INSERT;

ItemTrackingDataCollection.UpdateTrackingDataSetWithChange(
TempItemTrackLineInsert,CurrentSignFactor *
SourceQuantityArray[1] < 0,CurrentSignFactor,0);
END;
CalculateSums;

EXIT(FALSE);
END;

OnModifyRecord=VAR
xTempTrackingSpec@1000 : TEMPORARY Record 336;
BEGIN
IF InsertIsBlocked THEN
IF (xRec."Lot No." <> "Lot No.") OR
(xRec."Serial No." <> "Serial No.") OR
(xRec."Quantity (Base)" <> "Quantity (Base)")
THEN
EXIT(FALSE);

IF VerifyNewTrackingSpecification THEN BEGIN


MODIFY;

IF (xRec."Lot No." <> "Lot No.") OR (xRec."Serial No." <>


"Serial No.") THEN BEGIN
xTempTrackingSpec := xRec;

ItemTrackingDataCollection.UpdateTrackingDataSetWithChange(
xTempTrackingSpec,CurrentSignFactor *
SourceQuantityArray[1] < 0,CurrentSignFactor,2);
END;

IF TempItemTrackLineModify.GET("Entry No.") THEN


TempItemTrackLineModify.DELETE;
IF TempItemTrackLineInsert.GET("Entry No.") THEN BEGIN
TempItemTrackLineInsert.TRANSFERFIELDS(Rec);
TempItemTrackLineInsert.MODIFY;

ItemTrackingDataCollection.UpdateTrackingDataSetWithChange(
TempItemTrackLineInsert,CurrentSignFactor *
SourceQuantityArray[1] < 0,CurrentSignFactor,1);
END ELSE BEGIN
TempItemTrackLineModify.TRANSFERFIELDS(Rec);
TempItemTrackLineModify.INSERT;

ItemTrackingDataCollection.UpdateTrackingDataSetWithChange(
TempItemTrackLineModify,CurrentSignFactor *
SourceQuantityArray[1] < 0,CurrentSignFactor,1);
END;
END;
CalculateSums;

EXIT(FALSE);
END;

OnDeleteRecord=VAR
TrackingSpec@1002 : Record 336;
WMSManagement@1001 : Codeunit 7302;
AlreadyDeleted@1000 : Boolean;
BEGIN
OnBeforeDeleteRecord(Rec);

TrackingSpec."Item No." := "Item No.";


TrackingSpec."Location Code" := "Location Code";
TrackingSpec."Source Type" := "Source Type";
TrackingSpec."Source Subtype" := "Source Subtype";
WMSManagement.CheckItemTrackingChange(TrackingSpec,Rec);
IF NOT DeleteIsBlocked THEN BEGIN
AlreadyDeleted := TempItemTrackLineDelete.GET("Entry No.");
TempItemTrackLineDelete.TRANSFERFIELDS(Rec);
DELETE(TRUE);

IF NOT AlreadyDeleted THEN


TempItemTrackLineDelete.INSERT;
ItemTrackingDataCollection.UpdateTrackingDataSetWithChange(
TempItemTrackLineDelete,CurrentSignFactor *
SourceQuantityArray[1] < 0,CurrentSignFactor,2);
IF TempItemTrackLineInsert.GET("Entry No.") THEN
TempItemTrackLineInsert.DELETE;
IF TempItemTrackLineModify.GET("Entry No.") THEN
TempItemTrackLineModify.DELETE;
END;
CalculateSums;

EXIT(FALSE);
END;

OnQueryClosePage=BEGIN
IF NOT UpdateUndefinedQty THEN
EXIT(CONFIRM(Text006));

IF NOT
ItemTrackingDataCollection.RefreshTrackingAvailability(Rec,FALSE) THEN BEGIN
CurrPage.UPDATE;
EXIT(CONFIRM(Text019,TRUE));
END;
END;

OnAfterGetCurrRecord=BEGIN
UpdateExpDateEditable;
END;

ActionList=ACTIONS
{
{ 1900000003;0 ;ActionContainer;
ActionContainerType=RelatedInformation }
{ 66 ;1 ;ActionGroup;
Name=ButtonLineReclass;
CaptionML=[ENU=&Line;
ESP=&L¡nea];
Visible=ButtonLineReclassVisible;
Image=Line }
{ 67 ;2 ;Action ;
Name=Reclass_SerialNoInfoCard;
CaptionML=[ENU=Serial No. Information Card;
ESP=Ficha informaci¢n n§ serie];
ToolTipML=[ENU=View or edit detailed information about the
serial number.;
ESP=Permite ver o editar la informaci¢n detallada
sobre el n£mero de serie.];
ApplicationArea=#ItemTracking;
RunObject=Page 6509;
RunPageLink=Item No.=FIELD(Item No.),
Variant Code=FIELD(Variant Code),
Serial No.=FIELD(Serial No.);
Promoted=Yes;
Image=SNInfo;
PromotedCategory=Category4;
OnAction=BEGIN
TESTFIELD("Serial No.");
END;
}
{ 68 ;2 ;Action ;
Name=Reclass_LotNoInfoCard;
CaptionML=[ENU=Lot No. Information Card;
ESP=Ficha informaci¢n n§ lote];
ToolTipML=[ENU=View or edit detailed information about the
lot number.;
ESP=Permite ver o editar la informaci¢n detallada
sobre el n£mero de lote.];
ApplicationArea=#ItemTracking;
RunObject=Page 6508;
RunPageLink=Item No.=FIELD(Item No.),
Variant Code=FIELD(Variant Code),
Lot No.=FIELD(Lot No.);
Promoted=Yes;
Image=LotInfo;
PromotedCategory=Category4;
OnAction=BEGIN
TESTFIELD("Lot No.");
END;
}
{ 69 ;2 ;Separator }
{ 70 ;2 ;Action ;
Name=NewSerialNoInformation;
CaptionML=[ENU=New S&erial No. Information;
ESP=Nu&eva informaci¢n n§ serie];
ToolTipML=[ENU=Create a record with detailed information
about the serial number.;
ESP=Crea un registro con informaci¢n detallada
sobre el n£mero de serie.];
ApplicationArea=#ItemTracking;
Promoted=Yes;
Image=NewSerialNoProperties;
PromotedCategory=Category4;
OnAction=VAR
SerialNoInfoNew@1000 : Record 6504;
SerialNoInfoForm@1001 : Page 6504;
BEGIN
TESTFIELD("New Serial No.");

CLEAR(SerialNoInfoForm);
SerialNoInfoForm.Init(Rec);

SerialNoInfoNew.SETRANGE("Item No.","Item No.");


SerialNoInfoNew.SETRANGE("Variant Code","Variant
Code");
SerialNoInfoNew.SETRANGE("Serial No.","New Serial
No.");

SerialNoInfoForm.SETTABLEVIEW(SerialNoInfoNew);
SerialNoInfoForm.RUN;
END;
}
{ 71 ;2 ;Action ;
Name=NewLotNoInformation;
CaptionML=[ENU=New L&ot No. Information;
ESP=Nueva inf&ormaci¢n n§ lote];
ToolTipML=[ENU=Create a record with detailed information
about the lot number.;
ESP=Crea un registro con informaci¢n detallada
sobre el n£mero de lote.];
ApplicationArea=#ItemTracking;
RunPageOnRec=No;
Promoted=Yes;
Image=NewLotProperties;
PromotedCategory=Category4;
OnAction=VAR
LotNoInfoNew@1000 : Record 6505;
LotNoInfoForm@1001 : Page 6505;
BEGIN
TESTFIELD("New Lot No.");

CLEAR(LotNoInfoForm);
LotNoInfoForm.Init(Rec);

LotNoInfoNew.SETRANGE("Item No.","Item No.");


LotNoInfoNew.SETRANGE("Variant Code","Variant
Code");
LotNoInfoNew.SETRANGE("Lot No.","New Lot No.");

LotNoInfoForm.SETTABLEVIEW(LotNoInfoNew);
LotNoInfoForm.RUN;
END;
}
{ 72 ;1 ;ActionGroup;
Name=ButtonLine;
CaptionML=[ENU=&Line;
ESP=&L¡nea];
Visible=ButtonLineVisible;
Image=Line }
{ 73 ;2 ;Action ;
Name=Line_SerialNoInfoCard;
CaptionML=[ENU=Serial No. Information Card;
ESP=Ficha informaci¢n n§ serie];
ToolTipML=[ENU=View or edit detailed information about the
serial number.;
ESP=Permite ver o editar la informaci¢n detallada
sobre el n£mero de serie.];
ApplicationArea=#ItemTracking;
RunObject=Page 6509;
RunPageLink=Item No.=FIELD(Item No.),
Variant Code=FIELD(Variant Code),
Serial No.=FIELD(Serial No.);
Promoted=Yes;
Image=SNInfo;
PromotedCategory=Category4;
OnAction=BEGIN
TESTFIELD("Serial No.");
END;
}
{ 74 ;2 ;Action ;
Name=Line_LotNoInfoCard;
CaptionML=[ENU=Lot No. Information Card;
ESP=Ficha informaci¢n n§ lote];
ToolTipML=[ENU=View or edit detailed information about the
lot number.;
ESP=Permite ver o editar la informaci¢n detallada
sobre el n£mero de lote.];
ApplicationArea=#ItemTracking;
RunObject=Page 6508;
RunPageLink=Item No.=FIELD(Item No.),
Variant Code=FIELD(Variant Code),
Lot No.=FIELD(Lot No.);
Promoted=Yes;
Image=LotInfo;
PromotedCategory=Category4;
OnAction=BEGIN
TESTFIELD("Lot No.");
END;
}
{ 1900000004;0 ;ActionContainer;
ActionContainerType=ActionItems }
{ 50 ;1 ;ActionGroup;
Name=FunctionsSupply;
CaptionML=[ENU=F&unctions;
ESP=Acci&ones];
Visible=FunctionsSupplyVisible;
Image=Action }
{ 51 ;2 ;Action ;
Name=Assign Serial No.;
CaptionML=[ENU=Assign &Serial No.;
ESP=Asignar n§ &serie];
ToolTipML=[ENU=Automatically assign the required serial
numbers from predefined number series.;
ESP=Asigna autom ticamente los n£meros de serie
necesarios a partir de series de n£meros predefinidas.];
ApplicationArea=#ItemTracking;
Promoted=Yes;
Image=SerialNo;
PromotedCategory=Process;
OnAction=BEGIN
IF InsertIsBlocked THEN
EXIT;
AssignSerialNo;
END;
}
{ 52 ;2 ;Action ;
Name=Assign Lot No.;
CaptionML=[ENU=Assign &Lot No.;
ESP=Asignar n§ &lote];
ToolTipML=[ENU=Automatically assign the required lot numbers
from predefined number series.;
ESP=Asigna autom ticamente los n£meros de lote
necesarios a partir de series de n£meros predefinidas.];
ApplicationArea=#ItemTracking;
Promoted=Yes;
Image=Lot;
PromotedCategory=Process;
OnAction=BEGIN
IF InsertIsBlocked THEN
EXIT;
AssignLotNo;
END;
}
{ 77 ;2 ;Action ;
CaptionML=[ENU=Create Customized SN;
ESP=Crear NS personalizado];
ToolTipML=[ENU=Automatically assign the required serial
numbers based on a number series that you define.;
ESP=Asignar autom ticamente los n£meros de serie
necesarios basados en una serie de n£meros que defina.];
ApplicationArea=#ItemTracking;
Promoted=Yes;
Image=CreateSerialNo;
PromotedCategory=Process;
OnAction=BEGIN
IF InsertIsBlocked THEN
EXIT;
CreateCustomizedSN;
END;
}
{ 79 ;2 ;Action ;
CaptionML=[ENU=Refresh Availability;
ESP=Actualizar disponibilidad];
ToolTipML=[ENU="Update the availability information according
to changes made by other users since you opened the window. ";
ESP=Actualiza la informaci¢n de disponibilidad
seg£n los cambios realizados por otros usuarios desde que abri¢ la ventana.];
ApplicationArea=#ItemTracking;
Image=Refresh;
OnAction=BEGIN

ItemTrackingDataCollection.RefreshTrackingAvailability(Rec,TRUE);
END;
}
{ 43 ;1 ;ActionGroup;
Name=FunctionsDemand;
CaptionML=[ENU=F&unctions;
ESP=Acci&ones];
Visible=FunctionsDemandVisible;
Image=Action }
{ 44 ;2 ;Action ;
CaptionML=[ENU=Assign &Serial No.;
ESP=Asignar n§ &serie];
ToolTipML=[ENU=Automatically assign the required serial
numbers from predefined number series.;
ESP=Asigna autom ticamente los n£meros de serie
necesarios a partir de series de n£meros predefinidas.];
ApplicationArea=#ItemTracking;
Promoted=Yes;
Image=SerialNo;
PromotedCategory=Process;
OnAction=BEGIN
IF InsertIsBlocked THEN
EXIT;
AssignSerialNo;
END;
}
{ 45 ;2 ;Action ;
CaptionML=[ENU=Assign &Lot No.;
ESP=Asignar n§ &lote];
ToolTipML=[ENU=Automatically assign the required lot numbers
from predefined number series.;
ESP=Asigna autom ticamente los n£meros de lote
necesarios a partir de series de n£meros predefinidas.];
ApplicationArea=#ItemTracking;
Promoted=Yes;
Image=Lot;
PromotedCategory=Process;
OnAction=BEGIN
IF InsertIsBlocked THEN
EXIT;
AssignLotNo;
END;
}
{ 57 ;2 ;Action ;
Name=CreateCustomizedSN;
CaptionML=[ENU=Create Customized SN;
ESP=Crear NS personalizado];
ToolTipML=[ENU=Automatically assign the required serial
numbers based on a number series that you define.;
ESP=Asignar autom ticamente los n£meros de serie
necesarios basados en una serie de n£meros que defina.];
ApplicationArea=#ItemTracking;
Promoted=Yes;
Image=CreateSerialNo;
PromotedCategory=Process;
OnAction=BEGIN
IF InsertIsBlocked THEN
EXIT;
CreateCustomizedSN;
END;
}
{ 55 ;2 ;Action ;
Name=Select Entries;
CaptionML=[ENU=Select &Entries;
ESP=Seleccionar &movs.];
ToolTipML=[ENU=Select from existing, available serial or lot
numbers.;
ESP=Permite seleccionar entre n£meros de serie y
de lote existentes y disponibles.];
ApplicationArea=#ItemTracking;
Promoted=Yes;
PromotedIsBig=Yes;
Image=SelectEntries;
PromotedCategory=Process;
OnAction=BEGIN
IF InsertIsBlocked THEN
EXIT;

SelectEntries;
END;
}
{ 64 ;2 ;Action ;
CaptionML=[ENU=Refresh Availability;
ESP=Actualizar disponibilidad];
ToolTipML=[ENU="Update the availability information according
to changes made by other users since you opened the window. ";
ESP=Actualiza la informaci¢n de disponibilidad
seg£n los cambios realizados por otros usuarios desde que abri¢ la ventana.];
ApplicationArea=#ItemTracking;
Promoted=Yes;
PromotedIsBig=Yes;
Image=Refresh;
PromotedCategory=Process;
OnAction=BEGIN

ItemTrackingDataCollection.RefreshTrackingAvailability(Rec,TRUE);
END;
}
}
}
CONTROLS
{
{ 1900000001;0;Container;
ContainerType=ContentArea }

{ 59 ;1 ;Group }

{ 1903651101;2;Group ;
GroupType=FixedLayout }

{ 1900546401;3;Group ;
CaptionML=[ENU=Source;
ESP=Origen] }

{ 38 ;4 ;Field ;
ApplicationArea=#ItemTracking;
SourceExpr=CurrentSourceCaption;
Editable=FALSE;
ShowCaption=No;
ImplicitType=Text255 }

{ 29 ;4 ;Field ;
CaptionML=[ENU=Quantity;
ESP=Cantidad];
ToolTipML=[ENU=Specifies the quantity of the item that corresponds
to the document line, which is indicated by 0 in the Undefined fields.;
ESP=Especifica la cantidad del producto que corresponde
a la de la l¡nea del documento, indicada como 0 en los campos Indefinido.];
ApplicationArea=#ItemTracking;
DecimalPlaces=0:5;
SourceExpr=SourceQuantityArray[1];
Editable=FALSE }

{ 31 ;4 ;Field ;
Name=Handle1;
CaptionML=[ENU=Qty. to Handle;
ESP=Cant.a manipular];
ToolTipML=[ENU=Specifies the item-tracked quantity to be handled.
The quantities must correspond to those of the document line.;
ESP=Especifica la cantidad de producto con seguimiento
para manipular. Las cantidades deben corresponder con las de la l¡nea del
documento.];
ApplicationArea=#ItemTracking;
DecimalPlaces=0:5;
SourceExpr=SourceQuantityArray[2];
Visible=Handle1Visible;
Editable=FALSE }

{ 33 ;4 ;Field ;
Name=Invoice1;
CaptionML=[ENU=Qty. to Invoice;
ESP=Cant. a facturar];
ToolTipML=[ENU=Specifies the item-tracked quantity to be invoiced.;
ESP=Especifica la cantidad de producto seguida a
facturar.];
ApplicationArea=#ItemTracking;
DecimalPlaces=0:5;
SourceExpr=SourceQuantityArray[3];
Visible=Invoice1Visible;
Editable=FALSE }

{ 1901742101;3;Group ;
CaptionML=[ENU=Item Tracking;
ESP=Seguim. prod.] }

{ 87 ;4 ;Field ;
ApplicationArea=#ItemTracking;
SourceExpr=Text020;
Visible=FALSE;
ImplicitType=TextConst }

{ 35 ;4 ;Field ;
Name=Quantity_ItemTracking;
CaptionML=[ENU=Quantity;
ESP=Cantidad];
ToolTipML=[ENU=Specifies the item-tracked quantity of the item that
corresponds to the document line, which is indicated by 0 in the Undefined fields.;
ESP=Especifica la cantidad del producto seguida que
corresponde a la de la l¡nea del documento, indicada como 0 en los campos
Indefinido.];
ApplicationArea=#ItemTracking;
DecimalPlaces=0:5;
SourceExpr=TotalItemTrackingLine."Quantity (Base)";
Editable=FALSE }

{ 36 ;4 ;Field ;
Name=Handle2;
CaptionML=[ENU=Qty. to Handle;
ESP=Cant.a manipular];
ToolTipML=[ENU=Specifies the item-tracked quantity to be handled.
The quantities must correspond to those of the document line.;
ESP=Especifica la cantidad de producto con seguimiento
para manipular. Las cantidades deben corresponder con las de la l¡nea del
documento.];
ApplicationArea=#ItemTracking;
DecimalPlaces=0:5;
SourceExpr=TotalItemTrackingLine."Qty. to Handle (Base)";
Visible=Handle2Visible;
Editable=FALSE }

{ 37 ;4 ;Field ;
Name=Invoice2;
CaptionML=[ENU=Qty. to Invoice;
ESP=Cant. a facturar];
ToolTipML=[ENU=Specifies the item-tracked quantity to be invoiced.;
ESP=Especifica la cantidad de producto seguida a
facturar.];
ApplicationArea=#ItemTracking;
DecimalPlaces=0:5;
SourceExpr=TotalItemTrackingLine."Qty. to Invoice (Base)";
Visible=Invoice2Visible;
Editable=FALSE }

{ 1903866601;3;Group ;
CaptionML=[ENU=Undefined;
ESP=Indefinido] }

{ 88 ;4 ;Field ;
ApplicationArea=#ItemTracking;
SourceExpr=Text020;
Visible=FALSE;
ImplicitType=TextConst }

{ 40 ;4 ;Field ;
Name=Quantity3;
CaptionML=[ENU=Undefined Quantity;
ESP=Cant. no definida];
ToolTipML=[ENU=Specifies the item-tracked quantity that remains to
be assigned, according to the document quantity.;
ESP=Especifica la cantidad de producto seguida pendiente
de asignarse, seg£n la cantidad del documento.];
ApplicationArea=#ItemTracking;
DecimalPlaces=2:5;
BlankZero=Yes;
SourceExpr=UndefinedQtyArray[1];
Editable=FALSE }

{ 41 ;4 ;Field ;
Name=Handle3;
CaptionML=[ENU=Undefined Quantity to Handle;
ESP=Cant. no definida a manipular];
ToolTipML=[ENU=Specifies the difference between the quantity that
can be selected for the document line (which is shown in the Selectable field) and
the quantity that you have selected in this window (shown in the Selected field).
If you have specified more item tracking quantity than is required on the document
line, this field shows the overflow quantity as a negative number in red.;
ESP=Especifica la diferencia entre la cantidad que se
puede seleccionar para la l¡nea del documento (que aparece en el campo
Seleccionable) y la cantidad que se ha seleccionado en esta ventana (mostrada en el
campo Selecc.). Si ha especificado m s cantidad de seguimiento de producto que la
necesaria en la l¡nea del documento, este campo mostrar la cantidad excedente como
un n£mero negativo en rojo.];
ApplicationArea=#ItemTracking;
DecimalPlaces=2:5;
BlankZero=Yes;
SourceExpr=UndefinedQtyArray[2];
Visible=Handle3Visible;
Editable=FALSE }

{ 42 ;4 ;Field ;
Name=Invoice3;
CaptionML=[ENU=Undefined Quantity to Invoice;
ESP=Cant. no definida a facturar];
ToolTipML=[ENU=Specifies the difference between the quantity that
can be selected for the document line (which is shown in the Selectable field) and
the quantity that you have selected in this window (shown in the Selected field).
If you have specified more item tracking quantity than is required on the document
line, this field shows the overflow quantity as a negative number in red.;
ESP=Especifica la diferencia entre la cantidad que se
puede seleccionar para la l¡nea del documento (que aparece en el campo
Seleccionable) y la cantidad que se ha seleccionado en esta ventana (mostrada en el
campo Selecc.). Si ha especificado m s cantidad de seguimiento de producto que la
necesaria en la l¡nea del documento, este campo mostrar la cantidad excedente como
un n£mero negativo en rojo.];
ApplicationArea=#ItemTracking;
DecimalPlaces=2:5;
BlankZero=Yes;
SourceExpr=UndefinedQtyArray[3];
Visible=Invoice3Visible;
Editable=FALSE }

{ 82 ;1 ;Group }

{ 84 ;2 ;Field ;
Lookup=Yes;
CaptionML=[ENU=Item Tracking Code;
ESP=C¢d. seguim. prod.];
ToolTipML=[ENU=Specifies the transferred item tracking lines.;
ESP=Especifica las l¡neas de seguimiento de productos
transferidos.];
ApplicationArea=#ItemTracking;
SourceExpr=ItemTrackingCode.Code;
Editable=FALSE;
OnLookup=BEGIN
PAGE.RUNMODAL(0,ItemTrackingCode);
END;
}

{ 85 ;2 ;Field ;
CaptionML=[ENU=Description;
ESP=Descripci¢n];
ToolTipML=[ENU=Specifies the description of what is being tracked.;
ESP=Especifica la descripci¢n de lo que se realiza un
seguimiento.];
ApplicationArea=#ItemTracking;
SourceExpr=ItemTrackingCode.Description;
Editable=FALSE }

{ 1 ;1 ;Group ;
GroupType=Repeater }

{ 61 ;2 ;Field ;
Name=AvailabilitySerialNo;
CaptionML=[ENU=Availability, Serial No.;
ESP=Disponibilidad, N§ Serie];
ToolTipML=[ENU=Specifies a warning icon if the sum of the
quantities of the item in outbound documents is greater than the serial number
quantity in inventory.;
ESP=Especifica un icono de advertencia si la suma de las
cantidades del producto que figuran en los documentos de salida es mayor que la
cantidad del n£mero de serie del inventario.];
ApplicationArea=#ItemTracking;
SourceExpr=TrackingAvailable(Rec,0);
Editable=False;
OnDrillDown=BEGIN
LookupAvailable(0);
END;
}

{ 22 ;2 ;Field ;
ToolTipML=[ENU=Specifies the serial number associated with the
entry.;
ESP=Especifica el n£mero de serie asociado al
movimiento.];
ApplicationArea=#ItemTracking;
SourceExpr="Serial No.";
Editable=SerialNoEditable;
OnValidate=BEGIN
SerialNoOnAfterValidate;
END;

OnAssistEdit=VAR
MaxQuantity@1001 : Decimal;
BEGIN
OnBeforeSerialNoAssistEdit(Rec,xRec);

MaxQuantity := UndefinedQtyArray[1];

"Bin Code" := ForBinCode;


ItemTrackingDataCollection.AssistEditTrackingNo(Rec,
(CurrentSignFactor * SourceQuantityArray[1] < 0)
AND NOT
InsertIsBlocked,CurrentSignFactor,0,MaxQuantity);
"Bin Code" := '';
CurrPage.UPDATE;
END;

ImplicitType=Code50 }

{ 10 ;2 ;Field ;
ToolTipML=[ENU=Specifies a new serial number that will take the
place of the serial number in the Serial No. field.;
ESP=Especifica un n£mero de serie nuevo que sustituir
al n£mero de serie que aparece en el campo N.§ serie.];
ApplicationArea=#ItemTracking;
SourceExpr="New Serial No.";
Visible=NewSerialNoVisible;
Editable=NewSerialNoEditable;
ImplicitType=Code50 }

{ 56 ;2 ;Field ;
Name=AvailabilityLotNo;
CaptionML=[ENU=Availability, Lot No.;
ESP=Disponibilidad, N§ Lote];
ToolTipML=[ENU=Specifies a warning icon if the sum of the
quantities of the item in outbound documents is greater than the lot number
quantity in inventory.;
ESP=Especifica un icono de advertencia si la suma de las
cantidades del producto que figuran en los documentos de salida es mayor que la
cantidad del n£mero de lote del inventario.];
ApplicationArea=#ItemTracking;
SourceExpr=TrackingAvailable(Rec,1);
Editable=False;
OnDrillDown=BEGIN
LookupAvailable(1);
END;
}

{ 24 ;2 ;Field ;
ToolTipML=[ENU=Specifies the lot number of the item being handled
for the associated document line.;
ESP=Especifica el n£mero de lote del producto que se
est manipulando para la l¡nea de documento asociada.];
ApplicationArea=#ItemTracking;
SourceExpr="Lot No.";
Editable=LotNoEditable;
OnValidate=BEGIN
LotNoOnAfterValidate;
END;

OnAssistEdit=VAR
MaxQuantity@1001 : Decimal;
BEGIN
OnBeforeLotNoAssistEdit(Rec,xRec);

MaxQuantity := UndefinedQtyArray[1];

"Bin Code" := ForBinCode;


ItemTrackingDataCollection.AssistEditTrackingNo(Rec,
(CurrentSignFactor * SourceQuantityArray[1] < 0)
AND NOT
InsertIsBlocked,CurrentSignFactor,1,MaxQuantity);
"Bin Code" := '';
CurrPage.UPDATE;
END;

ImplicitType=Code50 }

{ 46 ;2 ;Field ;
ToolTipML=[ENU=Specifies a new lot number that will take the place
of the lot number in the Lot No. field.;
ESP=Especifica un n£mero de lote nuevo que sustituir al
n£mero de lote que aparece en el campo N.§ lote.];
ApplicationArea=#ItemTracking;
SourceExpr="New Lot No.";
Visible=NewLotNoVisible;
Editable=NewLotNoEditable;
ImplicitType=Code50 }

{ 53 ;2 ;Field ;
ToolTipML=[ENU=Specifies the expiration date, if any, of the item
carrying the item tracking number.;
ESP=Especifica la fecha de caducidad, si la hay, del
producto que incluye el n£mero de seguimiento de producto.];
ApplicationArea=#ItemTracking;
SourceExpr="Expiration Date";
Visible=FALSE;
Editable=ExpirationDateEditable;
OnValidate=BEGIN
CurrPage.UPDATE;
END;
ImplicitType=Date }

{ 75 ;2 ;Field ;
ToolTipML=[ENU=Specifies a new expiration date.;
ESP=Especifica una nueva fecha de caducidad.];
ApplicationArea=#ItemTracking;
SourceExpr="New Expiration Date";
Visible=NewExpirationDateVisible;
Editable=NewExpirationDateEditable;
ImplicitType=Date }

{ 48 ;2 ;Field ;
ToolTipML=[ENU=Specifies that a warranty date must be entered
manually.;
ESP=Especifica que la fecha de garant¡a debe escribirse
manualmente.];
ApplicationArea=#ItemTracking;
SourceExpr="Warranty Date";
Visible=FALSE;
Editable=WarrantyDateEditable;
ImplicitType=Date }

{ 2 ;2 ;Field ;
ToolTipML=[ENU=Specifies the number of the item associated with the
entry.;
ESP=Especifica el n£mero del producto asociado al
movimiento.];
ApplicationArea=#ItemTracking;
SourceExpr="Item No.";
Visible=FALSE;
Editable=ItemNoEditable;
ImplicitType=Code20 }

{ 4 ;2 ;Field ;
ToolTipML=[ENU=Specifies the variant of the item on the line.;
ESP=Especifica la variante del producto que figura en la
l¡nea.];
ApplicationArea=#Planning;
SourceExpr="Variant Code";
Visible=FALSE;
Editable=VariantCodeEditable;
ImplicitType=Code10 }

{ 6 ;2 ;Field ;
ToolTipML=[ENU=Specifies the description of the entry.;
ESP=Especifica la descripci¢n del movimiento.];
ApplicationArea=#ItemTracking;
SourceExpr=Description;
Visible=FALSE;
Editable=DescriptionEditable;
ImplicitType=Text100 }

{ 8 ;2 ;Field ;
ToolTipML=[ENU=Specifies the location code for the entry.;
ESP=Especifica el c¢digo de almac‚n del movimiento.];
ApplicationArea=#ItemTracking;
SourceExpr="Location Code";
Visible=FALSE;
Editable=LocationCodeEditable;
ImplicitType=Code10 }

{ 12 ;2 ;Field ;
ToolTipML=[ENU=Specifies the quantity on the line expressed in base
units of measure.;
ESP=Especifica la cantidad de la l¡nea expresada en
unidades de medida base.];
ApplicationArea=#ItemTracking;
SourceExpr="Quantity (Base)";
Editable=QuantityBaseEditable;
OnValidate=BEGIN
QuantityBaseOnValidate;
QuantityBaseOnAfterValidate;
END;

ImplicitType=Decimal }

{ 14 ;2 ;Field ;
ToolTipML=[ENU=Specifies the quantity that you want to handle in
the base unit of measure.;
ESP=Especifica la cantidad que desea manipular expresada
en la unidad de medida base.];
ApplicationArea=#ItemTracking;
SourceExpr="Qty. to Handle (Base)";
Visible=QtyToHandleBaseVisible;
Editable=QtyToHandleBaseEditable;
OnValidate=BEGIN
QtytoHandleBaseOnAfterValidate;
END;

ImplicitType=Decimal }

{ 16 ;2 ;Field ;
ToolTipML=[ENU=Specifies how many of the items, in base units of
measure, are scheduled for invoicing.;
ESP=Especifica la cantidad de productos, expresada en
unidades de medida base, programados para facturaci¢n.];
ApplicationArea=#ItemTracking;
SourceExpr="Qty. to Invoice (Base)";
Visible=QtyToInvoiceBaseVisible;
Editable=QtyToInvoiceBaseEditable;
OnValidate=BEGIN
QtytoInvoiceBaseOnAfterValidat;
END;

ImplicitType=Decimal }

{ 18 ;2 ;Field ;
ToolTipML=[ENU=Specifies the quantity of serial/lot numbers shipped
or received for the associated document line, expressed in base units of measure.;
ESP=Especifica la cantidad de n£meros de serie y lote
enviados o recibidos con relaci¢n a la l¡nea de documento asociada, expresada en
unidades de medida base.];
ApplicationArea=#ItemTracking;
SourceExpr="Quantity Handled (Base)";
Visible=FALSE;
ImplicitType=Decimal }
{ 20 ;2 ;Field ;
ToolTipML=[ENU=Specifies the quantity of serial/lot numbers that
are invoiced with the associated document line, expressed in base units of
measure.;
ESP=Especifica la cantidad de n£meros de serie o lote
que se facturan con la l¡nea de documento asociada, expresada en unidades de medida
base.];
ApplicationArea=#ItemTracking;
SourceExpr="Quantity Invoiced (Base)";
Visible=FALSE;
ImplicitType=Decimal }

{ 3 ;2 ;Field ;
ToolTipML=[ENU=Specifies the number of the item ledger entry that
the document or journal line is applied to.;
ESP=Especifica el n£mero del movimiento de producto en
el que se liquida la l¡nea de documento o diario.];
ApplicationArea=#ItemTracking;
SourceExpr="Appl.-to Item Entry";
Visible=ApplToItemEntryVisible;
ImplicitType=Integer }

{ 80 ;2 ;Field ;
ToolTipML=[ENU=Specifies the number of the item ledger entry that
the document or journal line is applied from.;
ESP=Especifica el n£mero del movimiento de producto
desde el que se liquida la l¡nea de documento o diario.];
ApplicationArea=#ItemTracking;
SourceExpr="Appl.-from Item Entry";
Visible=ApplFromItemEntryVisible;
ImplicitType=Integer }

}
CODE
{
VAR
xTempItemTrackingLine@1009 : TEMPORARY Record 336;
TotalItemTrackingLine@1003 : Record 336;
TempItemTrackLineInsert@1054 : TEMPORARY Record 336;
TempItemTrackLineModify@1055 : TEMPORARY Record 336;
TempItemTrackLineDelete@1056 : TEMPORARY Record 336;
TempItemTrackLineReserv@1060 : TEMPORARY Record 336;
Item@1004 : Record 27;
ItemTrackingCode@1005 : Record 6502;
TempReservEntry@1015 : TEMPORARY Record 337;
NoSeriesMgt@1030 : Codeunit 396;
ItemTrackingMgt@1020 : Codeunit 6500;
ReservEngineMgt@1034 : Codeunit 99000831;
ItemTrackingDataCollection@1058 : Codeunit 6501;
UndefinedQtyArray@1019 : ARRAY [3] OF Decimal;
SourceQuantityArray@1011 : ARRAY [5] OF Decimal;
QtyPerUOM@1021 : Decimal;
QtyToAddAsBlank@1033 : Decimal;
CurrentSignFactor@1012 : Integer;
Text002@1014 : TextConst 'ENU=Quantity must be %1.;ESP=Cantidad debe ser
%1.';
Text003@1001 : TextConst 'ENU=negative;ESP=negativo';
Text004@1016 : TextConst 'ENU=positive;ESP=positivo';
LastEntryNo@1008 : Integer;
CurrentSourceType@1048 : Integer;
SecondSourceID@1035 : Integer;
IsAssembleToOrder@1053 : Boolean;
ExpectedReceiptDate@1010 : Date;
ShipmentDate@1017 : Date;
Text005@1018 : TextConst 'ENU=Error when writing to database.;ESP=Error al
escribir en la base de datos.';
Text006@1100225000 : TextConst 'ENU=The corrections cannot be saved as excess
quantity has been defined.\Close the form anyway?;ESP=No se pueden guardar las
correcciones porque existe un exceso de cant.\�Desea cerrar el formulario?';
Text007@1023 : TextConst 'ENU=Another user has modified the item tracking
data since it was retrieved from the database.\Start again.;ESP=Otro usuario ha
modificado datos seguim. prod. desde que se recuper¢ de la base de datos.\Empiece
otra vez.';
CurrentEntryStatus@1024 : 'Reservation,Tracking,Surplus,Prospect';
FormRunMode@1026 : ',Reclass,Combined Ship/Rcpt,Drop Shipment,Transfer';
InsertIsBlocked@1025 : Boolean;
Text008@1028 : TextConst 'ENU=The quantity to create must be an
integer.;ESP=La cantidad a crear debe ser un n§ entero.';
Text009@1100225001 : TextConst 'ENU=The quantity to create must be
positive.;ESP=La cant. a crear debe ser positiva.';
Text011@1031 : TextConst 'ENU=Tracking specification with Serial No. %1 and
Lot No. %2 already exists.;ESP=La especificaci¢n de seguimiento con N§ serie %1 y
N§ lote %2 ya existe.';
Text012@1032 : TextConst 'ENU=Tracking specification with Serial No. %1
already exists.;ESP=La especificaci¢n de seguimiento con N§ serie %1 ya existe.';
DeleteIsBlocked@1036 : Boolean;
Text014@1100225002 : TextConst 'ENU=The total item tracking quantity %1
exceeds the %2 quantity %3.\The changes cannot be saved to the database.;ESP=La
cant. seguim. prod. total %1 excede el %2 cantidad %3.\No se pueden guardar los
cambios en la base de datos.';
Text015@1038 : TextConst 'ENU=Do you want to synchronize item tracking on the
line with item tracking on the related drop shipment %1?;ESP=¨Quiere sincronizar el
seguim. de prod. en la l¡nea con el seguim. de prod. del env¡o directo relacionado
%1?';
BlockCommit@1041 : Boolean;
IsCorrection@1046 : Boolean;
CurrentPageIsOpen@1029 : Boolean;
CalledFromSynchWhseItemTrkg@1000 : Boolean;
Inbound@1059 : Boolean;
CurrentSourceCaption@1047 : Text[255];
CurrentSourceRowID@1039 : Text[250];
SecondSourceRowID@1040 : Text[250];
Text016@1044 : TextConst 'ENU=purchase order line;ESP=l¡nea pedido compra';
Text017@1045 : TextConst 'ENU=sales order line;ESP=l¡n. pedido venta';
Text018@1057 : TextConst 'ENU=Saving item tracking line changes;ESP=Guardando
cambios de l¡nea de seguim. prod.';
ForBinCode@1043 : Code[20];
Text019@1013 : TextConst 'ENU=There are availability warnings on one or more
lines.\Close the form anyway?;ESP=Existen advertencias de disponibilidad en una o
m s l¡neas.\¨Desea cerrar el formulario de todas maneras?';
Text020@1002 : TextConst 'ENU=Placeholder;ESP=Marcador de posici¢n';
ApplFromItemEntryVisible@19038403 : Boolean INDATASET;
ApplToItemEntryVisible@1050 : Boolean INDATASET;
ItemNoEditable@19055681 : Boolean INDATASET;
VariantCodeEditable@19003611 : Boolean INDATASET;
LocationCodeEditable@19048234 : Boolean INDATASET;
Handle1Visible@19064734 : Boolean INDATASET;
Handle2Visible@19067235 : Boolean INDATASET;
Handle3Visible@19058196 : Boolean INDATASET;
QtyToHandleBaseVisible@19036968 : Boolean INDATASET;
Invoice1Visible@19017525 : Boolean INDATASET;
Invoice2Visible@19053429 : Boolean INDATASET;
Invoice3Visible@19043061 : Boolean INDATASET;
QtyToInvoiceBaseVisible@19048430 : Boolean INDATASET;
NewSerialNoVisible@19031772 : Boolean INDATASET;
NewLotNoVisible@19006815 : Boolean INDATASET;
NewExpirationDateVisible@19041101 : Boolean INDATASET;
ButtonLineReclassVisible@19076729 : Boolean INDATASET;
ButtonLineVisible@19043118 : Boolean INDATASET;
FunctionsSupplyVisible@19000825 : Boolean INDATASET;
FunctionsDemandVisible@19014220 : Boolean INDATASET;
InboundIsSet@1006 : Boolean;
QtyToHandleBaseEditable@19075992 : Boolean INDATASET;
QtyToInvoiceBaseEditable@19015223 : Boolean INDATASET;
QuantityBaseEditable@19065426 : Boolean INDATASET;
SerialNoEditable@19056272 : Boolean INDATASET;
LotNoEditable@19059315 : Boolean INDATASET;
DescriptionEditable@19061412 : Boolean INDATASET;
NewSerialNoEditable@19030864 : Boolean INDATASET;
NewLotNoEditable@19020282 : Boolean INDATASET;
NewExpirationDateEditable@19056874 : Boolean INDATASET;
ExpirationDateEditable@19023942 : Boolean INDATASET;
WarrantyDateEditable@19022604 : Boolean INDATASET;
ExcludePostedEntries@1007 : Boolean;
ProdOrderLineHandling@1052 : Boolean;
DifferentExpDateMsg@1042 : TextConst '@@@="%1 = Lot no., %2 = Item expiration
date (Example: A tracking specification exists for lot number ''L001'' and
expiration date 25.01.2019.)";ENU=A tracking specification exists for lot number %1
and expiration date %2. All items with this lot number must have the same
expiration date.;ESP=Existe una especificaci¢n de seguimiento para el n£mero de
lote %1 y la fecha de caducidad %2. Todos los productos incluidos en este n£mero de
lote deben tener la misma fecha de caducidad.';
ISDocStatus@1100409000 : ' ,Valid,Exists';
GlobalIsReclass@1000000000 : Boolean;

[External]
[LineStart(9787)]
PROCEDURE SetFormRunMode@19(Mode@1000 : ',Reclass,Combined Ship/Rcpt,Drop
Shipment');
BEGIN
FormRunMode := Mode;
END;

[External]
[LineStart(9790)]
PROCEDURE SetSourceSpec@1(TrackingSpecification@1000 : Record
336;AvailabilityDate@1002 : Date);
VAR
ReservEntry@1001 : Record 337;
TempTrackingSpecification@1005 : TEMPORARY Record 336;
TempTrackingSpecification2@1006 : TEMPORARY Record 336;
CreateReservEntry@1004 : Codeunit 99000830;
Controls@1003 : 'Handle,Invoice,Quantity,Reclass,Tracking';
BEGIN
OnBeforeSetSourceSpec(TrackingSpecification,ReservEntry);

GetItem(TrackingSpecification."Item No.");
ForBinCode := TrackingSpecification."Bin Code";
SetFilters(TrackingSpecification);
TempTrackingSpecification.DELETEALL;
TempItemTrackLineInsert.DELETEALL;
TempItemTrackLineModify.DELETEALL;
TempItemTrackLineDelete.DELETEALL;

TempReservEntry.DELETEALL;
LastEntryNo := 0;
IF ItemTrackingMgt.IsOrderNetworkEntity(TrackingSpecification."Source Type",
TrackingSpecification."Source Subtype") AND NOT (FormRunMode =
FormRunMode::"Drop Shipment")
THEN
CurrentEntryStatus := CurrentEntryStatus::Surplus
ELSE
CurrentEntryStatus := CurrentEntryStatus::Prospect;

// Set controls for Qty to handle:


SetControls(Controls::Handle,GetHandleSource(TrackingSpecification));
// Set controls for Qty to Invoice:
SetControls(Controls::Invoice,GetInvoiceSource(TrackingSpecification));

SetControls(Controls::Reclass,FormRunMode = FormRunMode::Reclass);

IF FormRunMode = FormRunMode::"Combined Ship/Rcpt" THEN


SetControls(Controls::Tracking,FALSE);
IF ItemTrackingMgt.ItemTrkgIsManagedByWhse(
TrackingSpecification."Source Type",
TrackingSpecification."Source Subtype",
TrackingSpecification."Source ID",
TrackingSpecification."Source Prod. Order Line",
TrackingSpecification."Source Ref. No.",
TrackingSpecification."Location Code",
TrackingSpecification."Item No.")
THEN BEGIN
SetControls(Controls::Quantity,FALSE);
QtyToHandleBaseEditable := TRUE;
DeleteIsBlocked := TRUE;
END;

ReservEntry."Source Type" := TrackingSpecification."Source Type";


ReservEntry."Source Subtype" := TrackingSpecification."Source Subtype";
CurrentSignFactor := CreateReservEntry.SignFactor(ReservEntry);
CurrentSourceCaption := ReservEntry.TextCaption;
CurrentSourceType := ReservEntry."Source Type";

IF CurrentSignFactor < 0 THEN BEGIN


ExpectedReceiptDate := 0D;
ShipmentDate := AvailabilityDate;
END ELSE BEGIN
ExpectedReceiptDate := AvailabilityDate;
ShipmentDate := 0D;
END;

SourceQuantityArray[1] := TrackingSpecification."Quantity (Base)";


SourceQuantityArray[2] := TrackingSpecification."Qty. to Handle (Base)";
SourceQuantityArray[3] := TrackingSpecification."Qty. to Invoice (Base)";
SourceQuantityArray[4] := TrackingSpecification."Quantity Handled (Base)";
SourceQuantityArray[5] := TrackingSpecification."Quantity Invoiced (Base)";
QtyPerUOM := TrackingSpecification."Qty. per Unit of Measure";

ReservEntry.SetSourceFilter(
TrackingSpecification."Source Type",TrackingSpecification."Source Subtype",
TrackingSpecification."Source ID",TrackingSpecification."Source Ref.
No.",TRUE);
ReservEntry.SetSourceFilter2(
TrackingSpecification."Source Batch Name",TrackingSpecification."Source
Prod. Order Line");
ReservEntry.SETRANGE("Untracked Surplus",FALSE);
// Transfer Receipt gets special treatment:
IF (TrackingSpecification."Source Type" = DATABASE::"Transfer Line") AND
(FormRunMode <> FormRunMode::Transfer) AND
(TrackingSpecification."Source Subtype" = 1)
THEN BEGIN
ReservEntry.SETRANGE("Source Subtype",0);

AddReservEntriesToTempRecSet(ReservEntry,TempTrackingSpecification2,TRUE,8421504);
ReservEntry.SETRANGE("Source Subtype",1);
ReservEntry.SETRANGE("Source Prod. Order
Line",TrackingSpecification."Source Ref. No.");
ReservEntry.SETRANGE("Source Ref. No.");
DeleteIsBlocked := TRUE;
SetControls(Controls::Quantity,FALSE);
END;

AddReservEntriesToTempRecSet(ReservEntry,TempTrackingSpecification,FALSE,0);

TempReservEntry.COPYFILTERS(ReservEntry);

TrackingSpecification.SetSourceFilter(
TrackingSpecification."Source Type",TrackingSpecification."Source Subtype",
TrackingSpecification."Source ID",TrackingSpecification."Source Ref.
No.",TRUE);
TrackingSpecification.SetSourceFilter2(
TrackingSpecification."Source Batch Name",TrackingSpecification."Source
Prod. Order Line");

IF TrackingSpecification.FINDSET THEN
REPEAT
TempTrackingSpecification := TrackingSpecification;
TempTrackingSpecification.INSERT;
UNTIL TrackingSpecification.NEXT = 0;

// Data regarding posted quantities on transfers is collected from Item


Ledger Entries:
IF TrackingSpecification."Source Type" = DATABASE::"Transfer Line" THEN

CollectPostedTransferEntries(TrackingSpecification,TempTrackingSpecification);

// Data regarding posted quantities on assembly orders is collected from Item


Ledger Entries:
IF NOT ExcludePostedEntries THEN
IF (TrackingSpecification."Source Type" = DATABASE::"Assembly Line") OR
(TrackingSpecification."Source Type" = DATABASE::"Assembly Header")
THEN

CollectPostedAssemblyEntries(TrackingSpecification,TempTrackingSpecification);
// Data regarding posted output quantities on prod.orders is collected from
Item Ledger Entries:
IF TrackingSpecification."Source Type" = DATABASE::"Prod. Order Line" THEN
IF TrackingSpecification."Source Subtype" = 3 THEN

CollectPostedOutputEntries(TrackingSpecification,TempTrackingSpecification);

// If run for Drop Shipment a RowID is prepared for synchronisation:


IF FormRunMode = FormRunMode::"Drop Shipment" THEN
CurrentSourceRowID :=
ItemTrackingMgt.ComposeRowID(TrackingSpecification."Source Type",
TrackingSpecification."Source Subtype",TrackingSpecification."Source
ID",
TrackingSpecification."Source Batch Name",TrackingSpecification."Source
Prod. Order Line",
TrackingSpecification."Source Ref. No.");

// Synchronization of outbound transfer order:


IF (TrackingSpecification."Source Type" = DATABASE::"Transfer Line") AND
(TrackingSpecification."Source Subtype" = 0)
THEN BEGIN
BlockCommit := TRUE;
CurrentSourceRowID :=
ItemTrackingMgt.ComposeRowID(TrackingSpecification."Source Type",
TrackingSpecification."Source Subtype",TrackingSpecification."Source
ID",
TrackingSpecification."Source Batch Name",TrackingSpecification."Source
Prod. Order Line",
TrackingSpecification."Source Ref. No.");
SecondSourceRowID :=
ItemTrackingMgt.ComposeRowID(TrackingSpecification."Source Type",
1,TrackingSpecification."Source ID",
TrackingSpecification."Source Batch Name",TrackingSpecification."Source
Prod. Order Line",
TrackingSpecification."Source Ref. No.");
FormRunMode := FormRunMode::Transfer;
END;

AddToGlobalRecordSet(TempTrackingSpecification);
AddToGlobalRecordSet(TempTrackingSpecification2);
CalculateSums;

ItemTrackingDataCollection.SetCurrentBinAndItemTrkgCode(ForBinCode,ItemTrackingCode
);
ItemTrackingDataCollection.RetrieveLookupData(Rec,FALSE);

FunctionsDemandVisible := CurrentSignFactor * SourceQuantityArray[1] < 0;


FunctionsSupplyVisible := NOT FunctionsDemandVisible;

OnAfterSetSourceSpec(TrackingSpecification,Rec,AvailabilityDate,BlockCommit);
END;

[External]
[LineStart(9941)]
PROCEDURE SetSecondSourceQuantity@1026(SecondSourceQuantityArray@1000 : ARRAY
[3] OF Decimal);
VAR
Controls@1001 : 'Handle,Invoice';
BEGIN
OnBeforeSetSecondSourceQuantity(SecondSourceQuantityArray);

CASE SecondSourceQuantityArray[1] OF
DATABASE::"Warehouse Receipt Line",DATABASE::"Warehouse Shipment Line":
BEGIN
SourceQuantityArray[2] := SecondSourceQuantityArray[2]; // "Qty. to
Handle (Base)"
SourceQuantityArray[3] := SecondSourceQuantityArray[3]; // "Qty. to
Invoice (Base)"
SetControls(Controls::Invoice,FALSE);
END;
ELSE
EXIT;
END;

CalculateSums;
END;

[External]
[LineStart(9957)]
PROCEDURE SetSecondSourceRowID@32(RowID@1000 : Text[250]);
BEGIN
SecondSourceRowID := RowID;
END;

[LineStart(9960)]
LOCAL PROCEDURE AddReservEntriesToTempRecSet@15(VAR ReservEntry@1000 : Record
337;VAR TempTrackingSpecification@1001 : TEMPORARY Record 336;SwapSign@1002 :
Boolean;Color@1004 : Integer);
VAR
FromReservEntry@1003 : Record 337;
AddTracking@1005 : Boolean;
BEGIN
IF ReservEntry.FINDSET THEN
REPEAT
IF Color = 0 THEN BEGIN
TempReservEntry := ReservEntry;
TempReservEntry.INSERT;
END;
IF ReservEntry.TrackingExists THEN BEGIN
AddTracking := TRUE;
IF SecondSourceID = DATABASE::"Warehouse Shipment Line" THEN
IF FromReservEntry.GET(ReservEntry."Entry No.",NOT
ReservEntry.Positive) THEN
AddTracking := (FromReservEntry."Source Type" = DATABASE::"Assembly
Header") = IsAssembleToOrder
ELSE
AddTracking := NOT IsAssembleToOrder;

IF AddTracking THEN BEGIN


TempTrackingSpecification.TRANSFERFIELDS(ReservEntry);
// Ensure uniqueness of Entry No. by making it negative:
TempTrackingSpecification."Entry No." *= -1;
IF SwapSign THEN
TempTrackingSpecification."Quantity (Base)" *= -1;
IF Color <> 0 THEN BEGIN
TempTrackingSpecification."Quantity Handled (Base)" :=
TempTrackingSpecification."Quantity (Base)";
TempTrackingSpecification."Quantity Invoiced (Base)" :=
TempTrackingSpecification."Quantity (Base)";
TempTrackingSpecification."Qty. to Handle (Base)" := 0;
TempTrackingSpecification."Qty. to Invoice (Base)" := 0;
END;
TempTrackingSpecification."Buffer Status" := Color;

OnAddReservEntriesToTempRecSetOnBeforeInsert(TempTrackingSpecification,ReservEntry)
;
TempTrackingSpecification.INSERT;
END;
END;
UNTIL ReservEntry.NEXT = 0;
END;

[LineStart(9996)]
LOCAL PROCEDURE AddToGlobalRecordSet@17(VAR TempTrackingSpecification@1000 :
TEMPORARY Record 336);
VAR
ExpDate@1001 : Date;
EntriesExist@1002 : Boolean;
BEGIN
TempTrackingSpecification.SETCURRENTKEY("Lot No.","Serial No.");
IF TempTrackingSpecification.FIND('-') THEN
REPEAT

TempTrackingSpecification.SetTrackingFilterFromSpec(TempTrackingSpecification);
TempTrackingSpecification.CALCSUMS("Quantity (Base)","Qty. to Handle
(Base)",
"Qty. to Invoice (Base)","Quantity Handled (Base)","Quantity Invoiced
(Base)");
IF TempTrackingSpecification."Quantity (Base)" <> 0 THEN BEGIN
Rec := TempTrackingSpecification;
"Quantity (Base)" *= CurrentSignFactor;
"Qty. to Handle (Base)" *= CurrentSignFactor;
"Qty. to Invoice (Base)" *= CurrentSignFactor;
"Quantity Handled (Base)" *= CurrentSignFactor;
"Quantity Invoiced (Base)" *= CurrentSignFactor;
"Qty. to Handle" :=
CalcQty("Qty. to Handle (Base)");
"Qty. to Invoice" :=
CalcQty("Qty. to Invoice (Base)");
"Entry No." := NextEntryNo;

ExpDate := ItemTrackingMgt.ExistingExpirationDate(
"Item No.","Variant Code",
"Lot No.","Serial No.",FALSE,EntriesExist);

IF ExpDate <> 0D THEN BEGIN


"Expiration Date" := ExpDate;
"Buffer Status2" := "Buffer Status2"::"ExpDate blocked";
END;

OnBeforeAddToGlobalRecordSet(Rec,EntriesExist);
INSERT;

IF "Buffer Status" = 0 THEN BEGIN


xTempItemTrackingLine := Rec;
xTempItemTrackingLine.INSERT;
END;
END;

TempTrackingSpecification.FIND('+');
TempTrackingSpecification.ClearTrackingFilter;
UNTIL TempTrackingSpecification.NEXT = 0;
END;

[LineStart(10038)]
LOCAL PROCEDURE SetControls@13(Controls@1000 :
'Handle,Invoice,Quantity,Reclass,Tracking';SetAccess@1001 : Boolean);
BEGIN
CASE Controls OF
Controls::Handle:
BEGIN
Handle1Visible := SetAccess;
Handle2Visible := SetAccess;
Handle3Visible := SetAccess;
QtyToHandleBaseVisible := SetAccess;
QtyToHandleBaseEditable := SetAccess;
END;
Controls::Invoice:
BEGIN
Invoice1Visible := SetAccess;
Invoice2Visible := SetAccess;
Invoice3Visible := SetAccess;
QtyToInvoiceBaseVisible := SetAccess;
QtyToInvoiceBaseEditable := SetAccess;
END;
Controls::Quantity:
BEGIN
QuantityBaseEditable := SetAccess;
SerialNoEditable := SetAccess;
LotNoEditable := SetAccess;
DescriptionEditable := SetAccess;
InsertIsBlocked := TRUE;
END;
Controls::Reclass:
BEGIN
NewSerialNoVisible := SetAccess;
NewSerialNoEditable := SetAccess;
NewLotNoVisible := SetAccess;
NewLotNoEditable := SetAccess;
NewExpirationDateVisible := SetAccess;
NewExpirationDateEditable := SetAccess;
ButtonLineReclassVisible := SetAccess;
ButtonLineVisible := NOT SetAccess;
END;
Controls::Tracking:
BEGIN
SerialNoEditable := SetAccess;
LotNoEditable := SetAccess;
ExpirationDateEditable := SetAccess;
WarrantyDateEditable := SetAccess;
InsertIsBlocked := SetAccess;
END;
END;

OnAfterSetControls(ItemTrackingCode,Controls,SetAccess);
END;

[LineStart(10087)]
LOCAL PROCEDURE GetItem@3(ItemNo@1000 : Code[20]);
BEGIN
IF Item."No." <> ItemNo THEN BEGIN
Item.GET(ItemNo);
Item.TESTFIELD("Item Tracking Code");
IF ItemTrackingCode.Code <> Item."Item Tracking Code" THEN
ItemTrackingCode.GET(Item."Item Tracking Code");
END;
END;

[LineStart(10095)]
LOCAL PROCEDURE SetFilters@12(TrackingSpecification@1000 : Record 336);
BEGIN
FILTERGROUP := 2;
SETCURRENTKEY("Source ID","Source Type","Source Subtype","Source Batch
Name","Source Prod. Order Line","Source Ref. No.");
SETRANGE("Source ID",TrackingSpecification."Source ID");
SETRANGE("Source Type",TrackingSpecification."Source Type");
SETRANGE("Source Subtype",TrackingSpecification."Source Subtype");
SETRANGE("Source Batch Name",TrackingSpecification."Source Batch Name");
IF (TrackingSpecification."Source Type" = DATABASE::"Transfer Line") AND
(TrackingSpecification."Source Subtype" = 1)
THEN BEGIN
SETFILTER("Source Prod. Order Line",'0 | ' +
FORMAT(TrackingSpecification."Source Ref. No."));
SETRANGE("Source Ref. No.");
END ELSE BEGIN
SETRANGE("Source Prod. Order Line",TrackingSpecification."Source Prod.
Order Line");
SETRANGE("Source Ref. No.",TrackingSpecification."Source Ref. No.");
END;
SETRANGE("Item No.",TrackingSpecification."Item No.");
SETRANGE("Location Code",TrackingSpecification."Location Code");
SETRANGE("Variant Code",TrackingSpecification."Variant Code");
FILTERGROUP := 0;
END;

[LineStart(10116)]
LOCAL PROCEDURE CheckLine@4(TrackingLine@1000 : Record 336);
BEGIN
IF TrackingLine."Quantity (Base)" * SourceQuantityArray[1] < 0 THEN
IF SourceQuantityArray[1] < 0 THEN
ERROR(Text002,Text003)
ELSE
ERROR(Text002,Text004);
END;

[LineStart(10123)]
LOCAL PROCEDURE CalculateSums@2();
VAR
xTrackingSpec@1000 : Record 336;
BEGIN
xTrackingSpec.COPY(Rec);
RESET;
CALCSUMS("Quantity (Base)",
"Qty. to Handle (Base)",
"Qty. to Invoice (Base)");
TotalItemTrackingLine := Rec;
COPY(xTrackingSpec);

UpdateUndefinedQtyArray;
END;

[LineStart(10134)]
LOCAL PROCEDURE UpdateUndefinedQty@5() : Boolean;
BEGIN
UpdateUndefinedQtyArray;
IF ProdOrderLineHandling THEN // Avoid check for prod.journal lines
EXIT(TRUE);
EXIT(ABS(SourceQuantityArray[1]) >= ABS(TotalItemTrackingLine."Quantity
(Base)"));
END;

[LineStart(10140)]
LOCAL PROCEDURE UpdateUndefinedQtyArray@51();
BEGIN
UndefinedQtyArray[1] := SourceQuantityArray[1] -
TotalItemTrackingLine."Quantity (Base)";
UndefinedQtyArray[2] := SourceQuantityArray[2] - TotalItemTrackingLine."Qty.
to Handle (Base)";
UndefinedQtyArray[3] := SourceQuantityArray[3] - TotalItemTrackingLine."Qty.
to Invoice (Base)";
END;

[LineStart(10145)]
LOCAL PROCEDURE TempRecIsValid@6() OK@1001 : Boolean;
VAR
ReservEntry@1000 : Record 337;
RecordCount@1002 : Integer;
IdenticalArray@1003 : ARRAY [2] OF Boolean;
BEGIN
OK := FALSE;
TempReservEntry.SETCURRENTKEY("Entry No.",Positive);
ReservEntry.SETCURRENTKEY("Source ID","Source Ref. No.","Source Type",
"Source Subtype","Source Batch Name","Source Prod. Order Line");

ReservEntry.COPYFILTERS(TempReservEntry);

IF ReservEntry.FINDSET THEN
REPEAT
IF NOT TempReservEntry.GET(ReservEntry."Entry No.",ReservEntry.Positive)
THEN
EXIT(FALSE);
IF NOT EntriesAreIdentical(ReservEntry,TempReservEntry,IdenticalArray)
THEN
EXIT(FALSE);
RecordCount += 1;
UNTIL ReservEntry.NEXT = 0;

OK := RecordCount = TempReservEntry.COUNT;
END;

[LineStart(10164)]
LOCAL PROCEDURE EntriesAreIdentical@8(VAR ReservEntry1@1000 : Record 337;VAR
ReservEntry2@1002 : Record 337;VAR IdenticalArray@1003 : ARRAY [2] OF Boolean) :
Boolean;
BEGIN
IdenticalArray[1] := (
(ReservEntry1."Entry No." = ReservEntry2."Entry No.")
AND
(ReservEntry1."Item No." = ReservEntry2."Item No.") AND
(ReservEntry1."Location Code" = ReservEntry2."Location
Code") AND
(ReservEntry1."Quantity (Base)" =
ReservEntry2."Quantity (Base)") AND
(ReservEntry1."Reservation Status" =
ReservEntry2."Reservation Status") AND
(ReservEntry1."Creation Date" = ReservEntry2."Creation
Date") AND
(ReservEntry1."Transferred from Entry No." =
ReservEntry2."Transferred from Entry No.") AND
(ReservEntry1."Source Type" = ReservEntry2."Source
Type") AND
(ReservEntry1."Source Subtype" = ReservEntry2."Source
Subtype") AND
(ReservEntry1."Source ID" = ReservEntry2."Source ID")
AND
(ReservEntry1."Source Batch Name" =
ReservEntry2."Source Batch Name") AND
(ReservEntry1."Source Prod. Order Line" =
ReservEntry2."Source Prod. Order Line") AND
(ReservEntry1."Source Ref. No." = ReservEntry2."Source
Ref. No.") AND
(ReservEntry1."Expected Receipt Date" =
ReservEntry2."Expected Receipt Date") AND
(ReservEntry1."Shipment Date" = ReservEntry2."Shipment
Date") AND
(ReservEntry1."Serial No." = ReservEntry2."Serial No.")
AND
(ReservEntry1."Created By" = ReservEntry2."Created By")
AND
(ReservEntry1."Changed By" = ReservEntry2."Changed By")
AND
(ReservEntry1.Positive = ReservEntry2.Positive) AND
(ReservEntry1."Qty. per Unit of Measure" =
ReservEntry2."Qty. per Unit of Measure") AND
(ReservEntry1.Quantity = ReservEntry2.Quantity) AND
(ReservEntry1."Action Message Adjustment" =
ReservEntry2."Action Message Adjustment") AND
(ReservEntry1.Binding = ReservEntry2.Binding) AND
(ReservEntry1."Suppressed Action Msg." =
ReservEntry2."Suppressed Action Msg.") AND
(ReservEntry1."Planning Flexibility" =
ReservEntry2."Planning Flexibility") AND
(ReservEntry1."Lot No." = ReservEntry2."Lot No.") AND
(ReservEntry1."Variant Code" = ReservEntry2."Variant
Code") AND
(ReservEntry1."Quantity Invoiced (Base)" =
ReservEntry2."Quantity Invoiced (Base)"));

IdenticalArray[2] := (
(ReservEntry1.Description = ReservEntry2.Description)
AND
(ReservEntry1."New Serial No." = ReservEntry2."New
Serial No.") AND
(ReservEntry1."New Lot No." = ReservEntry2."New Lot
No.") AND
(ReservEntry1."Expiration Date" =
ReservEntry2."Expiration Date") AND
(ReservEntry1."Warranty Date" = ReservEntry2."Warranty
Date") AND
(ReservEntry1."New Expiration Date" = ReservEntry2."New
Expiration Date"));

OnAfterEntriesAreIdentical(ReservEntry1,ReservEntry2,IdenticalArray);
EXIT(IdenticalArray[1] AND IdenticalArray[2]);
END;

[LineStart(10206)]
LOCAL PROCEDURE QtyToHandleAndInvoiceChanged@14(VAR ReservEntry1@1000 : Record
337;VAR ReservEntry2@1002 : Record 337) : Boolean;
BEGIN
EXIT(
(ReservEntry1."Qty. to Handle (Base)" <> ReservEntry2."Qty. to Handle
(Base)") OR
(ReservEntry1."Qty. to Invoice (Base)" <> ReservEntry2."Qty. to Invoice
(Base)"));
END;

[LineStart(10211)]
LOCAL PROCEDURE NextEntryNo@9() : Integer;
BEGIN
LastEntryNo += 1;
EXIT(LastEntryNo);
END;

[LineStart(10215)]
LOCAL PROCEDURE WriteToDatabase@10();
VAR
Window@1002 : Dialog;
ChangeType@1000 : 'Insert,Modify,Delete';
EntryNo@1001 : Integer;
NoOfLines@1003 : Integer;
i@1004 : Integer;
ModifyLoop@1005 : Integer;
Decrease@1006 : Boolean;
BEGIN
OnBeforeWriteToDatabase(Rec,CurrentPageIsOpen);
IF CurrentPageIsOpen THEN BEGIN
TempReservEntry.LOCKTABLE;
TempRecValid;

IF Item."Order Tracking Policy" = Item."Order Tracking Policy"::None THEN


QtyToAddAsBlank := 0
ELSE
QtyToAddAsBlank := UndefinedQtyArray[1] * CurrentSignFactor;

RESET;
DELETEALL;

Window.OPEN('#1############# @2@@@@@@@@@@@@@@@@@@@@@');
Window.UPDATE(1,Text018);
NoOfLines := TempItemTrackLineInsert.COUNT + TempItemTrackLineModify.COUNT
+ TempItemTrackLineDelete.COUNT;
IF TempItemTrackLineDelete.FIND('-') THEN BEGIN
REPEAT
i := i + 1;
IF i MOD 100 = 0 THEN
Window.UPDATE(2,ROUND(i / NoOfLines * 10000,1));

RegisterChange(TempItemTrackLineDelete,TempItemTrackLineDelete,ChangeType::Delete,F
ALSE);
IF TempItemTrackLineModify.GET(TempItemTrackLineDelete."Entry No.")
THEN
TempItemTrackLineModify.DELETE;
UNTIL TempItemTrackLineDelete.NEXT = 0;
TempItemTrackLineDelete.DELETEALL;
END;

FOR ModifyLoop := 1 TO 2 DO BEGIN


IF TempItemTrackLineModify.FIND('-') THEN
REPEAT
IF xTempItemTrackingLine.GET(TempItemTrackLineModify."Entry No.")
THEN BEGIN
// Process decreases before increases
Decrease := (xTempItemTrackingLine."Quantity (Base)" >
TempItemTrackLineModify."Quantity (Base)");
IF ((ModifyLoop = 1) AND Decrease) OR ((ModifyLoop = 2) AND NOT
Decrease) THEN BEGIN
i := i + 1;
IF (xTempItemTrackingLine."Serial No." <>
TempItemTrackLineModify."Serial No.") OR
(xTempItemTrackingLine."Lot No." <>
TempItemTrackLineModify."Lot No.") OR
(xTempItemTrackingLine."Appl.-from Item Entry" <>
TempItemTrackLineModify."Appl.-from Item Entry") OR
(xTempItemTrackingLine."Appl.-to Item Entry" <>
TempItemTrackLineModify."Appl.-to Item Entry")
THEN BEGIN

RegisterChange(xTempItemTrackingLine,xTempItemTrackingLine,ChangeType::Delete,FALSE
);

RegisterChange(TempItemTrackLineModify,TempItemTrackLineModify,ChangeType::Insert,F
ALSE);
IF (TempItemTrackLineInsert."Quantity (Base)" <>
TempItemTrackLineInsert."Qty. to Handle (Base)") OR
(TempItemTrackLineInsert."Quantity (Base)" <>
TempItemTrackLineInsert."Qty. to Invoice (Base)")
THEN
SetQtyToHandleAndInvoice(TempItemTrackLineInsert);
END ELSE BEGIN

RegisterChange(xTempItemTrackingLine,TempItemTrackLineModify,ChangeType::Modify,FAL
SE);
SetQtyToHandleAndInvoice(TempItemTrackLineModify);
END;
TempItemTrackLineModify.DELETE;
END;
END ELSE BEGIN
i := i + 1;
TempItemTrackLineModify.DELETE;
END;
IF i MOD 100 = 0 THEN
Window.UPDATE(2,ROUND(i / NoOfLines * 10000,1));
UNTIL TempItemTrackLineModify.NEXT = 0;
END;

IF TempItemTrackLineInsert.FIND('-') THEN BEGIN


REPEAT
i := i + 1;
IF i MOD 100 = 0 THEN
Window.UPDATE(2,ROUND(i / NoOfLines * 10000,1));
IF TempItemTrackLineModify.GET(TempItemTrackLineInsert."Entry No.")
THEN
TempItemTrackLineInsert.TRANSFERFIELDS(TempItemTrackLineModify);
IF NOT
RegisterChange(TempItemTrackLineInsert,TempItemTrackLineInsert,ChangeType::Insert,F
ALSE) THEN
ERROR(Text005);
IF (TempItemTrackLineInsert."Quantity (Base)" <>
TempItemTrackLineInsert."Qty. to Handle (Base)") OR
(TempItemTrackLineInsert."Quantity (Base)" <>
TempItemTrackLineInsert."Qty. to Invoice (Base)")
THEN
SetQtyToHandleAndInvoice(TempItemTrackLineInsert);
UNTIL TempItemTrackLineInsert.NEXT = 0;
TempItemTrackLineInsert.DELETEALL;
END;
Window.CLOSE;
END ELSE BEGIN
TempReservEntry.LOCKTABLE;
TempRecValid;

IF Item."Order Tracking Policy" = Item."Order Tracking Policy"::None THEN


QtyToAddAsBlank := 0
ELSE
QtyToAddAsBlank := UndefinedQtyArray[1] * CurrentSignFactor;

RESET;
SETFILTER("Buffer Status",'<>%1',0);
DELETEALL;
RESET;

xTempItemTrackingLine.RESET;
SETCURRENTKEY("Entry No.");
xTempItemTrackingLine.SETCURRENTKEY("Entry No.");
IF xTempItemTrackingLine.FIND('-') THEN
REPEAT
SetTrackingFilterFromSpec(xTempItemTrackingLine);
IF FIND('-') THEN BEGIN
IF RegisterChange(xTempItemTrackingLine,Rec,ChangeType::Modify,FALSE)
THEN BEGIN
EntryNo := xTempItemTrackingLine."Entry No.";
xTempItemTrackingLine := Rec;
xTempItemTrackingLine."Entry No." := EntryNo;
xTempItemTrackingLine.MODIFY;
END;
SetQtyToHandleAndInvoice(Rec);
DELETE;
END ELSE BEGIN
RegisterChange(xTempItemTrackingLine,xTempItemTrackingLine,ChangeType::Delete,FALSE
);
xTempItemTrackingLine.DELETE;
END;
UNTIL xTempItemTrackingLine.NEXT = 0;

RESET;

IF FIND('-') THEN
REPEAT
IF RegisterChange(Rec,Rec,ChangeType::Insert,FALSE) THEN BEGIN
xTempItemTrackingLine := Rec;
xTempItemTrackingLine.INSERT;
END ELSE
ERROR(Text005);
SetQtyToHandleAndInvoice(Rec);
DELETE;
UNTIL NEXT = 0;
END;

UpdateOrderTracking;
ReestablishReservations; // Late Binding

IF NOT BlockCommit THEN


COMMIT;
END;

[LineStart(10350)]
LOCAL PROCEDURE RegisterChange@11(VAR OldTrackingSpecification@1000 : Record
336;VAR NewTrackingSpecification@1001 : Record 336;ChangeType@1002 :
'Insert,Modify,FullDelete,PartDelete,ModifyAll';ModifySharedFields@1011 : Boolean)
OK@1003 : Boolean;
VAR
ReservEntry1@1004 : Record 337;
ReservEntry2@1005 : Record 337;
CreateReservEntry@1006 : Codeunit 99000830;
ReservationMgt@1007 : Codeunit 99000845;
QtyToAdd@1012 : Decimal;
LostReservQty@1013 : Decimal;
IdenticalArray@1010 : ARRAY [2] OF Boolean;
ExpirationDate@1100409000 : Date;
BEGIN
OK := FALSE;
ExpirationDate := OldTrackingSpecification."Expiration Date"; //LS
IF ((CurrentSignFactor * NewTrackingSpecification."Qty. to Handle") < 0) AND
(FormRunMode <> FormRunMode::"Drop Shipment")
THEN BEGIN
NewTrackingSpecification."Expiration Date" := 0D;
OldTrackingSpecification."Expiration Date" := 0D;
END;
CASE ChangeType OF
ChangeType::Insert:
BEGIN
IF (OldTrackingSpecification."Quantity (Base)" = 0) OR NOT
OldTrackingSpecification.TrackingExists THEN
EXIT(TRUE);
TempReservEntry.SetTrackingFilter('','');
OldTrackingSpecification."Quantity (Base)" :=
CurrentSignFactor *
ReservEngineMgt.AddItemTrackingToTempRecSet(
TempReservEntry,NewTrackingSpecification,
CurrentSignFactor * OldTrackingSpecification."Quantity
(Base)",QtyToAddAsBlank,
ItemTrackingCode."SN Specific Tracking",ItemTrackingCode."Lot
Specific Tracking");
TempReservEntry.ClearTrackingFilter;
// Late Binding
IF ReservEngineMgt.RetrieveLostReservQty(LostReservQty) THEN BEGIN
TempItemTrackLineReserv := NewTrackingSpecification;
TempItemTrackLineReserv."Quantity (Base)" := LostReservQty *
CurrentSignFactor;
TempItemTrackLineReserv.INSERT;
END;
IF OldTrackingSpecification."Quantity (Base)" = 0 THEN
EXIT(TRUE);
IF FormRunMode = FormRunMode::Reclass THEN BEGIN
CreateReservEntry.SetNewSerialLotNo(
OldTrackingSpecification."New Serial
No.",OldTrackingSpecification."New Lot No.");
CreateReservEntry.SetNewExpirationDate(OldTrackingSpecification."New
Expiration Date");
END;
CreateReservEntry.SetDates(
NewTrackingSpecification."Warranty
Date",NewTrackingSpecification."Expiration Date");
CreateReservEntry.SetApplyFromEntryNo(NewTrackingSpecification."Appl.-
from Item Entry");
CreateReservEntry.SetApplyToEntryNo(NewTrackingSpecification."Appl.-to
Item Entry");
CreateReservEntry.CreateReservEntryFor(
OldTrackingSpecification."Source Type",
OldTrackingSpecification."Source Subtype",
OldTrackingSpecification."Source ID",
OldTrackingSpecification."Source Batch Name",
OldTrackingSpecification."Source Prod. Order Line",
OldTrackingSpecification."Source Ref. No.",
OldTrackingSpecification."Qty. per Unit of Measure",
0,
OldTrackingSpecification."Quantity (Base)",
OldTrackingSpecification."Serial No.",
OldTrackingSpecification."Lot No.");

OnAfterCreateReservEntryFor(OldTrackingSpecification,NewTrackingSpecification);

CreateReservEntry.CreateEntry(OldTrackingSpecification."Item No.",
OldTrackingSpecification."Variant Code",
OldTrackingSpecification."Location Code",
OldTrackingSpecification.Description,
ExpectedReceiptDate,
ShipmentDate,0,CurrentEntryStatus);
CreateReservEntry.GetLastEntry(ReservEntry1);

OnRegisterChangeOnAfterCreateReservEntry(ReservEntry1,NewTrackingSpecification);
IF Item."Order Tracking Policy" = Item."Order Tracking
Policy"::"Tracking & Action Msg." THEN
ReservEngineMgt.UpdateActionMessages(ReservEntry1);
IF ModifySharedFields THEN BEGIN
ReservEntry1.SetPointerFilter;
ReservEntry1.SetTrackingFilterFromReservEntry(ReservEntry1);
ReservEntry1.SETFILTER("Entry No.",'<>%1',ReservEntry1."Entry No.");
ModifyFieldsWithinFilter(ReservEntry1,NewTrackingSpecification);
END;
OK := TRUE;
END;
ChangeType::Modify:
BEGIN
ReservEntry1.TRANSFERFIELDS(OldTrackingSpecification);
ReservEntry2.TRANSFERFIELDS(NewTrackingSpecification);
ReservEntry1."Entry No." := ReservEntry2."Entry No."; // If only entry
no. has changed it should not trigger
IF EntriesAreIdentical(ReservEntry1,ReservEntry2,IdenticalArray) THEN
EXIT(QtyToHandleAndInvoiceChanged(ReservEntry1,ReservEntry2));
IF ABS(OldTrackingSpecification."Quantity (Base)") <
ABS(NewTrackingSpecification."Quantity (Base)") THEN BEGIN
// Item Tracking is added to any blank reservation entries:
TempReservEntry.SetTrackingFilter('','');
QtyToAdd :=
CurrentSignFactor *
ReservEngineMgt.AddItemTrackingToTempRecSet(
TempReservEntry,NewTrackingSpecification,
CurrentSignFactor * (NewTrackingSpecification."Quantity (Base)" -
OldTrackingSpecification."Quantity
(Base)"),QtyToAddAsBlank,
ItemTrackingCode."SN Specific Tracking",ItemTrackingCode."Lot
Specific Tracking");
TempReservEntry.ClearTrackingFilter;
// Late Binding
IF ReservEngineMgt.RetrieveLostReservQty(LostReservQty) THEN BEGIN
TempItemTrackLineReserv := NewTrackingSpecification;
TempItemTrackLineReserv."Quantity (Base)" := LostReservQty *
CurrentSignFactor;
TempItemTrackLineReserv.INSERT;
END;
OldTrackingSpecification."Quantity (Base)" := QtyToAdd;
OldTrackingSpecification."Warranty Date" :=
NewTrackingSpecification."Warranty Date";
OldTrackingSpecification."Expiration Date" :=
NewTrackingSpecification."Expiration Date";
OldTrackingSpecification.Description :=
NewTrackingSpecification.Description;

OnAfterCopyTrackingSpec(NewTrackingSpecification,OldTrackingSpecification);
RegisterChange(OldTrackingSpecification,OldTrackingSpecification,
ChangeType::Insert,NOT IdenticalArray[2]);
END ELSE BEGIN
TempReservEntry.SetTrackingFilterFromSpec(OldTrackingSpecification);
OldTrackingSpecification.ClearTracking;
OnAfterClearTrackingSpec(OldTrackingSpecification);
QtyToAdd :=
CurrentSignFactor *
ReservEngineMgt.AddItemTrackingToTempRecSet(
TempReservEntry,OldTrackingSpecification,
CurrentSignFactor * (OldTrackingSpecification."Quantity (Base)" -
NewTrackingSpecification."Quantity
(Base)"),QtyToAddAsBlank,
ItemTrackingCode."SN Specific Tracking",ItemTrackingCode."Lot
Specific Tracking");
TempReservEntry.ClearTrackingFilter;
RegisterChange(NewTrackingSpecification,NewTrackingSpecification,
ChangeType::PartDelete,NOT IdenticalArray[2]);
END;

OnRegisterChangeOnAfterModify(NewTrackingSpecification,OldTrackingSpecification);
OK := TRUE;
END;
ChangeType::FullDelete,
ChangeType::PartDelete:
BEGIN
ReservationMgt.SetItemTrackingHandling(1); // Allow deletion of Item
Tracking
ReservEntry1.TRANSFERFIELDS(OldTrackingSpecification);
ReservEntry1.SetPointerFilter;
ReservEntry1.SetTrackingFilterFromReservEntry(ReservEntry1);
IF ChangeType = ChangeType::FullDelete THEN BEGIN
TempReservEntry.SetTrackingFilterFromSpec(OldTrackingSpecification);
OldTrackingSpecification.ClearTracking;
OnAfterClearTrackingSpec(OldTrackingSpecification);
QtyToAdd :=
CurrentSignFactor *
ReservEngineMgt.AddItemTrackingToTempRecSet(
TempReservEntry,OldTrackingSpecification,
CurrentSignFactor * OldTrackingSpecification."Quantity
(Base)",QtyToAddAsBlank,
ItemTrackingCode."SN Specific Tracking",ItemTrackingCode."Lot
Specific Tracking");
TempReservEntry.ClearTrackingFilter;
ReservationMgt.DeleteReservEntries2(TRUE,0,ReservEntry1)
END ELSE BEGIN
ReservationMgt.DeleteReservEntries2(FALSE,ReservEntry1."Quantity
(Base)" -
OldTrackingSpecification."Quantity Handled (Base)",ReservEntry1);
IF ModifySharedFields THEN BEGIN
ReservEntry1.SETRANGE("Reservation Status");
ModifyFieldsWithinFilter(ReservEntry1,OldTrackingSpecification);
END;
END;
OK := TRUE;
END;
END;
SetQtyToHandleAndInvoice(NewTrackingSpecification);
END;

[LineStart(10502)]
LOCAL PROCEDURE UpdateOrderTracking@26();
VAR
TempReservEntry@1000 : TEMPORARY Record 337;
BEGIN
IF NOT ReservEngineMgt.CollectAffectedSurplusEntries(TempReservEntry) THEN
EXIT;
IF Item."Order Tracking Policy" = Item."Order Tracking Policy"::None THEN
EXIT;
ReservEngineMgt.UpdateOrderTracking(TempReservEntry);
END;

[LineStart(10509)]
LOCAL PROCEDURE ModifyFieldsWithinFilter@25(VAR ReservEntry1@1000 : Record
337;VAR TrackingSpecification@1001 : Record 336);
BEGIN
// Used to ensure that field values that are common to a SN/Lot are copied to
all entries.
IF ReservEntry1.FIND('-') THEN
REPEAT
ReservEntry1.Description := TrackingSpecification.Description;
ReservEntry1."Warranty Date" := TrackingSpecification."Warranty Date";
ReservEntry1."Expiration Date" := TrackingSpecification."Expiration
Date";
ReservEntry1."New Serial No." := TrackingSpecification."New Serial No.";
ReservEntry1."New Lot No." := TrackingSpecification."New Lot No.";
ReservEntry1."New Expiration Date" := TrackingSpecification."New
Expiration Date";
OnAfterMoveFields(TrackingSpecification,ReservEntry1);
ReservEntry1.MODIFY;
UNTIL ReservEntry1.NEXT = 0;
END;

[LineStart(10523)]
LOCAL PROCEDURE SetQtyToHandleAndInvoice@7(TrackingSpecification@1000 : Record
336);
VAR
ReservEntry1@1003 : Record 337;
TotalQtyToHandle@1001 : Decimal;
TotalQtyToInvoice@1002 : Decimal;
QtyToHandleThisLine@1007 : Decimal;
QtyToInvoiceThisLine@1006 : Decimal;
QtyToHandle@1100409000 : Decimal;
BEGIN
IF IsCorrection THEN
EXIT;

TotalQtyToHandle := TrackingSpecification."Qty. to Handle (Base)" *


CurrentSignFactor;
TotalQtyToInvoice := TrackingSpecification."Qty. to Invoice (Base)" *
CurrentSignFactor;

ReservEntry1.TRANSFERFIELDS(TrackingSpecification);
ReservEntry1.SetPointerFilter;
ReservEntry1.SetTrackingFilterFromReservEntry(ReservEntry1);
IF TrackingSpecification.TrackingExists THEN BEGIN
ItemTrackingMgt.SetPointerFilter(TrackingSpecification);
TrackingSpecification.SetTrackingFilterFromSpec(TrackingSpecification);
IF TrackingSpecification.FIND('-') THEN
REPEAT
IF NOT TrackingSpecification.Correction THEN BEGIN
QtyToInvoiceThisLine :=
TrackingSpecification."Quantity Handled (Base)" -
TrackingSpecification."Quantity Invoiced (Base)";
IF ABS(QtyToInvoiceThisLine) > ABS(TotalQtyToInvoice) THEN
QtyToInvoiceThisLine := TotalQtyToInvoice;

IF TrackingSpecification."Qty. to Invoice (Base)" <>


QtyToInvoiceThisLine THEN BEGIN
TrackingSpecification."Qty. to Invoice (Base)" :=
QtyToInvoiceThisLine;
TrackingSpecification.MODIFY;
END;

TotalQtyToInvoice -= QtyToInvoiceThisLine;
END;
UNTIL (TrackingSpecification.NEXT = 0);
END;

IF TrackingSpecification."Lot No." <> '' THEN BEGIN


IF (TrackingSpecification."Source Type" = DATABASE::"Transfer Line") AND
(TrackingSpecification."Source Subtype" = 1) AND
(TrackingSpecification."Source Prod. Order Line" <> 0) // Shipped
THEN
ReservEntry1.SETRANGE("Source Ref. No.");

FOR ReservEntry1."Reservation Status" := ReservEntry1."Reservation


Status"::Reservation TO
ReservEntry1."Reservation Status"::Prospect
DO BEGIN
ReservEntry1.SETRANGE("Reservation Status",ReservEntry1."Reservation
Status");
IF ReservEntry1.FIND('-') THEN
REPEAT
QtyToHandleThisLine := ReservEntry1."Quantity (Base)";
QtyToInvoiceThisLine := QtyToHandleThisLine;

IF ABS(QtyToHandleThisLine) > ABS(TotalQtyToHandle) THEN


QtyToHandleThisLine := TotalQtyToHandle;
IF ABS(QtyToInvoiceThisLine) > ABS(TotalQtyToInvoice) THEN
QtyToInvoiceThisLine := TotalQtyToInvoice;

IF (ReservEntry1."Qty. to Handle (Base)" <> QtyToHandleThisLine) OR


(ReservEntry1."Qty. to Invoice (Base)" <> QtyToInvoiceThisLine)
AND NOT ReservEntry1.Correction
THEN BEGIN
ReservEntry1."Qty. to Handle (Base)" := QtyToHandleThisLine;
ReservEntry1."Qty. to Invoice (Base)" := QtyToInvoiceThisLine;
ReservEntry1.MODIFY;
END;

TotalQtyToHandle -= QtyToHandleThisLine;
TotalQtyToInvoice -= QtyToInvoiceThisLine;

UNTIL (ReservEntry1.NEXT = 0);


END
END ELSE
IF ReservEntry1.FIND('-') THEN
IF (ReservEntry1."Qty. to Handle (Base)" <> TotalQtyToHandle) OR
(ReservEntry1."Qty. to Invoice (Base)" <> TotalQtyToInvoice) AND NOT
ReservEntry1.Correction
THEN BEGIN
ReservEntry1."Qty. to Handle (Base)" := TotalQtyToHandle;
ReservEntry1."Qty. to Invoice (Base)" := TotalQtyToInvoice;
ReservEntry1.MODIFY;
END;
END;

[LineStart(10598)]
LOCAL PROCEDURE CollectPostedTransferEntries@16(TrackingSpecification@1001 :
Record 336;VAR TempTrackingSpecification@1000 : TEMPORARY Record 336);
VAR
ItemEntryRelation@1002 : Record 6507;
ItemLedgerEntry@1003 : Record 32;
BEGIN
// Used for collecting information about posted Transfer Shipments from the
created Item Ledger Entries.
IF TrackingSpecification."Source Type" <> DATABASE::"Transfer Line" THEN
EXIT;

ItemEntryRelation.SETCURRENTKEY("Order No.","Order Line No.");


ItemEntryRelation.SETRANGE("Order No.",TrackingSpecification."Source ID");
ItemEntryRelation.SETRANGE("Order Line No.",TrackingSpecification."Source
Ref. No.");

CASE TrackingSpecification."Source Subtype" OF


0: // Outbound
ItemEntryRelation.SETRANGE("Source Type",DATABASE::"Transfer Shipment
Line");
1: // Inbound
ItemEntryRelation.SETRANGE("Source Type",DATABASE::"Transfer Receipt
Line");
END;

IF ItemEntryRelation.FIND('-') THEN
REPEAT
ItemLedgerEntry.GET(ItemEntryRelation."Item Entry No.");
TempTrackingSpecification := TrackingSpecification;
TempTrackingSpecification."Entry No." := ItemLedgerEntry."Entry No.";
TempTrackingSpecification."Item No." := ItemLedgerEntry."Item No.";
TempTrackingSpecification.CopyTrackingFromItemLedgEntry(ItemLedgerEntry);
TempTrackingSpecification."Quantity (Base)" := ItemLedgerEntry.Quantity;
TempTrackingSpecification."Quantity Handled (Base)" :=
ItemLedgerEntry.Quantity;
TempTrackingSpecification."Quantity Invoiced (Base)" :=
ItemLedgerEntry.Quantity;
TempTrackingSpecification."Qty. per Unit of Measure" :=
ItemLedgerEntry."Qty. per Unit of Measure";
TempTrackingSpecification.InitQtyToShip;
TempTrackingSpecification.INSERT;
UNTIL ItemEntryRelation.NEXT = 0;
END;

[LineStart(10629)]
LOCAL PROCEDURE CollectPostedAssemblyEntries@38(TrackingSpecification@1001 :
Record 336;VAR TempTrackingSpecification@1000 : TEMPORARY Record 336);
VAR
ItemEntryRelation@1002 : Record 6507;
ItemLedgerEntry@1003 : Record 32;
BEGIN
// Used for collecting information about posted Assembly Lines from the
created Item Ledger Entries.
IF (TrackingSpecification."Source Type" <> DATABASE::"Assembly Line") AND
(TrackingSpecification."Source Type" <> DATABASE::"Assembly Header")
THEN
EXIT;

ItemEntryRelation.SETCURRENTKEY("Order No.","Order Line No.");


ItemEntryRelation.SETRANGE("Order No.",TrackingSpecification."Source ID");
ItemEntryRelation.SETRANGE("Order Line No.",TrackingSpecification."Source
Ref. No.");
IF TrackingSpecification."Source Type" = DATABASE::"Assembly Line" THEN
ItemEntryRelation.SETRANGE("Source Type",DATABASE::"Posted Assembly Line")
ELSE
ItemEntryRelation.SETRANGE("Source Type",DATABASE::"Posted Assembly
Header");

IF ItemEntryRelation.FIND('-') THEN
REPEAT
ItemLedgerEntry.GET(ItemEntryRelation."Item Entry No.");
TempTrackingSpecification := TrackingSpecification;
TempTrackingSpecification."Entry No." := ItemLedgerEntry."Entry No.";
TempTrackingSpecification."Item No." := ItemLedgerEntry."Item No.";
TempTrackingSpecification.CopyTrackingFromItemLedgEntry(ItemLedgerEntry);
TempTrackingSpecification."Quantity (Base)" := ItemLedgerEntry.Quantity;
TempTrackingSpecification."Quantity Handled (Base)" :=
ItemLedgerEntry.Quantity;
TempTrackingSpecification."Quantity Invoiced (Base)" :=
ItemLedgerEntry.Quantity;
TempTrackingSpecification."Qty. per Unit of Measure" :=
ItemLedgerEntry."Qty. per Unit of Measure";
TempTrackingSpecification.InitQtyToShip;
TempTrackingSpecification.INSERT;
UNTIL ItemEntryRelation.NEXT = 0;
END;

[LineStart(10659)]
LOCAL PROCEDURE CollectPostedOutputEntries@30(TrackingSpecification@1001 :
Record 336;VAR TempTrackingSpecification@1000 : TEMPORARY Record 336);
VAR
ItemLedgerEntry@1003 : Record 32;
ProdOrderRoutingLine@1004 : Record 5409;
BackwardFlushing@1002 : Boolean;
BEGIN
// Used for collecting information about posted prod. order output from the
created Item Ledger Entries.
IF TrackingSpecification."Source Type" <> DATABASE::"Prod. Order Line" THEN
EXIT;

IF (TrackingSpecification."Source Type" = DATABASE::"Prod. Order Line") AND


(TrackingSpecification."Source Subtype" = 3)
THEN BEGIN
ProdOrderRoutingLine.SETRANGE(Status,TrackingSpecification."Source
Subtype");
ProdOrderRoutingLine.SETRANGE("Prod. Order
No.",TrackingSpecification."Source ID");
ProdOrderRoutingLine.SETRANGE("Routing Reference
No.",TrackingSpecification."Source Prod. Order Line");
IF ProdOrderRoutingLine.FINDLAST THEN
BackwardFlushing :=
ProdOrderRoutingLine."Flushing Method" = ProdOrderRoutingLine."Flushing
Method"::Backward;
END;

ItemLedgerEntry.SETCURRENTKEY("Order Type","Order No.","Order Line


No.","Entry Type");
ItemLedgerEntry.SETRANGE("Order Type",ItemLedgerEntry."Order
Type"::Production);
ItemLedgerEntry.SETRANGE("Order No.",TrackingSpecification."Source ID");
ItemLedgerEntry.SETRANGE("Order Line No.",TrackingSpecification."Source Prod.
Order Line");
ItemLedgerEntry.SETRANGE("Entry Type",ItemLedgerEntry."Entry Type"::Output);

IF ItemLedgerEntry.FIND('-') THEN
REPEAT
TempTrackingSpecification := TrackingSpecification;
TempTrackingSpecification."Entry No." := ItemLedgerEntry."Entry No.";
TempTrackingSpecification."Item No." := ItemLedgerEntry."Item No.";
TempTrackingSpecification.CopyTrackingFromItemLedgEntry(ItemLedgerEntry);
TempTrackingSpecification."Quantity (Base)" := ItemLedgerEntry.Quantity;
TempTrackingSpecification."Quantity Handled (Base)" :=
ItemLedgerEntry.Quantity;
TempTrackingSpecification."Quantity Invoiced (Base)" :=
ItemLedgerEntry.Quantity;
TempTrackingSpecification."Qty. per Unit of Measure" :=
ItemLedgerEntry."Qty. per Unit of Measure";
TempTrackingSpecification.InitQtyToShip;
TempTrackingSpecification.INSERT;

IF BackwardFlushing THEN BEGIN


SourceQuantityArray[1] += ItemLedgerEntry.Quantity;
SourceQuantityArray[2] += ItemLedgerEntry.Quantity;
SourceQuantityArray[3] += ItemLedgerEntry.Quantity;
END;

UNTIL ItemLedgerEntry.NEXT = 0;
END;

[LineStart(10702)]
LOCAL PROCEDURE ZeroLineExists@18() OK@1000 : Boolean;
VAR
xTrackingSpec@1001 : Record 336;
BEGIN
IF ("Quantity (Base)" <> 0) OR TrackingExists THEN
EXIT(FALSE);
xTrackingSpec.COPY(Rec);
RESET;
SETRANGE("Quantity (Base)",0);
SetTrackingFilter('','');
OK := NOT ISEMPTY;
COPY(xTrackingSpec);
END;

[LineStart(10712)]
LOCAL PROCEDURE AssignSerialNo@20();
VAR
EnterQuantityToCreate@1001 : Page 6513;
QtyToCreate@1002 : Decimal;
QtyToCreateInt@1000 : Integer;
CreateLotNo@1004 : Boolean;
BEGIN
IF ZeroLineExists THEN
DELETE;

QtyToCreate := UndefinedQtyArray[1] * QtySignFactor;


IF QtyToCreate < 0 THEN
QtyToCreate := 0;
IF QtyToCreate MOD 1 <> 0 THEN
ERROR(Text008);

QtyToCreateInt := QtyToCreate;

CLEAR(EnterQuantityToCreate);
EnterQuantityToCreate.SetFields("Item No.","Variant Code",QtyToCreate,FALSE);
IF EnterQuantityToCreate.RUNMODAL = ACTION::OK THEN BEGIN
EnterQuantityToCreate.GetFields(QtyToCreateInt,CreateLotNo);
AssignSerialNoBatch(QtyToCreateInt,CreateLotNo);
END;
END;

[LineStart(10732)]
LOCAL PROCEDURE AssignSerialNoBatch@29(QtyToCreate@1001 :
Integer;CreateLotNo@1002 : Boolean);
VAR
i@1004 : Integer;
BEGIN
IF QtyToCreate <= 0 THEN
ERROR(Text009);
IF QtyToCreate MOD 1 <> 0 THEN
ERROR(Text008);

GetItem("Item No.");

IF CreateLotNo THEN BEGIN


TESTFIELD("Lot No.",'');
Item.TESTFIELD("Lot Nos.");
VALIDATE("Lot No.",NoSeriesMgt.GetNextNo(Item."Lot Nos.",WORKDATE,TRUE));
END;

Item.TESTFIELD("Serial Nos.");
ItemTrackingDataCollection.SetSkipLot(TRUE);
FOR i := 1 TO QtyToCreate DO BEGIN
VALIDATE("Quantity Handled (Base)",0);
VALIDATE("Quantity Invoiced (Base)",0);
VALIDATE("Serial No.",NoSeriesMgt.GetNextNo(Item."Serial
Nos.",WORKDATE,TRUE));
OnAfterAssignNewTrackingNo(Rec);
VALIDATE("Quantity (Base)",QtySignFactor);
"Entry No." := NextEntryNo;
IF TestTempSpecificationExists THEN
ERROR('');
INSERT;
TempItemTrackLineInsert.TRANSFERFIELDS(Rec);
TempItemTrackLineInsert.INSERT;
IF i = QtyToCreate THEN
ItemTrackingDataCollection.SetSkipLot(FALSE);
ItemTrackingDataCollection.UpdateTrackingDataSetWithChange(
TempItemTrackLineInsert,CurrentSignFactor * SourceQuantityArray[1] <
0,CurrentSignFactor,0);
END;
CalculateSums;
END;

[LineStart(10767)]
LOCAL PROCEDURE AssignLotNo@21();
VAR
QtyToCreate@1000 : Decimal;
BEGIN
IF ZeroLineExists THEN
DELETE;

IF (SourceQuantityArray[1] * UndefinedQtyArray[1] <= 0) OR


(ABS(SourceQuantityArray[1]) < ABS(UndefinedQtyArray[1]))
THEN
QtyToCreate := 0
ELSE
QtyToCreate := UndefinedQtyArray[1];

GetItem("Item No.");

Item.TESTFIELD("Lot Nos.");
VALIDATE("Quantity Handled (Base)",0);
VALIDATE("Quantity Invoiced (Base)",0);
VALIDATE("Lot No.",NoSeriesMgt.GetNextNo(Item."Lot Nos.",WORKDATE,TRUE));
OnAfterAssignNewTrackingNo(Rec);
"Qty. per Unit of Measure" := QtyPerUOM;
VALIDATE("Quantity (Base)",QtyToCreate);
"Entry No." := NextEntryNo;
TestTempSpecificationExists;
INSERT;
TempItemTrackLineInsert.TRANSFERFIELDS(Rec);
TempItemTrackLineInsert.INSERT;
ItemTrackingDataCollection.UpdateTrackingDataSetWithChange(
TempItemTrackLineInsert,CurrentSignFactor * SourceQuantityArray[1] <
0,CurrentSignFactor,0);
CalculateSums;
END;

[LineStart(10796)]
LOCAL PROCEDURE CreateCustomizedSN@22();
VAR
EnterCustomizedSN@1001 : Page 6515;
QtyToCreate@1002 : Decimal;
QtyToCreateInt@1000 : Integer;
Increment@1004 : Integer;
CreateLotNo@1005 : Boolean;
CustomizedSN@1006 : Code[50];
BEGIN
IF ZeroLineExists THEN
DELETE;

QtyToCreate := UndefinedQtyArray[1] * QtySignFactor;


IF QtyToCreate < 0 THEN
QtyToCreate := 0;

IF QtyToCreate MOD 1 <> 0 THEN


ERROR(Text008);

QtyToCreateInt := QtyToCreate;

CLEAR(EnterCustomizedSN);
EnterCustomizedSN.SetFields("Item No.","Variant Code",QtyToCreate,FALSE);
IF EnterCustomizedSN.RUNMODAL = ACTION::OK THEN BEGIN

EnterCustomizedSN.GetFields(QtyToCreateInt,CreateLotNo,CustomizedSN,Increment);
CreateCustomizedSNBatch(QtyToCreateInt,CreateLotNo,CustomizedSN,Increment);
END;
CalculateSums;
END;

[LineStart(10817)]
LOCAL PROCEDURE CreateCustomizedSNBatch@28(QtyToCreate@1001 :
Decimal;CreateLotNo@1002 : Boolean;CustomizedSN@1003 : Code[50];Increment@1004 :
Integer);
VAR
TextManagement@1005 : Codeunit 41;
i@1000 : Integer;
Counter@1007 : Integer;
BEGIN
TextManagement.EvaluateIncStr(CustomizedSN,CustomizedSN);
NoSeriesMgt.TestManual(Item."Serial Nos.");

IF QtyToCreate <= 0 THEN


ERROR(Text009);
IF QtyToCreate MOD 1 <> 0 THEN
ERROR(Text008);

IF CreateLotNo THEN BEGIN


TESTFIELD("Lot No.",'');
Item.TESTFIELD("Lot Nos.");
VALIDATE("Lot No.",NoSeriesMgt.GetNextNo(Item."Lot Nos.",WORKDATE,TRUE));
OnAfterAssignNewTrackingNo(Rec);
END;

FOR i := 1 TO QtyToCreate DO BEGIN


VALIDATE("Quantity Handled (Base)",0);
VALIDATE("Quantity Invoiced (Base)",0);
VALIDATE("Serial No.",CustomizedSN);
OnAfterAssignNewTrackingNo(Rec);
VALIDATE("Quantity (Base)",QtySignFactor);
"Entry No." := NextEntryNo;
IF TestTempSpecificationExists THEN
ERROR('');
INSERT;
TempItemTrackLineInsert.TRANSFERFIELDS(Rec);
TempItemTrackLineInsert.INSERT;
ItemTrackingDataCollection.UpdateTrackingDataSetWithChange(
TempItemTrackLineInsert,CurrentSignFactor * SourceQuantityArray[1] <
0,CurrentSignFactor,0);
IF i < QtyToCreate THEN BEGIN
Counter := Increment;
REPEAT
CustomizedSN := INCSTR(CustomizedSN);
Counter := Counter - 1;
UNTIL Counter <= 0;
END;
END;
CalculateSums;
END;

[LineStart(10857)]
LOCAL PROCEDURE TestTempSpecificationExists@23() Exists@1000 : Boolean;
VAR
TrackingSpecification@1004 : Record 336;
BEGIN
TrackingSpecification.COPY(Rec);
SETCURRENTKEY("Lot No.","Serial No.");
SETRANGE("Serial No.","Serial No.");
IF "Serial No." = '' THEN
SETRANGE("Lot No.","Lot No.");
SETFILTER("Entry No.",'<>%1',"Entry No.");
SETRANGE("Buffer Status",0);
Exists := NOT ISEMPTY;
COPY(TrackingSpecification);
IF Exists AND CurrentPageIsOpen THEN
IF "Serial No." = '' THEN
MESSAGE(Text011,"Serial No.","Lot No.")
ELSE
MESSAGE(Text012,"Serial No.");
END;

[LineStart(10873)]
LOCAL PROCEDURE TestExpirationDateMismatchOnTempSpec@34() Mismatch : Boolean;
VAR
TrackingSpecification@1000 : Record 336;
BEGIN
IF ("Expiration Date" = 0D) OR ("Lot No." = '') THEN
EXIT(FALSE);

TrackingSpecification.COPY(Rec);
SETFILTER("Entry No.",'<>%1',"Entry No.");
IF ISEMPTY THEN
Mismatch := FALSE
ELSE BEGIN
SETRANGE("Lot No.","Lot No.");
SETFILTER("Expiration Date",'<>%1',"Expiration Date");
SETRANGE("Buffer Status",0);
Mismatch := NOT ISEMPTY;
END;
COPY(TrackingSpecification);
IF Mismatch AND CurrentPageIsOpen THEN
MESSAGE(DifferentExpDateMsg,"Lot No.","Expiration Date");
END;

[LineStart(10891)]
LOCAL PROCEDURE VerifyNewTrackingSpecification@61() : Boolean;
BEGIN
IF TestTempSpecificationExists THEN
EXIT(FALSE);

EXIT(NOT TestExpirationDateMismatchOnTempSpec);
END;

[LineStart(10897)]
LOCAL PROCEDURE QtySignFactor@24() : Integer;
BEGIN
IF SourceQuantityArray[1] < 0 THEN
EXIT(-1);

EXIT(1)
END;

[External]
[LineStart(10903)]
PROCEDURE RegisterItemTrackingLines@27(SourceSpecification@1001 : Record
336;AvailabilityDate@1002 : Date;VAR TempTrackingSpecification@1000 : TEMPORARY
Record 336);
BEGIN
//<431
IF GlobalIsReclass THEN
FormRunMode := FormRunMode::Reclass;
//431>
SourceSpecification.TESTFIELD("Source Type"); // Check if source has been
set.
IF NOT CalledFromSynchWhseItemTrkg THEN
TempTrackingSpecification.RESET;
IF NOT TempTrackingSpecification.FIND('-') THEN
EXIT;

IsCorrection := SourceSpecification.Correction;
ExcludePostedEntries := TRUE;
SetSourceSpec(SourceSpecification,AvailabilityDate);
RESET;
SETCURRENTKEY("Lot No.","Serial No.");

REPEAT
SetTrackingFilterFromSpec(TempTrackingSpecification);
IF FIND('-') THEN BEGIN
IF IsCorrection THEN BEGIN
"Quantity (Base)" += TempTrackingSpecification."Quantity (Base)";
"Qty. to Handle (Base)" += TempTrackingSpecification."Qty. to Handle
(Base)";
"Qty. to Invoice (Base)" += TempTrackingSpecification."Qty. to Invoice
(Base)";
END ELSE
VALIDATE("Quantity (Base)","Quantity (Base)" +
TempTrackingSpecification."Quantity (Base)");
MODIFY;
END ELSE BEGIN
TRANSFERFIELDS(SourceSpecification);
"Serial No." := TempTrackingSpecification."Serial No.";
"Lot No." := TempTrackingSpecification."Lot No.";
"Warranty Date" := TempTrackingSpecification."Warranty Date";
"Expiration Date" := TempTrackingSpecification."Expiration Date";
IF FormRunMode = FormRunMode::Reclass THEN BEGIN
"New Serial No." := TempTrackingSpecification."New Serial No.";
"New Lot No." := TempTrackingSpecification."New Lot No.";
"New Expiration Date" := TempTrackingSpecification."New Expiration
Date"
END;
OnAfterCopyTrackingSpec(TempTrackingSpecification,Rec);
VALIDATE("Quantity (Base)",TempTrackingSpecification."Quantity (Base)");
"Entry No." := NextEntryNo;
INSERT;
END;
UNTIL TempTrackingSpecification.NEXT = 0;

OnAfterRegisterItemTrackingLines(SourceSpecification,TempTrackingSpecification,Rec,
AvailabilityDate);

RESET;
IF FIND('-') THEN
REPEAT
CheckLine(Rec);
UNTIL NEXT = 0;

SetTrackingFilterFromSpec(SourceSpecification);

CalculateSums;
IF UpdateUndefinedQty THEN
WriteToDatabase
ELSE
ERROR(Text014,TotalItemTrackingLine."Quantity (Base)",
LOWERCASE(TempReservEntry.TextCaption),SourceQuantityArray[1]);

// Copy to inbound part of transfer


IF (FormRunMode = FormRunMode::Transfer) OR IsOrderToOrderBindingToTransfer
THEN
SynchronizeLinkedSources('');
END;

[External]
[LineStart(10968)]
PROCEDURE SynchronizeLinkedSources@31(DialogText@1000 : Text[250]) : Boolean;
BEGIN
IF CurrentSourceRowID = '' THEN
EXIT(FALSE);
IF SecondSourceRowID = '' THEN
EXIT(FALSE);

ItemTrackingMgt.SynchronizeItemTracking(CurrentSourceRowID,SecondSourceRowID,Dialog
Text);

OnAfterSynchronizeLinkedSources(FormRunMode,CurrentSourceType,CurrentSourceRowID,Se
condSourceRowID);
EXIT(TRUE);
END;

[External]
[LineStart(10979)]
PROCEDURE SetBlockCommit@33(NewBlockCommit@1000 : Boolean);
BEGIN
BlockCommit := NewBlockCommit;
END;

[External]
[LineStart(10982)]
PROCEDURE SetCalledFromSynchWhseItemTrkg@39(CalledFromSynchWhseItemTrkg2@1000 :
Boolean);
BEGIN
CalledFromSynchWhseItemTrkg := CalledFromSynchWhseItemTrkg2;
END;

[LineStart(10985)]
LOCAL PROCEDURE UpdateExpDateColor@41();
BEGIN
IF ("Buffer Status2" = "Buffer Status2"::"ExpDate blocked") OR
(CurrentSignFactor < 0) THEN;
END;
[LineStart(10988)]
LOCAL PROCEDURE UpdateExpDateEditable@42();
BEGIN
ExpirationDateEditable :=
NOT (("Buffer Status2" = "Buffer Status2"::"ExpDate blocked") OR
(CurrentSignFactor < 0));
END;

[LineStart(10992)]
LOCAL PROCEDURE LookupAvailable@43(LookupMode@1000 : 'Serial No.,Lot No.');
BEGIN
"Bin Code" := ForBinCode;
ItemTrackingDataCollection.LookupTrackingAvailability(Rec,LookupMode);
"Bin Code" := '';
CurrPage.UPDATE;
END;

[LineStart(10998)]
LOCAL PROCEDURE TrackingAvailable@45(VAR TrackingSpecification@1000 : Record
336;LookupMode@1001 : 'Serial No.,Lot No.') : Boolean;
BEGIN

EXIT(ItemTrackingDataCollection.TrackingAvailable(TrackingSpecification,LookupMode)
);
END;

[LineStart(11001)]
LOCAL PROCEDURE SelectEntries@36();
VAR
xTrackingSpec@1001 : Record 336;
MaxQuantity@1000 : Decimal;
BEGIN
xTrackingSpec.COPYFILTERS(Rec);
MaxQuantity := UndefinedQtyArray[1];
IF MaxQuantity * CurrentSignFactor > 0 THEN
MaxQuantity := 0;
"Bin Code" := ForBinCode;

ItemTrackingDataCollection.SelectMultipleTrackingNo(Rec,MaxQuantity,CurrentSignFact
or);
"Bin Code" := '';
IF FINDSET THEN
REPEAT
CASE "Buffer Status" OF
"Buffer Status"::MODIFY:
BEGIN
IF TempItemTrackLineModify.GET("Entry No.") THEN
TempItemTrackLineModify.DELETE;
IF TempItemTrackLineInsert.GET("Entry No.") THEN BEGIN
TempItemTrackLineInsert.TRANSFERFIELDS(Rec);

OnSelectEntriesOnAfterTransferFields(TempItemTrackLineInsert,Rec);
TempItemTrackLineInsert.MODIFY;
END ELSE BEGIN
TempItemTrackLineModify.TRANSFERFIELDS(Rec);

OnSelectEntriesOnAfterTransferFields(TempItemTrackLineModify,Rec);
TempItemTrackLineModify.INSERT;
END;
END;
"Buffer Status"::INSERT:
BEGIN
TempItemTrackLineInsert.TRANSFERFIELDS(Rec);
OnSelectEntriesOnAfterTransferFields(TempItemTrackLineInsert,Rec);
TempItemTrackLineInsert.INSERT;
END;
END;
"Buffer Status" := 0;
MODIFY;
UNTIL NEXT = 0;
LastEntryNo := "Entry No.";
CalculateSums;
UpdateUndefinedQtyArray;
COPYFILTERS(xTrackingSpec);
CurrPage.UPDATE(FALSE);
END;

[LineStart(11042)]
LOCAL PROCEDURE ReestablishReservations@47();
VAR
LateBindingMgt@1000 : Codeunit 6502;
BEGIN
IF TempItemTrackLineReserv.FINDSET THEN
REPEAT

LateBindingMgt.ReserveItemTrackingLine2(TempItemTrackLineReserv,0,TempItemTrackLine
Reserv."Quantity (Base)");
SetQtyToHandleAndInvoice(TempItemTrackLineReserv);
UNTIL TempItemTrackLineReserv.NEXT = 0;
TempItemTrackLineReserv.DELETEALL;
END;

[External]
[LineStart(11050)]
PROCEDURE SetInbound@48(NewInbound@1000 : Boolean);
BEGIN
InboundIsSet := TRUE;
Inbound := NewInbound;
END;

[LineStart(11054)]
LOCAL PROCEDURE SerialNoOnAfterValidate@19074494();
BEGIN
UpdateExpDateEditable;
CurrPage.UPDATE;
END;

[LineStart(11058)]
LOCAL PROCEDURE LotNoOnAfterValidate@19045288();
BEGIN
UpdateExpDateEditable;
CurrPage.UPDATE;
END;

[LineStart(11062)]
LOCAL PROCEDURE QuantityBaseOnAfterValidate@19029188();
BEGIN
CurrPage.UPDATE;
END;

[LineStart(11065)]
LOCAL PROCEDURE QuantityBaseOnValidate@19070694();
BEGIN
CheckLine(Rec);
END;

[LineStart(11068)]
LOCAL PROCEDURE QtytoHandleBaseOnAfterValidate@19004517();
BEGIN
CurrPage.UPDATE;
END;

[LineStart(11071)]
LOCAL PROCEDURE QtytoInvoiceBaseOnAfterValidat@19062426();
BEGIN
CurrPage.UPDATE;
END;

[LineStart(11074)]
LOCAL PROCEDURE ExpirationDateOnFormat@19045111();
BEGIN
UpdateExpDateColor;
END;

[LineStart(11077)]
LOCAL PROCEDURE TempRecValid@49();
BEGIN
IF NOT TempRecIsValid THEN
ERROR(Text007);
END;

[LineStart(11081)]
LOCAL PROCEDURE GetHandleSource@37(TrackingSpecification@1000 : Record 336) :
Boolean;
VAR
QtyToHandleColumnIsHidden@1001 : Boolean;
BEGIN
WITH TrackingSpecification DO BEGIN
IF ("Source Type" = DATABASE::"Item Journal Line") AND ("Source Subtype" =
6) THEN BEGIN // 6 => Prod.order line
ProdOrderLineHandling := TRUE;
EXIT(TRUE); // Display Handle column for prod. orders
END;
QtyToHandleColumnIsHidden :=
("Source Type" IN
[DATABASE::"Item Ledger Entry",
DATABASE::"Item Journal Line",
DATABASE::"Job Journal Line",
DATABASE::"Requisition Line"]) OR
(("Source Type" IN [DATABASE::"Sales Line",DATABASE::"Purchase
Line",DATABASE::"Service Line"]) AND
("Source Subtype" IN [0,2,3])) OR
(("Source Type" = DATABASE::"Assembly Line") AND ("Source Subtype" = 0));
END;
OnAfterGetHandleSource(TrackingSpecification,QtyToHandleColumnIsHidden);
EXIT(NOT QtyToHandleColumnIsHidden);
END;

[LineStart(11100)]
LOCAL PROCEDURE GetInvoiceSource@50(TrackingSpecification@1000 : Record 336) :
Boolean;
VAR
QtyToInvoiceColumnIsHidden@1001 : Boolean;
BEGIN
WITH TrackingSpecification DO BEGIN
QtyToInvoiceColumnIsHidden :=
("Source Type" IN
[DATABASE::"Item Ledger Entry",
DATABASE::"Item Journal Line",
DATABASE::"Job Journal Line",
DATABASE::"Requisition Line",
DATABASE::"Transfer Line",
DATABASE::"Assembly Line",
DATABASE::"Assembly Header",
DATABASE::"Prod. Order Line",
DATABASE::"Worksheet Lines", //LS
DATABASE::"Prod. Order Component"]) OR
(("Source Type" IN [DATABASE::"Sales Line",DATABASE::"Purchase
Line",DATABASE::"Service Line"]) AND
("Source Subtype" IN [0,2,3,4]))
END;
OnAfterGetInvoiceSource(TrackingSpecification,QtyToInvoiceColumnIsHidden);
EXIT(NOT QtyToInvoiceColumnIsHidden);
END;

[External]
[LineStart(11120)]
PROCEDURE SetSecondSourceID@57(SourceID@1000 : Integer;IsATO@1001 : Boolean);
BEGIN
SecondSourceID := SourceID;
IsAssembleToOrder := IsATO;
END;

[LineStart(11124)]
LOCAL PROCEDURE SynchronizeWarehouseItemTracking@53();
VAR
WarehouseShipmentLine@1000 : Record 7321;
ItemTrackingMgt@1002 : Codeunit 6500;
BEGIN
IF ItemTrackingMgt.ItemTrkgIsManagedByWhse(
"Source Type","Source Subtype","Source ID",
"Source Prod. Order Line","Source Ref. No.","Location Code","Item No.")
THEN
EXIT;

WarehouseShipmentLine.SETRANGE("Source Type","Source Type");


WarehouseShipmentLine.SETRANGE("Source Subtype","Source Subtype");
WarehouseShipmentLine.SETRANGE("Source No.","Source ID");
WarehouseShipmentLine.SETRANGE("Source Line No.","Source Ref. No.");
IF WarehouseShipmentLine.FINDSET THEN
REPEAT
DeleteWhseItemTracking(WarehouseShipmentLine);
WarehouseShipmentLine.CreateWhseItemTrackingLines;
UNTIL WarehouseShipmentLine.NEXT = 0;
END;
[LineStart(11141)]
LOCAL PROCEDURE DeleteWhseItemTracking@52(WarehouseShipmentLine@1000 : Record
7321);
VAR
WhseItemTrackingLine@1001 : Record 6550;
BEGIN
WhseItemTrackingLine.SETRANGE("Source Type",DATABASE::"Warehouse Shipment
Line");
WhseItemTrackingLine.SETRANGE("Source ID",WarehouseShipmentLine."No.");
WhseItemTrackingLine.SETRANGE("Source Ref. No.",WarehouseShipmentLine."Line
No.");
WhseItemTrackingLine.DELETEALL(TRUE);
END;

[LineStart(11147)]
LOCAL PROCEDURE IsOrderToOrderBindingToTransfer@59() : Boolean;
VAR
ReservEntry@1000 : Record 337;
BEGIN
IF CurrentSourceType = DATABASE::"Transfer Line" THEN
EXIT(FALSE);

ReservEntry.SetSourceFilter("Source Type","Source Subtype","Source


ID","Source Ref. No.",FALSE);
ReservEntry.SetSourceFilter2("Source Batch Name","Source Prod. Order Line");
ReservEntry.SETRANGE("Reservation Status",ReservEntry."Reservation
Status"::Reservation);
ReservEntry.SETRANGE(Binding,ReservEntry.Binding::"Order-to-Order");
IF ReservEntry.ISEMPTY THEN
EXIT(FALSE);

ReservEntry.FINDFIRST;
ReservEntry.GET(ReservEntry."Entry No.",NOT ReservEntry.Positive);
IF NOT ((ReservEntry."Source Type" = DATABASE::"Transfer Line") AND
(ReservEntry."Source Subtype" = 0)) THEN
EXIT(FALSE);

CurrentSourceRowID :=
ItemTrackingMgt.ComposeRowID(ReservEntry."Source Type",
0,ReservEntry."Source ID",ReservEntry."Source Batch Name",
ReservEntry."Source Prod. Order Line",ReservEntry."Source Ref. No.");
SecondSourceRowID :=
ItemTrackingMgt.ComposeRowID(ReservEntry."Source Type",
1,ReservEntry."Source ID",ReservEntry."Source Batch Name",
ReservEntry."Source Prod. Order Line",ReservEntry."Source Ref. No.");
EXIT(TRUE);
END;

[Integration]
[LineStart(11173)]
LOCAL PROCEDURE OnAfterCopyTrackingSpec@63(VAR SourceTrackingSpec@1000 : Record
336;VAR DestTrkgSpec@1001 : Record 336);
BEGIN
END;

[Integration]
[LineStart(11176)]
LOCAL PROCEDURE OnAfterClearTrackingSpec@64(VAR OldTrkgSpec@1000 : Record 336);
BEGIN
END;

[Integration]
[LineStart(11179)]
LOCAL PROCEDURE OnAfterCreateReservEntryFor@35(VAR
OldTrackingSpecification@1000 : Record 336;VAR NewTrackingSpecification@1001 :
Record 336);
BEGIN
END;

[Integration]
[LineStart(11182)]
LOCAL PROCEDURE OnAfterEntriesAreIdentical@69(ReservEntry1@1002 : Record
337;ReservEntry2@1001 : Record 337;VAR IdenticalArray@1000 : ARRAY [2] OF Boolean);
BEGIN
END;

[Integration]
[LineStart(11185)]
LOCAL PROCEDURE OnAfterMoveFields@65(VAR TrkgSpec@1000 : Record 336;VAR
ReservEntry@1001 : Record 337);
BEGIN
END;

[Integration]
[LineStart(11188)]
LOCAL PROCEDURE OnAfterAssignNewTrackingNo@66(VAR TrkgSpec@1000 : Record 336);
BEGIN
END;

[Integration]
[LineStart(11191)]
LOCAL PROCEDURE OnAfterGetHandleSource@40(TrackingSpecification@1000 : Record
336;VAR QtyToHandleColumnIsHidden@1001 : Boolean);
BEGIN
END;

[Integration]
[LineStart(11194)]
LOCAL PROCEDURE OnAfterGetInvoiceSource@71(TrackingSpecification@1000 : Record
336;VAR QtyToInvoiceColumnIsHidden@1001 : Boolean);
BEGIN
END;

[Integration]
[LineStart(11197)]
LOCAL PROCEDURE OnAfterRegisterItemTrackingLines@56(VAR
TrackingSpecification@1000 : Record 336;VAR TempTrackingSpecification@1002 :
TEMPORARY Record 336;VAR CurrTrackingSpecification@1003 : Record 336;VAR
AvailabilityDate@1001 : Date);
BEGIN
END;

[Integration]
[LineStart(11200)]
LOCAL PROCEDURE OnAfterSetControls@74(ItemTrackingCode@1000 : Record 6502;VAR
Controls@1002 : 'Handle,Invoice,Quantity,Reclass,Tracking';VAR SetAccess@1001 :
Boolean);
BEGIN
END;

[Integration]
[LineStart(11203)]
LOCAL PROCEDURE OnAfterSetSourceSpec@58(VAR TrackingSpecification@1000 : Record
336;VAR CurrTrackingSpecification@1003 : Record 336;VAR AvailabilityDate@1001 :
Date;VAR BlockCommit@1002 : Boolean);
BEGIN
END;

[Integration]
[LineStart(11206)]
LOCAL PROCEDURE OnAfterSynchronizeLinkedSources@72(FormRunMode@1002 :
',Reclass,Combined Ship/Rcpt,Drop Shipment,Transfer';CurrentSourceType@1003 :
Integer;CurrentSourceRowID@1001 : Text[250];SecondSourceRowID@1000 : Text[250]);
BEGIN
END;

[Integration]
[LineStart(11209)]
LOCAL PROCEDURE OnBeforeAddToGlobalRecordSet@67(VAR
TrackingSpecification@1000 : Record 336;EntriesExist@1001 : Boolean);
BEGIN
END;

[Integration]
[LineStart(11212)]
LOCAL PROCEDURE OnBeforeDeleteRecord@70(VAR TrackingSpecification@1000 : Record
336);
BEGIN
END;

[Integration]
[LineStart(11215)]
LOCAL PROCEDURE OnBeforeLotNoAssistEdit@75(VAR TrackingSpecification@1000 :
Record 336;xTrackingSpecification@1001 : Record 336);
BEGIN
END;

[Integration]
[LineStart(11218)]
LOCAL PROCEDURE OnBeforeSerialNoAssistEdit@73(VAR TrackingSpecification@1000 :
Record 336;xTrackingSpecification@1001 : Record 336);
BEGIN
END;

[Integration]
[LineStart(11221)]
LOCAL PROCEDURE OnBeforeSetSourceSpec@54(VAR TrackingSpecification@1000 :
Record 336;VAR ReservationEntry@1001 : Record 337);
BEGIN
END;

[Integration]
[LineStart(11224)]
LOCAL PROCEDURE OnBeforeSetSecondSourceQuantity@68(VAR
SecondSourceQuantityArray@1000 : ARRAY [3] OF Decimal);
BEGIN
END;

[Integration]
[LineStart(11227)]
LOCAL PROCEDURE OnBeforeWriteToDatabase@62(VAR TrackingSpecification@1000 :
Record 336;VAR CurrentPageIsOpen@1001 : Boolean);
BEGIN
END;

[Integration]
[LineStart(11230)]
LOCAL PROCEDURE OnAddReservEntriesToTempRecSetOnBeforeInsert@55(VAR
TempTrackingSpecification@1000 : TEMPORARY Record 336;ReservationEntry@1001 :
Record 337);
BEGIN
END;

[Integration]
[LineStart(11233)]
LOCAL PROCEDURE OnRegisterChangeOnAfterCreateReservEntry@44(VAR
ReservEntry@1000 : Record 337;TrackingSpecification@1001 : Record 336);
BEGIN
END;

[Integration]
[LineStart(11236)]
LOCAL PROCEDURE OnRegisterChangeOnAfterModify@60(VAR
NewTrackingSpecification@1000 : Record 336;VAR OldTrackingSpecification@1001 :
Record 336);
BEGIN
END;

[Integration]
[LineStart(11239)]
LOCAL PROCEDURE OnSelectEntriesOnAfterTransferFields@46(VAR
TempTrackingSpec@1000 : TEMPORARY Record 336;VAR TrackingSpecification@1001 :
Record 336);
BEGIN
END;

[LineStart(11242)]
PROCEDURE SetReclass@1000000000(IsReclass@1000000000 : Boolean);
BEGIN
GlobalIsReclass := IsReclass; //<431
END;

BEGIN
{
In order to provide F6 invoked lookup from availability bitmap columns, a
menu button has been hidden behind control 1.
Function buttons Line and Function both exist in two overlayed versions to
make dynamic show/hide/enable of
individual menu items possible.

LS = Changes made by LS Retail

LS7.0-01 StK #15620# - Adjusted for Nav 2013.


431 OS.ACE.04/02/2021. Integraci�n con Canarias
}
END.
}
}

OBJECT Page 7337 Posted Whse. Shipment


{
OBJECT-PROPERTIES
{
Date=06/04/21;
Time=[ 9:48:08];
Modified=Yes;
Version List=NAVW114.00,AITANA,022,OS,431;
}
PROPERTIES
{
CaptionML=[ENU=Posted Whse. Shipment;
ESP=Env�o alm. registrado];
InsertAllowed=No;
SourceTable=Table7322;
PageType=Document;
RefreshOnActivate=Yes;
OnOpenPage=BEGIN
ErrorIfUserIsNotWhseEmployee;
END;

OnFindRecord=BEGIN
EXIT(FindFirstAllowedRec(Which));
END;

OnNextRecord=BEGIN
EXIT(FindNextAllowedRec(Steps));
END;

ActionList=ACTIONS
{
{ 1900000003;0 ;ActionContainer;
ActionContainerType=RelatedInformation }
{ 100 ;1 ;ActionGroup;
CaptionML=[ENU=&Shipment;
ESP=En&v�o];
Image=Shipment }
{ 101 ;2 ;Action ;
ShortCutKey=Shift+Ctrl+L;
CaptionML=[ENU=List;
ESP=Lista];
ToolTipML=[ENU=View all warehouse documents of this type that
exist.;
ESP=Permite ver todos los documentos de almac�n de
este tipo existentes.];
ApplicationArea=#Warehouse;
Image=OpportunitiesList;
OnAction=BEGIN
LookupPostedWhseShptHeader(Rec);
END;
}
{ 23 ;2 ;Action ;
CaptionML=[ENU=Co&mments;
ESP=C&omentarios];
ToolTipML=[ENU=View or add comments for the record.;
ESP=Permite ver o agregar comentarios para el
registro.];
ApplicationArea=#Warehouse;
RunObject=Page 5776;
RunPageLink=Table Name=CONST(Posted Whse. Shipment),
Type=CONST(" "),
No.=FIELD(No.);
Image=ViewComments }
{ 1900000004;0 ;ActionContainer;
ActionContainerType=ActionItems }
{ 6 ;1 ;Action ;
Ellipsis=Yes;
CaptionML=[ENU=&Print;
ESP=&Imprimir];
ToolTipML=[ENU=Prepare to print the document. A report
request window for the document opens where you can specify what to include on the
print-out.;
ESP=Preparar el documento para imprimirlo. Se abre
una ventana de solicitud de informe para el documento, donde puede especificar qu�
incluir en la impresi�n.];
ApplicationArea=#Warehouse;
Promoted=Yes;
Image=Print;
PromotedCategory=Process;
OnAction=BEGIN
WhseDocPrint.PrintPostedShptHeader(Rec);
END;
}
{ 1100225000;1 ;Action ;
CaptionML=ESP=Crear registro Franquicia exportar env�o;
Promoted=Yes;
PromotedIsBig=Yes;
Image=Shipment;
PromotedCategory=Process;
PromotedOnly=Yes;
OnAction=VAR
FranchisesManagement@1100225000 : Codeunit 50069;
BEGIN

FranchisesManagement.TransferLogEntryFromPostedPage(Rec); //<431
END;
}
}
}
CONTROLS
{
{ 1900000001;0;Container;
ContainerType=ContentArea }

{ 1 ;1 ;Group ;
CaptionML=[ENU=General;
ESP=General] }

{ 4 ;2 ;Field ;
ToolTipML=[ENU=Specifies the number of the involved entry or
record, according to the specified number series.;
ESP=Especifica el n�mero de la entrada o el registro
relacionado, seg�n la serie num�rica especificada.];
ApplicationArea=#Warehouse;
SourceExpr="No.";
Importance=Promoted;
Editable=FALSE;
ImplicitType=Code20 }

{ 19 ;2 ;Field ;
ToolTipML=[ENU=Specifies the number of the warehouse shipment that
the posted warehouse shipment originates from.;
ESP=Especifica el n�mero del env�o de almac�n del que
procede el env�o de almac�n registrado.];
ApplicationArea=#Warehouse;
SourceExpr="Whse. Shipment No.";
Importance=Promoted;
Editable=FALSE;
ImplicitType=Code20 }

{ 28 ;2 ;Field ;
ToolTipML=[ENU=Specifies the code of the location from which the
items were shipped.;
ESP=Especifica el c�digo de la ubicaci�n desde la que se
enviaron los art�culos.];
ApplicationArea=#Location;
SourceExpr="Location Code";
Editable=FALSE;
ImplicitType=Code10 }

{ 10 ;2 ;Field ;
ToolTipML=[ENU=Specifies the code of the zone on this posted
shipment header.;
ESP=Especifica el c�digo de la zona de esta cabecera de
env�o registrada.];
ApplicationArea=#Warehouse;
SourceExpr="Zone Code";
Editable=FALSE;
ImplicitType=Code10 }

{ 17 ;2 ;Field ;
ToolTipML=[ENU=Specifies the bin where the items are picked or put
away.;
ESP=Especifica la ubicaci�n donde se recogen o se dejan
los productos.];
ApplicationArea=#Warehouse;
SourceExpr="Bin Code";
Editable=FALSE;
ImplicitType=Code20 }

{ 2 ;2 ;Field ;
ToolTipML=[ENU=Specifies the posting date of the posted warehouse
shipment.;
ESP=Especifica la fecha de registro del env�o de almac�n
registrado.];
ApplicationArea=#Warehouse;
SourceExpr="Posting Date";
Editable=FALSE;
ImplicitType=Date }

{ 24 ;2 ;Field ;
ToolTipML=[ENU=Specifies the ID of the user who is responsible for
the document.;
ESP=Especifica el id. del usuario responsable del
documento.];
ApplicationArea=#Warehouse;
SourceExpr="Assigned User ID";
Importance=Promoted;
Editable=FALSE;
ImplicitType=Code50 }

{ 26 ;2 ;Field ;
ToolTipML=[ENU=Specifies the date when the user was assigned the
activity.;
ESP=Especifica la fecha en la que se asign� la actividad
al usuario.];
ApplicationArea=#Warehouse;
SourceExpr="Assignment Date";
Editable=FALSE;
ImplicitType=Date }

{ 30 ;2 ;Field ;
ToolTipML=[ENU=Specifies the time when the user was assigned the
activity.;
ESP=Especifica la hora en la que se asign� la actividad
al usuario.];
ApplicationArea=#Warehouse;
SourceExpr="Assignment Time";
Editable=FALSE;
ImplicitType=Time }

{ 7141744;2;Field ;
SourceExpr="Customer No.";
ImplicitType=Code20 }

{ 7141743;2;Field ;
SourceExpr="Ship to Code";
ImplicitType=Code10 }

{ 97 ;1 ;Part ;
Name=WhseShptLines;
ApplicationArea=#Warehouse;
SubPageView=SORTING(No.,Line No.);
SubPageLink=No.=FIELD(No.);
PagePartID=Page7338;
PartType=Page }

{ 1906801201;1;Group ;
CaptionML=[ENU=Shipping;
ESP=Env�o] }

{ 32 ;2 ;Field ;
ToolTipML=[ENU=Specifies a document number that refers to the
customer's or vendor's numbering system.;
ESP=Especifica un n�mero de documento que hace
referencia al sistema de numeraci�n del cliente o el proveedor.];
ApplicationArea=#Warehouse;
SourceExpr="External Document No.";
Importance=Promoted;
Editable=FALSE;
ImplicitType=Code35 }
{ 7 ;2 ;Field ;
ToolTipML=[ENU=Specifies when items on the document are shipped or
were shipped. A shipment date is usually calculated from a requested delivery date
plus lead time.;
ESP=Especifica cu�ndo se van a enviar o se han enviado
los productos del documento. Se calcula normalmente una fecha de env�o con la fecha
de entrega solicitada y el plazo de seguridad.];
ApplicationArea=#Warehouse;
SourceExpr="Shipment Date";
Importance=Promoted;
Editable=FALSE;
ImplicitType=Date }

{ 12 ;2 ;Field ;
ToolTipML=[ENU=Specifies the code for the shipping agent who is
transporting the items.;
ESP=Especifica el c�digo del transportista que traslada
los productos.];
ApplicationArea=#Warehouse;
SourceExpr="Shipping Agent Code";
Editable=FALSE;
ImplicitType=Code10 }

{ 13 ;2 ;Field ;
ToolTipML=[ENU=Specifies the code for the service, such as a one-
day delivery, that is offered by the shipping agent.;
ESP=Especifica el c�digo de servicio (por ejemplo,
entrega en un d�a) que ofrece el transportista.];
ApplicationArea=#Warehouse;
SourceExpr="Shipping Agent Service Code";
Importance=Promoted;
Editable=FALSE;
ImplicitType=Code10 }

{ 14 ;2 ;Field ;
ToolTipML=[ENU=Specifies the delivery conditions of the related
shipment, such as free on board (FOB).;
ESP=Especifica las condiciones de entrega del env�o en
cuesti�n, como franco a bordo (FOB).];
ApplicationArea=#Warehouse;
SourceExpr="Shipment Method Code";
Editable=FALSE;
ImplicitType=Code10 }

{ 1900000007;0;Container;
ContainerType=FactBoxArea }

{ 1900383207;1;Part ;
ApplicationArea=#RecordLinks;
Visible=FALSE;
PartType=System;
SystemPartID=RecordLinks }

{ 1905767507;1;Part ;
ApplicationArea=#Notes;
Visible=TRUE;
PartType=System;
SystemPartID=Notes }
}
CODE
{
VAR
WhseDocPrint@1000 : Codeunit 5776;

BEGIN
{
-022 mmartin 24/02/2016. PI022_LVS_1252. Modificacions magatzems avan�ats.
431 OS.ACE.04/02/2021. Integraci�n con Canarias
}
END.
}
}

OBJECT Page 50187 Franchises Adjust Entry List


{
OBJECT-PROPERTIES
{
Date=06/10/21;
Time=[ 9:04:46];
Modified=Yes;
Version List=OS,431,999;
}
PROPERTIES
{
CaptionML=[ENU=Franchises Adjust Entry Listt;
ESP=Gesti�n ajustes Franquicia];
SourceTable=Table50133;
SourceTableView=SORTING(Entry No.)
ORDER(Descending);
PageType=List;
}
CONTROLS
{
{ 1000000000;0;Container;
ContainerType=ContentArea }

{ 1000000001;1;Group ;
Name=Group;
GroupType=Repeater }

{ 1100225008;2;Field ;
SourceExpr="Entry No.";
Editable=false;
ImplicitType=Integer }

{ 1100225000;2;Field ;
SourceExpr="Operation Date";
ImplicitType=Date }

{ 1100225001;2;Field ;
SourceExpr="Franchise Code";
ImplicitType=Code20 }

{ 1100225014;2;Field ;
SourceExpr="Store No.";
ImplicitType=Code20 }
{ 1100225005;2;Field ;
SourceExpr="Location Code";
ImplicitType=Code10 }

{ 1100225004;2;Field ;
SourceExpr="Location Name";
ImplicitType=Text100 }

{ 1100225002;2;Field ;
SourceExpr="Item No.";
ImplicitType=Code20 }

{ 1100225006;2;Field ;
SourceExpr="Item Description";
ImplicitType=Text100 }

{ 1100225013;2;Field ;
SourceExpr="Barcode No.";
ImplicitType=Code20 }

{ 1100225007;2;Field ;
SourceExpr="Quantity Adjusted";
Editable=false;
ImplicitType=Decimal }

{ 1100225003;2;Field ;
SourceExpr="Related To Receipt No.";
Editable=false;
ImplicitType=Code20 }

{ 1100225009;2;Field ;
SourceExpr=Status;
ImplicitType=Option }

{ 1100225010;2;Field ;
SourceExpr="Resolution Description";
ImplicitType=Text250 }

{ 1100225011;2;Field ;
SourceExpr="Resolution Date";
ImplicitType=Date }

{ 1100225012;2;Field ;
SourceExpr="Resolution USERID";
ImplicitType=Code50 }

}
CODE
{

BEGIN
{
999 OS.XT. 05/10/2021. Modificaci� per les vendes fer ajust positiu si no hi
ha estoc i guardar-ho en taula nova
}
END.
}
}
OBJECT Page 50271 Franchises Setup List
{
OBJECT-PROPERTIES
{
Date=07/06/21;
Time=10:48:48;
Modified=Yes;
Version List=OS,431,528;
}
PROPERTIES
{
Editable=No;
CaptionML=[ENU=Franchises Setup List;
ESP=Lista configuraci�n franquicias];
SourceTable=Table50123;
SourceTableView=SORTING(Enable Franchise,Endpoint Items,Enable Export Item
Information)
WHERE(Store Type=CONST(Franchise));
PageType=List;
UsageCategory=Lists;
CardPageID=Franchises Setup Card;
ActionList=ACTIONS
{
{ 1000000005; ;ActionContainer;
ActionContainerType=ActionItems }
{ 1000000004;1 ;Action ;
CaptionML=ESP=Facturaci�n franquicia;
RunObject=Report 50003;
Promoted=Yes;
PromotedIsBig=Yes;
Image=Invoice;
PromotedCategory=Process;
PromotedOnly=Yes;
OnAction=VAR
FranchisesManagement@1100225000 : Codeunit 50069;
BEGIN

FranchisesManagement.CreateExportStockToLog(Rec.Code);
END;
}
}
}
CONTROLS
{
{ 1000000000;0;Container;
ContainerType=ContentArea }

{ 1000000001;1;Group ;
Name=Group;
GroupType=Repeater }

{ 1000000019;2;Field ;
SourceExpr="Enable Franchise";
ImplicitType=Boolean }

{ 1000000002;2;Field ;
SourceExpr=Code;
ImplicitType=Code20 }
{ 1100225000;2;Field ;
SourceExpr=Description;
ImplicitType=Text50 }

}
CODE
{

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
528 OS.OA. 01/06/2021. AN_CASTOR. Integraci�n con CASTOR
}
END.
}
}

OBJECT Page 50272 Franchise Log Entry


{
OBJECT-PROPERTIES
{
Date=13/03/23;
Time=[ 8:52:51];
Modified=Yes;
Version List=OS,431,528;
}
PROPERTIES
{
CaptionML=ESP=Log Franquicia;
SourceTable=Table50124;
SourceTableView=SORTING(Entry No.,Operation,Action)
ORDER(Descending)
WHERE(Store Type=CONST(Franchise));
PageType=List;
PromotedActionCategoriesML=[ENU=New,Process,Report,Total Process,Parcial
Process,Navigate;
ESP=Nuevo,Procesar,Informes,Procesos
Totales,Procesos Parciales,Navegar];
OnAfterGetRecord=BEGIN
CLEAR(TransSalesEntry);
TransSalesEntry.SETRANGE("Receipt No.", Rec."Source
Operation");
NoOfTransSalesEntry := TransSalesEntry.COUNT;

CLEAR(ItemLedgEntry);
ItemLedgEntry.SETRANGE("Document No.", Rec."Source
Operation");
ItemLedgEntry.SETRANGE("Entry Type", ItemLedgEntry."Entry
Type"::Sale);
NoOfItemLedgEntry := ItemLedgEntry.COUNT;
END;

OnNewRecord=BEGIN
Rec."Store Type" := Rec."Store Type"::Franchise;
END;

ActionList=ACTIONS
{
{ 1100225008; ;ActionContainer;
ActionContainerType=ActionItems }
{ 1100225009;1 ;Action ;
Name=Process Selected Entries;
CaptionML=[ENU=Process Selected Entries;
ESP=Procesar registros seleccionados];
Promoted=Yes;
PromotedIsBig=Yes;
Image=Allocations;
PromotedCategory=Category5;
PromotedOnly=Yes;
OnAction=VAR
SendFranchiseInteractions@7141743 : Report 50154;
FranchisesLogEntry@7141744 : Record 50124;
BEGIN
CurrPage.SETSELECTIONFILTER(FranchisesLogEntry);

SendFranchiseInteractions.SETTABLEVIEW(FranchisesLogEntry);
SendFranchiseInteractions.RUNMODAL;
END;
}
{ 1000000002;1 ;Separator }
{ 1000000004;1 ;Action ;
Name=Exportfile;
CaptionML=ESP=Exportar fichero;
Promoted=Yes;
PromotedIsBig=Yes;
Image=ExportFile;
PromotedCategory=Process;
PromotedOnly=Yes;
OnAction=VAR
FranchisesManagement@1000000000 : Codeunit 50069;
BEGIN
FranchisesManagement.Exportfile(Rec);
END;
}
{ 1100225010; ;ActionContainer;
ActionContainerType=RelatedInformation }
{ 1100225015;1 ;Action ;
Name=GoToTransactionEntry;
CaptionML=ESP=Registro transacciones;
Promoted=Yes;
PromotedIsBig=Yes;
Image=GoTo;
PromotedCategory=Category6;
PromotedOnly=Yes;
OnAction=VAR
TransactionRegister@1100225000 : Page 99001496;
TransactionHeader@1100225001 : Record 99001472;
BEGIN
IF Operation <> Operation::Sale THEN BEGIN
MESSAGE(OperationErr,Operation);
EXIT;
END;

TransactionHeader.SETCURRENTKEY("Store No.","Wrong
Shift","POS Terminal No.","Receipt No.");
TransactionHeader.SETRANGE("Receipt No.","Source
Operation");
TransactionHeader.SETRANGE("Store No.","Store
No.");

TransactionRegister.SETTABLEVIEW(TransactionHeader);
TransactionRegister.LOOKUPMODE := TRUE;
TransactionRegister.EDITABLE := FALSE;
TransactionRegister.RUNMODAL;
END;
}
{ 1100225016;1 ;Action ;
Name=GoToSalesTransactionEntry;
CaptionML=ESP=Registro transacciones ventas;
Promoted=Yes;
PromotedIsBig=Yes;
Image=ItemLines;
PromotedCategory=Category6;
PromotedOnly=Yes;
OnAction=VAR
TransactionSalesEntries@1100225000 : Page
99001497;
TransSalesEntry@1100225001 : Record 99001473;
BEGIN
IF Operation <> Operation::Sale THEN BEGIN
MESSAGE(OperationErr,Operation);
EXIT;
END;

TransSalesEntry.SETCURRENTKEY("Receipt No.","Store
No.");
TransSalesEntry.SETRANGE("Receipt No.","Source
Operation");
TransSalesEntry.SETRANGE("Store No.","Store No.");

TransactionSalesEntries.SETTABLEVIEW(TransSalesEntry);
TransactionSalesEntries.LOOKUPMODE := TRUE;
TransactionSalesEntries.EDITABLE := FALSE;
TransactionSalesEntries.RUNMODAL;
END;
}
{ 1100225017;1 ;Action ;
Name=GoToItemLedgerEntries;
CaptionML=ESP=Mov. Producto;
Promoted=Yes;
PromotedIsBig=Yes;
Image=EntriesList;
PromotedCategory=Category6;
PromotedOnly=Yes;
OnAction=VAR
ItemLedgerEntries@1100225000 : Page 38;
ItemLedgerEntry@1100225001 : Record 32;
Store@1100225002 : Record 99001470;
LocationToFilter@1100225003 : Text;
BEGIN
IF Action <> Action::Receive THEN BEGIN
MESSAGE(OperationErr,Action);
EXIT;
END;

CASE TRUE OF
("Store No." <> '') AND ("Store No. Source" <>
''): BEGIN
Store.GET("Store No.");
LocationToFilter := Store."Location Code";
Store.GET("Store No. Source");
LocationToFilter += '|' + Store."Location
Code";
END;
("Store No." <> '') : BEGIN
Store.GET("Store No.");
LocationToFilter := Store."Location Code";
END;
ELSE BEGIN
MESSAGE(NotValidErr);
EXIT;
END;
END;

ItemLedgerEntry.SETCURRENTKEY("Document
No.","Location Code");
ItemLedgerEntry.SETRANGE("Document No.","Source
Operation");
ItemLedgerEntry.SETFILTER("Location
Code",LocationToFilter);
ItemLedgerEntries.SETTABLEVIEW(ItemLedgerEntry);
ItemLedgerEntries.LOOKUPMODE := TRUE;
ItemLedgerEntries.EDITABLE := FALSE;
ItemLedgerEntries.RUNMODAL;
END;
}
}
}
CONTROLS
{
{ 7141743;0;Container ;
ContainerType=ContentArea }

{ 7141744;1;Group ;
Name=Group;
GroupType=Repeater }

{ 1100225006;2;Field ;
SourceExpr=Action;
ImplicitType=Option }

{ 7141745;2;Field ;
SourceExpr=Operation;
ImplicitType=Option }

{ 1100225007;2;Field ;
SourceExpr="Source Operation";
ImplicitType=Code20 }

{ 1000000000;2;Field ;
SourceExpr="Package No";
ImplicitType=Code20 }

{ 1000000001;2;Field ;
SourceExpr="Posted Warehouse Shipment No.";
ImplicitType=Code20 }
{ 1100225011;2;Field ;
SourceExpr="Franchise Code";
ImplicitType=Code20 }

{ 1100225012;2;Field ;
SourceExpr="Store No.";
ImplicitType=Code20 }

{ 1100225014;2;Field ;
SourceExpr="Store No. Source";
ImplicitType=Code20 }

{ 1000000003;2;Field ;
SourceExpr="Inventory Type";
ImplicitType=Text50 }

{ 1100225013;2;Field ;
SourceExpr="POS Terminal";
ImplicitType=Code20 }

{ 1100225002;2;Field ;
SourceExpr="Operation Date";
ImplicitType=Date }

{ 1100225001;2;Field ;
SourceExpr="Operation Time";
ImplicitType=Time }

{ 1100225000;2;Field ;
SourceExpr=User;
ImplicitType=Code50 }

{ 1100225003;2;Field ;
SourceExpr=Processed;
ImplicitType=Boolean }

{ 1100225004;2;Field ;
SourceExpr="Processed Date";
ImplicitType=Date }

{ 1100225005;2;Field ;
SourceExpr="Processed Time";
ImplicitType=Time }

{ 7141754;2;Field ;
SourceExpr=Error;
ImplicitType=Boolean }

{ 7141755;2;Field ;
SourceExpr=Description;
ImplicitType=Text250 }

{ 1000000005;2;Field ;
SourceExpr=NoOfTransSalesEntry;
ImplicitType=Integer }

{ 1000000006;2;Field ;
SourceExpr=NoOfItemLedgEntry;
ImplicitType=Integer }

}
CODE
{
VAR
OperationErr@1100225000 : TextConst 'ESP=Esta opci�n no es valida para el
tipo de operaci�n %1';
NotValidErr@1100225001 : TextConst 'ESP=Esta opci�n no es valida';
TransSalesEntry@1000000002 : Record 99001473;
ItemLedgEntry@1000000003 : Record 32;
NoOfTransSalesEntry@1000000000 : Integer;
NoOfItemLedgEntry@1000000001 : Integer;

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
528 OS.OA. 01/06/2021. AN_CASTOR. Integraci�n con CASTOR
}
END.
}
}

OBJECT Page 50276 Franchises Setup Card


{
OBJECT-PROPERTIES
{
Date=28/10/22;
Time=10:06:15;
Modified=Yes;
Version List=OS,431,528,544,565;
}
PROPERTIES
{
SourceTable=Table50123;
PageType=Card;
PromotedActionCategoriesML=[ENU=New,Process,Report,Equivalences;
ESP=Nuevo,Procesar,Informes,Equivalencias];
OnNewRecord=BEGIN
Rec."Store Type" := "Store Type"::Franchise;
END;

ActionList=ACTIONS
{
{ 1100225030; ;ActionContainer;
ActionContainerType=ActionItems }
{ 1100225031;1 ;Action ;
CaptionML=ESP=Crear registro exportar estoc;
Promoted=Yes;
PromotedIsBig=Yes;
Image=CalculateInventory;
PromotedCategory=Process;
PromotedOnly=Yes;
OnAction=VAR
FranchisesManagement@1100225000 : Codeunit 50069;
BEGIN

FranchisesManagement.CreateExportStockToLog(Rec.Code);
END;
}
{ 1000000005;1 ;Action ;
CaptionML=ESP=Facturaci�n franquicia;
RunObject=Report 50003;
Promoted=Yes;
PromotedIsBig=Yes;
Image=Invoice;
PromotedCategory=Process;
PromotedOnly=Yes;
OnAction=VAR
FranchisesManagement@1100225000 : Codeunit 50069;
BEGIN

FranchisesManagement.CreateExportStockToLog(Rec.Code);
END;
}
{ 1100225032; ;ActionContainer;
ActionContainerType=RelatedInformation }
{ 1100225033;1 ;Action ;
Name=SetReasonsCode;
CaptionML=ESP=Motivos ajuste;
RunObject=Page 50285;
RunPageLink=Franchise Code=FIELD(Code),
Type=CONST(Adjust Reason);
Promoted=Yes;
PromotedIsBig=Yes;
Image=EditAdjustments;
PromotedCategory=Category4 }
{ 1100225035;1 ;Action ;
Name=SetTenderType;
CaptionML=ESP=Medios de pago;
RunObject=Page 50285;
RunPageLink=Franchise Code=FIELD(Code),
Type=CONST(Payment Method);
Promoted=Yes;
PromotedIsBig=Yes;
Image=ApplyEntries;
PromotedCategory=Category4 }
{ 1100225027;1 ;Action ;
CaptionML=[ENU=Item Status Sync.;
ESP=Estado productos a sincronizar];
RunObject=Page 50316;
RunPageLink=Code=FIELD(Code);
Promoted=Yes;
PromotedIsBig=Yes;
Image=Item;
PromotedCategory=Category4 }
}
}
CONTROLS
{
{ 1100225000;0;Container;
ContainerType=ContentArea }

{ 1100225001;1;Group ;
Name=General;
GroupType=Group }

{ 1100225002;2;Field ;
SourceExpr="Enable Franchise";
ImplicitType=Boolean }

{ 1100225023;2;Field ;
SourceExpr=Code;
ImplicitType=Code20 }

{ 1100225014;2;Field ;
SourceExpr=Description;
ImplicitType=Text50 }

{ 1100225021;2;Field ;
SourceExpr="Channel 1";
ImplicitType=Code20 }

{ 1100225020;2;Field ;
SourceExpr="Active 1";
ImplicitType=Boolean }

{ 1100225019;2;Field ;
SourceExpr="Channel 2";
ImplicitType=Code20 }

{ 1100225018;2;Field ;
SourceExpr="Active 2";
ImplicitType=Boolean }

{ 1100225017;2;Field ;
SourceExpr="Color Attribute";
ImplicitType=Code20 }

{ 1100225016;2;Field ;
SourceExpr="Brand Attribute";
ImplicitType=Code20 }

{ 1100225015;2;Field ;
SourceExpr="Size Attribute";
ImplicitType=Code20 }

{ 1000000003;2;Field ;
SourceExpr="PVP Customer Price Group";
ImplicitType=Code10 }

{ 1000000004;2;Field ;
SourceExpr="Cost Customer Price Group";
ImplicitType=Code10 }

{ 1100225012;2;Field ;
SourceExpr=Vendor;
ImplicitType=Text50 }

{ 1100225007;2;Field ;
SourceExpr="Days To Delete Log";
ImplicitType=Integer }

{ 1100225034;2;Field ;
SourceExpr="Contact Nos.";
ImplicitType=Code20 }
{ 1100225036;2;Field ;
SourceExpr="SII Disabled";
ImplicitType=Boolean }

{ 1100225024;1;Group ;
CaptionML=ESP=Endpoints;
GroupType=Group }

{ 1100225003;2;Field ;
SourceExpr="Endpoint URL";
ImplicitType=Text100 }

{ 1100225004;2;Field ;
SourceExpr="Endpoint Items";
ImplicitType=Text30 }

{ 1100225025;2;Field ;
SourceExpr="Endpoint Shipment";
ImplicitType=Text30 }

{ 1100225029;2;Field ;
SourceExpr="Endpoint Stock";
ImplicitType=Text30 }

{ 1100225005;2;Field ;
SourceExpr=User;
ImplicitType=Text50 }

{ 1100225006;2;Field ;
ExtendedDatatype=Masked;
SourceExpr=Password;
ImplicitType=Text50 }

{ 1100225008;2;Field ;
ExtendedDatatype=Masked;
SourceExpr="Base 64 Password";
ImplicitType=Text35 }

{ 1100225009;2;Field ;
SourceExpr="Save File Path";
ImplicitType=Text200 }

{ 1100225011;2;Field ;
SourceExpr="Enable Import Confirm Message";
ImplicitType=Boolean }

{ 1000000000;2;Field ;
SourceExpr="Enable Import Sales Message";
ImplicitType=Boolean }

{ 1100225013;2;Field ;
SourceExpr="Enable Import Inventory";
ImplicitType=Boolean }

{ 1100225022;2;Field ;
SourceExpr="Enable Import Stock";
ImplicitType=Boolean }

{ 1000000006;2;Field ;
SourceExpr="Enable Import Contact";
ImplicitType=Boolean }

{ 1000000001;2;Field ;
SourceExpr="Enable Export Item Information";
ImplicitType=Boolean }

{ 1000000002;2;Field ;
SourceExpr="Enable Export Shipment Inform.";
ImplicitType=Boolean }

{ 1100225026;2;Field ;
SourceExpr="Enable Export Stock";
ImplicitType=Boolean }

{ 1100225038;2;Field ;
SourceExpr="Send Stock In Days";
ImplicitType=Integer }

{ 1100225028;2;Field ;
SourceExpr="Last Stock Sent";
Editable=false;
ImplicitType=Date }

{ 1100225010;1;Part ;
SubPageLink=Code=FIELD(Code);
PagePartID=Page50277;
PartType=Page }

}
CODE
{

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
528 OS.OA. 01/06/2021. AN_CASTOR. Integraci�n con CASTOR
544 OS.MM. 09/08/2021. AN_PTG001_MRW. Implantaci�n empresa portuguesa.
565 OS.MM. 24/11/2021. SP_20211115_MRW. No enviar productos seg�n
configuraci�n de estado y precios a Canarias
}
END.
}
}

OBJECT Page 50277 Franchises Setup Store List


{
OBJECT-PROPERTIES
{
Date=29/03/21;
Time=13:06:46;
Modified=Yes;
Version List=OS,431;
}
PROPERTIES
{
CaptionML=[ENU=Stores;
ESP=Tiendas];
LinksAllowed=No;
SourceTable=Table50126;
DelayedInsert=Yes;
PageType=ListPart;
}
CONTROLS
{
{ 1100225000;0;Container;
ContainerType=ContentArea }

{ 1100225001;1;Group ;
Name=Group;
GroupType=Repeater }

{ 1100225008;2;Field ;
SourceExpr="Enable Store";
ImplicitType=Boolean }

{ 1100225003;2;Field ;
SourceExpr="Store No.";
ImplicitType=Code20 }

{ 1100225004;2;Field ;
SourceExpr="POS Terminal";
ImplicitType=Code20 }

{ 1000000000;2;Field ;
SourceExpr="Customer No.";
ImplicitType=Code20 }

{ 1100225005;2;Field ;
SourceExpr="Journal Template Name Adjust";
ImplicitType=Code10 }

{ 1100225006;2;Field ;
SourceExpr="Journal Batch Name Adjust";
ImplicitType=Code10 }

{ 1100225002;2;Field ;
SourceExpr="Invoice Location";
ImplicitType=Code10 }

{ 1100225007;2;Field ;
SourceExpr="Journal Template Name Reclass";
ImplicitType=Code10 }

{ 1100225009;2;Field ;
SourceExpr="Journal Batch Name Reclass";
ImplicitType=Code10 }

}
CODE
{

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
}
END.
}
}

OBJECT Page 50279 Franchises Stock Entry List


{
OBJECT-PROPERTIES
{
Date=30/03/21;
Time=12:50:55;
Modified=Yes;
Version List=OS,431;
}
PROPERTIES
{
CaptionML=[ENU=Franchises Stock Entry List;
ESP=Gesti�n incidencias estocs te�ricos];
SourceTable=Table50128;
PageType=List;
OnAfterGetRecord=BEGIN
SetStyleExpression;
END;

}
CONTROLS
{
{ 1000000000;0;Container;
ContainerType=ContentArea }

{ 1100225003;1;Group ;
GroupType=Group }

{ 1100225015;2;Field ;
CaptionML=ESP=Color Rojo mayor en MRW;
Style=Unfavorable;
StyleExpr=TRUE }

{ 1100225016;2;Field ;
CaptionML=ESP=Color Azul mayor en FRANQUICIA;
Style=StrongAccent;
StyleExpr=TRUE }

{ 1000000001;1;Group ;
Name=Group;
GroupType=Repeater }

{ 1100225000;2;Field ;
SourceExpr="Operation Date";
ImplicitType=Date }

{ 1100225001;2;Field ;
SourceExpr="Franchise Code";
ImplicitType=Code20 }

{ 1100225002;2;Field ;
SourceExpr="Item No.";
ImplicitType=Code20 }

{ 1100225013;2;Field ;
SourceExpr="Barcode No.";
ImplicitType=Code20 }
{ 1100225004;2;Field ;
SourceExpr="Location Code";
ImplicitType=Code10 }

{ 1100225006;2;Field ;
SourceExpr="Location Name";
ImplicitType=Text100 }

{ 1100225005;2;Field ;
SourceExpr="Store No.";
ImplicitType=Code20 }

{ 1100225007;2;Field ;
SourceExpr="Franchise Stock";
ImplicitType=Decimal }

{ 1100225008;2;Field ;
SourceExpr="MRW Stock";
ImplicitType=Decimal }

{ 1100225014;2;Field ;
SourceExpr="Stock Difference";
StyleExpr=DifferenceStyleExpression;
ImplicitType=Decimal }

{ 1100225009;2;Field ;
SourceExpr=Status;
ImplicitType=Option }

{ 1100225010;2;Field ;
SourceExpr="Resolution Description";
ImplicitType=Text250 }

{ 1100225011;2;Field ;
SourceExpr="Resolution Date";
ImplicitType=Date }

{ 1100225012;2;Field ;
SourceExpr="Resolution USERID";
ImplicitType=Code50 }

}
CODE
{
VAR
DifferenceStyleExpression@1100225000 : Text;

[LineStart(11250)]
LOCAL PROCEDURE SetStyleExpression@1100225000();
BEGIN
IF "Stock Difference" > 0 THEN
DifferenceStyleExpression := 'Unfavorable'
ELSE
DifferenceStyleExpression := 'StrongAccent';
END;

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
}
END.
}
}

OBJECT Page 50285 Franchises Values


{
OBJECT-PROPERTIES
{
Date=16/04/21;
Time=[ 8:28:08];
Modified=Yes;
Version List=OS,431;
}
PROPERTIES
{
Editable=Yes;
CaptionML=ESP=Valores franquicia;
SourceTable=Table50122;
DelayedInsert=Yes;
PageType=List;
}
CONTROLS
{
{ 1000000000;0;Container;
ContainerType=ContentArea }

{ 1000000001;1;Group ;
Name=Group;
GroupType=Repeater }

{ 1100225002;2;Field ;
SourceExpr=Code;
ImplicitType=Code20 }

{ 1100225004;2;Field ;
SourceExpr="Franchise Value";
ImplicitType=Text100 }

}
CODE
{

BEGIN
{
431 OS.ACE.04/02/2021. Integraci�n con Canarias
}
END.
}
}

OBJECT Page 50286 Temp Franchises Inv. Summary


{
OBJECT-PROPERTIES
{
Date=13/04/21;
Time=15:39:16;
Modified=Yes;
Version List=OS,431;
}
PROPERTIES
{
Editable=No;
CaptionML=ESP=Resumen facturaci�n franquicia;
SourceTable=Table50124;
PageType=List;
}
CONTROLS
{
{ 1100225000;0;Container;
ContainerType=ContentArea }

{ 1100225001;1;Group ;
Name=Group;
GroupType=Repeater }

{ 1100225002;2;Field ;
SourceExpr="Result Franchise No.";
ImplicitType=Code20 }

{ 1100225003;2;Field ;
SourceExpr="Result Store No.";
ImplicitType=Code20 }

{ 1100225004;2;Field ;
SourceExpr="Result Location Code";
ImplicitType=Code20 }

{ 1100225005;2;Field ;
SourceExpr="Result Document No.";
ImplicitType=Code20 }

{ 1100225006;2;Field ;
SourceExpr="Result Item No.";
ImplicitType=Code20 }

{ 1100225008;2;Field ;
SourceExpr="Result Item Description";
ImplicitType=Text100 }

{ 1100225007;2;Field ;
SourceExpr="Result Quantity";
ImplicitType=Decimal }

}
CODE
{

BEGIN
END.
}
}

OBJECT Page 10000807 Retail Item Card


{
OBJECT-PROPERTIES
{
Date=17/05/23;
Time=[ 9:19:22];
Modified=Yes;
Version
List=LSW113.0.00.775,AITANA,006,007,025,OS,044,073,096,204,396,428,431,522,532,545,
573,MRW042,MW-2824;
}
PROPERTIES
{
CaptionML=[ENU=Retail Item Card;
ESP=Ficha Producto Com. Minorista];
SourceTable=Table27;
RefreshOnActivate=Yes;
PromotedActionCategoriesML=[ENU=New,Process,Reports,Master
Data,History,Pricing,Category7_caption,Category8_caption,Category9_caption,Category
10_caption;
ESP=Nuevo,Procesos,Informes,Datos
Maestros,Hist�rico,Precios,Category7_caption,Category8_caption,Category9_caption,Ca
tegory10_caption];
OnInit=VAR
FileManagement@1200070000 : Codeunit 419;
BEGIN
OrderMultipleEnable := TRUE;
MaximumOrderQuantityEnable := TRUE;
MinimumOrderQuantityEnable := TRUE;
MaximumInventoryEnable := TRUE;
ReorderQuantityEnable := TRUE;
ReorderPointEnable := TRUE;
SafetyStockQuantityEnable := TRUE;
SafetyLeadTimeEnable := TRUE;
ReorderCycleEnable := TRUE;
UnitPriceIncludingVATEditable := TRUE;
UnitPriceEditable := TRUE;
VisibleInWebClient := FileManagement.IsWebClient;
VisibleInWinClient := FileManagement.IsWindowsClient;
END;

OnOpenPage=BEGIN
SetVisible;

IF ReplenishmentSetup.WRITEPERMISSION THEN BEGIN


IF NOT ReplenishmentSetup.GET THEN
CLEAR(ReplenishmentSetup);
ReplenishmentGradeCodeVisible := ReplenishmentSetup."Store Items
Ranged By" = ReplenishmentSetup."Store Items Ranged By"::"Item Category/Grade";
END;

//Compruebo permisos
Permisos := FALSE;
IF UserSetup.GET(USERID) THEN BEGIN
IF UserSetup."Permitir Crear Tarifas Auto." THEN
Permisos := TRUE;
END;
END;

OnFindRecord=BEGIN
StoreToLocationFilter;

EXIT(FIND(Which));
END;

OnAfterGetRecord=VAR
ReplenItemStoreRec_l@1100409000 : Record 10012206;
BEGIN
EnableCostingControls;

ItemStatusLinks.RESET;
ItemStatusLinks.SETRANGE("Item No.","No.");
ItemStatusLinks.SETRANGE("Starting Date",0D,TODAY);
IF NOT ItemStatusLinks.FINDLAST THEN BEGIN
ItemStatusLinks.INIT;
ItemStatusLinks."Starting Date" := 0D;
END;

IF "Fuel Item" THEN


gGradeId := gFcFunctions.Item2GradeId("No.")
ELSE
gGradeId := 0;

ReplenItemStoreRec_l.RESET;
ReplenItemStoreRec_l.SETRANGE("Item No.","No.");
IF ReplenItemStoreRec_l.FINDFIRST THEN
LocationDetails_g := TRUE
ELSE
LocationDetails_g := FALSE;
EnablePlanningControls;
OnAfterGetCurrRecord;

//-MRW
fxGetNotesMessage(Rec);
//+MRW

//-MRW mluque Bloqueo medidas cubiscan


CubiScanBloq := NOT "CubiScan Imported";
//+MRW

CheckDepositFieldEditable(DepositFieldEditable); //<545
END;

OnNewRecord=BEGIN
EnableCostingControls;
IF StandardCard."No." <> '' THEN BEGIN
Rec := StandardCard;
"No." := '';
END;
OnAfterGetCurrRecord;
END;

OnInsertRecord=VAR
ItemCreate@1000000001 : Codeunit 10000719;
Template@1200070001 : Record 10000730;
BEGIN
IF StandardCard."No." <> '' THEN BEGIN
Template.INIT;
Template."Default Item" := StandardCard."No.";
ItemCreate.CreateExtraTables(Template,Rec,TRUE);
END;
END;

OnModifyRecord=BEGIN
"Error Check Internal Usage" := TRUE;
END;

OnQueryClosePage=VAR
Miscellanious@1100225000 : Codeunit 50004;
BEGIN
Miscellanious.CheckUnitPriceFromItem("No.",0); //-999

//mluque Compruebo los campos obligatorios


ControlCampOblig.ComprProducto("No.");
END;

ActionList=ACTIONS
{
{ 1900000003;0 ;ActionContainer;
ActionContainerType=RelatedInformation }
{ 1100409024;1 ;ActionGroup;
Name=&Master Data;
CaptionML=[ENU=&Master Data;
ESP=Datos &Maestros] }
{ 1100409037;2 ;Action ;
Name=Page Item Units of Measure;
CaptionML=[ENU=&Units of Measure;
ESP=&Unidades de Medida];
RunObject=Page 5404;
RunPageLink=Item No.=FIELD(No.);
Promoted=Yes;
Image=UnitOfMeasure;
PromotedCategory=Category4 }
{ 1100409039;2 ;ActionGroup;
Name=&Variants;
CaptionML=[ENU=&Variants;
ESP=&Variantes];
Image=ItemVariant }
{ 1100409041;3 ;Action ;
Name=Variant Worksheet;
CaptionML=[ENU=Va&riants;
ESP=Va&riantes];
Promoted=Yes;
Image=ItemVariant;
PromotedCategory=Category4;
OnAction=VAR
VariantWorksheet@1200070000 : Page 10001440;
ItemVariantRegistration@1200070001 : Record
10001414;
ItemVariant@1200070002 : Record 5401;
BEGIN
IF "Variant Framework Code" <> '' THEN BEGIN
CLEAR(VariantWorksheet);
VariantWorksheet.LoadForm("No.");
VariantWorksheet.RUN;
END
ELSE BEGIN
ItemVariant.SETRANGE("Item No.","No.");
PAGE.RUN(5401,ItemVariant);
END;
END;
}
{ 1100409043;3 ;Action ;
Name=Item Variant Framework;
CaptionML=[ENU=Variant &Framework;
ESP=&Estructura Variante];
RunObject=Page 10001438;
RunPageLink=Item=FIELD(No.);
Promoted=Yes;
Image=Ranges;
PromotedCategory=Category4 }
{ 1100409049;3 ;Action ;
Name=Collection Matrix;
CaptionML=[ENU=C&ollection;
ESP=C&ollecci�n];
RunObject=Page 10001479;
RunPageLink=Item No.=FIELD(No.);
Image=Group }
{ 1100409056;3 ;Action ;
Name=Item Dimension Pattern Link;
CaptionML=[ENU=&Dimension Pattern;
ESP=Patr�n &Dimensi�n];
RunObject=Page 10012244;
RunPageView=SORTING(Item No.,Dimension 1,Group Type,Group);
RunPageLink=Item No.=FIELD(No.);
Image=CodesList }
{ 1200070006;3 ;Action ;
Name=Item Status Worksheet;
CaptionML=[ENU=Item Status &Worksheet;
ESP=&Hoja Estado Producto];
Image=Worksheet;
OnAction=VAR
ItemStatusLinkWorktable_temp@1100409001 :
TEMPORARY Record 10001399;
ItemStatusLinkWorksheet@1100409000 : Page
10001401;
VariantGroupFunctions@1100409002 : Codeunit
10001406;
Text001_l@1100409003 : TextConst 'ENU=The %1 has
no variants, page cannot be opened.;ESP=%1 no tiene variantes, no se puede abrir la
p�gina.';
BEGIN
IF "Variant Framework Code" <> '' THEN BEGIN
IF
VariantGroupFunctions.NumberOfFramworkfVariantDimensions("Variant Framework Code")
> 0 THEN BEGIN

ItemStatusLinkWorksheet.PopulateWorktable(ItemStatusLinkWorktable_temp,"No.",Descri
ption,TODAY);

PAGE.RUN(10001401,ItemStatusLinkWorktable_temp);
END;
END ELSE
MESSAGE(Text001_l,Rec.TABLECAPTION);
END;
}
{ 1200070007;3 ;Action ;
Name=Item Status Matrix;
CaptionML=[ENU=Item Status &Matrix;
ESP=&Matriz Estado Producto];
Image=Worksheet2;
OnAction=VAR
ItemStatus@1100409006 : Record 10001403;
ItemStatusLinkMatrixTable_Temp@1100409000 :
TEMPORARY Record 10001398;
ItemStatusLinkMatrix@1100409004 : Page 10001402;
VariantGroupFunctions@1100409001 : Codeunit
10001406;
Text001_l@1100409003 : TextConst 'ENU=The Matrix
page only support items with 1 or 2 variant dimensions. This item has %1 variant
dimensions.;ESP=La p�gina Matriz s�lo soporta productos con 1 o 2 dimensiones
variante. Este producto tiene %1 dimensiones variante.';
Text002_l@1100409002 : TextConst 'ENU=The %1 has
no variants, page cannot be opened.;ESP=%1 no tiene variantes, no se puede abrir la
p�gina.';
StatusCode@1100409007 : Code[20];
NumberOfVariantDim@1100409005 : Integer;
BEGIN
IF "Variant Framework Code" <> '' THEN BEGIN
NumberOfVariantDim :=
VariantGroupFunctions.NumberOfFramworkfVariantDimensions("Variant Framework Code");
IF NumberOfVariantDim IN [1,2] THEN BEGIN

ItemStatusLinkMatrix.PopulateWorktable(ItemStatusLinkMatrixTable_Temp,"No.",Descrip
tion,TODAY,0,NumberOfVariantDim);

PAGE.RUN(10001402,ItemStatusLinkMatrixTable_Temp);
END ELSE
MESSAGE(Text001_l,NumberOfVariantDim);
END ELSE
MESSAGE(Text002_l,Rec.TABLECAPTION);
END;
}
{ 1100409038;2 ;Action ;
Name=Dimensions;
ShortCutKey=Shift+Ctrl+D;
CaptionML=[ENU=&Dimensions;
ESP=&Dimensiones];
RunObject=Page 540;
RunPageLink=Table ID=CONST(27),
No.=FIELD(No.);
Image=Dimensions }
{ 1100409051;2 ;Action ;
Name=Extended Texts;
CaptionML=[ENU=&Extended Texts;
ESP=Textos &Expandidos];
RunObject=Page 391;
RunPageView=SORTING(Table Name,No.,Language Code,All Language
Codes,Starting Date,Ending Date);
RunPageLink=Table Name=CONST(Item),
No.=FIELD(No.);
Image=Text }
{ 1100409055;2 ;Action ;
Name=Translations;
CaptionML=[ENU=&Translations;
ESP=&Traducciones];
RunObject=Page 35;
RunPageLink=Item No.=FIELD(No.),
Variant Code=CONST();
Image=Translations }
{ 1100409053;2 ;Action ;
Name=Picture;
CaptionML=[ENU=&Picture;
ESP=&Imagen];
RunObject=Page 346;
RunPageLink=No.=FIELD(No.),
Date Filter=FIELD(Date Filter),
Global Dimension 1 Filter=FIELD(Global Dimension
1 Filter),
Global Dimension 2 Filter=FIELD(Global Dimension
2 Filter),
Location Filter=FIELD(Location Filter),
Drop Shipment Filter=FIELD(Drop Shipment Filter),
Variant Filter=FIELD(Variant Filter),
Bin Filter=FIELD(Bin Filter);
Promoted=Yes;
Image=Picture;
PromotedCategory=Category4 }
{ 1100409062;2 ;Action ;
Name=Barcode List;
ShortCutKey=Shift+Ctrl+B;
CaptionML=[ENU=&Barcode List;
ESP=Lista C�ds. &Barras];
RunObject=Page 99001453;
RunPageLink=Item No.=FIELD(No.);
Promoted=Yes;
Image=BarCode;
PromotedCategory=Category4 }
{ 1100409059;2 ;ActionGroup;
Name=&Labels and Printing;
CaptionML=[ENU=&Labels and Printing;
ESP=&Etiquetas e Impresi�n];
Image=Print }
{ 1100409085;3 ;Action ;
Name=Shelf Label Setup;
CaptionML=[ENU=Shelf La&bel Setup;
ESP=Conf. Eti&quetas Estanter�a];
RunObject=Page 99001709;
RunPageLink=Item No.=FIELD(No.);
Image=SetupList }
{ 1100409077;3 ;Action ;
Name=Item Label Setup;
CaptionML=[ENU=&Item Label Setup;
ESP=Conf. Etiquetas &Producto];
RunObject=Page 99001732;
RunPageLink=Item No.=FIELD(No.);
Image=PriceWorksheet }
{ 1100409076;3 ;Separator }
{ 1100409075;3 ;Action ;
Name=POS Terminal Receipt Text;
CaptionML=[ENU=POS Terminal &Receipt Text;
ESP=Texto &Recibo TPV];
RunObject=Page 99009517;
RunPageLink=Item No.=FIELD(No.),
Text Type=CONST(Receipt Text);
Image=Text }
{ 1100409074;3 ;Action ;
Name=POS Terminal Sales Text;
CaptionML=[ENU=POS Terminal &Sales Text;
ESP=Texto &Ventas TPV];
RunObject=Page 99009517;
RunPageLink=Item No.=FIELD(No.),
Text Type=CONST(Sales Text);
Visible=FALSE;
Image=Description }
{ 1100409073;3 ;Action ;
Name=POS Terminal Price Lookup;
CaptionML=[ENU=POS Terminal &Price Lookup Txt.;
ESP=Txt. Lookup &Precio TPV];
RunObject=Page 99009517;
RunPageLink=Item No.=FIELD(No.),
Text Type=CONST(Price Lookup Text);
Visible=FALSE;
Image=Price }
{ 1100409069;3 ;Separator }
{ 1100409064;3 ;Action ;
Name=Extra Print Setup;
CaptionML=[ENU=E&xtra Print Setup;
ESP=Conf. E&xtra Impr.];
RunObject=Page 99001780;
RunPageLink=Table No.=CONST(27),
Key=FIELD(No.);
Image=PrintInstallment }
{ 1100409033;2 ;Action ;
Name=Images;
CaptionML=[ENU=&Images;
ESP=&Im�genes];
Image=Picture;
RunPageMode=View;
OnAction=VAR
RecRef@1100409001 : RecordRef;
BOUtils_l@1100409000 : Codeunit 99001452;
BEGIN
RecRef.GETTABLE(Rec);
BOUtils_l.DisplayRetailImage(RecRef);
END;
}
{ 1200070008;2 ;Action ;
Name=Item HTML Web;
CaptionML=[ENU=Item &HTML;
ESP=&HTML Producto];
RunObject=Page 99009623;
RunPageLink=Item No.=FIELD(No.);
Visible=VisibleInWebClient;
Image=ElectronicDoc }
{ 1100409045;2 ;Action ;
Name=Item HTML Windows;
CaptionML=[ENU=Item &HTML;
ESP=&HTML Producto];
RunObject=Page 99001749;
RunPageLink=Item No.=FIELD(No.);
Visible=VisibleInWinClient;
Image=ElectronicDoc }
{ 1100409011;2 ;ActionGroup;
Name=&Groups and Links;
CaptionML=[ENU=&Groups and Links;
ESP=&Grupos y Links];
Image=ItemGroup }
{ 1100409086;3 ;Action ;
Name=Attributes;
CaptionML=[ENU=&Attributes;
ESP=&Atributos];
RunObject=Page 10000733;
RunPageLink=Link Type=CONST(Item),
Link Field 1=FIELD(FILTER(No.));
Image=SetupList }
{ 1100409090;3 ;Action ;
Name=Special Groups;
CaptionML=[ENU=Special &Groups;
ESP=&Grupos Especial];
RunObject=Page 10000819;
RunPageLink=Item No.=FIELD(No.);
Promoted=Yes;
Image=IndustryGroups;
PromotedCategory=Category4 }
{ 1100409089;3 ;Action ;
Name=Events;
CaptionML=[ENU=&Events;
ESP=&Eventos];
RunObject=Page 99001692;
RunPageView=SORTING(Item No.);
RunPageLink=Item No.=FIELD(No.);
Image=Event }
{ 1100409065;3 ;Action ;
Name=Item Status;
CaptionML=[ENU=Item S&tatus;
ESP=Es&tado Producto];
RunObject=Page 99001691;
RunPageView=SORTING(Item No.,Variant Dimension 1 Code,Variant
Code,Store Group Code,Location Code,Starting Date);
RunPageLink=Item No.=FIELD(No.);
Image=Status }
{ 1100409162;3 ;Separator }
{ 1100409160;3 ;Action ;
Name=Linked Items;
CaptionML=[ENU=&Linked Items;
ESP=Productos Vincu&lados];
RunObject=Page 99001455;
RunPageLink=Item No.=FIELD(No.);
Image=LinkWithExisting }
{ 1100409022;3 ;Action ;
Name=Where-Linked List;
CaptionML=[ENU=&Where-Linked List;
ESP=Lista &D�nde-vinculados];
RunObject=Page 99001456;
RunPageView=SORTING(Linked Item No.,Item No.);
RunPageLink=Linked Item No.=FIELD(No.);
Image=LinkAccount }
{ 1100225059;3 ;Action ;
Name=Abrir Ficha Producto Web;
Promoted=Yes;
PromotedIsBig=Yes;
Image=Web;
PromotedCategory=Process;
OnAction=BEGIN
//-MRW
LinkWeb:= '';
IF "Magento Code" <> 0 THEN BEGIN
LinkWeb :=
'http://www.mrwonderfulshop.es/es/catalog/product/view/id/'+FORMAT("Magento Code")
+'/';
HYPERLINK(LinkWeb);
END ELSE BEGIN
ERROR(Text50001);
END;
//+MRW
END;
}
{ 1100409091;1 ;ActionGroup;
Name=&Availability;
CaptionML=[ENU=&Availability;
ESP=&Disponibilidad];
Image=Items }
{ 1100409092;2 ;Action ;
Name=Items By Location;
AccessByPermission=TableData 14=R;
CaptionML=[ENU=Items b&y Location;
ESP=Prods. por &almac�n];
Image=ItemAvailbyLoc;
OnAction=VAR
ItemsByLocation@1001 : Page 491;
BEGIN
ItemsByLocation.SETRECORD(Rec);
ItemsByLocation.RUN;
END;
}
{ 1100409096;2 ;ActionGroup;
CaptionML=[ENU=&Item Availability by;
ESP=D&isponibilidad Producto por];
Image=ItemAvailability }
{ 1100409095;3 ;Action ;
Name=Retail Item Avail. by Period;
CaptionML=[ENU=&Period;
ESP=&Periodo];
RunObject=Page 99001523;
RunPageLink=No.=FIELD(No.),
Global Dimension 1 Filter=FIELD(Global Dimension
1 Filter),
Global Dimension 2 Filter=FIELD(Global Dimension
2 Filter),
Location Filter=FIELD(Location Filter),
Drop Shipment Filter=FIELD(Drop Shipment Filter),
Variant Filter=FIELD(Variant Filter),
Bin Filter=FIELD(Bin Filter);
Image=Period }
{ 1100409094;3 ;Action ;
Name=Retail Item Avail. by Variant;
CaptionML=[ENU=&Variant;
ESP=&Variante];
RunObject=Page 99001765;
RunPageLink=No.=FIELD(No.),
Global Dimension 1 Filter=FIELD(Global Dimension
1 Filter),
Global Dimension 2 Filter=FIELD(Global Dimension
2 Filter),
Location Filter=FIELD(Location Filter),
Drop Shipment Filter=FIELD(Drop Shipment Filter),
Variant Filter=FIELD(Variant Filter),
Bin Filter=FIELD(Bin Filter);
Image=ItemVariant }
{ 1100409093;3 ;Action ;
Name=Retail Item Avail. by Location;
CaptionML=[ENU=&Location;
ESP=A&lmac�n];
RunObject=Page 99001680;
RunPageLink=No.=FIELD(No.),
Global Dimension 1 Filter=FIELD(Global Dimension
1 Filter),
Global Dimension 2 Filter=FIELD(Global Dimension
2 Filter),
Location Filter=FIELD(Location Filter),
Drop Shipment Filter=FIELD(Drop Shipment Filter),
Variant Filter=FIELD(Variant Filter),
Bin Filter=FIELD(Bin Filter);
Image=Warehouse }
{ 1100409098;3 ;Action ;
Name=BOM Level;
CaptionML=[ENU=BOM Level;
ESP=Nivel L.M.];
Image=BOMLevel;
OnAction=BEGIN

ItemAvailFormsMgt.ShowItemAvailFromItem(Rec,ItemAvailFormsMgt.ByBOM);
END;
}
{ 1100409100;3 ;Action ;
Name=Timeline;
CaptionML=[ENU=Timeline;
ESP=L�nea Tiempo];
Image=Timeline;
OnAction=BEGIN
ShowTimelineFromItem(Rec);
END;
}
{ 1100409081;2 ;ActionGroup;
CaptionML=[ENU=&Retail Availability by;
ESP=Disponibilidad P&roducto Com. Min. por];
Image=ItemAvailability }
{ 1100409080;3 ;Action ;
Name=Retail Avail. by Variant;
CaptionML=[ENU=&Variant;
ESP=&Variante];
Image=ItemVariant;
OnAction=VAR
lExtVarValues@1100409001 : Record 10001413;
lRetailItemVarAwail@1100409000 : Page 99001643;
BEGIN
lExtVarValues.SETRANGE("Item No.", "No.");
IF lExtVarValues.FINDFIRST THEN BEGIN
lRetailItemVarAwail.SETRECORD(lExtVarValues);
lRetailItemVarAwail.ItemInitForm(Rec);
lRetailItemVarAwail.SETTABLEVIEW(lExtVarValues);
lRetailItemVarAwail.RUN;
END ELSE
MESSAGE(Text008);
END;
}
{ 1100409079;3 ;Action ;
Name=Retail Avail. by Variant - Location;
CaptionML=[ENU=Variant - &Location;
ESP=Variante - &Localizaci�n];
Image=Warehouse;
OnAction=VAR
lIVL@1100409000 : Page 99001644;
BEGIN
lIVL.ItemInit("No.", '', GETFILTER("Store
Filter"));
lIVL.RUN;
END;
}
{ 10014504;3 ;Action ;
Name=Retail Avail. by Var.Dim. - Loc.;
CaptionML=[ENU=Variant Dimension - Location;
ESP=Dimensi�n Variante - Almac�n];
Image=Warehouse;
OnAction=VAR
lRetailItemVarDimLocAvail@1100409000 : Page
10000855;
BEGIN
lRetailItemVarDimLocAvail.InitFormItem(Rec);
lRetailItemVarDimLocAvail.RUN;
END;
}
{ 1100409078;3 ;Action ;
Name=Retail Avail. by Variant - Prepack;
CaptionML=[ENU=Variant - &Prepack;
ESP=Variante - &Pre-embalaje];
Image=BOMLevel;
OnAction=VAR
lRetailItemVarPrepack@1100409000 : Page 99001702;
BEGIN
IF "BOM Type" = "BOM Type"::Prepack THEN BEGIN
lRetailItemVarPrepack.ItemInit(Rec);
lRetailItemVarPrepack.RUN;
END ELSE
ERROR(Text021);
END;
}
{ 1100225031;1 ;ActionGroup;
CaptionML=[ENU=Availability;
ESP=Stock Mr. Wonderful];
Image=ItemAvailability }
{ 1100225030;2 ;ActionGroup;
CaptionML=[ENU=Stock;
ESP=Stock];
Image=Statistics }
{ 1100225029;3 ;Action ;
Name=<Action110>;
CaptionML=[ENU=Event;
ESP=Evento];
Image=Event;
OnAction=BEGIN
ItemAvailFormsMgt.ShowItemAvailFromItem(Rec,ItemAvailFormsMgt.ByEvent);
END;
}
{ 1100225028;3 ;Action ;
CaptionML=[ENU=Period;
ESP=Periodo];
RunObject=Page 157;
RunPageLink=No.=FIELD(No.),
Global Dimension 1 Filter=FIELD(Global Dimension
1 Filter),
Global Dimension 2 Filter=FIELD(Global Dimension
2 Filter),
Location Filter=FIELD(Location Filter),
Drop Shipment Filter=FIELD(Drop Shipment Filter),
Variant Filter=FIELD(Variant Filter);
Image=Period }
{ 1100225027;3 ;Action ;
CaptionML=[ENU=Variant;
ESP=Variante];
RunObject=Page 5414;
RunPageLink=No.=FIELD(No.),
Global Dimension 1 Filter=FIELD(Global Dimension
1 Filter),
Global Dimension 2 Filter=FIELD(Global Dimension
2 Filter),
Location Filter=FIELD(Location Filter),
Drop Shipment Filter=FIELD(Drop Shipment Filter),
Variant Filter=FIELD(Variant Filter);
Image=ItemVariant }
{ 1100225026;3 ;Action ;
CaptionML=[ENU=Location;
ESP=Almac�n];
RunObject=Page 492;
RunPageLink=No.=FIELD(No.),
Global Dimension 1 Filter=FIELD(Global Dimension
1 Filter),
Global Dimension 2 Filter=FIELD(Global Dimension
2 Filter),
Location Filter=FIELD(Location Filter),
Drop Shipment Filter=FIELD(Drop Shipment Filter),
Variant Filter=FIELD(Variant Filter);
Image=Warehouse }
{ 1100225025;3 ;Action ;
CaptionML=[ENU=BOM Level;
ESP=Nivel L.M.];
Image=BOMLevel;
OnAction=BEGIN

ItemAvailFormsMgt.ShowItemAvailFromItem(Rec,ItemAvailFormsMgt.ByBOM);
END;
}
{ 1100225023;3 ;Action ;
CaptionML=[ENU=Timeline;
ESP=Escala de tiempo];
Image=Timeline;
OnAction=BEGIN
ShowTimelineFromItem(Rec);
END;
}
{ 1100409102;1 ;ActionGroup;
Name=&History;
CaptionML=[ENU=&History;
ESP=&Hist�rico];
Image=History }
{ 1100409111;2 ;ActionGroup;
CaptionML=[ENU=E&ntries;
ESP=&Movimientos];
Image=Entries }
{ 1100409110;3 ;Action ;
Name=Item Ledger Entries;
ShortCutKey=Ctrl+F7;
CaptionML=[ENU=Ledger E&ntries;
ESP=&Movimientos];
RunObject=Page 38;
RunPageView=SORTING(Item No.);
RunPageLink=Item No.=FIELD(No.);
Promoted=Yes;
Image=ItemLedger;
PromotedCategory=Category5 }
{ 1100409109;3 ;Action ;
Name=Reservation Entries;
CaptionML=[ENU=&Reservation Entries;
ESP=Movimientos &Reserva];
RunObject=Page 497;
RunPageView=SORTING(Item No.,Variant Code,Location
Code,Reservation Status);
RunPageLink=Reservation Status=CONST(Reservation),
Item No.=FIELD(No.);
Image=ReservationLedger }
{ 1100409108;3 ;Action ;
Name=Phys. Inventory Ledger Entries;
CaptionML=[ENU=&Phys. Inventory Ledger Entries;
ESP=Movs. Inventario &F�sico+];
RunObject=Page 390;
RunPageView=SORTING(Item No.);
RunPageLink=Item No.=FIELD(No.);
Image=PhysicalInventoryLedger }
{ 1100409106;3 ;Action ;
Name=Value Entries;
CaptionML=[ENU=&Value Entries;
ESP=Movs. &Valor];
RunObject=Page 5802;
RunPageView=SORTING(Item No.);
RunPageLink=Item No.=FIELD(No.);
Image=ValueLedger }
{ 1100409104;3 ;Action ;
Name=Item Tracking Entries;
CaptionML=[ENU=Item &Tracking Entries;
ESP=Movs. &seguim. prod.];
Image=ItemTrackingLedger;
OnAction=VAR
ItemTrackingDocMgt@1200070000 : Codeunit 6503;
BEGIN

ItemTrackingDocMgt.ShowItemTrackingForMasterData(3,'',"No.",'','','','');
END;
}
{ 1100409120;2 ;ActionGroup;
CaptionML=[ENU=&Statistics;
ESP=E&stad�sticas];
Image=Statistics }
{ 1100409118;3 ;Action ;
Name=Page Statistics;
ShortCutKey=F7;
CaptionML=[ENU=&Statistics;
ESP=E&stad�sticas];
Promoted=Yes;
Image=Statistics;
PromotedCategory=Category5;
OnAction=VAR
ItemStatistics@1100409000 : Page 5827;
BEGIN
ItemStatistics.SetItem(Rec);
ItemStatistics.RUN;
END;
}
{ 1100409117;3 ;Action ;
Name=Page Item Entry Statistics;
CaptionML=[ENU=Entr&y Statistics;
ESP=Estad�st&icas Mov.];
RunObject=Page 304;
RunPageLink=No.=FIELD(No.),
Date Filter=FIELD(Date Filter),
Global Dimension 1 Filter=FIELD(Global Dimension
1 Filter),
Global Dimension 2 Filter=FIELD(Global Dimension
2 Filter),
Location Filter=FIELD(Location Filter),
Drop Shipment Filter=FIELD(Drop Shipment Filter);
Promoted=Yes;
Image=EntryStatistics;
PromotedCategory=Category5 }
{ 1100409116;3 ;Action ;
Name=Page Retail Item Turnover;
CaptionML=[ENU=T&urnover;
ESP=Fact&uraci�n];
RunObject=Page 99001525;
RunPageLink=No.=FIELD(No.),
Global Dimension 1 Filter=FIELD(Global Dimension
1 Filter),
Global Dimension 2 Filter=FIELD(Global Dimension
2 Filter),
Location Filter=FIELD(Location Filter),
Drop Shipment Filter=FIELD(Drop Shipment Filter);
Promoted=Yes;
Image=Turnover;
PromotedCategory=Category5 }
{ 1100409030;3 ;Action ;
Name=Page Sales by Periods;
CaptionML=[ENU=S&ales by Periods;
ESP=Vent&as por Periodos];
RunObject=Page 99001527;
RunPageLink=No.=FIELD(No.);
Promoted=Yes;
Image=Sales;
PromotedCategory=Category5 }
{ 1100409115;3 ;Action ;
Name=Page Variant Matrix;
CaptionML=[ENU=&Variant Matrix;
ESP=Matriz &Variante];
Image=GL;
OnAction=VAR
Variantreg@1000000001 : Record 10001413;
DimensionForm@1000000000 : Page 10001424;
BEGIN
Variantreg.SETRANGE("Item No.","No.");
IF Variantreg.FINDFIRST THEN BEGIN
DimensionForm.SETRECORD(Variantreg);
DimensionForm.ItemSetFilters(Rec);
DimensionForm.SETTABLEVIEW(Variantreg);
DimensionForm.RUN;
END ELSE
MESSAGE(Text008);
END;
}
{ 1100409114;3 ;Action ;
Name=Page Variant Dimension;
CaptionML=[ENU=V&ariant Dimension;
ESP=Dimensi�n V&ariante];
Image=DimensionSets;
OnAction=VAR
"Variant-DimensionSales"@10012000 : Page 99001694;
BEGIN
IF "Variant Framework Code" = '' THEN
ERROR(Text008);
"Variant-DimensionSales".SetItemFilters(Rec);
"Variant-DimensionSales".RUN;
END;
}
{ 1100409113;3 ;Action ;
Name=Page Variant by Period;
CaptionML=[ENU=Variant by &Period;
ESP=Variante por &Periodo];
Image=Period;
OnAction=VAR
ItemVariantsalesByPeriod@10012000 : Page 99001693;
BEGIN
IF "Variant Framework Code" = '' THEN
ERROR(Text008);
ItemVariantsalesByPeriod.SetItemFilter(Rec);
ItemVariantsalesByPeriod.RUN;
END;
}
{ 1100409036;2 ;Action ;
CaptionML=[ENU=Co&mments;
ESP=C&omentarios];
RunObject=Page 124;
RunPageLink=Table Name=CONST(Item),
No.=FIELD(No.);
Image=ViewComments }
{ 1100409126;2 ;ActionGroup;
CaptionML=[ENU=Price &History;
ESP=&Hist�rico Precio];
Image=PriceAdjustment }
{ 1100409124;3 ;Action ;
CaptionML=[ENU=&Sales Price;
ESP=por &Localizaci�n];
RunObject=Page 10000723;
RunPageLink=Item No.=FIELD(No.),
Price Type=CONST(Sale);
Image=SalesPrices }
{ 1100409123;3 ;Action ;
CaptionML=[ENU=&Cost Price;
ESP=por &Periodo];
RunObject=Page 10000724;
RunPageLink=Price Type=CONST(Cost),
Item No.=FIELD(No.);
Image=Price }
{ 1100409122;3 ;Action ;
CaptionML=[ENU=&Vendor Price List;
ESP=Lista Precios Pro&veedor];
RunObject=Page 10000725;
RunPageLink=Price Type=CONST(Wholesale),
Item No.=FIELD(No.);
Image=PriceWorksheet }
{ 1100409139;1 ;ActionGroup;
CaptionML=[ENU=&Purchases;
ESP=&Compras] }
{ 1100409138;2 ;Action ;
CaptionML=[ENU=Ven&dors;
ESP=Provee&dores];
RunObject=Page 114;
RunPageView=SORTING(Item No.);
RunPageLink=Item No.=FIELD(No.);
Image=Vendor }
{ 1100409137;2 ;Action ;
CaptionML=[ENU=&Prices;
ESP=&Precios];
RunObject=Page 7012;
RunPageView=SORTING(Item No.);
RunPageLink=Item No.=FIELD(No.);
Image=Price }
{ 1100409136;2 ;Action ;
CaptionML=[ENU=&Line Discounts;
ESP=Descs. &L�nea];
RunObject=Page 7014;
RunPageLink=Item No.=FIELD(No.);
Image=LineDiscount }
{ 1100409134;2 ;Separator }
{ 1100409132;2 ;Action ;
CaptionML=[ENU=&Orders;
ESP=Pedid&os];
RunObject=Page 56;
RunPageView=SORTING(Document Type,Type,No.);
RunPageLink=Type=CONST(Item),
No.=FIELD(No.);
Image=Document }
{ 1100409130;2 ;Action ;
CaptionML=[ENU=&Return Orders;
ESP=&Devoluciones];
RunObject=Page 6643;
RunPageView=SORTING(Document Type,Type,No.);
RunPageLink=Type=CONST(Item),
No.=FIELD(No.);
Image=ReturnOrder }
{ 1100409149;1 ;ActionGroup;
CaptionML=[ENU=S&ales;
ESP=Ve&ntas] }
{ 1100409148;2 ;Action ;
CaptionML=[ENU=&Prices;
ESP=&Precios];
RunObject=Page 7002;
RunPageView=SORTING(Item No.);
RunPageLink=Item No.=FIELD(No.);
Image=Price }
{ 1100409147;2 ;Action ;
CaptionML=[ENU=&Line Discounts;
ESP=Descs. &L�nea];
RunObject=Page 7004;
RunPageView=SORTING(Type,Code);
RunPageLink=Type=CONST(Item),
Code=FIELD(No.);
Image=LineDiscount }
{ 1100409145;2 ;Action ;
CaptionML=[ENU=&Orders;
ESP=Pedid&os];
RunObject=Page 48;
RunPageView=SORTING(Document Type,Type,No.);
RunPageLink=Type=CONST(Item),
No.=FIELD(No.);
Image=Document }
{ 1100409144;2 ;Action ;
CaptionML=[ENU=&Return Orders;
ESP=&Devoluciones];
RunObject=Page 6633;
RunPageView=SORTING(Document Type,Type,No.);
RunPageLink=Type=CONST(Item),
No.=FIELD(No.);
Image=ReturnOrder }
{ 1100409142;2 ;Action ;
CaptionML=[ENU=&Competitor Prices;
ESP=Precios &Competidor];
RunObject=Page 10001468;
RunPageLink=Item No.=FIELD(No.);
Image=PriceWorksheet }
{ 1100409021;2 ;Action ;
CaptionML=[ENU=O&ffers;
ESP=O&fertas];
Promoted=Yes;
Image=Discount;
PromotedCategory=Category6;
OnAction=VAR
TmpPerDiscPri@1100409000 : TEMPORARY Record
99001453;
BEGIN
TmpPerDiscPri.Priority := 1;
TmpPerDiscPri."No." := "No.";
TmpPerDiscPri.INSERT;
PAGE.RUN(99001844,TmpPerDiscPri);
END;
}
{ 1200070001;2 ;Action ;
CaptionML=[ENU=FBP;
ESP=FBP];
Image=CalculateRemainingUsage;
OnAction=VAR
FBPHeaderTemp@1200070001 : TEMPORARY Record
99009600;
FBPUtility@1200070000 : Codeunit 99009600;
FrequentBuyerPrograms@1200070002 : Page 99009602;
BEGIN
IF FrequentBuyerPrograms.MarkFBPsWithItemNo("No.")
> 0 THEN BEGIN
FrequentBuyerPrograms.EDITABLE(FALSE);
FrequentBuyerPrograms.RUN;
END ELSE

MESSAGE(Text022,TABLECAPTION,FrequentBuyerPrograms.CAPTION);
END;
}
{ 1100225060;2 ;Action ;
Name=Calcular Tarifas;
Promoted=Yes;
Enabled=Permisos;
PromotedIsBig=Yes;
Image=Price;
PromotedCategory=Process;
OnAction=BEGIN
//Calculo tarifas
GestionTarifa.CrearTarifas(Rec."No.");
//<MRW042
GestionTarifa.Rate(Rec."No.");
//MRW042>
END;
}
{ 1100409150;1 ;ActionGroup;
CaptionML=[ENU=&Retail/POS;
ESP=&Retail/TPV] }
{ 1100409153;2 ;ActionGroup;
CaptionML=[ENU=P&OS;
ESP=&TPV];
Image=Calculate }
{ 1100409152;3 ;Action ;
CaptionML=[ENU=&Cross-selling;
ESP=Ventas Cru&zadas];
RunObject=Page 99001454;
RunPageLink=Table ID=CONST(27),
Value=FIELD(No.),
Usage Category=CONST(Cross-selling);
Image=Zones }
{ 1100409151;3 ;Action ;
CaptionML=[ENU=Infoco&des;
ESP=Infoc�&digos];
RunObject=Page 99001454;
RunPageLink=Table ID=CONST(27),
Value=FIELD(No.),
Usage Category=CONST(" ");
Image=CodesList }
{ 1100409020;3 ;Action ;
CaptionML=[ENU=&Extra Print Setup;
ESP=Conf Impr. &Extra];
RunObject=Page 99001780;
RunPageLink=Table No.=CONST(27),
Key=FIELD(No.);
Image=PrintInstallment }
{ 1100409066;3 ;Action ;
CaptionML=[ENU=&POS Actions;
ESP=Acciones T&PV];
RunObject=Page 99001552;
RunPageView=SORTING(Data Trigger,Data ID);
RunPageLink=Data Trigger=CONST(Item),
Data ID=FIELD(No.);
Image=View }
{ 1100409159;2 ;ActionGroup;
CaptionML=[ENU=Store In&formation;
ESP=In&formaci�n Tienda];
Image=ItemTracking }
{ 1100409158;3 ;Action ;
ShortCutKey=Shift+Ctrl+Y;
CaptionML=[ENU=&Item Store Information;
ESP=&Informaci�n Producto Tienda];
RunObject=Page 10000859;
RunPageLink=Item Filter=FIELD(No.);
Image=Item }
{ 1100409157;3 ;Action ;
CaptionML=[ENU=Location &Distribution;
ESP=Localizaci�n &Distribuci�n];
RunObject=Page 99001591;
RunPageLink=Table ID=CONST(27),
Value=FIELD(No.);
Image=ItemTracking }
{ 1100409023;3 ;Action ;
CaptionML=[ENU=Section &Locations;
ESP=&Localizaciones Secci�n];
RunObject=Page 99001650;
RunPageLink=Item No.=FIELD(No.);
Image=Bin }
{ 1100409156;2 ;ActionGroup;
CaptionML=[ENU=Ac&tions;
ESP=A&cciones];
Image=Database }
{ 1100409155;3 ;Action ;
CaptionML=[ENU=&View &Preactions;
ESP=&Ver &Preacciones];
RunObject=Page 99001846;
RunPageView=SORTING(Table No.,Entry No.);
RunPageLink=Table No.=CONST(27),
Key=FIELD(No.);
Image=ViewPage }
{ 1100409154;3 ;Action ;
CaptionML=[ENU=&View Actions;
ESP=&Ver Acciones];
RunObject=Page 99001630;
RunPageView=SORTING(Table No.,Entry No.);
RunPageLink=Table No.=CONST(27),
Key=FIELD(No.);
Image=ViewOrder }
{ 1100409163;2 ;Action ;
CaptionML=[ENU=Item in Dyn. Item Hierarchy;
ESP=Producto en Jerarqu�a Prod. Din.];
Image=Hierarchy;
OnAction=VAR
ItemInHrchy@1100409000 : Page 10000776;
BEGIN
CLEAR(ItemInHrchy);
ItemInHrchy.SetItem("No.");
ItemInHrchy.RUN;
END;
}
{ 1100409179;1 ;ActionGroup;
CaptionML=[ENU=Assembly/Production;
ESP=Montaje/Producci�n];
Image=Production }
{ 1100409178;2 ;Action ;
CaptionML=[ENU=Structure;
ESP=Estructura];
Image=Hierarchy;
OnAction=VAR
BOMStructure@1000 : Page 5870;
BEGIN
BOMStructure.InitItem(Rec);
BOMStructure.RUN;
END;
}
{ 1100409177;2 ;Action ;
CaptionML=[ENU=Cost Shares;
ESP=Costes Compartidos];
Image=CostBudget;
OnAction=VAR
BOMCostShares@1000 : Page 5872;
BEGIN
BOMCostShares.InitItem(Rec);
BOMCostShares.RUN;
END;
}
{ 1100409176;2 ;ActionGroup;
CaptionML=[ENU=Assemb&ly;
ESP=Monta&je];
Image=AssemblyBOM }
{ 1100409175;3 ;Action ;
Name=AssemblyBOM;
CaptionML=[ENU=Assembly BOM;
ESP=L.M. de ensamblado];
RunObject=Page 36;
RunPageLink=Parent Item No.=FIELD(No.);
Image=BOM }
{ 1100409174;3 ;Action ;
CaptionML=[ENU=Where-Used;
ESP=Donde-Usado];
RunObject=Page 37;
RunPageView=SORTING(Type,No.);
RunPageLink=Type=CONST(Item),
No.=FIELD(No.);
Image=Track }
{ 1100409173;3 ;Action ;
AccessByPermission=TableData 90=R;
CaptionML=[ENU=Calc. Stan&dard Cost;
ESP=Calc. Coste Est�n&dar];
Image=CalculateCost;
OnAction=BEGIN
CLEAR(CalculateStdCost);
CalculateStdCost.CalcItem("No.",TRUE);
END;
}
{ 1100409172;3 ;Action ;
AccessByPermission=TableData 90=R;
CaptionML=[ENU=Calc. Unit Price;
ESP=C�lc. Precio Unitario];
Image=SuggestItemPrice;
OnAction=BEGIN
CLEAR(CalculateStdCost);
CalculateStdCost.CalcAssemblyItemPrice("No.");
END;
}
{ 1100409171;2 ;ActionGroup;
CaptionML=[ENU=Production;
ESP=Producci�n];
Image=Production }
{ 1100409170;3 ;Action ;
CaptionML=[ENU=Production BOM;
ESP=L.M. Producci�n];
RunObject=Page 99000786;
RunPageLink=No.=FIELD(No.);
Image=BOM }
{ 1100409169;3 ;Action ;
AccessByPermission=TableData 99000771=R;
CaptionML=[ENU=Where-Used;
ESP=Donde-Usado];
Image=Where-Used;
OnAction=VAR
ProdBOMWhereUsed@1001 : Page 99000811;
BEGIN
ProdBOMWhereUsed.SetItem(Rec,WORKDATE);
ProdBOMWhereUsed.RUN;
END;
}
{ 1100409168;3 ;Action ;
AccessByPermission=TableData 99000771=R;
CaptionML=[ENU=Calc. Stan&dard Cost;
ESP=Calc. Coste Est�n&dar];
Image=CalculateCost;
OnAction=BEGIN
CLEAR(CalculateStdCost);
CalculateStdCost.CalcItem("No.",FALSE);
END;
}
{ 1100409161;2 ;Action ;
CaptionML=[ENU=Prepack;
ESP=Pre-embalaje];
Image=BOMRegisters;
OnAction=VAR
lRetailBOMComp@1100409000 : Codeunit 99001472;
BEGIN
lRetailBOMComp.RetailBOMViewEdit("No.", TRUE);
END;
}
{ 1100409082;1 ;ActionGroup;
CaptionML=[ENU=&Warehouse;
ESP=&Almac�n] }
{ 1100409165;2 ;Action ;
CaptionML=[ENU=Stockkeepin&g Units;
ESP=Unida&des Almacenamiento];
RunObject=Page 5701;
RunPageView=SORTING(Item No.);
RunPageLink=Item No.=FIELD(No.);
Image=SKU }
{ 1100409128;2 ;Action ;
CaptionML=[ENU=&Replenishment Control Data;
ESP=Datos Control &Reaprovisionamiento];
Promoted=Yes;
PromotedIsBig=Yes;
Image=DataEntry;
PromotedCategory=Process;
OnAction=VAR
lReplenCalculation@1100409000 : Codeunit 10012201;
BEGIN
lReplenCalculation.EditControlData("No.");
END;
}
{ 1100409005;2 ;Action ;
CaptionML=[ENU=Dimension Pattern;
ESP=Patr�n Dimensi�n];
RunObject=Page 10012244;
RunPageView=SORTING(Item No.,Dimension 1,Group Type,Group);
RunPageLink=Item No.=FIELD(No.);
Image=DimensionSets }
{ 1000000001;1 ;ActionGroup;
CaptionML=[ENU=LS Recommend;
ESP=LS Recomienda] }
{ 1000000000;2 ;Action ;
Name=AddItemToRecommendationCatalog;
CaptionML=[ENU=Add Item to Catalog;
ESP=A�adir Producto a Cat�logo];
Image=Add;
OnAction=VAR
LSRecommendsFunctions@1000000000 : Codeunit
10016250;
BEGIN
LSRecommendsFunctions.Initialize(FALSE);
LSRecommendsFunctions.AddItemToCatalog(Rec);
END;
}
{ 1000000008;1 ;ActionGroup;
CaptionML=[ENU=&Item;
ESP=&Producto] }
{ 1000000067;2 ;Action ;
ShortCutKey=Shift+F5;
CaptionML=[ENU=&Card;
ESP=&Ficha];
RunObject=Page 30;
RunPageLink=No.=FIELD(No.);
Image=EditLines }
{ 1100225035;1 ;ActionGroup;
CaptionML=[ENU=Labels;
ESP=Etiquetas];
ActionContainerType=NewDocumentItems }
{ 1100225034;2 ;Action ;
CaptionML=[ENU=EAN13 Labels;
ESP=Etiquetas EAN13];
Promoted=Yes;
Image=Print;
PromotedCategory=Report;
OnAction=VAR
ItemLabels@7141743 : Report 50031;
Item@7141744 : Record 27;
IUM@7141745 : Record 5404;
BEGIN
//-025
CLEAR(ItemLabels);
IUM.RESET;
IUM.SETRANGE("Item No.","No.");
IUM.SETRANGE("Label EAN Type",IUM."Label EAN
Type"::EAN13);
IF IUM.FINDSET THEN BEGIN
Item.GET("No.");
Item.SETRECFILTER;
ItemLabels.SetUOM(IUM.Code);
ItemLabels.SetQuantity(1);
ItemLabels.SetSmall(FALSE);
ItemLabels.SETTABLEVIEW(Item);
ItemLabels.RUN;
END;
//+025
END;
}
{ 1100225033;2 ;Action ;
CaptionML=[ENU=EAN13 Small Label;
ESP=Etiquetas EAN13 Peque�a];
Promoted=Yes;
Image=Print;
PromotedCategory=Report;
OnAction=VAR
ItemLabels@7141743 : Report 50031;
Item@7141744 : Record 27;
IUM@7141745 : Record 5404;
BEGIN
//-025
CLEAR(ItemLabels);
IUM.RESET;
IUM.SETRANGE("Item No.","No.");
IUM.SETRANGE("Label EAN Type",IUM."Label EAN
Type"::EAN13);
IF IUM.FINDSET THEN BEGIN
Item.GET("No.");
Item.SETRECFILTER;
ItemLabels.SetUOM(IUM.Code);
ItemLabels.SetQuantity(1);
ItemLabels.SetSmall(TRUE);
ItemLabels.SETTABLEVIEW(Item);
ItemLabels.RUN;
END;
//+025
END;
}
{ 1100225032;2 ;Action ;
CaptionML=[ENU=DUN14 Labels;
ESP=Etiquetas DUN14];
Promoted=Yes;
Image=Print;
PromotedCategory=Report;
OnAction=VAR
ItemLabels@7141745 : Report 50031;
Item@7141744 : Record 27;
IUM@7141743 : Record 5404;
BEGIN
//-025
CLEAR(ItemLabels);
IUM.RESET;
IUM.SETRANGE("Item No.","No.");
IUM.SETRANGE("Label EAN Type",IUM."Label EAN
Type"::DUN14);
IF IUM.FINDSET THEN BEGIN
Item.GET("No.");
Item.SETRECFILTER;
ItemLabels.SetUOM(IUM.Code);
ItemLabels.SetQuantity(1);
ItemLabels.SETTABLEVIEW(Item);
ItemLabels.RUN;
END;
//+025
END;
}
{ 1900000004;0 ;ActionContainer;
ActionContainerType=ActionItems }
{ 1000000009;1 ;ActionGroup;
CaptionML=[ENU=F&unctions;
ESP=Acci&ones] }
{ 1200070070;2 ;Action ;
CaptionML=[ENU=Insert New Item &Defaults;
ESP=Insertar Valores &Defecto Nuevo Prod.];
Promoted=Yes;
Image=ApplyTemplate;
PromotedCategory=Process;
OnAction=VAR
DefRec@1200070000 : Record 10000730;
ItemDefRec@1200070001 : Record 27;
CheckItem@1200070002 : Codeunit 10000719;
NewNo@1000000001 : Code[20];
BEGIN
NewNo := CheckItem.CreateItem;
IF NewNo <> '' THEN BEGIN
GET(NewNo);
CurrPage.UPDATE(FALSE);
END;
END;
}
{ 1000000045;2 ;Action ;
CaptionML=[ENU=&Basic Error Check;
ESP=&Validaci�n Error B�sico];
Image=ErrorLog;
OnAction=VAR
ItemErrorCheck@1200070001 : Record 10001405;
BEGIN
IF "Item Error Check Code" = '' THEN
ERROR(Text009)
ELSE BEGIN
ItemErrorCheck.GET("Item Error Check Code");
CODEUNIT.RUN(ItemErrorCheck."Show Codeunit
Object ID",Rec);
MODIFY;
END;
END;
}
{ 1200070005;2 ;Action ;
CaptionML=[ENU=Where Used on POS;
ESP=D�nde se usa en el TPV];
Promoted=Yes;
Image=Where-Used;
PromotedCategory=Process;
OnAction=VAR
ItemWhereUsedTmp@1200070000 : TEMPORARY Record
99008917;
ObjWhereUsedUtility@1200070001 : Codeunit
10000745;
BEGIN

ObjWhereUsedUtility.POSItemWhereUsed(Rec,ItemWhereUsedTmp);

Rec.GET("No.");
CurrPage.UPDATE(TRUE);
END;
}
{ 1200070085;2 ;Separator }
{ 1200071006;2 ;Action ;
CaptionML=[ENU=Store Inventory Action;
ESP=Acci�n Inventario Tienda];
Image=NewRow;
OnAction=VAR
StoreInventoryLineTemp@1200070001 : TEMPORARY
Record 10001313;
StoreInventoryWorksheet@10014500 : Record
10001312;
StoreInventoryManagement@1200070000 : Codeunit
10001319;
EnterQty@1200070003 : TextConst 'ENU=Enter
quantity;ESP=Insertar cantidad';
Dialogue@1200070002 : DotNet
"'Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'.Microsoft.VisualBasic.Interaction" RUNONCLIENT;
EnteredQty@1200070004 : Text;
QtyError@1200070005 : TextConst 'ENU=%1 not a
valid quantity value.;ESP=%1 no es un valor cantidad v�lido.';
BEGIN
StoreInventoryLineTemp."Item No." := "No.";
StoreInventoryLineTemp.Description := Description;
EnteredQty := Dialogue.InputBox(EnterQty,"No." + '
- ' + Description,'',100,100);
IF NOT
EVALUATE(StoreInventoryLineTemp.Quantity,EnteredQty) THEN
ERROR(STRSUBSTNO(QtyError,EnteredQty));
StoreInventoryLineTemp."Variant Code" := '';
StoreInventoryLineTemp.INSERT;
StoreInventoryLineTemp.SETRECFILTER;

StoreInventoryManagement.CreateWorksheetLines(StoreInventoryLineTemp,StoreInventory
Worksheet);

StoreInventoryManagement.EditWorksheet(StoreInventoryWorksheet,'');
END;
}
{ 3 ;2 ;Action ;
Name=CalculateCountingPeriod;
AccessByPermission=TableData 7380=R;
CaptionML=[ENU=C&alculate Counting Period;
ESP=C&alcular Periodo Recuento];
Image=CalculateCalendar;
OnAction=VAR
Item@1001 : Record 27;
PhysInvtCountMgt@1000 : Codeunit 7380;
BEGIN
Item.SETRANGE("No.","No.");
PhysInvtCountMgt.UpdateItemPhysInvtCount(Item);
END;
}
{ 9 ;1 ;ActionGroup;
CaptionML=[ENU=Printing;
ESP=Impresi�n] }
{ 15 ;2 ;Action ;
CaptionML=[ENU=Print &Shelf Labels;
ESP=Imprimir Etiquetas &Estanter�a];
Image=PrintForm;
OnAction=VAR
LabelUtiliy@1200070000 : Codeunit 99001481;
BEGIN
LabelUtiliy.QuickPrintShelfLabels("No.",'');
END;
}
{ 13 ;2 ;Action ;
CaptionML=[ENU=Print &Item Labels;
ESP=Imprimir Etiquetas &Producto];
Image=PrintCheck;
OnAction=VAR
LabelUtiliy@1200070000 : Codeunit 99001481;
BEGIN
LabelUtiliy.QuickPrintItemLabels("No.",'');
END;
}
{ 11 ;2 ;Action ;
CaptionML=[ENU=&Print Price Reduction Labels;
ESP=Im&primir Etiquetas Reducci�n Precio];
Image=PrintCover;
OnAction=VAR
PriceReductionForm@10012000 : Page 99001712;
BEGIN
PriceReductionForm.SetOpenItem("No.");
PriceReductionForm.RUN;
END;
}
{ 1100409183;1 ;ActionGroup;
CaptionML=[ENU=&Barcodes;
ESP=C�ds. &Barras] }
{ 1100409180;2 ;Action ;
CaptionML=[ENU=&Create Barcode;
ESP=&Crear C�d. Barras];
Image=BarCode;
OnAction=VAR
BarcodeMgmt@1000000001 : Codeunit 99001450;
Barcodes_l@1000000000 : Record 99001451;
BEGIN
Barcodes_l.INIT;
Barcodes_l."Barcode No." :=
BarcodeMgmt.RetBarcodeFromNoSeries(Rec);
Barcodes_l.Description := Description;
Barcodes_l.VALIDATE("Item No.","No.");
IF Barcodes_l."Barcode No." <> '' THEN
IF Barcodes_l.INSERT(TRUE) THEN;
END;
}
{ 1100409181;2 ;Action ;
CaptionML=[ENU=Create Barcode from &Mask;
ESP=Crear C�ds. Barras desde &M�scara];
Image=BeginningText;
OnAction=BEGIN
CreateBarcodeFromMask;
END;
}
{ 1100409186;1 ;ActionGroup;
CaptionML=[ENU=&General;
ESP=&General] }
{ 1100409184;2 ;Action ;
CaptionML=[ENU=Requisition Worksheet;
ESP=Hoja de Trabajo Requisici�n];
RunObject=Page 291;
Promoted=Yes;
Image=Worksheet;
PromotedCategory=Process }
{ 1100409182;2 ;Action ;
CaptionML=[ENU=Item Journal;
ESP=Diario productos];
RunObject=Page 40;
Promoted=Yes;
Image=Journals;
PromotedCategory=Process }
{ 1100409167;2 ;Action ;
CaptionML=[ENU=Item Reclassification Journal;
ESP=Diario Reclasificaci�n Producto];
RunObject=Page 393;
Promoted=Yes;
Image=Journals;
PromotedCategory=Process }
{ 1100409166;2 ;Action ;
CaptionML=[ENU=Item Tracing;
ESP=Trazab. Producto];
RunObject=Page 6520;
Promoted=Yes;
Image=ItemTracing;
PromotedCategory=Process }
{ 10014502;1 ;ActionGroup;
CaptionML=[ENU=Hierarchies;
ESP=Jerarqu�as] }
{ 10714503;2 ;Action ;
Name=ItemToHierarchies;
CaptionML=[ENU=Add Item to Hierarchies;
ESP=A�adir Producto a Jerarqu�as];
Image=Hierarchy;
OnAction=VAR
HierarchyTreeLink@10014501 : Record 10000922;
HierarchiesandNodes@10014500 : Page 10000938;
BEGIN
HierarchyTreeLink.Type :=
HierarchyTreeLink.Type::Item;
HierarchyTreeLink."No." := "No.";
HierarchyTreeLink.Description := Description;

HierarchiesandNodes.InitLinkToAdd(HierarchyTreeLink);
HierarchiesandNodes.RUNMODAL;
END;
}
{ 10014503;2 ;Action ;
CaptionML=[ENU=Item Links;
ESP=V�nculos Producto];
RunObject=Page 10000939;
RunPageLink=Item No.=FIELD(No.);
Image=Links }
{ 1100225058;1 ;ActionGroup;
CaptionML=[ENU=Magento;
ESP=Magento];
Image=Sales }
{ 1100225057;2 ;Action ;
CaptionML=[ENU=Log;
ESP=Log];
RunObject=Page 50003;
RunPageView=SORTING(Entry No.,Operation,Action)
ORDER(Descending)
WHERE(Operation=FILTER(Item|Picture|Stock|Price|
Promos));
RunPageLink=Code=FIELD(No.);
Image=Log;
PromotedCategory=Category7 }
{ 1100225056;2 ;ActionGroup;
CaptionML=[ENU=Item Info;
ESP=Datos Producto];
ActionContainerType=NewDocumentItems;
Image=Administration }
{ 1100225055;3 ;Action ;
CaptionML=[ENU=New;
ESP=Alta];
Image=MoveUp;
PromotedCategory=Category7;
OnAction=BEGIN
MagentoItem(1,0); //<073
MagentoItem(1,1); //<396
END;
}
{ 1100225054;3 ;Action ;
CaptionML=[ENU=Update;
ESP=Modificaci�n];
Image=Restore;
PromotedCategory=Category7;
OnAction=BEGIN
MagentoItem(2,0); //<073
MagentoItem(2,1); //<396
END;
}
{ 1100225053;3 ;Action ;
CaptionML=[ENU=Delete;
ESP=Baja];
Image=MoveDown;
PromotedCategory=Category7;
OnAction=BEGIN
MagentoItem(3,0); //<073
MagentoItem(3,1); //<396
END;
}
{ 1100225052;2 ;ActionGroup;
CaptionML=ESP=Imagenes;
Image=Setup }
{ 1100225051;3 ;Action ;
CaptionML=[ENU=New;
ESP=Alta];
Image=MoveUp;
PromotedCategory=Category7;
OnAction=BEGIN
MagentoPicture(1); //<073
END;
}
{ 1100225050;3 ;Action ;
CaptionML=[ENU=Update;
ESP=Modificaci�n];
Image=Restore;
PromotedCategory=Category7;
OnAction=BEGIN
MagentoPicture(2); //<073
END;
}
{ 1100225049;3 ;Action ;
CaptionML=[ENU=Delete;
ESP=Baja];
Image=MoveDown;
PromotedCategory=Category7;
OnAction=BEGIN
MagentoPicture(3); //<073
END;
}
{ 1100225048;2 ;Action ;
CaptionML=[ENU=Stock;
ESP=Stock];
Image=Confirm;
PromotedCategory=Category7;
OnAction=BEGIN
MagentoStock; //<073
END;
}
{ 1100225046;2 ;Action ;
CaptionML=[ENU=Prices;
ESP=Tarifas];
Image=Price;
PromotedCategory=Category4;
OnAction=VAR
MagentoLogEntry@7141744 : Record 50002;
Magento@7141743 : Codeunit 50003;
BEGIN
MagentoPrices; //<073
MagentoPricesM2; //<396
END;
}
{ 1900000006;0 ;ActionContainer;
ActionContainerType=Reports }
}
}
CONTROLS
{
{ 1900000001;0;Container;
ContainerType=ContentArea }

{ 1 ;1 ;Group ;
CaptionML=[ENU=General;
ESP=General] }

{ 1100409035;2;Field ;
SourceExpr="No.";
Importance=Promoted;
Editable=FALSE;
ImplicitType=Code20 }

{ 1100409032;2;Field ;
SourceExpr=Description;
ShowMandatory=TRUE;
ImplicitType=Text100 }

{ 1100409029;2;Field ;
SourceExpr="Division Code";
ImplicitType=Code10 }

{ 1100225000;2;Field ;
SourceExpr="Search Description";
ImplicitType=Code100 }

{ 1100409026;2;Field ;
SourceExpr="Item Category Code";
LookupPageID=Retail Item Categories;
ImplicitType=Code20 }

{ 1100409025;2;Field ;
SourceExpr="Product Group Code";
LookupPageID=Retail Product Groups;
ImplicitType=Code10 }

{ 1100409019;2;Field ;
SourceExpr="Unit Price";
Importance=Promoted;
Editable=UnitPriceEditable;
OnValidate=BEGIN
CurrPage.UPDATE;
END;

ImplicitType=Decimal }

{ 1100409017;2;Field ;
SourceExpr="Unit Price Including VAT";
Visible=FALSE;
Editable=UnitPriceIncludingVATEditable;
OnValidate=BEGIN
CurrPage.UPDATE;
END;

ImplicitType=Decimal }

{ 1100409013;2;Field ;
SourceExpr="Price Includes VAT";
ImplicitType=Boolean }

{ 1100409010;2;Field ;
SourceExpr="VAT Bus. Posting Gr. (Price)";
Importance=Additional;
ImplicitType=Code20 }

{ 1100409007;2;Field ;
SourceExpr="Base Unit of Measure";
OnValidate=BEGIN
CurrPage.UPDATE(TRUE);
END;

ImplicitType=Code10 }

{ 12 ;2 ;Field ;
DrillDown=No;
CaptionML=[ENU=Barcode No.;
ESP=No. C�d. Barras];
SourceExpr=DefaultBarcode;
OnLookup=BEGIN
Barcodes.SETCURRENTKEY("Item No.","Barcode No.");
Barcodes.SETRANGE("Item No.","No.");
PAGE.RUNMODAL(99001453,Barcodes);
CurrPage.UPDATE;
END;

ImplicitType=Code22 }

{ 1100409028;2;Field ;
CaptionML=[ENU=Barcode Mask;
ESP=M�scara Cod. Barras];
SourceExpr="Barcode Mask";
ImplicitType=Code22 }

{ 1100409087;2;Field ;
SourceExpr="Common Item No.";
Importance=Additional;
ImplicitType=Code20 }

{ 1200070030;2;Field ;
DrillDown=No;
CaptionML=[ENU=Special Group Code;
ESP=C�d. Grupo Especial];
SourceExpr="Special Group Code";
ImplicitType=Code10 }

{ 1000000071;2;Field ;
CaptionML=[ENU=Variant Framework Code;
ESP=C�d. Estructura Variantes];
SourceExpr="Variant Framework Code";
ImplicitType=Code20 }

{ 20 ;2 ;Field ;
SourceExpr=Blocked;
Importance=Additional;
ImplicitType=Boolean }

{ 1200000048;2;Field ;
SourceExpr="Item Family Code";
Importance=Additional;
ImplicitType=Code10 }

{ 1200070034;2;Field ;
SourceExpr="Print Variants Shelf Labels";
Importance=Additional;
ImplicitType=Boolean }

{ 223 ;2 ;Field ;
CaptionML=[ENU=Date Created;
ESP=Fecha Creaci�n];
SourceExpr="Date Created";
ImplicitType=Date }

{ 221 ;2 ;Field ;
CaptionML=[ENU=Created by User;
ESP=Creado por usuario];
SourceExpr="Created by User";
ImplicitType=Code50 }

{ 219 ;2 ;Field ;
SourceExpr="Last Date Modified";
OnDrillDown=VAR
Changelog@1200000000 : Record 405;
BEGIN
Changelog.SETCURRENTKEY("Table No.");
Changelog.SETRANGE("Table No.",27);
Changelog.SETRANGE("Primary Key Field 1
Value","No.");
IF Changelog.FINDFIRST THEN
PAGE.RUNMODAL(595,Changelog);
END;

ImplicitType=Date }

{ 1200000058;2;Field ;
SourceExpr="Last Modified by User";
ImplicitType=Code50 }

{ 1100225006;2;Field ;
SourceExpr="Ventas en multiplos";
ImplicitType=Boolean }

{ 1100225005;2;Field ;
SourceExpr="Uds ventas en multiplos";
ImplicitType=Integer }

{ 1100225004;2;Field ;
SourceExpr="Magento Code";
Editable=FALSE;
ImplicitType=Integer }

{ 1000000015;2;Field ;
SourceExpr="Magento Is Visible";
ImplicitType=Boolean }

{ 1100225003;2;Field ;
SourceExpr=Expansion;
Editable="Magento Code" <> 0;
ImplicitType=Boolean }

{ 1100225002;2;Field ;
SourceExpr=Type;
ImplicitType=Option }

{ 1100225001;2;Field ;
CaptionML=[ESP=es cont�nuo;
ENG=is continuous];
SourceExpr="is continuous";
ImplicitType=Boolean }

{ 1100225037;2;Field ;
SourceExpr="Item Created in Splio";
Editable=FALSE;
ImplicitType=Boolean }

{ 1000000002;2;Field ;
SourceExpr="Item Created in Magento 2";
ImplicitType=Boolean }

{ 1100225062;2;Field ;
SourceExpr="Item Class";
ImplicitType=Option }

{ 1000000012;2;Field ;
SourceExpr="Send Item Info To Franchise";
ImplicitType=Boolean }

{ 1100225019;2;Group ;
CaptionML=ESP=Cantidades;
GroupType=Group }

{ 1100225018;3;Field ;
SourceExpr="Magento Skip Stock";
ImplicitType=Boolean }

{ 1100225017;3;Field ;
SourceExpr="Magento Reserve Item B2B";
ImplicitType=Boolean }

{ 1100225016;3;Field ;
SourceExpr="Magento Reserve Item B2C";
ImplicitType=Boolean }

{ 1100225015;3;Field ;
SourceExpr=Inventory;
ImplicitType=Decimal }
{ 1000000013;3;Field ;
SourceExpr="AGV Available Stock";
ImplicitType=Decimal }

{ 1000000014;3;Field ;
SourceExpr="AGV Stock Last datetime";
ImplicitType=DateTime }

{ 1100225014;3;Field ;
SourceExpr="Qty. on Sales Quote";
ImplicitType=Decimal }

{ 1100225013;3;Field ;
SourceExpr="Qty. on Sales Order";
ImplicitType=Decimal }

{ 1100225012;3;Field ;
SourceExpr="Qty. on Sales Order ECI";
ImplicitType=Decimal }

{ 1100225011;3;Field ;
SourceExpr="Qty. on Sales Order FNAC";
ImplicitType=Decimal }

{ 1100225010;3;Field ;
SourceExpr="Qty. on Sales Order AMAZON";
ImplicitType=Decimal }

{ 1100225009;3;Field ;
SourceExpr="Qty. on Purch. Order";
ImplicitType=Decimal }

{ 1100225008;3;Field ;
SourceExpr="Qty. on Assembly Order";
ImplicitType=Decimal }

{ 1100225007;3;Field ;
SourceExpr="Qty. Assigned to ship";
ImplicitType=Decimal }

{ 1905885101;1;Group ;
CaptionML=[ENU=Invoicing;
ESP=Facturaci�n] }

{ 24 ;2 ;Field ;
SourceExpr="Costing Method";
Importance=Promoted;
OnValidate=BEGIN
EnableCostingControls;
END;

ImplicitType=Option }

{ 28 ;2 ;Field ;
SourceExpr="Standard Cost";
Enabled=StandardCostEnable;
OnDrillDown=VAR
ShowAvgCalcItem@1100409000 : Codeunit 5803;
BEGIN
ShowAvgCalcItem.DrillDownAvgCostAdjmtPoint(Rec);
END;

ImplicitType=Decimal }

{ 30 ;2 ;Field ;
SourceExpr="Unit Cost";
Enabled=UnitCostEnable;
OnDrillDown=VAR
ShowAvgCalcItem@1100409000 : Codeunit 5803;
BEGIN
ShowAvgCalcItem.DrillDownAvgCostAdjmtPoint(Rec);
END;

ImplicitType=Decimal }

{ 1100225021;2;Field ;
SourceExpr="Overhead Rate";
ImplicitType=Decimal }

{ 32 ;2 ;Field ;
SourceExpr="Last Direct Cost";
ImplicitType=Decimal }

{ 1100225020;2;Field ;
SourceExpr="Initial Cost";
ImplicitType=Decimal }

{ 34 ;2 ;Field ;
SourceExpr="Price/Profit Calculation";
ImplicitType=Option }

{ 36 ;2 ;Field ;
SourceExpr="Profit %";
ImplicitType=Decimal }

{ 1100409002;2;Field ;
SourceExpr="No Stock Posting";
Importance=Additional;
ImplicitType=Boolean }

{ 1100409004;2;Field ;
SourceExpr="POS Cost Calculation";
Importance=Additional;
ImplicitType=Option }

{ 10012008;2;Field ;
SourceExpr="Profit Goal %";
Importance=Additional;
ImplicitType=Decimal }

{ 40 ;2 ;Field ;
SourceExpr="Inventory Posting Group";
Importance=Promoted;
ShowMandatory=TRUE;
ImplicitType=Code20 }

{ 95 ;2 ;Field ;
SourceExpr="Gen. Prod. Posting Group";
Importance=Promoted;
ShowMandatory=TRUE;
ImplicitType=Code20 }

{ 66 ;2 ;Field ;
SourceExpr="VAT Prod. Posting Group";
ShowMandatory=TRUE;
ImplicitType=Code20 }

{ 1100225022;2;Field ;
SourceExpr="VAT Prod. Posting Group SC";
ImplicitType=Code10 }

{ 44 ;2 ;Field ;
SourceExpr="Allow Invoice Disc.";
Importance=Additional;
ImplicitType=Boolean }

{ 73 ;2 ;Field ;
SourceExpr="Sales Unit of Measure";
ImplicitType=Code10 }

{ 1200000015;2;Field ;
SourceExpr="Item Disc. Group";
ImplicitType=Code20 }

{ 1200070039;2;Field ;
Name=<Base Unit of Measure2>;
SourceExpr="Base Unit of Measure";
ShowMandatory=TRUE;
ImplicitType=Code10 }

{ 1200070040;2;Field ;
SourceExpr="Base Comp. Unit Code";
Importance=Additional;
ImplicitType=Code10 }

{ 1200070042;2;Field ;
SourceExpr="Qty. per Base Comp. Unit";
Importance=Additional;
ImplicitType=Decimal }

{ 1200070044;2;Field ;
SourceExpr="Comparison Unit Code";
Importance=Additional;
ImplicitType=Code10 }

{ 1200070046;2;Field ;
SourceExpr="Comp. Price Incl. VAT";
Importance=Additional;
ImplicitType=Decimal }

{ 1000000010;2;Field ;
SourceExpr="IGIC %";
ImplicitType=Decimal }

{ 1900124701;1;Group ;
CaptionML=[ENU=Ordering;
ESP=Pedidos] }

{ 50 ;2 ;Field ;
SourceExpr="Vendor No.";
ImplicitType=Code20 }

{ 1100225064;2;Field ;
SourceExpr="Deposit Item";
Editable=DepositFieldEditable;
ImplicitType=Boolean }

{ 52 ;2 ;Field ;
SourceExpr="Vendor Item No.";
ImplicitType=Text20 }

{ 1100409068;2;Field ;
SourceExpr="Select Lowest Price Vendor";
Importance=Additional;
ImplicitType=Boolean }

{ 1200000032;2;Field ;
SourceExpr="Original Vendor No.";
Importance=Additional;
ImplicitType=Code20 }

{ 1200000034;2;Field ;
SourceExpr="Original Vendor Item No.";
Importance=Additional;
ImplicitType=Text20 }

{ 199 ;2 ;Field ;
SourceExpr=Reserve;
Importance=Additional;
ImplicitType=Option }

{ 1200070000;2;Field ;
SourceExpr="Def. Ordered by";
ImplicitType=Option }

{ 1200070002;2;Field ;
SourceExpr="Def. Ordering Method";
ImplicitType=Option }

{ 1200070048;2;Field ;
SourceExpr="Replenishment System";
Importance=Promoted;
ImplicitType=Option }

{ 99 ;2 ;Field ;
SourceExpr="Purch. Unit of Measure";
OnValidate=BEGIN
CurrPage.UPDATE(TRUE);
END;

ImplicitType=Code10 }

{ 56 ;2 ;Field ;
SourceExpr="Maximum Inventory";
Enabled=MaximumInventoryEnable;
ImplicitType=Decimal }

{ 58 ;2 ;Field ;
SourceExpr="Reorder Point";
Enabled=ReorderPointEnable;
ImplicitType=Decimal }

{ 60 ;2 ;Field ;
SourceExpr="Reorder Quantity";
Enabled=ReorderQuantityEnable;
ImplicitType=Decimal }

{ 1100409121;2;Field ;
SourceExpr="Reordering Policy";
ImplicitType=Option }

{ 1100409125;2;Field ;
SourceExpr="Safety Lead Time";
Enabled=SafetyLeadTimeEnable;
ImplicitType=DateFormula }

{ 1100409133;2;Field ;
SourceExpr="Safety Stock Quantity";
Enabled=SafetyStockQuantityEnable;
ImplicitType=Decimal }

{ 1100409127;2;Field ;
SourceExpr="Minimum Order Quantity";
Enabled=MinimumOrderQuantityEnable;
ImplicitType=Decimal }

{ 1100409129;2;Field ;
SourceExpr="Maximum Order Quantity";
Enabled=MaximumOrderQuantityEnable;
ImplicitType=Decimal }

{ 1100409131;2;Field ;
SourceExpr="Order Multiple";
Enabled=OrderMultipleEnable;
ImplicitType=Decimal }

{ 1100409000;2;Field ;
SourceExpr="Assembly BOM";
Importance=Additional;
ImplicitType=Boolean }

{ 10 ;2 ;Field ;
SourceExpr="Shelf No.";
Importance=Additional;
ImplicitType=Code10 }

{ 1100225061;2;Field ;
SourceExpr="Release Date";
ImplicitType=Date }

{ 1100225074;1;Group ;
CaptionML=[ENU=Wonder Information;
ESP=Informaci�n Wonder];
GroupType=Group }
{ 1100225073;2;Field ;
SourceExpr=CopyDescrip;
ImplicitType=Text150 }

{ 1100225072;2;Field ;
SourceExpr="Collection No.";
ImplicitType=Code20 }

{ 1100225071;2;Field ;
SourceExpr="Collection Year";
ImplicitType=Code20 }

{ 1100225070;2;Field ;
SourceExpr=Topic;
ImplicitType=Code20 }

{ 1100225069;2;Field ;
SourceExpr="CREA Code";
ImplicitType=Code20 }

{ 1100225068;2;Field ;
SourceExpr="Language Code";
ImplicitType=Code10 }

{ 1100225067;2;Field ;
SourceExpr="Design Lines";
ImplicitType=Code20 }

{ 1100225066;2;Field ;
SourceExpr="Mix Strategy";
ImplicitType=Code20 }

{ 1100225036;2;Field ;
SourceExpr="Manufacturer Code";
ImplicitType=Code10 }

{ 1100225038;2;Field ;
SourceExpr=FSC;
ImplicitType=Text100 }

{ 1100225080;1;Group ;
CaptionML=ESP=Par�metros de riesgo;
GroupType=Group }

{ 1100225079;2;Field ;
SourceExpr="Item Type";
ImplicitType=Code20 }

{ 1100225078;2;Field ;
SourceExpr="Stock Risk";
ImplicitType=Code20 }

{ 1100225077;2;Field ;
SourceExpr=Periodicity;
ImplicitType=Code20 }

{ 1100225076;2;Field ;
SourceExpr="Item Information";
ImplicitType=Code20 }

{ 1100225075;2;Field ;
CaptionML=ESP=Maxic�digo;
SourceExpr=Maxicode;
Editable=FALSE;
ImplicitType=Code50 }

{ 1100225047;1;Group ;
CaptionML=[ENU=Foreign Trade;
ESP=Comercio exterior] }

{ 1100225082;2;Field ;
SourceExpr="Tariff No.";
ImplicitType=Code20 }

{ 1100225081;2;Field ;
SourceExpr="Country/Region of Origin Code";
ImplicitType=Code10 }

{ 1100225044;2;Field ;
SourceExpr="Net Weight";
Editable=CubiScanBloq;
ImplicitType=Decimal }

{ 1100225043;2;Field ;
SourceExpr="Gross Weight";
Editable=CubiScanBloq;
ImplicitType=Decimal }

{ 1100225042;2;Field ;
SourceExpr=Depth;
Editable=CubiScanBloq;
ImplicitType=Decimal }

{ 1100225041;2;Field ;
SourceExpr=Height;
Editable=CubiScanBloq;
ImplicitType=Decimal }

{ 1100225040;2;Field ;
SourceExpr=Width;
Editable=CubiScanBloq;
ImplicitType=Decimal }

{ 1100225039;2;Field ;
SourceExpr="Unit Volume";
Editable=CubiScanBloq;
ImplicitType=Decimal }

{ 1100225024;2;Field ;
SourceExpr="CubiScan Imported";
ImplicitType=Boolean }

{ 1000000011;2;Group ;
Name=Ecoembes;
CaptionML=[ENU=Ecoembes;
ESP=Ecoembes];
GroupType=Group }
{ 1000000007;3;Field ;
SourceExpr="Ecoembes - Carton/Paper";
ImplicitType=Decimal }

{ 1000000006;3;Field ;
SourceExpr="Ecoembes - Plastic";
ImplicitType=Decimal }

{ 1000000005;3;Field ;
SourceExpr="Ecoembes - Metal/Aluminium";
ImplicitType=Decimal }

{ 1000000004;3;Field ;
SourceExpr="Ecoembes - Foam";
ImplicitType=Decimal }

{ 1000000003;3;Field ;
SourceExpr="Ecoembes - Others";
ImplicitType=Decimal }

{ 1902341901;1;Group ;
CaptionML=[ENU=POS;
ESP=TPV] }

{ 1200000056;2;Field ;
Name=PPScaleItem;
SourceExpr="Scale Item";
ImplicitType=Boolean }

{ 1200070003;2;Field ;
SourceExpr="UOM Pop-up on POS";
ImplicitType=Boolean }

{ 1200000042;2;Field ;
SourceExpr="Keying in Price";
ImplicitType=Option }

{ 1200000044;2;Field ;
SourceExpr="Keying in Quantity";
ImplicitType=Option }

{ 1100409012;2;Field ;
SourceExpr="Suggested Qty. on POS";
ImplicitType=Decimal }

{ 1200000052;2;Field ;
SourceExpr="Zero Price Valid";
ImplicitType=Boolean }

{ 1200070071;2;Field ;
SourceExpr="Qty. Becomes Negative";
ImplicitType=Boolean }

{ 1100409006;2;Field ;
SourceExpr="No Discount Allowed";
ImplicitType=Boolean }

{ 1100409016;2;Field ;
SourceExpr="Explode BOM in Statem. Posting";
Importance=Additional;
ImplicitType=Boolean }

{ 1100409135;2;Field ;
SourceExpr="Skip Compression When Scanned";
ImplicitType=Boolean }

{ 1100409067;2;Field ;
SourceExpr="Skip Compression When Printed";
ImplicitType=Boolean }

{ 1100409107;2;Field ;
SourceExpr="Fuel Item";
Importance=Additional;
Editable=FALSE;
ImplicitType=Boolean }

{ 1100409105;2;Field ;
CaptionML=[ENU=Grade ID;
ESP=ID Grado];
SourceExpr=gGradeId;
Importance=Additional;
Editable=FALSE;
ImplicitType=Integer }

{ 1200070004;2;Field ;
SourceExpr="Qty not in Decimal";
ImplicitType=Boolean }

{ 10014500;2;Field ;
SourceExpr="Tare Weight";
Importance=Additional;
ImplicitType=Decimal }

{ 118 ;1 ;Part ;
CaptionML=[ENU=Pricing;
ESP=Precios];
SubPageLink=Item No.=FIELD(No.);
PagePartID=Page10000788;
PartType=Page }

{ 124 ;1 ;Part ;
Name=subDept;
CaptionML=[ENU=Distribution;
ESP=Distribuci�n];
SubPageLink=Item No.=FIELD(No.);
PagePartID=Page10000710;
PartType=Page }

{ 1903746001;1;Group ;
CaptionML=[ENU=Tracking/Comparison;
ESP=Seguimiento/Compar];
GroupType=Group }

{ 1100409031;2;Field ;
SourceExpr="Item Tracking Code";
Importance=Promoted;
ImplicitType=Code10 }
{ 1100409027;2;Field ;
SourceExpr="Serial Nos.";
ImplicitType=Code20 }

{ 1100409009;2;Field ;
SourceExpr="Lot Nos.";
ImplicitType=Code20 }

{ 1100409008;2;Field ;
SourceExpr="Expiration Calculation";
ImplicitType=DateFormula }

{ 1200070090;2;Field ;
Name=<Base Unit of Measure3>;
SourceExpr="Base Unit of Measure";
ImplicitType=Code10 }

{ 1200070076;2;Field ;
Name=<Base Comp. Unit Code3>;
SourceExpr="Base Comp. Unit Code";
Importance=Additional;
ImplicitType=Code10 }

{ 1200070063;2;Field ;
Name=<Qty. per Base Comp. Unit3>;
SourceExpr="Qty. per Base Comp. Unit";
Importance=Additional;
ImplicitType=Decimal }

{ 1200070062;2;Field ;
Name=<Comparison Unit Code3>;
SourceExpr="Comparison Unit Code";
Importance=Additional;
ImplicitType=Code10 }

{ 1200070055;2;Field ;
Name=<Comp. Price Incl. VAT3>;
SourceExpr="Comp. Price Incl. VAT";
Importance=Additional;
ImplicitType=Decimal }

{ 1904749901;1;Group ;
CaptionML=[ENU=Merchandising;
ESP=Mercadotecnia] }

{ 1200070097;2;Field ;
SourceExpr="Season Code";
Importance=Promoted;
ImplicitType=Code10 }

{ 10014501;2;Field ;
ToolTipML=[ENU=Specifies the Lifecycle Curve of the item. It is
used to calculate the item's sales demand in Store Stock Redistribution.;
ESP=Especifica la Curva Ciclo de Vida del Producto. Se
usa para calcular la demanda de venta en la Redistribuci�n Existencias Tienda.];
SourceExpr="Lifecycle Curve Code";
ImplicitType=Code20 }
{ 1200070099;2;Field ;
SourceExpr="Lifecycle Length";
ImplicitType=DateFormula }

{ 1200070101;2;Field ;
SourceExpr="Lifecycle Starting Date";
ImplicitType=Date }

{ 1200070103;2;Field ;
SourceExpr="Lifecycle Ending Date";
ImplicitType=Date }

{ 1200070121;2;Field ;
SourceExpr="Item Error Check Code";
ImplicitType=Code10 }

{ 1200070123;2;Field ;
SourceExpr="Item Error Check Status";
Editable=FALSE;
ImplicitType=Option }

{ 1100409014;2;Field ;
SourceExpr="Item Capacity Value";
ImplicitType=Decimal }

{ 10012041;2;Field ;
SourceExpr="Replenishment Grade Code";
Importance=Promoted;
Visible=ReplenishmentGradeCodeVisible;
ImplicitType=Code10 }

{ 1100409058;2;Field ;
SourceExpr="Replen. Transfer Rule Code";
ImplicitType=Code10 }

{ 1100409015;2;Field ;
SourceExpr="Replenishment Calculation Type";
Importance=Promoted;
ImplicitType=Option }

{ 1100409054;2;Field ;
SourceExpr="Exclude from Replenishment";
ImplicitType=Boolean }

{ 1100409044;2;Field ;
CaptionML=[ENU=Location Details;
ESP=Detalles Almac�n];
SourceExpr=LocationDetails_g;
Editable=false;
ImplicitType=Boolean }

{ 1903822601;1;Group ;
CaptionML=[ENU=Attributes;
ESP=Atributos] }

{ 1100409050;2;Field ;
SourceExpr="ABC Sales";
ImplicitType=Option }
{ 1100409052;2;Field ;
SourceExpr="ABC Profit";
ImplicitType=Option }

{ 1100409018;2;Field ;
SourceExpr="Attrib 1 Code";
Importance=Promoted;
Visible=Attrib1CodeVisible;
ImplicitType=Text30 }

{ 1100409040;2;Field ;
SourceExpr="Attrib 2 Code";
Importance=Promoted;
Visible=Attrib2CodeVisible;
ImplicitType=Text30 }

{ 1100409042;2;Field ;
SourceExpr="Attrib 3 Code";
Visible=Attrib3CodeVisible;
ImplicitType=Text30 }

{ 1100409046;2;Field ;
SourceExpr="Attrib 4 Code";
Visible=Attrib4CodeVisible;
ImplicitType=Text30 }

{ 1100409048;2;Field ;
SourceExpr="Attrib 5 Code";
Visible=Attrib5CodeVisible;
ImplicitType=Text30 }

{ 1100409001;2;Field ;
Name=Assembly BOM2;
SourceExpr="Assembly BOM";
Importance=Additional;
ImplicitType=Boolean }

{ 1100409072;2;Field ;
SourceExpr="BOM Cost Price Distribution";
Importance=Additional;
ImplicitType=Option }

{ 1100409071;2;Field ;
SourceExpr="BOM Type";
Importance=Additional;
ImplicitType=Option }

{ 1100409070;2;Field ;
SourceExpr="BOM Receiving Explode";
Importance=Additional;
ImplicitType=Option }

{ 1100225045;2;Field ;
SourceExpr="Expedition Box Item";
ImplicitType=Boolean }

{ 14 ;1 ;Group ;
CaptionML=[ENU=Warehouse;
ESP=Almac�n] }
{ 8 ;2 ;Field ;
SourceExpr="Phys Invt Counting Period Code";
Importance=Promoted;
ImplicitType=Code10 }

{ 7 ;2 ;Field ;
SourceExpr="Last Phys. Invt. Date";
ImplicitType=Date }

{ 6 ;2 ;Field ;
SourceExpr="Last Counting Period Update";
ImplicitType=Date }

{ 5 ;2 ;Field ;
SourceExpr="Next Counting Start Date";
ImplicitType=Date }

{ 4 ;2 ;Field ;
SourceExpr="Next Counting End Date";
ImplicitType=Date }

{ 1900000007;0;Container;
ContainerType=FactBoxArea }

{ 1100409034;1;Part ;
SubPageLink=No.=FIELD(No.),
Date Filter=FIELD(Date Filter),
Global Dimension 1 Filter=FIELD(Global Dimension 1
Filter),
Global Dimension 2 Filter=FIELD(Global Dimension 1
Filter),
Store Filter=FIELD(Store Filter),
Location Filter=FIELD(Location Filter),
Drop Shipment Filter=FIELD(Drop Shipment Filter),
Bin Filter=FIELD(Bin Filter),
Variant Filter=FIELD(Variant Filter),
Lot No. Filter=FIELD(Lot No. Filter),
Serial No. Filter=FIELD(Serial No. Filter);
PagePartID=Page10000890;
PartType=Page }

{ 1100409003;1;Part ;
SubPageLink=Item No.=FIELD(No.);
PagePartID=Page99009109;
PartType=Page }

{ 1900383207;1;Part ;
PartType=System;
SystemPartID=RecordLinks }

{ 1905767507;1;Part ;
PartType=System;
SystemPartID=Notes }

}
CODE
{
VAR
Text000@1000000007 : TextConst 'ENU=Do you want to save filter;ESP=Desea
salvar el Filtro';
Text001@1000000008 : TextConst 'ENU=Internal EAN-13 barcode setup must be 12
digits;ESP=La Conf. Interna de C�d. Barras EAN-13 debe ser de 12 d�gitos';
Text002@1000000009 : TextConst 'ENU=Priority not set, see
errors;ESP=Prioridad no definida, ver errores';
A5V22@1100409003 : Boolean INDATASET;
StandardCard@1000000000 : Record 27;
TroubleshHeader@1000000006 : Record 5943;
SkilledResources@1000000005 : Page 6023;
CalculateStdCost@1000000003 : Codeunit 5812;
isUser@1200000000 : Record 10000742;
QtySoldNotPst@1100409025 : Decimal;
BOUtils@1100409001 : Codeunit 99001452;
Text003@1200070000 : TextConst 'ENU="Barcode found\item not found
=";ESP="C�d. Barras encontrado\Producto no encontrado ="';
Text004@1200070001 : TextConst 'ENU=Barcode not found;ESP=C�d. Barras no
encontrado';
Barcodes@1200070003 : Record 99001451;
"POSIS&HGBPOSTitle"@1200070002 : Text[30];
POSISTitle@1200070004 : Text[30];
HGBPOSTitle@1200070005 : Text[30];
Text005@1200070006 : TextConst 'ENU=-- POSIS & HB-GPoS --;ESP=-- POSIS & HB-
GPoS --';
Text006@1200070007 : TextConst 'ENU=-- POSIS --;ESP=-- POSIS --';
Text007@1200070008 : TextConst 'ENU=-- HB-GPoS --;ESP=-- HB-GPoS --';
RetailSetup@1200070009 : Record 10000700;
Text008@1200070010 : TextConst 'ENU=The item does not have variants.;ESP=El
Producto no tiene variantes';
RetailUsers@1200070011 : Record 10000742;
ItemStatusLinks@1200070012 : Record 10001404;
Text009@1200070013 : TextConst 'ENU=The field Item Error Check Code is not
defined.;ESP=El C�d. Error Validaci�n Producto no est� definido!';
ReplenishmentSetup@1100409000 : Record 10012200;
Text020@10012005 : TextConst 'ENU=From %1 %2.;ESP=Desde %1 %2.';
Text021@1100409004 : TextConst 'ENU=Item is not a prepack.;ESP=El producto no
es un pre-embalaje.';
gGradeId@1100409007 : Integer;
gFcFunctions@1100409008 : Codeunit 10012601;
ItemAvailFormsMgt@1100409009 : Codeunit 353;
HierarchyMgt@10014500 : Codeunit 10000920;
ReplenishmentGradeCodeVisible@19039562 : Boolean INDATASET;
Attrib1CodeVisible@19072877 : Boolean INDATASET;
Attrib2CodeVisible@19066636 : Boolean INDATASET;
Attrib3CodeVisible@19060135 : Boolean INDATASET;
Attrib4CodeVisible@19055110 : Boolean INDATASET;
Attrib5CodeVisible@19075641 : Boolean INDATASET;
UnitPriceEditable@19072822 : Boolean INDATASET;
UnitPriceIncludingVATEditable@19007978 : Boolean INDATASET;
ReorderCycleEnable@19029774 : Boolean INDATASET;
SafetyLeadTimeEnable@19079647 : Boolean INDATASET;
SafetyStockQuantityEnable@19036196 : Boolean INDATASET;
ReorderPointEnable@19067744 : Boolean INDATASET;
ReorderQuantityEnable@19013534 : Boolean INDATASET;
MaximumInventoryEnable@19059424 : Boolean INDATASET;
MinimumOrderQuantityEnable@19021857 : Boolean INDATASET;
MaximumOrderQuantityEnable@19007977 : Boolean INDATASET;
OrderMultipleEnable@19004365 : Boolean INDATASET;
ReschedulingPeriodEnable@1004 : Boolean INDATASET;
LotAccumulationPeriodEnable@1003 : Boolean INDATASET;
DampenerPeriodEnable@1002 : Boolean INDATASET;
DampenerQtyEnable@1001 : Boolean INDATASET;
OverflowLevelEnable@1000 : Boolean INDATASET;
StandardCostEnable@1100409011 : Boolean INDATASET;
UnitCostEnable@1100409010 : Boolean INDATASET;
LocationDetails_g@1100409002 : Boolean;
TableSpecificInfocode@1200070015 : Record 99001479;
TableSpecificInfocodeTEMP@1200070014 : TEMPORARY Record 99001479;
Text022@1200070016 : TextConst 'ENU=%1 is not linked to %2;ESP=%1 no est�
vinculado con %2';
VisibleInWebClient@1200070017 : Boolean;
VisibleInWinClient@1200070018 : Boolean;
CubiScanBloq@1100225000 : Boolean;
LinkWeb@1100225001 : Text[100];
Text50001@1100225002 : TextConst 'ESP=El Producto no tiene ID Magento, no se
puede abrir su ficha web.';
Permisos@1100225003 : Boolean;
GestionTarifa@1100225004 : Codeunit 50010;
UserSetup@1100225005 : Record 91;
ControlCampOblig@1100225006 : Codeunit 50011;
DepositFieldEditable@1100225007 : Boolean;

[LineStart(11352)]
PROCEDURE CreateBarcodeFromMask@10012000();
VAR
BarcodeMgmt@10012001 : Codeunit 99001450;
Barcodes_l@10012000 : Record 99001451;
Masks@10012002 : Page 99001661;
BarcodeMask@10012003 : Record 99001459;
BEGIN
Masks.LOOKUPMODE(TRUE);
Masks.SETTABLEVIEW(BarcodeMask);
IF Masks.RUNMODAL = ACTION::LookupOK THEN BEGIN
Masks.GETRECORD(BarcodeMask);
Barcodes_l.INIT;
Barcodes_l."Barcode No." :=
BarcodeMgmt.ConstructBarcodeFromMask(BarcodeMask);
Barcodes_l.Description := Description;
Barcodes_l.VALIDATE("Item No.","No.");
IF Barcodes_l."Barcode No." <> '' THEN
IF Barcodes_l.INSERT(TRUE) THEN;
END;
END;

[LineStart(11365)]
PROCEDURE StoreToLocationFilter@1100409001();
VAR
Stores@1100409001 : Record 99001470;
InvFilter@1100409000 : Code[250];
BEGIN
CombineStoreLocationFilter(Rec);
END;

[LineStart(11368)]
PROCEDURE EnablePlanningControls@1();
VAR
PlanningGetParam@1000 : Codeunit 99000855;
ReorderCycleEnabled@1010 : Boolean;
SafetyLeadTimeEnabled@1009 : Boolean;
SafetyStockQtyEnabled@1008 : Boolean;
ReorderPointEnabled@1007 : Boolean;
ReorderQuantityEnabled@1006 : Boolean;
MaximumInventoryEnabled@1005 : Boolean;
MinimumOrderQtyEnabled@1004 : Boolean;
MaximumOrderQtyEnabled@1003 : Boolean;
OrderMultipleEnabled@1002 : Boolean;
IncludeInventoryEnabled@1001 : Boolean;
ReschedulingPeriodEnabled@1015 : Boolean;
LotAccumulationPeriodEnabled@1014 : Boolean;
DampenerPeriodEnabled@1013 : Boolean;
DampenerQtyEnabled@1012 : Boolean;
OverflowLevelEnabled@1011 : Boolean;
BEGIN
PlanningGetParam.SetUpPlanningControls("Reordering Policy","Include
Inventory",
ReorderCycleEnabled,SafetyLeadTimeEnabled,SafetyStockQtyEnabled,
ReorderPointEnabled,ReorderQuantityEnabled,MaximumInventoryEnabled,

MinimumOrderQtyEnabled,MaximumOrderQtyEnabled,OrderMultipleEnabled,IncludeInventory
Enabled,
ReschedulingPeriodEnabled,LotAccumulationPeriodEnabled,
DampenerPeriodEnabled,DampenerQtyEnabled,OverflowLevelEnabled);

ReorderCycleEnable := ReorderCycleEnabled;
SafetyLeadTimeEnable := SafetyLeadTimeEnabled;
SafetyStockQuantityEnable := SafetyStockQtyEnabled;
ReorderPointEnable := ReorderPointEnabled;
ReorderQuantityEnable := ReorderQuantityEnabled;
MaximumInventoryEnable := MaximumInventoryEnabled;
MinimumOrderQuantityEnable := MinimumOrderQtyEnabled;
MaximumOrderQuantityEnable := MaximumOrderQtyEnabled;
OrderMultipleEnable := OrderMultipleEnabled;

ReschedulingPeriodEnable := ReschedulingPeriodEnabled;
LotAccumulationPeriodEnable := LotAccumulationPeriodEnabled;
DampenerPeriodEnable := DampenerPeriodEnabled;
DampenerQtyEnable := DampenerQtyEnabled;
OverflowLevelEnable := OverflowLevelEnabled;
END;

[LineStart(11392)]
LOCAL PROCEDURE OnAfterGetCurrRecord@19077479();
BEGIN
xRec := Rec;
END;

[LineStart(11395)]
PROCEDURE EnableCostingControls@3();
BEGIN
StandardCostEnable := "Costing Method" = "Costing Method"::Standard;
UnitCostEnable := "Costing Method" <> "Costing Method"::Standard;
END;

[LineStart(11399)]
LOCAL PROCEDURE SetVisible@1200070007();
VAR
AttributeSetup@1200070000 : Record 10000788;
BEGIN
AttributeSetup.GetSetup;
Attrib1CodeVisible := NOT (AttributeSetup."Item Attrib. 1 Code" = '');
Attrib2CodeVisible := NOT (AttributeSetup."Item Attrib. 2 Code" = '');
Attrib3CodeVisible := NOT (AttributeSetup."Item Attrib. 3 Code" = '');
Attrib4CodeVisible := NOT (AttributeSetup."Item Attrib. 4 Code" = '');
Attrib5CodeVisible := NOT (AttributeSetup."Item Attrib. 5 Code" = '');
END;

[LineStart(11407)]
LOCAL PROCEDURE fxGetNotesMessage@1000000000(recItem@1000000000 : Record 27);
VAR
RecordLink@1000000001 : Record 2000000068;
NoteText@1000000002 : BigText;
RecRef@1000000004 : RecordRef;
BEGIN
RecRef.GETTABLE(recItem);
RecordLink.SETRANGE("Record ID",RecRef.RECORDID);
IF RecordLink.FINDFIRST THEN;
RecordLink.CALCFIELDS(Note);
IF RecordLink.Note.HASVALUE THEN
MESSAGE('El producto %1 tiene notas asociadas',recItem."No.");
END;

[LineStart(11415)]
LOCAL PROCEDURE CheckDepositFieldEditable@1000000001(VAR
DepositFieldEditable@1000000002 : Boolean);
VAR
PurchaseLine@1000000000 : Record 39;
ItemManagement@1000000001 : Codeunit 50034;
BEGIN
DepositFieldEditable := NOT
ItemManagement.ItemHasPurchaseLines(Rec."No."); //545>
END;

BEGIN
{
-006 apicazo 29/04/2015. PI0006_MRW_9999. SGA
-007 apicazo 14/05/2015. PI0007_MRW_9999. Magento
-025 apicazo 08/03/2016. PI025_LVS_1252. Modificacions NAV.
-999 mluque 11/01/2017. A�adida la action "Abrir Ficha Producto Web" que abre
un navegador con la ficha de la shop
-044 OS.XT. 25/11/2016. Gesti�n IVA de autoconsumo (regalos)

-999 mluque 19/12/2017 Bloqueo la modificaci�n de las medidas de producto una


vez se haya importado de CubiScan
MRW042 dperez 23/07/2018 Gesti�n de tarifas
MRW999 dperez 20/05/2019 A�adir C�d. fabricante

073 OS.AP. 14/05/2018. MRW_SP20180514. Optimizaciones y mejores procesos


Magento.
204 OS.SM.20/02/2020. MRW_SP20200220_SM. Connectivitat API SPLIO
396 OS.SMF.16/03/2021. AN_Magento2. Integraci�n Magento 2.
428 OS.MM. 29/01/2021. MRW_SP20210129_MM. Camp FSC a productes.
431 OS.ACE.04/02/2021. Integraci�n con Canarias
520 OS.SMF.20/05/2021. MRW_SP20212005_SMF. A�adir campos �Validaci�n de
muestras� en productos.
522 OS.XT. 25/05/2021. AN_InformeIgic. Informe IGIC para franquicias
532 OS.MMC.15/06/2021. MRW_SP20210615_XT. Poder enviar descripcions de
Magento juntament amb la informaci� de producte a franqu�cies.
545 OS.OA. 13/08/2021. AN_CMP001_MRW. Dep�sitos proveedor
573 OS.MM. 13/12/2021. Campos Ecoembres en la ficha de producto.
}
END.
}
}

OBJECT Page 99001497 Transaction Sales Entries


{
OBJECT-PROPERTIES
{
Date=16/12/21;
Time=11:50:55;
Modified=Yes;
Version List=LSW110.00.00.363,OS,431,528,578,700;
}
PROPERTIES
{
Editable=No;
CaptionML=[ENU=Transaction Sales Entries;
ESP=Movs. Venta Transacci�n];
SourceTable=Table99001473;
DataCaptionFields=Store No.,POS Terminal No.,Transaction No.,Item No.,Staff ID;
PageType=List;
OnAfterGetRecord=BEGIN
OnAfterGetCurrRecord;
END;

OnNewRecord=BEGIN
OnAfterGetCurrRecord;
END;

ActionList=ACTIONS
{
{ 1900000003;0 ;ActionContainer;
ActionContainerType=RelatedInformation }
{ 2 ;1 ;ActionGroup;
CaptionML=[ENU=E&ntry;
ESP=Movimie&nto] }
{ 26 ;2 ;Action ;
CaptionML=[ENU=T&ransaction Card;
ESP=Ficha T&ransacci�n];
RunObject=Page 99001495;
RunPageLink=Store No.=FIELD(Store No.),
POS Terminal No.=FIELD(POS Terminal No.),
Transaction No.=FIELD(Transaction No.);
Image=Entries }
{ 24 ;2 ;Action ;
ShortCutKey=Shift+Ctrl+N;
CaptionML=[ENU=Infoco&de Entries;
ESP=Movs. Infoc�&digo];
RunObject=Page 99001498;
RunPageLink=Store No.=FIELD(Store No.),
POS Terminal No.=FIELD(POS Terminal No.),
Transaction No.=FIELD(Transaction No.),
Transaction Type=CONST(Sales Entry),
Line No.=FIELD(Line No.);
Image=CodesList }
{ 3 ;2 ;Action ;
CaptionML=[ENU=Retail &Item Card;
ESP=Ficha &Producto Com. Minorista];
RunObject=Page 10000807;
RunPageLink=No.=FIELD(Item No.);
Image=ItemLedger }
{ 1100409008;2 ;Action ;
CaptionML=[ENU=Additi&onal Salespersons;
ESP=Vendedores Adici&onales];
RunObject=Page 10000867;
RunPageLink=Store No.=FIELD(Store No.),
POS Terminal No.=FIELD(POS Terminal No.),
Transaction No.=FIELD(Transaction No.),
Line No.=FIELD(Line No.);
Image=SalesPerson }
{ 1100409009;2 ;Action ;
CaptionML=[ENU=&Discount Entry;
ESP=Mov. &Desconto];
RunObject=Page 99009056;
RunPageLink=Store No.=FIELD(Store No.),
POS Terminal No.=FIELD(POS Terminal No.),
Transaction No.=FIELD(Transaction No.),
Line No.=FIELD(Line No.);
Image=Discount }
}
}
CONTROLS
{
{ 1900000001;0;Container;
ContainerType=ContentArea }

{ 1 ;1 ;Group ;
GroupType=Repeater }

{ 20 ;2 ;Field ;
SourceExpr="Transaction No.";
ImplicitType=Integer }

{ 4 ;2 ;Field ;
SourceExpr="Transaction Code";
ImplicitType=Option }

{ 6 ;2 ;Field ;
SourceExpr="Receipt No.";
ImplicitType=Code20 }

{ 1000000000;2;Field ;
SourceExpr="SII Receipt No.";
ImplicitType=Code20 }

{ 8 ;2 ;Field ;
SourceExpr="Barcode No.";
ImplicitType=Code22 }

{ 10 ;2 ;Field ;
SourceExpr="Item No.";
LookupPageID=Item Lookup 2;
DrillDownPageID=Item Lookup 2;
ImplicitType=Code20 }
{ 1100409000;2;Field ;
SourceExpr="Variant Code";
Visible=FALSE;
ImplicitType=Code10 }

{ 23 ;2 ;Field ;
SourceExpr=Date;
ImplicitType=Date }

{ 12 ;2 ;Field ;
SourceExpr=Quantity;
ImplicitType=Decimal }

{ 14 ;2 ;Field ;
SourceExpr=Price;
ImplicitType=Decimal }

{ 16 ;2 ;Field ;
SourceExpr="Net Amount";
ImplicitType=Decimal }

{ 1100225000;2;Field ;
SourceExpr="Promotion %";
ImplicitType=Decimal }

{ 18 ;2 ;Field ;
SourceExpr="Discount Amount";
ImplicitType=Decimal }

{ 39 ;2 ;Field ;
SourceExpr="VAT Amount";
ImplicitType=Decimal }

{ 37 ;2 ;Field ;
SourceExpr="Cost Amount";
ImplicitType=Decimal }

{ 65 ;2 ;Field ;
SourceExpr="POS Terminal No.";
ImplicitType=Code10 }

{ 67 ;2 ;Field ;
SourceExpr="Staff ID";
ImplicitType=Code20 }

{ 1200070002;2;Field ;
SourceExpr="Sales Staff";
ImplicitType=Code20 }

{ 30 ;2 ;Field ;
SourceExpr=Section;
ImplicitType=Code10 }

{ 32 ;2 ;Field ;
SourceExpr=Time;
ImplicitType=Time }

{ 1000000001;2;Field ;
SourceExpr="Promotional Code";
ImplicitType=Text250 }

{ 43 ;2 ;Field ;
SourceExpr="Infocode Discount";
ImplicitType=Decimal }

{ 45 ;2 ;Field ;
SourceExpr="Total Discount";
ImplicitType=Decimal }

{ 41 ;2 ;Field ;
SourceExpr="Line Discount";
ImplicitType=Decimal }

{ 47 ;2 ;Field ;
SourceExpr="Periodic Discount";
ImplicitType=Decimal }

{ 1200070000;2;Field ;
SourceExpr="Customer Discount";
ImplicitType=Decimal }

{ 51 ;2 ;Field ;
SourceExpr="Keyboard Item Entry";
ImplicitType=Boolean }

{ 53 ;2 ;Field ;
SourceExpr="Price in Barcode";
ImplicitType=Boolean }

{ 61 ;2 ;Field ;
SourceExpr="Line was Discounted";
ImplicitType=Boolean }

{ 49 ;2 ;Field ;
SourceExpr="Item Number Scanned";
ImplicitType=Boolean }

{ 63 ;2 ;Field ;
SourceExpr="Scale Item";
ImplicitType=Boolean }

{ 1200070003;2;Field ;
SourceExpr="Weight Manually Entered";
ImplicitType=Boolean }

{ 1200070004;2;Field ;
SourceExpr="Unit of Measure";
ImplicitType=Code10 }

{ 1100409002;2;Field ;
SourceExpr="Serial No.";
Visible=FALSE;
ImplicitType=Code20 }

{ 1100409004;2;Field ;
SourceExpr="Lot No.";
Visible=FALSE;
ImplicitType=Code20 }

{ 1100409006;2;Field ;
SourceExpr="Expiration Date";
Visible=FALSE;
ImplicitType=Date }

{ 10012000;2;Field ;
SourceExpr="Sales Type";
Visible=FALSE;
ImplicitType=Code20 }

{ 1200070001;2;Field ;
SourceExpr="Recommended Item";
ImplicitType=Boolean }

{ 1100225001;2;Field ;
SourceExpr="No Item Leger Entry";
Editable=false;
ImplicitType=Boolean }

{ 27 ;1 ;Group }

{ 28 ;2 ;Field ;
Name=Item Description;
CaptionML=[ENU=Item Description;
ESP=Descripci�n producto];
SourceExpr=ItemName;
Editable=FALSE;
ImplicitType=Text100 }

}
CODE
{
VAR
Item@1000 : Record 27;
ItemName@1001 : Text[100];

[LineStart(11424)]
LOCAL PROCEDURE OnAfterGetCurrRecord@19077479();
BEGIN
xRec := Rec;
IF Item.GET("Item No.") THEN BEGIN
ItemName := Item.Description;
END ELSE
CLEAR(ItemName);
END;

BEGIN
{
700 OS.AP. 19/09/2019. Numeradors tickets SII TPV.
431 OS.ACE.04/02/2021. Integraci�n con Canarias
528 OS.MM. 04/10/2021. AN_CASTOR. Integraci�n con CASTOR
578 OS.OA. 15/12/2021. Facturaci�n franquicias tipo Canarias
}
END.
}
}

You might also like