This topic is locked
[SOLVED]

 inventory - control of stock

4/30/2010 10:10:49 PM
PHPRunner General questions
O
onlline author

Need Help
Table (product)
id

name

amount

value
Table (goods receipt)
id

name

amount
need when you receive the product in the second table is added and updated the field (quantity) of Table (Product)
for inventory control of product
looked all over forums but do not have anything like that,

J
Jane 5/4/2010

Hi,
use After record added event on the Eventstab for this purpose.

Here is just a sample:

global $dal;

$product = $dal->Table("product");

if ($values["amount"])

{

$product->Param["name"] = $values["name"];

$product->Value["amount"] = $values["amount"];

$product->Update();

}



More info here:

http://xlinesoft.com/phprunner/docs/data_access_layer.htm

O
onlline author 5/5/2010



Hi,
use After record added event on the Eventstab for this purpose.

Here is just a sample:

global $dal;

$product = $dal->Table("product");

if ($values["amount"])

{

$product->Param["name"] = $values["name"];

$product->Value["amount"] = $values["amount"];

$product->Update();

}



More info here:

http://xlinesoft.com/phprunner/docs/data_access_layer.htm


Thanks for the help,

Almost, but I need the sum

Table of (goods receipt) amount with the sum of a (product)
example
10 have received 20 total 30 in the product table,
the example made it 'only the value received in the product table, did the sum,
Obrigado pela ajuda,

Quase, mas preciso da soma

da Table (goods receipt) amount com a soma da tabela (product)
exemplo
tenho 10 recebi 20 total 30 na tabela product,
o exemplo fez com que ficasse somente o valor recebido na tabela product, não fez a soma,

A
ann 5/6/2010

Leonardo,
To sum the amounts of "goods receipt" table and "product" table add the following code to the After record added event on the Events tab

$sql="update product set amount=amount+".$values["amount"]." where name='".$values["name"]."'";

customQuery($sql);
O
onlline author 5/8/2010



Leonardo,
To sum the amounts of "goods receipt" table and "product" table add the following code to the After record added event on the Events tab

$sql="update product set amount=amount+".$values["amount"]." where name='".$values["name"]."'";

customQuery($sql);



thank Jane and Ann.
what my issue was resolved as follows.
$sql="update product set amount=amount+".$values["amount"]." where name='".$values["name"]."'";

customQuery($sql);