erp_stok_olustur
Create new stock items in the ERP system with required codes and names, then generate direct links to view the created items.
Instructions
ERP sisteminde yeni stok kartı oluşturur. oluşturduktan sonra https://erp.aaro.com.tr/Stok/Kalem?id={id} kullanıcıya bu linki sunabilir
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| StokKodu | Yes | Stok kodu (zorunlu) | |
| StokAdi | Yes | Stok adı (zorunlu) | |
| StokKisaKodu | No | Stok kısa kodu | |
| StokKisaAdi | No | Stok kısa adı | |
| TipID | No | Stok tipi (varsayılan: 105001) | |
| SubeID | No | Şube ID (varsayılan: 1) | |
| SirketID | No | Şirket ID (varsayılan: 1) | |
| Brm1ID | No | Birim ID (varsayılan: 1 - Adet) | |
| StokMuhasebeID | No | Muhasebe ID | |
| Durum | No | Aktif/Pasif durumu (varsayılan: true) |
Implementation Reference
- src/index.ts:405-431 (handler)Handler function for creating a new ERP stock item (stok oluştur). Takes parameters like StokKodu, StokAdi etc., constructs payload and calls /api/Stok POST. This is the core implementation logic for the 'erp_stok_olustur' tool.private async createStok(args: any) { const { StokKodu, StokAdi, StokKisaKodu, StokKisaAdi, TipID, SubeID, SirketID, Brm1ID, StokMuhasebeID, Durum, ...otherParams } = args; if (!StokKodu || !StokAdi) { throw new Error('StokKodu ve StokAdi gerekli'); } const stokData = { StokID: -1, // Yeni kayıt için -1 StokKodu, StokAdi, StokKisaKodu: StokKisaKodu || StokKodu, StokKisaAdi: StokKisaAdi || StokAdi, TipID: TipID || '105001', // Varsayılan stok tipi SubeID: SubeID || '1', SirketID: SirketID || '1', Brm1ID: Brm1ID || '1', // Varsayılan birim: Adet StokMuhasebeID: StokMuhasebeID || '201', Durum: Durum !== undefined ? Durum : true, ...otherParams }; return await this.callErpApi('/api/Stok', 'POST', { KayitTipi: '1', // Yeni kayıt body: stokData }); }
- src/index.ts:236-237 (registration)Registration of the 'createStok' handler in the special handlers switch statement. Tool configs in tools.json likely map 'erp_stok_olustur' to handler: 'createStok'.return await this.createStok(args);
- src/index.ts:427-431 (helper)Uses the callErpApi helper to perform the actual API call to create stock.return await this.callErpApi('/api/Stok', 'POST', { KayitTipi: '1', // Yeni kayıt body: stokData }); }
- src/index.ts:167-174 (registration)Dynamic tool registration and listing from loaded tools.json config, where 'erp_stok_olustur' is expected to be defined with handler: 'createStok'.const tools = Object.entries(this.toolsConfig).map(([name, config]) => ({ name, description: config.description, inputSchema: config.inputSchema, })); return { tools }; });