• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
雨打浮萍
博客园    首页    新随笔    联系   管理    订阅  订阅

AX中 多公司交易,物料主表价格维护,

1、需求:

         集团公司和子公司,采用的公司物料方法创建分公司物料,集团公司对分公司来说就是供应商,分公司对集团就是客户。

      集团公司的物料主表的销售价,对应分公司帐套的物料主表的采购价。集团公司的物料主表销售价格一旦更新,分公司的采购价也相应更新,保持一致。

 2、实现方式:

  
//写个类方法
void update(DataAreaId _DataAreaId,itemid itemid)
{

    inventtable inventtable;
    inventtable inventtable1;
    xtTDataArea  xtTDataArea;
    InventTableModule InventTableModule;
    InventTableModule InventTableModule1;
    int price;
    itemid _itemid;

//总部帐套
 changecompany('xx')
    {
        select InventTableModule where InventTableModule.ItemId == itemid   &&   InventTableModule.moduletype == 1;
        price=InventTableModule.Price;
        _itemid=InventTableModule.ItemId;

     }

//分公司帐套

  changecompany(_DataAreaId)

    {
        ttsbegin;
        select forupdate InventTableModule1 where InventTableModule1.ItemId ==_itemid
         && InventTableModule1.ModuleType == 2 ;

         if (InventTableModule1)
         {
           InventTableModule1.Price =price;
            InventTableModule1.update();
         }
        
         ttscommit;
     }
}

 

 3、调用方式

 

 static void xtTDataArea(Args _args)
{
 xtTDataArea_update xtTDataArea_update;
 xtTDataArea  xtTDataArea;
;
  //初始化类
 xtTDataArea_update =  new xtTDataArea_update();
 while select xtTDataArea  where xtTDataArea.id != 'xx'
 
    {
 
         xtTDataArea_update.update(xtTDataArea.Id,'1011017001');


   }
         info("OK");

}

 

 

 

 

 

 

 

 

 

  

posted @ 2009-07-17 12:25  雨打浮萍  阅读(492)  评论(1)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3