Transfer of stock between stores

I want to create a stock transfer form one warehouse to another in the form 6i. I have two fields (1. Warehouse, 2. At the warehouse)

After you save the record for warehouse less quantity but warehouse is not + quantity.

My trigger code is below.

FWID is warehouse ID

TWID is warehouse ID

create or replace trigger STOCKTRNS_AFT_INS

After Insert on stock_transfer

for each line

declare

-local variables here

DATE OF V_SDATE: =: NEW. TRDATE;

NUMBER OF V_INSTOCK;

NUMBER OF V_FWID: =: NEW. FWID;

NUMBER OF V_TWID: =: NEW. TWID;

Start

SELECT COUNT (*)

IN V_INSTOCK

STOCK S

WHERE S.ITID =: NEW. ITÍD

AND S.WID =: NEW. FWID;

IF V_FWID IS NOT NULL THEN

IF V_INSTOCK = 0 THEN

RAISE_APPLICATION_ERROR (-20000,

"Record not found article in stock for the transfer");

ON THE OTHER

-UPDATING OF REGISTRATION...

UPDATE STOCK S

SET S.QTY = S.QTY -: NEW. QTY.

WHERE S.ITID =: NEW. ITÍD

AND S.WID =: NEW. FWID;

END IF;

updated items i

Set i.itcrqty = itcrqty -: new.qty

where i.itid =: new.itid;

ELSIF V_TWID IS NOT NULL THEN

-CASE BACK

IF V_INSTOCK = 0 THEN

-INSERT THE NEW RECORD...

PUT IN LACROSSE

(ITÍD, WID, QTY, LASTINDATE, LASTINQTY)

VALUES

(: NEW.) ITÍD,: NEW. TWID,: NEW. QUANTITY, V_SDATE,: NEW. QTY);

ON THE OTHER

UPDATE STOCK S

SET S.QTY = S.QTY +: NEW. QTY.

WHERE S.ITID =: NEW. ITÍD

AND S.WID =: NEW. TWID;

END IF;

updated items i

Set i.itcrqty = itcrqty +: new.qty

where i.itid =: new.itid;

END IF;

end;

Expert please help me.

If you don't add enough to your warehouse is home then the following code is effective:

create or replace trigger STOCKTRNS_AFT_INS

After Insert on stock_transfer

for each line

declare

-local variables here

DATE OF V_SDATE: =: NEW. TRDATE;

NUMBER OF V_FINSTOCK;

NUMBER OF V_TINSTOCK;

NUMBER OF V_FWID: =: NEW. FWID;

NUMBER OF V_TWID: =: NEW. TWID;

BEGIN

SELECT SUM (DECODE (S.WID,: NEW.)) FWID, S.QTY, 0)), SUM (DECODE (S.WID,: NEW.)) TWID, S.QTY, 0))
IN V_FINSTOCK, V_TINSTOCK
STOCK S
WHERE S.ITID =: NEW. ITÍD
AND S.WID IN (: NEW.) FWID,: NEW. TWID);

IF V_FWID IS NOT NULL AND V_TWID IS NOT NULL THEN

IF V_FINSTOCK< :new.qty="">
RAISE_APPLICATION_ERROR (-20000,' Stock low quantity available: ' | to_char (v_finstock));
ON THE OTHER
UPDATE STOCK S
SET S.QTY = S.QTY -: NEW. QTY.
WHERE S.ITID =: NEW. ITÍD
AND S.WID =: NEW. FWID;

updated items i
Set i.itcrqty = itcrqty -: new.qty
where i.itid =: new.itid;
END IF;

IF NVL(V_TINSTOCK,0) = 0 THEN
PUT IN LACROSSE
(ITÍD, WID, QTY, LASTINDATE, LASTINQTY)
VALUES
(: NEW.) ITÍD,: NEW. TWID,: NEW. QUANTITY, V_SDATE,: NEW. QTY);

RAISE_APPLICATION_ERROR (-20000, 'New amount inserted into the warehouse store');
ON THE OTHER

