supermag.smdoccreateiw
supermag.smdocaddspeciw
declare
core_result pls_integer;
vDocType varchar2(2) := :doctype;
vDocID varchar2(50) := :docid;
vLocationFrom number(3, 0) := :locfrom;
vLocationTo number(3, 0) := :locto;
vOurSelfClient number(3, 0) := :client;
vbasestoreorder varchar2(50) := :basestoreorder;
MESSAGE_STR varchar2(250);
begin
if supermag.core.getproc is null then
core_result := supermag.Core.StartSMApp();
end if;
if vDocType = 'IW' then
supermag.smdoccreateiw
(vDocID,
trunc(sysdate),
vLocationFrom,
vLocationTo,
vOurSelfClient,
vbasestoreorder);
end if;
commit;
EXCEPTION
WHEN OTHERS THEN
:MESSAGE_STR := SQLERRM;
end;
declare
core_result pls_integer;
vDocID varchar2(50) := :docid;
vArticle varchar2(50) := :article;
vDisplayItem NUMBER(10) := :displayitem;
vExcisetbl VARCHAR2(1) := :excisetbl; -- Акцизный сбор
vItemGrossWeight NUMBER(14, 3) := :itemgrossweight; -- Вес брутто изделия
vPackName VARCHAR2(50) := :packname; -- значение ''
vQuantity NUMBER(14, 3) := :quantity;
vPackStbl VARCHAR2(1) := :packstbl; -- ???
vValidDate DATE := :validdate; -- Срок годности
vActuallyQuant NUMBER(14, 3) := :actuallyquant; -- Надо проверять на совпадение с Spec.Quantity
vMoveReason SLSPECQMISMATCH.REASON%TYPE := :movereason; -- Причина перемещения
vMismatchReason VARCHAR2(30) := :mismatchreason; --Причина несоответствия.
vCause VARCHAR2(1) := :cause;
vProducer SAPRODUCERS.ID%TYPE := :producer;
vItemPrice NUMBER(19, 4) := :itemprice;
vTotalPrice NUMBER(19, 4) := :totalprice;
vItemPriceCur SMSPEC.ITEMPRICECUR%TYPE := :itempricecur;
vTotalPriceCur SMSPEC.TOTALPRICECUR%TYPE := :totalpricecur;
vComplexArticle SMSPEC.ARTICLE%TYPE := :complexarticle;
vComplexQuantity SMSPEC.QUANTITY%TYPE := :complexquantity;
vComplexCompQuant SMSPEC.QUANTITY%TYPE := :complexcompquant;
MESSAGE_STR varchar2(250);
begin
if supermag.core.getproc is null then
core_result := supermag.Core.StartSMApp();
end if;
supermag.smdocaddspeciw(vDocID,
vArticle,
vDisplayItem,
vExcisetbl,
vItemGrossWeight,
vPackName,
vQuantity,
vPackStbl,
vValidDate,
vActuallyQuant,
vMoveReason,
vMismatchReason,
vCause,
vProducer,
vItemPrice,
vTotalPrice,
vItemPriceCur,
vTotalPriceCur,
vComplexArticle,
vComplexQuantity,
vComplexCompQuant);
commit;
EXCEPTION
WHEN OTHERS THEN
:MESSAGE_STR := SQLERRM;
end;
supermag.documents.lockdoc
supermag.documents.unlockdoc