Subversion Repositories SmartDukaan

Rev

Rev 37604 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37604 Rev 37697
Line 362... Line 362...
362
 
362
 
363
    /**
363
    /**
364
     * Price an item moving out of one of our own warehouses: it keeps the price of the vendor it was
364
     * Price an item moving out of one of our own warehouses: it keeps the price of the vendor it was
365
     * originally bought from, so the sending warehouse's own circular is not consulted.
365
     * originally bought from, so the sending warehouse's own circular is not consulted.
366
     *
366
     *
367
     * <p>Answers for a single unit, which is the price the oldest stock moves at. If a larger quantity is
367
     * <p>Answers with the price the oldest stock moves at, together with how many units this order can take and
368
     * then entered and it would run past that vendor's stock into another's, creating the order says so and
368
     * what is holding the rest, so the quantity can be chosen correctly on screen rather than discovered on submit.
369
     * names how many can move at this price - the quantity is not known yet at this point.
369
     * External vendors are untouched by this and still answer with a plain catalog price.
370
     */
370
     */
371
    private VendorPriceCircularModel internalMovementPrice(Supplier vendor, Item item)
371
    private VendorPriceCircularModel internalMovementPrice(Supplier vendor, Item item)
372
            throws ProfitMandiBusinessException {
372
            throws ProfitMandiBusinessException {
373
        InternalMovementAllocationModel price = internalMovementPricingService.resolvePrice(vendor, item.getId(), 1);
373
        return internalMovementPricingService.describeAvailability(vendor, item);
374
        return new VendorPriceCircularModel(0, vendor.getId(), item.getCatalogItemId(), price.getTransferPrice(),
-
 
375
                price.getDealerPrice(), price.getMop(), LocalDate.now(),
-
 
376
                VendorCatalogPricingStatus.APPROVED.name());
-
 
377
    }
374
    }
378
 
375
 
379
    @RequestMapping(value = "/vendorItem", method = RequestMethod.GET)
376
    @RequestMapping(value = "/vendorItem", method = RequestMethod.GET)
380
    public String getItemPricing(Model model, @RequestParam int vendorId, @RequestParam String query) throws Exception {
377
    public String getItemPricing(Model model, @RequestParam int vendorId, @RequestParam String query) throws Exception {
381
        String query1 = query.toLowerCase();
378
        String query1 = query.toLowerCase();