ADempiereとPentaho、、、

無料のERP(販売管理、在庫管理、顧客管理)パッケージ"ADempiere"と無料のBI(経営分析ソフト)"Pentaho"が連携できたらおもしくろくね〜?と思っている人が気ままに書いているサイトです。あとADempiereをFileMakerっぽく使う方法も掲載してます。
お知らせ
・ADempiereの初心者向け勉強会が行われています。参加希望者および詳細内容はここを参照ください。
CodeZineOSSのERP「ADempiere」のフレームワークを利用した工程管理表の作成という記事を掲載しました。この記事ではApplicationDictionaryとSQLで工程作業実績入力&集計を作ってみたで紹介している内容を行います。

スポンサーサイト

上記の広告は1ヶ月以上更新のないブログに表示されています。新しい記事を書く事で広告が消せます。
[ --/--/-- --:-- ] スポンサー広告 | TB(-) | CM(-)

ADempiereのサービス化(Win限定)

毎回RUN_Server2.batを実行するのはメンドクサイのでadempiereをサービス化する方法を紹介。(Win限定)


DOSプロンプトにて以下を実行する。

cd C:\Adempiere\utils\windows
Adempiere_Service_Install.bat

終了。
[ 2012/03/14 19:22 ] ERP、ERPとは ADempiere | TB(0) | CM(0)

Pentahoのインストール設定

MySQL環境では(たぶんPostgresql環境でも?)下記のURLの設定手順ではBIサーバ8h放置プレーで以下のエラーが表示される。
http://www.prashantraju.com/projects/pentaho/

ERROR [JDBCExceptionReporter] No operations allowed after connectio
n closed.Connection was implicitly closed by the driver.

理由については下記のP49参照。


対処方法は

C:\biserver-ce-x.x.x-stable\biserver-ce\pentaho-solutions\system\hibernate\mysql5.hibernate.cfg.xmlの<session-factory>配下に以下を記載。
<property name="hibernate.c3p0.acquire_increment">3</property>
<property name="hibernate.c3p0.idle_test_period">14400</property>
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">75</property>
<property name="hibernate.c3p0.max_statements">0</property>
<property name="hibernate.c3p0.timeout">25200</property>
<property name="hibernate.c3p0.preferredTestQuery">select 1</property>
<property name="hibernate.c3p0.testConnectionOnCheckout">true</property>

下記ディレクトリ配下にC3P0(c3p0-x.x.x.x.jar)を保存する。
C:\biserver-ce-x.x.x-stable\biserver-ce\tomcat\lib
[ 2012/03/13 15:14 ] BI、BIとは Pentaho | TB(0) | CM(0)

RUN_Server2.bat実行時のプロンプト表示内容

ADempiereをインストールしたあと、正しくインストールされたか不安かと思いますが、正常にインストールされた際のRUN_Server2.bat実行時のプロンプト表示内容の動画を下記にアップしました。

正しくインストールされたかどうか確認されたい方はご参考ください。

[広告] VPS


[ 2012/03/08 19:44 ] ERP、ERPとは ADempiere | TB(0) | CM(0)

在庫ウィンドの作成

ADempeireがデフォルトで持っている「製品情報」という名の在庫表は、商品にロットや保障日付等の属性を設定した場合、検索しにくいという弱点があるので、それを改良した「在庫ウィンド」なるものを作成してみる。

1.以下のSQLを実行し、VIEWを作成する。
(下記ビューはadempiere.rv_storageを参考にしています)

CREATE OR REPLACE VIEW adempiere.rv_jastorage AS
SELECT
s.ad_client_id, s.ad_org_id, s.isactive,s.created,s.createdby,s.updated,s.updatedby,
s.m_product_id, p.value, p.name, p.description, p.upc, p.sku, p.c_uom_id,
p.m_product_category_id, p.classification, p.weight, p.volume, p.versionno,
p.guaranteedays, p.guaranteedaysmin, s.m_locator_id, l.m_warehouse_id,
l.x, l.y, l.z, s.qtyonhand, s.qtyreserved, s.qtyonhand - s.qtyreserved AS qtyavailable,
s.qtyordered, s.datelastinventory, s.m_attributesetinstance_id,
asi.m_attributeset_id, asi.serno, asi.lot, asi.m_lot_id, asi.guaranteedate,
adempiere.daysbetween(asi.guaranteedate::timestamp with time zone,
adempiere.getdate()) AS shelflifedays,
adempiere.daysbetween(asi.guaranteedate::timestamp with time zone,
adempiere.getdate())::numeric - p.guaranteedaysmin AS goodfordays,
CASE
WHEN COALESCE(p.guaranteedays, 0::numeric) > 0::numeric THEN round(adempiere.daysbetween(asi.guaranteedate::timestamp with time zone, adempiere.getdate())::numeric / p.guaranteedays * 100::numeric, 0)
ELSE NULL::numeric
END AS shelfliferemainingpct
FROM adempiere.m_storage s
JOIN adempiere.m_locator l ON s.m_locator_id = l.m_locator_id
JOIN adempiere.m_product p ON s.m_product_id = p.m_product_id
LEFT JOIN adempiere.m_attributesetinstance asi ON s.m_attributesetinstance_id = asi.m_attributesetinstance_id;

2.下記を参考にadempiere.rv_jastorageのウィンド、メニュー作成する。
http://codezine.jp/article/detail/6367?p=3

※ 「テーブルとカラム」ウィンドウで"ビュー"にチェックを入れてください。
すると以下のように在庫ウィンドが作成されます。
在庫ウィンド

なお、余計なカラムはApplication Dictionaryで削ってください。
「ウィンド、タブ&フィールド」ウィンドの"フィールド連続番号"タブで表示するフィールドを選択できます。(表示したくないカラムを左側に移動してやればOKです。表示順位も変更できます。)
フィールド連続番号
[ 2012/03/03 20:49 ] ERP、ERPとは ADempiere | TB(0) | CM(0)

保障日付の挙動を調べてみた

ADempiereでは[製品管理]⇒[製品属性]⇒[属性セット]で保障日付を設定できます。
(このウィンドでロット、シリアルナンバー等も設定できます)
属性セット

※ 上記の設定では保障日付のみを付与し必須に設定しています。
  そのため保障日付を設定した商品を入荷した時、保障日付が設定されないとエラーメッセージが出力されますが、保障日付を設定した商品を生産(Production)ウィンドで生産したとき、保障日付を設定しなくても生産できます。(バグ or 仕様? ちなみにソースレベルでは入荷プロセスでは属性のマンダトリーチェックをしていますが(org.compiere.modelMInOut.javaの1147行目あたり)、生産(org.compiere.process.M_Production_Run)は属性のマンダトリーチェックしていない)

で、設定した保障日付が過ぎた場合、どうなるか調べてみた。

まず製品情報ウィンドの表示。
製品情報

で、上記画面の下側の丸印のボタンをクリックし、「すべてを表示」にチェックをいれると下記のように表示されます。(すなわち、保障日付がすぎた商品は赤字で表示される)
属性インスタンス

ちなみに保障日付をすぎた商品が出荷できるか調べたら、何の警告もなく出荷できました。
出荷
[ 2012/03/02 20:40 ] ERP、ERPとは ADempiere | TB(0) | CM(0)
プロフィール

Author:cozy56
メルアドは、エル ドット シー オー ゼット ワイ 56 アットマーク ジーメール ドット コム

なお旧ブログはhttp://plaza.rakuten.co.jp/cozy56

カレンダー
04 | 2012/05 | 06
- - 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31 - -