Показать сообщение отдельно
Старый 15.11.2007, 14:55   #7  
Logger is offline
Logger
Участник
Лучший по профессии 2015
Лучший по профессии 2014
 
3,971 / 3267 (116) ++++++++++
Регистрация: 12.10.2004
Адрес: Москва
Записей в блоге: 2
X++:
public server WMSOrderTrans split(InventQty splitQty)
{
    WMSOrderTrans   WMSOrderTrans;
    ;
    if ((splitQty <= 0) || (splitQty >= this.qty))
        throw(error("@SYS25644"));
    ttsbegin;
    WMSOrderTrans.data(this);
    WMSOrderTrans.qty = splitQty;
    WMSOrderTrans.expectedExpeditionTime = this.expectedExpeditionTime * splitQty / this.qty;
    WMSOrderTrans.volume = this.volume * splitQty / this.qty;
    this.qty -= splitQty;
    this.expectedExpeditionTime -= WMSOrderTrans.expectedExpeditionTime;
    this.volume -= WMSOrderTrans.volume;
    this.doUpdate();
    WMSOrderTrans.doInsert();
    ttscommit;
    return WMSOrderTrans;
}