UPDATE STOCK S
SET S.QTY = S.QTY +: NEW. QTY.
WHERE S.ITID =: NEW. ITÍD
AND S.WID =: NEW. TWID;

updated items i
Set i.itcrqty = itcrqty +: new.qty
where i.itid =: new.itid;

END IF;

ON THE OTHER
RAISE_APPLICATION_ERROR (-20000, 'The V_FWID AND V_TWID MUST BE ENTERED...');
END IF;

END;

I hope it's your absolute requirement.

Tags: Oracle Development

Similar Questions

  • Transfer of files between drives: data loss or corruption?

    1. Is there data loss or corruption during the transfer of files between disks in Windows 7?
    2. What about very large files, gigabytes in size?
    3. Is it possible to check if there is data loss or corruption?

    Creation and verification of a checksum is a file operation.  It doesn't matter where the files are stored.

    It doesn't matter if the source is a CD, a USB flash drive or a hard drive.  As much as the destination is concerned, if you write a large file on a CD, the possibility of error is greater if copy to a USB flash drive or an external hard drive.  Which is why you often see tips to burn at the slowest speed available when writing large critical files as an ISO installation file.

    The only difference between 'copy' and 'move' is this movement copies the file and automatically deletes the original.

    You want to make sure that the file copied correctly before the original has disappeared.  The way to ensure that is to perform a copy operation, check the integrity of the copied file and delete the original.

  • Transfer of Vms between ESXI

    Boa noite colegas,

    Tendo 2 com ESXI hosts.

    Qual seria a best practice by transfer of Vms between estes hosts com ESXI?

    Desde ja Agradea§o a bonitos,.

    Quando nao is tem uma data Vcenter, EU prefer o Vmware converter. Some virtual hd o copiam e depois tem o trabalho recriar o maquina inventario, mas no matter what.

  • transfer of information between callbacks

    So I'm trying to do my a little more general sequence of current test and I came up with this problem.

    I am venturing into the use of reminders that it really cleans my sequences and I do my more general sequence to take into account different products and tests at the same time.  I test devices on a plate (65 k + EHR by plate), and I was using the entry point for execution single-pass with a loop inside my test sequence to loop through all of the devices on my plate.  It's really ugly with pretty much all the information transmitted by the local variables.  After that I wrote using reminders I really see the advantage of going this way.

    Here's my problem.

    Because I don't want the tester to invite the operator whenever the probe station probes a device that I use a reminder that reads the information from the probe station and this information is used as the serial number HAD (actually a message saying that it is a valid and the XY coordinates &).  The convenient location for me to record this information in the file Globals however corresponds to the

    NEITHER TestStand i: Introduction course manual

    Lesson 9- Best practices for the development of Test

    Section b. using the scope of appropriate data

    Course software Version 4.0 July 2007 edition

    Avoid using global variables to file for ongoing communication between the sequences.  Global variables file are appropriate for the data items that you set once in a thread unique portion of the sequence and do not set again.

    So my use of a global file to store information produced during the recall of sequence pre USE clearly violates these guidelines.  In order for me to pass this information to the MainSequence recall where I will carry out the test so it seems I should use parameters instead.  So where did my question

    How to use parameters to pass information between reminders of sequence?  Should I change the process template?  I hope not

    Hi Chilidog,

    It would be my task, I see two ways to achieve without changing the model

    1.) create a local variable when running in the model entry point.
    Pre DUT will create a new variable in the entry point of models in a statement using the
    Runstate.Root.Locals.AsPropertyObject.NewSubProperty ("strMyVariable", PropValType_String, false, "", PropOption_DoNothingIfExists ")
    then in another stage access via PropertyObject and add the new value.

    Note: This also works with containers

    Overall access through the property object in the same way and get the value.

    2.) use a queue.
    For more information, use this thread
        http://forums.NI.com/T5/NI-TestStand/generating-multiple-reports-in-subdirectories-with-nested/m-p/1...

    hope this helps

    Jürgen

  • Transfer of NFC between 2 phones

    I ' ts possible to transfer video between 1 Xperia V and 1 Xperia M via NFC?
    Do I need a specific application?
    I couldn't find an option to do so.
    Any comment is welcome.

    http://Userguide.sonymobile.com/referrer.php?region=global-en&product=Xperia-m#! NFC.html

  • Cannot transfer app updated between devices.

    I can no longer download updates app on my mac using itunes and then transfer these updates on my other devices. I have very limited bandwidth and cannot afford to download the same updates on two iphones, ipad and mac. Is there a solution?

    After the introduction of Apple App clarified in iOS 9.2, it's no longer possible o update your applications on a device, transfer updates to iTunes, then sync our other devices with these versions. With the thinning App, versions uploaded on any given device can only be used on this device.

    You must download the updates of iTunes, then sync your devices with versions of pants.

  • I have a design program on my iMac and Air. I want to transfer a file between the two, but it's in a format that it cannot open any applications. Can I transfer it somehow between the two?

    I have a version software Punch Home Design compete 17.5 on both my iMac and my Air.It saves files in my office as a .dxf file. I want to transfer the file to my Air, but nothing opens a .dxf file, including the Dropbox App Home Design is without help. Is it possible to just connect the two computers and share the file? It offers 3D features that I want to show a customer without making them come to my office and look at my big mac. The two computers are on 10.11.3, so what counts.

    I don't understand how a program that works and which saves .dxf files can open them but CADintosh can open the .dxf files.

  • Pairing Bluetooth or transfer of work between iPhone 6s and Macbook Pro 2014

    Of course I have my MacBook on El Capitan, and the transfer enabled on both devices... Trying to pair of Mac, he normally asks me if the code is correct on iPhone... I click Yes then it says connected on Mac for 10 seconds approximately, but on the iPhone, it is not connected. When he's in "My devices" on mac, I double-click on and then it is not again ask code, it says right on my Macbook "the network is unavailable. Make sure that network access is enabled. When I try to connect from the iPhone, it says "Device not supported" or "Login failed. Make sure that the device is turned on and in range. I know that for the transfer matching is not necessary, however, when I type an email or a note, he just doesn't show on the device in the face even though I followed the instructions, of course... ! I would be really happy if someone could help me with this problem. Thanks in advance!

    Kustrio wrote:

    ... I know that for the transfer, the matching is not necessary...

    Not only the pairing is unnecessary, it is not possible to connect an iPhone with a computer except for use as a personal hotspot.

    What follows may have something that will help with transfer issues: for help using continuity with your iOS device or your Mac - Apple Support

  • DK 31 Pier transfer of data between the computer of the Z1

    31 Dk can transfer data to the computer you to the Z1 and Z1 to computer you or this loading dock is only intended to load?

    And if it's possible transfer of data, it can be if.connecting of damage to computer?

    Hi GustavoSR91,

    Welcome to the community! Since you are new, please make sure that you have checked our Forum.

    I can advise that this device does not allow this feature, load only the functions.

    I hope this helps.

    Don't forget to mark messages that responds to the topic as accepted Solution.
    If you find any useful position, press the laurels.
    What are your thoughts on this forum? Let us know by making this short film survey.

  • Transfer of data between 7290's BlackBerry Smartphones

    I bought a 2nd 7290 because I couldn't solve the problem I had to lose the sound.  How can I transfer the data off the old unit to the new.  It is a personal phone not connected to a wireless network.  Also the new purchase does not show bluetooth icon.

    You can download any version of the Desktop Manager. That is not the model of your device. The latest version is 4.7.

  • Transfer of registration between two Adobe IDS / accounts

    Hi, I have two products under the identification code Adobe I would like to move them to a new account for consistency within an organization. Can I simply record the serial numbers of the products for the destination account, or should I disable their first account somehow?

    Please refer to transfer a license of Adobe product

    Concerning

    Stéphane

  • transfer credit stock of adobe to the team

    I buy a subscription for shares Adobe as an administrator but am unable to allocate to join my team.

    Any ideas?

    Hello

    Was it a recent purchase?

    I see that you have an individual subscription of Stock, but this can be attributed to your team.

    If you need a subscription of Stock for your team you can 'add licenses' via the administration console - manage your cloud of Adobe Creative for the composition of teams

    Kind regards

    Bev

  • Transfer of projects between Macs

    Hello

    I mainly work with the film on PP CS6.

    I however produced a podcast/radio feature and I started to cut on my MacBookPro in hearing CS6 while always away on assignment.

    Now that I'm back, I want to open the project on my main machine (speakers, two screens, integration with PP etc.)

    I had a problem with the audio to burst, it is solved by import parameters of the Application of the MBP in place.

    Now, I have a problem with my edit. When I start to reconnect the media with the content of my main studio project disc, no clips online. Mounting the same aspect in the time line, but everything seems to point to the media wring.

    Is there a foolproof way to do this? Otherwise I'll have to fight with the edict on my MBP.

    Thanks for any help.

    Andy

    Hi Andy,.

    How do you transfer your session and the media the MBP to the desktop?  Is it stored on a flash drive or external, copied on a network share, or you perform an export of the session and its media within hearing?

    The simplest and easiest method to transfer from one system to the other would be to open the multitrack session on your MBP, select file > export > Session and export it to a network share or the flash player.  Don't forget to check the box titled "backup copies of associated files" which will bring together all the media used in your session with your exported session and relink the session to use these files.

    Durin

  • Transfer of licence between PC and Mac

    I had Adobe Web Premium for many years now, and I just bought a new Mac so I was wondering if there is a way to transfer my license from my pc to my mac without getting Creative Cloud. Thank you!

    Please see:

    https://helpx.Adobe.com/x-productkb/policy-pricing/Exchange-product-language-OS.html

    I hope this helps.

    Kind regards
    Megha Rawat

  • Transfer of indesign between laptops

    Hello

    I used to run indesign CS5 on my old laptop.  Now, I have a new laptop and want to transfer indesign on it.  I installed indesign CC2014 as this seems to be the only version available from the cloud (?) of Adobe.

    However when I try to activate using the serial number provided initially I get the error "the serial number you entered is invalid.  Please try again.  If the problem persists, contact customer service.

    Online chat Adobe told me to post here for a solution.

    I would like a link to download indesign CS5 that works with my existing serial number or a new serial number that are compatible with the version CC2014.

    Any help would be appreciated.

    Thank you

    Lee

    https://helpx.Adobe.com/Creative-Suite/KB/CS5-product-downloads.html

    Note that CS5 is not supported on the new Mac or Windows 8 or 10.

Maybe you are looking for

  • Can no longer drag columns to rearrange them in

    I used to be able to drag columns in my spreadsheet to reorganize, but now they come right back to where they were originally and the other columns do not move to make room as they did.  Advice or advice on what I might have accidentally changed?

  • C309a get HP-CUE-scanning flow component has encountered a problem and needs to close

    I am running Windows xp sp3.  I meet it when scanning, other functions of the printer are working fine.  It also worked fine 2 weeks ago.  Does anyone have any suggestions. I downloaded the latest version of the HP Solution Center already.

  • How to get more themes online, to use as a wallpaper?

    Original title: wallpaper How to get more themes online, to use as a wallpaper? I would like to know how. Thank you, with best regards,Ana Luisa 22

  • Keyboard Lenovo 8821 - where is print screen button?

    Hello I have a Lenovo 8821 keyboard. The print screen key is not in the usual place (next to F12) and I can't anywhere else. In its place is a simply labeled "Fn" key and next to it, a touch of break. I'm desperate to get the job print screen - someo

  • AB infected apps

    Hi, I tried to download apps from ab to my pc (win 7) and abfile & abdocs are infected with malicious software. Does anyone else have this problem?